@fileverse-dev/fortune-react 1.0.2-mod-20 → 1.0.2-mod-22

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/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
- overflow: scroll;
1193
- border-radius: 6px;
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
- padding: 30px 42px;
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
- height: 210px;
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;
@@ -3304,8 +3334,8 @@ label {
3304
3334
  height: 252px;
3305
3335
  background: rgb(240, 240, 240);
3306
3336
  position: absolute;
3307
- bottom: -110px;
3308
- left: 197px;
3337
+ bottom: 10px;
3338
+ left: 100px;
3309
3339
  border-radius: 6px;
3310
3340
  box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
3311
3341
  border: 1px solid rgba(0, 0, 0, 0.2);
@@ -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
- overflow: scroll;
1193
- border-radius: 6px;
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
- padding: 30px 42px;
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
- height: 210px;
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;
@@ -3304,8 +3334,8 @@ label {
3304
3334
  height: 252px;
3305
3335
  background: rgb(240, 240, 240);
3306
3336
  position: absolute;
3307
- bottom: -110px;
3308
- left: 197px;
3337
+ bottom: 10px;
3338
+ left: 100px;
3309
3339
  border-radius: 6px;
3310
3340
  box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
3311
3341
  border: 1px solid rgba(0, 0, 0, 0.2);
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) {
@@ -437,11 +438,6 @@ var ColumnHeader = function ColumnHeader() {
437
438
  var c2 = s[i].column[1];
438
439
  columnTitleMap = selectTitlesMap(columnTitleMap, c1, c2);
439
440
  }
440
- console.log({
441
- x: s[0].row_select,
442
- y: s[0].column_select,
443
- columnTitleMap: columnTitleMap
444
- });
445
441
  var columnTitleRange = selectTitlesRange(columnTitleMap);
446
442
  var selects = [];
447
443
  for (var j = 0; j < columnTitleRange.length; j += 1) {
@@ -1233,35 +1229,39 @@ var Dialog = function Dialog(_ref) {
1233
1229
  className: "fortune-dialog",
1234
1230
  style: containerStyle
1235
1231
  }, /*#__PURE__*/React.createElement("div", {
1236
- className: "fortune-modal-dialog-header"
1237
- }, /*#__PURE__*/React.createElement("div", {
1238
- className: "fortune-modal-dialog-icon-close",
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",
1239
1236
  onClick: onCancel,
1240
1237
  tabIndex: 0
1241
- }, /*#__PURE__*/React.createElement(SVGIcon, {
1242
- name: "close",
1243
- style: {
1244
- padding: 7,
1245
- cursor: "pointer"
1246
- }
1247
- }))), /*#__PURE__*/React.createElement("div", {
1248
- className: "fortune-dialog-box-content",
1238
+ })), /*#__PURE__*/React.createElement("div", {
1239
+ className: "px-6 pb-6 pt-4 text-body-sm",
1249
1240
  style: contentStyle
1250
1241
  }, children), type != null && (/*#__PURE__*/React.createElement("div", {
1251
- className: "fortune-dialog-box-button-container"
1252
- }, type === "ok" ? (/*#__PURE__*/React.createElement("div", {
1253
- className: "fortune-message-box-button button-default",
1254
- onClick: onOk,
1255
- tabIndex: 0
1256
- }, button.confirm)) : (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
1257
- 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
+ },
1258
1248
  onClick: onOk,
1259
1249
  tabIndex: 0
1260
- }, button.confirm), /*#__PURE__*/React.createElement("div", {
1261
- className: "fortune-message-box-button button-default",
1250
+ }, button.confirm)) : (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button$1, {
1251
+ variant: "secondary",
1252
+ style: {
1253
+ minWidth: "80px"
1254
+ },
1262
1255
  onClick: onCancel,
1263
1256
  tabIndex: 0
1264
- }, 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))))));
1265
1265
  };
1266
1266
 
1267
1267
  var MessageBox = function MessageBox(_ref) {
@@ -1273,15 +1273,7 @@ var MessageBox = function MessageBox(_ref) {
1273
1273
  return /*#__PURE__*/React.createElement(Dialog, {
1274
1274
  type: type,
1275
1275
  onOk: onOk,
1276
- onCancel: onCancel,
1277
- contentStyle: {
1278
- width: 300,
1279
- paddingTop: 20,
1280
- paddingBottom: 30,
1281
- display: "flex",
1282
- justifyContent: "center",
1283
- alignItems: "center"
1284
- }
1276
+ onCancel: onCancel
1285
1277
  }, children);
1286
1278
  };
1287
1279
 
@@ -1355,8 +1347,7 @@ var SearchReplace = function SearchReplace(_ref) {
1355
1347
  setContext = _useContext.setContext,
1356
1348
  refs = _useContext.refs;
1357
1349
  var _locale = locale(context),
1358
- findAndReplace = _locale.findAndReplace,
1359
- button = _locale.button;
1350
+ findAndReplace = _locale.findAndReplace;
1360
1351
  var _useState = useState(""),
1361
1352
  _useState2 = _slicedToArray(_useState, 2),
1362
1353
  searchText = _useState2[0],
@@ -1365,28 +1356,27 @@ var SearchReplace = function SearchReplace(_ref) {
1365
1356
  _useState4 = _slicedToArray(_useState3, 2),
1366
1357
  replaceText = _useState4[0],
1367
1358
  setReplaceText = _useState4[1];
1368
- var _useState5 = useState(context.showReplace),
1359
+ var _useState5 = useState([]),
1369
1360
  _useState6 = _slicedToArray(_useState5, 2),
1370
- showReplace = _useState6[0],
1371
- setShowReplace = _useState6[1];
1372
- var _useState7 = useState([]),
1361
+ searchResult = _useState6[0],
1362
+ setSearchResult = _useState6[1];
1363
+ var _useState7 = useState(),
1373
1364
  _useState8 = _slicedToArray(_useState7, 2),
1374
- searchResult = _useState8[0],
1375
- setSearchResult = _useState8[1];
1376
- var _useState9 = useState(),
1377
- _useState0 = _slicedToArray(_useState9, 2),
1378
- selectedCell = _useState0[0],
1379
- setSelectedCell = _useState0[1];
1365
+ selectedCell = _useState8[0],
1366
+ setSelectedCell = _useState8[1];
1380
1367
  var _useAlert = useAlert(),
1381
1368
  showAlert = _useAlert.showAlert;
1382
- var _useState1 = useState({
1369
+ var tableContainerRef = useRef(null);
1370
+ var searchInputRef = useRef(null);
1371
+ var replaceInputRef = useRef(null);
1372
+ var _useState9 = useState({
1383
1373
  regCheck: false,
1384
1374
  wordCheck: false,
1385
1375
  caseCheck: false
1386
1376
  }),
1387
- _useState10 = _slicedToArray(_useState1, 2),
1388
- checkMode = _useState10[0],
1389
- checkModeReplace = _useState10[1];
1377
+ _useState0 = _slicedToArray(_useState9, 2),
1378
+ checkMode = _useState0[0],
1379
+ checkModeReplace = _useState0[1];
1390
1380
  var closeDialog = useCallback(function () {
1391
1381
  _.set(refs.globalCache, "searchDialog.mouseEnter", false);
1392
1382
  setContext(function (draftCtx) {
@@ -1421,98 +1411,110 @@ var SearchReplace = function SearchReplace(_ref) {
1421
1411
  onSearchDialogMoveStart(refs.globalCache, nativeEvent, getContainer());
1422
1412
  e.stopPropagation();
1423
1413
  }
1424
- }, /*#__PURE__*/React.createElement("div", {
1425
- className: "container",
1426
- onMouseDown: function onMouseDown(e) {
1427
- return e.stopPropagation();
1428
- }
1429
- }, /*#__PURE__*/React.createElement("div", {
1430
- className: "icon-close fortune-modal-dialog-icon-close",
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",
1431
1421
  onClick: closeDialog,
1432
1422
  tabIndex: 0
1433
- }, /*#__PURE__*/React.createElement(SVGIcon, {
1434
- name: "close",
1435
- style: {
1436
- padding: 7,
1437
- cursor: "pointer"
1438
- }
1439
1423
  })), /*#__PURE__*/React.createElement("div", {
1440
- className: "tabBox"
1441
- }, /*#__PURE__*/React.createElement("span", {
1442
- id: "searchTab",
1443
- className: showReplace ? "" : "on",
1444
- onClick: function onClick() {
1445
- return setShowReplace(false);
1446
- },
1447
- tabIndex: 0
1448
- }, findAndReplace.find), /*#__PURE__*/React.createElement("span", {
1449
- id: "replaceTab",
1450
- className: showReplace ? "on" : "",
1451
- onClick: function onClick() {
1452
- return setShowReplace(true);
1453
- },
1454
- tabIndex: 0
1455
- }, findAndReplace.replace)), /*#__PURE__*/React.createElement("div", {
1456
- className: "ctBox"
1424
+ className: "px-6 pb-6 pt-4"
1457
1425
  }, /*#__PURE__*/React.createElement("div", {
1458
- className: "row"
1426
+ className: "flex flex-col gap-4"
1459
1427
  }, /*#__PURE__*/React.createElement("div", {
1460
- className: "inputBox"
1428
+ className: "flex flex-col gap-4"
1461
1429
  }, /*#__PURE__*/React.createElement("div", {
1462
- className: "textboxs",
1463
- id: "searchInput"
1464
- }, findAndReplace.findTextbox, "\uFF1A", /*#__PURE__*/React.createElement("input", {
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,
1465
1436
  className: "formulaInputFocus",
1466
1437
  autoFocus: true,
1467
1438
  spellCheck: "false",
1468
1439
  onKeyDown: function onKeyDown(e) {
1469
1440
  return e.stopPropagation();
1470
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
+ },
1471
1448
  value: searchText,
1472
1449
  onChange: function onChange(e) {
1473
- return setSearchText(e.target.value);
1450
+ if (e.target.value.length === 0) {
1451
+ setSearchResult([]);
1452
+ }
1453
+ setSearchText(e.target.value);
1474
1454
  }
1475
- })), showReplace && (/*#__PURE__*/React.createElement("div", {
1476
- className: "textboxs",
1477
- id: "replaceInput"
1478
- }, findAndReplace.replaceTextbox, "\uFF1A", /*#__PURE__*/React.createElement("input", {
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,
1479
1462
  className: "formulaInputFocus",
1480
1463
  spellCheck: "false",
1481
1464
  onKeyDown: function onKeyDown(e) {
1482
1465
  return e.stopPropagation();
1483
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
+ },
1484
1473
  value: replaceText,
1485
1474
  onChange: function onChange(e) {
1486
1475
  return setReplaceText(e.target.value);
1487
1476
  }
1488
- })))), /*#__PURE__*/React.createElement("div", {
1489
- className: "checkboxs"
1477
+ }))), /*#__PURE__*/React.createElement("div", {
1478
+ className: "flex flex-row gap-2"
1490
1479
  }, /*#__PURE__*/React.createElement("div", {
1491
- id: "regCheck"
1492
- }, /*#__PURE__*/React.createElement("input", {
1493
- type: "checkbox",
1494
- onChange: function onChange(e) {
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) {
1495
1490
  return setCheckMode("regCheck", e.target.checked);
1496
1491
  }
1497
1492
  }), /*#__PURE__*/React.createElement("span", null, findAndReplace.regexTextbox)), /*#__PURE__*/React.createElement("div", {
1498
- id: "wordCheck"
1499
- }, /*#__PURE__*/React.createElement("input", {
1500
- type: "checkbox",
1501
- onChange: function onChange(e) {
1502
- return setCheckMode("wordCheck", e.target.checked);
1503
- }
1504
- }), /*#__PURE__*/React.createElement("span", null, findAndReplace.wholeTextbox)), /*#__PURE__*/React.createElement("div", {
1505
- id: "caseCheck"
1506
- }, /*#__PURE__*/React.createElement("input", {
1507
- type: "checkbox",
1508
- 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) {
1509
1499
  return setCheckMode("caseCheck", e.target.checked);
1510
1500
  }
1511
- }), /*#__PURE__*/React.createElement("span", null, findAndReplace.distinguishTextbox)))), /*#__PURE__*/React.createElement("div", {
1512
- className: "btnBox"
1513
- }, showReplace && (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
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, {
1514
1515
  id: "replaceAllBtn",
1515
- className: "fortune-message-box-button button-default",
1516
+ variant: "secondary",
1517
+ className: "min-w-fit",
1516
1518
  onClick: function onClick() {
1517
1519
  setContext(function (draftCtx) {
1518
1520
  setSelectedCell(undefined);
@@ -1520,10 +1522,12 @@ var SearchReplace = function SearchReplace(_ref) {
1520
1522
  showAlert(alertMsg);
1521
1523
  });
1522
1524
  },
1523
- tabIndex: 0
1524
- }, findAndReplace.allReplaceBtn), /*#__PURE__*/React.createElement("div", {
1525
+ tabIndex: 0,
1526
+ disabled: searchText.length === 0 || replaceText.length === 0
1527
+ }, findAndReplace.allReplaceBtn), /*#__PURE__*/React.createElement(Button$1, {
1525
1528
  id: "replaceBtn",
1526
- className: "fortune-message-box-button button-default",
1529
+ variant: "secondary",
1530
+ className: "min-w-fit",
1527
1531
  onClick: function onClick() {
1528
1532
  return setContext(function (draftCtx) {
1529
1533
  setSelectedCell(undefined);
@@ -1533,10 +1537,12 @@ var SearchReplace = function SearchReplace(_ref) {
1533
1537
  }
1534
1538
  });
1535
1539
  },
1536
- tabIndex: 0
1537
- }, findAndReplace.replaceBtn))), /*#__PURE__*/React.createElement("div", {
1540
+ tabIndex: 0,
1541
+ disabled: searchText.length === 0 || replaceText.length === 0
1542
+ }, findAndReplace.replaceBtn), /*#__PURE__*/React.createElement(Button$1, {
1538
1543
  id: "searchAllBtn",
1539
- className: "fortune-message-box-button button-default",
1544
+ variant: "secondary",
1545
+ className: "min-w-fit",
1540
1546
  onClick: function onClick() {
1541
1547
  return setContext(function (draftCtx) {
1542
1548
  setSelectedCell(undefined);
@@ -1546,10 +1552,12 @@ var SearchReplace = function SearchReplace(_ref) {
1546
1552
  if (_.isEmpty(res)) showAlert(findAndReplace.noFindTip);
1547
1553
  });
1548
1554
  },
1549
- tabIndex: 0
1550
- }, findAndReplace.allFindBtn), /*#__PURE__*/React.createElement("div", {
1555
+ tabIndex: 0,
1556
+ disabled: searchText.length === 0
1557
+ }, findAndReplace.allFindBtn), /*#__PURE__*/React.createElement(Button$1, {
1551
1558
  id: "searchNextBtn",
1552
- className: "fortune-message-box-button button-default",
1559
+ variant: "default",
1560
+ className: "min-w-fit",
1553
1561
  onClick: function onClick() {
1554
1562
  return setContext(function (draftCtx) {
1555
1563
  setSearchResult([]);
@@ -1557,23 +1565,45 @@ var SearchReplace = function SearchReplace(_ref) {
1557
1565
  if (alertMsg != null) showAlert(alertMsg);
1558
1566
  });
1559
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
+ },
1560
1596
  tabIndex: 0
1561
- }, findAndReplace.findBtn))), /*#__PURE__*/React.createElement("div", {
1562
- className: "close-button fortune-message-box-button button-default",
1563
- onClick: closeDialog,
1564
- tabIndex: 0
1565
- }, button.close), searchResult.length > 0 && (/*#__PURE__*/React.createElement("div", {
1597
+ }, /*#__PURE__*/React.createElement(Table, {
1566
1598
  id: "searchAllbox"
1567
- }, /*#__PURE__*/React.createElement("div", {
1568
- className: "boxTitle"
1569
- }, /*#__PURE__*/React.createElement("span", null, findAndReplace.searchTargetSheet), /*#__PURE__*/React.createElement("span", null, findAndReplace.searchTargetCell), /*#__PURE__*/React.createElement("span", null, findAndReplace.searchTargetValue)), /*#__PURE__*/React.createElement("div", {
1570
- className: "boxMain"
1571
- }, searchResult.map(function (v) {
1572
- return /*#__PURE__*/React.createElement("div", {
1573
- 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, {
1574
1604
  r: v.r,
1575
1605
  c: v.c
1576
- }) ? "on" : ""),
1606
+ }) ? "color-bg-default-selected" : ""),
1577
1607
  key: v.cellPosition,
1578
1608
  onClick: function onClick() {
1579
1609
  setContext(function (draftCtx) {
@@ -1589,8 +1619,14 @@ var SearchReplace = function SearchReplace(_ref) {
1589
1619
  });
1590
1620
  },
1591
1621
  tabIndex: 0
1592
- }, /*#__PURE__*/React.createElement("span", null, v.sheetName), /*#__PURE__*/React.createElement("span", null, v.cellPosition), /*#__PURE__*/React.createElement("span", null, v.value));
1593
- }))))));
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
+ })))))))));
1594
1630
  };
1595
1631
 
1596
1632
  var LinkEditCard = function LinkEditCard(_ref) {