@fileverse-dev/fortune-react 1.2.4 → 1.2.6

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.
Files changed (42) hide show
  1. package/es/components/ConditionFormat/index.css +0 -2
  2. package/es/components/ContextMenu/Menu.d.ts +0 -1
  3. package/es/components/ContextMenu/Menu.js +2 -5
  4. package/es/components/ContextMenu/index.css +1 -4
  5. package/es/components/ContextMenu/index.js +8 -35
  6. package/es/components/DataVerification/ColorPicker.js +2 -2
  7. package/es/components/DataVerification/DropdownList.js +13 -3
  8. package/es/components/DataVerification/DropdownOption.js +14 -1
  9. package/es/components/DataVerification/RangeDialog.js +2 -0
  10. package/es/components/DataVerification/index.css +18 -4
  11. package/es/components/DataVerification/index.js +29 -13
  12. package/es/components/SheetOverlay/ColumnHeader.js +34 -19
  13. package/es/components/SheetOverlay/FormulaHint/index.js +2 -2
  14. package/es/components/SheetOverlay/FormulaSearch/index.css +1 -0
  15. package/es/components/SheetOverlay/FormulaSearch/index.js +1 -1
  16. package/es/components/SheetOverlay/RowHeader.js +33 -6
  17. package/es/components/SheetOverlay/index.css +24 -7
  18. package/es/components/Toolbar/Combo.js +2 -5
  19. package/es/components/Toolbar/Select.js +1 -1
  20. package/es/components/Toolbar/index.css +1 -21
  21. package/es/components/Toolbar/index.js +1 -2
  22. package/lib/components/ConditionFormat/index.css +0 -2
  23. package/lib/components/ContextMenu/Menu.d.ts +0 -1
  24. package/lib/components/ContextMenu/Menu.js +2 -5
  25. package/lib/components/ContextMenu/index.css +1 -4
  26. package/lib/components/ContextMenu/index.js +7 -34
  27. package/lib/components/DataVerification/ColorPicker.js +2 -2
  28. package/lib/components/DataVerification/DropdownList.js +13 -3
  29. package/lib/components/DataVerification/DropdownOption.js +14 -1
  30. package/lib/components/DataVerification/RangeDialog.js +2 -0
  31. package/lib/components/DataVerification/index.css +18 -4
  32. package/lib/components/DataVerification/index.js +29 -13
  33. package/lib/components/SheetOverlay/ColumnHeader.js +33 -17
  34. package/lib/components/SheetOverlay/FormulaHint/index.js +2 -2
  35. package/lib/components/SheetOverlay/FormulaSearch/index.css +1 -0
  36. package/lib/components/SheetOverlay/FormulaSearch/index.js +1 -1
  37. package/lib/components/SheetOverlay/RowHeader.js +32 -4
  38. package/lib/components/SheetOverlay/index.css +24 -7
  39. package/lib/components/Toolbar/Combo.js +1 -4
  40. package/lib/components/Toolbar/Select.js +1 -1
  41. package/lib/components/Toolbar/index.css +1 -21
  42. package/package.json +2 -2
@@ -22,8 +22,6 @@
22
22
  z-index: 1005;
23
23
  border-radius: 4px;
24
24
  cursor: pointer;
25
- align-items: center;
26
- height: 32px;
27
25
  }
28
26
 
29
27
  .condition-format-item:hover {
@@ -3,7 +3,6 @@ type Props = React.PropsWithChildren<{
3
3
  onClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>, container: HTMLDivElement) => void;
4
4
  onMouseLeave?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>, container: HTMLDivElement) => void;
5
5
  onMouseEnter?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>, container: HTMLDivElement) => void;
6
- isActive?: boolean;
7
6
  }>;
8
7
  declare const Menu: React.FC<Props>;
9
8
  export default Menu;
@@ -1,16 +1,13 @@
1
- import { cn } from "@fileverse/ui";
2
1
  import React, { useRef } from "react";
3
2
  var Menu = function Menu(_a) {
4
3
  var _onClick = _a.onClick,
5
4
  _onMouseLeave = _a.onMouseLeave,
6
5
  _onMouseEnter = _a.onMouseEnter,
7
- children = _a.children,
8
- _b = _a.isActive,
9
- isActive = _b === void 0 ? false : _b;
6
+ children = _a.children;
10
7
  var containerRef = useRef(null);
11
8
  return /*#__PURE__*/React.createElement("div", {
12
9
  ref: containerRef,
13
- className: cn("luckysheet-cols-menuitem luckysheet-mousedown-cancel", isActive && "color-bg-default-hover"),
10
+ className: "luckysheet-cols-menuitem luckysheet-mousedown-cancel",
14
11
  onClick: function onClick(e) {
15
12
  return _onClick === null || _onClick === void 0 ? void 0 : _onClick(e, containerRef.current);
16
13
  },
@@ -82,10 +82,7 @@
82
82
  cursor: pointer;
83
83
  list-style: none;
84
84
  margin: 0;
85
- padding-right: 8px !important;
86
- padding-left: 8px !important;
87
- padding-top: 6px !important;
88
- padding-bottom: 6px !important;
85
+ padding: 8px !important;
89
86
  white-space: nowrap;
90
87
  user-select: none;
91
88
  display: flex;
@@ -115,7 +115,7 @@ var __generator = this && this.__generator || function (thisArg, body) {
115
115
  };
116
116
  import { locale, handleCopy, handlePasteByClick, deleteRowCol, insertRowCol, removeActiveImage, deleteSelectedCellText, sortSelection, createFilter, showImgChooser, handleLink, hideSelected, showSelected, getSheetIndex, api, isAllowEdit, jfrefreshgrid, newComment, getFreezeState, toggleFreeze, clearFilter, clearSelectedCellFormat, clearColumnsCellsFormat, clearRowsCellsFormat } from "@fileverse-dev/fortune-core";
117
117
  import _ from "lodash";
118
- import React, { useContext, useRef, useCallback, useLayoutEffect, useState } from "react";
118
+ import React, { useContext, useRef, useCallback, useLayoutEffect } from "react";
119
119
  import regeneratorRuntime from "regenerator-runtime";
120
120
  import Tippy from "@tippyjs/react";
121
121
  import { LucideIcon } from "@fileverse/ui";
@@ -149,9 +149,6 @@ var ContextMenu = function ContextMenu() {
149
149
  info = _b.info,
150
150
  toolbar = _b.toolbar,
151
151
  splitText = _b.splitText;
152
- var _c = useState(""),
153
- activeMenu = _c[0],
154
- setActiveMenu = _c[1];
155
152
  var addRowColRightAvobe = function addRowColRightAvobe(type, direction) {
156
153
  var _a, _b, _c, _d, _e, _f;
157
154
  var positionCol = (_c = (_b = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.column) === null || _c === void 0 ? void 0 : _c[0];
@@ -832,12 +829,6 @@ var ContextMenu = function ContextMenu() {
832
829
  arrow: false,
833
830
  zIndex: 3000,
834
831
  appendTo: document.body,
835
- onShow: function onShow() {
836
- setActiveMenu("sort");
837
- },
838
- onHide: function onHide() {
839
- if (activeMenu === "sort") setActiveMenu("");
840
- },
841
832
  content: /*#__PURE__*/React.createElement("div", {
842
833
  className: "fortune-toolbar-select",
843
834
  style: {
@@ -876,9 +867,7 @@ var ContextMenu = function ContextMenu() {
876
867
  }), /*#__PURE__*/React.createElement("p", null, sort.desc))))),
877
868
  trigger: "mouseenter focus",
878
869
  hideOnClick: false
879
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Menu, {
880
- isActive: activeMenu === "sort"
881
- }, /*#__PURE__*/React.createElement("div", {
870
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement("div", {
882
871
  className: "flex items-center justify-between w-full"
883
872
  }, /*#__PURE__*/React.createElement("div", {
884
873
  className: "context-item"
@@ -918,7 +907,7 @@ var ContextMenu = function ContextMenu() {
918
907
  }, /*#__PURE__*/React.createElement("div", {
919
908
  className: "context-item p-2 w-full",
920
909
  style: {
921
- height: "32px"
910
+ height: "40px"
922
911
  }
923
912
  }, /*#__PURE__*/React.createElement(LucideIcon, {
924
913
  name: "Filter",
@@ -933,22 +922,14 @@ var ContextMenu = function ContextMenu() {
933
922
  }, /*#__PURE__*/React.createElement("div", {
934
923
  className: "context-item p-2 w-full",
935
924
  style: {
936
- height: "32px"
925
+ height: "40px"
937
926
  }
938
927
  }, /*#__PURE__*/React.createElement(LucideIcon, {
939
928
  name: "Eraser"
940
929
  }), /*#__PURE__*/React.createElement("p", null, filter.clearFilter))))),
941
930
  trigger: "mouseenter focus",
942
- hideOnClick: false,
943
- onShow: function onShow() {
944
- setActiveMenu("filter");
945
- },
946
- onHide: function onHide() {
947
- if (activeMenu === "filter") setActiveMenu("");
948
- }
949
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Menu, {
950
- isActive: activeMenu === "filter"
951
- }, /*#__PURE__*/React.createElement("div", {
931
+ hideOnClick: false
932
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement("div", {
952
933
  className: "flex items-center justify-between w-full"
953
934
  }, /*#__PURE__*/React.createElement("div", {
954
935
  className: "context-item"
@@ -1002,12 +983,6 @@ var ContextMenu = function ContextMenu() {
1002
983
  arrow: false,
1003
984
  zIndex: 3000,
1004
985
  appendTo: document.body,
1005
- onShow: function onShow() {
1006
- setActiveMenu("conditionFormat");
1007
- },
1008
- onHide: function onHide() {
1009
- if (activeMenu === "conditionFormat") setActiveMenu("");
1010
- },
1011
986
  content: /*#__PURE__*/React.createElement("div", {
1012
987
  style: {
1013
988
  minWidth: 220
@@ -1018,9 +993,7 @@ var ContextMenu = function ContextMenu() {
1018
993
  })),
1019
994
  trigger: "mouseenter focus",
1020
995
  hideOnClick: false
1021
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Menu, {
1022
- isActive: activeMenu === "conditionFormat"
1023
- }, /*#__PURE__*/React.createElement("div", {
996
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement("div", {
1024
997
  className: "flex items-center justify-between w-full"
1025
998
  }, /*#__PURE__*/React.createElement("div", {
1026
999
  className: "flex items-center gap-2 context-item"
@@ -1056,7 +1029,7 @@ var ContextMenu = function ContextMenu() {
1056
1029
  }), /*#__PURE__*/React.createElement("p", null, "Clear formatting")));
1057
1030
  }
1058
1031
  return null;
1059
- }, [context, setContext, refs.globalCache, rightclick, showAlert, showDialog, drag.noMulti, info.tipRowHeightLimit, info.tipColumnWidthLimit, generalDialog.partiallyError, generalDialog.readOnlyError, generalDialog.dataNullError, activeMenu]);
1032
+ }, [context, setContext, refs.globalCache, rightclick, showAlert, showDialog, drag.noMulti, info.tipRowHeightLimit, info.tipColumnWidthLimit, generalDialog.partiallyError, generalDialog.readOnlyError, generalDialog.dataNullError]);
1060
1033
  useLayoutEffect(function () {
1061
1034
  var _a;
1062
1035
  if (!containerRef.current) {
@@ -104,14 +104,14 @@ export var ColorSection = function ColorSection(_a) {
104
104
  title: color.name
105
105
  }));
106
106
  }), /*#__PURE__*/React.createElement("div", {
107
- className: "w-full flex justify-center",
107
+ className: "w-full flex justify-center color-picker-reset-btn",
108
108
  onClick: function onClick() {
109
109
  onPick("228, 232, 237");
110
110
  setIsOpen(false);
111
111
  }
112
112
  }, /*#__PURE__*/React.createElement(IconButton, {
113
113
  icon: "DropletOff",
114
- size: "md",
114
+ size: "sm",
115
115
  variant: "ghost",
116
116
  className: "color-picker-icon"
117
117
  }), /*#__PURE__*/React.createElement(Button, {
@@ -146,8 +146,15 @@ var DropDownList = function DropDownList() {
146
146
  display: isMul && selected.indexOf(v) >= 0 ? "inline" : "none"
147
147
  }
148
148
  }), v);
149
+ }), /*#__PURE__*/React.createElement("hr", {
150
+ style: {
151
+ border: "none",
152
+ height: "1px",
153
+ background: "hsl(var(--color-bg-default-hover, #F2F4F5))",
154
+ marginBottom: "4px"
155
+ }
149
156
  }), /*#__PURE__*/React.createElement("div", {
150
- className: "w-full flex align-center",
157
+ className: "w-full flex align-center edit-dropdown",
151
158
  style: {
152
159
  height: "28px"
153
160
  },
@@ -159,11 +166,14 @@ var DropDownList = function DropDownList() {
159
166
  icon: "Pencil",
160
167
  size: "sm",
161
168
  variant: "ghost",
162
- className: "color-picker-icon pt-2 color-picker"
169
+ className: "color-picker-icon color-picker edit-dropdown",
170
+ style: {
171
+ paddingTop: "0px !important"
172
+ }
163
173
  }), /*#__PURE__*/React.createElement(Button, {
164
174
  size: "md",
165
175
  variant: "ghost",
166
- className: "color-picker-reset color-picker"
176
+ className: "color-picker-reset color-picker edit-dropdown"
167
177
  }, "Edit")));
168
178
  };
169
179
  export default DropDownList;
@@ -47,7 +47,20 @@ var DynamicInputList = function DynamicInputList(_a) {
47
47
  });
48
48
  };
49
49
  useEffect(function () {
50
- handleAdd();
50
+ if (optionItems.length === 0) {
51
+ var nextNum_1 = 1;
52
+ setOptionItems(function (prev) {
53
+ return __spreadArray(__spreadArray([], prev, true), [{
54
+ id: createId(),
55
+ value: "Option ".concat(nextNum_1),
56
+ color: "228, 232, 237"
57
+ }, {
58
+ id: createId(),
59
+ value: "Option ".concat(nextNum_1 + 1),
60
+ color: "228, 232, 237"
61
+ }], false);
62
+ });
63
+ }
51
64
  }, []);
52
65
  var handleRemove = function handleRemove(index) {
53
66
  setOptionItems(function (prev) {
@@ -18,10 +18,12 @@ var RangeDialog = function RangeDialog() {
18
18
  rangeTxt2 = _c[0],
19
19
  setRangeTxt2 = _c[1];
20
20
  var close = useCallback(function () {
21
+ var _a;
21
22
  setContext(function (ctx) {
22
23
  ctx.rangeDialog.show = false;
23
24
  ctx.rangeDialog.singleSelect = false;
24
25
  });
26
+ (_a = document.getElementById("data-verification-button")) === null || _a === void 0 ? void 0 : _a.click();
25
27
  if (!context.rangeDialog) return;
26
28
  var rangeDialogType = context.rangeDialog.type;
27
29
  if (rangeDialogType.indexOf("between") >= 0) {
@@ -201,6 +201,15 @@
201
201
  min-width: 100px;
202
202
  }
203
203
 
204
+ .color-picker-reset-btn {
205
+ height: 30px;
206
+ border-radius: 6px;
207
+ }
208
+
209
+ .color-picker-reset-btn:hover {
210
+ background: hsl(var(--color-bg-default-hover, #F2F4F5))!important;
211
+ }
212
+
204
213
  .color-picker:hover {
205
214
  background: hsl(var(--color-bg-default-hover, #F2F4F5))!important;
206
215
  }
@@ -212,15 +221,20 @@
212
221
  }
213
222
 
214
223
  .color-picker-reset {
224
+ height: 30px !important;
225
+ padding-top: 0px !important;
226
+ padding-bottom: 0px !important;
215
227
  min-width: 0px !important;
216
228
  padding-left: 0px !important;
217
229
  margin-left: 0px !important;
218
230
  }
219
231
 
220
- .color-picker-reset:hover {
221
- background-color: white!important;
232
+ .edit-dropdown {
233
+ height: 28px!important;
234
+ border-radius: 5px;
222
235
  }
223
236
 
224
- .color-picker-icon:hover {
225
- background-color: white!important;
237
+ .edit-dropdown:hover {
238
+ height: 28px!important;
239
+ background: hsl(var(--color-bg-default-hover, #F2F4F5))!important;
226
240
  }
@@ -215,6 +215,18 @@ var DataVerification = function DataVerification() {
215
215
  }
216
216
  });
217
217
  }, []);
218
+ var rangeOnClick = function rangeOnClick() {
219
+ var _a;
220
+ (_a = document.getElementById("data-verification-button")) === null || _a === void 0 ? void 0 : _a.click();
221
+ hideDialog();
222
+ dataSelectRange("rangeTxt", context.dataVerification.dataRegulation.value1);
223
+ };
224
+ var rangeOnChange = function rangeOnChange(e) {
225
+ var value = e.target.value;
226
+ setContext(function (ctx) {
227
+ ctx.dataVerification.dataRegulation.rangeTxt = value;
228
+ });
229
+ };
218
230
  return /*#__PURE__*/React.createElement("div", {
219
231
  id: "fortune-data-verification"
220
232
  }, /*#__PURE__*/React.createElement("div", {
@@ -230,23 +242,19 @@ var DataVerification = function DataVerification() {
230
242
  }, dataVerification.cellRange), /*#__PURE__*/React.createElement(TextField, {
231
243
  rightIcon: /*#__PURE__*/React.createElement(LucideIcon, {
232
244
  name: "Grid2x2",
233
- size: "sm"
245
+ size: "sm",
246
+ onClick: rangeOnClick,
247
+ onChange: rangeOnChange,
248
+ style: {
249
+ cursor: "pointer",
250
+ color: "#363B3F"
251
+ }
234
252
  }),
235
253
  "aria-hidden": "true",
236
254
  readOnly: true,
237
255
  value: (_a = context.dataVerification.dataRegulation) === null || _a === void 0 ? void 0 : _a.rangeTxt,
238
- onChange: function onChange(e) {
239
- var value = e.target.value;
240
- setContext(function (ctx) {
241
- ctx.dataVerification.dataRegulation.rangeTxt = value;
242
- });
243
- },
244
- onClick: function onClick() {
245
- var _a;
246
- (_a = document.getElementById("data-verification-button")) === null || _a === void 0 ? void 0 : _a.click();
247
- hideDialog();
248
- dataSelectRange("rangeTxt", context.dataVerification.dataRegulation.value1);
249
- }
256
+ onChange: rangeOnChange,
257
+ onClick: rangeOnClick
250
258
  })), /*#__PURE__*/React.createElement("div", {
251
259
  className: "flex flex-col"
252
260
  }, /*#__PURE__*/React.createElement("div", {
@@ -299,9 +307,17 @@ var DataVerification = function DataVerification() {
299
307
  }, /*#__PURE__*/React.createElement("span", {
300
308
  className: "data-verification-checkbox-label"
301
309
  }, dataVerification.selected), /*#__PURE__*/React.createElement(TextField, {
310
+ onMouseDown: function onMouseDown(e) {
311
+ e.stopPropagation();
312
+ e.target.focus();
313
+ },
314
+ onKeyDown: function onKeyDown(e) {
315
+ e.stopPropagation();
316
+ },
302
317
  value: (_g = (_f = context.dataVerification) === null || _f === void 0 ? void 0 : _f.dataRegulation) === null || _g === void 0 ? void 0 : _g.value1,
303
318
  placeholder: dataVerification.placeholder2,
304
319
  onChange: function onChange(e) {
320
+ e.stopPropagation();
305
321
  var value = e.target.value;
306
322
  setContext(function (ctx) {
307
323
  ctx.dataVerification.dataRegulation.value1 = value;
@@ -1,5 +1,4 @@
1
- import { colLocation, colLocationByIndex, selectTitlesMap, selectTitlesRange, handleColSizeHandleMouseDown, handleColumnHeaderMouseDown, isAllowEdit, getFlowdata, fixColumnStyleOverflowInFreeze, handleColFreezeHandleMouseDown, getSheetIndex, fixPositionOnFrozenCells, showSelected } from "@fileverse-dev/fortune-core";
2
- import { api } from "@fileverse-dev/fortune-core";
1
+ import { colLocation, colLocationByIndex, selectTitlesMap, selectTitlesRange, handleColSizeHandleMouseDown, handleColumnHeaderMouseDown, isAllowEdit, getFlowdata, fixColumnStyleOverflowInFreeze, handleColFreezeHandleMouseDown, getSheetIndex, fixPositionOnFrozenCells, showSelected, api } from "@fileverse-dev/fortune-core";
3
2
  import _ from "lodash";
4
3
  import React, { useContext, useState, useRef, useCallback, useEffect, useMemo } from "react";
5
4
  import WorkbookContext from "../../context";
@@ -163,6 +162,7 @@ var ColumnHeader = function ColumnHeader() {
163
162
  if (sheetIndex == null) return;
164
163
  var tempPointers = [];
165
164
  var colhidden = (_b = (_a = context.luckysheetfile[sheetIndex]) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.colhidden;
165
+ console.log(colhidden);
166
166
  if (colhidden) {
167
167
  Object.keys(colhidden).forEach(function (key) {
168
168
  var item = {
@@ -171,20 +171,36 @@ var ColumnHeader = function ColumnHeader() {
171
171
  };
172
172
  tempPointers.push(item);
173
173
  });
174
- console.log(tempPointers);
175
174
  setHiddenPointers(tempPointers);
176
175
  } else {
177
176
  setHiddenPointers([]);
178
177
  }
179
178
  }, [context.visibledatacolumn, sheetIndex]);
180
179
  var showColumn = function showColumn(e, item) {
180
+ var _a, _b;
181
+ if (sheetIndex == null) return;
182
+ var startPoint = item.col;
183
+ var startCol = startPoint,
184
+ endCol = startPoint;
185
+ var colhiddenData = (_b = (_a = context.luckysheetfile[sheetIndex]) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.colhidden;
186
+ var findColBoundary = function findColBoundary(start, direction) {
187
+ var tempPoint = start;
188
+ while (true) {
189
+ var checkColIndex = tempPoint + direction;
190
+ if (!(colhiddenData === null || colhiddenData === void 0 ? void 0 : colhiddenData.hasOwnProperty(checkColIndex))) break;
191
+ tempPoint = checkColIndex;
192
+ }
193
+ return tempPoint;
194
+ };
195
+ startCol = findColBoundary(startPoint, -1);
196
+ endCol = findColBoundary(startPoint, 1);
181
197
  if (context.isFlvReadOnly) return;
182
198
  e.stopPropagation();
183
199
  setContext(function (ctx) {
184
200
  var _a;
185
201
  api.setSelection(ctx, [{
186
202
  row: [0, (_a = context.visibledatarow) === null || _a === void 0 ? void 0 : _a.length],
187
- column: [Number(item.col) - 1, Number(item.col) + 1]
203
+ column: [Number(startCol) - 1, Number(endCol) + 1]
188
204
  }], {
189
205
  id: context.currentSheetId
190
206
  });
@@ -192,6 +208,15 @@ var ColumnHeader = function ColumnHeader() {
192
208
  setContext(function (ctx) {
193
209
  showSelected(ctx, "column");
194
210
  });
211
+ setContext(function (ctx) {
212
+ var _a;
213
+ api.setSelection(ctx, [{
214
+ row: [0, (_a = context.visibledatarow) === null || _a === void 0 ? void 0 : _a.length],
215
+ column: [Number(startCol), Number(endCol)]
216
+ }], {
217
+ id: context.currentSheetId
218
+ });
219
+ });
195
220
  };
196
221
  useEffect(function () {
197
222
  containerRef.current.scrollLeft = context.scrollLeft;
@@ -217,10 +242,10 @@ var ColumnHeader = function ColumnHeader() {
217
242
  }
218
243
  }, hiddenPointers.map(function (item) {
219
244
  return /*#__PURE__*/React.createElement("div", {
220
- className: "flex gap-4 cursor-pointer hide-btn align-center",
245
+ className: "flex gap-4 cursor-pointer hide-btn align-center jusify-between",
221
246
  style: {
222
247
  height: context.columnHeaderHeight - 12,
223
- left: "".concat(item.left - 12, "px")
248
+ left: "".concat(item.left - 15, "px")
224
249
  },
225
250
  onClick: function onClick(e) {
226
251
  return showColumn(e, item);
@@ -236,18 +261,7 @@ var ColumnHeader = function ColumnHeader() {
236
261
  }, /*#__PURE__*/React.createElement("path", {
237
262
  d: "M0.164574 4.20629L3.54376 7.58548C3.7275 7.76922 4.04167 7.63909 4.04167 7.37924L4.04167 0.620865C4.04167 0.361018 3.7275 0.230885 3.54376 0.414625L0.164575 3.79381C0.0506717 3.90772 0.0506715 4.09239 0.164574 4.20629Z",
238
263
  fill: "#363B3F"
239
- }))));
240
- }), hiddenPointers.map(function (item) {
241
- return /*#__PURE__*/React.createElement("div", {
242
- className: "flex gap-4 cursor-pointer hide-btn align-center",
243
- style: {
244
- height: context.columnHeaderHeight - 12,
245
- left: "".concat(item.left + 6, "px")
246
- },
247
- onClick: function onClick(e) {
248
- return showColumn(e, item);
249
- }
250
- }, /*#__PURE__*/React.createElement("div", {
264
+ }))), /*#__PURE__*/React.createElement("div", {
251
265
  className: ""
252
266
  }, /*#__PURE__*/React.createElement("svg", {
253
267
  xmlns: "http://www.w3.org/2000/svg",
@@ -306,12 +320,13 @@ var ColumnHeader = function ColumnHeader() {
306
320
  c1 = _a.c1,
307
321
  c2 = _a.c2;
308
322
  return /*#__PURE__*/React.createElement("div", {
309
- className: "fortune-col-header-selected color-bg-tertiary",
323
+ className: "fortune-col-header-selected",
310
324
  key: i,
311
325
  style: _.assign({
312
326
  left: col_pre,
313
327
  width: col - col_pre - 1,
314
328
  display: "block",
329
+ backgroundColor: "#EFC703",
315
330
  mixBlendMode: "multiply"
316
331
  }, fixColumnStyleOverflowInFreeze(context, c1, c2, (_b = refs.globalCache.freezen) === null || _b === void 0 ? void 0 : _b[context.currentSheetId]))
317
332
  });
@@ -195,14 +195,14 @@ var FormulaHint = function FormulaHint(props) {
195
195
  if (param.require === "o") {
196
196
  name = "[".concat(name, "]");
197
197
  }
198
- return /*#__PURE__*/React.createElement("code", {
198
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("code", {
199
199
  className: "luckysheet-arguments-help-parameter font-family-mono mb-1 mt-2 color-text-default",
200
200
  dir: "auto",
201
201
  key: name,
202
202
  style: {
203
203
  backgroundColor: commaCount === i ? bgColor(fn.BRAND_SECONDARY_COLOR) : "transparent"
204
204
  }
205
- }, name, i !== fn.p.length - 1 && ", ");
205
+ }, name), i !== fn.p.length - 1 && ", ");
206
206
  })), /*#__PURE__*/React.createElement("code", {
207
207
  className: "luckysheet-arguments-paren font-family-mono mb-1 mt-2 color-text-default"
208
208
  }, ")")), /*#__PURE__*/React.createElement("div", {
@@ -6,6 +6,7 @@
6
6
  background: #fff;
7
7
  z-index: 1003;
8
8
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
9
+ border: 1px solid lavender;
9
10
  border-radius: 10px;
10
11
  }
11
12
 
@@ -53,7 +53,7 @@ var FormulaSearch = function FormulaSearch(props) {
53
53
  });
54
54
  if (_.isEmpty(context.functionCandidates) && _.isEmpty(context.defaultCandidates)) return null;
55
55
  return /*#__PURE__*/React.createElement("div", {
56
- className: "flex color-border-default border flex-col luckysheet-formula-search-c-p custom-scroll",
56
+ className: "flex flex-col luckysheet-formula-search-c-p custom-scroll",
57
57
  id: "luckysheet-formula-search-c-p",
58
58
  style: {
59
59
  top: top
@@ -1,5 +1,4 @@
1
- import { rowLocation, rowLocationByIndex, selectTitlesMap, selectTitlesRange, handleContextMenu, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, fixRowStyleOverflowInFreeze, handleRowFreezeHandleMouseDown, getSheetIndex, showSelected, fixPositionOnFrozenCells } from "@fileverse-dev/fortune-core";
2
- import { api } from "@fileverse-dev/fortune-core";
1
+ import { rowLocation, rowLocationByIndex, selectTitlesMap, selectTitlesRange, handleContextMenu, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, fixRowStyleOverflowInFreeze, handleRowFreezeHandleMouseDown, getSheetIndex, showSelected, fixPositionOnFrozenCells, api } from "@fileverse-dev/fortune-core";
3
2
  import _ from "lodash";
4
3
  import React, { useContext, useState, useRef, useCallback, useEffect, useMemo } from "react";
5
4
  import WorkbookContext from "../../context";
@@ -176,12 +175,30 @@ var RowHeader = function RowHeader() {
176
175
  }
177
176
  }, [context.visibledatarow, sheetIndex]);
178
177
  var showRow = function showRow(e, item) {
178
+ var _a, _b;
179
+ if (sheetIndex == null) return;
180
+ var startPoint = item.row;
181
+ var startRow = startPoint,
182
+ endRow = startPoint;
183
+ var rowhiddenData = (_b = (_a = context.luckysheetfile[sheetIndex]) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.rowhidden;
184
+ var findRowBoundary = function findRowBoundary(start, direction) {
185
+ var tempPoint = start;
186
+ while (true) {
187
+ var checkRowIndex = tempPoint + direction;
188
+ if (!(rowhiddenData === null || rowhiddenData === void 0 ? void 0 : rowhiddenData.hasOwnProperty(checkRowIndex))) break;
189
+ tempPoint = checkRowIndex;
190
+ }
191
+ return tempPoint;
192
+ };
193
+ startRow = findRowBoundary(startPoint, -1);
194
+ endRow = findRowBoundary(startPoint, 1);
195
+ console.log(startRow, endRow);
179
196
  if (context.isFlvReadOnly) return;
180
197
  e.stopPropagation();
181
198
  setContext(function (ctx) {
182
199
  var _a;
183
200
  api.setSelection(ctx, [{
184
- row: [Number(item.row) - 1, Number(item.row) + 1],
201
+ row: [Number(startRow) - 1, Number(endRow) + 1],
185
202
  column: [0, (_a = context.visibledatacolumn) === null || _a === void 0 ? void 0 : _a.length]
186
203
  }], {
187
204
  id: context.currentSheetId
@@ -190,6 +207,15 @@ var RowHeader = function RowHeader() {
190
207
  setContext(function (ctx) {
191
208
  showSelected(ctx, "row");
192
209
  });
210
+ setContext(function (ctx) {
211
+ var _a;
212
+ api.setSelection(ctx, [{
213
+ row: [Number(startRow), Number(endRow)],
214
+ column: [0, (_a = context.visibledatacolumn) === null || _a === void 0 ? void 0 : _a.length]
215
+ }], {
216
+ id: context.currentSheetId
217
+ });
218
+ });
193
219
  };
194
220
  useEffect(function () {
195
221
  containerRef.current.scrollTop = context.scrollTop;
@@ -207,9 +233,9 @@ var RowHeader = function RowHeader() {
207
233
  onContextMenu: onContextMenu
208
234
  }, hiddenPointers.map(function (item) {
209
235
  return /*#__PURE__*/React.createElement("div", {
210
- className: "flex flex-col gap-4 cursor-pointer align-center hide-btn-row hide-btn",
236
+ className: "flex flex-col gap-4 cursor-pointer align-center hide-btn-row",
211
237
  style: {
212
- top: "".concat(item.top - 16, "px"),
238
+ top: "".concat(item.top - 15, "px"),
213
239
  zIndex: 100
214
240
  },
215
241
  onClick: function onClick(e) {
@@ -266,12 +292,13 @@ var RowHeader = function RowHeader() {
266
292
  r1 = _a.r1,
267
293
  r2 = _a.r2;
268
294
  return /*#__PURE__*/React.createElement("div", {
269
- className: "fortune-row-header-selected color-bg-tertiary",
295
+ className: "fortune-row-header-selected",
270
296
  key: i,
271
297
  style: _.assign({
272
298
  top: row_pre,
273
299
  height: row - row_pre - 1,
274
300
  display: "block",
301
+ backgroundColor: "#EFC703",
275
302
  mixBlendMode: "multiply"
276
303
  }, fixRowStyleOverflowInFreeze(context, r1, r2, (_b = refs.globalCache.freezen) === null || _b === void 0 ? void 0 : _b[context.currentSheetId]))
277
304
  });