@fileverse-dev/fortune-react 1.1.99-patch-2 → 1.2.0-patch-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/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 +37 -10
- package/es/components/DataVerification/ColorPicker.js +31 -7
- package/es/components/DataVerification/DropdownList.js +20 -1
- package/es/components/DataVerification/DropdownOption.js +5 -2
- package/es/components/DataVerification/RangeDialog.js +1 -5
- package/es/components/DataVerification/index.css +21 -1
- package/es/components/DataVerification/index.js +31 -5
- package/es/components/SheetOverlay/ColumnHeader.js +89 -7
- package/es/components/SheetOverlay/FormulaHint/index.js +13 -2
- package/es/components/SheetOverlay/FormulaSearch/index.css +0 -1
- package/es/components/SheetOverlay/FormulaSearch/index.js +1 -1
- package/es/components/SheetOverlay/RowHeader.js +83 -7
- package/es/components/SheetOverlay/index.css +26 -7
- package/es/components/Toolbar/Combo.js +5 -2
- package/es/components/Toolbar/index.css +17 -1
- package/es/components/Toolbar/index.d.ts +1 -1
- package/es/components/Toolbar/index.js +28 -19
- package/es/components/Workbook/index.d.ts +1 -1
- package/es/components/Workbook/index.js +5 -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 +36 -9
- package/lib/components/DataVerification/ColorPicker.js +30 -6
- package/lib/components/DataVerification/DropdownList.js +20 -1
- package/lib/components/DataVerification/DropdownOption.js +5 -2
- package/lib/components/DataVerification/RangeDialog.js +1 -5
- package/lib/components/DataVerification/index.css +21 -1
- package/lib/components/DataVerification/index.js +31 -5
- package/lib/components/SheetOverlay/ColumnHeader.js +87 -6
- package/lib/components/SheetOverlay/FormulaHint/index.js +13 -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 +81 -6
- package/lib/components/SheetOverlay/index.css +26 -7
- package/lib/components/Toolbar/Combo.js +4 -1
- package/lib/components/Toolbar/index.css +17 -1
- package/lib/components/Toolbar/index.d.ts +1 -1
- package/lib/components/Toolbar/index.js +27 -19
- package/lib/components/Workbook/index.d.ts +1 -1
- package/lib/components/Workbook/index.js +5 -0
- package/package.json +2 -2
|
@@ -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];
|
|
@@ -633,7 +636,7 @@ var ContextMenu = function ContextMenu() {
|
|
|
633
636
|
}), /*#__PURE__*/React.createElement("div", null, rightclick.deleteSelected, rightclick.row))));
|
|
634
637
|
}
|
|
635
638
|
if (name === "hide-row") {
|
|
636
|
-
return (selection === null || selection === void 0 ? void 0 : selection.row_select)
|
|
639
|
+
return (selection === null || selection === void 0 ? void 0 : selection.row_select) && ["hideSelected", "showHide"].map(function (item) {
|
|
637
640
|
return /*#__PURE__*/React.createElement(Menu, {
|
|
638
641
|
key: item,
|
|
639
642
|
onClick: function onClick() {
|
|
@@ -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) {
|
|
@@ -1077,7 +1104,7 @@ var ContextMenu = function ContextMenu() {
|
|
|
1077
1104
|
left: contextMenu.x,
|
|
1078
1105
|
top: contextMenu.y
|
|
1079
1106
|
}
|
|
1080
|
-
}, context.contextMenu.headerMenu === true ? settings.headerContextMenu.map(function (menu, i) {
|
|
1107
|
+
}, context.contextMenu.headerMenu === true || context.contextMenu.headerMenu === "row" ? settings.headerContextMenu.map(function (menu, i) {
|
|
1081
1108
|
return getMenuElement(menu, i);
|
|
1082
1109
|
}) : settings.cellContextMenu.map(function (menu, i) {
|
|
1083
1110
|
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: "
|
|
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("
|
|
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-
|
|
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-
|
|
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
|
-
|
|
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: "
|
|
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
|
};
|
|
@@ -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
|
-
},
|
|
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 = {
|
|
@@ -223,13 +306,12 @@ var ColumnHeader = function ColumnHeader() {
|
|
|
223
306
|
c1 = _a.c1,
|
|
224
307
|
c2 = _a.c2;
|
|
225
308
|
return /*#__PURE__*/React.createElement("div", {
|
|
226
|
-
className: "fortune-col-header-selected",
|
|
309
|
+
className: "fortune-col-header-selected color-bg-tertiary",
|
|
227
310
|
key: i,
|
|
228
311
|
style: _.assign({
|
|
229
312
|
left: col_pre,
|
|
230
313
|
width: col - col_pre - 1,
|
|
231
314
|
display: "block",
|
|
232
|
-
backgroundColor: "#EFC703",
|
|
233
315
|
mixBlendMode: "multiply"
|
|
234
316
|
}, fixColumnStyleOverflowInFreeze(context, c1, c2, (_b = refs.globalCache.freezen) === null || _b === void 0 ? void 0 : _b[context.currentSheetId]))
|
|
235
317
|
});
|
|
@@ -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
|
|
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
|
|
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",
|
|
@@ -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
|