@fileverse-dev/fortune-react 1.1.99-patch-2 → 1.2.0-comment-ui-fixes-1

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 (33) hide show
  1. package/es/components/ContextMenu/index.js +2 -2
  2. package/es/components/DataVerification/ColorPicker.js +31 -7
  3. package/es/components/DataVerification/DropdownList.js +20 -1
  4. package/es/components/DataVerification/DropdownOption.js +5 -2
  5. package/es/components/DataVerification/RangeDialog.js +1 -5
  6. package/es/components/DataVerification/index.css +21 -1
  7. package/es/components/DataVerification/index.js +31 -5
  8. package/es/components/NotationBoxes/index.js +3 -11
  9. package/es/components/SheetOverlay/ColumnHeader.js +88 -5
  10. package/es/components/SheetOverlay/FormulaHint/index.js +13 -2
  11. package/es/components/SheetOverlay/RowHeader.js +82 -5
  12. package/es/components/SheetOverlay/index.css +24 -1
  13. package/es/components/Toolbar/index.d.ts +1 -1
  14. package/es/components/Toolbar/index.js +28 -19
  15. package/es/components/Workbook/index.d.ts +1 -1
  16. package/es/components/Workbook/index.js +5 -0
  17. package/lib/components/ContextMenu/index.js +2 -2
  18. package/lib/components/DataVerification/ColorPicker.js +30 -6
  19. package/lib/components/DataVerification/DropdownList.js +20 -1
  20. package/lib/components/DataVerification/DropdownOption.js +5 -2
  21. package/lib/components/DataVerification/RangeDialog.js +1 -5
  22. package/lib/components/DataVerification/index.css +21 -1
  23. package/lib/components/DataVerification/index.js +31 -5
  24. package/lib/components/NotationBoxes/index.js +3 -11
  25. package/lib/components/SheetOverlay/ColumnHeader.js +86 -4
  26. package/lib/components/SheetOverlay/FormulaHint/index.js +13 -2
  27. package/lib/components/SheetOverlay/RowHeader.js +80 -4
  28. package/lib/components/SheetOverlay/index.css +24 -1
  29. package/lib/components/Toolbar/index.d.ts +1 -1
  30. package/lib/components/Toolbar/index.js +27 -19
  31. package/lib/components/Workbook/index.d.ts +1 -1
  32. package/lib/components/Workbook/index.js +5 -0
  33. package/package.json +3 -3
@@ -633,7 +633,7 @@ var ContextMenu = function ContextMenu() {
633
633
  }), /*#__PURE__*/React.createElement("div", null, rightclick.deleteSelected, rightclick.row))));
634
634
  }
635
635
  if (name === "hide-row") {
636
- return (selection === null || selection === void 0 ? void 0 : selection.row_select) === true && ["hideSelected", "showHide"].map(function (item) {
636
+ return (selection === null || selection === void 0 ? void 0 : selection.row_select) && ["hideSelected", "showHide"].map(function (item) {
637
637
  return /*#__PURE__*/React.createElement(Menu, {
638
638
  key: item,
639
639
  onClick: function onClick() {
@@ -1077,7 +1077,7 @@ var ContextMenu = function ContextMenu() {
1077
1077
  left: contextMenu.x,
1078
1078
  top: contextMenu.y
1079
1079
  }
1080
- }, context.contextMenu.headerMenu === true ? settings.headerContextMenu.map(function (menu, i) {
1080
+ }, context.contextMenu.headerMenu === true || context.contextMenu.headerMenu === "row" ? settings.headerContextMenu.map(function (menu, i) {
1081
1081
  return getMenuElement(menu, i);
1082
1082
  }) : settings.cellContextMenu.map(function (menu, i) {
1083
1083
  return getMenuElement(menu, i);
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from "react";
2
2
  import { ChevronDown } from "lucide-react";
3
- import { Popover, PopoverContent, PopoverTrigger } from "@fileverse/ui";
3
+ import { Button, Popover, PopoverContent, PopoverTrigger, IconButton } from "@fileverse/ui";
4
4
  export var TEXT_COLORS = [{
5
5
  name: "Light Gray",
6
6
  value: "228, 232, 237"
@@ -57,7 +57,9 @@ export var ColorSection = function ColorSection(_a) {
57
57
  }, /*#__PURE__*/React.createElement("div", {
58
58
  className: "flex items-center justify-between color-picker rounded transition-all cursor-pointer border border-gray-300",
59
59
  style: {
60
- padding: "7px"
60
+ padding: "7px",
61
+ border: "var(--border-width-md, 1px) solid hsl(var(--color-border-default, #E8EBEC))",
62
+ borderRadius: "var(--border-radius-sm, 4px)"
61
63
  }
62
64
  }, /*#__PURE__*/React.createElement("div", {
63
65
  className: "flex items-center gap-3 color-text-secondary"
@@ -72,7 +74,7 @@ export var ColorSection = function ColorSection(_a) {
72
74
  })))), /*#__PURE__*/React.createElement(PopoverContent, {
73
75
  align: "start",
74
76
  alignOffset: 0,
75
- className: "w-[200px] export-content-popover",
77
+ className: "color-picker-container",
76
78
  elevation: 2,
77
79
  side: "bottom",
78
80
  sideOffset: 4
@@ -81,18 +83,40 @@ export var ColorSection = function ColorSection(_a) {
81
83
  }, /*#__PURE__*/React.createElement("div", {
82
84
  className: "flex gap-2 flex-wrap w-full"
83
85
  }, TEXT_COLORS.map(function (color) {
84
- return /*#__PURE__*/React.createElement("button", {
86
+ return /*#__PURE__*/React.createElement("div", {
87
+ key: color.value,
88
+ className: "w-7 h-7 rounded-full transition-all hover:scale-110 hover:shadow-md",
89
+ style: {
90
+ border: "".concat(color.value) === trigerColor ? "2px solid rgb(".concat(color.value, ")") : "none",
91
+ padding: "2px"
92
+ }
93
+ }, /*#__PURE__*/React.createElement("button", {
85
94
  type: "button",
86
95
  key: color.value,
87
96
  onClick: function onClick() {
88
97
  onPick(color.value);
89
98
  setIsOpen(false);
90
99
  },
91
- className: "w-7 h-7 rounded-full transition-all hover:scale-110 hover:shadow-md",
100
+ className: "w-full h-full rounded-full transition-all hover:scale-110 hover:shadow-md",
92
101
  style: {
93
102
  backgroundColor: "rgb(".concat(color.value, ")")
94
103
  },
95
104
  title: color.name
96
- });
97
- })))));
105
+ }));
106
+ }), /*#__PURE__*/React.createElement("div", {
107
+ className: "w-full flex justify-center",
108
+ onClick: function onClick() {
109
+ onPick("228, 232, 237");
110
+ setIsOpen(false);
111
+ }
112
+ }, /*#__PURE__*/React.createElement(IconButton, {
113
+ icon: "DropletOff",
114
+ size: "md",
115
+ variant: "ghost",
116
+ className: "color-picker-icon"
117
+ }), /*#__PURE__*/React.createElement(Button, {
118
+ size: "md",
119
+ variant: "ghost",
120
+ className: "color-picker-reset"
121
+ }, "Reset"))))));
98
122
  };
@@ -1,5 +1,6 @@
1
1
  import { getCellValue, getDropdownList, getFlowdata, getSheetIndex, mergeBorder, setDropdownValue } from "@fileverse-dev/fortune-core";
2
2
  import React, { useCallback, useContext, useEffect, useRef, useState } from "react";
3
+ import { Button, IconButton } from "@fileverse/ui";
3
4
  import WorkbookContext from "../../context";
4
5
  import { useOutsideClick } from "../../hooks/useOutsideClick";
5
6
  import SVGIcon from "../SVGIcon";
@@ -145,6 +146,24 @@ var DropDownList = function DropDownList() {
145
146
  display: isMul && selected.indexOf(v) >= 0 ? "inline" : "none"
146
147
  }
147
148
  }), v);
148
- }));
149
+ }), /*#__PURE__*/React.createElement("div", {
150
+ className: "w-full flex align-center",
151
+ style: {
152
+ height: "28px"
153
+ },
154
+ onClick: function onClick() {
155
+ var _a;
156
+ (_a = window === null || window === void 0 ? void 0 : window.dataVerificationClick) === null || _a === void 0 ? void 0 : _a.call(window);
157
+ }
158
+ }, /*#__PURE__*/React.createElement(IconButton, {
159
+ icon: "Pencil",
160
+ size: "sm",
161
+ variant: "ghost",
162
+ className: "color-picker-icon pt-2 color-picker"
163
+ }), /*#__PURE__*/React.createElement(Button, {
164
+ size: "md",
165
+ variant: "ghost",
166
+ className: "color-picker-reset color-picker"
167
+ }, "Edit")));
149
168
  };
150
169
  export default DropDownList;
@@ -174,7 +174,7 @@ var DynamicInputList = function DynamicInputList(_a) {
174
174
  }, optionItems.map(function (item, index) {
175
175
  return /*#__PURE__*/React.createElement("li", {
176
176
  key: item.id,
177
- className: cn("relative flex optionItems-center gap-3 transition mb-4", draggingIndex === index && "scale-[0.99] opacity-80 shadow-lg rounded-xl"),
177
+ className: cn("relative flex optionItems-center gap-2 transition mb-4", draggingIndex === index && "scale-[0.99] opacity-80 shadow-lg rounded-xl"),
178
178
  onDragOver: function onDragOver(e) {
179
179
  return onDragOverRow(index, e);
180
180
  },
@@ -269,7 +269,10 @@ var DynamicInputList = function DynamicInputList(_a) {
269
269
  }, /*#__PURE__*/React.createElement(Button, {
270
270
  variant: "secondary",
271
271
  onClick: handleAdd,
272
- className: ""
272
+ size: "sm",
273
+ style: {
274
+ fontWeight: 500
275
+ }
273
276
  }, "Add another item")));
274
277
  };
275
278
  export default DynamicInputList;
@@ -1,7 +1,6 @@
1
1
  import { locale } from "@fileverse-dev/fortune-core";
2
2
  import { Button, cn, IconButton, TextField } from "@fileverse/ui";
3
3
  import React, { useCallback, useContext, useEffect, useState } from "react";
4
- import DataVerification from ".";
5
4
  import WorkbookContext from "../../context";
6
5
  import { useDialog } from "../../hooks/useDialog";
7
6
  import ConditionRules from "../ConditionFormat/ConditionRules";
@@ -14,8 +13,7 @@ var RangeDialog = function RangeDialog() {
14
13
  var showDialog = useDialog().showDialog;
15
14
  var _b = locale(context),
16
15
  dataVerification = _b.dataVerification,
17
- button = _b.button,
18
- toolbar = _b.toolbar;
16
+ button = _b.button;
19
17
  var _c = useState(getDisplayedRangeTxt(context)),
20
18
  rangeTxt2 = _c[0],
21
19
  setRangeTxt2 = _c[1];
@@ -37,9 +35,7 @@ var RangeDialog = function RangeDialog() {
37
35
  showDialog(/*#__PURE__*/React.createElement(ConditionRules, {
38
36
  type: rulesType
39
37
  }), undefined, locale(context).conditionformat["conditionformat_".concat(rulesType)]);
40
- return;
41
38
  }
42
- showDialog(/*#__PURE__*/React.createElement(DataVerification, null), undefined, toolbar.dataVerification);
43
39
  }, [setContext, showDialog, context]);
44
40
  useEffect(function () {
45
41
  setRangeTxt2(getDisplayedRangeTxt(context));
@@ -202,5 +202,25 @@
202
202
  }
203
203
 
204
204
  .color-picker:hover {
205
- background: hsl(var(--color-bg-default-hover, #F2F4F5));
205
+ background: hsl(var(--color-bg-default-hover, #F2F4F5))!important;
206
+ }
207
+
208
+ .color-picker-container {
209
+ border: 1px solid hsl(var(--color-border-default, #E8EBEC)) !important;
210
+ box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.15);
211
+ width: 230px !important;
212
+ }
213
+
214
+ .color-picker-reset {
215
+ min-width: 0px !important;
216
+ padding-left: 0px !important;
217
+ margin-left: 0px !important;
218
+ }
219
+
220
+ .color-picker-reset:hover {
221
+ background-color: white!important;
222
+ }
223
+
224
+ .color-picker-icon:hover {
225
+ background-color: white!important;
206
226
  }
@@ -84,6 +84,14 @@ var DataVerification = function DataVerification() {
84
84
  }));
85
85
  }
86
86
  }, []);
87
+ var dataSelectRange = useCallback(function (type, value) {
88
+ hideDialog();
89
+ setContext(function (ctx) {
90
+ ctx.rangeDialog.show = true;
91
+ ctx.rangeDialog.type = type;
92
+ ctx.rangeDialog.rangeTxt = value;
93
+ });
94
+ }, [hideDialog, setContext]);
87
95
  var btn = useCallback(function (type) {
88
96
  if (type === "confirm") {
89
97
  setContext(function (ctx) {
@@ -210,7 +218,7 @@ var DataVerification = function DataVerification() {
210
218
  return /*#__PURE__*/React.createElement("div", {
211
219
  id: "fortune-data-verification"
212
220
  }, /*#__PURE__*/React.createElement("div", {
213
- className: "flex flex-col gap-4",
221
+ className: "flex flex-col gap-4 h-[calc(100vh-270px)] overflow-y-auto no-scrollbar",
214
222
  style: {
215
223
  width: "345px",
216
224
  padding: "16px"
@@ -226,7 +234,19 @@ var DataVerification = function DataVerification() {
226
234
  }),
227
235
  "aria-hidden": "true",
228
236
  readOnly: true,
229
- value: (_a = context.dataVerification.dataRegulation) === null || _a === void 0 ? void 0 : _a.rangeTxt
237
+ 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
+ }
230
250
  })), /*#__PURE__*/React.createElement("div", {
231
251
  className: "flex flex-col"
232
252
  }, /*#__PURE__*/React.createElement("div", {
@@ -271,7 +291,7 @@ var DataVerification = function DataVerification() {
271
291
  });
272
292
  }
273
293
  }), /*#__PURE__*/React.createElement("span", {
274
- className: "ml-2"
294
+ className: "ml-2 text-body-sm"
275
295
  }, dataVerification.allowMultiSelect)))), ((_e = (_d = context.dataVerification) === null || _d === void 0 ? void 0 : _d.dataRegulation) === null || _e === void 0 ? void 0 : _e.type) === "checkbox" && (/*#__PURE__*/React.createElement("div", {
276
296
  className: "mt-4 space-y-2"
277
297
  }, /*#__PURE__*/React.createElement("div", {
@@ -387,7 +407,7 @@ var DataVerification = function DataVerification() {
387
407
  });
388
408
  }
389
409
  }), /*#__PURE__*/React.createElement("span", {
390
- className: "ml-2"
410
+ className: "ml-2 text-body-sm"
391
411
  }, dataVerification[v]));
392
412
  }), ((_o = (_m = context.dataVerification) === null || _m === void 0 ? void 0 : _m.dataRegulation) === null || _o === void 0 ? void 0 : _o.hintShow) && (/*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TextField, {
393
413
  placeholder: dataVerification.placeholder5,
@@ -399,7 +419,11 @@ var DataVerification = function DataVerification() {
399
419
  });
400
420
  }
401
421
  }))))), /*#__PURE__*/React.createElement(Divider, {
402
- className: "w-full border-t-[1px] my-4"
422
+ className: "border-t-[1px]",
423
+ style: {
424
+ width: "315px",
425
+ margin: "0 16px 16px 16px"
426
+ }
403
427
  }), /*#__PURE__*/React.createElement("div", {
404
428
  className: "flex gap-2 justify-between items-center",
405
429
  style: {
@@ -423,7 +447,9 @@ var DataVerification = function DataVerification() {
423
447
  minWidth: "80px"
424
448
  },
425
449
  onClick: function onClick() {
450
+ var _a;
426
451
  btn("confirm");
452
+ (_a = document.getElementById("data-verification-button")) === null || _a === void 0 ? void 0 : _a.click();
427
453
  }
428
454
  }, button.confirm))));
429
455
  };
@@ -44,8 +44,6 @@ var NotationBoxes = function NotationBoxes() {
44
44
  rc = commentBox.rc,
45
45
  left = commentBox.left,
46
46
  top = commentBox.top,
47
- width = commentBox.width,
48
- height = commentBox.height,
49
47
  size = commentBox.size;
50
48
  var isEditing = ((_a = context.editingCommentBox) === null || _a === void 0 ? void 0 : _a.rc) === rc;
51
49
  var commentId = "comment-box-".concat(rc);
@@ -65,19 +63,13 @@ var NotationBoxes = function NotationBoxes() {
65
63
  }
66
64
  }), /*#__PURE__*/React.createElement("div", {
67
65
  id: commentId,
68
- className: "luckysheet-postil-show-main",
66
+ className: "border-radius-sm",
69
67
  style: {
70
- width: width,
71
- height: height,
72
- color: "#000",
73
- padding: 5,
74
- border: "1px solid #000",
75
- backgroundColor: "rgb(255,255,225)",
76
68
  position: "absolute",
77
69
  left: left,
78
70
  top: top,
79
- boxSizing: "border-box",
80
- zIndex: isEditing ? 200 : 100
71
+ zIndex: isEditing ? 200 : 100,
72
+ boxShadow: "0 1px 1px #0000002e,0 4px 8px #0000001a"
81
73
  },
82
74
  onMouseDown: function onMouseDown(e) {
83
75
  var nativeEvent = e.nativeEvent;
@@ -1,4 +1,5 @@
1
- import { colLocation, colLocationByIndex, selectTitlesMap, selectTitlesRange, handleColSizeHandleMouseDown, handleColumnHeaderMouseDown, isAllowEdit, getFlowdata, fixColumnStyleOverflowInFreeze, handleColFreezeHandleMouseDown, getSheetIndex, fixPositionOnFrozenCells } from "@fileverse-dev/fortune-core";
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";
2
3
  import _ from "lodash";
3
4
  import React, { useContext, useState, useRef, useCallback, useEffect, useMemo } from "react";
4
5
  import WorkbookContext from "../../context";
@@ -73,13 +74,13 @@ var ColumnHeader = function ColumnHeader() {
73
74
  }]);
74
75
  }, [context, hoverLocation.col_index, refs.globalCache.freezen]);
75
76
  var onMouseDown = useCallback(function (e) {
76
- if (e.button === 0 && e.target.tagName === "use") {
77
+ if (e.button === 0 && e.target.tagName === "use" || e.button === 2) {
77
78
  var nativeEvent_1 = e.nativeEvent;
78
79
  setContext(function (draft) {
79
80
  handleColumnHeaderMouseDown(draft, refs.globalCache, nativeEvent_1, containerRef.current, refs.cellInput.current, refs.fxInput.current);
80
81
  });
81
82
  }
82
- if (e.button !== 0) return;
83
+ if (e.button !== 0 || context.isFlvReadOnly) return;
83
84
  var targetEl = e.target;
84
85
  if (targetEl.closest(".fortune-cols-change-size") || targetEl.closest(".fortune-cols-freeze-handle") || targetEl.closest(".header-arrow")) return;
85
86
  var headerEl = containerRef.current;
@@ -154,6 +155,44 @@ var ColumnHeader = function ColumnHeader() {
154
155
  }
155
156
  setSelectedLocation(selects);
156
157
  }, [context.luckysheet_select_save, context.visibledatacolumn]);
158
+ var _g = useState([]),
159
+ hiddenPointers = _g[0],
160
+ setHiddenPointers = _g[1];
161
+ useEffect(function () {
162
+ var _a, _b;
163
+ if (sheetIndex == null) return;
164
+ var tempPointers = [];
165
+ var colhidden = (_b = (_a = context.luckysheetfile[sheetIndex]) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.colhidden;
166
+ if (colhidden) {
167
+ Object.keys(colhidden).forEach(function (key) {
168
+ var item = {
169
+ col: key,
170
+ left: context.visibledatacolumn[Number(key) - 1]
171
+ };
172
+ tempPointers.push(item);
173
+ });
174
+ console.log(tempPointers);
175
+ setHiddenPointers(tempPointers);
176
+ } else {
177
+ setHiddenPointers([]);
178
+ }
179
+ }, [context.visibledatacolumn, sheetIndex]);
180
+ var showColumn = function showColumn(e, item) {
181
+ if (context.isFlvReadOnly) return;
182
+ e.stopPropagation();
183
+ setContext(function (ctx) {
184
+ var _a;
185
+ api.setSelection(ctx, [{
186
+ row: [0, (_a = context.visibledatarow) === null || _a === void 0 ? void 0 : _a.length],
187
+ column: [Number(item.col) - 1, Number(item.col) + 1]
188
+ }], {
189
+ id: context.currentSheetId
190
+ });
191
+ });
192
+ setContext(function (ctx) {
193
+ showSelected(ctx, "column");
194
+ });
195
+ };
157
196
  useEffect(function () {
158
197
  containerRef.current.scrollLeft = context.scrollLeft;
159
198
  }, [context.scrollLeft]);
@@ -176,7 +215,51 @@ var ColumnHeader = function ColumnHeader() {
176
215
  };
177
216
  });
178
217
  }
179
- }, /*#__PURE__*/React.createElement("div", {
218
+ }, hiddenPointers.map(function (item) {
219
+ return /*#__PURE__*/React.createElement("div", {
220
+ className: "flex gap-4 cursor-pointer hide-btn align-center",
221
+ style: {
222
+ height: context.columnHeaderHeight - 12,
223
+ left: "".concat(item.left - 12, "px")
224
+ },
225
+ onClick: function onClick(e) {
226
+ return showColumn(e, item);
227
+ }
228
+ }, /*#__PURE__*/React.createElement("div", {
229
+ className: ""
230
+ }, /*#__PURE__*/React.createElement("svg", {
231
+ xmlns: "http://www.w3.org/2000/svg",
232
+ width: "5",
233
+ height: "8",
234
+ viewBox: "0 0 5 8",
235
+ fill: "none"
236
+ }, /*#__PURE__*/React.createElement("path", {
237
+ 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
+ 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", {
251
+ className: ""
252
+ }, /*#__PURE__*/React.createElement("svg", {
253
+ xmlns: "http://www.w3.org/2000/svg",
254
+ width: "5",
255
+ height: "8",
256
+ viewBox: "0 0 5 8",
257
+ fill: "none"
258
+ }, /*#__PURE__*/React.createElement("path", {
259
+ d: "M4.68811 4.35359L1.81188 7.22982C1.4969 7.5448 0.958328 7.32172 0.958328 6.87627L0.958328 1.12381C0.958328 0.678362 1.4969 0.455279 1.81188 0.770261L4.68811 3.64649C4.88337 3.84175 4.88337 4.15833 4.68811 4.35359Z",
260
+ fill: "#363B3F"
261
+ }))));
262
+ }), /*#__PURE__*/React.createElement("div", {
180
263
  className: "fortune-cols-freeze-handle",
181
264
  onMouseDown: onColFreezeHandleMouseDown,
182
265
  style: {
@@ -199,7 +282,7 @@ var ColumnHeader = function ColumnHeader() {
199
282
  display: "block"
200
283
  }, fixColumnStyleOverflowInFreeze(context, hoverLocation.col_index, hoverLocation.col_index, (_a = refs.globalCache.freezen) === null || _a === void 0 ? void 0 : _a[context.currentSheetId]))
201
284
  }, allowEditRef.current && (/*#__PURE__*/React.createElement("span", {
202
- className: "header-arrow",
285
+ className: "header-arrow mr-2",
203
286
  onClick: function onClick(e) {
204
287
  setContext(function (ctx) {
205
288
  ctx.contextMenu = {
@@ -66,6 +66,17 @@ var FormulaHint = function FormulaHint(props) {
66
66
  var divOffset = ((_d = hintRef.current) === null || _d === void 0 ? void 0 : _d.offsetHeight) || 0;
67
67
  setTop(hintAbove ? selectionHeight - (divOffset + 30) : selectionHeight + 4);
68
68
  };
69
+ var hexToRgbString = function hexToRgbString(hex) {
70
+ hex = hex.replace("#", "");
71
+ var r = parseInt(hex.substring(0, 2), 16);
72
+ var g = parseInt(hex.substring(2, 4), 16);
73
+ var b = parseInt(hex.substring(4, 6), 16);
74
+ return "".concat(r, ", ").concat(g, ", ").concat(b);
75
+ };
76
+ var bgColor = function bgColor(BRAND_SECONDARY_COLOR) {
77
+ var bg = BRAND_SECONDARY_COLOR ? "rgb(".concat(hexToRgbString(BRAND_SECONDARY_COLOR), ", 0.4)") : "#FFDF0A";
78
+ return bg;
79
+ };
69
80
  useEffect(function () {
70
81
  calcuatePopUpPlacement();
71
82
  }, []);
@@ -189,7 +200,7 @@ var FormulaHint = function FormulaHint(props) {
189
200
  dir: "auto",
190
201
  key: name,
191
202
  style: {
192
- backgroundColor: commaCount === i ? (fn === null || fn === void 0 ? void 0 : fn.BRAND_SECONDARY_COLOR) || "#FFDF0A" : "transparent"
203
+ backgroundColor: commaCount === i ? bgColor(fn.BRAND_SECONDARY_COLOR) : "transparent"
193
204
  }
194
205
  }, name, i !== fn.p.length - 1 && ", ");
195
206
  })), /*#__PURE__*/React.createElement("code", {
@@ -365,7 +376,7 @@ var FormulaHint = function FormulaHint(props) {
365
376
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("code", {
366
377
  className: "font-family-mono mb-1 mt-2 color-text-default font-family-mono",
367
378
  style: {
368
- backgroundColor: commaCount === index ? (fn === null || fn === void 0 ? void 0 : fn.BRAND_SECONDARY_COLOR) || "#FFDF0A" : "transparent"
379
+ backgroundColor: commaCount === index ? bgColor(fn.BRAND_SECONDARY_COLOR) : "transparent"
369
380
  }
370
381
  }, param.name, param.repeat === "y" && (/*#__PURE__*/React.createElement("span", {
371
382
  className: "luckysheet-arguments-help-argument-info example-value",
@@ -1,4 +1,5 @@
1
- import { rowLocation, rowLocationByIndex, selectTitlesMap, selectTitlesRange, handleContextMenu, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, fixRowStyleOverflowInFreeze, handleRowFreezeHandleMouseDown, getSheetIndex, fixPositionOnFrozenCells } from "@fileverse-dev/fortune-core";
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";
2
3
  import _ from "lodash";
3
4
  import React, { useContext, useState, useRef, useCallback, useEffect, useMemo } from "react";
4
5
  import WorkbookContext from "../../context";
@@ -67,7 +68,13 @@ var RowHeader = function RowHeader() {
67
68
  getRowIndexClicked = _f.getRowIndexClicked,
68
69
  isRowDoubleClicked = _f.isRowDoubleClicked;
69
70
  var onMouseDown = useCallback(function (e) {
70
- if (e.button !== 0) return;
71
+ if (e.button === 0 && e.target.tagName === "use" || e.button === 2) {
72
+ var nativeEvent_1 = e.nativeEvent;
73
+ setContext(function (draft) {
74
+ handleRowHeaderMouseDown(draft, refs.globalCache, nativeEvent_1, containerRef.current, refs.cellInput.current, refs.fxInput.current);
75
+ });
76
+ }
77
+ if (e.button !== 0 || context.isFlvReadOnly) return;
71
78
  var targetEl = e.target;
72
79
  if (targetEl.closest(".fortune-rows-change-size") || targetEl.closest(".fortune-rows-freeze-handle")) return;
73
80
  var headerEl = containerRef.current;
@@ -79,9 +86,9 @@ var RowHeader = function RowHeader() {
79
86
  draft.luckysheet_scroll_status = true;
80
87
  });
81
88
  } else {
82
- var nativeEvent_1 = e.nativeEvent;
89
+ var nativeEvent_2 = e.nativeEvent;
83
90
  setContext(function (draft) {
84
- handleRowHeaderMouseDown(draft, refs.globalCache, nativeEvent_1, containerRef.current, refs.cellInput.current, refs.fxInput.current);
91
+ handleRowHeaderMouseDown(draft, refs.globalCache, nativeEvent_2, containerRef.current, refs.cellInput.current, refs.fxInput.current);
85
92
  });
86
93
  return;
87
94
  }
@@ -147,6 +154,43 @@ var RowHeader = function RowHeader() {
147
154
  }
148
155
  setSelectedLocation(selects);
149
156
  }, [context.luckysheet_select_save, context.visibledatarow]);
157
+ var _g = useState([]),
158
+ hiddenPointers = _g[0],
159
+ setHiddenPointers = _g[1];
160
+ useEffect(function () {
161
+ var _a, _b;
162
+ if (sheetIndex == null) return;
163
+ var tempPointers = [];
164
+ var rowhidden = (_b = (_a = context.luckysheetfile[sheetIndex]) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.rowhidden;
165
+ if (rowhidden) {
166
+ Object.keys(rowhidden).forEach(function (key) {
167
+ var item = {
168
+ row: key,
169
+ top: context.visibledatarow[Number(key) - 1]
170
+ };
171
+ tempPointers.push(item);
172
+ });
173
+ setHiddenPointers(tempPointers);
174
+ } else {
175
+ setHiddenPointers([]);
176
+ }
177
+ }, [context.visibledatarow, sheetIndex]);
178
+ var showRow = function showRow(e, item) {
179
+ if (context.isFlvReadOnly) return;
180
+ e.stopPropagation();
181
+ setContext(function (ctx) {
182
+ var _a;
183
+ api.setSelection(ctx, [{
184
+ row: [Number(item.row) - 1, Number(item.row) + 1],
185
+ column: [0, (_a = context.visibledatacolumn) === null || _a === void 0 ? void 0 : _a.length]
186
+ }], {
187
+ id: context.currentSheetId
188
+ });
189
+ });
190
+ setContext(function (ctx) {
191
+ showSelected(ctx, "row");
192
+ });
193
+ };
150
194
  useEffect(function () {
151
195
  containerRef.current.scrollTop = context.scrollTop;
152
196
  }, [context.scrollTop]);
@@ -161,7 +205,40 @@ var RowHeader = function RowHeader() {
161
205
  onMouseDown: onMouseDown,
162
206
  onMouseLeave: onMouseLeave,
163
207
  onContextMenu: onContextMenu
164
- }, /*#__PURE__*/React.createElement("div", {
208
+ }, hiddenPointers.map(function (item) {
209
+ return /*#__PURE__*/React.createElement("div", {
210
+ className: "flex flex-col gap-4 cursor-pointer align-center hide-btn-row hide-btn",
211
+ style: {
212
+ top: "".concat(item.top - 16, "px"),
213
+ zIndex: 100
214
+ },
215
+ onClick: function onClick(e) {
216
+ return showRow(e, item);
217
+ }
218
+ }, /*#__PURE__*/React.createElement("div", {
219
+ className: "rotate-row-icon"
220
+ }, /*#__PURE__*/React.createElement("svg", {
221
+ xmlns: "http://www.w3.org/2000/svg",
222
+ width: "5",
223
+ height: "8",
224
+ viewBox: "0 0 5 8",
225
+ fill: "none"
226
+ }, /*#__PURE__*/React.createElement("path", {
227
+ 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",
228
+ fill: "#363B3F"
229
+ }))), /*#__PURE__*/React.createElement("div", {
230
+ className: "rotate-90"
231
+ }, /*#__PURE__*/React.createElement("svg", {
232
+ xmlns: "http://www.w3.org/2000/svg",
233
+ width: "5",
234
+ height: "8",
235
+ viewBox: "0 0 5 8",
236
+ fill: "none"
237
+ }, /*#__PURE__*/React.createElement("path", {
238
+ 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",
239
+ fill: "#363B3F"
240
+ }))));
241
+ }), /*#__PURE__*/React.createElement("div", {
165
242
  className: "fortune-rows-freeze-handle",
166
243
  onMouseDown: onRowFreezeHandleMouseDown,
167
244
  style: {
@@ -1010,4 +1010,27 @@
1010
1010
  background: #555;
1011
1011
  /* darker on hover */
1012
1012
  /* scrollbar */
1013
- }
1013
+ }
1014
+
1015
+ .hide-btn {
1016
+ padding-top: 1px;
1017
+ position: absolute;
1018
+ right: 5;
1019
+ top: 5px;
1020
+ z-index: 200;
1021
+ width: 9px;
1022
+ }
1023
+
1024
+ .hide-btn:hover {
1025
+ border: 1px solid #0188fb;
1026
+ }
1027
+
1028
+ .rotate-row-icon {
1029
+ transform: rotate(-90deg);
1030
+ }
1031
+
1032
+ .hide-btn-row {
1033
+ position: absolute;
1034
+ left: 4px;
1035
+ z-index: 200;
1036
+ }
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { Cell } from "@fileverse-dev/fortune-core";
3
3
  import "./index.css";
4
- export declare const getLucideIcon: (title: string) => "Ethereum" | "DollarSign" | "" | "ChevronDown" | "Undo" | "Redo" | "Underline" | "Border" | "Filter" | "Link" | "Search" | "Percent" | "PaintRoller" | "Bold" | "Italic" | "Strikethrough" | "AlignLeft" | "AlignCenter" | "AlignRight" | "ArrowUpFromLine" | "AlignVerticalMiddle" | "ArrowDownToLine" | "TextOverflow" | "WrapText" | "TextClip" | "Baseline" | "PaintBucket" | "MergeHorizontal" | "DecimalsArrowLeft" | "DecimalsArrowRight" | "PaintbrushVertical" | "MessageSquarePlus" | "Image" | "Sigma" | "ShieldCheck" | "DuneChart" | "Ellipsis";
4
+ export declare const getLucideIcon: (title: string) => "Ethereum" | "DollarSign" | "" | "ChevronDown" | "Undo" | "Redo" | "PaintRoller" | "Bold" | "Italic" | "Strikethrough" | "Underline" | "AlignLeft" | "AlignCenter" | "AlignRight" | "ArrowUpFromLine" | "AlignVerticalMiddle" | "ArrowDownToLine" | "TextOverflow" | "WrapText" | "TextClip" | "Baseline" | "PaintBucket" | "Border" | "MergeHorizontal" | "Percent" | "DecimalsArrowLeft" | "DecimalsArrowRight" | "PaintbrushVertical" | "Filter" | "Link" | "MessageSquarePlus" | "Image" | "Sigma" | "ShieldCheck" | "Search" | "DuneChart" | "Ellipsis";
5
5
  export declare const CurrencySelector: ({ cell, defaultTextFormat, toolTipText, }: {
6
6
  cell: Cell | null | undefined;
7
7
  defaultTextFormat: string;