@fileverse-dev/fortune-react 1.0.2-mod-20-patch-2 → 1.0.2-mod-25
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/ConditionFormat/index.d.ts +1 -1
- package/dist/components/ContextMenu/index.d.ts +1 -0
- package/dist/components/DataVerification/getDisplayedRangeTxt.d.ts +2 -0
- package/dist/components/Dialog/index.d.ts +1 -0
- package/dist/components/Workbook/api.d.ts +2 -1048
- package/dist/components/Workbook/index.d.ts +0 -1046
- package/dist/hooks/useDialog.d.ts +1 -1
- package/dist/index.css +134 -88
- package/dist/index.esm.css +134 -88
- package/dist/index.esm.js +768 -516
- package/dist/index.js +768 -515
- package/dist/index.umd.css +134 -88
- package/dist/index.umd.js +74030 -6443
- package/dist/index.umd.min.css +1 -1
- package/dist/index.umd.min.js +42 -3
- package/package.json +4 -2
package/dist/index.esm.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
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, 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, updateCell, editSheetName, cancelActiveImgItem, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, addSheet,
|
|
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, 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, 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, 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';
|
|
5
|
+
import { cn, IconButton, Button as Button$1, TextField, Checkbox, Divider as Divider$2, Table, TableHeader, TableRow, TableHead, TableBody, TableCell, Select as Select$1, SelectTrigger, SelectValue, SelectContent, SelectItem as SelectItem$1, LucideIcon } from '@fileverse/ui';
|
|
5
6
|
import regeneratorRuntime from 'regenerator-runtime';
|
|
7
|
+
import Tippy from '@tippyjs/react';
|
|
6
8
|
|
|
7
9
|
function _arrayLikeToArray(r, a) {
|
|
8
10
|
(null == a || a > r.length) && (a = r.length);
|
|
@@ -1219,7 +1221,8 @@ var Dialog = function Dialog(_ref) {
|
|
|
1219
1221
|
onCancel = _ref.onCancel,
|
|
1220
1222
|
children = _ref.children,
|
|
1221
1223
|
containerStyle = _ref.containerStyle,
|
|
1222
|
-
contentStyle = _ref.contentStyle
|
|
1224
|
+
contentStyle = _ref.contentStyle,
|
|
1225
|
+
title = _ref.title;
|
|
1223
1226
|
var _useContext = useContext(WorkbookContext),
|
|
1224
1227
|
context = _useContext.context;
|
|
1225
1228
|
var _locale = locale(context),
|
|
@@ -1228,35 +1231,43 @@ var Dialog = function Dialog(_ref) {
|
|
|
1228
1231
|
className: "fortune-dialog",
|
|
1229
1232
|
style: containerStyle
|
|
1230
1233
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1231
|
-
className: "
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
+
className: cn("flex items-center justify-end border-b color-border-default py-3 px-6", {
|
|
1235
|
+
"justify-between": title
|
|
1236
|
+
})
|
|
1237
|
+
}, title && /*#__PURE__*/React.createElement("div", {
|
|
1238
|
+
className: "text-heading-sm"
|
|
1239
|
+
}, title), /*#__PURE__*/React.createElement(IconButton, {
|
|
1240
|
+
icon: "X",
|
|
1241
|
+
variant: "ghost",
|
|
1234
1242
|
onClick: onCancel,
|
|
1235
1243
|
tabIndex: 0
|
|
1236
|
-
}, /*#__PURE__*/React.createElement(
|
|
1237
|
-
|
|
1238
|
-
style: {
|
|
1239
|
-
padding: 7,
|
|
1240
|
-
cursor: "pointer"
|
|
1241
|
-
}
|
|
1242
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
1243
|
-
className: "fortune-dialog-box-content",
|
|
1244
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
1245
|
+
className: "px-6 pb-6 pt-4 text-body-sm",
|
|
1244
1246
|
style: contentStyle
|
|
1245
1247
|
}, children), type != null && (/*#__PURE__*/React.createElement("div", {
|
|
1246
|
-
className: "
|
|
1247
|
-
}, type === "ok" ? (/*#__PURE__*/React.createElement(
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
className: "fortune-message-box-button button-primary",
|
|
1248
|
+
className: "px-6 pb-6 flex flex-row gap-2 justify-end"
|
|
1249
|
+
}, type === "ok" ? (/*#__PURE__*/React.createElement(Button$1, {
|
|
1250
|
+
variant: "default",
|
|
1251
|
+
style: {
|
|
1252
|
+
minWidth: "80px"
|
|
1253
|
+
},
|
|
1253
1254
|
onClick: onOk,
|
|
1254
1255
|
tabIndex: 0
|
|
1255
|
-
}, button.confirm), /*#__PURE__*/React.createElement(
|
|
1256
|
-
|
|
1256
|
+
}, button.confirm)) : (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button$1, {
|
|
1257
|
+
variant: "secondary",
|
|
1258
|
+
style: {
|
|
1259
|
+
minWidth: "80px"
|
|
1260
|
+
},
|
|
1257
1261
|
onClick: onCancel,
|
|
1258
1262
|
tabIndex: 0
|
|
1259
|
-
}, button.cancel)
|
|
1263
|
+
}, button.cancel), /*#__PURE__*/React.createElement(Button$1, {
|
|
1264
|
+
variant: "default",
|
|
1265
|
+
style: {
|
|
1266
|
+
minWidth: "80px"
|
|
1267
|
+
},
|
|
1268
|
+
onClick: onOk,
|
|
1269
|
+
tabIndex: 0
|
|
1270
|
+
}, button.confirm))))));
|
|
1260
1271
|
};
|
|
1261
1272
|
|
|
1262
1273
|
var MessageBox = function MessageBox(_ref) {
|
|
@@ -1268,15 +1279,7 @@ var MessageBox = function MessageBox(_ref) {
|
|
|
1268
1279
|
return /*#__PURE__*/React.createElement(Dialog, {
|
|
1269
1280
|
type: type,
|
|
1270
1281
|
onOk: onOk,
|
|
1271
|
-
onCancel: onCancel
|
|
1272
|
-
contentStyle: {
|
|
1273
|
-
width: 300,
|
|
1274
|
-
paddingTop: 20,
|
|
1275
|
-
paddingBottom: 30,
|
|
1276
|
-
display: "flex",
|
|
1277
|
-
justifyContent: "center",
|
|
1278
|
-
alignItems: "center"
|
|
1279
|
-
}
|
|
1282
|
+
onCancel: onCancel
|
|
1280
1283
|
}, children);
|
|
1281
1284
|
};
|
|
1282
1285
|
|
|
@@ -1350,8 +1353,7 @@ var SearchReplace = function SearchReplace(_ref) {
|
|
|
1350
1353
|
setContext = _useContext.setContext,
|
|
1351
1354
|
refs = _useContext.refs;
|
|
1352
1355
|
var _locale = locale(context),
|
|
1353
|
-
findAndReplace = _locale.findAndReplace
|
|
1354
|
-
button = _locale.button;
|
|
1356
|
+
findAndReplace = _locale.findAndReplace;
|
|
1355
1357
|
var _useState = useState(""),
|
|
1356
1358
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1357
1359
|
searchText = _useState2[0],
|
|
@@ -1360,28 +1362,27 @@ var SearchReplace = function SearchReplace(_ref) {
|
|
|
1360
1362
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
1361
1363
|
replaceText = _useState4[0],
|
|
1362
1364
|
setReplaceText = _useState4[1];
|
|
1363
|
-
var _useState5 = useState(
|
|
1365
|
+
var _useState5 = useState([]),
|
|
1364
1366
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
var _useState7 = useState(
|
|
1367
|
+
searchResult = _useState6[0],
|
|
1368
|
+
setSearchResult = _useState6[1];
|
|
1369
|
+
var _useState7 = useState(),
|
|
1368
1370
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
var _useState9 = useState(),
|
|
1372
|
-
_useState0 = _slicedToArray(_useState9, 2),
|
|
1373
|
-
selectedCell = _useState0[0],
|
|
1374
|
-
setSelectedCell = _useState0[1];
|
|
1371
|
+
selectedCell = _useState8[0],
|
|
1372
|
+
setSelectedCell = _useState8[1];
|
|
1375
1373
|
var _useAlert = useAlert(),
|
|
1376
1374
|
showAlert = _useAlert.showAlert;
|
|
1377
|
-
var
|
|
1375
|
+
var tableContainerRef = useRef(null);
|
|
1376
|
+
var searchInputRef = useRef(null);
|
|
1377
|
+
var replaceInputRef = useRef(null);
|
|
1378
|
+
var _useState9 = useState({
|
|
1378
1379
|
regCheck: false,
|
|
1379
1380
|
wordCheck: false,
|
|
1380
1381
|
caseCheck: false
|
|
1381
1382
|
}),
|
|
1382
|
-
|
|
1383
|
-
checkMode =
|
|
1384
|
-
checkModeReplace =
|
|
1383
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
1384
|
+
checkMode = _useState0[0],
|
|
1385
|
+
checkModeReplace = _useState0[1];
|
|
1385
1386
|
var closeDialog = useCallback(function () {
|
|
1386
1387
|
_.set(refs.globalCache, "searchDialog.mouseEnter", false);
|
|
1387
1388
|
setContext(function (draftCtx) {
|
|
@@ -1416,98 +1417,110 @@ var SearchReplace = function SearchReplace(_ref) {
|
|
|
1416
1417
|
onSearchDialogMoveStart(refs.globalCache, nativeEvent, getContainer());
|
|
1417
1418
|
e.stopPropagation();
|
|
1418
1419
|
}
|
|
1419
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
1420
|
-
className: "
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1420
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
1421
|
+
className: "flex items-center justify-between border-b color-border-default py-3 px-6"
|
|
1422
|
+
}, /*#__PURE__*/React.createElement("h3", {
|
|
1423
|
+
className: "text-heading-sm"
|
|
1424
|
+
}, "Find and replace"), /*#__PURE__*/React.createElement(IconButton, {
|
|
1425
|
+
icon: "X",
|
|
1426
|
+
variant: "ghost",
|
|
1426
1427
|
onClick: closeDialog,
|
|
1427
1428
|
tabIndex: 0
|
|
1428
|
-
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
1429
|
-
name: "close",
|
|
1430
|
-
style: {
|
|
1431
|
-
padding: 7,
|
|
1432
|
-
cursor: "pointer"
|
|
1433
|
-
}
|
|
1434
1429
|
})), /*#__PURE__*/React.createElement("div", {
|
|
1435
|
-
className: "
|
|
1436
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
1437
|
-
id: "searchTab",
|
|
1438
|
-
className: showReplace ? "" : "on",
|
|
1439
|
-
onClick: function onClick() {
|
|
1440
|
-
return setShowReplace(false);
|
|
1441
|
-
},
|
|
1442
|
-
tabIndex: 0
|
|
1443
|
-
}, findAndReplace.find), /*#__PURE__*/React.createElement("span", {
|
|
1444
|
-
id: "replaceTab",
|
|
1445
|
-
className: showReplace ? "on" : "",
|
|
1446
|
-
onClick: function onClick() {
|
|
1447
|
-
return setShowReplace(true);
|
|
1448
|
-
},
|
|
1449
|
-
tabIndex: 0
|
|
1450
|
-
}, findAndReplace.replace)), /*#__PURE__*/React.createElement("div", {
|
|
1451
|
-
className: "ctBox"
|
|
1430
|
+
className: "px-6 pb-6 pt-4"
|
|
1452
1431
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1453
|
-
className: "
|
|
1432
|
+
className: "flex flex-col gap-4"
|
|
1454
1433
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1455
|
-
className: "
|
|
1434
|
+
className: "flex flex-col gap-4"
|
|
1456
1435
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
},
|
|
1436
|
+
id: "searchInput",
|
|
1437
|
+
className: "flex flex-row gap-2 items-center"
|
|
1438
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
1439
|
+
className: "find-replace-label text-heading-xsm"
|
|
1440
|
+
}, findAndReplace.findTextbox, "\uFF1A"), /*#__PURE__*/React.createElement(TextField, {
|
|
1441
|
+
ref: searchInputRef,
|
|
1460
1442
|
className: "formulaInputFocus",
|
|
1461
1443
|
autoFocus: true,
|
|
1462
1444
|
spellCheck: "false",
|
|
1463
1445
|
onKeyDown: function onKeyDown(e) {
|
|
1464
1446
|
return e.stopPropagation();
|
|
1465
1447
|
},
|
|
1448
|
+
onMouseDown: function onMouseDown(e) {
|
|
1449
|
+
var _searchInputRef$curre;
|
|
1450
|
+
if (e.target === searchInputRef.current || ((_searchInputRef$curre = searchInputRef.current) === null || _searchInputRef$curre === void 0 ? void 0 : _searchInputRef$curre.contains(e.target))) {
|
|
1451
|
+
e.stopPropagation();
|
|
1452
|
+
}
|
|
1453
|
+
},
|
|
1466
1454
|
value: searchText,
|
|
1467
1455
|
onChange: function onChange(e) {
|
|
1468
|
-
|
|
1456
|
+
if (e.target.value.length === 0) {
|
|
1457
|
+
setSearchResult([]);
|
|
1458
|
+
}
|
|
1459
|
+
setSearchText(e.target.value);
|
|
1469
1460
|
}
|
|
1470
|
-
})),
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
},
|
|
1461
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
1462
|
+
id: "replaceInput",
|
|
1463
|
+
className: "flex flex-row gap-2 items-center"
|
|
1464
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
1465
|
+
className: "find-replace-label text-heading-xsm"
|
|
1466
|
+
}, findAndReplace.replaceTextbox, "\uFF1A"), /*#__PURE__*/React.createElement(TextField, {
|
|
1467
|
+
ref: replaceInputRef,
|
|
1474
1468
|
className: "formulaInputFocus",
|
|
1475
1469
|
spellCheck: "false",
|
|
1476
1470
|
onKeyDown: function onKeyDown(e) {
|
|
1477
1471
|
return e.stopPropagation();
|
|
1478
1472
|
},
|
|
1473
|
+
onMouseDown: function onMouseDown(e) {
|
|
1474
|
+
var _replaceInputRef$curr;
|
|
1475
|
+
if (e.target === replaceInputRef.current || ((_replaceInputRef$curr = replaceInputRef.current) === null || _replaceInputRef$curr === void 0 ? void 0 : _replaceInputRef$curr.contains(e.target))) {
|
|
1476
|
+
e.stopPropagation();
|
|
1477
|
+
}
|
|
1478
|
+
},
|
|
1479
1479
|
value: replaceText,
|
|
1480
1480
|
onChange: function onChange(e) {
|
|
1481
1481
|
return setReplaceText(e.target.value);
|
|
1482
1482
|
}
|
|
1483
|
-
})))
|
|
1484
|
-
className: "
|
|
1483
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
1484
|
+
className: "flex flex-row gap-2"
|
|
1485
1485
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1486
|
-
|
|
1487
|
-
}, /*#__PURE__*/React.createElement("
|
|
1488
|
-
|
|
1489
|
-
|
|
1486
|
+
className: "find-replace-label"
|
|
1487
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
1488
|
+
className: "flex flex-col gap-2 text-body-sm"
|
|
1489
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1490
|
+
id: "regCheck",
|
|
1491
|
+
className: "flex flex-row gap-2 items-center"
|
|
1492
|
+
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
1493
|
+
className: "border-2",
|
|
1494
|
+
checked: checkMode.regCheck,
|
|
1495
|
+
onCheckedChange: function onCheckedChange(e) {
|
|
1490
1496
|
return setCheckMode("regCheck", e.target.checked);
|
|
1491
1497
|
}
|
|
1492
1498
|
}), /*#__PURE__*/React.createElement("span", null, findAndReplace.regexTextbox)), /*#__PURE__*/React.createElement("div", {
|
|
1493
|
-
id: "
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
}), /*#__PURE__*/React.createElement("span", null, findAndReplace.wholeTextbox)), /*#__PURE__*/React.createElement("div", {
|
|
1500
|
-
id: "caseCheck"
|
|
1501
|
-
}, /*#__PURE__*/React.createElement("input", {
|
|
1502
|
-
type: "checkbox",
|
|
1503
|
-
onChange: function onChange(e) {
|
|
1499
|
+
id: "caseCheck",
|
|
1500
|
+
className: "flex flex-row gap-2 items-center"
|
|
1501
|
+
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
1502
|
+
className: "border-2",
|
|
1503
|
+
checked: checkMode.caseCheck,
|
|
1504
|
+
onCheckedChange: function onCheckedChange(e) {
|
|
1504
1505
|
return setCheckMode("caseCheck", e.target.checked);
|
|
1505
1506
|
}
|
|
1506
|
-
}), /*#__PURE__*/React.createElement("span", null, findAndReplace.distinguishTextbox))
|
|
1507
|
-
|
|
1508
|
-
|
|
1507
|
+
}), /*#__PURE__*/React.createElement("span", null, findAndReplace.distinguishTextbox)), /*#__PURE__*/React.createElement("div", {
|
|
1508
|
+
id: "wordCheck",
|
|
1509
|
+
className: "flex flex-row gap-2 items-center"
|
|
1510
|
+
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
1511
|
+
className: "border-2",
|
|
1512
|
+
checked: checkMode.wordCheck,
|
|
1513
|
+
onCheckedChange: function onCheckedChange(e) {
|
|
1514
|
+
return setCheckMode("wordCheck", e.target.checked);
|
|
1515
|
+
}
|
|
1516
|
+
}), /*#__PURE__*/React.createElement("span", null, findAndReplace.wholeTextbox)))), /*#__PURE__*/React.createElement(Divider$2, {
|
|
1517
|
+
className: "w-full border-t-[1px]"
|
|
1518
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
1519
|
+
className: "flex flex-row gap-2 justify-center items-center mb-4"
|
|
1520
|
+
}, /*#__PURE__*/React.createElement(Button$1, {
|
|
1509
1521
|
id: "replaceAllBtn",
|
|
1510
|
-
|
|
1522
|
+
variant: "secondary",
|
|
1523
|
+
className: "min-w-fit",
|
|
1511
1524
|
onClick: function onClick() {
|
|
1512
1525
|
setContext(function (draftCtx) {
|
|
1513
1526
|
setSelectedCell(undefined);
|
|
@@ -1515,10 +1528,12 @@ var SearchReplace = function SearchReplace(_ref) {
|
|
|
1515
1528
|
showAlert(alertMsg);
|
|
1516
1529
|
});
|
|
1517
1530
|
},
|
|
1518
|
-
tabIndex: 0
|
|
1519
|
-
|
|
1531
|
+
tabIndex: 0,
|
|
1532
|
+
disabled: searchText.length === 0 || replaceText.length === 0
|
|
1533
|
+
}, findAndReplace.allReplaceBtn), /*#__PURE__*/React.createElement(Button$1, {
|
|
1520
1534
|
id: "replaceBtn",
|
|
1521
|
-
|
|
1535
|
+
variant: "secondary",
|
|
1536
|
+
className: "min-w-fit",
|
|
1522
1537
|
onClick: function onClick() {
|
|
1523
1538
|
return setContext(function (draftCtx) {
|
|
1524
1539
|
setSelectedCell(undefined);
|
|
@@ -1528,10 +1543,12 @@ var SearchReplace = function SearchReplace(_ref) {
|
|
|
1528
1543
|
}
|
|
1529
1544
|
});
|
|
1530
1545
|
},
|
|
1531
|
-
tabIndex: 0
|
|
1532
|
-
|
|
1546
|
+
tabIndex: 0,
|
|
1547
|
+
disabled: searchText.length === 0 || replaceText.length === 0
|
|
1548
|
+
}, findAndReplace.replaceBtn), /*#__PURE__*/React.createElement(Button$1, {
|
|
1533
1549
|
id: "searchAllBtn",
|
|
1534
|
-
|
|
1550
|
+
variant: "secondary",
|
|
1551
|
+
className: "min-w-fit",
|
|
1535
1552
|
onClick: function onClick() {
|
|
1536
1553
|
return setContext(function (draftCtx) {
|
|
1537
1554
|
setSelectedCell(undefined);
|
|
@@ -1541,10 +1558,12 @@ var SearchReplace = function SearchReplace(_ref) {
|
|
|
1541
1558
|
if (_.isEmpty(res)) showAlert(findAndReplace.noFindTip);
|
|
1542
1559
|
});
|
|
1543
1560
|
},
|
|
1544
|
-
tabIndex: 0
|
|
1545
|
-
|
|
1561
|
+
tabIndex: 0,
|
|
1562
|
+
disabled: searchText.length === 0
|
|
1563
|
+
}, findAndReplace.allFindBtn), /*#__PURE__*/React.createElement(Button$1, {
|
|
1546
1564
|
id: "searchNextBtn",
|
|
1547
|
-
|
|
1565
|
+
variant: "default",
|
|
1566
|
+
className: "min-w-fit",
|
|
1548
1567
|
onClick: function onClick() {
|
|
1549
1568
|
return setContext(function (draftCtx) {
|
|
1550
1569
|
setSearchResult([]);
|
|
@@ -1552,23 +1571,45 @@ var SearchReplace = function SearchReplace(_ref) {
|
|
|
1552
1571
|
if (alertMsg != null) showAlert(alertMsg);
|
|
1553
1572
|
});
|
|
1554
1573
|
},
|
|
1574
|
+
tabIndex: 0,
|
|
1575
|
+
disabled: searchText.length === 0
|
|
1576
|
+
}, findAndReplace.findBtn))), searchResult.length > 0 && (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider$2, {
|
|
1577
|
+
className: "w-full border-t-[1px] mb-4"
|
|
1578
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
1579
|
+
ref: tableContainerRef,
|
|
1580
|
+
className: "mb-6 table-container max-h-[300px] overflow-y-auto",
|
|
1581
|
+
onMouseDown: function onMouseDown(e) {
|
|
1582
|
+
var _tableContainerRef$cu;
|
|
1583
|
+
if (e.target === tableContainerRef.current || ((_tableContainerRef$cu = tableContainerRef.current) === null || _tableContainerRef$cu === void 0 ? void 0 : _tableContainerRef$cu.contains(e.target))) {
|
|
1584
|
+
var _tableContainerRef$cu2;
|
|
1585
|
+
e.stopPropagation();
|
|
1586
|
+
(_tableContainerRef$cu2 = tableContainerRef.current) === null || _tableContainerRef$cu2 === void 0 ? void 0 : _tableContainerRef$cu2.focus();
|
|
1587
|
+
}
|
|
1588
|
+
},
|
|
1589
|
+
onWheel: function onWheel(e) {
|
|
1590
|
+
e.preventDefault();
|
|
1591
|
+
e.stopPropagation();
|
|
1592
|
+
if (tableContainerRef.current) {
|
|
1593
|
+
tableContainerRef.current.scrollTop += e.deltaY;
|
|
1594
|
+
}
|
|
1595
|
+
},
|
|
1596
|
+
onTouchStart: function onTouchStart(e) {
|
|
1597
|
+
e.stopPropagation();
|
|
1598
|
+
},
|
|
1599
|
+
onTouchMove: function onTouchMove(e) {
|
|
1600
|
+
e.stopPropagation();
|
|
1601
|
+
},
|
|
1555
1602
|
tabIndex: 0
|
|
1556
|
-
},
|
|
1557
|
-
className: "close-button fortune-message-box-button button-default",
|
|
1558
|
-
onClick: closeDialog,
|
|
1559
|
-
tabIndex: 0
|
|
1560
|
-
}, button.close), searchResult.length > 0 && (/*#__PURE__*/React.createElement("div", {
|
|
1603
|
+
}, /*#__PURE__*/React.createElement(Table, {
|
|
1561
1604
|
id: "searchAllbox"
|
|
1562
|
-
}, /*#__PURE__*/React.createElement(
|
|
1563
|
-
className: "
|
|
1564
|
-
}, /*#__PURE__*/React.createElement(
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
1568
|
-
className: "boxItem ".concat(_.isEqual(selectedCell, {
|
|
1605
|
+
}, /*#__PURE__*/React.createElement(TableHeader, {
|
|
1606
|
+
className: "color-bg-secondary"
|
|
1607
|
+
}, /*#__PURE__*/React.createElement(TableRow, null, /*#__PURE__*/React.createElement(TableHead, null, findAndReplace.searchTargetSheet), /*#__PURE__*/React.createElement(TableHead, null, findAndReplace.searchTargetCell), /*#__PURE__*/React.createElement(TableHead, null, findAndReplace.searchTargetValue))), /*#__PURE__*/React.createElement(TableBody, null, searchResult.map(function (v) {
|
|
1608
|
+
return /*#__PURE__*/React.createElement(TableRow, {
|
|
1609
|
+
className: cn(_.isEqual(selectedCell, {
|
|
1569
1610
|
r: v.r,
|
|
1570
1611
|
c: v.c
|
|
1571
|
-
}) ? "
|
|
1612
|
+
}) ? "color-bg-default-selected" : ""),
|
|
1572
1613
|
key: v.cellPosition,
|
|
1573
1614
|
onClick: function onClick() {
|
|
1574
1615
|
setContext(function (draftCtx) {
|
|
@@ -1584,8 +1625,14 @@ var SearchReplace = function SearchReplace(_ref) {
|
|
|
1584
1625
|
});
|
|
1585
1626
|
},
|
|
1586
1627
|
tabIndex: 0
|
|
1587
|
-
}, /*#__PURE__*/React.createElement(
|
|
1588
|
-
|
|
1628
|
+
}, /*#__PURE__*/React.createElement(TableCell, {
|
|
1629
|
+
className: "find-replace-table-cell"
|
|
1630
|
+
}, v.sheetName), /*#__PURE__*/React.createElement(TableCell, {
|
|
1631
|
+
className: "find-replace-table-cell"
|
|
1632
|
+
}, v.cellPosition), /*#__PURE__*/React.createElement(TableCell, {
|
|
1633
|
+
className: "find-replace-table-cell"
|
|
1634
|
+
}, v.value));
|
|
1635
|
+
})))))))));
|
|
1589
1636
|
};
|
|
1590
1637
|
|
|
1591
1638
|
var LinkEditCard = function LinkEditCard(_ref) {
|
|
@@ -2314,13 +2361,14 @@ function useDialog() {
|
|
|
2314
2361
|
var _useContext = useContext(ModalContext),
|
|
2315
2362
|
showModal = _useContext.showModal,
|
|
2316
2363
|
hideModal = _useContext.hideModal;
|
|
2317
|
-
var showDialog = useCallback(function (content, type) {
|
|
2318
|
-
var onOk = arguments.length >
|
|
2319
|
-
var onCancel = arguments.length >
|
|
2364
|
+
var showDialog = useCallback(function (content, type, title) {
|
|
2365
|
+
var onOk = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : hideModal;
|
|
2366
|
+
var onCancel = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : hideModal;
|
|
2320
2367
|
showModal(/*#__PURE__*/React.createElement(Dialog, {
|
|
2321
2368
|
type: type,
|
|
2322
2369
|
onOk: onOk,
|
|
2323
|
-
onCancel: onCancel
|
|
2370
|
+
onCancel: onCancel,
|
|
2371
|
+
title: title
|
|
2324
2372
|
}, content));
|
|
2325
2373
|
}, [hideModal, showModal]);
|
|
2326
2374
|
return {
|
|
@@ -2834,6 +2882,21 @@ var DataVerification = function DataVerification() {
|
|
|
2834
2882
|
}, button.cancel));
|
|
2835
2883
|
};
|
|
2836
2884
|
|
|
2885
|
+
function getDisplayedRangeTxt(context) {
|
|
2886
|
+
var _context$rangeDialog$, _context$rangeDialog;
|
|
2887
|
+
if (context.luckysheet_select_save) {
|
|
2888
|
+
var range = context.luckysheet_select_save[context.luckysheet_select_save.length - 1];
|
|
2889
|
+
return getRangetxt(context, context.currentSheetId, range, context.currentSheetId);
|
|
2890
|
+
}
|
|
2891
|
+
return (_context$rangeDialog$ = (_context$rangeDialog = context.rangeDialog) === null || _context$rangeDialog === void 0 ? void 0 : _context$rangeDialog.rangeTxt) !== null && _context$rangeDialog$ !== void 0 ? _context$rangeDialog$ : "";
|
|
2892
|
+
}
|
|
2893
|
+
|
|
2894
|
+
var datepickerStyles = "\n .datepicker-toggle {\n display: inline-block;\n position: relative;\n width: 100%;\n }\n \n .datepicker-toggle-button {\n opacity: 0.3;\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n width: 16px;\n height: 16px;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxyZWN0IHg9IjMiIHk9IjQiIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgcng9IjIiIHJ5PSIyIj48L3JlY3Q+PGxpbmUgeDE9IjE2IiB5MT0iMiIgeDI9IjE2IiB5Mj0iNiI+PC9saW5lPjxsaW5lIHgxPSI4IiB5MT0iMiIgeDI9IjgiIHkyPSI2Ij48L2xpbmU+PGxpbmUgeDE9IjMiIHkxPSIxMCIgeDI9IjIxIiB5Mj0iMTAiPjwvbGluZT48L3N2Zz4=');\n background-repeat: no-repeat;\n background-position: center;\n pointer-events: none;\n }\n \n .datepicker-input {\n width: 100%;\n padding: 8px 12px;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n font-size: 14px;\n line-height: 1.5;\n color: #1a202c;\n background-color: #fff;\n cursor: pointer;\n }\n \n .datepicker-input::-webkit-calendar-picker-indicator {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n cursor: pointer;\n opacity: 0;\n }\n \n .datepicker-input:focus {\n outline: none;\n border-color: #4299e1;\n box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);\n }\n";
|
|
2895
|
+
if (typeof document !== "undefined") {
|
|
2896
|
+
var styleSheet = document.createElement("style");
|
|
2897
|
+
styleSheet.textContent = datepickerStyles;
|
|
2898
|
+
document.head.appendChild(styleSheet);
|
|
2899
|
+
}
|
|
2837
2900
|
var ConditionRules = function ConditionRules(_ref) {
|
|
2838
2901
|
var type = _ref.type;
|
|
2839
2902
|
var _useContext = useContext(WorkbookContext),
|
|
@@ -2847,12 +2910,23 @@ var ConditionRules = function ConditionRules(_ref) {
|
|
|
2847
2910
|
protection = _locale.protection,
|
|
2848
2911
|
generalDialog = _locale.generalDialog;
|
|
2849
2912
|
var _useState = useState({
|
|
2850
|
-
textColor: "#
|
|
2851
|
-
cellColor: "#
|
|
2913
|
+
textColor: "#FFFFFF",
|
|
2914
|
+
cellColor: "#D82E2A"
|
|
2852
2915
|
}),
|
|
2853
2916
|
_useState2 = _slicedToArray(_useState, 2),
|
|
2854
2917
|
colorRules = _useState2[0],
|
|
2855
2918
|
setColorRules = _useState2[1];
|
|
2919
|
+
var dataSelectRange = useCallback(function (selectType) {
|
|
2920
|
+
hideDialog();
|
|
2921
|
+
setContext(function (ctx) {
|
|
2922
|
+
ctx.conditionRules.textColor.color = colorRules.textColor;
|
|
2923
|
+
ctx.conditionRules.cellColor.color = colorRules.cellColor;
|
|
2924
|
+
ctx.rangeDialog.show = true;
|
|
2925
|
+
ctx.rangeDialog.type = selectType;
|
|
2926
|
+
ctx.rangeDialog.rangeTxt = ctx.conditionRules.rulesValue;
|
|
2927
|
+
ctx.rangeDialog.singleSelect = true;
|
|
2928
|
+
});
|
|
2929
|
+
}, [colorRules.cellColor, colorRules.textColor, hideDialog, setContext]);
|
|
2856
2930
|
var close = useCallback(function (closeType) {
|
|
2857
2931
|
if (closeType === "confirm") {
|
|
2858
2932
|
setContext(function (ctx) {
|
|
@@ -2921,17 +2995,16 @@ var ConditionRules = function ConditionRules(_ref) {
|
|
|
2921
2995
|
ctx.rangeDialog.rangeTxt = "";
|
|
2922
2996
|
});
|
|
2923
2997
|
}, []);
|
|
2998
|
+
var titleType = type === "top10_percent" ? "top10" : type === "last10_percent" ? "last10" : type;
|
|
2924
2999
|
return /*#__PURE__*/React.createElement("div", {
|
|
2925
3000
|
className: "condition-rules"
|
|
3001
|
+
}, !["aboveAverage", "belowAverage"].includes(type) && (/*#__PURE__*/React.createElement("div", {
|
|
3002
|
+
className: "flex flex-col"
|
|
2926
3003
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2927
|
-
className: "condition-rules-
|
|
2928
|
-
}, conditionformat["conditionformat_".concat(
|
|
2929
|
-
className: "
|
|
2930
|
-
},
|
|
2931
|
-
className: "condition-rules-inpbox"
|
|
2932
|
-
}, /*#__PURE__*/React.createElement("input", {
|
|
2933
|
-
className: "condition-rules-input",
|
|
2934
|
-
type: "text",
|
|
3004
|
+
className: "condition-rules-value text-heading-xsm"
|
|
3005
|
+
}, conditionformat["conditionformat_".concat(titleType, "_title")]), (type === "greaterThan" || type === "lessThan" || type === "equal" || type === "textContains") && (/*#__PURE__*/React.createElement("div", {
|
|
3006
|
+
className: "w-full"
|
|
3007
|
+
}, /*#__PURE__*/React.createElement(TextField, {
|
|
2935
3008
|
value: context.conditionRules.rulesValue,
|
|
2936
3009
|
onChange: function onChange(e) {
|
|
2937
3010
|
var value = e.target.value;
|
|
@@ -2940,12 +3013,11 @@ var ConditionRules = function ConditionRules(_ref) {
|
|
|
2940
3013
|
});
|
|
2941
3014
|
}
|
|
2942
3015
|
}))), type === "between" && (/*#__PURE__*/React.createElement("div", {
|
|
2943
|
-
className: "
|
|
3016
|
+
className: "w-full flex gap-2 items-center"
|
|
2944
3017
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2945
|
-
className: "
|
|
2946
|
-
}, /*#__PURE__*/React.createElement(
|
|
2947
|
-
|
|
2948
|
-
type: "text",
|
|
3018
|
+
className: "w-full"
|
|
3019
|
+
}, /*#__PURE__*/React.createElement(TextField, {
|
|
3020
|
+
placeholder: "From",
|
|
2949
3021
|
value: context.conditionRules.betweenValue.value1,
|
|
2950
3022
|
onChange: function onChange(e) {
|
|
2951
3023
|
var value = e.target.value;
|
|
@@ -2953,15 +3025,10 @@ var ConditionRules = function ConditionRules(_ref) {
|
|
|
2953
3025
|
ctx.conditionRules.betweenValue.value1 = value;
|
|
2954
3026
|
});
|
|
2955
3027
|
}
|
|
2956
|
-
})), /*#__PURE__*/React.createElement("
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
}, conditionformat.to), /*#__PURE__*/React.createElement("div", {
|
|
2961
|
-
className: "condition-rules-between-inpbox"
|
|
2962
|
-
}, /*#__PURE__*/React.createElement("input", {
|
|
2963
|
-
className: "condition-rules-between-input",
|
|
2964
|
-
type: "text",
|
|
3028
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
3029
|
+
className: "w-full"
|
|
3030
|
+
}, /*#__PURE__*/React.createElement(TextField, {
|
|
3031
|
+
placeholder: "To",
|
|
2965
3032
|
value: context.conditionRules.betweenValue.value2,
|
|
2966
3033
|
onChange: function onChange(e) {
|
|
2967
3034
|
var value = e.target.value;
|
|
@@ -2970,10 +3037,10 @@ var ConditionRules = function ConditionRules(_ref) {
|
|
|
2970
3037
|
});
|
|
2971
3038
|
}
|
|
2972
3039
|
})))), type === "occurrenceDate" && (/*#__PURE__*/React.createElement("div", {
|
|
2973
|
-
className: "
|
|
3040
|
+
className: "datepicker-toggle"
|
|
2974
3041
|
}, /*#__PURE__*/React.createElement("input", {
|
|
2975
3042
|
type: "date",
|
|
2976
|
-
className: "
|
|
3043
|
+
className: "datepicker-input",
|
|
2977
3044
|
value: context.conditionRules.dateValue,
|
|
2978
3045
|
onChange: function onChange(e) {
|
|
2979
3046
|
var value = e.target.value;
|
|
@@ -2981,50 +3048,101 @@ var ConditionRules = function ConditionRules(_ref) {
|
|
|
2981
3048
|
ctx.conditionRules.dateValue = value;
|
|
2982
3049
|
});
|
|
2983
3050
|
}
|
|
2984
|
-
})
|
|
2985
|
-
className: "
|
|
2986
|
-
|
|
2987
|
-
|
|
3051
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
3052
|
+
className: "datepicker-toggle-button"
|
|
3053
|
+
}))), type === "duplicateValue" && (/*#__PURE__*/React.createElement(Select$1, {
|
|
3054
|
+
value: context.conditionRules.repeatValue,
|
|
3055
|
+
onValueChange: function onValueChange(value) {
|
|
2988
3056
|
setContext(function (ctx) {
|
|
2989
3057
|
ctx.conditionRules.repeatValue = value;
|
|
2990
3058
|
});
|
|
2991
3059
|
}
|
|
2992
|
-
}, /*#__PURE__*/React.createElement(
|
|
3060
|
+
}, /*#__PURE__*/React.createElement(SelectTrigger, null, /*#__PURE__*/React.createElement(SelectValue, null)), /*#__PURE__*/React.createElement(SelectContent, {
|
|
3061
|
+
className: "condition-rules-select"
|
|
3062
|
+
}, /*#__PURE__*/React.createElement(SelectItem$1, {
|
|
2993
3063
|
value: "0"
|
|
2994
|
-
}, conditionformat.duplicateValue), /*#__PURE__*/React.createElement(
|
|
3064
|
+
}, conditionformat.duplicateValue), /*#__PURE__*/React.createElement(SelectItem$1, {
|
|
2995
3065
|
value: "1"
|
|
2996
|
-
}, conditionformat.uniqueValue))), (type === "top10" || type === "top10_percent" || type === "last10" || type === "last10_percent") && (/*#__PURE__*/React.createElement("div", {
|
|
3066
|
+
}, conditionformat.uniqueValue)))), (type === "top10" || type === "top10_percent" || type === "last10" || type === "last10_percent") && (/*#__PURE__*/React.createElement("div", {
|
|
2997
3067
|
className: "condition-rules-project-box"
|
|
2998
|
-
}, type === "top10" || type === "top10_percent" ? conditionformat.top : conditionformat.last, /*#__PURE__*/React.createElement("
|
|
2999
|
-
className: "
|
|
3068
|
+
}, type === "top10" || type === "top10_percent" ? conditionformat.top : conditionformat.last, /*#__PURE__*/React.createElement("div", {
|
|
3069
|
+
className: "flex items-center"
|
|
3070
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
3071
|
+
icon: "Minus",
|
|
3072
|
+
variant: "ghost",
|
|
3073
|
+
className: "!bg-transparent",
|
|
3074
|
+
disabled: Number(context.conditionRules.projectValue) <= 1,
|
|
3075
|
+
onClick: function onClick() {
|
|
3076
|
+
setContext(function (ctx) {
|
|
3077
|
+
var current = Number(ctx.conditionRules.projectValue) || 0;
|
|
3078
|
+
ctx.conditionRules.projectValue = String(Math.max(current - 1, 1));
|
|
3079
|
+
});
|
|
3080
|
+
}
|
|
3081
|
+
}), /*#__PURE__*/React.createElement(TextField, {
|
|
3082
|
+
className: "condition-rules-project-input pr-0",
|
|
3000
3083
|
type: "number",
|
|
3084
|
+
min: 1,
|
|
3085
|
+
max: type === "top10" || type === "last10" ? 10 : 100,
|
|
3001
3086
|
value: context.conditionRules.projectValue,
|
|
3002
3087
|
onChange: function onChange(e) {
|
|
3003
3088
|
var value = e.target.value;
|
|
3004
3089
|
setContext(function (ctx) {
|
|
3005
3090
|
ctx.conditionRules.projectValue = value;
|
|
3006
3091
|
});
|
|
3092
|
+
},
|
|
3093
|
+
rightIcon: type === "top10" || type === "last10" ? (/*#__PURE__*/React.createElement("span", {
|
|
3094
|
+
className: "color-icon-secondary"
|
|
3095
|
+
}, conditionformat.oneself)) : (/*#__PURE__*/React.createElement("span", {
|
|
3096
|
+
className: "color-icon-secondary"
|
|
3097
|
+
}, "%"))
|
|
3098
|
+
}), /*#__PURE__*/React.createElement(IconButton, {
|
|
3099
|
+
icon: "Plus",
|
|
3100
|
+
variant: "ghost",
|
|
3101
|
+
className: "!bg-transparent",
|
|
3102
|
+
disabled: Number(context.conditionRules.projectValue) >= (type === "top10" || type === "last10" ? 10 : 100),
|
|
3103
|
+
onClick: function onClick() {
|
|
3104
|
+
setContext(function (ctx) {
|
|
3105
|
+
var current = Number(ctx.conditionRules.projectValue) || 0;
|
|
3106
|
+
ctx.conditionRules.projectValue = String(current + 1);
|
|
3107
|
+
});
|
|
3108
|
+
}
|
|
3109
|
+
})))))), /*#__PURE__*/React.createElement("div", {
|
|
3110
|
+
className: "flex flex-col"
|
|
3111
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3112
|
+
className: "condition-rules-value text-heading-xsm"
|
|
3113
|
+
}, conditionformat.applyRange), /*#__PURE__*/React.createElement(TextField, {
|
|
3114
|
+
rightIcon: /*#__PURE__*/React.createElement(LucideIcon, {
|
|
3115
|
+
name: "Grid2x2",
|
|
3116
|
+
size: "sm"
|
|
3117
|
+
}),
|
|
3118
|
+
"aria-hidden": "true",
|
|
3119
|
+
readOnly: true,
|
|
3120
|
+
placeholder: conditionformat.selectRange,
|
|
3121
|
+
value: getDisplayedRangeTxt(context),
|
|
3122
|
+
onClick: function onClick() {
|
|
3123
|
+
dataSelectRange("conditionRules".concat(type));
|
|
3007
3124
|
}
|
|
3008
|
-
})
|
|
3009
|
-
className: "
|
|
3125
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
3126
|
+
className: "flex flex-col"
|
|
3127
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3128
|
+
className: "condition-rules-set-title text-heading-xsm"
|
|
3010
3129
|
}, "".concat(conditionformat.setAs, "\uFF1A")), /*#__PURE__*/React.createElement("div", {
|
|
3011
3130
|
className: "condition-rules-setbox"
|
|
3012
3131
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3013
3132
|
className: "condition-rules-set"
|
|
3014
3133
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3015
3134
|
className: "condition-rules-color"
|
|
3016
|
-
}, /*#__PURE__*/React.createElement("
|
|
3017
|
-
id: "checkTextColor"
|
|
3018
|
-
|
|
3019
|
-
className: "condition-rules-check",
|
|
3135
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
3136
|
+
id: "checkTextColor"
|
|
3137
|
+
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
3020
3138
|
checked: context.conditionRules.textColor.check,
|
|
3021
|
-
|
|
3139
|
+
onCheckedChange: function onCheckedChange(e) {
|
|
3022
3140
|
var checked = e.target.checked;
|
|
3023
3141
|
setContext(function (ctx) {
|
|
3024
3142
|
ctx.conditionRules.textColor.check = checked;
|
|
3025
3143
|
});
|
|
3026
3144
|
}
|
|
3027
|
-
}), /*#__PURE__*/React.createElement("label", {
|
|
3145
|
+
})), /*#__PURE__*/React.createElement("label", {
|
|
3028
3146
|
htmlFor: "checkTextColor",
|
|
3029
3147
|
className: "condition-rules-label"
|
|
3030
3148
|
}, conditionformat.textColor), /*#__PURE__*/React.createElement("input", {
|
|
@@ -3041,18 +3159,17 @@ var ConditionRules = function ConditionRules(_ref) {
|
|
|
3041
3159
|
className: "condition-rules-set"
|
|
3042
3160
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3043
3161
|
className: "condition-rules-color"
|
|
3044
|
-
}, /*#__PURE__*/React.createElement("
|
|
3045
|
-
id: "checkCellColor"
|
|
3046
|
-
|
|
3047
|
-
className: "condition-rules-check",
|
|
3162
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
3163
|
+
id: "checkCellColor"
|
|
3164
|
+
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
3048
3165
|
checked: context.conditionRules.cellColor.check,
|
|
3049
|
-
|
|
3166
|
+
onCheckedChange: function onCheckedChange(e) {
|
|
3050
3167
|
var checked = e.target.checked;
|
|
3051
3168
|
setContext(function (ctx) {
|
|
3052
3169
|
ctx.conditionRules.cellColor.check = checked;
|
|
3053
3170
|
});
|
|
3054
3171
|
}
|
|
3055
|
-
}), /*#__PURE__*/React.createElement("label", {
|
|
3172
|
+
})), /*#__PURE__*/React.createElement("label", {
|
|
3056
3173
|
htmlFor: "checkCellColor",
|
|
3057
3174
|
className: "condition-rules-label"
|
|
3058
3175
|
}, conditionformat.cellColor), /*#__PURE__*/React.createElement("input", {
|
|
@@ -3065,23 +3182,32 @@ var ConditionRules = function ConditionRules(_ref) {
|
|
|
3065
3182
|
draft.cellColor = value;
|
|
3066
3183
|
}));
|
|
3067
3184
|
}
|
|
3068
|
-
})))), /*#__PURE__*/React.createElement(
|
|
3069
|
-
className: "
|
|
3185
|
+
}))))), /*#__PURE__*/React.createElement(Divider$2, {
|
|
3186
|
+
className: "w-full border-t-[1px]"
|
|
3187
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
3188
|
+
className: "flex gap-2 justify-end"
|
|
3189
|
+
}, /*#__PURE__*/React.createElement(Button$1, {
|
|
3190
|
+
variant: "secondary",
|
|
3191
|
+
style: {
|
|
3192
|
+
minWidth: "80px"
|
|
3193
|
+
},
|
|
3070
3194
|
onClick: function onClick() {
|
|
3071
|
-
close("
|
|
3195
|
+
close("close");
|
|
3072
3196
|
},
|
|
3073
3197
|
tabIndex: 0
|
|
3074
|
-
}, button.
|
|
3075
|
-
|
|
3198
|
+
}, button.cancel), /*#__PURE__*/React.createElement(Button$1, {
|
|
3199
|
+
variant: "default",
|
|
3200
|
+
style: {
|
|
3201
|
+
minWidth: "80px"
|
|
3202
|
+
},
|
|
3076
3203
|
onClick: function onClick() {
|
|
3077
|
-
close("
|
|
3204
|
+
close("confirm");
|
|
3078
3205
|
},
|
|
3079
3206
|
tabIndex: 0
|
|
3080
|
-
}, button.
|
|
3207
|
+
}, button.apply)));
|
|
3081
3208
|
};
|
|
3082
3209
|
|
|
3083
3210
|
var RangeDialog = function RangeDialog() {
|
|
3084
|
-
var _context$rangeDialog$, _context$rangeDialog;
|
|
3085
3211
|
var _useContext = useContext(WorkbookContext),
|
|
3086
3212
|
context = _useContext.context,
|
|
3087
3213
|
setContext = _useContext.setContext;
|
|
@@ -3090,7 +3216,7 @@ var RangeDialog = function RangeDialog() {
|
|
|
3090
3216
|
var _locale = locale(context),
|
|
3091
3217
|
dataVerification = _locale.dataVerification,
|
|
3092
3218
|
button = _locale.button;
|
|
3093
|
-
var _useState = useState((
|
|
3219
|
+
var _useState = useState(getDisplayedRangeTxt(context)),
|
|
3094
3220
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3095
3221
|
rangeTxt2 = _useState2[0],
|
|
3096
3222
|
setRangeTxt2 = _useState2[1];
|
|
@@ -3104,30 +3230,24 @@ var RangeDialog = function RangeDialog() {
|
|
|
3104
3230
|
if (rangeDialogType.indexOf("between") >= 0) {
|
|
3105
3231
|
showDialog(/*#__PURE__*/React.createElement(ConditionRules, {
|
|
3106
3232
|
type: "between"
|
|
3107
|
-
}));
|
|
3233
|
+
}), undefined, locale(context).conditionformat.conditionformat_between);
|
|
3108
3234
|
return;
|
|
3109
3235
|
}
|
|
3110
3236
|
if (rangeDialogType.indexOf("conditionRules") >= 0) {
|
|
3111
3237
|
var rulesType = rangeDialogType.substring("conditionRules".length, rangeDialogType.length);
|
|
3112
3238
|
showDialog(/*#__PURE__*/React.createElement(ConditionRules, {
|
|
3113
3239
|
type: rulesType
|
|
3114
|
-
}));
|
|
3240
|
+
}), undefined, locale(context).conditionformat["conditionformat_".concat(rulesType)]);
|
|
3115
3241
|
return;
|
|
3116
3242
|
}
|
|
3117
3243
|
showDialog(/*#__PURE__*/React.createElement(DataVerification, null));
|
|
3118
|
-
}, [
|
|
3244
|
+
}, [setContext, showDialog, context]);
|
|
3119
3245
|
useEffect(function () {
|
|
3120
|
-
setRangeTxt2(
|
|
3121
|
-
if (context.luckysheet_select_save) {
|
|
3122
|
-
var range = context.luckysheet_select_save[context.luckysheet_select_save.length - 1];
|
|
3123
|
-
r = getRangetxt(context, context.currentSheetId, range, context.currentSheetId);
|
|
3124
|
-
return r;
|
|
3125
|
-
}
|
|
3126
|
-
return "";
|
|
3127
|
-
});
|
|
3246
|
+
setRangeTxt2(getDisplayedRangeTxt(context));
|
|
3128
3247
|
}, [context, context.luckysheet_select_save]);
|
|
3129
3248
|
return /*#__PURE__*/React.createElement("div", {
|
|
3130
3249
|
id: "range-dialog",
|
|
3250
|
+
className: "fortune-dialog",
|
|
3131
3251
|
onClick: function onClick(e) {
|
|
3132
3252
|
return e.stopPropagation();
|
|
3133
3253
|
},
|
|
@@ -3145,15 +3265,34 @@ var RangeDialog = function RangeDialog() {
|
|
|
3145
3265
|
},
|
|
3146
3266
|
tabIndex: 0
|
|
3147
3267
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3148
|
-
className: "
|
|
3149
|
-
},
|
|
3268
|
+
className: cn("flex items-center justify-between border-b color-border-default py-3 px-6")
|
|
3269
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3270
|
+
className: "text-heading-sm"
|
|
3271
|
+
}, dataVerification.selectCellRange), /*#__PURE__*/React.createElement(IconButton, {
|
|
3272
|
+
icon: "X",
|
|
3273
|
+
variant: "ghost",
|
|
3274
|
+
onClick: close,
|
|
3275
|
+
tabIndex: 0
|
|
3276
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
3277
|
+
className: "px-6 pb-6 pt-4 text-body-sm"
|
|
3278
|
+
}, /*#__PURE__*/React.createElement(TextField, {
|
|
3279
|
+
className: "w-full",
|
|
3150
3280
|
readOnly: true,
|
|
3151
3281
|
placeholder: dataVerification.selectCellRange2,
|
|
3152
3282
|
value: rangeTxt2
|
|
3153
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
3154
|
-
className: "
|
|
3283
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
3284
|
+
className: "px-6 pb-6 flex flex-row gap-2 justify-end"
|
|
3285
|
+
}, /*#__PURE__*/React.createElement(Button$1, {
|
|
3286
|
+
variant: "secondary",
|
|
3287
|
+
style: {
|
|
3288
|
+
minWidth: "80px"
|
|
3289
|
+
},
|
|
3290
|
+
onClick: close,
|
|
3291
|
+
tabIndex: 0
|
|
3292
|
+
}, button.close), /*#__PURE__*/React.createElement(Button$1, {
|
|
3293
|
+
variant: "default",
|
|
3155
3294
|
style: {
|
|
3156
|
-
|
|
3295
|
+
minWidth: "80px"
|
|
3157
3296
|
},
|
|
3158
3297
|
onClick: function onClick() {
|
|
3159
3298
|
setContext(function (ctx) {
|
|
@@ -3162,13 +3301,7 @@ var RangeDialog = function RangeDialog() {
|
|
|
3162
3301
|
close();
|
|
3163
3302
|
},
|
|
3164
3303
|
tabIndex: 0
|
|
3165
|
-
}, button.confirm)
|
|
3166
|
-
className: "button-basic button-close",
|
|
3167
|
-
onClick: function onClick() {
|
|
3168
|
-
close();
|
|
3169
|
-
},
|
|
3170
|
-
tabIndex: 0
|
|
3171
|
-
}, button.close));
|
|
3304
|
+
}, button.confirm)));
|
|
3172
3305
|
};
|
|
3173
3306
|
|
|
3174
3307
|
function useOutsideClick(containerRef, handler, deps, optionalContainerRef) {
|
|
@@ -4087,7 +4220,6 @@ var Combo = function Combo(_ref) {
|
|
|
4087
4220
|
var openState = useRef(false);
|
|
4088
4221
|
var triggerRef = useRef(null);
|
|
4089
4222
|
useOutsideClick(popupRef, function () {
|
|
4090
|
-
console.log("Combo useOutsideClick", openState.current);
|
|
4091
4223
|
setOpen(false);
|
|
4092
4224
|
openState.current = false;
|
|
4093
4225
|
}, [], triggerRef);
|
|
@@ -4119,10 +4251,8 @@ var Combo = function Combo(_ref) {
|
|
|
4119
4251
|
ref: triggerRef,
|
|
4120
4252
|
className: "fortune-toolbar-combo-button",
|
|
4121
4253
|
onClick: function onClick(e) {
|
|
4122
|
-
console.log("Combo onClick pop ref", popupRef.current, "ll", document.getElementsByClassName("fortune-toolbar-combo-popup"));
|
|
4123
4254
|
openState.current = !openState.current;
|
|
4124
4255
|
setOpen(openState.current);
|
|
4125
|
-
console.log("Combo onClick", iconId, _onClick, open, openState.current, e, e.target);
|
|
4126
4256
|
if (_onClick) _onClick(e);else setOpen(openState.current);
|
|
4127
4257
|
},
|
|
4128
4258
|
tabIndex: 0,
|
|
@@ -4138,7 +4268,7 @@ var Combo = function Combo(_ref) {
|
|
|
4138
4268
|
className: "fortune-tooltip"
|
|
4139
4269
|
}, tooltip)), open && (/*#__PURE__*/React.createElement("div", {
|
|
4140
4270
|
ref: popupRef,
|
|
4141
|
-
className: "fortune-toolbar-combo-popup",
|
|
4271
|
+
className: "fortune-toolbar-combo-popup color-text-default",
|
|
4142
4272
|
style: popupPosition
|
|
4143
4273
|
}, children === null || children === void 0 ? void 0 : children(setOpen))));
|
|
4144
4274
|
};
|
|
@@ -4170,7 +4300,7 @@ var Option = function Option(_ref2) {
|
|
|
4170
4300
|
}, iconId && /*#__PURE__*/React.createElement(SVGIcon, {
|
|
4171
4301
|
name: iconId
|
|
4172
4302
|
}), /*#__PURE__*/React.createElement("div", {
|
|
4173
|
-
className: "fortuen-toolbar-text"
|
|
4303
|
+
className: "fortuen-toolbar-text color-text-default text-body-sm"
|
|
4174
4304
|
}, children));
|
|
4175
4305
|
};
|
|
4176
4306
|
|
|
@@ -4416,7 +4546,7 @@ var SplitColumn = function SplitColumn() {
|
|
|
4416
4546
|
}
|
|
4417
4547
|
}
|
|
4418
4548
|
if (dataCover) {
|
|
4419
|
-
showDialog(splitText.splitConfirmToExe, "yesno", function () {
|
|
4549
|
+
showDialog(splitText.splitConfirmToExe, "yesno", undefined, function () {
|
|
4420
4550
|
hideDialog();
|
|
4421
4551
|
setContext(function (ctx) {
|
|
4422
4552
|
updateMoreCell(r, c, dataArr, ctx);
|
|
@@ -4739,33 +4869,53 @@ var ConditionalFormat = function ConditionalFormat(_ref) {
|
|
|
4739
4869
|
showDialog = _useDialog.showDialog;
|
|
4740
4870
|
var _locale = locale(context),
|
|
4741
4871
|
conditionformat = _locale.conditionformat;
|
|
4742
|
-
var
|
|
4743
|
-
|
|
4744
|
-
var menuItem = target.className === "fortune-toolbar-menu-line" ? target.parentElement : target;
|
|
4872
|
+
var activeSubMenuRef = useRef(null);
|
|
4873
|
+
var updateSubMenuPosition = useCallback(function (subMenu, menuItem) {
|
|
4745
4874
|
var menuItemRect = menuItem.getBoundingClientRect();
|
|
4746
4875
|
var workbookContainerRect = refs.workbookContainer.current.getBoundingClientRect();
|
|
4747
|
-
var
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
if (workbookContainerRect.right - menuItemRect.right < parseFloat(subMenu.style.width.replace("px", ""))) {
|
|
4752
|
-
subMenu.style.display = "block";
|
|
4753
|
-
subMenu.style.right = "".concat(menuItemRect.width - menuItemPaddingRight, "px");
|
|
4876
|
+
var subMenuWidth = subMenu.offsetWidth;
|
|
4877
|
+
var availableSpace = workbookContainerRect.right - menuItemRect.right;
|
|
4878
|
+
if (availableSpace < subMenuWidth) {
|
|
4879
|
+
subMenu.style.right = "108%";
|
|
4754
4880
|
} else {
|
|
4755
|
-
subMenu.style.
|
|
4756
|
-
subMenu.style.right = "".concat(-(parseFloat(subMenu.style.width.replace("px", "")) + menuItemPaddingRight), "px");
|
|
4881
|
+
subMenu.style.right = "-100%";
|
|
4757
4882
|
}
|
|
4758
4883
|
}, [refs.workbookContainer]);
|
|
4884
|
+
var showSubMenu = useCallback(function (e) {
|
|
4885
|
+
var target = e.target;
|
|
4886
|
+
var menuItem = target.className === "fortune-toolbar-menu-line" ? target.parentElement : target;
|
|
4887
|
+
var subMenu = menuItem.querySelector(".condition-format-sub-menu");
|
|
4888
|
+
if (_.isNil(subMenu)) return;
|
|
4889
|
+
subMenu.style.display = "block";
|
|
4890
|
+
activeSubMenuRef.current = subMenu;
|
|
4891
|
+
updateSubMenuPosition(subMenu, menuItem);
|
|
4892
|
+
}, [updateSubMenuPosition]);
|
|
4759
4893
|
var hideSubMenu = useCallback(function (e) {
|
|
4760
4894
|
var target = e.target;
|
|
4761
4895
|
if (target.className === "condition-format-sub-menu") {
|
|
4762
4896
|
target.style.display = "none";
|
|
4897
|
+
activeSubMenuRef.current = null;
|
|
4763
4898
|
return;
|
|
4764
4899
|
}
|
|
4765
4900
|
var subMenu = target.className === "condition-format-item" ? target.parentElement : target.querySelector(".condition-format-sub-menu");
|
|
4766
4901
|
if (_.isNil(subMenu)) return;
|
|
4767
4902
|
subMenu.style.display = "none";
|
|
4903
|
+
activeSubMenuRef.current = null;
|
|
4768
4904
|
}, []);
|
|
4905
|
+
useEffect(function () {
|
|
4906
|
+
var handleResize = function handleResize() {
|
|
4907
|
+
if (activeSubMenuRef.current) {
|
|
4908
|
+
var menuItem = activeSubMenuRef.current.parentElement;
|
|
4909
|
+
if (menuItem) {
|
|
4910
|
+
updateSubMenuPosition(activeSubMenuRef.current, menuItem);
|
|
4911
|
+
}
|
|
4912
|
+
}
|
|
4913
|
+
};
|
|
4914
|
+
window.addEventListener("resize", handleResize);
|
|
4915
|
+
return function () {
|
|
4916
|
+
window.removeEventListener("resize", handleResize);
|
|
4917
|
+
};
|
|
4918
|
+
}, [updateSubMenuPosition]);
|
|
4769
4919
|
var getConditionFormatItem = useCallback(function (name) {
|
|
4770
4920
|
if (name === "-") {
|
|
4771
4921
|
return /*#__PURE__*/React.createElement(MenuDivider, {
|
|
@@ -4786,8 +4936,7 @@ var ConditionalFormat = function ConditionalFormat(_ref) {
|
|
|
4786
4936
|
}), /*#__PURE__*/React.createElement("div", {
|
|
4787
4937
|
className: "condition-format-sub-menu",
|
|
4788
4938
|
style: {
|
|
4789
|
-
display: "none"
|
|
4790
|
-
width: 150
|
|
4939
|
+
display: "none"
|
|
4791
4940
|
}
|
|
4792
4941
|
}, [{
|
|
4793
4942
|
text: "greaterThan",
|
|
@@ -4812,13 +4961,13 @@ var ConditionalFormat = function ConditionalFormat(_ref) {
|
|
|
4812
4961
|
value: "##"
|
|
4813
4962
|
}].map(function (v) {
|
|
4814
4963
|
return /*#__PURE__*/React.createElement("div", {
|
|
4815
|
-
className: "condition-format-item",
|
|
4964
|
+
className: "condition-format-item text-body-sm color-text-default",
|
|
4816
4965
|
key: v.text,
|
|
4817
4966
|
onClick: function onClick() {
|
|
4818
|
-
setOpen(false);
|
|
4967
|
+
setOpen === null || setOpen === void 0 ? void 0 : setOpen(false);
|
|
4819
4968
|
showDialog(/*#__PURE__*/React.createElement(ConditionRules, {
|
|
4820
4969
|
type: v.text
|
|
4821
|
-
}));
|
|
4970
|
+
}), undefined, conditionformat["conditionformat_".concat(v.text)]);
|
|
4822
4971
|
},
|
|
4823
4972
|
tabIndex: 0
|
|
4824
4973
|
}, conditionformat[v.text], /*#__PURE__*/React.createElement("span", null, v.value));
|
|
@@ -4837,8 +4986,7 @@ var ConditionalFormat = function ConditionalFormat(_ref) {
|
|
|
4837
4986
|
}), /*#__PURE__*/React.createElement("div", {
|
|
4838
4987
|
className: "condition-format-sub-menu",
|
|
4839
4988
|
style: {
|
|
4840
|
-
display: "none"
|
|
4841
|
-
width: 180
|
|
4989
|
+
display: "none"
|
|
4842
4990
|
}
|
|
4843
4991
|
}, [{
|
|
4844
4992
|
text: "top10",
|
|
@@ -4860,13 +5008,13 @@ var ConditionalFormat = function ConditionalFormat(_ref) {
|
|
|
4860
5008
|
value: conditionformat.below
|
|
4861
5009
|
}].map(function (v) {
|
|
4862
5010
|
return /*#__PURE__*/React.createElement("div", {
|
|
4863
|
-
className: "condition-format-item",
|
|
5011
|
+
className: "condition-format-item text-body-sm color-text-default",
|
|
4864
5012
|
key: v.text,
|
|
4865
5013
|
onClick: function onClick() {
|
|
4866
|
-
setOpen(false);
|
|
5014
|
+
setOpen === null || setOpen === void 0 ? void 0 : setOpen(false);
|
|
4867
5015
|
showDialog(/*#__PURE__*/React.createElement(ConditionRules, {
|
|
4868
5016
|
type: v.text
|
|
4869
|
-
}));
|
|
5017
|
+
}), undefined, conditionformat["conditionformat_".concat(v.text)]);
|
|
4870
5018
|
},
|
|
4871
5019
|
tabIndex: 0
|
|
4872
5020
|
}, conditionformat[v.text], /*#__PURE__*/React.createElement("span", null, v.value));
|
|
@@ -4915,12 +5063,11 @@ var ConditionalFormat = function ConditionalFormat(_ref) {
|
|
|
4915
5063
|
}), /*#__PURE__*/React.createElement("div", {
|
|
4916
5064
|
className: "condition-format-sub-menu",
|
|
4917
5065
|
style: {
|
|
4918
|
-
display: "none"
|
|
4919
|
-
width: 150
|
|
5066
|
+
display: "none"
|
|
4920
5067
|
}
|
|
4921
5068
|
}, ["deleteSheetRule"].map(function (v) {
|
|
4922
5069
|
return /*#__PURE__*/React.createElement("div", {
|
|
4923
|
-
className: "condition-format-item",
|
|
5070
|
+
className: "condition-format-item text-body-sm color-text-default",
|
|
4924
5071
|
key: v,
|
|
4925
5072
|
style: {
|
|
4926
5073
|
padding: "6px 10px"
|
|
@@ -6486,7 +6633,11 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
6486
6633
|
key: name,
|
|
6487
6634
|
tooltip: toolbar.sortAndFilter
|
|
6488
6635
|
}, function (setOpen) {
|
|
6489
|
-
return /*#__PURE__*/React.createElement(Select,
|
|
6636
|
+
return /*#__PURE__*/React.createElement(Select, {
|
|
6637
|
+
style: {
|
|
6638
|
+
minWidth: "11.25rem"
|
|
6639
|
+
}
|
|
6640
|
+
}, _items8.map(function (_ref11, index) {
|
|
6490
6641
|
var text = _ref11.text,
|
|
6491
6642
|
iconId = _ref11.iconId,
|
|
6492
6643
|
value = _ref11.value,
|
|
@@ -6498,10 +6649,13 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
6498
6649
|
setOpen(false);
|
|
6499
6650
|
}
|
|
6500
6651
|
}, /*#__PURE__*/React.createElement("div", {
|
|
6501
|
-
className: "fortune-toolbar-menu-line"
|
|
6502
|
-
|
|
6652
|
+
className: "fortune-toolbar-menu-line gap-1",
|
|
6653
|
+
style: {
|
|
6654
|
+
justifyContent: "start"
|
|
6655
|
+
}
|
|
6656
|
+
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
6503
6657
|
name: iconId
|
|
6504
|
-
})))) : (/*#__PURE__*/React.createElement(MenuDivider, {
|
|
6658
|
+
}), text))) : (/*#__PURE__*/React.createElement(MenuDivider, {
|
|
6505
6659
|
key: "divider-".concat(index)
|
|
6506
6660
|
}));
|
|
6507
6661
|
}));
|
|
@@ -7259,132 +7413,18 @@ var Menu = function Menu(_ref) {
|
|
|
7259
7413
|
}, children));
|
|
7260
7414
|
};
|
|
7261
7415
|
|
|
7262
|
-
var
|
|
7263
|
-
var
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
setRangeColChar = _useState2[1];
|
|
7267
|
-
var _useState3 = useState(true),
|
|
7268
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
7269
|
-
ascOrDesc = _useState4[0],
|
|
7270
|
-
setAscOrDesc = _useState4[1];
|
|
7416
|
+
var ContextMenu = function ContextMenu() {
|
|
7417
|
+
var _useDialog = useDialog(),
|
|
7418
|
+
showDialog = _useDialog.showDialog;
|
|
7419
|
+
var containerRef = useRef(null);
|
|
7271
7420
|
var _useContext = useContext(WorkbookContext),
|
|
7272
7421
|
context = _useContext.context,
|
|
7273
|
-
setContext = _useContext.setContext
|
|
7274
|
-
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
7280
|
-
isTitleChange = _useState8[0],
|
|
7281
|
-
setIstitleChange = _useState8[1];
|
|
7282
|
-
var _locale = locale(context),
|
|
7283
|
-
sort = _locale.sort;
|
|
7284
|
-
var _useDialog = useDialog(),
|
|
7285
|
-
hideDialog = _useDialog.hideDialog;
|
|
7286
|
-
var col_start = context.luckysheet_select_save[0].column[0];
|
|
7287
|
-
var col_end = context.luckysheet_select_save[0].column[1];
|
|
7288
|
-
var row_start = context.luckysheet_select_save[0].row[0];
|
|
7289
|
-
var row_end = context.luckysheet_select_save[0].row[1];
|
|
7290
|
-
var sheetIndex = getSheetIndex(context, context.currentSheetId);
|
|
7291
|
-
var handleSelectChange = function handleSelectChange(event) {
|
|
7292
|
-
setSelectedValue(event.target.value);
|
|
7293
|
-
};
|
|
7294
|
-
var handleRadioChange = useCallback(function (e) {
|
|
7295
|
-
var sortValue = e.target.value;
|
|
7296
|
-
setAscOrDesc(sortValue === "asc");
|
|
7297
|
-
}, []);
|
|
7298
|
-
var handleTitleChange = useCallback(function (e) {
|
|
7299
|
-
var value = e.target.checked;
|
|
7300
|
-
setIstitleChange(value);
|
|
7301
|
-
}, []);
|
|
7302
|
-
useEffect(function () {
|
|
7303
|
-
var list = [];
|
|
7304
|
-
if (isTitleChange) {
|
|
7305
|
-
for (var i = col_start; i <= col_end; i += 1) {
|
|
7306
|
-
var _context$luckysheetfi, _context$luckysheetfi2;
|
|
7307
|
-
var cell = (_context$luckysheetfi = context.luckysheetfile[sheetIndex].data) === null || _context$luckysheetfi === void 0 ? void 0 : (_context$luckysheetfi2 = _context$luckysheetfi[row_start]) === null || _context$luckysheetfi2 === void 0 ? void 0 : _context$luckysheetfi2[i];
|
|
7308
|
-
var colHeaderValue = (cell === null || cell === void 0 ? void 0 : cell.m) || (cell === null || cell === void 0 ? void 0 : cell.v);
|
|
7309
|
-
if (colHeaderValue) {
|
|
7310
|
-
list.push(colHeaderValue);
|
|
7311
|
-
} else {
|
|
7312
|
-
var ColumnChar = indexToColumnChar(i);
|
|
7313
|
-
list.push("".concat(sort.columnOperation, " ").concat(ColumnChar));
|
|
7314
|
-
}
|
|
7315
|
-
}
|
|
7316
|
-
} else {
|
|
7317
|
-
for (var _i = col_start; _i <= col_end; _i += 1) {
|
|
7318
|
-
var _ColumnChar = indexToColumnChar(_i);
|
|
7319
|
-
list.push(_ColumnChar);
|
|
7320
|
-
}
|
|
7321
|
-
}
|
|
7322
|
-
setRangeColChar(list);
|
|
7323
|
-
}, [col_end, col_start, context.luckysheetfile, isTitleChange, row_start, sheetIndex, sort.columnOperation]);
|
|
7324
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
7325
|
-
className: "fortune-sort"
|
|
7326
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
7327
|
-
className: "fortune-sort-title"
|
|
7328
|
-
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", null, sort.sortRangeTitle), indexToColumnChar(col_start), row_start + 1, /*#__PURE__*/React.createElement("span", null, sort.sortRangeTitleTo), indexToColumnChar(col_end), row_end + 1)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
7329
|
-
className: "fortune-sort-modal"
|
|
7330
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("input", {
|
|
7331
|
-
type: "checkbox",
|
|
7332
|
-
id: "fortune-sort-haveheader",
|
|
7333
|
-
onChange: handleTitleChange
|
|
7334
|
-
}), /*#__PURE__*/React.createElement("span", null, sort.hasTitle)), /*#__PURE__*/React.createElement("div", {
|
|
7335
|
-
className: "fortune-sort-tablec"
|
|
7336
|
-
}, /*#__PURE__*/React.createElement("table", {
|
|
7337
|
-
cellSpacing: "0"
|
|
7338
|
-
}, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
7339
|
-
style: {
|
|
7340
|
-
width: "190px"
|
|
7341
|
-
}
|
|
7342
|
-
}, sort.sortBy, /*#__PURE__*/React.createElement("select", {
|
|
7343
|
-
name: "sort_0",
|
|
7344
|
-
onChange: handleSelectChange
|
|
7345
|
-
}, rangeColChar.map(function (col, index) {
|
|
7346
|
-
return /*#__PURE__*/React.createElement("option", {
|
|
7347
|
-
value: index,
|
|
7348
|
-
key: index
|
|
7349
|
-
}, col);
|
|
7350
|
-
}))), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("input", {
|
|
7351
|
-
type: "radio",
|
|
7352
|
-
value: "asc",
|
|
7353
|
-
defaultChecked: true,
|
|
7354
|
-
name: "sort_0",
|
|
7355
|
-
onChange: handleRadioChange
|
|
7356
|
-
}), /*#__PURE__*/React.createElement("span", null, sort.asc)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("input", {
|
|
7357
|
-
type: "radio",
|
|
7358
|
-
value: "desc",
|
|
7359
|
-
name: "sort_0",
|
|
7360
|
-
onChange: handleRadioChange
|
|
7361
|
-
}), /*#__PURE__*/React.createElement("span", null, sort.desc))))))))), /*#__PURE__*/React.createElement("div", {
|
|
7362
|
-
className: "fortune-sort-button"
|
|
7363
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
7364
|
-
className: "button-basic button-primary",
|
|
7365
|
-
onClick: function onClick() {
|
|
7366
|
-
setContext(function (draftCtx) {
|
|
7367
|
-
sortSelection(draftCtx, ascOrDesc, parseInt(selectedValue, 10));
|
|
7368
|
-
draftCtx.contextMenu = {};
|
|
7369
|
-
});
|
|
7370
|
-
hideDialog();
|
|
7371
|
-
},
|
|
7372
|
-
tabIndex: 0
|
|
7373
|
-
}, sort.confirm)));
|
|
7374
|
-
};
|
|
7375
|
-
|
|
7376
|
-
var ContextMenu = function ContextMenu() {
|
|
7377
|
-
var _useDialog = useDialog(),
|
|
7378
|
-
showDialog = _useDialog.showDialog;
|
|
7379
|
-
var containerRef = useRef(null);
|
|
7380
|
-
var _useContext = useContext(WorkbookContext),
|
|
7381
|
-
context = _useContext.context,
|
|
7382
|
-
setContext = _useContext.setContext,
|
|
7383
|
-
settings = _useContext.settings,
|
|
7384
|
-
refs = _useContext.refs;
|
|
7385
|
-
var contextMenu = context.contextMenu;
|
|
7386
|
-
var _useAlert = useAlert(),
|
|
7387
|
-
showAlert = _useAlert.showAlert;
|
|
7422
|
+
setContext = _useContext.setContext,
|
|
7423
|
+
settings = _useContext.settings,
|
|
7424
|
+
refs = _useContext.refs;
|
|
7425
|
+
var contextMenu = context.contextMenu;
|
|
7426
|
+
var _useAlert = useAlert(),
|
|
7427
|
+
showAlert = _useAlert.showAlert;
|
|
7388
7428
|
var _locale = locale(context),
|
|
7389
7429
|
rightclick = _locale.rightclick,
|
|
7390
7430
|
drag = _locale.drag,
|
|
@@ -7398,6 +7438,65 @@ var ContextMenu = function ContextMenu() {
|
|
|
7398
7438
|
key: "divider-".concat(i)
|
|
7399
7439
|
});
|
|
7400
7440
|
}
|
|
7441
|
+
if (name === "freeze-row") {
|
|
7442
|
+
var freezeState = getFreezeState(context);
|
|
7443
|
+
var isFrozen = freezeState.isRowFrozen;
|
|
7444
|
+
var isEntireRowSelected = (selection === null || selection === void 0 ? void 0 : selection.row_select) === true;
|
|
7445
|
+
if (!isEntireRowSelected) return null;
|
|
7446
|
+
return /*#__PURE__*/React.createElement(Menu, {
|
|
7447
|
+
key: "freeze-row",
|
|
7448
|
+
onClick: function onClick() {
|
|
7449
|
+
setContext(function (draftCtx) {
|
|
7450
|
+
if (isFrozen) {
|
|
7451
|
+
toggleFreeze(draftCtx, "unfreeze-row");
|
|
7452
|
+
} else {
|
|
7453
|
+
toggleFreeze(draftCtx, "row");
|
|
7454
|
+
}
|
|
7455
|
+
draftCtx.contextMenu = {};
|
|
7456
|
+
});
|
|
7457
|
+
}
|
|
7458
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7459
|
+
className: "context-item"
|
|
7460
|
+
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
7461
|
+
name: "freeze-flv",
|
|
7462
|
+
width: 18,
|
|
7463
|
+
height: 18,
|
|
7464
|
+
style: {
|
|
7465
|
+
marginTop: "4px",
|
|
7466
|
+
marginRight: "4px"
|
|
7467
|
+
}
|
|
7468
|
+
}), isFrozen ? "Unfreeze row" : "Freeze to current row"));
|
|
7469
|
+
}
|
|
7470
|
+
if (name === "freeze-column") {
|
|
7471
|
+
var _freezeState = getFreezeState(context);
|
|
7472
|
+
var _isFrozen = _freezeState.isColFrozen;
|
|
7473
|
+
var isEntireColumnSelected = (selection === null || selection === void 0 ? void 0 : selection.column_select) === true;
|
|
7474
|
+
if (!isEntireColumnSelected) return null;
|
|
7475
|
+
return /*#__PURE__*/React.createElement(Menu, {
|
|
7476
|
+
key: "freeze-column",
|
|
7477
|
+
onClick: function onClick() {
|
|
7478
|
+
setContext(function (draftCtx) {
|
|
7479
|
+
if (_isFrozen) {
|
|
7480
|
+
toggleFreeze(draftCtx, "unfreeze-column");
|
|
7481
|
+
} else {
|
|
7482
|
+
toggleFreeze(draftCtx, "column");
|
|
7483
|
+
jfrefreshgrid(draftCtx, null, undefined, false);
|
|
7484
|
+
}
|
|
7485
|
+
draftCtx.contextMenu = {};
|
|
7486
|
+
});
|
|
7487
|
+
}
|
|
7488
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7489
|
+
className: "context-item"
|
|
7490
|
+
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
7491
|
+
name: "freeze-flv",
|
|
7492
|
+
width: 18,
|
|
7493
|
+
height: 18,
|
|
7494
|
+
style: {
|
|
7495
|
+
marginTop: "4px",
|
|
7496
|
+
marginRight: "4px"
|
|
7497
|
+
}
|
|
7498
|
+
}), /*#__PURE__*/React.createElement("p", null, _isFrozen ? "Unfreeze column" : "Freeze to current column")));
|
|
7499
|
+
}
|
|
7401
7500
|
if (name === "comment") {
|
|
7402
7501
|
return /*#__PURE__*/React.createElement(Menu, {
|
|
7403
7502
|
key: name,
|
|
@@ -7516,19 +7615,14 @@ var ContextMenu = function ContextMenu() {
|
|
|
7516
7615
|
}, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
7517
7616
|
name: "insert-flv",
|
|
7518
7617
|
width: 18,
|
|
7519
|
-
height: 18
|
|
7520
|
-
|
|
7521
|
-
marginRight: "8px",
|
|
7522
|
-
position: "relative",
|
|
7523
|
-
top: "3px"
|
|
7524
|
-
}
|
|
7525
|
-
}), _.startsWith((_context$lang = context.lang) !== null && _context$lang !== void 0 ? _context$lang : "", "zh") && (/*#__PURE__*/React.createElement(React.Fragment, null, rightclick.to, /*#__PURE__*/React.createElement("span", {
|
|
7618
|
+
height: 18
|
|
7619
|
+
}), /*#__PURE__*/React.createElement("div", null, _.startsWith((_context$lang = context.lang) !== null && _context$lang !== void 0 ? _context$lang : "", "zh") && (/*#__PURE__*/React.createElement(React.Fragment, null, rightclick.to, /*#__PURE__*/React.createElement("span", {
|
|
7526
7620
|
className: "luckysheet-cols-rows-shift-".concat(dir)
|
|
7527
7621
|
}, rightclick[dir]))), "".concat(rightclick.insert, " "), "1", /*#__PURE__*/React.createElement("span", {
|
|
7528
7622
|
className: "luckysheet-cols-rows-shift-word luckysheet-mousedown-cancel"
|
|
7529
7623
|
}, " ".concat(rightclick.column, " ")), !_.startsWith((_context$lang2 = context.lang) !== null && _context$lang2 !== void 0 ? _context$lang2 : "", "zh") && (/*#__PURE__*/React.createElement("span", {
|
|
7530
7624
|
className: "luckysheet-cols-rows-shift-".concat(dir)
|
|
7531
|
-
}, rightclick[dir]))));
|
|
7625
|
+
}, rightclick[dir])))));
|
|
7532
7626
|
});
|
|
7533
7627
|
}
|
|
7534
7628
|
if (name === "insert-row") {
|
|
@@ -7564,19 +7658,14 @@ var ContextMenu = function ContextMenu() {
|
|
|
7564
7658
|
}, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
7565
7659
|
name: "insert-flv",
|
|
7566
7660
|
width: 18,
|
|
7567
|
-
height: 18
|
|
7568
|
-
|
|
7569
|
-
marginRight: "8px",
|
|
7570
|
-
position: "relative",
|
|
7571
|
-
top: "3px"
|
|
7572
|
-
}
|
|
7573
|
-
}), _.startsWith((_context$lang3 = context.lang) !== null && _context$lang3 !== void 0 ? _context$lang3 : "", "zh") && (/*#__PURE__*/React.createElement(React.Fragment, null, rightclick.to, /*#__PURE__*/React.createElement("span", {
|
|
7661
|
+
height: 18
|
|
7662
|
+
}), /*#__PURE__*/React.createElement("div", null, _.startsWith((_context$lang3 = context.lang) !== null && _context$lang3 !== void 0 ? _context$lang3 : "", "zh") && (/*#__PURE__*/React.createElement(React.Fragment, null, rightclick.to, /*#__PURE__*/React.createElement("span", {
|
|
7574
7663
|
className: "luckysheet-cols-rows-shift-".concat(dir)
|
|
7575
7664
|
}, rightclick[dir]))), "".concat(rightclick.insert, " "), "1", /*#__PURE__*/React.createElement("span", {
|
|
7576
7665
|
className: "luckysheet-cols-rows-shift-word luckysheet-mousedown-cancel"
|
|
7577
7666
|
}, " ".concat(rightclick.row, " ")), !_.startsWith((_context$lang4 = context.lang) !== null && _context$lang4 !== void 0 ? _context$lang4 : "", "zh") && (/*#__PURE__*/React.createElement("span", {
|
|
7578
7667
|
className: "luckysheet-cols-rows-shift-".concat(dir)
|
|
7579
|
-
}, rightclick[dir]))));
|
|
7668
|
+
}, rightclick[dir])))));
|
|
7580
7669
|
});
|
|
7581
7670
|
}
|
|
7582
7671
|
if (name === "delete-column") {
|
|
@@ -7838,49 +7927,152 @@ var ContextMenu = function ContextMenu() {
|
|
|
7838
7927
|
}
|
|
7839
7928
|
}), /*#__PURE__*/React.createElement("p", null, rightclick.clearContent)));
|
|
7840
7929
|
}
|
|
7841
|
-
if (name === "orderAZ") {
|
|
7842
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
7843
|
-
key: name,
|
|
7844
|
-
onClick: function onClick() {
|
|
7845
|
-
setContext(function (draftCtx) {
|
|
7846
|
-
sortSelection(draftCtx, true);
|
|
7847
|
-
draftCtx.contextMenu = {};
|
|
7848
|
-
});
|
|
7849
|
-
}
|
|
7850
|
-
}, rightclick.orderAZ);
|
|
7851
|
-
}
|
|
7852
|
-
if (name === "orderZA") {
|
|
7853
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
7854
|
-
key: name,
|
|
7855
|
-
onClick: function onClick() {
|
|
7856
|
-
setContext(function (draftCtx) {
|
|
7857
|
-
sortSelection(draftCtx, false);
|
|
7858
|
-
draftCtx.contextMenu = {};
|
|
7859
|
-
});
|
|
7860
|
-
}
|
|
7861
|
-
}, rightclick.orderZA);
|
|
7862
|
-
}
|
|
7863
7930
|
if (name === "sort") {
|
|
7864
|
-
|
|
7931
|
+
var _locale2 = locale(context),
|
|
7932
|
+
sort = _locale2.sort;
|
|
7933
|
+
return /*#__PURE__*/React.createElement(Tippy, {
|
|
7865
7934
|
key: name,
|
|
7866
|
-
|
|
7867
|
-
|
|
7868
|
-
|
|
7869
|
-
|
|
7870
|
-
|
|
7935
|
+
placement: "right-start",
|
|
7936
|
+
interactive: true,
|
|
7937
|
+
interactiveBorder: 50,
|
|
7938
|
+
offset: [0, 0],
|
|
7939
|
+
arrow: false,
|
|
7940
|
+
zIndex: 3000,
|
|
7941
|
+
appendTo: document.body,
|
|
7942
|
+
content: /*#__PURE__*/React.createElement("div", {
|
|
7943
|
+
className: "fortune-toolbar-select",
|
|
7944
|
+
style: {
|
|
7945
|
+
minWidth: "11.25rem"
|
|
7946
|
+
}
|
|
7947
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7948
|
+
className: "flex flex-col color-text-default text-body-sm"
|
|
7949
|
+
}, /*#__PURE__*/React.createElement(Menu, {
|
|
7950
|
+
onClick: function onClick() {
|
|
7951
|
+
setContext(function (draftCtx) {
|
|
7952
|
+
sortSelection(draftCtx, true);
|
|
7953
|
+
draftCtx.contextMenu = {};
|
|
7954
|
+
});
|
|
7955
|
+
}
|
|
7956
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7957
|
+
className: "context-item p-2 w-full",
|
|
7958
|
+
style: {
|
|
7959
|
+
height: "40px"
|
|
7960
|
+
}
|
|
7961
|
+
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
7962
|
+
name: "sort-asc",
|
|
7963
|
+
width: 22,
|
|
7964
|
+
style: {
|
|
7965
|
+
marginRight: "4px"
|
|
7966
|
+
}
|
|
7967
|
+
}), /*#__PURE__*/React.createElement("p", null, sort.asc))), /*#__PURE__*/React.createElement(Menu, {
|
|
7968
|
+
onClick: function onClick() {
|
|
7969
|
+
setContext(function (draftCtx) {
|
|
7970
|
+
sortSelection(draftCtx, false);
|
|
7971
|
+
draftCtx.contextMenu = {};
|
|
7972
|
+
});
|
|
7973
|
+
}
|
|
7974
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7975
|
+
className: "context-item p-2 w-full",
|
|
7976
|
+
style: {
|
|
7977
|
+
height: "40px"
|
|
7978
|
+
}
|
|
7979
|
+
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
7980
|
+
name: "sort-desc",
|
|
7981
|
+
width: 22,
|
|
7982
|
+
style: {
|
|
7983
|
+
marginRight: "4px"
|
|
7984
|
+
}
|
|
7985
|
+
}), /*#__PURE__*/React.createElement("p", null, sort.desc))))),
|
|
7986
|
+
trigger: "mouseenter focus",
|
|
7987
|
+
hideOnClick: false
|
|
7988
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement("div", {
|
|
7989
|
+
className: "flex items-center justify-between w-full"
|
|
7990
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7991
|
+
className: "context-item"
|
|
7992
|
+
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
7993
|
+
name: "sort-flv",
|
|
7994
|
+
width: 18,
|
|
7995
|
+
height: 18,
|
|
7996
|
+
style: {
|
|
7997
|
+
marginRight: "8px"
|
|
7871
7998
|
}
|
|
7872
|
-
}, rightclick.sortSelection)
|
|
7999
|
+
}), /*#__PURE__*/React.createElement("p", null, rightclick.sortSelection)), /*#__PURE__*/React.createElement(SVGIcon, {
|
|
8000
|
+
name: "rightArrow",
|
|
8001
|
+
width: 18
|
|
8002
|
+
})))));
|
|
7873
8003
|
}
|
|
7874
8004
|
if (name === "filter") {
|
|
7875
|
-
|
|
8005
|
+
var _locale3 = locale(context),
|
|
8006
|
+
filter = _locale3.filter;
|
|
8007
|
+
return /*#__PURE__*/React.createElement(Tippy, {
|
|
7876
8008
|
key: name,
|
|
7877
|
-
|
|
7878
|
-
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
8009
|
+
placement: "right-start",
|
|
8010
|
+
interactive: true,
|
|
8011
|
+
interactiveBorder: 50,
|
|
8012
|
+
offset: [0, 0],
|
|
8013
|
+
arrow: false,
|
|
8014
|
+
zIndex: 3000,
|
|
8015
|
+
appendTo: document.body,
|
|
8016
|
+
content: /*#__PURE__*/React.createElement("div", {
|
|
8017
|
+
className: "fortune-toolbar-select",
|
|
8018
|
+
style: {
|
|
8019
|
+
minWidth: "11.25rem"
|
|
8020
|
+
}
|
|
8021
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
8022
|
+
className: "flex flex-col color-text-default text-body-sm"
|
|
8023
|
+
}, /*#__PURE__*/React.createElement(Menu, {
|
|
8024
|
+
onClick: function onClick() {
|
|
8025
|
+
setContext(function (draftCtx) {
|
|
8026
|
+
createFilter(draftCtx);
|
|
8027
|
+
draftCtx.contextMenu = {};
|
|
8028
|
+
});
|
|
8029
|
+
}
|
|
8030
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
8031
|
+
className: "context-item p-2 w-full",
|
|
8032
|
+
style: {
|
|
8033
|
+
height: "40px"
|
|
8034
|
+
}
|
|
8035
|
+
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
8036
|
+
name: "filter",
|
|
8037
|
+
width: 22,
|
|
8038
|
+
style: {
|
|
8039
|
+
marginRight: "4px"
|
|
8040
|
+
}
|
|
8041
|
+
}), /*#__PURE__*/React.createElement("p", null, filter.filter))), /*#__PURE__*/React.createElement(Menu, {
|
|
8042
|
+
onClick: function onClick() {
|
|
8043
|
+
setContext(function (draftCtx) {
|
|
8044
|
+
clearFilter(draftCtx);
|
|
8045
|
+
draftCtx.contextMenu = {};
|
|
8046
|
+
});
|
|
8047
|
+
}
|
|
8048
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
8049
|
+
className: "context-item p-2 w-full",
|
|
8050
|
+
style: {
|
|
8051
|
+
height: "40px"
|
|
8052
|
+
}
|
|
8053
|
+
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
8054
|
+
name: "eraser",
|
|
8055
|
+
width: 22,
|
|
8056
|
+
style: {
|
|
8057
|
+
marginRight: "4px"
|
|
8058
|
+
}
|
|
8059
|
+
}), /*#__PURE__*/React.createElement("p", null, filter.clearFilter))))),
|
|
8060
|
+
trigger: "mouseenter focus",
|
|
8061
|
+
hideOnClick: false
|
|
8062
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement("div", {
|
|
8063
|
+
className: "flex items-center justify-between w-full"
|
|
8064
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
8065
|
+
className: "context-item"
|
|
8066
|
+
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
8067
|
+
name: "filter",
|
|
8068
|
+
width: 22,
|
|
8069
|
+
style: {
|
|
8070
|
+
marginRight: "4px"
|
|
7882
8071
|
}
|
|
7883
|
-
}, rightclick.filterSelection)
|
|
8072
|
+
}), /*#__PURE__*/React.createElement("p", null, rightclick.filterSelection)), /*#__PURE__*/React.createElement(SVGIcon, {
|
|
8073
|
+
name: "rightArrow",
|
|
8074
|
+
width: 18
|
|
8075
|
+
})))));
|
|
7884
8076
|
}
|
|
7885
8077
|
if (name === "image") {
|
|
7886
8078
|
return /*#__PURE__*/React.createElement(Menu, {
|
|
@@ -7904,8 +8096,45 @@ var ContextMenu = function ContextMenu() {
|
|
|
7904
8096
|
}
|
|
7905
8097
|
}, rightclick.link);
|
|
7906
8098
|
}
|
|
8099
|
+
if (name === "conditionFormat") {
|
|
8100
|
+
var closeContextMenu = function closeContextMenu() {
|
|
8101
|
+
return setContext(function (ctx) {
|
|
8102
|
+
ctx.contextMenu = {};
|
|
8103
|
+
});
|
|
8104
|
+
};
|
|
8105
|
+
return /*#__PURE__*/React.createElement(Tippy, {
|
|
8106
|
+
key: name,
|
|
8107
|
+
placement: "right-start",
|
|
8108
|
+
interactive: true,
|
|
8109
|
+
interactiveBorder: 50,
|
|
8110
|
+
offset: [0, 0],
|
|
8111
|
+
arrow: false,
|
|
8112
|
+
zIndex: 3000,
|
|
8113
|
+
appendTo: document.body,
|
|
8114
|
+
content: /*#__PURE__*/React.createElement("div", {
|
|
8115
|
+
style: {
|
|
8116
|
+
minWidth: 220
|
|
8117
|
+
}
|
|
8118
|
+
}, /*#__PURE__*/React.createElement(ConditionalFormat, {
|
|
8119
|
+
items: ["highlightCellRules", "itemSelectionRules", "-", "deleteRule"],
|
|
8120
|
+
setOpen: closeContextMenu
|
|
8121
|
+
})),
|
|
8122
|
+
trigger: "mouseenter focus",
|
|
8123
|
+
hideOnClick: false
|
|
8124
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement("div", {
|
|
8125
|
+
className: "flex items-center justify-between w-full"
|
|
8126
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
8127
|
+
className: "flex items-center gap-2"
|
|
8128
|
+
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
8129
|
+
name: "conditionFormat",
|
|
8130
|
+
width: 18
|
|
8131
|
+
}), /*#__PURE__*/React.createElement("p", null, rightclick.conditionFormat || "Conditional Format")), /*#__PURE__*/React.createElement(SVGIcon, {
|
|
8132
|
+
name: "rightArrow",
|
|
8133
|
+
width: 18
|
|
8134
|
+
})))));
|
|
8135
|
+
}
|
|
7907
8136
|
return null;
|
|
7908
|
-
}, [context
|
|
8137
|
+
}, [context, setContext, refs.globalCache, rightclick, showAlert, showDialog, drag.noMulti, info.tipRowHeightLimit, info.tipColumnWidthLimit, generalDialog.partiallyError, generalDialog.readOnlyError, generalDialog.dataNullError]);
|
|
7909
8138
|
useLayoutEffect(function () {
|
|
7910
8139
|
var _refs$workbookContain;
|
|
7911
8140
|
if (!containerRef.current) {
|
|
@@ -9173,31 +9402,41 @@ var SVGDefines = function SVGDefines(_ref) {
|
|
|
9173
9402
|
stroke: "#535A68",
|
|
9174
9403
|
strokeWidth: "1.5"
|
|
9175
9404
|
})), /*#__PURE__*/React.createElement("symbol", {
|
|
9176
|
-
|
|
9177
|
-
|
|
9178
|
-
|
|
9405
|
+
id: "sort-desc",
|
|
9406
|
+
width: "18",
|
|
9407
|
+
height: "18",
|
|
9408
|
+
viewBox: "0 0 18 18",
|
|
9409
|
+
fill: "none"
|
|
9179
9410
|
}, /*#__PURE__*/React.createElement("path", {
|
|
9180
|
-
d: "
|
|
9181
|
-
|
|
9411
|
+
d: "M6.75 12.75C7.16421 12.75 7.5 13.0858 7.5 13.5C7.5 13.9142 7.16421 14.25 6.75 14.25H5.25C4.83579 14.25 4.5 13.9142 4.5 13.5C4.5 13.0858 4.83579 12.75 5.25 12.75H6.75Z",
|
|
9412
|
+
fill: "#363B3F"
|
|
9182
9413
|
}), /*#__PURE__*/React.createElement("path", {
|
|
9183
|
-
d: "
|
|
9184
|
-
|
|
9414
|
+
d: "M9 9.75C9.41421 9.75 9.75 10.0858 9.75 10.5C9.75 10.9142 9.41421 11.25 9 11.25H5.25C4.83579 11.25 4.5 10.9142 4.5 10.5C4.5 10.0858 4.83579 9.75 5.25 9.75H9Z",
|
|
9415
|
+
fill: "#363B3F"
|
|
9185
9416
|
}), /*#__PURE__*/React.createElement("path", {
|
|
9186
|
-
d: "
|
|
9187
|
-
|
|
9188
|
-
})
|
|
9189
|
-
|
|
9190
|
-
fill: "#
|
|
9191
|
-
|
|
9417
|
+
d: "M11.25 6.75C11.6642 6.75 12 7.08579 12 7.5C12 7.91421 11.6642 8.25 11.25 8.25H5.25C4.83579 8.25 4.5 7.91421 4.5 7.5C4.5 7.08579 4.83579 6.75 5.25 6.75H11.25Z",
|
|
9418
|
+
fill: "#363B3F"
|
|
9419
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
9420
|
+
d: "M13.5 3.75C13.9142 3.75 14.25 4.08579 14.25 4.5C14.25 4.91421 13.9142 5.25 13.5 5.25H5.25C4.83579 5.25 4.5 4.91421 4.5 4.5C4.5 4.08579 4.83579 3.75 5.25 3.75H13.5Z",
|
|
9421
|
+
fill: "#363B3F"
|
|
9422
|
+
})), /*#__PURE__*/React.createElement("symbol", {
|
|
9423
|
+
id: "sort-asc",
|
|
9424
|
+
width: "18",
|
|
9425
|
+
height: "18",
|
|
9426
|
+
viewBox: "0 0 18 18",
|
|
9427
|
+
fill: "none"
|
|
9192
9428
|
}, /*#__PURE__*/React.createElement("path", {
|
|
9193
|
-
d: "
|
|
9194
|
-
|
|
9429
|
+
d: "M13.5 12.75C13.9142 12.75 14.25 13.0858 14.25 13.5C14.25 13.9142 13.9142 14.25 13.5 14.25H5.25C4.83579 14.25 4.5 13.9142 4.5 13.5C4.5 13.0858 4.83579 12.75 5.25 12.75H13.5Z",
|
|
9430
|
+
fill: "#363B3F"
|
|
9195
9431
|
}), /*#__PURE__*/React.createElement("path", {
|
|
9196
|
-
d: "
|
|
9197
|
-
|
|
9432
|
+
d: "M11.25 9.75C11.6642 9.75 12 10.0858 12 10.5C12 10.9142 11.6642 11.25 11.25 11.25H5.25C4.83579 11.25 4.5 10.9142 4.5 10.5C4.5 10.0858 4.83579 9.75 5.25 9.75H11.25Z",
|
|
9433
|
+
fill: "#363B3F"
|
|
9434
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
9435
|
+
d: "M9 6.75C9.41421 6.75 9.75 7.08579 9.75 7.5C9.75 7.91421 9.41421 8.25 9 8.25H5.25C4.83579 8.25 4.5 7.91421 4.5 7.5C4.5 7.08579 4.83579 6.75 5.25 6.75H9Z",
|
|
9436
|
+
fill: "#363B3F"
|
|
9198
9437
|
}), /*#__PURE__*/React.createElement("path", {
|
|
9199
|
-
d: "
|
|
9200
|
-
|
|
9438
|
+
d: "M6.75 3.75C7.16421 3.75 7.5 4.08579 7.5 4.5C7.5 4.91421 7.16421 5.25 6.75 5.25H5.25C4.83579 5.25 4.5 4.91421 4.5 4.5C4.5 4.08579 4.83579 3.75 5.25 3.75H6.75Z",
|
|
9439
|
+
fill: "#363B3F"
|
|
9201
9440
|
})), /*#__PURE__*/React.createElement("symbol", {
|
|
9202
9441
|
viewBox: "0 0 1024 1024",
|
|
9203
9442
|
fill: "#535A68",
|
|
@@ -9260,13 +9499,16 @@ var SVGDefines = function SVGDefines(_ref) {
|
|
|
9260
9499
|
d: "M4.66663 1.33334C4.66663 0.965149 4.36815 0.666672 3.99996 0.666672C3.63177 0.666672 3.33329 0.965149 3.33329 1.33334V3.33334H1.33329C0.965103 3.33334 0.666626 3.63182 0.666626 4C0.666626 4.36819 0.965103 4.66667 1.33329 4.66667H3.33329V10.6667C3.33329 11.1971 3.54401 11.7058 3.91908 12.0809C4.29415 12.456 4.80286 12.6667 5.33329 12.6667H11.3333V14.6667C11.3333 15.0349 11.6318 15.3333 12 15.3333C12.3681 15.3333 12.6666 15.0349 12.6666 14.6667V12.6667H14.6666C15.0348 12.6667 15.3333 12.3682 15.3333 12C15.3333 11.6318 15.0348 11.3333 14.6666 11.3333H12.6666V5.33334C12.6666 4.8029 12.4559 4.2942 12.0808 3.91912C11.7058 3.54405 11.1971 3.33334 10.6666 3.33334H4.66663V1.33334ZM4.66663 4.66667V10.6667C4.66663 10.8435 4.73686 11.0131 4.86189 11.1381C4.98691 11.2631 5.15648 11.3333 5.33329 11.3333H11.3333V5.33334C11.3333 5.15653 11.2631 4.98696 11.138 4.86193C11.013 4.73691 10.8434 4.66667 10.6666 4.66667H4.66663Z",
|
|
9261
9500
|
fill: "#363B3F"
|
|
9262
9501
|
}))), /*#__PURE__*/React.createElement("symbol", {
|
|
9263
|
-
|
|
9264
|
-
|
|
9265
|
-
|
|
9266
|
-
|
|
9502
|
+
width: "20",
|
|
9503
|
+
height: "24",
|
|
9504
|
+
viewBox: "0 0 16 16",
|
|
9505
|
+
fill: "none",
|
|
9506
|
+
id: "conditionFormat"
|
|
9267
9507
|
}, /*#__PURE__*/React.createElement("path", {
|
|
9268
|
-
|
|
9269
|
-
"
|
|
9508
|
+
"fill-rule": "evenodd",
|
|
9509
|
+
"clip-rule": "evenodd",
|
|
9510
|
+
d: "M11.4661 0.673182C11.7715 0.703436 12.0585 0.838439 12.2773 1.0573C12.5274 1.30735 12.668 1.64638 12.668 2.00001V7.51303C12.7678 7.57076 12.861 7.64098 12.944 7.72396C13.1941 7.97401 13.3346 8.31305 13.3346 8.66667V9.33334C13.3346 9.86377 13.1238 10.3723 12.7487 10.7474C12.3736 11.1225 11.8651 11.3333 11.3346 11.3333H10.0013V13.2669C10.0012 13.7973 9.79038 14.306 9.41536 14.681C9.0403 15.056 8.53167 15.2669 8.0013 15.2669C7.47093 15.2669 6.9623 15.056 6.58724 14.681C6.21223 14.306 6.00137 13.7973 6.0013 13.2669V11.3333H4.66797C4.13754 11.3333 3.62898 11.1225 3.25391 10.7474C2.92577 10.4193 2.72324 9.98901 2.67773 9.53125L2.66797 9.33334V8.66667C2.66797 8.31305 2.80855 7.97401 3.05859 7.72396C3.14158 7.64098 3.23477 7.57076 3.33464 7.51303V2.00001C3.33464 1.64638 3.47521 1.30734 3.72526 1.0573C3.97531 0.807248 4.31435 0.666672 4.66797 0.666672H11.3346L11.4661 0.673182ZM4.0013 8.66667V9.33334L4.00456 9.39909C4.01968 9.55176 4.08719 9.69526 4.19661 9.80469C4.32164 9.92972 4.49116 10 4.66797 10H6.0013C6.35492 10 6.69396 10.1406 6.94401 10.3906C7.19406 10.6407 7.33464 10.9797 7.33464 11.3333V13.2669C7.3347 13.4436 7.40498 13.6133 7.52995 13.7383C7.65496 13.8632 7.82455 13.9336 8.0013 13.9336C8.17805 13.9336 8.34764 13.8632 8.47266 13.7383C8.59762 13.6133 8.6679 13.4436 8.66797 13.2669V11.3333C8.66797 10.9797 8.80855 10.6407 9.05859 10.3906C9.30864 10.1406 9.64768 10 10.0013 10H11.3346C11.5114 10 11.681 9.92972 11.806 9.80469C11.931 9.67967 12.0013 9.51015 12.0013 9.33334V8.66667H4.0013ZM4.66797 7.33334H11.3346V2.00001H10.0013V4C10.0013 4.36819 9.70283 4.66667 9.33463 4.66667C8.96644 4.66667 8.66797 4.36819 8.66797 4V2.00001H7.33464V2.66667C7.33464 3.03486 7.03616 3.33334 6.66797 3.33334C6.29978 3.33334 6.0013 3.03486 6.0013 2.66667V2.00001H4.66797V7.33334Z",
|
|
9511
|
+
fill: "#363B3F"
|
|
9270
9512
|
})), /*#__PURE__*/React.createElement("symbol", {
|
|
9271
9513
|
viewBox: "0 0 1024 1024",
|
|
9272
9514
|
fill: "#535A68",
|
|
@@ -9372,19 +9614,29 @@ var SVGDefines = function SVGDefines(_ref) {
|
|
|
9372
9614
|
d: "M0.728617 1.71942C0.837856 1.48397 1.07381 1.33333 1.33336 1.33333H14.6667C14.9262 1.33333 15.1622 1.48397 15.2714 1.71942C15.3807 1.95486 15.3433 2.2323 15.1757 2.43048L10 8.55077V14C10 14.2311 9.88039 14.4456 9.68385 14.5671C9.48731 14.6886 9.24188 14.6996 9.03522 14.5963L6.36855 13.263C6.1427 13.15 6.00003 12.9192 6.00003 12.6667V8.55077L0.824316 2.43048C0.656718 2.2323 0.619379 1.95486 0.728617 1.71942ZM2.77023 2.66667L7.17574 7.87618C7.27752 7.99653 7.33336 8.14905 7.33336 8.30667V12.2546L8.6667 12.9213V8.30667C8.6667 8.14905 8.72254 7.99653 8.82432 7.87618L13.2298 2.66667H2.77023Z",
|
|
9373
9615
|
fill: "#363B3F"
|
|
9374
9616
|
}))), /*#__PURE__*/React.createElement("symbol", {
|
|
9375
|
-
|
|
9376
|
-
|
|
9377
|
-
|
|
9617
|
+
id: "filter1",
|
|
9618
|
+
width: "18",
|
|
9619
|
+
height: "18",
|
|
9620
|
+
viewBox: "0 0 18 18",
|
|
9621
|
+
fill: "none"
|
|
9378
9622
|
}, /*#__PURE__*/React.createElement("path", {
|
|
9379
|
-
d: "
|
|
9380
|
-
|
|
9623
|
+
d: "M10.0149 1.5C10.4291 1.5 10.7649 1.83579 10.7649 2.25C10.7649 2.66421 10.4291 3 10.0149 3H2.24975L7.66821 8.99121L7.80004 9.15161C8.09041 9.53914 8.24953 10.0121 8.24975 10.5V15.0007L9.74902 15.75L9.74975 10.5C9.75 9.9426 9.95667 9.4046 10.3306 8.99121L11.2439 7.98047L11.2988 7.92627C11.5809 7.67149 12.0156 7.66669 12.3037 7.927C12.6108 8.20473 12.6348 8.67881 12.3572 8.98608L11.4438 9.99683L11.4431 9.99756C11.3186 10.1353 11.2499 10.3143 11.2498 10.5V15.75L11.2468 15.8452C11.2327 16.0677 11.1689 16.2847 11.0601 16.4802C10.9356 16.7036 10.756 16.8914 10.5386 17.0259C10.3211 17.1604 10.0726 17.237 9.81713 17.2485C9.5937 17.2586 9.37132 17.2188 9.16601 17.1321L9.07885 17.0918L7.57885 16.3418C7.32961 16.2172 7.11961 16.0259 6.97314 15.7888C6.84501 15.5814 6.77019 15.3462 6.75341 15.104L6.74975 15V10.5C6.7496 10.3375 6.69633 10.1801 6.5996 10.051L6.55566 9.99756L1.13647 4.00562C0.94211 3.79026 0.81445 3.52231 0.768793 3.23584C0.723182 2.94943 0.760896 2.65567 0.878656 2.39062C0.996448 2.12559 1.18922 1.90053 1.43237 1.74243C1.67547 1.58442 1.95908 1.50014 2.24902 1.5H10.0149Z",
|
|
9624
|
+
fill: "#363B3F"
|
|
9625
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
9626
|
+
d: "M14.2498 1.5C14.6638 1.50014 14.9998 1.83587 14.9998 2.25V3.75H16.4998C16.9138 3.75014 17.2498 4.08587 17.2498 4.5C17.2498 4.91413 16.9138 5.24986 16.4998 5.25H14.9998V6.75C14.9998 7.16413 14.6638 7.49986 14.2498 7.5C13.8355 7.5 13.4998 7.16421 13.4998 6.75V5.25H11.9998C11.5855 5.25 11.2498 4.91421 11.2498 4.5C11.2498 4.08579 11.5855 3.75 11.9998 3.75H13.4998V2.25C13.4998 1.83579 13.8355 1.5 14.2498 1.5Z",
|
|
9627
|
+
fill: "#363B3F"
|
|
9381
9628
|
})), /*#__PURE__*/React.createElement("symbol", {
|
|
9382
|
-
|
|
9383
|
-
|
|
9384
|
-
|
|
9629
|
+
id: "eraser",
|
|
9630
|
+
width: "18",
|
|
9631
|
+
height: "18",
|
|
9632
|
+
viewBox: "0 0 18 18",
|
|
9633
|
+
fill: "none"
|
|
9385
9634
|
}, /*#__PURE__*/React.createElement("path", {
|
|
9386
|
-
d: "
|
|
9387
|
-
|
|
9635
|
+
d: "M9.39746 1.5C9.81167 1.5 10.1475 1.83579 10.1475 2.25C10.1475 2.66421 9.81167 3 9.39746 3H2.24975L7.66821 8.99121L7.80004 9.15161C8.09041 9.53914 8.24953 10.0121 8.24975 10.5V15.0007L9.74902 15.75L9.74975 10.5C9.75 9.94243 9.95719 9.40465 10.3313 8.99121L10.6506 8.63672L10.7048 8.58252C10.9867 8.32757 11.4214 8.32258 11.7097 8.58252C12.0172 8.86008 12.0415 9.33487 11.7639 9.64233L11.4438 9.99683L11.4431 9.99756C11.3186 10.1353 11.2499 10.3143 11.2498 10.5V15.75L11.2468 15.8452C11.2327 16.0677 11.1689 16.2847 11.0601 16.4802C10.9356 16.7036 10.756 16.8914 10.5386 17.0259C10.3211 17.1604 10.0726 17.237 9.81713 17.2485C9.5937 17.2586 9.37132 17.2188 9.16601 17.1321L9.07885 17.0918L7.57885 16.3418C7.32961 16.2172 7.11961 16.0259 6.97314 15.7888C6.84501 15.5814 6.77019 15.3462 6.75341 15.104L6.74975 15V10.5C6.7496 10.3375 6.69633 10.1801 6.5996 10.051L6.55566 9.99756L1.13647 4.00562C0.94211 3.79026 0.81445 3.52231 0.768793 3.23584C0.723182 2.94943 0.760896 2.65567 0.878656 2.39062C0.996448 2.12559 1.18922 1.90053 1.43237 1.74243C1.67547 1.58442 1.95908 1.50014 2.24902 1.5H9.39746Z",
|
|
9636
|
+
fill: "#363B3F"
|
|
9637
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
9638
|
+
d: "M11.8445 2.09473C12.1191 1.82027 12.5534 1.80323 12.8479 2.04346L12.905 2.09473L14.2498 3.43945L15.5945 2.09473L15.6516 2.04346C15.9462 1.80333 16.3805 1.82019 16.655 2.09473C16.9294 2.36928 16.9464 2.80361 16.7063 3.09814L16.655 3.15527L15.3103 4.5L16.655 5.84473L16.7063 5.90186C16.9464 6.19639 16.9294 6.63072 16.655 6.90527C16.3805 7.17981 15.9462 7.19667 15.6516 6.95654L15.5945 6.90527L14.2498 5.56055L12.905 6.90527C12.6122 7.19812 12.1374 7.19804 11.8445 6.90527C11.5516 6.61238 11.5516 6.13762 11.8445 5.84473L13.1892 4.5L11.8445 3.15527L11.7932 3.09814C11.5529 2.80356 11.5699 2.36931 11.8445 2.09473Z",
|
|
9639
|
+
fill: "#363B3F"
|
|
9388
9640
|
})), /*#__PURE__*/React.createElement("symbol", {
|
|
9389
9641
|
viewBox: "0 0 1057 1024",
|
|
9390
9642
|
fill: "#535A68",
|
|
@@ -9438,12 +9690,16 @@ var SVGDefines = function SVGDefines(_ref) {
|
|
|
9438
9690
|
fill: "",
|
|
9439
9691
|
"p-id": "5612"
|
|
9440
9692
|
})), /*#__PURE__*/React.createElement("symbol", {
|
|
9441
|
-
|
|
9442
|
-
|
|
9693
|
+
width: "16",
|
|
9694
|
+
height: "24",
|
|
9695
|
+
viewBox: "0 0 16 16",
|
|
9696
|
+
fill: "none",
|
|
9443
9697
|
id: "rightArrow"
|
|
9444
9698
|
}, /*#__PURE__*/React.createElement("path", {
|
|
9445
|
-
|
|
9446
|
-
"
|
|
9699
|
+
"fill-rule": "evenodd",
|
|
9700
|
+
"clip-rule": "evenodd",
|
|
9701
|
+
d: "M5.52729 3.52859C5.78764 3.26824 6.20975 3.26824 6.4701 3.52859L10.4701 7.52859C10.7305 7.78894 10.7305 8.21105 10.4701 8.4714L6.4701 12.4714C6.20975 12.7317 5.78764 12.7317 5.52729 12.4714C5.26694 12.2111 5.26694 11.7889 5.52729 11.5286L9.05589 8L5.52729 4.4714C5.26694 4.21105 5.26694 3.78894 5.52729 3.52859Z",
|
|
9702
|
+
fill: "#77818A"
|
|
9447
9703
|
})), /*#__PURE__*/React.createElement("symbol", {
|
|
9448
9704
|
viewBox: "0 0 1024 1024",
|
|
9449
9705
|
id: "downArrow"
|
|
@@ -9533,6 +9789,20 @@ var SVGDefines = function SVGDefines(_ref) {
|
|
|
9533
9789
|
"clip-rule": "evenodd",
|
|
9534
9790
|
d: "M3.75 1.5C3.15326 1.5 2.58097 1.73705 2.15901 2.15901C1.73705 2.58097 1.5 3.15326 1.5 3.75V15.75C1.5 16.0533 1.68273 16.3268 1.96299 16.4429C2.24324 16.559 2.56583 16.4948 2.78033 16.2803L5.56066 13.5H14.25C14.8467 13.5 15.419 13.2629 15.841 12.841C16.2629 12.419 16.5 11.8467 16.5 11.25V3.75C16.5 3.15326 16.2629 2.58097 15.841 2.15901C15.419 1.73705 14.8467 1.5 14.25 1.5H3.75ZM3.21967 3.21967C3.36032 3.07902 3.55109 3 3.75 3H14.25C14.4489 3 14.6397 3.07902 14.7803 3.21967C14.921 3.36032 15 3.55109 15 3.75V11.25C15 11.4489 14.921 11.6397 14.7803 11.7803C14.6397 11.921 14.4489 12 14.25 12H5.25C5.05109 12 4.86032 12.079 4.71967 12.2197L3 13.9393V3.75C3 3.55109 3.07902 3.36032 3.21967 3.21967Z",
|
|
9535
9791
|
fill: "#363B3F"
|
|
9792
|
+
}))), /*#__PURE__*/React.createElement("symbol", {
|
|
9793
|
+
id: "freeze-flv",
|
|
9794
|
+
viewBox: "0 0 24 24"
|
|
9795
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
9796
|
+
width: "18",
|
|
9797
|
+
height: "16",
|
|
9798
|
+
viewBox: "0 0 18 16",
|
|
9799
|
+
fill: "none",
|
|
9800
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
9801
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
9802
|
+
"fill-rule": "evenodd",
|
|
9803
|
+
"clip-rule": "evenodd",
|
|
9804
|
+
d: "M13.4208 1.58557C13.6061 1.21509 13.4559 0.764586 13.0854 0.579344C12.7149 0.394102 12.2644 0.54427 12.0792 0.914754L11.4375 2.19811L11.1708 1.66475C10.9856 1.29427 10.5351 1.1441 10.1646 1.32934C9.79411 1.51459 9.64394 1.96509 9.82918 2.33557L10.599 3.87516L10.0365 5.00016H7.96353L7.40103 3.87516L8.17083 2.33557C8.35607 1.96509 8.2059 1.51459 7.83541 1.32934C7.46493 1.1441 7.01443 1.29427 6.82918 1.66475L6.5625 2.19811L5.92082 0.914754C5.73558 0.54427 5.28508 0.394102 4.91459 0.579344C4.54411 0.764586 4.39394 1.21509 4.57918 1.58557L5.22086 2.86893L4.63417 2.76226C4.22664 2.68817 3.8362 2.95847 3.7621 3.366C3.688 3.77353 3.95831 4.16397 4.36584 4.23807L6.05939 4.54598L6.66148 5.75016L5.91147 7.25016H4.49999L3.6 6.05018C3.35147 5.71881 2.88137 5.65165 2.55 5.90018C2.21863 6.14871 2.15147 6.61881 2.4 6.95018L2.62499 7.25016H1.5C1.08579 7.25016 0.75 7.58595 0.75 8.00016C0.75 8.41438 1.08579 8.75016 1.5 8.75016H2.62501L2.4 9.05018C2.15147 9.38155 2.21863 9.85165 2.55 10.1002C2.88137 10.3487 3.35147 10.2816 3.6 9.95018L4.50001 8.75016H5.91148L6.66148 10.2502L6.05938 11.4544L4.36584 11.7623C3.95831 11.8364 3.688 12.2268 3.7621 12.6344C3.8362 13.0419 4.22664 13.3122 4.63417 13.2381L5.22085 13.1314L4.57918 14.4148C4.39394 14.7852 4.54411 15.2357 4.91459 15.421C5.28508 15.6062 5.73558 15.4561 5.92082 15.0856L6.5625 13.8022L6.82918 14.3356C7.01443 14.7061 7.46493 14.8562 7.83541 14.671C8.2059 14.4858 8.35607 14.0353 8.17083 13.6648L7.40102 12.1252L7.96352 11.0002H10.0365L10.599 12.1252L9.82918 13.6648C9.64394 14.0353 9.79411 14.4858 10.1646 14.671C10.5351 14.8562 10.9856 14.7061 11.1708 14.3356L11.4375 13.8022L12.0792 15.0856C12.2644 15.4561 12.7149 15.6062 13.0854 15.421C13.4559 15.2358 13.6061 14.7853 13.4208 14.4148L12.7791 13.1314L13.3658 13.2381C13.7734 13.3122 14.1638 13.0419 14.2379 12.6344C14.312 12.2268 14.0417 11.8364 13.6342 11.7623L11.9406 11.4544L11.3385 10.2502L12.0885 8.75018H13.5L14.4 9.95018C14.6485 10.2816 15.1186 10.3487 15.45 10.1002C15.7814 9.85165 15.8485 9.38155 15.6 9.05018L15.375 8.75018H16.5C16.9142 8.75018 17.25 8.4144 17.25 8.00018C17.25 7.58597 16.9142 7.25018 16.5 7.25018H15.375L15.6 6.95018C15.8485 6.61881 15.7814 6.14871 15.45 5.90018C15.1186 5.65165 14.6485 5.71881 14.4 6.05018L13.5 7.25018H12.0885L11.3385 5.75016L11.9406 4.54599L13.6342 4.23807C14.0417 4.16397 14.312 3.77353 14.2379 3.366C14.1638 2.95847 13.7734 2.68817 13.3658 2.76226L12.7791 2.86893L13.4208 1.58557ZM7.96353 6.50016L7.21353 8.00016L7.96354 9.50018H10.0365L10.7865 8.00018L10.0365 6.50016H7.96353Z",
|
|
9805
|
+
fill: "#363B3F"
|
|
9536
9806
|
}))), /*#__PURE__*/React.createElement("symbol", {
|
|
9537
9807
|
viewBox: "0 0 1024 1024",
|
|
9538
9808
|
id: "tab"
|
|
@@ -9547,6 +9817,32 @@ var SVGDefines = function SVGDefines(_ref) {
|
|
|
9547
9817
|
d: "M844.8 896c25.6 0 51.2-19.2 51.2-51.2v-185.6h-51.2c-44.8 0-83.2-38.4-83.2-83.2s38.4-83.2 83.2-83.2h51.2V313.6c0-25.6-19.2-51.2-51.2-51.2h-134.4c0-70.4-57.6-128-128-128S448 185.6 448 256H313.6c-25.6 0-51.2 19.2-51.2 51.2V448C185.6 448 128 505.6 128 576s57.6 128 128 128v134.4c0 25.6 19.2 51.2 51.2 51.2h185.6v-51.2c0-44.8 38.4-83.2 83.2-83.2 44.8 0 83.2 38.4 83.2 83.2v57.6h185.6zM576 710.4c-70.4 0-128 57.6-128 128H307.2v-185.6H256c-44.8 0-83.2-38.4-83.2-83.2S211.2 492.8 256 492.8h51.2V307.2h185.6V256c0-44.8 38.4-83.2 83.2-83.2 44.8 0 83.2 38.4 83.2 83.2v51.2h185.6V448c-70.4 0-128 57.6-128 128s57.6 128 128 128v140.8H704c6.4-70.4-51.2-134.4-128-134.4z",
|
|
9548
9818
|
fill: "",
|
|
9549
9819
|
"p-id": "36983"
|
|
9820
|
+
})), /*#__PURE__*/React.createElement("symbol", {
|
|
9821
|
+
id: "sort-flv",
|
|
9822
|
+
width: "18",
|
|
9823
|
+
height: "18",
|
|
9824
|
+
viewBox: "0 0 18 18",
|
|
9825
|
+
fill: "none"
|
|
9826
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
9827
|
+
"fill-rule": "evenodd",
|
|
9828
|
+
"clip-rule": "evenodd",
|
|
9829
|
+
d: "M1.71967 11.4697C2.01256 11.1768 2.48744 11.1768 2.78033 11.4697L5.25 13.9393L7.71967 11.4697C8.01256 11.1768 8.48744 11.1768 8.78033 11.4697C9.07322 11.7626 9.07322 12.2374 8.78033 12.5303L5.78033 15.5303C5.48744 15.8232 5.01256 15.8232 4.71967 15.5303L1.71967 12.5303C1.42678 12.2374 1.42678 11.7626 1.71967 11.4697Z",
|
|
9830
|
+
fill: "#363B3F"
|
|
9831
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
9832
|
+
"fill-rule": "evenodd",
|
|
9833
|
+
"clip-rule": "evenodd",
|
|
9834
|
+
d: "M5.25 2.25C5.66421 2.25 6 2.58579 6 3V15C6 15.4142 5.66421 15.75 5.25 15.75C4.83579 15.75 4.5 15.4142 4.5 15V3C4.5 2.58579 4.83579 2.25 5.25 2.25Z",
|
|
9835
|
+
fill: "#363B3F"
|
|
9836
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
9837
|
+
"fill-rule": "evenodd",
|
|
9838
|
+
"clip-rule": "evenodd",
|
|
9839
|
+
d: "M12.2197 2.46967C12.5126 2.17678 12.9874 2.17678 13.2803 2.46967L16.2803 5.46967C16.5732 5.76256 16.5732 6.23744 16.2803 6.53033C15.9874 6.82322 15.5126 6.82322 15.2197 6.53033L12.75 4.06066L10.2803 6.53033C9.98744 6.82322 9.51256 6.82322 9.21967 6.53033C8.92678 6.23744 8.92678 5.76256 9.21967 5.46967L12.2197 2.46967Z",
|
|
9840
|
+
fill: "#363B3F"
|
|
9841
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
9842
|
+
"fill-rule": "evenodd",
|
|
9843
|
+
"clip-rule": "evenodd",
|
|
9844
|
+
d: "M12.75 2.25C13.1642 2.25 13.5 2.58579 13.5 3V15C13.5 15.4142 13.1642 15.75 12.75 15.75C12.3358 15.75 12 15.4142 12 15V3C12 2.58579 12.3358 2.25 12.75 2.25Z",
|
|
9845
|
+
fill: "#363B3F"
|
|
9550
9846
|
}))));
|
|
9551
9847
|
};
|
|
9552
9848
|
|
|
@@ -9841,7 +10137,7 @@ var MoreItemsContaier = function MoreItemsContaier(_ref) {
|
|
|
9841
10137
|
}, children);
|
|
9842
10138
|
};
|
|
9843
10139
|
|
|
9844
|
-
function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cellInput, scrollbarX, scrollbarY
|
|
10140
|
+
function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cellInput, scrollbarX, scrollbarY) {
|
|
9845
10141
|
return {
|
|
9846
10142
|
applyOp: function applyOp(ops) {
|
|
9847
10143
|
setContext(function (ctx_) {
|
|
@@ -10142,50 +10438,6 @@ function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cel
|
|
|
10142
10438
|
},
|
|
10143
10439
|
celldataToData: function celldataToData(celldata, rowCount, colCount) {
|
|
10144
10440
|
return api.celldataToData(celldata, rowCount, colCount);
|
|
10145
|
-
},
|
|
10146
|
-
insertFunction: function insertFunction(selectedFuncIndex, filteredFunctionList, callback) {
|
|
10147
|
-
var _context$luckysheet_s2;
|
|
10148
|
-
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];
|
|
10149
|
-
var row_index = last === null || last === void 0 ? void 0 : last.row_focus;
|
|
10150
|
-
var col_index = last === null || last === void 0 ? void 0 : last.column_focus;
|
|
10151
|
-
if (!last) {
|
|
10152
|
-
row_index = 0;
|
|
10153
|
-
col_index = 0;
|
|
10154
|
-
} else {
|
|
10155
|
-
if (row_index == null) {
|
|
10156
|
-
var _last$row2 = _slicedToArray(last.row, 1);
|
|
10157
|
-
row_index = _last$row2[0];
|
|
10158
|
-
}
|
|
10159
|
-
if (col_index == null) {
|
|
10160
|
-
var _last$column2 = _slicedToArray(last.column, 1);
|
|
10161
|
-
col_index = _last$column2[0];
|
|
10162
|
-
}
|
|
10163
|
-
}
|
|
10164
|
-
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>");
|
|
10165
|
-
var _locale2 = locale(context),
|
|
10166
|
-
functionlist = _locale2.functionlist;
|
|
10167
|
-
setContext(function (ctx) {
|
|
10168
|
-
if (cellInput != null && globalCache != null) {
|
|
10169
|
-
ctx.luckysheetCellUpdate = [row_index, col_index];
|
|
10170
|
-
globalCache.doNotUpdateCell = true;
|
|
10171
|
-
cellInput.innerHTML = formulaTxt;
|
|
10172
|
-
var spans = cellInput.childNodes;
|
|
10173
|
-
if (!_.isEmpty(spans)) {
|
|
10174
|
-
setCaretPosition(ctx, spans[spans.length - 1], 0, 1);
|
|
10175
|
-
}
|
|
10176
|
-
ctx.functionHint = filteredFunctionList[selectedFuncIndex].n.toUpperCase();
|
|
10177
|
-
ctx.functionCandidates = [];
|
|
10178
|
-
if (_.isEmpty(ctx.formulaCache.functionlistMap)) {
|
|
10179
|
-
for (var i = 0; i < functionlist.length; i += 1) {
|
|
10180
|
-
ctx.formulaCache.functionlistMap[functionlist[i].n] = functionlist[i];
|
|
10181
|
-
}
|
|
10182
|
-
}
|
|
10183
|
-
callback === null || callback === void 0 ? void 0 : callback();
|
|
10184
|
-
}
|
|
10185
|
-
});
|
|
10186
|
-
},
|
|
10187
|
-
getLocaleContext: function getLocaleContext() {
|
|
10188
|
-
return locale(context);
|
|
10189
10441
|
}
|
|
10190
10442
|
};
|
|
10191
10443
|
}
|
|
@@ -11393,8 +11645,8 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
11393
11645
|
};
|
|
11394
11646
|
}, [onPaste]);
|
|
11395
11647
|
useImperativeHandle(ref, function () {
|
|
11396
|
-
return generateAPIs(context, setContextWithProduce, handleUndo, handleRedo, mergedSettings, cellInput.current, scrollbarX.current, scrollbarY.current
|
|
11397
|
-
}, [context, setContextWithProduce, handleUndo, handleRedo, mergedSettings
|
|
11648
|
+
return generateAPIs(context, setContextWithProduce, handleUndo, handleRedo, mergedSettings, cellInput.current, scrollbarX.current, scrollbarY.current);
|
|
11649
|
+
}, [context, setContextWithProduce, handleUndo, handleRedo, mergedSettings]);
|
|
11398
11650
|
var i = getSheetIndex(context, context.currentSheetId);
|
|
11399
11651
|
if (i == null) {
|
|
11400
11652
|
return null;
|