@fileverse-dev/fortune-react 1.1.99-patch-5 → 1.1.99-patch-2

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 (31) hide show
  1. package/es/components/ContextMenu/index.js +2 -2
  2. package/es/components/DataVerification/ColorPicker.js +7 -31
  3. package/es/components/DataVerification/DropdownList.js +1 -20
  4. package/es/components/DataVerification/DropdownOption.js +2 -5
  5. package/es/components/DataVerification/RangeDialog.js +5 -1
  6. package/es/components/DataVerification/index.css +0 -20
  7. package/es/components/DataVerification/index.js +5 -29
  8. package/es/components/SheetOverlay/ColumnHeader.js +5 -88
  9. package/es/components/SheetOverlay/FormulaHint/index.js +2 -13
  10. package/es/components/SheetOverlay/RowHeader.js +5 -82
  11. package/es/components/SheetOverlay/index.css +1 -24
  12. package/es/components/Toolbar/index.d.ts +1 -1
  13. package/es/components/Toolbar/index.js +19 -23
  14. package/es/components/Workbook/index.d.ts +1 -1
  15. package/es/components/Workbook/index.js +0 -5
  16. package/lib/components/ContextMenu/index.js +2 -2
  17. package/lib/components/DataVerification/ColorPicker.js +6 -30
  18. package/lib/components/DataVerification/DropdownList.js +1 -20
  19. package/lib/components/DataVerification/DropdownOption.js +2 -5
  20. package/lib/components/DataVerification/RangeDialog.js +5 -1
  21. package/lib/components/DataVerification/index.css +0 -20
  22. package/lib/components/DataVerification/index.js +5 -29
  23. package/lib/components/SheetOverlay/ColumnHeader.js +4 -86
  24. package/lib/components/SheetOverlay/FormulaHint/index.js +2 -13
  25. package/lib/components/SheetOverlay/RowHeader.js +4 -80
  26. package/lib/components/SheetOverlay/index.css +1 -24
  27. package/lib/components/Toolbar/index.d.ts +1 -1
  28. package/lib/components/Toolbar/index.js +19 -22
  29. package/lib/components/Workbook/index.d.ts +1 -1
  30. package/lib/components/Workbook/index.js +0 -5
  31. package/package.json +2 -2
@@ -124,7 +124,7 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
124
124
  };
125
125
  import React, { useContext, useCallback, useRef, useEffect, useState } from "react";
126
126
  import { toolbarItemClickHandler, handleTextBackground, handleTextColor, handleTextSize, normalizedCellAttr, getFlowdata, newComment, editComment, deleteComment, showHideComment, showHideAllComments, autoSelectionFormula, handleSum, locale, handleMerge, handleBorder, toolbarItemSelectedFunc, handleFreeze, insertImage, showImgChooser, updateFormat, handleSort, handleHorizontalAlign, handleVerticalAlign, handleScreenShot, createFilter, clearFilter, applyLocation, insertDuneChart } from "@fileverse-dev/fortune-core";
127
- import { api } from "@fileverse-dev/fortune-core";
127
+ import { setSelection, getSelection } from "@fileverse-dev/fortune-core/src/api";
128
128
  import _ from "lodash";
129
129
  import { IconButton, LucideIcon, Tooltip, Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem } from "@fileverse/ui";
130
130
  import DataVerificationPortal from "./dataVerificationPortal";
@@ -588,27 +588,6 @@ var Toolbar = function Toolbar(_a) {
588
588
  var _o = useState(false),
589
589
  showDataValidation = _o[0],
590
590
  setShowDataValidation = _o[1];
591
- var dataVerificationClick = function dataVerificationClick() {
592
- var _a;
593
- var selection = api.getSelection(context);
594
- if (!selection) {
595
- setContext(function (ctx) {
596
- api.setSelection(ctx, [{
597
- row: [0, 0],
598
- column: [0, 0]
599
- }], {
600
- id: context.currentSheetId
601
- });
602
- });
603
- }
604
- (_a = document.getElementById("data-verification-button")) === null || _a === void 0 ? void 0 : _a.click();
605
- setTimeout(function () {
606
- setShowDataValidation(true);
607
- }, 100);
608
- };
609
- useEffect(function () {
610
- window.dataVerificationClick = dataVerificationClick;
611
- }, []);
612
591
  var getToolbarItem = useCallback(function (name, i) {
613
592
  var _a, _b, _c, _d, _e, _f, _g;
614
593
  var tooltip = toolbar[name];
@@ -991,7 +970,24 @@ var Toolbar = function Toolbar(_a) {
991
970
  iconId: name,
992
971
  tooltip: tooltip,
993
972
  key: name,
994
- onClick: dataVerificationClick
973
+ onClick: function onClick() {
974
+ var _a;
975
+ var selection = getSelection(context);
976
+ if (!selection) {
977
+ setContext(function (ctx) {
978
+ setSelection(ctx, [{
979
+ row: [0, 0],
980
+ column: [0, 0]
981
+ }], {
982
+ id: context.currentSheetId
983
+ });
984
+ });
985
+ }
986
+ (_a = document.getElementById("data-verification-button")) === null || _a === void 0 ? void 0 : _a.click();
987
+ setTimeout(function () {
988
+ setShowDataValidation(true);
989
+ }, 100);
990
+ }
995
991
  }));
996
992
  }
997
993
  if (name === "locationCondition") {
@@ -57,7 +57,7 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
57
57
  getHtmlByRange: (range: import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => string | null;
58
58
  setSelection: (range: import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => void;
59
59
  setCellValuesByRange: (data: any[][], range: import("@fileverse-dev/fortune-core").SingleRange, options?: api.CommonOptions) => void;
60
- setCellFormatByRange: (attr: "error" | "rt" | "f" | "m" | "v" | "mc" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | keyof import("@fileverse-dev/fortune-core").CellStyle, value: any, range: import("@fileverse-dev/fortune-core").Range | import("@fileverse-dev/fortune-core").SingleRange, options?: api.CommonOptions) => void;
60
+ setCellFormatByRange: (attr: "error" | "rt" | "f" | "m" | "v" | "mc" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | keyof import("@fileverse-dev/fortune-core").CellStyle, value: any, range: import("@fileverse-dev/fortune-core").SingleRange | import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => void;
61
61
  mergeCells: (ranges: import("@fileverse-dev/fortune-core").Range, type: string, options?: api.CommonOptions) => void;
62
62
  cancelMerge: (ranges: import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => void;
63
63
  getAllSheets: () => SheetType[];
@@ -647,11 +647,6 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_a, ref) {
647
647
  }
648
648
  });
649
649
  }
650
- setContextWithProduce(function (ctx) {
651
- if (ctx.luckysheet_selection_range) {
652
- ctx.luckysheet_selection_range = [];
653
- }
654
- });
655
650
  }, [context, setContextWithProduce]);
656
651
  var onMoreToolbarItemsClose = useCallback(function () {
657
652
  setMoreToolbarItems(null);
@@ -642,7 +642,7 @@ var ContextMenu = function ContextMenu() {
642
642
  }), /*#__PURE__*/_react.default.createElement("div", null, rightclick.deleteSelected, rightclick.row))));
643
643
  }
644
644
  if (name === "hide-row") {
645
- return (selection === null || selection === void 0 ? void 0 : selection.row_select) && ["hideSelected", "showHide"].map(function (item) {
645
+ return (selection === null || selection === void 0 ? void 0 : selection.row_select) === true && ["hideSelected", "showHide"].map(function (item) {
646
646
  return /*#__PURE__*/_react.default.createElement(_Menu.default, {
647
647
  key: item,
648
648
  onClick: function onClick() {
@@ -1086,7 +1086,7 @@ var ContextMenu = function ContextMenu() {
1086
1086
  left: contextMenu.x,
1087
1087
  top: contextMenu.y
1088
1088
  }
1089
- }, context.contextMenu.headerMenu === true || context.contextMenu.headerMenu === "row" ? settings.headerContextMenu.map(function (menu, i) {
1089
+ }, context.contextMenu.headerMenu === true ? settings.headerContextMenu.map(function (menu, i) {
1090
1090
  return getMenuElement(menu, i);
1091
1091
  }) : settings.cellContextMenu.map(function (menu, i) {
1092
1092
  return getMenuElement(menu, i);
@@ -65,9 +65,7 @@ var ColorSection = exports.ColorSection = function ColorSection(_a) {
65
65
  }, /*#__PURE__*/_react.default.createElement("div", {
66
66
  className: "flex items-center justify-between color-picker rounded transition-all cursor-pointer border border-gray-300",
67
67
  style: {
68
- padding: "7px",
69
- border: "var(--border-width-md, 1px) solid hsl(var(--color-border-default, #E8EBEC))",
70
- borderRadius: "var(--border-radius-sm, 4px)"
68
+ padding: "7px"
71
69
  }
72
70
  }, /*#__PURE__*/_react.default.createElement("div", {
73
71
  className: "flex items-center gap-3 color-text-secondary"
@@ -82,7 +80,7 @@ var ColorSection = exports.ColorSection = function ColorSection(_a) {
82
80
  })))), /*#__PURE__*/_react.default.createElement(_ui.PopoverContent, {
83
81
  align: "start",
84
82
  alignOffset: 0,
85
- className: "color-picker-container",
83
+ className: "w-[200px] export-content-popover",
86
84
  elevation: 2,
87
85
  side: "bottom",
88
86
  sideOffset: 4
@@ -91,40 +89,18 @@ var ColorSection = exports.ColorSection = function ColorSection(_a) {
91
89
  }, /*#__PURE__*/_react.default.createElement("div", {
92
90
  className: "flex gap-2 flex-wrap w-full"
93
91
  }, TEXT_COLORS.map(function (color) {
94
- return /*#__PURE__*/_react.default.createElement("div", {
95
- key: color.value,
96
- className: "w-7 h-7 rounded-full transition-all hover:scale-110 hover:shadow-md",
97
- style: {
98
- border: "".concat(color.value) === trigerColor ? "2px solid rgb(".concat(color.value, ")") : "none",
99
- padding: "2px"
100
- }
101
- }, /*#__PURE__*/_react.default.createElement("button", {
92
+ return /*#__PURE__*/_react.default.createElement("button", {
102
93
  type: "button",
103
94
  key: color.value,
104
95
  onClick: function onClick() {
105
96
  onPick(color.value);
106
97
  setIsOpen(false);
107
98
  },
108
- className: "w-full h-full rounded-full transition-all hover:scale-110 hover:shadow-md",
99
+ className: "w-7 h-7 rounded-full transition-all hover:scale-110 hover:shadow-md",
109
100
  style: {
110
101
  backgroundColor: "rgb(".concat(color.value, ")")
111
102
  },
112
103
  title: color.name
113
- }));
114
- }), /*#__PURE__*/_react.default.createElement("div", {
115
- className: "w-full flex justify-center",
116
- onClick: function onClick() {
117
- onPick("228, 232, 237");
118
- setIsOpen(false);
119
- }
120
- }, /*#__PURE__*/_react.default.createElement(_ui.IconButton, {
121
- icon: "DropletOff",
122
- size: "md",
123
- variant: "ghost",
124
- className: "color-picker-icon"
125
- }), /*#__PURE__*/_react.default.createElement(_ui.Button, {
126
- size: "md",
127
- variant: "ghost",
128
- className: "color-picker-reset"
129
- }, "Reset"))))));
104
+ });
105
+ })))));
130
106
  };
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _fortuneCore = require("@fileverse-dev/fortune-core");
9
9
  var _react = _interopRequireWildcard(require("react"));
10
- var _ui = require("@fileverse/ui");
11
10
  var _context = _interopRequireDefault(require("../../context"));
12
11
  var _useOutsideClick = require("../../hooks/useOutsideClick");
13
12
  var _SVGIcon = _interopRequireDefault(require("../SVGIcon"));
@@ -155,24 +154,6 @@ var DropDownList = function DropDownList() {
155
154
  display: isMul && selected.indexOf(v) >= 0 ? "inline" : "none"
156
155
  }
157
156
  }), v);
158
- }), /*#__PURE__*/_react.default.createElement("div", {
159
- className: "w-full flex align-center",
160
- style: {
161
- height: "28px"
162
- }
163
- }, /*#__PURE__*/_react.default.createElement(_ui.IconButton, {
164
- icon: "Pencil",
165
- size: "sm",
166
- variant: "ghost",
167
- className: "color-picker-icon pt-2"
168
- }), /*#__PURE__*/_react.default.createElement(_ui.Button, {
169
- size: "md",
170
- variant: "ghost",
171
- className: "color-picker-reset",
172
- onClick: function onClick() {
173
- var _a;
174
- (_a = window === null || window === void 0 ? void 0 : window.dataVerificationClick) === null || _a === void 0 ? void 0 : _a.call(window);
175
- }
176
- }, "Edit")));
157
+ }));
177
158
  };
178
159
  var _default = exports.default = DropDownList;
@@ -181,7 +181,7 @@ var DynamicInputList = function DynamicInputList(_a) {
181
181
  }, optionItems.map(function (item, index) {
182
182
  return /*#__PURE__*/_react.default.createElement("li", {
183
183
  key: item.id,
184
- className: (0, _ui.cn)("relative flex optionItems-center gap-2 transition mb-4", draggingIndex === index && "scale-[0.99] opacity-80 shadow-lg rounded-xl"),
184
+ className: (0, _ui.cn)("relative flex optionItems-center gap-3 transition mb-4", draggingIndex === index && "scale-[0.99] opacity-80 shadow-lg rounded-xl"),
185
185
  onDragOver: function onDragOver(e) {
186
186
  return onDragOverRow(index, e);
187
187
  },
@@ -276,10 +276,7 @@ var DynamicInputList = function DynamicInputList(_a) {
276
276
  }, /*#__PURE__*/_react.default.createElement(_ui.Button, {
277
277
  variant: "secondary",
278
278
  onClick: handleAdd,
279
- size: "sm",
280
- style: {
281
- fontWeight: 500
282
- }
279
+ className: ""
283
280
  }, "Add another item")));
284
281
  };
285
282
  var _default = exports.default = DynamicInputList;
@@ -8,6 +8,7 @@ exports.default = void 0;
8
8
  var _fortuneCore = require("@fileverse-dev/fortune-core");
9
9
  var _ui = require("@fileverse/ui");
10
10
  var _react = _interopRequireWildcard(require("react"));
11
+ var _ = _interopRequireDefault(require("."));
11
12
  var _context = _interopRequireDefault(require("../../context"));
12
13
  var _useDialog = require("../../hooks/useDialog");
13
14
  var _ConditionRules = _interopRequireDefault(require("../ConditionFormat/ConditionRules"));
@@ -22,7 +23,8 @@ var RangeDialog = function RangeDialog() {
22
23
  var showDialog = (0, _useDialog.useDialog)().showDialog;
23
24
  var _b = (0, _fortuneCore.locale)(context),
24
25
  dataVerification = _b.dataVerification,
25
- button = _b.button;
26
+ button = _b.button,
27
+ toolbar = _b.toolbar;
26
28
  var _c = (0, _react.useState)((0, _getDisplayedRangeTxt.getDisplayedRangeTxt)(context)),
27
29
  rangeTxt2 = _c[0],
28
30
  setRangeTxt2 = _c[1];
@@ -44,7 +46,9 @@ var RangeDialog = function RangeDialog() {
44
46
  showDialog(/*#__PURE__*/_react.default.createElement(_ConditionRules.default, {
45
47
  type: rulesType
46
48
  }), undefined, (0, _fortuneCore.locale)(context).conditionformat["conditionformat_".concat(rulesType)]);
49
+ return;
47
50
  }
51
+ showDialog(/*#__PURE__*/_react.default.createElement(_.default, null), undefined, toolbar.dataVerification);
48
52
  }, [setContext, showDialog, context]);
49
53
  (0, _react.useEffect)(function () {
50
54
  setRangeTxt2((0, _getDisplayedRangeTxt.getDisplayedRangeTxt)(context));
@@ -203,24 +203,4 @@
203
203
 
204
204
  .color-picker:hover {
205
205
  background: hsl(var(--color-bg-default-hover, #F2F4F5));
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;
216
- padding-left: 0px;
217
- margin-left: 0px;
218
- }
219
-
220
- .color-picker-reset:hover {
221
- background-color: white;
222
- }
223
-
224
- .color-picker-icon:hover {
225
- background-color: white;
226
206
  }
@@ -93,14 +93,6 @@ var DataVerification = function DataVerification() {
93
93
  }));
94
94
  }
95
95
  }, []);
96
- var dataSelectRange = (0, _react.useCallback)(function (type, value) {
97
- hideDialog();
98
- setContext(function (ctx) {
99
- ctx.rangeDialog.show = true;
100
- ctx.rangeDialog.type = type;
101
- ctx.rangeDialog.rangeTxt = value;
102
- });
103
- }, [hideDialog, setContext]);
104
96
  var btn = (0, _react.useCallback)(function (type) {
105
97
  if (type === "confirm") {
106
98
  setContext(function (ctx) {
@@ -227,7 +219,7 @@ var DataVerification = function DataVerification() {
227
219
  return /*#__PURE__*/_react.default.createElement("div", {
228
220
  id: "fortune-data-verification"
229
221
  }, /*#__PURE__*/_react.default.createElement("div", {
230
- className: "flex flex-col gap-4 h-[calc(100vh-270px)] overflow-y-auto no-scrollbar",
222
+ className: "flex flex-col gap-4",
231
223
  style: {
232
224
  width: "345px",
233
225
  padding: "16px"
@@ -243,17 +235,7 @@ var DataVerification = function DataVerification() {
243
235
  }),
244
236
  "aria-hidden": "true",
245
237
  readOnly: true,
246
- value: (_a = context.dataVerification.dataRegulation) === null || _a === void 0 ? void 0 : _a.rangeTxt,
247
- onChange: function onChange(e) {
248
- var value = e.target.value;
249
- setContext(function (ctx) {
250
- ctx.dataVerification.dataRegulation.rangeTxt = value;
251
- });
252
- },
253
- onClick: function onClick() {
254
- hideDialog();
255
- dataSelectRange("rangeTxt", context.dataVerification.dataRegulation.value1);
256
- }
238
+ value: (_a = context.dataVerification.dataRegulation) === null || _a === void 0 ? void 0 : _a.rangeTxt
257
239
  })), /*#__PURE__*/_react.default.createElement("div", {
258
240
  className: "flex flex-col"
259
241
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -298,7 +280,7 @@ var DataVerification = function DataVerification() {
298
280
  });
299
281
  }
300
282
  }), /*#__PURE__*/_react.default.createElement("span", {
301
- className: "ml-2 text-body-sm"
283
+ className: "ml-2"
302
284
  }, 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.default.createElement("div", {
303
285
  className: "mt-4 space-y-2"
304
286
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -414,7 +396,7 @@ var DataVerification = function DataVerification() {
414
396
  });
415
397
  }
416
398
  }), /*#__PURE__*/_react.default.createElement("span", {
417
- className: "ml-2 text-body-sm"
399
+ className: "ml-2"
418
400
  }, dataVerification[v]));
419
401
  }), ((_o = (_m = context.dataVerification) === null || _m === void 0 ? void 0 : _m.dataRegulation) === null || _o === void 0 ? void 0 : _o.hintShow) && (/*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_ui.TextField, {
420
402
  placeholder: dataVerification.placeholder5,
@@ -426,11 +408,7 @@ var DataVerification = function DataVerification() {
426
408
  });
427
409
  }
428
410
  }))))), /*#__PURE__*/_react.default.createElement(_ui.Divider, {
429
- className: "border-t-[1px]",
430
- style: {
431
- width: "315px",
432
- margin: "0 16px 16px 16px"
433
- }
411
+ className: "w-full border-t-[1px] my-4"
434
412
  }), /*#__PURE__*/_react.default.createElement("div", {
435
413
  className: "flex gap-2 justify-between items-center",
436
414
  style: {
@@ -454,9 +432,7 @@ var DataVerification = function DataVerification() {
454
432
  minWidth: "80px"
455
433
  },
456
434
  onClick: function onClick() {
457
- var _a;
458
435
  btn("confirm");
459
- (_a = document.getElementById("data-verification-button")) === null || _a === void 0 ? void 0 : _a.click();
460
436
  }
461
437
  }, button.confirm))));
462
438
  };
@@ -82,13 +82,13 @@ var ColumnHeader = function ColumnHeader() {
82
82
  }]);
83
83
  }, [context, hoverLocation.col_index, refs.globalCache.freezen]);
84
84
  var onMouseDown = (0, _react.useCallback)(function (e) {
85
- if (e.button === 0 && e.target.tagName === "use" || e.button === 2) {
85
+ if (e.button === 0 && e.target.tagName === "use") {
86
86
  var nativeEvent_1 = e.nativeEvent;
87
87
  setContext(function (draft) {
88
88
  (0, _fortuneCore.handleColumnHeaderMouseDown)(draft, refs.globalCache, nativeEvent_1, containerRef.current, refs.cellInput.current, refs.fxInput.current);
89
89
  });
90
90
  }
91
- if (e.button !== 0 || context.isFlvReadOnly) return;
91
+ if (e.button !== 0) return;
92
92
  var targetEl = e.target;
93
93
  if (targetEl.closest(".fortune-cols-change-size") || targetEl.closest(".fortune-cols-freeze-handle") || targetEl.closest(".header-arrow")) return;
94
94
  var headerEl = containerRef.current;
@@ -163,44 +163,6 @@ var ColumnHeader = function ColumnHeader() {
163
163
  }
164
164
  setSelectedLocation(selects);
165
165
  }, [context.luckysheet_select_save, context.visibledatacolumn]);
166
- var _g = (0, _react.useState)([]),
167
- hiddenPointers = _g[0],
168
- setHiddenPointers = _g[1];
169
- (0, _react.useEffect)(function () {
170
- var _a, _b;
171
- if (sheetIndex == null) return;
172
- var tempPointers = [];
173
- var colhidden = (_b = (_a = context.luckysheetfile[sheetIndex]) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.colhidden;
174
- if (colhidden) {
175
- Object.keys(colhidden).forEach(function (key) {
176
- var item = {
177
- col: key,
178
- left: context.visibledatacolumn[Number(key) - 1]
179
- };
180
- tempPointers.push(item);
181
- });
182
- console.log(tempPointers);
183
- setHiddenPointers(tempPointers);
184
- } else {
185
- setHiddenPointers([]);
186
- }
187
- }, [context.visibledatacolumn, sheetIndex]);
188
- var showColumn = function showColumn(e, item) {
189
- if (context.isFlvReadOnly) return;
190
- e.stopPropagation();
191
- setContext(function (ctx) {
192
- var _a;
193
- _fortuneCore.api.setSelection(ctx, [{
194
- row: [0, (_a = context.visibledatarow) === null || _a === void 0 ? void 0 : _a.length],
195
- column: [Number(item.col) - 1, Number(item.col) + 1]
196
- }], {
197
- id: context.currentSheetId
198
- });
199
- });
200
- setContext(function (ctx) {
201
- (0, _fortuneCore.showSelected)(ctx, "column");
202
- });
203
- };
204
166
  (0, _react.useEffect)(function () {
205
167
  containerRef.current.scrollLeft = context.scrollLeft;
206
168
  }, [context.scrollLeft]);
@@ -223,51 +185,7 @@ var ColumnHeader = function ColumnHeader() {
223
185
  };
224
186
  });
225
187
  }
226
- }, hiddenPointers.map(function (item) {
227
- return /*#__PURE__*/_react.default.createElement("div", {
228
- className: "flex gap-4 cursor-pointer hide-btn align-center",
229
- style: {
230
- height: context.columnHeaderHeight - 12,
231
- left: "".concat(item.left - 12, "px")
232
- },
233
- onClick: function onClick(e) {
234
- return showColumn(e, item);
235
- }
236
- }, /*#__PURE__*/_react.default.createElement("div", {
237
- className: ""
238
- }, /*#__PURE__*/_react.default.createElement("svg", {
239
- xmlns: "http://www.w3.org/2000/svg",
240
- width: "5",
241
- height: "8",
242
- viewBox: "0 0 5 8",
243
- fill: "none"
244
- }, /*#__PURE__*/_react.default.createElement("path", {
245
- 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",
246
- fill: "#363B3F"
247
- }))));
248
- }), hiddenPointers.map(function (item) {
249
- return /*#__PURE__*/_react.default.createElement("div", {
250
- className: "flex gap-4 cursor-pointer hide-btn align-center",
251
- style: {
252
- height: context.columnHeaderHeight - 12,
253
- left: "".concat(item.left + 6, "px")
254
- },
255
- onClick: function onClick(e) {
256
- return showColumn(e, item);
257
- }
258
- }, /*#__PURE__*/_react.default.createElement("div", {
259
- className: ""
260
- }, /*#__PURE__*/_react.default.createElement("svg", {
261
- xmlns: "http://www.w3.org/2000/svg",
262
- width: "5",
263
- height: "8",
264
- viewBox: "0 0 5 8",
265
- fill: "none"
266
- }, /*#__PURE__*/_react.default.createElement("path", {
267
- 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",
268
- fill: "#363B3F"
269
- }))));
270
- }), /*#__PURE__*/_react.default.createElement("div", {
188
+ }, /*#__PURE__*/_react.default.createElement("div", {
271
189
  className: "fortune-cols-freeze-handle",
272
190
  onMouseDown: onColFreezeHandleMouseDown,
273
191
  style: {
@@ -290,7 +208,7 @@ var ColumnHeader = function ColumnHeader() {
290
208
  display: "block"
291
209
  }, (0, _fortuneCore.fixColumnStyleOverflowInFreeze)(context, hoverLocation.col_index, hoverLocation.col_index, (_a = refs.globalCache.freezen) === null || _a === void 0 ? void 0 : _a[context.currentSheetId]))
292
210
  }, allowEditRef.current && (/*#__PURE__*/_react.default.createElement("span", {
293
- className: "header-arrow mr-2",
211
+ className: "header-arrow",
294
212
  onClick: function onClick(e) {
295
213
  setContext(function (ctx) {
296
214
  ctx.contextMenu = {
@@ -75,17 +75,6 @@ var FormulaHint = function FormulaHint(props) {
75
75
  var divOffset = ((_d = hintRef.current) === null || _d === void 0 ? void 0 : _d.offsetHeight) || 0;
76
76
  setTop(hintAbove ? selectionHeight - (divOffset + 30) : selectionHeight + 4);
77
77
  };
78
- var hexToRgbString = function hexToRgbString(hex) {
79
- hex = hex.replace("#", "");
80
- var r = parseInt(hex.substring(0, 2), 16);
81
- var g = parseInt(hex.substring(2, 4), 16);
82
- var b = parseInt(hex.substring(4, 6), 16);
83
- return "".concat(r, ", ").concat(g, ", ").concat(b);
84
- };
85
- var bgColor = function bgColor(BRAND_SECONDARY_COLOR) {
86
- var bg = BRAND_SECONDARY_COLOR ? "rgb(".concat(hexToRgbString(BRAND_SECONDARY_COLOR), ", 0.4)") : "#FFDF0A";
87
- return bg;
88
- };
89
78
  (0, _react.useEffect)(function () {
90
79
  calcuatePopUpPlacement();
91
80
  }, []);
@@ -209,7 +198,7 @@ var FormulaHint = function FormulaHint(props) {
209
198
  dir: "auto",
210
199
  key: name,
211
200
  style: {
212
- backgroundColor: commaCount === i ? bgColor(fn.BRAND_SECONDARY_COLOR) : "transparent"
201
+ backgroundColor: commaCount === i ? (fn === null || fn === void 0 ? void 0 : fn.BRAND_SECONDARY_COLOR) || "#FFDF0A" : "transparent"
213
202
  }
214
203
  }, name, i !== fn.p.length - 1 && ", ");
215
204
  })), /*#__PURE__*/_react.default.createElement("code", {
@@ -385,7 +374,7 @@ var FormulaHint = function FormulaHint(props) {
385
374
  }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("code", {
386
375
  className: "font-family-mono mb-1 mt-2 color-text-default font-family-mono",
387
376
  style: {
388
- backgroundColor: commaCount === index ? bgColor(fn.BRAND_SECONDARY_COLOR) : "transparent"
377
+ backgroundColor: commaCount === index ? (fn === null || fn === void 0 ? void 0 : fn.BRAND_SECONDARY_COLOR) || "#FFDF0A" : "transparent"
389
378
  }
390
379
  }, param.name, param.repeat === "y" && (/*#__PURE__*/_react.default.createElement("span", {
391
380
  className: "luckysheet-arguments-help-argument-info example-value",
@@ -76,13 +76,7 @@ var RowHeader = function RowHeader() {
76
76
  getRowIndexClicked = _f.getRowIndexClicked,
77
77
  isRowDoubleClicked = _f.isRowDoubleClicked;
78
78
  var onMouseDown = (0, _react.useCallback)(function (e) {
79
- if (e.button === 0 && e.target.tagName === "use" || e.button === 2) {
80
- var nativeEvent_1 = e.nativeEvent;
81
- setContext(function (draft) {
82
- (0, _fortuneCore.handleRowHeaderMouseDown)(draft, refs.globalCache, nativeEvent_1, containerRef.current, refs.cellInput.current, refs.fxInput.current);
83
- });
84
- }
85
- if (e.button !== 0 || context.isFlvReadOnly) return;
79
+ if (e.button !== 0) return;
86
80
  var targetEl = e.target;
87
81
  if (targetEl.closest(".fortune-rows-change-size") || targetEl.closest(".fortune-rows-freeze-handle")) return;
88
82
  var headerEl = containerRef.current;
@@ -94,9 +88,9 @@ var RowHeader = function RowHeader() {
94
88
  draft.luckysheet_scroll_status = true;
95
89
  });
96
90
  } else {
97
- var nativeEvent_2 = e.nativeEvent;
91
+ var nativeEvent_1 = e.nativeEvent;
98
92
  setContext(function (draft) {
99
- (0, _fortuneCore.handleRowHeaderMouseDown)(draft, refs.globalCache, nativeEvent_2, containerRef.current, refs.cellInput.current, refs.fxInput.current);
93
+ (0, _fortuneCore.handleRowHeaderMouseDown)(draft, refs.globalCache, nativeEvent_1, containerRef.current, refs.cellInput.current, refs.fxInput.current);
100
94
  });
101
95
  return;
102
96
  }
@@ -162,43 +156,6 @@ var RowHeader = function RowHeader() {
162
156
  }
163
157
  setSelectedLocation(selects);
164
158
  }, [context.luckysheet_select_save, context.visibledatarow]);
165
- var _g = (0, _react.useState)([]),
166
- hiddenPointers = _g[0],
167
- setHiddenPointers = _g[1];
168
- (0, _react.useEffect)(function () {
169
- var _a, _b;
170
- if (sheetIndex == null) return;
171
- var tempPointers = [];
172
- var rowhidden = (_b = (_a = context.luckysheetfile[sheetIndex]) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.rowhidden;
173
- if (rowhidden) {
174
- Object.keys(rowhidden).forEach(function (key) {
175
- var item = {
176
- row: key,
177
- top: context.visibledatarow[Number(key) - 1]
178
- };
179
- tempPointers.push(item);
180
- });
181
- setHiddenPointers(tempPointers);
182
- } else {
183
- setHiddenPointers([]);
184
- }
185
- }, [context.visibledatarow, sheetIndex]);
186
- var showRow = function showRow(e, item) {
187
- if (context.isFlvReadOnly) return;
188
- e.stopPropagation();
189
- setContext(function (ctx) {
190
- var _a;
191
- _fortuneCore.api.setSelection(ctx, [{
192
- row: [Number(item.row) - 1, Number(item.row) + 1],
193
- column: [0, (_a = context.visibledatacolumn) === null || _a === void 0 ? void 0 : _a.length]
194
- }], {
195
- id: context.currentSheetId
196
- });
197
- });
198
- setContext(function (ctx) {
199
- (0, _fortuneCore.showSelected)(ctx, "row");
200
- });
201
- };
202
159
  (0, _react.useEffect)(function () {
203
160
  containerRef.current.scrollTop = context.scrollTop;
204
161
  }, [context.scrollTop]);
@@ -213,40 +170,7 @@ var RowHeader = function RowHeader() {
213
170
  onMouseDown: onMouseDown,
214
171
  onMouseLeave: onMouseLeave,
215
172
  onContextMenu: onContextMenu
216
- }, hiddenPointers.map(function (item) {
217
- return /*#__PURE__*/_react.default.createElement("div", {
218
- className: "flex flex-col gap-4 cursor-pointer align-center hide-btn-row hide-btn",
219
- style: {
220
- top: "".concat(item.top - 16, "px"),
221
- zIndex: 100
222
- },
223
- onClick: function onClick(e) {
224
- return showRow(e, item);
225
- }
226
- }, /*#__PURE__*/_react.default.createElement("div", {
227
- className: "rotate-row-icon"
228
- }, /*#__PURE__*/_react.default.createElement("svg", {
229
- xmlns: "http://www.w3.org/2000/svg",
230
- width: "5",
231
- height: "8",
232
- viewBox: "0 0 5 8",
233
- fill: "none"
234
- }, /*#__PURE__*/_react.default.createElement("path", {
235
- 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",
236
- fill: "#363B3F"
237
- }))), /*#__PURE__*/_react.default.createElement("div", {
238
- className: "rotate-90"
239
- }, /*#__PURE__*/_react.default.createElement("svg", {
240
- xmlns: "http://www.w3.org/2000/svg",
241
- width: "5",
242
- height: "8",
243
- viewBox: "0 0 5 8",
244
- fill: "none"
245
- }, /*#__PURE__*/_react.default.createElement("path", {
246
- 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",
247
- fill: "#363B3F"
248
- }))));
249
- }), /*#__PURE__*/_react.default.createElement("div", {
173
+ }, /*#__PURE__*/_react.default.createElement("div", {
250
174
  className: "fortune-rows-freeze-handle",
251
175
  onMouseDown: onRowFreezeHandleMouseDown,
252
176
  style: {
@@ -1010,27 +1010,4 @@
1010
1010
  background: #555;
1011
1011
  /* darker on hover */
1012
1012
  /* scrollbar */
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
- }
1013
+ }