@fileverse-dev/fortune-react 1.0.2-mod-20-patch-2 → 1.0.2-mod-24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Workbook/api.d.ts +2 -1048
- package/dist/components/Workbook/index.d.ts +0 -1046
- package/dist/index.css +38 -8
- package/dist/index.esm.css +38 -8
- package/dist/index.esm.js +175 -178
- package/dist/index.js +175 -178
- package/dist/index.umd.css +38 -8
- package/dist/index.umd.js +63697 -183
- package/dist/index.umd.min.css +1 -1
- package/dist/index.umd.min.js +42 -3
- package/package.json +4 -2
package/dist/index.css
CHANGED
|
@@ -1187,11 +1187,11 @@ html::-webkit-scrollbar-button {
|
|
|
1187
1187
|
}
|
|
1188
1188
|
|
|
1189
1189
|
.fortune-dialog {
|
|
1190
|
+
min-width: 368px;
|
|
1190
1191
|
max-width: 90%;
|
|
1191
1192
|
max-height: 90%;
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
background: white;
|
|
1193
|
+
border-radius: 12px;
|
|
1194
|
+
background: hsl(var(--color-bg-default));
|
|
1195
1195
|
box-shadow: rgb(0 0 0 / 10%) 5px 5px 30px;
|
|
1196
1196
|
box-sizing: border-box;
|
|
1197
1197
|
overflow: auto;
|
|
@@ -1251,10 +1251,11 @@ html::-webkit-scrollbar-button {
|
|
|
1251
1251
|
opacity: 0.7;
|
|
1252
1252
|
}
|
|
1253
1253
|
|
|
1254
|
+
@import "@fileverse/ui/styles";
|
|
1254
1255
|
/*查找替换弹出框样式*/
|
|
1255
1256
|
#fortune-search-replace {
|
|
1256
1257
|
position: absolute;
|
|
1257
|
-
|
|
1258
|
+
min-width: 504px;
|
|
1258
1259
|
z-index: 1002;
|
|
1259
1260
|
}
|
|
1260
1261
|
|
|
@@ -1336,10 +1337,7 @@ html::-webkit-scrollbar-button {
|
|
|
1336
1337
|
}
|
|
1337
1338
|
|
|
1338
1339
|
#fortune-search-replace #searchAllbox {
|
|
1339
|
-
|
|
1340
|
-
border: 1px solid #d4d4d4;
|
|
1341
|
-
margin-top: 10px;
|
|
1342
|
-
overflow-y: auto;
|
|
1340
|
+
overflow-y: scroll;
|
|
1343
1341
|
position: relative;
|
|
1344
1342
|
}
|
|
1345
1343
|
|
|
@@ -1413,6 +1411,38 @@ html::-webkit-scrollbar-button {
|
|
|
1413
1411
|
white-space: nowrap;
|
|
1414
1412
|
}
|
|
1415
1413
|
|
|
1414
|
+
.find-replace-label {
|
|
1415
|
+
min-width: 100px;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
.find-replace-table-cell {
|
|
1419
|
+
min-width: 154px;
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
/* Add scrollbar styles */
|
|
1423
|
+
#fortune-search-replace .table-container {
|
|
1424
|
+
scrollbar-width: thin;
|
|
1425
|
+
scrollbar-color: #babac0 transparent;
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
#fortune-search-replace .table-container::-webkit-scrollbar {
|
|
1429
|
+
width: 8px;
|
|
1430
|
+
height: 8px;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
#fortune-search-replace .table-container::-webkit-scrollbar-track {
|
|
1434
|
+
background-color: transparent;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
#fortune-search-replace .table-container::-webkit-scrollbar-thumb {
|
|
1438
|
+
background-color: #babac0;
|
|
1439
|
+
border-radius: 16px;
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
#fortune-search-replace .table-container::-webkit-scrollbar-button {
|
|
1443
|
+
display: none;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1416
1446
|
.fortune-link-modify-modal {
|
|
1417
1447
|
position: absolute;
|
|
1418
1448
|
overflow: hidden;
|
package/dist/index.esm.css
CHANGED
|
@@ -1187,11 +1187,11 @@ html::-webkit-scrollbar-button {
|
|
|
1187
1187
|
}
|
|
1188
1188
|
|
|
1189
1189
|
.fortune-dialog {
|
|
1190
|
+
min-width: 368px;
|
|
1190
1191
|
max-width: 90%;
|
|
1191
1192
|
max-height: 90%;
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
background: white;
|
|
1193
|
+
border-radius: 12px;
|
|
1194
|
+
background: hsl(var(--color-bg-default));
|
|
1195
1195
|
box-shadow: rgb(0 0 0 / 10%) 5px 5px 30px;
|
|
1196
1196
|
box-sizing: border-box;
|
|
1197
1197
|
overflow: auto;
|
|
@@ -1251,10 +1251,11 @@ html::-webkit-scrollbar-button {
|
|
|
1251
1251
|
opacity: 0.7;
|
|
1252
1252
|
}
|
|
1253
1253
|
|
|
1254
|
+
@import "@fileverse/ui/styles";
|
|
1254
1255
|
/*查找替换弹出框样式*/
|
|
1255
1256
|
#fortune-search-replace {
|
|
1256
1257
|
position: absolute;
|
|
1257
|
-
|
|
1258
|
+
min-width: 504px;
|
|
1258
1259
|
z-index: 1002;
|
|
1259
1260
|
}
|
|
1260
1261
|
|
|
@@ -1336,10 +1337,7 @@ html::-webkit-scrollbar-button {
|
|
|
1336
1337
|
}
|
|
1337
1338
|
|
|
1338
1339
|
#fortune-search-replace #searchAllbox {
|
|
1339
|
-
|
|
1340
|
-
border: 1px solid #d4d4d4;
|
|
1341
|
-
margin-top: 10px;
|
|
1342
|
-
overflow-y: auto;
|
|
1340
|
+
overflow-y: scroll;
|
|
1343
1341
|
position: relative;
|
|
1344
1342
|
}
|
|
1345
1343
|
|
|
@@ -1413,6 +1411,38 @@ html::-webkit-scrollbar-button {
|
|
|
1413
1411
|
white-space: nowrap;
|
|
1414
1412
|
}
|
|
1415
1413
|
|
|
1414
|
+
.find-replace-label {
|
|
1415
|
+
min-width: 100px;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
.find-replace-table-cell {
|
|
1419
|
+
min-width: 154px;
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
/* Add scrollbar styles */
|
|
1423
|
+
#fortune-search-replace .table-container {
|
|
1424
|
+
scrollbar-width: thin;
|
|
1425
|
+
scrollbar-color: #babac0 transparent;
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
#fortune-search-replace .table-container::-webkit-scrollbar {
|
|
1429
|
+
width: 8px;
|
|
1430
|
+
height: 8px;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
#fortune-search-replace .table-container::-webkit-scrollbar-track {
|
|
1434
|
+
background-color: transparent;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
#fortune-search-replace .table-container::-webkit-scrollbar-thumb {
|
|
1438
|
+
background-color: #babac0;
|
|
1439
|
+
border-radius: 16px;
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
#fortune-search-replace .table-container::-webkit-scrollbar-button {
|
|
1443
|
+
display: none;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1416
1446
|
.fortune-link-modify-modal {
|
|
1417
1447
|
position: absolute;
|
|
1418
1448
|
overflow: hidden;
|
package/dist/index.esm.js
CHANGED
|
@@ -2,6 +2,7 @@ import { defaultContext, defaultSettings, getSheetIndex, colLocationByIndex, fix
|
|
|
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 { IconButton, Button as Button$1, TextField, Checkbox, Divider as Divider$2, Table, TableHeader, TableRow, TableHead, TableBody, cn, TableCell } from '@fileverse/ui';
|
|
5
6
|
import regeneratorRuntime from 'regenerator-runtime';
|
|
6
7
|
|
|
7
8
|
function _arrayLikeToArray(r, a) {
|
|
@@ -1228,35 +1229,39 @@ var Dialog = function Dialog(_ref) {
|
|
|
1228
1229
|
className: "fortune-dialog",
|
|
1229
1230
|
style: containerStyle
|
|
1230
1231
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1231
|
-
className: "
|
|
1232
|
-
}, /*#__PURE__*/React.createElement(
|
|
1233
|
-
|
|
1232
|
+
className: "flex items-center justify-end border-b color-border-default py-3 px-6"
|
|
1233
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
1234
|
+
icon: "X",
|
|
1235
|
+
variant: "ghost",
|
|
1234
1236
|
onClick: onCancel,
|
|
1235
1237
|
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",
|
|
1238
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
1239
|
+
className: "px-6 pb-6 pt-4 text-body-sm",
|
|
1244
1240
|
style: contentStyle
|
|
1245
1241
|
}, 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",
|
|
1242
|
+
className: "px-6 pb-6 flex flex-row gap-2 justify-end"
|
|
1243
|
+
}, type === "ok" ? (/*#__PURE__*/React.createElement(Button$1, {
|
|
1244
|
+
variant: "default",
|
|
1245
|
+
style: {
|
|
1246
|
+
minWidth: "80px"
|
|
1247
|
+
},
|
|
1253
1248
|
onClick: onOk,
|
|
1254
1249
|
tabIndex: 0
|
|
1255
|
-
}, button.confirm), /*#__PURE__*/React.createElement(
|
|
1256
|
-
|
|
1250
|
+
}, button.confirm)) : (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button$1, {
|
|
1251
|
+
variant: "secondary",
|
|
1252
|
+
style: {
|
|
1253
|
+
minWidth: "80px"
|
|
1254
|
+
},
|
|
1257
1255
|
onClick: onCancel,
|
|
1258
1256
|
tabIndex: 0
|
|
1259
|
-
}, button.cancel)
|
|
1257
|
+
}, button.cancel), /*#__PURE__*/React.createElement(Button$1, {
|
|
1258
|
+
variant: "default",
|
|
1259
|
+
style: {
|
|
1260
|
+
minWidth: "80px"
|
|
1261
|
+
},
|
|
1262
|
+
onClick: onOk,
|
|
1263
|
+
tabIndex: 0
|
|
1264
|
+
}, button.confirm))))));
|
|
1260
1265
|
};
|
|
1261
1266
|
|
|
1262
1267
|
var MessageBox = function MessageBox(_ref) {
|
|
@@ -1268,15 +1273,7 @@ var MessageBox = function MessageBox(_ref) {
|
|
|
1268
1273
|
return /*#__PURE__*/React.createElement(Dialog, {
|
|
1269
1274
|
type: type,
|
|
1270
1275
|
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
|
-
}
|
|
1276
|
+
onCancel: onCancel
|
|
1280
1277
|
}, children);
|
|
1281
1278
|
};
|
|
1282
1279
|
|
|
@@ -1350,8 +1347,7 @@ var SearchReplace = function SearchReplace(_ref) {
|
|
|
1350
1347
|
setContext = _useContext.setContext,
|
|
1351
1348
|
refs = _useContext.refs;
|
|
1352
1349
|
var _locale = locale(context),
|
|
1353
|
-
findAndReplace = _locale.findAndReplace
|
|
1354
|
-
button = _locale.button;
|
|
1350
|
+
findAndReplace = _locale.findAndReplace;
|
|
1355
1351
|
var _useState = useState(""),
|
|
1356
1352
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1357
1353
|
searchText = _useState2[0],
|
|
@@ -1360,28 +1356,27 @@ var SearchReplace = function SearchReplace(_ref) {
|
|
|
1360
1356
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
1361
1357
|
replaceText = _useState4[0],
|
|
1362
1358
|
setReplaceText = _useState4[1];
|
|
1363
|
-
var _useState5 = useState(
|
|
1359
|
+
var _useState5 = useState([]),
|
|
1364
1360
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
var _useState7 = useState(
|
|
1361
|
+
searchResult = _useState6[0],
|
|
1362
|
+
setSearchResult = _useState6[1];
|
|
1363
|
+
var _useState7 = useState(),
|
|
1368
1364
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
var _useState9 = useState(),
|
|
1372
|
-
_useState0 = _slicedToArray(_useState9, 2),
|
|
1373
|
-
selectedCell = _useState0[0],
|
|
1374
|
-
setSelectedCell = _useState0[1];
|
|
1365
|
+
selectedCell = _useState8[0],
|
|
1366
|
+
setSelectedCell = _useState8[1];
|
|
1375
1367
|
var _useAlert = useAlert(),
|
|
1376
1368
|
showAlert = _useAlert.showAlert;
|
|
1377
|
-
var
|
|
1369
|
+
var tableContainerRef = useRef(null);
|
|
1370
|
+
var searchInputRef = useRef(null);
|
|
1371
|
+
var replaceInputRef = useRef(null);
|
|
1372
|
+
var _useState9 = useState({
|
|
1378
1373
|
regCheck: false,
|
|
1379
1374
|
wordCheck: false,
|
|
1380
1375
|
caseCheck: false
|
|
1381
1376
|
}),
|
|
1382
|
-
|
|
1383
|
-
checkMode =
|
|
1384
|
-
checkModeReplace =
|
|
1377
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
1378
|
+
checkMode = _useState0[0],
|
|
1379
|
+
checkModeReplace = _useState0[1];
|
|
1385
1380
|
var closeDialog = useCallback(function () {
|
|
1386
1381
|
_.set(refs.globalCache, "searchDialog.mouseEnter", false);
|
|
1387
1382
|
setContext(function (draftCtx) {
|
|
@@ -1416,98 +1411,110 @@ var SearchReplace = function SearchReplace(_ref) {
|
|
|
1416
1411
|
onSearchDialogMoveStart(refs.globalCache, nativeEvent, getContainer());
|
|
1417
1412
|
e.stopPropagation();
|
|
1418
1413
|
}
|
|
1419
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
1420
|
-
className: "
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1414
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
1415
|
+
className: "flex items-center justify-between border-b color-border-default py-3 px-6"
|
|
1416
|
+
}, /*#__PURE__*/React.createElement("h3", {
|
|
1417
|
+
className: "text-heading-sm"
|
|
1418
|
+
}, "Find and replace"), /*#__PURE__*/React.createElement(IconButton, {
|
|
1419
|
+
icon: "X",
|
|
1420
|
+
variant: "ghost",
|
|
1426
1421
|
onClick: closeDialog,
|
|
1427
1422
|
tabIndex: 0
|
|
1428
|
-
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
1429
|
-
name: "close",
|
|
1430
|
-
style: {
|
|
1431
|
-
padding: 7,
|
|
1432
|
-
cursor: "pointer"
|
|
1433
|
-
}
|
|
1434
1423
|
})), /*#__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"
|
|
1424
|
+
className: "px-6 pb-6 pt-4"
|
|
1452
1425
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1453
|
-
className: "
|
|
1426
|
+
className: "flex flex-col gap-4"
|
|
1454
1427
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1455
|
-
className: "
|
|
1428
|
+
className: "flex flex-col gap-4"
|
|
1456
1429
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
},
|
|
1430
|
+
id: "searchInput",
|
|
1431
|
+
className: "flex flex-row gap-2 items-center"
|
|
1432
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
1433
|
+
className: "find-replace-label text-heading-xsm"
|
|
1434
|
+
}, findAndReplace.findTextbox, "\uFF1A"), /*#__PURE__*/React.createElement(TextField, {
|
|
1435
|
+
ref: searchInputRef,
|
|
1460
1436
|
className: "formulaInputFocus",
|
|
1461
1437
|
autoFocus: true,
|
|
1462
1438
|
spellCheck: "false",
|
|
1463
1439
|
onKeyDown: function onKeyDown(e) {
|
|
1464
1440
|
return e.stopPropagation();
|
|
1465
1441
|
},
|
|
1442
|
+
onMouseDown: function onMouseDown(e) {
|
|
1443
|
+
var _searchInputRef$curre;
|
|
1444
|
+
if (e.target === searchInputRef.current || ((_searchInputRef$curre = searchInputRef.current) === null || _searchInputRef$curre === void 0 ? void 0 : _searchInputRef$curre.contains(e.target))) {
|
|
1445
|
+
e.stopPropagation();
|
|
1446
|
+
}
|
|
1447
|
+
},
|
|
1466
1448
|
value: searchText,
|
|
1467
1449
|
onChange: function onChange(e) {
|
|
1468
|
-
|
|
1450
|
+
if (e.target.value.length === 0) {
|
|
1451
|
+
setSearchResult([]);
|
|
1452
|
+
}
|
|
1453
|
+
setSearchText(e.target.value);
|
|
1469
1454
|
}
|
|
1470
|
-
})),
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
},
|
|
1455
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
1456
|
+
id: "replaceInput",
|
|
1457
|
+
className: "flex flex-row gap-2 items-center"
|
|
1458
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
1459
|
+
className: "find-replace-label text-heading-xsm"
|
|
1460
|
+
}, findAndReplace.replaceTextbox, "\uFF1A"), /*#__PURE__*/React.createElement(TextField, {
|
|
1461
|
+
ref: replaceInputRef,
|
|
1474
1462
|
className: "formulaInputFocus",
|
|
1475
1463
|
spellCheck: "false",
|
|
1476
1464
|
onKeyDown: function onKeyDown(e) {
|
|
1477
1465
|
return e.stopPropagation();
|
|
1478
1466
|
},
|
|
1467
|
+
onMouseDown: function onMouseDown(e) {
|
|
1468
|
+
var _replaceInputRef$curr;
|
|
1469
|
+
if (e.target === replaceInputRef.current || ((_replaceInputRef$curr = replaceInputRef.current) === null || _replaceInputRef$curr === void 0 ? void 0 : _replaceInputRef$curr.contains(e.target))) {
|
|
1470
|
+
e.stopPropagation();
|
|
1471
|
+
}
|
|
1472
|
+
},
|
|
1479
1473
|
value: replaceText,
|
|
1480
1474
|
onChange: function onChange(e) {
|
|
1481
1475
|
return setReplaceText(e.target.value);
|
|
1482
1476
|
}
|
|
1483
|
-
})))
|
|
1484
|
-
className: "
|
|
1477
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
1478
|
+
className: "flex flex-row gap-2"
|
|
1485
1479
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1486
|
-
|
|
1487
|
-
}, /*#__PURE__*/React.createElement("
|
|
1488
|
-
|
|
1489
|
-
|
|
1480
|
+
className: "find-replace-label"
|
|
1481
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
1482
|
+
className: "flex flex-col gap-2 text-body-sm"
|
|
1483
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1484
|
+
id: "regCheck",
|
|
1485
|
+
className: "flex flex-row gap-2 items-center"
|
|
1486
|
+
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
1487
|
+
className: "border-2",
|
|
1488
|
+
checked: checkMode.regCheck,
|
|
1489
|
+
onCheckedChange: function onCheckedChange(e) {
|
|
1490
1490
|
return setCheckMode("regCheck", e.target.checked);
|
|
1491
1491
|
}
|
|
1492
1492
|
}), /*#__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) {
|
|
1493
|
+
id: "caseCheck",
|
|
1494
|
+
className: "flex flex-row gap-2 items-center"
|
|
1495
|
+
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
1496
|
+
className: "border-2",
|
|
1497
|
+
checked: checkMode.caseCheck,
|
|
1498
|
+
onCheckedChange: function onCheckedChange(e) {
|
|
1504
1499
|
return setCheckMode("caseCheck", e.target.checked);
|
|
1505
1500
|
}
|
|
1506
|
-
}), /*#__PURE__*/React.createElement("span", null, findAndReplace.distinguishTextbox))
|
|
1507
|
-
|
|
1508
|
-
|
|
1501
|
+
}), /*#__PURE__*/React.createElement("span", null, findAndReplace.distinguishTextbox)), /*#__PURE__*/React.createElement("div", {
|
|
1502
|
+
id: "wordCheck",
|
|
1503
|
+
className: "flex flex-row gap-2 items-center"
|
|
1504
|
+
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
1505
|
+
className: "border-2",
|
|
1506
|
+
checked: checkMode.wordCheck,
|
|
1507
|
+
onCheckedChange: function onCheckedChange(e) {
|
|
1508
|
+
return setCheckMode("wordCheck", e.target.checked);
|
|
1509
|
+
}
|
|
1510
|
+
}), /*#__PURE__*/React.createElement("span", null, findAndReplace.wholeTextbox)))), /*#__PURE__*/React.createElement(Divider$2, {
|
|
1511
|
+
className: "w-full border-t-[1px]"
|
|
1512
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
1513
|
+
className: "flex flex-row gap-2 justify-center items-center mb-4"
|
|
1514
|
+
}, /*#__PURE__*/React.createElement(Button$1, {
|
|
1509
1515
|
id: "replaceAllBtn",
|
|
1510
|
-
|
|
1516
|
+
variant: "secondary",
|
|
1517
|
+
className: "min-w-fit",
|
|
1511
1518
|
onClick: function onClick() {
|
|
1512
1519
|
setContext(function (draftCtx) {
|
|
1513
1520
|
setSelectedCell(undefined);
|
|
@@ -1515,10 +1522,12 @@ var SearchReplace = function SearchReplace(_ref) {
|
|
|
1515
1522
|
showAlert(alertMsg);
|
|
1516
1523
|
});
|
|
1517
1524
|
},
|
|
1518
|
-
tabIndex: 0
|
|
1519
|
-
|
|
1525
|
+
tabIndex: 0,
|
|
1526
|
+
disabled: searchText.length === 0 || replaceText.length === 0
|
|
1527
|
+
}, findAndReplace.allReplaceBtn), /*#__PURE__*/React.createElement(Button$1, {
|
|
1520
1528
|
id: "replaceBtn",
|
|
1521
|
-
|
|
1529
|
+
variant: "secondary",
|
|
1530
|
+
className: "min-w-fit",
|
|
1522
1531
|
onClick: function onClick() {
|
|
1523
1532
|
return setContext(function (draftCtx) {
|
|
1524
1533
|
setSelectedCell(undefined);
|
|
@@ -1528,10 +1537,12 @@ var SearchReplace = function SearchReplace(_ref) {
|
|
|
1528
1537
|
}
|
|
1529
1538
|
});
|
|
1530
1539
|
},
|
|
1531
|
-
tabIndex: 0
|
|
1532
|
-
|
|
1540
|
+
tabIndex: 0,
|
|
1541
|
+
disabled: searchText.length === 0 || replaceText.length === 0
|
|
1542
|
+
}, findAndReplace.replaceBtn), /*#__PURE__*/React.createElement(Button$1, {
|
|
1533
1543
|
id: "searchAllBtn",
|
|
1534
|
-
|
|
1544
|
+
variant: "secondary",
|
|
1545
|
+
className: "min-w-fit",
|
|
1535
1546
|
onClick: function onClick() {
|
|
1536
1547
|
return setContext(function (draftCtx) {
|
|
1537
1548
|
setSelectedCell(undefined);
|
|
@@ -1541,10 +1552,12 @@ var SearchReplace = function SearchReplace(_ref) {
|
|
|
1541
1552
|
if (_.isEmpty(res)) showAlert(findAndReplace.noFindTip);
|
|
1542
1553
|
});
|
|
1543
1554
|
},
|
|
1544
|
-
tabIndex: 0
|
|
1545
|
-
|
|
1555
|
+
tabIndex: 0,
|
|
1556
|
+
disabled: searchText.length === 0
|
|
1557
|
+
}, findAndReplace.allFindBtn), /*#__PURE__*/React.createElement(Button$1, {
|
|
1546
1558
|
id: "searchNextBtn",
|
|
1547
|
-
|
|
1559
|
+
variant: "default",
|
|
1560
|
+
className: "min-w-fit",
|
|
1548
1561
|
onClick: function onClick() {
|
|
1549
1562
|
return setContext(function (draftCtx) {
|
|
1550
1563
|
setSearchResult([]);
|
|
@@ -1552,23 +1565,45 @@ var SearchReplace = function SearchReplace(_ref) {
|
|
|
1552
1565
|
if (alertMsg != null) showAlert(alertMsg);
|
|
1553
1566
|
});
|
|
1554
1567
|
},
|
|
1568
|
+
tabIndex: 0,
|
|
1569
|
+
disabled: searchText.length === 0
|
|
1570
|
+
}, findAndReplace.findBtn))), searchResult.length > 0 && (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider$2, {
|
|
1571
|
+
className: "w-full border-t-[1px] mb-4"
|
|
1572
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
1573
|
+
ref: tableContainerRef,
|
|
1574
|
+
className: "mb-6 table-container max-h-[300px] overflow-y-auto",
|
|
1575
|
+
onMouseDown: function onMouseDown(e) {
|
|
1576
|
+
var _tableContainerRef$cu;
|
|
1577
|
+
if (e.target === tableContainerRef.current || ((_tableContainerRef$cu = tableContainerRef.current) === null || _tableContainerRef$cu === void 0 ? void 0 : _tableContainerRef$cu.contains(e.target))) {
|
|
1578
|
+
var _tableContainerRef$cu2;
|
|
1579
|
+
e.stopPropagation();
|
|
1580
|
+
(_tableContainerRef$cu2 = tableContainerRef.current) === null || _tableContainerRef$cu2 === void 0 ? void 0 : _tableContainerRef$cu2.focus();
|
|
1581
|
+
}
|
|
1582
|
+
},
|
|
1583
|
+
onWheel: function onWheel(e) {
|
|
1584
|
+
e.preventDefault();
|
|
1585
|
+
e.stopPropagation();
|
|
1586
|
+
if (tableContainerRef.current) {
|
|
1587
|
+
tableContainerRef.current.scrollTop += e.deltaY;
|
|
1588
|
+
}
|
|
1589
|
+
},
|
|
1590
|
+
onTouchStart: function onTouchStart(e) {
|
|
1591
|
+
e.stopPropagation();
|
|
1592
|
+
},
|
|
1593
|
+
onTouchMove: function onTouchMove(e) {
|
|
1594
|
+
e.stopPropagation();
|
|
1595
|
+
},
|
|
1555
1596
|
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", {
|
|
1597
|
+
}, /*#__PURE__*/React.createElement(Table, {
|
|
1561
1598
|
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, {
|
|
1599
|
+
}, /*#__PURE__*/React.createElement(TableHeader, {
|
|
1600
|
+
className: "color-bg-secondary"
|
|
1601
|
+
}, /*#__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) {
|
|
1602
|
+
return /*#__PURE__*/React.createElement(TableRow, {
|
|
1603
|
+
className: cn(_.isEqual(selectedCell, {
|
|
1569
1604
|
r: v.r,
|
|
1570
1605
|
c: v.c
|
|
1571
|
-
}) ? "
|
|
1606
|
+
}) ? "color-bg-default-selected" : ""),
|
|
1572
1607
|
key: v.cellPosition,
|
|
1573
1608
|
onClick: function onClick() {
|
|
1574
1609
|
setContext(function (draftCtx) {
|
|
@@ -1584,8 +1619,14 @@ var SearchReplace = function SearchReplace(_ref) {
|
|
|
1584
1619
|
});
|
|
1585
1620
|
},
|
|
1586
1621
|
tabIndex: 0
|
|
1587
|
-
}, /*#__PURE__*/React.createElement(
|
|
1588
|
-
|
|
1622
|
+
}, /*#__PURE__*/React.createElement(TableCell, {
|
|
1623
|
+
className: "find-replace-table-cell"
|
|
1624
|
+
}, v.sheetName), /*#__PURE__*/React.createElement(TableCell, {
|
|
1625
|
+
className: "find-replace-table-cell"
|
|
1626
|
+
}, v.cellPosition), /*#__PURE__*/React.createElement(TableCell, {
|
|
1627
|
+
className: "find-replace-table-cell"
|
|
1628
|
+
}, v.value));
|
|
1629
|
+
})))))))));
|
|
1589
1630
|
};
|
|
1590
1631
|
|
|
1591
1632
|
var LinkEditCard = function LinkEditCard(_ref) {
|
|
@@ -9841,7 +9882,7 @@ var MoreItemsContaier = function MoreItemsContaier(_ref) {
|
|
|
9841
9882
|
}, children);
|
|
9842
9883
|
};
|
|
9843
9884
|
|
|
9844
|
-
function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cellInput, scrollbarX, scrollbarY
|
|
9885
|
+
function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cellInput, scrollbarX, scrollbarY) {
|
|
9845
9886
|
return {
|
|
9846
9887
|
applyOp: function applyOp(ops) {
|
|
9847
9888
|
setContext(function (ctx_) {
|
|
@@ -10142,50 +10183,6 @@ function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cel
|
|
|
10142
10183
|
},
|
|
10143
10184
|
celldataToData: function celldataToData(celldata, rowCount, colCount) {
|
|
10144
10185
|
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
10186
|
}
|
|
10190
10187
|
};
|
|
10191
10188
|
}
|
|
@@ -11393,8 +11390,8 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
11393
11390
|
};
|
|
11394
11391
|
}, [onPaste]);
|
|
11395
11392
|
useImperativeHandle(ref, function () {
|
|
11396
|
-
return generateAPIs(context, setContextWithProduce, handleUndo, handleRedo, mergedSettings, cellInput.current, scrollbarX.current, scrollbarY.current
|
|
11397
|
-
}, [context, setContextWithProduce, handleUndo, handleRedo, mergedSettings
|
|
11393
|
+
return generateAPIs(context, setContextWithProduce, handleUndo, handleRedo, mergedSettings, cellInput.current, scrollbarX.current, scrollbarY.current);
|
|
11394
|
+
}, [context, setContextWithProduce, handleUndo, handleRedo, mergedSettings]);
|
|
11398
11395
|
var i = getSheetIndex(context, context.currentSheetId);
|
|
11399
11396
|
if (i == null) {
|
|
11400
11397
|
return null;
|