@fileverse-dev/fortune-react 1.2.0-patch-2 → 1.2.0-update-ds-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.
- package/es/components/ConditionFormat/index.css +2 -0
- package/es/components/ContextMenu/Menu.d.ts +1 -0
- package/es/components/ContextMenu/Menu.js +5 -2
- package/es/components/ContextMenu/index.css +4 -1
- package/es/components/ContextMenu/index.js +35 -8
- package/es/components/DataVerification/RangeDialog.js +0 -3
- package/es/components/SheetOverlay/ColumnHeader.js +3 -3
- package/es/components/SheetOverlay/FormulaSearch/index.css +0 -1
- package/es/components/SheetOverlay/FormulaSearch/index.js +1 -1
- package/es/components/SheetOverlay/RowHeader.js +3 -3
- package/es/components/SheetOverlay/index.css +1 -6
- package/es/components/Toolbar/Combo.js +5 -2
- package/es/components/Toolbar/Select.js +1 -1
- package/es/components/Toolbar/index.css +21 -1
- package/es/components/Toolbar/index.js +2 -1
- package/lib/components/ConditionFormat/index.css +2 -0
- package/lib/components/ContextMenu/Menu.d.ts +1 -0
- package/lib/components/ContextMenu/Menu.js +5 -2
- package/lib/components/ContextMenu/index.css +4 -1
- package/lib/components/ContextMenu/index.js +34 -7
- package/lib/components/DataVerification/RangeDialog.js +0 -3
- package/lib/components/SheetOverlay/ColumnHeader.js +1 -2
- package/lib/components/SheetOverlay/FormulaSearch/index.css +0 -1
- package/lib/components/SheetOverlay/FormulaSearch/index.js +1 -1
- package/lib/components/SheetOverlay/RowHeader.js +1 -2
- package/lib/components/SheetOverlay/index.css +1 -6
- package/lib/components/Toolbar/Combo.js +4 -1
- package/lib/components/Toolbar/Select.js +1 -1
- package/lib/components/Toolbar/index.css +21 -1
- package/package.json +2 -2
- package/CHANGELOG.md +0 -1615
|
@@ -3,6 +3,7 @@ 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;
|
|
6
7
|
}>;
|
|
7
8
|
declare const Menu: React.FC<Props>;
|
|
8
9
|
export default Menu;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import { cn } from "@fileverse/ui";
|
|
1
2
|
import React, { useRef } from "react";
|
|
2
3
|
var Menu = function Menu(_a) {
|
|
3
4
|
var _onClick = _a.onClick,
|
|
4
5
|
_onMouseLeave = _a.onMouseLeave,
|
|
5
6
|
_onMouseEnter = _a.onMouseEnter,
|
|
6
|
-
children = _a.children
|
|
7
|
+
children = _a.children,
|
|
8
|
+
_b = _a.isActive,
|
|
9
|
+
isActive = _b === void 0 ? false : _b;
|
|
7
10
|
var containerRef = useRef(null);
|
|
8
11
|
return /*#__PURE__*/React.createElement("div", {
|
|
9
12
|
ref: containerRef,
|
|
10
|
-
className: "luckysheet-cols-menuitem luckysheet-mousedown-cancel",
|
|
13
|
+
className: cn("luckysheet-cols-menuitem luckysheet-mousedown-cancel", isActive && "color-bg-default-hover"),
|
|
11
14
|
onClick: function onClick(e) {
|
|
12
15
|
return _onClick === null || _onClick === void 0 ? void 0 : _onClick(e, containerRef.current);
|
|
13
16
|
},
|
|
@@ -82,7 +82,10 @@
|
|
|
82
82
|
cursor: pointer;
|
|
83
83
|
list-style: none;
|
|
84
84
|
margin: 0;
|
|
85
|
-
padding: 8px !important;
|
|
85
|
+
padding-right: 8px !important;
|
|
86
|
+
padding-left: 8px !important;
|
|
87
|
+
padding-top: 6px !important;
|
|
88
|
+
padding-bottom: 6px !important;
|
|
86
89
|
white-space: nowrap;
|
|
87
90
|
user-select: none;
|
|
88
91
|
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 } from "react";
|
|
118
|
+
import React, { useContext, useRef, useCallback, useLayoutEffect, useState } from "react";
|
|
119
119
|
import regeneratorRuntime from "regenerator-runtime";
|
|
120
120
|
import Tippy from "@tippyjs/react";
|
|
121
121
|
import { LucideIcon } from "@fileverse/ui";
|
|
@@ -149,6 +149,9 @@ 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];
|
|
152
155
|
var addRowColRightAvobe = function addRowColRightAvobe(type, direction) {
|
|
153
156
|
var _a, _b, _c, _d, _e, _f;
|
|
154
157
|
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];
|
|
@@ -829,6 +832,12 @@ var ContextMenu = function ContextMenu() {
|
|
|
829
832
|
arrow: false,
|
|
830
833
|
zIndex: 3000,
|
|
831
834
|
appendTo: document.body,
|
|
835
|
+
onShow: function onShow() {
|
|
836
|
+
setActiveMenu("sort");
|
|
837
|
+
},
|
|
838
|
+
onHide: function onHide() {
|
|
839
|
+
if (activeMenu === "sort") setActiveMenu("");
|
|
840
|
+
},
|
|
832
841
|
content: /*#__PURE__*/React.createElement("div", {
|
|
833
842
|
className: "fortune-toolbar-select",
|
|
834
843
|
style: {
|
|
@@ -867,7 +876,9 @@ var ContextMenu = function ContextMenu() {
|
|
|
867
876
|
}), /*#__PURE__*/React.createElement("p", null, sort.desc))))),
|
|
868
877
|
trigger: "mouseenter focus",
|
|
869
878
|
hideOnClick: false
|
|
870
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Menu,
|
|
879
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Menu, {
|
|
880
|
+
isActive: activeMenu === "sort"
|
|
881
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
871
882
|
className: "flex items-center justify-between w-full"
|
|
872
883
|
}, /*#__PURE__*/React.createElement("div", {
|
|
873
884
|
className: "context-item"
|
|
@@ -907,7 +918,7 @@ var ContextMenu = function ContextMenu() {
|
|
|
907
918
|
}, /*#__PURE__*/React.createElement("div", {
|
|
908
919
|
className: "context-item p-2 w-full",
|
|
909
920
|
style: {
|
|
910
|
-
height: "
|
|
921
|
+
height: "32px"
|
|
911
922
|
}
|
|
912
923
|
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
913
924
|
name: "Filter",
|
|
@@ -922,14 +933,22 @@ var ContextMenu = function ContextMenu() {
|
|
|
922
933
|
}, /*#__PURE__*/React.createElement("div", {
|
|
923
934
|
className: "context-item p-2 w-full",
|
|
924
935
|
style: {
|
|
925
|
-
height: "
|
|
936
|
+
height: "32px"
|
|
926
937
|
}
|
|
927
938
|
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
928
939
|
name: "Eraser"
|
|
929
940
|
}), /*#__PURE__*/React.createElement("p", null, filter.clearFilter))))),
|
|
930
941
|
trigger: "mouseenter focus",
|
|
931
|
-
hideOnClick: false
|
|
932
|
-
|
|
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", {
|
|
933
952
|
className: "flex items-center justify-between w-full"
|
|
934
953
|
}, /*#__PURE__*/React.createElement("div", {
|
|
935
954
|
className: "context-item"
|
|
@@ -983,6 +1002,12 @@ var ContextMenu = function ContextMenu() {
|
|
|
983
1002
|
arrow: false,
|
|
984
1003
|
zIndex: 3000,
|
|
985
1004
|
appendTo: document.body,
|
|
1005
|
+
onShow: function onShow() {
|
|
1006
|
+
setActiveMenu("conditionFormat");
|
|
1007
|
+
},
|
|
1008
|
+
onHide: function onHide() {
|
|
1009
|
+
if (activeMenu === "conditionFormat") setActiveMenu("");
|
|
1010
|
+
},
|
|
986
1011
|
content: /*#__PURE__*/React.createElement("div", {
|
|
987
1012
|
style: {
|
|
988
1013
|
minWidth: 220
|
|
@@ -993,7 +1018,9 @@ var ContextMenu = function ContextMenu() {
|
|
|
993
1018
|
})),
|
|
994
1019
|
trigger: "mouseenter focus",
|
|
995
1020
|
hideOnClick: false
|
|
996
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Menu,
|
|
1021
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Menu, {
|
|
1022
|
+
isActive: activeMenu === "conditionFormat"
|
|
1023
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
997
1024
|
className: "flex items-center justify-between w-full"
|
|
998
1025
|
}, /*#__PURE__*/React.createElement("div", {
|
|
999
1026
|
className: "flex items-center gap-2 context-item"
|
|
@@ -1029,7 +1056,7 @@ var ContextMenu = function ContextMenu() {
|
|
|
1029
1056
|
}), /*#__PURE__*/React.createElement("p", null, "Clear formatting")));
|
|
1030
1057
|
}
|
|
1031
1058
|
return null;
|
|
1032
|
-
}, [context, setContext, refs.globalCache, rightclick, showAlert, showDialog, drag.noMulti, info.tipRowHeightLimit, info.tipColumnWidthLimit, generalDialog.partiallyError, generalDialog.readOnlyError, generalDialog.dataNullError]);
|
|
1059
|
+
}, [context, setContext, refs.globalCache, rightclick, showAlert, showDialog, drag.noMulti, info.tipRowHeightLimit, info.tipColumnWidthLimit, generalDialog.partiallyError, generalDialog.readOnlyError, generalDialog.dataNullError, activeMenu]);
|
|
1033
1060
|
useLayoutEffect(function () {
|
|
1034
1061
|
var _a;
|
|
1035
1062
|
if (!containerRef.current) {
|
|
@@ -18,7 +18,6 @@ var RangeDialog = function RangeDialog() {
|
|
|
18
18
|
rangeTxt2 = _c[0],
|
|
19
19
|
setRangeTxt2 = _c[1];
|
|
20
20
|
var close = useCallback(function () {
|
|
21
|
-
var _a;
|
|
22
21
|
setContext(function (ctx) {
|
|
23
22
|
ctx.rangeDialog.show = false;
|
|
24
23
|
ctx.rangeDialog.singleSelect = false;
|
|
@@ -37,8 +36,6 @@ var RangeDialog = function RangeDialog() {
|
|
|
37
36
|
type: rulesType
|
|
38
37
|
}), undefined, locale(context).conditionformat["conditionformat_".concat(rulesType)]);
|
|
39
38
|
}
|
|
40
|
-
console.log("rangeDialogType", rangeDialogType);
|
|
41
|
-
(_a = document.getElementById("data-verification-button")) === null || _a === void 0 ? void 0 : _a.click();
|
|
42
39
|
}, [setContext, showDialog, context]);
|
|
43
40
|
useEffect(function () {
|
|
44
41
|
setRangeTxt2(getDisplayedRangeTxt(context));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { colLocation, colLocationByIndex, selectTitlesMap, selectTitlesRange, handleColSizeHandleMouseDown, handleColumnHeaderMouseDown, isAllowEdit, getFlowdata, fixColumnStyleOverflowInFreeze, handleColFreezeHandleMouseDown, getSheetIndex, fixPositionOnFrozenCells, showSelected
|
|
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";
|
|
@@ -305,13 +306,12 @@ var ColumnHeader = function ColumnHeader() {
|
|
|
305
306
|
c1 = _a.c1,
|
|
306
307
|
c2 = _a.c2;
|
|
307
308
|
return /*#__PURE__*/React.createElement("div", {
|
|
308
|
-
className: "fortune-col-header-selected",
|
|
309
|
+
className: "fortune-col-header-selected color-bg-tertiary",
|
|
309
310
|
key: i,
|
|
310
311
|
style: _.assign({
|
|
311
312
|
left: col_pre,
|
|
312
313
|
width: col - col_pre - 1,
|
|
313
314
|
display: "block",
|
|
314
|
-
backgroundColor: "#EFC703",
|
|
315
315
|
mixBlendMode: "multiply"
|
|
316
316
|
}, fixColumnStyleOverflowInFreeze(context, c1, c2, (_b = refs.globalCache.freezen) === null || _b === void 0 ? void 0 : _b[context.currentSheetId]))
|
|
317
317
|
});
|
|
@@ -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 flex-col luckysheet-formula-search-c-p custom-scroll",
|
|
56
|
+
className: "flex color-border-default border 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,4 +1,5 @@
|
|
|
1
|
-
import { rowLocation, rowLocationByIndex, selectTitlesMap, selectTitlesRange, handleContextMenu, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, fixRowStyleOverflowInFreeze, handleRowFreezeHandleMouseDown, getSheetIndex, showSelected, fixPositionOnFrozenCells
|
|
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";
|
|
@@ -265,13 +266,12 @@ var RowHeader = function RowHeader() {
|
|
|
265
266
|
r1 = _a.r1,
|
|
266
267
|
r2 = _a.r2;
|
|
267
268
|
return /*#__PURE__*/React.createElement("div", {
|
|
268
|
-
className: "fortune-row-header-selected",
|
|
269
|
+
className: "fortune-row-header-selected color-bg-tertiary",
|
|
269
270
|
key: i,
|
|
270
271
|
style: _.assign({
|
|
271
272
|
top: row_pre,
|
|
272
273
|
height: row - row_pre - 1,
|
|
273
274
|
display: "block",
|
|
274
|
-
backgroundColor: "#EFC703",
|
|
275
275
|
mixBlendMode: "multiply"
|
|
276
276
|
}, fixRowStyleOverflowInFreeze(context, r1, r2, (_b = refs.globalCache.freezen) === null || _b === void 0 ? void 0 : _b[context.currentSheetId]))
|
|
277
277
|
});
|
|
@@ -45,12 +45,10 @@
|
|
|
45
45
|
.fortune-row-header-selected {
|
|
46
46
|
position: absolute;
|
|
47
47
|
z-index: 10;
|
|
48
|
-
border-right: 1px solid #0188fb;
|
|
49
48
|
right: 0;
|
|
50
49
|
width: 100%;
|
|
51
50
|
margin-top: 2px;
|
|
52
51
|
display: none;
|
|
53
|
-
background-color: rgba(76, 76, 76, 0.1);
|
|
54
52
|
}
|
|
55
53
|
|
|
56
54
|
.fortune-col-header-wrap {
|
|
@@ -94,12 +92,10 @@
|
|
|
94
92
|
cursor: default;
|
|
95
93
|
position: absolute;
|
|
96
94
|
z-index: 10;
|
|
97
|
-
border-bottom: 1px solid #0188fb;
|
|
98
95
|
bottom: 0;
|
|
99
96
|
height: 100%;
|
|
100
97
|
margin-left: 0px;
|
|
101
98
|
display: none;
|
|
102
|
-
background-color: rgba(76, 76, 76, 0.1);
|
|
103
99
|
}
|
|
104
100
|
|
|
105
101
|
.fortune-left-top {
|
|
@@ -137,7 +133,7 @@
|
|
|
137
133
|
z-index: 14;
|
|
138
134
|
/*border:1px solid #fff;*/
|
|
139
135
|
margin: 0px 0 0 0px;
|
|
140
|
-
background: rgba(0, 80, 208, 0.15);
|
|
136
|
+
/* background: rgba(0, 80, 208, 0.15); */
|
|
141
137
|
display: none;
|
|
142
138
|
}
|
|
143
139
|
|
|
@@ -199,7 +195,6 @@
|
|
|
199
195
|
z-index: 15;
|
|
200
196
|
border: 2.5px solid #efc703;
|
|
201
197
|
margin: -1px 0 0 -1px;
|
|
202
|
-
background: rgba(1, 136, 251, 0.15);
|
|
203
198
|
display: none;
|
|
204
199
|
box-sizing: content-box;
|
|
205
200
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useMemo, useRef, useState } from "react";
|
|
2
|
-
import { IconButton, Tooltip, Popover, PopoverContent, PopoverTrigger, cn, Button } from "@fileverse/ui";
|
|
2
|
+
import { IconButton, Tooltip, Popover, PopoverContent, PopoverTrigger, cn, Button, LucideIcon } from "@fileverse/ui";
|
|
3
3
|
import SVGIcon from "../SVGIcon";
|
|
4
4
|
import { getLucideIcon } from ".";
|
|
5
5
|
var Combo = function Combo(_a) {
|
|
@@ -49,7 +49,10 @@ var Combo = function Combo(_a) {
|
|
|
49
49
|
height: 16
|
|
50
50
|
})) : (/*#__PURE__*/React.createElement("span", {
|
|
51
51
|
className: "fortune-toolbar-combo-text"
|
|
52
|
-
}, text !== undefined ? text : ""))
|
|
52
|
+
}, text !== undefined ? text : "")), /*#__PURE__*/React.createElement(LucideIcon, {
|
|
53
|
+
className: "w-[16px] h-[16px]",
|
|
54
|
+
name: "ChevronDown"
|
|
55
|
+
})))) : (/*#__PURE__*/React.createElement("span", null, iconId === "font-color" ? (/*#__PURE__*/React.createElement(Tooltip, {
|
|
53
56
|
text: tooltip,
|
|
54
57
|
placement: "bottom"
|
|
55
58
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
@@ -27,7 +27,7 @@ var Option = function Option(_a) {
|
|
|
27
27
|
}, iconId && /*#__PURE__*/React.createElement(SVGIcon, {
|
|
28
28
|
name: iconId
|
|
29
29
|
}), /*#__PURE__*/React.createElement("div", {
|
|
30
|
-
className: "fortuen-toolbar-text color-text-default text-body-sm"
|
|
30
|
+
className: "fortuen-toolbar-text color-text-default text-body-sm w-full"
|
|
31
31
|
}, children));
|
|
32
32
|
};
|
|
33
33
|
export { Option };
|
|
@@ -141,14 +141,30 @@
|
|
|
141
141
|
|
|
142
142
|
.fortune-toolbar-combo-button {
|
|
143
143
|
font-size: 12px;
|
|
144
|
+
padding-top: 4px;
|
|
145
|
+
padding-bottom: 4px;
|
|
146
|
+
padding-left: 8px;
|
|
147
|
+
padding-right: 8px;
|
|
148
|
+
border-radius: 4px;
|
|
149
|
+
gap: 8px;
|
|
150
|
+
}
|
|
151
|
+
.fortune-toolbar-combo-button:hover {
|
|
152
|
+
background: hsl(var(--color-bg-default-hover));
|
|
144
153
|
}
|
|
145
154
|
|
|
146
155
|
.fortune-toolbar-select-option {
|
|
147
156
|
font-size: 12px;
|
|
148
157
|
min-width: 60px;
|
|
149
|
-
padding: 8px;
|
|
158
|
+
padding-left: 8px;
|
|
159
|
+
padding-right: 8px;
|
|
160
|
+
padding-top: 6px;
|
|
161
|
+
padding-bottom: 6px;
|
|
150
162
|
cursor: pointer;
|
|
151
163
|
user-select: none;
|
|
164
|
+
height: 32px;
|
|
165
|
+
display: flex;
|
|
166
|
+
align-items: center;
|
|
167
|
+
|
|
152
168
|
}
|
|
153
169
|
|
|
154
170
|
.fortune-toolbar-select-option:hover {
|
|
@@ -171,6 +187,10 @@
|
|
|
171
187
|
font-weight: 500;
|
|
172
188
|
font-size: 14px;
|
|
173
189
|
line-height: 20px;
|
|
190
|
+
max-width: 56px;
|
|
191
|
+
overflow: hidden;
|
|
192
|
+
text-overflow: ellipsis;
|
|
193
|
+
white-space: nowrap;
|
|
174
194
|
}
|
|
175
195
|
|
|
176
196
|
.fortune-toolbar-color-picker-item {
|
|
@@ -123,7 +123,8 @@ 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
|
|
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
128
|
import _ from "lodash";
|
|
128
129
|
import { IconButton, LucideIcon, Tooltip, Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem } from "@fileverse/ui";
|
|
129
130
|
import DataVerificationPortal from "./dataVerificationPortal";
|
|
@@ -3,6 +3,7 @@ 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;
|
|
6
7
|
}>;
|
|
7
8
|
declare const Menu: React.FC<Props>;
|
|
8
9
|
export default Menu;
|
|
@@ -5,17 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _ui = require("@fileverse/ui");
|
|
8
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
10
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
10
11
|
var Menu = function Menu(_a) {
|
|
11
12
|
var _onClick = _a.onClick,
|
|
12
13
|
_onMouseLeave = _a.onMouseLeave,
|
|
13
14
|
_onMouseEnter = _a.onMouseEnter,
|
|
14
|
-
children = _a.children
|
|
15
|
+
children = _a.children,
|
|
16
|
+
_b = _a.isActive,
|
|
17
|
+
isActive = _b === void 0 ? false : _b;
|
|
15
18
|
var containerRef = (0, _react.useRef)(null);
|
|
16
19
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
17
20
|
ref: containerRef,
|
|
18
|
-
className: "luckysheet-cols-menuitem luckysheet-mousedown-cancel",
|
|
21
|
+
className: (0, _ui.cn)("luckysheet-cols-menuitem luckysheet-mousedown-cancel", isActive && "color-bg-default-hover"),
|
|
19
22
|
onClick: function onClick(e) {
|
|
20
23
|
return _onClick === null || _onClick === void 0 ? void 0 : _onClick(e, containerRef.current);
|
|
21
24
|
},
|
|
@@ -82,7 +82,10 @@
|
|
|
82
82
|
cursor: pointer;
|
|
83
83
|
list-style: none;
|
|
84
84
|
margin: 0;
|
|
85
|
-
padding: 8px !important;
|
|
85
|
+
padding-right: 8px !important;
|
|
86
|
+
padding-left: 8px !important;
|
|
87
|
+
padding-top: 6px !important;
|
|
88
|
+
padding-bottom: 6px !important;
|
|
86
89
|
white-space: nowrap;
|
|
87
90
|
user-select: none;
|
|
88
91
|
display: flex;
|
|
@@ -158,6 +158,9 @@ var ContextMenu = function ContextMenu() {
|
|
|
158
158
|
info = _b.info,
|
|
159
159
|
toolbar = _b.toolbar,
|
|
160
160
|
splitText = _b.splitText;
|
|
161
|
+
var _c = (0, _react.useState)(""),
|
|
162
|
+
activeMenu = _c[0],
|
|
163
|
+
setActiveMenu = _c[1];
|
|
161
164
|
var addRowColRightAvobe = function addRowColRightAvobe(type, direction) {
|
|
162
165
|
var _a, _b, _c, _d, _e, _f;
|
|
163
166
|
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];
|
|
@@ -838,6 +841,12 @@ var ContextMenu = function ContextMenu() {
|
|
|
838
841
|
arrow: false,
|
|
839
842
|
zIndex: 3000,
|
|
840
843
|
appendTo: document.body,
|
|
844
|
+
onShow: function onShow() {
|
|
845
|
+
setActiveMenu("sort");
|
|
846
|
+
},
|
|
847
|
+
onHide: function onHide() {
|
|
848
|
+
if (activeMenu === "sort") setActiveMenu("");
|
|
849
|
+
},
|
|
841
850
|
content: /*#__PURE__*/_react.default.createElement("div", {
|
|
842
851
|
className: "fortune-toolbar-select",
|
|
843
852
|
style: {
|
|
@@ -876,7 +885,9 @@ var ContextMenu = function ContextMenu() {
|
|
|
876
885
|
}), /*#__PURE__*/_react.default.createElement("p", null, sort.desc))))),
|
|
877
886
|
trigger: "mouseenter focus",
|
|
878
887
|
hideOnClick: false
|
|
879
|
-
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Menu.default,
|
|
888
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Menu.default, {
|
|
889
|
+
isActive: activeMenu === "sort"
|
|
890
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
880
891
|
className: "flex items-center justify-between w-full"
|
|
881
892
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
882
893
|
className: "context-item"
|
|
@@ -916,7 +927,7 @@ var ContextMenu = function ContextMenu() {
|
|
|
916
927
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
917
928
|
className: "context-item p-2 w-full",
|
|
918
929
|
style: {
|
|
919
|
-
height: "
|
|
930
|
+
height: "32px"
|
|
920
931
|
}
|
|
921
932
|
}, /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
|
|
922
933
|
name: "Filter",
|
|
@@ -931,14 +942,22 @@ var ContextMenu = function ContextMenu() {
|
|
|
931
942
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
932
943
|
className: "context-item p-2 w-full",
|
|
933
944
|
style: {
|
|
934
|
-
height: "
|
|
945
|
+
height: "32px"
|
|
935
946
|
}
|
|
936
947
|
}, /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
|
|
937
948
|
name: "Eraser"
|
|
938
949
|
}), /*#__PURE__*/_react.default.createElement("p", null, filter.clearFilter))))),
|
|
939
950
|
trigger: "mouseenter focus",
|
|
940
|
-
hideOnClick: false
|
|
941
|
-
|
|
951
|
+
hideOnClick: false,
|
|
952
|
+
onShow: function onShow() {
|
|
953
|
+
setActiveMenu("filter");
|
|
954
|
+
},
|
|
955
|
+
onHide: function onHide() {
|
|
956
|
+
if (activeMenu === "filter") setActiveMenu("");
|
|
957
|
+
}
|
|
958
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Menu.default, {
|
|
959
|
+
isActive: activeMenu === "filter"
|
|
960
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
942
961
|
className: "flex items-center justify-between w-full"
|
|
943
962
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
944
963
|
className: "context-item"
|
|
@@ -992,6 +1011,12 @@ var ContextMenu = function ContextMenu() {
|
|
|
992
1011
|
arrow: false,
|
|
993
1012
|
zIndex: 3000,
|
|
994
1013
|
appendTo: document.body,
|
|
1014
|
+
onShow: function onShow() {
|
|
1015
|
+
setActiveMenu("conditionFormat");
|
|
1016
|
+
},
|
|
1017
|
+
onHide: function onHide() {
|
|
1018
|
+
if (activeMenu === "conditionFormat") setActiveMenu("");
|
|
1019
|
+
},
|
|
995
1020
|
content: /*#__PURE__*/_react.default.createElement("div", {
|
|
996
1021
|
style: {
|
|
997
1022
|
minWidth: 220
|
|
@@ -1002,7 +1027,9 @@ var ContextMenu = function ContextMenu() {
|
|
|
1002
1027
|
})),
|
|
1003
1028
|
trigger: "mouseenter focus",
|
|
1004
1029
|
hideOnClick: false
|
|
1005
|
-
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Menu.default,
|
|
1030
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Menu.default, {
|
|
1031
|
+
isActive: activeMenu === "conditionFormat"
|
|
1032
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
1006
1033
|
className: "flex items-center justify-between w-full"
|
|
1007
1034
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
1008
1035
|
className: "flex items-center gap-2 context-item"
|
|
@@ -1038,7 +1065,7 @@ var ContextMenu = function ContextMenu() {
|
|
|
1038
1065
|
}), /*#__PURE__*/_react.default.createElement("p", null, "Clear formatting")));
|
|
1039
1066
|
}
|
|
1040
1067
|
return null;
|
|
1041
|
-
}, [context, setContext, refs.globalCache, rightclick, showAlert, showDialog, drag.noMulti, info.tipRowHeightLimit, info.tipColumnWidthLimit, generalDialog.partiallyError, generalDialog.readOnlyError, generalDialog.dataNullError]);
|
|
1068
|
+
}, [context, setContext, refs.globalCache, rightclick, showAlert, showDialog, drag.noMulti, info.tipRowHeightLimit, info.tipColumnWidthLimit, generalDialog.partiallyError, generalDialog.readOnlyError, generalDialog.dataNullError, activeMenu]);
|
|
1042
1069
|
(0, _react.useLayoutEffect)(function () {
|
|
1043
1070
|
var _a;
|
|
1044
1071
|
if (!containerRef.current) {
|
|
@@ -27,7 +27,6 @@ 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;
|
|
31
30
|
setContext(function (ctx) {
|
|
32
31
|
ctx.rangeDialog.show = false;
|
|
33
32
|
ctx.rangeDialog.singleSelect = false;
|
|
@@ -46,8 +45,6 @@ var RangeDialog = function RangeDialog() {
|
|
|
46
45
|
type: rulesType
|
|
47
46
|
}), undefined, (0, _fortuneCore.locale)(context).conditionformat["conditionformat_".concat(rulesType)]);
|
|
48
47
|
}
|
|
49
|
-
console.log("rangeDialogType", rangeDialogType);
|
|
50
|
-
(_a = document.getElementById("data-verification-button")) === null || _a === void 0 ? void 0 : _a.click();
|
|
51
48
|
}, [setContext, showDialog, context]);
|
|
52
49
|
(0, _react.useEffect)(function () {
|
|
53
50
|
setRangeTxt2((0, _getDisplayedRangeTxt.getDisplayedRangeTxt)(context));
|
|
@@ -314,13 +314,12 @@ var ColumnHeader = function ColumnHeader() {
|
|
|
314
314
|
c1 = _a.c1,
|
|
315
315
|
c2 = _a.c2;
|
|
316
316
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
317
|
-
className: "fortune-col-header-selected",
|
|
317
|
+
className: "fortune-col-header-selected color-bg-tertiary",
|
|
318
318
|
key: i,
|
|
319
319
|
style: _lodash.default.assign({
|
|
320
320
|
left: col_pre,
|
|
321
321
|
width: col - col_pre - 1,
|
|
322
322
|
display: "block",
|
|
323
|
-
backgroundColor: "#EFC703",
|
|
324
323
|
mixBlendMode: "multiply"
|
|
325
324
|
}, (0, _fortuneCore.fixColumnStyleOverflowInFreeze)(context, c1, c2, (_b = refs.globalCache.freezen) === null || _b === void 0 ? void 0 : _b[context.currentSheetId]))
|
|
326
325
|
});
|
|
@@ -62,7 +62,7 @@ var FormulaSearch = function FormulaSearch(props) {
|
|
|
62
62
|
});
|
|
63
63
|
if (_lodash.default.isEmpty(context.functionCandidates) && _lodash.default.isEmpty(context.defaultCandidates)) return null;
|
|
64
64
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
65
|
-
className: "flex flex-col luckysheet-formula-search-c-p custom-scroll",
|
|
65
|
+
className: "flex color-border-default border flex-col luckysheet-formula-search-c-p custom-scroll",
|
|
66
66
|
id: "luckysheet-formula-search-c-p",
|
|
67
67
|
style: {
|
|
68
68
|
top: top
|
|
@@ -274,13 +274,12 @@ var RowHeader = function RowHeader() {
|
|
|
274
274
|
r1 = _a.r1,
|
|
275
275
|
r2 = _a.r2;
|
|
276
276
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
277
|
-
className: "fortune-row-header-selected",
|
|
277
|
+
className: "fortune-row-header-selected color-bg-tertiary",
|
|
278
278
|
key: i,
|
|
279
279
|
style: _lodash.default.assign({
|
|
280
280
|
top: row_pre,
|
|
281
281
|
height: row - row_pre - 1,
|
|
282
282
|
display: "block",
|
|
283
|
-
backgroundColor: "#EFC703",
|
|
284
283
|
mixBlendMode: "multiply"
|
|
285
284
|
}, (0, _fortuneCore.fixRowStyleOverflowInFreeze)(context, r1, r2, (_b = refs.globalCache.freezen) === null || _b === void 0 ? void 0 : _b[context.currentSheetId]))
|
|
286
285
|
});
|
|
@@ -45,12 +45,10 @@
|
|
|
45
45
|
.fortune-row-header-selected {
|
|
46
46
|
position: absolute;
|
|
47
47
|
z-index: 10;
|
|
48
|
-
border-right: 1px solid #0188fb;
|
|
49
48
|
right: 0;
|
|
50
49
|
width: 100%;
|
|
51
50
|
margin-top: 2px;
|
|
52
51
|
display: none;
|
|
53
|
-
background-color: rgba(76, 76, 76, 0.1);
|
|
54
52
|
}
|
|
55
53
|
|
|
56
54
|
.fortune-col-header-wrap {
|
|
@@ -94,12 +92,10 @@
|
|
|
94
92
|
cursor: default;
|
|
95
93
|
position: absolute;
|
|
96
94
|
z-index: 10;
|
|
97
|
-
border-bottom: 1px solid #0188fb;
|
|
98
95
|
bottom: 0;
|
|
99
96
|
height: 100%;
|
|
100
97
|
margin-left: 0px;
|
|
101
98
|
display: none;
|
|
102
|
-
background-color: rgba(76, 76, 76, 0.1);
|
|
103
99
|
}
|
|
104
100
|
|
|
105
101
|
.fortune-left-top {
|
|
@@ -137,7 +133,7 @@
|
|
|
137
133
|
z-index: 14;
|
|
138
134
|
/*border:1px solid #fff;*/
|
|
139
135
|
margin: 0px 0 0 0px;
|
|
140
|
-
background: rgba(0, 80, 208, 0.15);
|
|
136
|
+
/* background: rgba(0, 80, 208, 0.15); */
|
|
141
137
|
display: none;
|
|
142
138
|
}
|
|
143
139
|
|
|
@@ -199,7 +195,6 @@
|
|
|
199
195
|
z-index: 15;
|
|
200
196
|
border: 2.5px solid #efc703;
|
|
201
197
|
margin: -1px 0 0 -1px;
|
|
202
|
-
background: rgba(1, 136, 251, 0.15);
|
|
203
198
|
display: none;
|
|
204
199
|
box-sizing: content-box;
|
|
205
200
|
}
|