@leankylin-sheet/react 5.2.25 → 5.2.27

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.
@@ -1266,109 +1266,348 @@ html::-webkit-scrollbar-button {
1266
1266
  .leankylin-modal-dialog-icon-close:hover {
1267
1267
  opacity: 0.7;
1268
1268
  }
1269
- /*查找替换弹出框样式*/
1269
+ /* 查找替换弹出框样式 */
1270
1270
  #leankylin-search-replace {
1271
1271
  position: absolute;
1272
- padding: 30px 42px;
1272
+ padding: 24px 28px;
1273
1273
  z-index: 1002;
1274
+ min-width: 520px;
1275
+ max-height: calc(100vh - 60px);
1276
+ overflow-y: auto;
1277
+ font-family:
1278
+ -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
1279
+ Arial, sans-serif;
1274
1280
  }
1275
1281
 
1282
+ /* 关闭按钮 */
1276
1283
  #leankylin-search-replace .icon-close {
1277
- position: absolute;
1278
- right: 3px;
1279
- top: 3px;
1284
+ width: 28px;
1285
+ height: 28px;
1286
+ display: flex;
1287
+ align-items: center;
1288
+ justify-content: center;
1289
+ border-radius: 6px;
1290
+ color: #999;
1291
+ cursor: pointer;
1292
+ flex-shrink: 0;
1293
+ transition: all 0.15s;
1294
+ }
1295
+
1296
+ #leankylin-search-replace .icon-close:hover {
1297
+ background-color: rgba(0, 0, 0, 0.05);
1298
+ color: #555;
1299
+ }
1300
+
1301
+ #leankylin-search-replace .icon-close:active {
1302
+ background-color: rgba(0, 0, 0, 0.08);
1280
1303
  }
1281
1304
 
1305
+ /* 统一头部:tab + 关闭 */
1306
+ #leankylin-search-replace .sr-header {
1307
+ display: flex;
1308
+ align-items: center;
1309
+ gap: 8px;
1310
+ margin-bottom: 16px;
1311
+ }
1312
+
1313
+ /* Tab 切换 */
1282
1314
  #leankylin-search-replace .tabBox {
1283
- margin-top: 10px;
1284
- font-size: 0;
1315
+ display: flex;
1316
+ gap: 2px;
1317
+ flex: 1;
1318
+ background: #f3f3f6;
1319
+ border-radius: 6px;
1320
+ padding: 3px;
1321
+ margin-bottom: 0;
1285
1322
  }
1286
1323
 
1287
1324
  #leankylin-search-replace .tabBox span {
1288
- display: inline-block;
1325
+ flex: 1;
1326
+ display: inline-flex;
1327
+ align-items: center;
1328
+ justify-content: center;
1289
1329
  text-align: center;
1290
- width: 100px;
1291
- border: 1px solid rgb(235, 235, 235);
1292
- font-size: 14px;
1293
- line-height: 2;
1330
+ padding: 7px 0;
1331
+ border: none;
1332
+ border-radius: 4px;
1333
+ font-size: 13px;
1334
+ font-weight: 500;
1335
+ color: #666;
1336
+ cursor: pointer;
1337
+ transition: all 0.2s;
1338
+ background: transparent;
1339
+ }
1340
+
1341
+ #leankylin-search-replace .tabBox span:hover {
1342
+ color: #444;
1294
1343
  }
1295
1344
 
1296
1345
  #leankylin-search-replace .tabBox span.on {
1297
- background-color: #8C89FE;
1298
- border-color: #726EFE;
1299
- color: #fff;
1346
+ background-color: #fff;
1347
+ color: #333;
1348
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
1300
1349
  }
1301
1350
 
1351
+ /* 内容区 */
1302
1352
  #leankylin-search-replace .ctBox {
1303
- padding: 5px 10px;
1304
- border: 1px solid rgb(235, 235, 235);
1305
- font-size: 14px;
1306
- min-width: 500px;
1353
+ padding: 0;
1354
+ border: none;
1355
+ font-size: 13px;
1356
+ min-width: 460px;
1307
1357
  }
1308
1358
 
1309
1359
  #leankylin-search-replace .ctBox .row {
1310
1360
  display: flex;
1311
1361
  flex-direction: row;
1362
+ gap: 20px;
1312
1363
  justify-content: space-between;
1313
1364
  }
1314
1365
 
1366
+ /* 输入框区 */
1315
1367
  #leankylin-search-replace .inputBox {
1316
- height: 90px;
1368
+ flex: 1;
1369
+ display: flex;
1370
+ flex-direction: column;
1371
+ gap: 10px;
1317
1372
  position: relative;
1318
1373
  }
1319
1374
 
1320
1375
  #leankylin-search-replace .inputBox .textboxs {
1321
- height: 30px;
1322
- line-height: 30px;
1376
+ display: flex;
1377
+ align-items: center;
1378
+ gap: 8px;
1379
+ font-size: 13px;
1380
+ color: #555;
1381
+ white-space: nowrap;
1323
1382
  }
1324
1383
 
1384
+ #leankylin-search-replace .inputBox .textboxs input.formulaInputFocus {
1385
+ flex: 1;
1386
+ height: 32px;
1387
+ padding: 0 10px;
1388
+ border: 1px solid #d9d9d9;
1389
+ border-radius: 6px;
1390
+ font-size: 13px;
1391
+ color: #333;
1392
+ background: #fff;
1393
+ outline: none;
1394
+ transition: border-color 0.2s, box-shadow 0.2s;
1395
+ box-sizing: border-box;
1396
+ }
1397
+
1398
+ #leankylin-search-replace
1399
+ .inputBox
1400
+ .textboxs
1401
+ input.formulaInputFocus:focus {
1402
+ border-color: #8C89FE;
1403
+ box-shadow: 0 0 0 3px rgba(140, 137, 254, 0.12);
1404
+ }
1405
+
1406
+ #leankylin-search-replace
1407
+ .inputBox
1408
+ .textboxs
1409
+ input.formulaInputFocus:hover {
1410
+ border-color: #b0aefe;
1411
+ }
1412
+
1413
+ /* 选项区 (checkbox + 下拉) */
1325
1414
  #leankylin-search-replace .checkboxs {
1326
- height: 90px;
1415
+ display: flex;
1416
+ flex-direction: column;
1417
+ gap: 8px;
1418
+ min-width: 160px;
1327
1419
  }
1328
1420
 
1329
- #leankylin-search-replace .checkboxs div {
1330
- height: 30px;
1331
- line-height: 30px;
1421
+ #leankylin-search-replace .checkboxs > div {
1422
+ display: flex;
1423
+ align-items: center;
1424
+ gap: 0;
1332
1425
  }
1333
1426
 
1334
- #leankylin-search-replace .checkboxs input[type="checkbox"] {
1335
- float: left;
1336
- margin-top: 9px;
1427
+ /* 自定义 Checkbox */
1428
+ #leankylin-search-replace .checkboxs .sr-checkbox {
1429
+ display: inline-flex;
1430
+ align-items: center;
1431
+ gap: 8px;
1432
+ cursor: pointer;
1433
+ font-size: 13px;
1434
+ color: #555;
1435
+ -webkit-user-select: none;
1436
+ -moz-user-select: none;
1437
+ user-select: none;
1438
+ line-height: 1;
1439
+ padding: 4px 0;
1337
1440
  }
1338
1441
 
1442
+ #leankylin-search-replace .checkboxs .sr-checkbox input[type="checkbox"] {
1443
+ -moz-appearance: none;
1444
+ appearance: none;
1445
+ -webkit-appearance: none;
1446
+ width: 16px;
1447
+ height: 16px;
1448
+ margin: 0;
1449
+ border: 1.5px solid #c0c0c0;
1450
+ border-radius: 4px;
1451
+ background: #fff;
1452
+ cursor: pointer;
1453
+ position: relative;
1454
+ flex-shrink: 0;
1455
+ transition: all 0.15s;
1456
+ }
1457
+
1458
+ #leankylin-search-replace
1459
+ .checkboxs
1460
+ .sr-checkbox
1461
+ input[type="checkbox"]:hover {
1462
+ border-color: #8C89FE;
1463
+ }
1464
+
1465
+ #leankylin-search-replace
1466
+ .checkboxs
1467
+ .sr-checkbox
1468
+ input[type="checkbox"]:checked {
1469
+ background: #8C89FE;
1470
+ border-color: #8C89FE;
1471
+ }
1472
+
1473
+ #leankylin-search-replace
1474
+ .checkboxs
1475
+ .sr-checkbox
1476
+ input[type="checkbox"]:checked::after {
1477
+ content: "";
1478
+ position: absolute;
1479
+ left: 4.5px;
1480
+ top: 1.5px;
1481
+ width: 5px;
1482
+ height: 9px;
1483
+ border: solid #fff;
1484
+ border-width: 0 2px 2px 0;
1485
+ transform: rotate(45deg);
1486
+ }
1487
+
1488
+ #leankylin-search-replace
1489
+ .checkboxs
1490
+ .sr-checkbox
1491
+ input[type="checkbox"]:focus-visible {
1492
+ box-shadow: 0 0 0 3px rgba(140, 137, 254, 0.15);
1493
+ }
1494
+
1495
+ #leankylin-search-replace .checkboxs .sr-checkbox span {
1496
+ color: #555;
1497
+ }
1498
+
1499
+ /* 搜索范围下拉 - 与查找/替换输入行同样的布局,select 展开至 input 相同宽度 */
1500
+ #leankylin-search-replace #searchTypeSelect {
1501
+ display: flex;
1502
+ align-items: center;
1503
+ gap: 8px;
1504
+ font-size: 13px;
1505
+ color: #555;
1506
+ white-space: nowrap;
1507
+ }
1508
+
1509
+ #leankylin-search-replace #searchTypeSelect > span {
1510
+ flex-shrink: 0;
1511
+ }
1512
+
1513
+ #leankylin-search-replace #searchTypeSelect select {
1514
+ flex: 1;
1515
+ width: auto;
1516
+ height: 32px;
1517
+ padding: 0 28px 0 10px;
1518
+ border: 1px solid #d9d9d9;
1519
+ border-radius: 6px;
1520
+ background-color: #fff;
1521
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M3 4.5L6 8l3-3.5H3z'/%3E%3C/svg%3E");
1522
+ background-repeat: no-repeat;
1523
+ background-position: right 8px center;
1524
+ font-size: 13px;
1525
+ color: #333;
1526
+ cursor: pointer;
1527
+ outline: none;
1528
+ -moz-appearance: none;
1529
+ appearance: none;
1530
+ -webkit-appearance: none;
1531
+ transition: border-color 0.2s, box-shadow 0.2s;
1532
+ box-sizing: border-box;
1533
+ }
1534
+
1535
+ #leankylin-search-replace #searchTypeSelect select:hover {
1536
+ border-color: #b0aefe;
1537
+ }
1538
+
1539
+ #leankylin-search-replace #searchTypeSelect select:focus {
1540
+ border-color: #8C89FE;
1541
+ box-shadow: 0 0 0 3px rgba(140, 137, 254, 0.12);
1542
+ }
1543
+
1544
+ /* 按钮区 */
1339
1545
  #leankylin-search-replace .btnBox {
1340
- margin-top: 10px;
1546
+ display: flex;
1547
+ flex-wrap: wrap;
1548
+ gap: 8px;
1549
+ margin-top: 16px;
1341
1550
  }
1342
1551
 
1343
1552
  #leankylin-search-replace .btnBox .button-default {
1344
- margin-right: 8px;
1345
- margin-left: 0px;
1553
+ margin: 0;
1554
+ padding: 6px 16px;
1555
+ border-radius: 6px;
1556
+ font-size: 13px;
1557
+ font-weight: 500;
1558
+ transition: all 0.15s;
1346
1559
  }
1347
1560
 
1561
+ #leankylin-search-replace .btnBox .button-default:hover {
1562
+ border-color: #8C89FE;
1563
+ color: #8C89FE;
1564
+ }
1565
+
1566
+ #leankylin-search-replace .btnBox .button-default:active {
1567
+ background-color: #f9f9ff;
1568
+ }
1569
+
1570
+ /* 关闭按钮 */
1348
1571
  #leankylin-search-replace .close-button {
1349
- margin-left: 0px;
1350
- margin-top: 10px;
1572
+ margin: 12px 0 0;
1573
+ padding: 6px 20px;
1574
+ border-radius: 6px;
1575
+ font-size: 13px;
1576
+ transition: all 0.15s;
1351
1577
  }
1352
1578
 
1579
+ #leankylin-search-replace .close-button:hover {
1580
+ border-color: #aaa;
1581
+ }
1582
+
1583
+ /* 搜索结果列表 */
1353
1584
  #leankylin-search-replace #searchAllbox {
1354
1585
  height: 210px;
1355
- border: 1px solid #d4d4d4;
1356
- margin-top: 10px;
1586
+ border: 1px solid #e8e8e8;
1587
+ border-radius: 6px;
1588
+ margin-top: 14px;
1357
1589
  overflow-y: auto;
1358
1590
  position: relative;
1591
+ background: #fff;
1359
1592
  }
1360
1593
 
1361
1594
  #leankylin-search-replace #searchAllbox .boxTitle {
1362
1595
  width: 100%;
1363
- height: 30px;
1364
- line-height: 29px;
1365
- padding: 0 5px;
1366
- background-color: #fff;
1367
- border-bottom: 1px solid #d4d4d4;
1596
+ height: 34px;
1597
+ line-height: 34px;
1598
+ padding: 0 10px;
1599
+ background-color: #fafafa;
1600
+ border-bottom: 1px solid #e8e8e8;
1368
1601
  box-sizing: border-box;
1369
1602
  position: sticky;
1370
1603
  left: 0;
1371
1604
  top: 0;
1605
+ z-index: 1;
1606
+ font-size: 12px;
1607
+ font-weight: 600;
1608
+ color: #888;
1609
+ text-transform: uppercase;
1610
+ letter-spacing: 0.3px;
1372
1611
  }
1373
1612
 
1374
1613
  #leankylin-search-replace #searchAllbox .boxTitle span {
@@ -1389,11 +1628,23 @@ html::-webkit-scrollbar-button {
1389
1628
  }
1390
1629
 
1391
1630
  #leankylin-search-replace #searchAllbox .boxMain .boxItem {
1392
- height: 30px;
1393
- line-height: 29px;
1394
- border-bottom: 1px solid #d4d4d4;
1395
- padding: 0 5px;
1631
+ height: 32px;
1632
+ line-height: 32px;
1633
+ border-bottom: 1px solid #f0f0f0;
1634
+ padding: 0 10px;
1396
1635
  box-sizing: border-box;
1636
+ cursor: pointer;
1637
+ font-size: 13px;
1638
+ color: #444;
1639
+ transition: background-color 0.12s;
1640
+ }
1641
+
1642
+ #leankylin-search-replace #searchAllbox .boxMain .boxItem:hover {
1643
+ background-color: #f5f5ff;
1644
+ }
1645
+
1646
+ #leankylin-search-replace #searchAllbox .boxMain .boxItem:last-child {
1647
+ border-bottom: none;
1397
1648
  }
1398
1649
 
1399
1650
  #leankylin-search-replace #searchAllbox .boxMain .boxItem.on {
@@ -1419,6 +1670,8 @@ html::-webkit-scrollbar-button {
1419
1670
  overflow: hidden;
1420
1671
  text-overflow: ellipsis;
1421
1672
  white-space: nowrap;
1673
+ font-family: "SF Mono", "Fira Code", Menlo, monospace;
1674
+ font-size: 12px;
1422
1675
  }
1423
1676
 
1424
1677
  #leankylin-search-replace #searchAllbox .boxMain .boxItem span:nth-of-type(3) {
@@ -1427,6 +1680,25 @@ html::-webkit-scrollbar-button {
1427
1680
  text-overflow: ellipsis;
1428
1681
  white-space: nowrap;
1429
1682
  }
1683
+
1684
+ /* 滚动条美化 */
1685
+ #leankylin-search-replace #searchAllbox::-webkit-scrollbar {
1686
+ width: 6px;
1687
+ }
1688
+
1689
+ #leankylin-search-replace #searchAllbox::-webkit-scrollbar-track {
1690
+ background: transparent;
1691
+ }
1692
+
1693
+ #leankylin-search-replace #searchAllbox::-webkit-scrollbar-thumb {
1694
+ background: #d4d4d4;
1695
+ border-radius: 3px;
1696
+ }
1697
+
1698
+ #leankylin-search-replace #searchAllbox::-webkit-scrollbar-thumb:hover {
1699
+ background: #bbb;
1700
+ }
1701
+
1430
1702
  .leankylin-link-modify-modal {
1431
1703
  position: absolute;
1432
1704
  overflow: hidden;
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defaultContext, defaultSettings, getSheetIndex, colLocationByIndex, fixPositionOnFrozenCells, colLocation, getFlowdata, isAllowEdit, handleColumnHeaderMouseDown, handleColSizeHandleMouseDown, handleColFreezeHandleMouseDown, handleContextMenu, selectTitlesMap, selectTitlesRange, fixColumnStyleOverflowInFreeze, rowLocationByIndex, rowLocation, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, handleRowFreezeHandleMouseDown, fixRowStyleOverflowInFreeze, functionHTMLGenerate, locale, getCellValue, createRangeHightlight, isInlineStringCell, getInlineStringHTML, valueShowEs, escapeHTMLTag, escapeScriptTag, isShowHidenCR, cancelNormalSelected, moveHighlightCell, updateCell, israngeseleciton, handleFormulaInput, onSearchDialogMoveStart, replaceAll, replace, searchAll, searchNext, normalizeSelection, scrollToHighlightCell, isLinkValid, getRangetxt, goToLink, replaceHtml, removeHyperlink, onRangeSelectionModalMoveStart, saveHyperlink, createFilterOptions, onImageMoveStart, onImageResizeStart, showComments, setEditingComment, onCommentBoxMoveStart, onCommentBoxResizeStart, confirmMessage, getRangeByTxt, getDropdownList, setCellValue, setConditionRules, mergeBorder, setDropcownValue, handleCellAreaMouseDown, handleCellAreaMouseMove, handleCellAreaDragOver, handleCellDrop, handleCellAreaDoubleClick, selectAll, showLinkCard, getCellRowColumn, getCellHyperlink, handleOverlayMouseMove, handleOverlayMouseUp, handleKeydownForZoom, handleOverlayTouchStart, handleOverlayTouchMove, handleOverlayTouchEnd, 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, getDataBySelectionNoCopy, getInlineStringNoStyle, rangeHightlightselected, editSheetName, setNextSheet, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, addSheet, indexToColumnChar, sortSelection, handleCopy, insertRowCol, deleteRowCol, hideSelected, showSelected, api, removeActiveImage, deleteSelectedCellText, jfrefreshgrid, handleLink, deleteSheet, opToPatch, orderbydatafiler, getFilterColumnValues, getFilterColumnColors, saveFilter, cancelActiveImgItem, patchToOp, filterPatch, inverseRowColOptions, ensureSheetIndex, initSheetIndex, handleGlobalKeyDown, handlePasteByLeanklin, groupValuesRefresh } from '@leankylin-sheet/core';
1
+ import { defaultContext, defaultSettings, getSheetIndex, colLocationByIndex, fixPositionOnFrozenCells, colLocation, getFlowdata, isAllowEdit, handleColumnHeaderMouseDown, handleColSizeHandleMouseDown, handleColFreezeHandleMouseDown, handleContextMenu, selectTitlesMap, selectTitlesRange, fixColumnStyleOverflowInFreeze, rowLocationByIndex, rowLocation, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, handleRowFreezeHandleMouseDown, fixRowStyleOverflowInFreeze, functionHTMLGenerate, locale, getCellValue, createRangeHightlight, isInlineStringCell, getInlineStringHTML, valueShowEs, escapeHTMLTag, escapeScriptTag, isShowHidenCR, cancelNormalSelected, moveHighlightCell, updateCell, israngeseleciton, handleFormulaInput, onSearchDialogMoveStart, replaceAll, replace, searchAll, searchNext, changeSheet, normalizeSelection, scrollToHighlightCell, isLinkValid, getRangetxt, goToLink, replaceHtml, removeHyperlink, onRangeSelectionModalMoveStart, saveHyperlink, createFilterOptions, onImageMoveStart, onImageResizeStart, showComments, setEditingComment, onCommentBoxMoveStart, onCommentBoxResizeStart, confirmMessage, getRangeByTxt, getDropdownList, setCellValue, setConditionRules, mergeBorder, setDropcownValue, handleCellAreaMouseDown, handleCellAreaMouseMove, handleCellAreaDragOver, handleCellDrop, handleCellAreaDoubleClick, selectAll, showLinkCard, getCellRowColumn, getCellHyperlink, handleOverlayMouseMove, handleOverlayMouseUp, handleKeydownForZoom, handleOverlayTouchStart, handleOverlayTouchMove, handleOverlayTouchEnd, 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, getDataBySelectionNoCopy, getInlineStringNoStyle, rangeHightlightselected, editSheetName, setNextSheet, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, addSheet, indexToColumnChar, sortSelection, handleCopy, insertRowCol, deleteRowCol, hideSelected, showSelected, api, removeActiveImage, deleteSelectedCellText, jfrefreshgrid, handleLink, deleteSheet, opToPatch, orderbydatafiler, getFilterColumnValues, getFilterColumnColors, saveFilter, cancelActiveImgItem, patchToOp, filterPatch, inverseRowColOptions, ensureSheetIndex, initSheetIndex, handleGlobalKeyDown, handlePasteByLeanklin, groupValuesRefresh } from '@leankylin-sheet/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';
@@ -1548,6 +1548,10 @@ var SearchReplace = function SearchReplace() {
1548
1548
  _useState12 = _slicedToArray(_useState11, 2),
1549
1549
  checkMode = _useState12[0],
1550
1550
  checkModeReplace = _useState12[1];
1551
+ var _useState13 = useState("v"),
1552
+ _useState14 = _slicedToArray(_useState13, 2),
1553
+ searchType = _useState14[0],
1554
+ setSearchType = _useState14[1];
1551
1555
  var closeDialog = useCallback(function () {
1552
1556
  _.set(refs.globalCache, "searchDialog.mouseEnter", false);
1553
1557
  setContext(function (draftCtx) {
@@ -1562,9 +1566,12 @@ var SearchReplace = function SearchReplace() {
1562
1566
  }, []);
1563
1567
  var getInitialPosition = useCallback(function (container) {
1564
1568
  var rect = container.getBoundingClientRect();
1569
+ var estimatedHeight = 520;
1570
+ var dialogWidth = 500;
1571
+ var top = Math.max(40, Math.min((rect.height - estimatedHeight) / 2, rect.height - estimatedHeight - 20));
1565
1572
  return {
1566
- left: (rect.width - 500) / 2,
1567
- top: (rect.height - 200) / 3
1573
+ left: Math.max(20, (rect.width - dialogWidth) / 2),
1574
+ top: Number.isFinite(top) && top > 0 ? top : 40
1568
1575
  };
1569
1576
  }, []);
1570
1577
  var body = document.body;
@@ -1592,15 +1599,8 @@ var SearchReplace = function SearchReplace() {
1592
1599
  return e.stopPropagation();
1593
1600
  }
1594
1601
  }, /*#__PURE__*/React.createElement("div", {
1595
- className: "icon-close leankylin-modal-dialog-icon-close",
1596
- onClick: closeDialog
1597
- }, /*#__PURE__*/React.createElement(SVGIcon, {
1598
- name: "close",
1599
- style: {
1600
- padding: 7,
1601
- cursor: "pointer"
1602
- }
1603
- })), /*#__PURE__*/React.createElement("div", {
1602
+ className: "sr-header"
1603
+ }, /*#__PURE__*/React.createElement("div", {
1604
1604
  className: "tabBox"
1605
1605
  }, /*#__PURE__*/React.createElement("span", {
1606
1606
  id: "searchTab",
@@ -1615,12 +1615,38 @@ var SearchReplace = function SearchReplace() {
1615
1615
  return setShowReplace(true);
1616
1616
  }
1617
1617
  }, findAndReplace.replace)), /*#__PURE__*/React.createElement("div", {
1618
+ className: "icon-close",
1619
+ onClick: closeDialog
1620
+ }, /*#__PURE__*/React.createElement("svg", {
1621
+ width: "14",
1622
+ height: "14",
1623
+ viewBox: "0 0 16 16",
1624
+ fill: "none"
1625
+ }, /*#__PURE__*/React.createElement("path", {
1626
+ d: "M12 4L4 12M4 4l8 8",
1627
+ stroke: "currentColor",
1628
+ strokeWidth: "1.5",
1629
+ strokeLinecap: "round"
1630
+ })))), /*#__PURE__*/React.createElement("div", {
1618
1631
  className: "ctBox"
1619
1632
  }, /*#__PURE__*/React.createElement("div", {
1620
1633
  className: "row"
1621
1634
  }, /*#__PURE__*/React.createElement("div", {
1622
1635
  className: "inputBox"
1623
1636
  }, /*#__PURE__*/React.createElement("div", {
1637
+ id: "searchTypeSelect"
1638
+ }, /*#__PURE__*/React.createElement("span", null, findAndReplace.searchTypeLabel, "\uFF1A"), /*#__PURE__*/React.createElement("select", {
1639
+ value: searchType,
1640
+ onChange: function onChange(e) {
1641
+ return setSearchType(e.target.value);
1642
+ }
1643
+ }, /*#__PURE__*/React.createElement("option", {
1644
+ value: "v"
1645
+ }, findAndReplace.searchTypeValue), /*#__PURE__*/React.createElement("option", {
1646
+ value: "f"
1647
+ }, findAndReplace.searchTypeFormula), /*#__PURE__*/React.createElement("option", {
1648
+ value: "m"
1649
+ }, findAndReplace.searchTypeDisplay))), /*#__PURE__*/React.createElement("div", {
1624
1650
  className: "textboxs",
1625
1651
  id: "searchInput"
1626
1652
  }, findAndReplace.findTextbox, "\uFF1A", /*#__PURE__*/React.createElement("input", {
@@ -1651,26 +1677,32 @@ var SearchReplace = function SearchReplace() {
1651
1677
  className: "checkboxs"
1652
1678
  }, /*#__PURE__*/React.createElement("div", {
1653
1679
  id: "regCheck"
1680
+ }, /*#__PURE__*/React.createElement("div", {
1681
+ className: "sr-checkbox"
1654
1682
  }, /*#__PURE__*/React.createElement("input", {
1655
1683
  type: "checkbox",
1656
1684
  onChange: function onChange(e) {
1657
1685
  return setCheckMode("regCheck", e.target.checked);
1658
1686
  }
1659
- }), /*#__PURE__*/React.createElement("span", null, findAndReplace.regexTextbox)), /*#__PURE__*/React.createElement("div", {
1687
+ }), /*#__PURE__*/React.createElement("span", null, findAndReplace.regexTextbox))), /*#__PURE__*/React.createElement("div", {
1660
1688
  id: "wordCheck"
1689
+ }, /*#__PURE__*/React.createElement("div", {
1690
+ className: "sr-checkbox"
1661
1691
  }, /*#__PURE__*/React.createElement("input", {
1662
1692
  type: "checkbox",
1663
1693
  onChange: function onChange(e) {
1664
1694
  return setCheckMode("wordCheck", e.target.checked);
1665
1695
  }
1666
- }), /*#__PURE__*/React.createElement("span", null, findAndReplace.wholeTextbox)), /*#__PURE__*/React.createElement("div", {
1696
+ }), /*#__PURE__*/React.createElement("span", null, findAndReplace.wholeTextbox))), /*#__PURE__*/React.createElement("div", {
1667
1697
  id: "caseCheck"
1698
+ }, /*#__PURE__*/React.createElement("div", {
1699
+ className: "sr-checkbox"
1668
1700
  }, /*#__PURE__*/React.createElement("input", {
1669
1701
  type: "checkbox",
1670
1702
  onChange: function onChange(e) {
1671
1703
  return setCheckMode("caseCheck", e.target.checked);
1672
1704
  }
1673
- }), /*#__PURE__*/React.createElement("span", null, findAndReplace.distinguishTextbox)))), /*#__PURE__*/React.createElement("div", {
1705
+ }), /*#__PURE__*/React.createElement("span", null, findAndReplace.distinguishTextbox))))), /*#__PURE__*/React.createElement("div", {
1674
1706
  className: "btnBox"
1675
1707
  }, showReplace && ( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
1676
1708
  id: "replaceAllBtn",
@@ -1678,7 +1710,7 @@ var SearchReplace = function SearchReplace() {
1678
1710
  onClick: function onClick() {
1679
1711
  setContext(function (draftCtx) {
1680
1712
  setSelectedCell(undefined);
1681
- var alertMsg = replaceAll(draftCtx, searchText, replaceText, checkMode);
1713
+ var alertMsg = replaceAll(draftCtx, searchText, replaceText, checkMode, searchType);
1682
1714
  showAlert(alertMsg);
1683
1715
  });
1684
1716
  }
@@ -1688,7 +1720,7 @@ var SearchReplace = function SearchReplace() {
1688
1720
  onClick: function onClick() {
1689
1721
  return setContext(function (draftCtx) {
1690
1722
  setSelectedCell(undefined);
1691
- var alertMsg = replace(draftCtx, searchText, replaceText, checkMode);
1723
+ var alertMsg = replace(draftCtx, searchText, replaceText, checkMode, searchType);
1692
1724
  if (alertMsg != null) {
1693
1725
  showAlert(alertMsg);
1694
1726
  }
@@ -1701,7 +1733,7 @@ var SearchReplace = function SearchReplace() {
1701
1733
  return setContext(function (draftCtx) {
1702
1734
  setSelectedCell(undefined);
1703
1735
  if (!searchText) return;
1704
- var res = searchAll(draftCtx, searchText, checkMode);
1736
+ var res = searchAll(draftCtx, searchText, checkMode, searchType);
1705
1737
  setSearchResult(res);
1706
1738
  if (_.isEmpty(res)) showAlert(findAndReplace.noFindTip);
1707
1739
  });
@@ -1712,7 +1744,7 @@ var SearchReplace = function SearchReplace() {
1712
1744
  onClick: function onClick() {
1713
1745
  return setContext(function (draftCtx) {
1714
1746
  setSearchResult([]);
1715
- var alertMsg = searchNext(draftCtx, searchText, checkMode);
1747
+ var alertMsg = searchNext(draftCtx, searchText, checkMode, searchType);
1716
1748
  if (alertMsg != null) showAlert(alertMsg);
1717
1749
  });
1718
1750
  }
@@ -1737,6 +1769,9 @@ var SearchReplace = function SearchReplace() {
1737
1769
  key: v.cellPosition,
1738
1770
  onClick: function onClick() {
1739
1771
  setContext(function (draftCtx) {
1772
+ if (v.sheetId !== draftCtx.currentSheetId) {
1773
+ changeSheet(draftCtx, v.sheetId);
1774
+ }
1740
1775
  draftCtx.luckysheet_select_save = normalizeSelection(draftCtx, [{
1741
1776
  row: [v.r, v.r],
1742
1777
  column: [v.c, v.c]