@fileverse-dev/fortune-react 1.2.0 → 1.2.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.
@@ -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) {
@@ -90,6 +92,7 @@ var RangeDialog = function RangeDialog() {
90
92
  minWidth: "80px"
91
93
  },
92
94
  onClick: function onClick() {
95
+ console.log("rangeTxt2", rangeTxt2);
93
96
  setContext(function (ctx) {
94
97
  ctx.rangeDialog.rangeTxt = rangeTxt2;
95
98
  });
@@ -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";
@@ -196,6 +195,15 @@ var ColumnHeader = function ColumnHeader() {
196
195
  useEffect(function () {
197
196
  containerRef.current.scrollLeft = context.scrollLeft;
198
197
  }, [context.scrollLeft]);
198
+ var _h = useState(0),
199
+ hovered = _h[0],
200
+ setHovered = _h[1];
201
+ var onMouseMoveHideRight = useCallback(function () {
202
+ setHovered(-21);
203
+ }, []);
204
+ var onMouseLeaveHideRight = useCallback(function () {
205
+ setHovered(0);
206
+ }, []);
199
207
  return /*#__PURE__*/React.createElement("div", {
200
208
  ref: containerRef,
201
209
  className: "fortune-col-header",
@@ -239,10 +247,12 @@ var ColumnHeader = function ColumnHeader() {
239
247
  }))));
240
248
  }), hiddenPointers.map(function (item) {
241
249
  return /*#__PURE__*/React.createElement("div", {
242
- className: "flex gap-4 cursor-pointer hide-btn align-center",
250
+ onMouseEnter: onMouseMoveHideRight,
251
+ onMouseLeave: onMouseLeaveHideRight,
252
+ className: "flex gap-4 cursor-pointer hide-btn-right align-center",
243
253
  style: {
244
254
  height: context.columnHeaderHeight - 12,
245
- left: "".concat(item.left + 6, "px")
255
+ left: "".concat(item.left + 8 + hovered, "px")
246
256
  },
247
257
  onClick: function onClick(e) {
248
258
  return showColumn(e, item);
@@ -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";
@@ -207,9 +206,9 @@ var RowHeader = function RowHeader() {
207
206
  onContextMenu: onContextMenu
208
207
  }, hiddenPointers.map(function (item) {
209
208
  return /*#__PURE__*/React.createElement("div", {
210
- className: "flex flex-col gap-4 cursor-pointer align-center hide-btn-row hide-btn",
209
+ className: "flex flex-col gap-4 cursor-pointer align-center hide-btn-row",
211
210
  style: {
212
- top: "".concat(item.top - 16, "px"),
211
+ top: "".concat(item.top - 15, "px"),
213
212
  zIndex: 100
214
213
  },
215
214
  onClick: function onClick(e) {
@@ -1013,16 +1013,42 @@
1013
1013
  }
1014
1014
 
1015
1015
  .hide-btn {
1016
- padding-top: 1px;
1016
+ padding-left: 2px;
1017
+ padding-top: 2px;
1017
1018
  position: absolute;
1018
1019
  right: 5;
1019
1020
  top: 5px;
1020
1021
  z-index: 200;
1021
- width: 9px;
1022
1022
  }
1023
1023
 
1024
1024
  .hide-btn:hover {
1025
- border: 1px solid #0188fb;
1025
+ padding-left: 1px;
1026
+ padding-top: 1px;
1027
+ width: 28px;
1028
+ border: 1px solid black;
1029
+ background-color: rgba(255, 255, 255, 1);
1030
+ border-radius: var(--border-radius-sm, 4px);
1031
+ }
1032
+
1033
+ .hide-btn-right {
1034
+ padding-right: 3px;
1035
+ padding-top: 2px;
1036
+ position: absolute;
1037
+ right: 5;
1038
+ top: 5px;
1039
+ z-index: 200;
1040
+ margin-right: 20px;
1041
+ }
1042
+
1043
+ .hide-btn-right:hover {
1044
+ padding-right: 2px;
1045
+ padding-top: 1px;
1046
+ z-index: 198;
1047
+ justify-content: end;
1048
+ width: 30px;
1049
+ border: 1px solid black;
1050
+ background-color: rgba(255, 255, 255, 1);
1051
+ border-radius: var(--border-radius-sm, 4px);
1026
1052
  }
1027
1053
 
1028
1054
  .rotate-row-icon {
@@ -1031,6 +1057,13 @@
1031
1057
 
1032
1058
  .hide-btn-row {
1033
1059
  position: absolute;
1034
- left: 4px;
1060
+ left: 4px;
1035
1061
  z-index: 200;
1062
+ width: 15px;
1063
+ }
1064
+
1065
+ .hide-btn-row:hover {
1066
+ background-color: white;
1067
+ border: 1px solid black;
1068
+ border-radius: 4px;
1036
1069
  }
@@ -123,8 +123,7 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
123
123
  return to.concat(ar || Array.prototype.slice.call(from));
124
124
  };
125
125
  import React, { useContext, useCallback, useRef, useEffect, useState } from "react";
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";
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, api } from "@fileverse-dev/fortune-core";
128
127
  import _ from "lodash";
129
128
  import { IconButton, LucideIcon, Tooltip, Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem } from "@fileverse/ui";
130
129
  import DataVerificationPortal from "./dataVerificationPortal";
@@ -27,10 +27,12 @@ var RangeDialog = function RangeDialog() {
27
27
  rangeTxt2 = _c[0],
28
28
  setRangeTxt2 = _c[1];
29
29
  var close = (0, _react.useCallback)(function () {
30
+ var _a;
30
31
  setContext(function (ctx) {
31
32
  ctx.rangeDialog.show = false;
32
33
  ctx.rangeDialog.singleSelect = false;
33
34
  });
35
+ (_a = document.getElementById("data-verification-button")) === null || _a === void 0 ? void 0 : _a.click();
34
36
  if (!context.rangeDialog) return;
35
37
  var rangeDialogType = context.rangeDialog.type;
36
38
  if (rangeDialogType.indexOf("between") >= 0) {
@@ -99,6 +101,7 @@ var RangeDialog = function RangeDialog() {
99
101
  minWidth: "80px"
100
102
  },
101
103
  onClick: function onClick() {
104
+ console.log("rangeTxt2", rangeTxt2);
102
105
  setContext(function (ctx) {
103
106
  ctx.rangeDialog.rangeTxt = rangeTxt2;
104
107
  });
@@ -204,6 +204,15 @@ var ColumnHeader = function ColumnHeader() {
204
204
  (0, _react.useEffect)(function () {
205
205
  containerRef.current.scrollLeft = context.scrollLeft;
206
206
  }, [context.scrollLeft]);
207
+ var _h = (0, _react.useState)(0),
208
+ hovered = _h[0],
209
+ setHovered = _h[1];
210
+ var onMouseMoveHideRight = (0, _react.useCallback)(function () {
211
+ setHovered(-21);
212
+ }, []);
213
+ var onMouseLeaveHideRight = (0, _react.useCallback)(function () {
214
+ setHovered(0);
215
+ }, []);
207
216
  return /*#__PURE__*/_react.default.createElement("div", {
208
217
  ref: containerRef,
209
218
  className: "fortune-col-header",
@@ -247,10 +256,12 @@ var ColumnHeader = function ColumnHeader() {
247
256
  }))));
248
257
  }), hiddenPointers.map(function (item) {
249
258
  return /*#__PURE__*/_react.default.createElement("div", {
250
- className: "flex gap-4 cursor-pointer hide-btn align-center",
259
+ onMouseEnter: onMouseMoveHideRight,
260
+ onMouseLeave: onMouseLeaveHideRight,
261
+ className: "flex gap-4 cursor-pointer hide-btn-right align-center",
251
262
  style: {
252
263
  height: context.columnHeaderHeight - 12,
253
- left: "".concat(item.left + 6, "px")
264
+ left: "".concat(item.left + 8 + hovered, "px")
254
265
  },
255
266
  onClick: function onClick(e) {
256
267
  return showColumn(e, item);
@@ -215,9 +215,9 @@ var RowHeader = function RowHeader() {
215
215
  onContextMenu: onContextMenu
216
216
  }, hiddenPointers.map(function (item) {
217
217
  return /*#__PURE__*/_react.default.createElement("div", {
218
- className: "flex flex-col gap-4 cursor-pointer align-center hide-btn-row hide-btn",
218
+ className: "flex flex-col gap-4 cursor-pointer align-center hide-btn-row",
219
219
  style: {
220
- top: "".concat(item.top - 16, "px"),
220
+ top: "".concat(item.top - 15, "px"),
221
221
  zIndex: 100
222
222
  },
223
223
  onClick: function onClick(e) {
@@ -1013,16 +1013,42 @@
1013
1013
  }
1014
1014
 
1015
1015
  .hide-btn {
1016
- padding-top: 1px;
1016
+ padding-left: 2px;
1017
+ padding-top: 2px;
1017
1018
  position: absolute;
1018
1019
  right: 5;
1019
1020
  top: 5px;
1020
1021
  z-index: 200;
1021
- width: 9px;
1022
1022
  }
1023
1023
 
1024
1024
  .hide-btn:hover {
1025
- border: 1px solid #0188fb;
1025
+ padding-left: 1px;
1026
+ padding-top: 1px;
1027
+ width: 28px;
1028
+ border: 1px solid black;
1029
+ background-color: rgba(255, 255, 255, 1);
1030
+ border-radius: var(--border-radius-sm, 4px);
1031
+ }
1032
+
1033
+ .hide-btn-right {
1034
+ padding-right: 3px;
1035
+ padding-top: 2px;
1036
+ position: absolute;
1037
+ right: 5;
1038
+ top: 5px;
1039
+ z-index: 200;
1040
+ margin-right: 20px;
1041
+ }
1042
+
1043
+ .hide-btn-right:hover {
1044
+ padding-right: 2px;
1045
+ padding-top: 1px;
1046
+ z-index: 198;
1047
+ justify-content: end;
1048
+ width: 30px;
1049
+ border: 1px solid black;
1050
+ background-color: rgba(255, 255, 255, 1);
1051
+ border-radius: var(--border-radius-sm, 4px);
1026
1052
  }
1027
1053
 
1028
1054
  .rotate-row-icon {
@@ -1031,6 +1057,13 @@
1031
1057
 
1032
1058
  .hide-btn-row {
1033
1059
  position: absolute;
1034
- left: 4px;
1060
+ left: 4px;
1035
1061
  z-index: 200;
1062
+ width: 15px;
1063
+ }
1064
+
1065
+ .hide-btn-row:hover {
1066
+ background-color: white;
1067
+ border: 1px solid black;
1068
+ border-radius: 4px;
1036
1069
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-react",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "module": "es/index.js",
@@ -16,7 +16,7 @@
16
16
  "tsc": "tsc"
17
17
  },
18
18
  "dependencies": {
19
- "@fileverse-dev/fortune-core": "1.2.0",
19
+ "@fileverse-dev/fortune-core": "1.2.2",
20
20
  "@fileverse/ui": "^4.1.7-patch-21",
21
21
  "@tippyjs/react": "^4.2.6",
22
22
  "@types/regenerator-runtime": "^0.13.6",