@fileverse-dev/fortune-react 1.1.99-patch-6 → 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.
- package/es/components/ContextMenu/index.js +2 -2
- package/es/components/DataVerification/ColorPicker.js +7 -31
- package/es/components/DataVerification/DropdownList.js +1 -20
- package/es/components/DataVerification/DropdownOption.js +2 -5
- package/es/components/DataVerification/RangeDialog.js +5 -1
- package/es/components/DataVerification/index.css +1 -21
- package/es/components/DataVerification/index.js +5 -31
- package/es/components/SheetOverlay/ColumnHeader.js +5 -88
- package/es/components/SheetOverlay/FormulaHint/index.js +2 -13
- package/es/components/SheetOverlay/RowHeader.js +5 -82
- package/es/components/SheetOverlay/index.css +1 -24
- package/es/components/Toolbar/index.d.ts +1 -1
- package/es/components/Toolbar/index.js +19 -23
- package/es/components/Workbook/index.d.ts +1 -1
- package/es/components/Workbook/index.js +0 -5
- package/lib/components/ContextMenu/index.js +2 -2
- package/lib/components/DataVerification/ColorPicker.js +6 -30
- package/lib/components/DataVerification/DropdownList.js +1 -20
- package/lib/components/DataVerification/DropdownOption.js +2 -5
- package/lib/components/DataVerification/RangeDialog.js +5 -1
- package/lib/components/DataVerification/index.css +1 -21
- package/lib/components/DataVerification/index.js +5 -31
- package/lib/components/SheetOverlay/ColumnHeader.js +4 -86
- package/lib/components/SheetOverlay/FormulaHint/index.js +2 -13
- package/lib/components/SheetOverlay/RowHeader.js +4 -80
- package/lib/components/SheetOverlay/index.css +1 -24
- package/lib/components/Toolbar/index.d.ts +1 -1
- package/lib/components/Toolbar/index.js +19 -22
- package/lib/components/Workbook/index.d.ts +1 -1
- package/lib/components/Workbook/index.js +0 -5
- package/package.json +2 -2
|
@@ -633,7 +633,7 @@ var ContextMenu = function ContextMenu() {
|
|
|
633
633
|
}), /*#__PURE__*/React.createElement("div", null, rightclick.deleteSelected, rightclick.row))));
|
|
634
634
|
}
|
|
635
635
|
if (name === "hide-row") {
|
|
636
|
-
return (selection === null || selection === void 0 ? void 0 : selection.row_select) && ["hideSelected", "showHide"].map(function (item) {
|
|
636
|
+
return (selection === null || selection === void 0 ? void 0 : selection.row_select) === true && ["hideSelected", "showHide"].map(function (item) {
|
|
637
637
|
return /*#__PURE__*/React.createElement(Menu, {
|
|
638
638
|
key: item,
|
|
639
639
|
onClick: function onClick() {
|
|
@@ -1077,7 +1077,7 @@ var ContextMenu = function ContextMenu() {
|
|
|
1077
1077
|
left: contextMenu.x,
|
|
1078
1078
|
top: contextMenu.y
|
|
1079
1079
|
}
|
|
1080
|
-
}, context.contextMenu.headerMenu === true
|
|
1080
|
+
}, context.contextMenu.headerMenu === true ? settings.headerContextMenu.map(function (menu, i) {
|
|
1081
1081
|
return getMenuElement(menu, i);
|
|
1082
1082
|
}) : settings.cellContextMenu.map(function (menu, i) {
|
|
1083
1083
|
return getMenuElement(menu, i);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
2
|
import { ChevronDown } from "lucide-react";
|
|
3
|
-
import {
|
|
3
|
+
import { Popover, PopoverContent, PopoverTrigger } from "@fileverse/ui";
|
|
4
4
|
export var TEXT_COLORS = [{
|
|
5
5
|
name: "Light Gray",
|
|
6
6
|
value: "228, 232, 237"
|
|
@@ -57,9 +57,7 @@ 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"
|
|
61
|
-
border: "var(--border-width-md, 1px) solid hsl(var(--color-border-default, #E8EBEC))",
|
|
62
|
-
borderRadius: "var(--border-radius-sm, 4px)"
|
|
60
|
+
padding: "7px"
|
|
63
61
|
}
|
|
64
62
|
}, /*#__PURE__*/React.createElement("div", {
|
|
65
63
|
className: "flex items-center gap-3 color-text-secondary"
|
|
@@ -74,7 +72,7 @@ export var ColorSection = function ColorSection(_a) {
|
|
|
74
72
|
})))), /*#__PURE__*/React.createElement(PopoverContent, {
|
|
75
73
|
align: "start",
|
|
76
74
|
alignOffset: 0,
|
|
77
|
-
className: "
|
|
75
|
+
className: "w-[200px] export-content-popover",
|
|
78
76
|
elevation: 2,
|
|
79
77
|
side: "bottom",
|
|
80
78
|
sideOffset: 4
|
|
@@ -83,40 +81,18 @@ export var ColorSection = function ColorSection(_a) {
|
|
|
83
81
|
}, /*#__PURE__*/React.createElement("div", {
|
|
84
82
|
className: "flex gap-2 flex-wrap w-full"
|
|
85
83
|
}, TEXT_COLORS.map(function (color) {
|
|
86
|
-
return /*#__PURE__*/React.createElement("
|
|
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", {
|
|
84
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
94
85
|
type: "button",
|
|
95
86
|
key: color.value,
|
|
96
87
|
onClick: function onClick() {
|
|
97
88
|
onPick(color.value);
|
|
98
89
|
setIsOpen(false);
|
|
99
90
|
},
|
|
100
|
-
className: "w-
|
|
91
|
+
className: "w-7 h-7 rounded-full transition-all hover:scale-110 hover:shadow-md",
|
|
101
92
|
style: {
|
|
102
93
|
backgroundColor: "rgb(".concat(color.value, ")")
|
|
103
94
|
},
|
|
104
95
|
title: color.name
|
|
105
|
-
})
|
|
106
|
-
})
|
|
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"))))));
|
|
96
|
+
});
|
|
97
|
+
})))));
|
|
122
98
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
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";
|
|
4
3
|
import WorkbookContext from "../../context";
|
|
5
4
|
import { useOutsideClick } from "../../hooks/useOutsideClick";
|
|
6
5
|
import SVGIcon from "../SVGIcon";
|
|
@@ -146,24 +145,6 @@ var DropDownList = function DropDownList() {
|
|
|
146
145
|
display: isMul && selected.indexOf(v) >= 0 ? "inline" : "none"
|
|
147
146
|
}
|
|
148
147
|
}), v);
|
|
149
|
-
})
|
|
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")));
|
|
148
|
+
}));
|
|
168
149
|
};
|
|
169
150
|
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-3 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,10 +269,7 @@ var DynamicInputList = function DynamicInputList(_a) {
|
|
|
269
269
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
270
270
|
variant: "secondary",
|
|
271
271
|
onClick: handleAdd,
|
|
272
|
-
|
|
273
|
-
style: {
|
|
274
|
-
fontWeight: 500
|
|
275
|
-
}
|
|
272
|
+
className: ""
|
|
276
273
|
}, "Add another item")));
|
|
277
274
|
};
|
|
278
275
|
export default DynamicInputList;
|
|
@@ -1,6 +1,7 @@
|
|
|
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 ".";
|
|
4
5
|
import WorkbookContext from "../../context";
|
|
5
6
|
import { useDialog } from "../../hooks/useDialog";
|
|
6
7
|
import ConditionRules from "../ConditionFormat/ConditionRules";
|
|
@@ -13,7 +14,8 @@ var RangeDialog = function RangeDialog() {
|
|
|
13
14
|
var showDialog = useDialog().showDialog;
|
|
14
15
|
var _b = locale(context),
|
|
15
16
|
dataVerification = _b.dataVerification,
|
|
16
|
-
button = _b.button
|
|
17
|
+
button = _b.button,
|
|
18
|
+
toolbar = _b.toolbar;
|
|
17
19
|
var _c = useState(getDisplayedRangeTxt(context)),
|
|
18
20
|
rangeTxt2 = _c[0],
|
|
19
21
|
setRangeTxt2 = _c[1];
|
|
@@ -35,7 +37,9 @@ var RangeDialog = function RangeDialog() {
|
|
|
35
37
|
showDialog(/*#__PURE__*/React.createElement(ConditionRules, {
|
|
36
38
|
type: rulesType
|
|
37
39
|
}), undefined, locale(context).conditionformat["conditionformat_".concat(rulesType)]);
|
|
40
|
+
return;
|
|
38
41
|
}
|
|
42
|
+
showDialog(/*#__PURE__*/React.createElement(DataVerification, null), undefined, toolbar.dataVerification);
|
|
39
43
|
}, [setContext, showDialog, context]);
|
|
40
44
|
useEffect(function () {
|
|
41
45
|
setRangeTxt2(getDisplayedRangeTxt(context));
|
|
@@ -202,25 +202,5 @@
|
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
.color-picker:hover {
|
|
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 !important;
|
|
216
|
-
padding-left: 0px !important;
|
|
217
|
-
margin-left: 0px !important;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
.color-picker-reset:hover {
|
|
221
|
-
background-color: white;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
.color-picker-icon:hover {
|
|
225
|
-
background-color: white;
|
|
205
|
+
background: hsl(var(--color-bg-default-hover, #F2F4F5));
|
|
226
206
|
}
|
|
@@ -84,14 +84,6 @@ 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]);
|
|
95
87
|
var btn = useCallback(function (type) {
|
|
96
88
|
if (type === "confirm") {
|
|
97
89
|
setContext(function (ctx) {
|
|
@@ -218,7 +210,7 @@ var DataVerification = function DataVerification() {
|
|
|
218
210
|
return /*#__PURE__*/React.createElement("div", {
|
|
219
211
|
id: "fortune-data-verification"
|
|
220
212
|
}, /*#__PURE__*/React.createElement("div", {
|
|
221
|
-
className: "flex flex-col gap-4
|
|
213
|
+
className: "flex flex-col gap-4",
|
|
222
214
|
style: {
|
|
223
215
|
width: "345px",
|
|
224
216
|
padding: "16px"
|
|
@@ -234,19 +226,7 @@ var DataVerification = function DataVerification() {
|
|
|
234
226
|
}),
|
|
235
227
|
"aria-hidden": "true",
|
|
236
228
|
readOnly: true,
|
|
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
|
-
hideDialog();
|
|
247
|
-
dataSelectRange("rangeTxt", context.dataVerification.dataRegulation.value1);
|
|
248
|
-
(_a = document.getElementById("data-verification-button")) === null || _a === void 0 ? void 0 : _a.click();
|
|
249
|
-
}
|
|
229
|
+
value: (_a = context.dataVerification.dataRegulation) === null || _a === void 0 ? void 0 : _a.rangeTxt
|
|
250
230
|
})), /*#__PURE__*/React.createElement("div", {
|
|
251
231
|
className: "flex flex-col"
|
|
252
232
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -291,7 +271,7 @@ var DataVerification = function DataVerification() {
|
|
|
291
271
|
});
|
|
292
272
|
}
|
|
293
273
|
}), /*#__PURE__*/React.createElement("span", {
|
|
294
|
-
className: "ml-2
|
|
274
|
+
className: "ml-2"
|
|
295
275
|
}, 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", {
|
|
296
276
|
className: "mt-4 space-y-2"
|
|
297
277
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -407,7 +387,7 @@ var DataVerification = function DataVerification() {
|
|
|
407
387
|
});
|
|
408
388
|
}
|
|
409
389
|
}), /*#__PURE__*/React.createElement("span", {
|
|
410
|
-
className: "ml-2
|
|
390
|
+
className: "ml-2"
|
|
411
391
|
}, dataVerification[v]));
|
|
412
392
|
}), ((_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, {
|
|
413
393
|
placeholder: dataVerification.placeholder5,
|
|
@@ -419,11 +399,7 @@ var DataVerification = function DataVerification() {
|
|
|
419
399
|
});
|
|
420
400
|
}
|
|
421
401
|
}))))), /*#__PURE__*/React.createElement(Divider, {
|
|
422
|
-
className: "border-t-[1px]"
|
|
423
|
-
style: {
|
|
424
|
-
width: "315px",
|
|
425
|
-
margin: "0 16px 16px 16px"
|
|
426
|
-
}
|
|
402
|
+
className: "w-full border-t-[1px] my-4"
|
|
427
403
|
}), /*#__PURE__*/React.createElement("div", {
|
|
428
404
|
className: "flex gap-2 justify-between items-center",
|
|
429
405
|
style: {
|
|
@@ -447,9 +423,7 @@ var DataVerification = function DataVerification() {
|
|
|
447
423
|
minWidth: "80px"
|
|
448
424
|
},
|
|
449
425
|
onClick: function onClick() {
|
|
450
|
-
var _a;
|
|
451
426
|
btn("confirm");
|
|
452
|
-
(_a = document.getElementById("data-verification-button")) === null || _a === void 0 ? void 0 : _a.click();
|
|
453
427
|
}
|
|
454
428
|
}, button.confirm))));
|
|
455
429
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { colLocation, colLocationByIndex, selectTitlesMap, selectTitlesRange, handleColSizeHandleMouseDown, handleColumnHeaderMouseDown, isAllowEdit, getFlowdata, fixColumnStyleOverflowInFreeze, handleColFreezeHandleMouseDown, getSheetIndex, fixPositionOnFrozenCells
|
|
2
|
-
import { api } from "@fileverse-dev/fortune-core";
|
|
1
|
+
import { colLocation, colLocationByIndex, selectTitlesMap, selectTitlesRange, handleColSizeHandleMouseDown, handleColumnHeaderMouseDown, isAllowEdit, getFlowdata, fixColumnStyleOverflowInFreeze, handleColFreezeHandleMouseDown, getSheetIndex, fixPositionOnFrozenCells } 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";
|
|
@@ -74,13 +73,13 @@ var ColumnHeader = function ColumnHeader() {
|
|
|
74
73
|
}]);
|
|
75
74
|
}, [context, hoverLocation.col_index, refs.globalCache.freezen]);
|
|
76
75
|
var onMouseDown = useCallback(function (e) {
|
|
77
|
-
if (e.button === 0 && e.target.tagName === "use"
|
|
76
|
+
if (e.button === 0 && e.target.tagName === "use") {
|
|
78
77
|
var nativeEvent_1 = e.nativeEvent;
|
|
79
78
|
setContext(function (draft) {
|
|
80
79
|
handleColumnHeaderMouseDown(draft, refs.globalCache, nativeEvent_1, containerRef.current, refs.cellInput.current, refs.fxInput.current);
|
|
81
80
|
});
|
|
82
81
|
}
|
|
83
|
-
if (e.button !== 0
|
|
82
|
+
if (e.button !== 0) return;
|
|
84
83
|
var targetEl = e.target;
|
|
85
84
|
if (targetEl.closest(".fortune-cols-change-size") || targetEl.closest(".fortune-cols-freeze-handle") || targetEl.closest(".header-arrow")) return;
|
|
86
85
|
var headerEl = containerRef.current;
|
|
@@ -155,44 +154,6 @@ var ColumnHeader = function ColumnHeader() {
|
|
|
155
154
|
}
|
|
156
155
|
setSelectedLocation(selects);
|
|
157
156
|
}, [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
|
-
};
|
|
196
157
|
useEffect(function () {
|
|
197
158
|
containerRef.current.scrollLeft = context.scrollLeft;
|
|
198
159
|
}, [context.scrollLeft]);
|
|
@@ -215,51 +176,7 @@ var ColumnHeader = function ColumnHeader() {
|
|
|
215
176
|
};
|
|
216
177
|
});
|
|
217
178
|
}
|
|
218
|
-
},
|
|
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", {
|
|
179
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
263
180
|
className: "fortune-cols-freeze-handle",
|
|
264
181
|
onMouseDown: onColFreezeHandleMouseDown,
|
|
265
182
|
style: {
|
|
@@ -282,7 +199,7 @@ var ColumnHeader = function ColumnHeader() {
|
|
|
282
199
|
display: "block"
|
|
283
200
|
}, fixColumnStyleOverflowInFreeze(context, hoverLocation.col_index, hoverLocation.col_index, (_a = refs.globalCache.freezen) === null || _a === void 0 ? void 0 : _a[context.currentSheetId]))
|
|
284
201
|
}, allowEditRef.current && (/*#__PURE__*/React.createElement("span", {
|
|
285
|
-
className: "header-arrow
|
|
202
|
+
className: "header-arrow",
|
|
286
203
|
onClick: function onClick(e) {
|
|
287
204
|
setContext(function (ctx) {
|
|
288
205
|
ctx.contextMenu = {
|
|
@@ -66,17 +66,6 @@ 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
|
-
};
|
|
80
69
|
useEffect(function () {
|
|
81
70
|
calcuatePopUpPlacement();
|
|
82
71
|
}, []);
|
|
@@ -200,7 +189,7 @@ var FormulaHint = function FormulaHint(props) {
|
|
|
200
189
|
dir: "auto",
|
|
201
190
|
key: name,
|
|
202
191
|
style: {
|
|
203
|
-
backgroundColor: commaCount === i ?
|
|
192
|
+
backgroundColor: commaCount === i ? (fn === null || fn === void 0 ? void 0 : fn.BRAND_SECONDARY_COLOR) || "#FFDF0A" : "transparent"
|
|
204
193
|
}
|
|
205
194
|
}, name, i !== fn.p.length - 1 && ", ");
|
|
206
195
|
})), /*#__PURE__*/React.createElement("code", {
|
|
@@ -376,7 +365,7 @@ var FormulaHint = function FormulaHint(props) {
|
|
|
376
365
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("code", {
|
|
377
366
|
className: "font-family-mono mb-1 mt-2 color-text-default font-family-mono",
|
|
378
367
|
style: {
|
|
379
|
-
backgroundColor: commaCount === index ?
|
|
368
|
+
backgroundColor: commaCount === index ? (fn === null || fn === void 0 ? void 0 : fn.BRAND_SECONDARY_COLOR) || "#FFDF0A" : "transparent"
|
|
380
369
|
}
|
|
381
370
|
}, param.name, param.repeat === "y" && (/*#__PURE__*/React.createElement("span", {
|
|
382
371
|
className: "luckysheet-arguments-help-argument-info example-value",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { rowLocation, rowLocationByIndex, selectTitlesMap, selectTitlesRange, handleContextMenu, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, fixRowStyleOverflowInFreeze, handleRowFreezeHandleMouseDown, getSheetIndex,
|
|
2
|
-
import { api } from "@fileverse-dev/fortune-core";
|
|
1
|
+
import { rowLocation, rowLocationByIndex, selectTitlesMap, selectTitlesRange, handleContextMenu, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, fixRowStyleOverflowInFreeze, handleRowFreezeHandleMouseDown, getSheetIndex, fixPositionOnFrozenCells } 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";
|
|
@@ -68,13 +67,7 @@ var RowHeader = function RowHeader() {
|
|
|
68
67
|
getRowIndexClicked = _f.getRowIndexClicked,
|
|
69
68
|
isRowDoubleClicked = _f.isRowDoubleClicked;
|
|
70
69
|
var onMouseDown = useCallback(function (e) {
|
|
71
|
-
if (e.button
|
|
72
|
-
var nativeEvent_1 = e.nativeEvent;
|
|
73
|
-
setContext(function (draft) {
|
|
74
|
-
handleRowHeaderMouseDown(draft, refs.globalCache, nativeEvent_1, containerRef.current, refs.cellInput.current, refs.fxInput.current);
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
if (e.button !== 0 || context.isFlvReadOnly) return;
|
|
70
|
+
if (e.button !== 0) return;
|
|
78
71
|
var targetEl = e.target;
|
|
79
72
|
if (targetEl.closest(".fortune-rows-change-size") || targetEl.closest(".fortune-rows-freeze-handle")) return;
|
|
80
73
|
var headerEl = containerRef.current;
|
|
@@ -86,9 +79,9 @@ var RowHeader = function RowHeader() {
|
|
|
86
79
|
draft.luckysheet_scroll_status = true;
|
|
87
80
|
});
|
|
88
81
|
} else {
|
|
89
|
-
var
|
|
82
|
+
var nativeEvent_1 = e.nativeEvent;
|
|
90
83
|
setContext(function (draft) {
|
|
91
|
-
handleRowHeaderMouseDown(draft, refs.globalCache,
|
|
84
|
+
handleRowHeaderMouseDown(draft, refs.globalCache, nativeEvent_1, containerRef.current, refs.cellInput.current, refs.fxInput.current);
|
|
92
85
|
});
|
|
93
86
|
return;
|
|
94
87
|
}
|
|
@@ -154,43 +147,6 @@ var RowHeader = function RowHeader() {
|
|
|
154
147
|
}
|
|
155
148
|
setSelectedLocation(selects);
|
|
156
149
|
}, [context.luckysheet_select_save, context.visibledatarow]);
|
|
157
|
-
var _g = useState([]),
|
|
158
|
-
hiddenPointers = _g[0],
|
|
159
|
-
setHiddenPointers = _g[1];
|
|
160
|
-
useEffect(function () {
|
|
161
|
-
var _a, _b;
|
|
162
|
-
if (sheetIndex == null) return;
|
|
163
|
-
var tempPointers = [];
|
|
164
|
-
var rowhidden = (_b = (_a = context.luckysheetfile[sheetIndex]) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.rowhidden;
|
|
165
|
-
if (rowhidden) {
|
|
166
|
-
Object.keys(rowhidden).forEach(function (key) {
|
|
167
|
-
var item = {
|
|
168
|
-
row: key,
|
|
169
|
-
top: context.visibledatarow[Number(key) - 1]
|
|
170
|
-
};
|
|
171
|
-
tempPointers.push(item);
|
|
172
|
-
});
|
|
173
|
-
setHiddenPointers(tempPointers);
|
|
174
|
-
} else {
|
|
175
|
-
setHiddenPointers([]);
|
|
176
|
-
}
|
|
177
|
-
}, [context.visibledatarow, sheetIndex]);
|
|
178
|
-
var showRow = function showRow(e, item) {
|
|
179
|
-
if (context.isFlvReadOnly) return;
|
|
180
|
-
e.stopPropagation();
|
|
181
|
-
setContext(function (ctx) {
|
|
182
|
-
var _a;
|
|
183
|
-
api.setSelection(ctx, [{
|
|
184
|
-
row: [Number(item.row) - 1, Number(item.row) + 1],
|
|
185
|
-
column: [0, (_a = context.visibledatacolumn) === null || _a === void 0 ? void 0 : _a.length]
|
|
186
|
-
}], {
|
|
187
|
-
id: context.currentSheetId
|
|
188
|
-
});
|
|
189
|
-
});
|
|
190
|
-
setContext(function (ctx) {
|
|
191
|
-
showSelected(ctx, "row");
|
|
192
|
-
});
|
|
193
|
-
};
|
|
194
150
|
useEffect(function () {
|
|
195
151
|
containerRef.current.scrollTop = context.scrollTop;
|
|
196
152
|
}, [context.scrollTop]);
|
|
@@ -205,40 +161,7 @@ var RowHeader = function RowHeader() {
|
|
|
205
161
|
onMouseDown: onMouseDown,
|
|
206
162
|
onMouseLeave: onMouseLeave,
|
|
207
163
|
onContextMenu: onContextMenu
|
|
208
|
-
},
|
|
209
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
210
|
-
className: "flex flex-col gap-4 cursor-pointer align-center hide-btn-row hide-btn",
|
|
211
|
-
style: {
|
|
212
|
-
top: "".concat(item.top - 16, "px"),
|
|
213
|
-
zIndex: 100
|
|
214
|
-
},
|
|
215
|
-
onClick: function onClick(e) {
|
|
216
|
-
return showRow(e, item);
|
|
217
|
-
}
|
|
218
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
219
|
-
className: "rotate-row-icon"
|
|
220
|
-
}, /*#__PURE__*/React.createElement("svg", {
|
|
221
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
222
|
-
width: "5",
|
|
223
|
-
height: "8",
|
|
224
|
-
viewBox: "0 0 5 8",
|
|
225
|
-
fill: "none"
|
|
226
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
227
|
-
d: "M0.164574 4.20629L3.54376 7.58548C3.7275 7.76922 4.04167 7.63909 4.04167 7.37924L4.04167 0.620865C4.04167 0.361018 3.7275 0.230885 3.54376 0.414625L0.164575 3.79381C0.0506717 3.90772 0.0506715 4.09239 0.164574 4.20629Z",
|
|
228
|
-
fill: "#363B3F"
|
|
229
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
230
|
-
className: "rotate-90"
|
|
231
|
-
}, /*#__PURE__*/React.createElement("svg", {
|
|
232
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
233
|
-
width: "5",
|
|
234
|
-
height: "8",
|
|
235
|
-
viewBox: "0 0 5 8",
|
|
236
|
-
fill: "none"
|
|
237
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
238
|
-
d: "M0.164574 4.20629L3.54376 7.58548C3.7275 7.76922 4.04167 7.63909 4.04167 7.37924L4.04167 0.620865C4.04167 0.361018 3.7275 0.230885 3.54376 0.414625L0.164575 3.79381C0.0506717 3.90772 0.0506715 4.09239 0.164574 4.20629Z",
|
|
239
|
-
fill: "#363B3F"
|
|
240
|
-
}))));
|
|
241
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
164
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
242
165
|
className: "fortune-rows-freeze-handle",
|
|
243
166
|
onMouseDown: onRowFreezeHandleMouseDown,
|
|
244
167
|
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
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Cell } from "@fileverse-dev/fortune-core";
|
|
3
3
|
import "./index.css";
|
|
4
|
-
export declare const getLucideIcon: (title: string) => "Ethereum" | "DollarSign" | "" | "ChevronDown" | "Undo" | "Redo" | "
|
|
4
|
+
export declare const getLucideIcon: (title: string) => "Ethereum" | "DollarSign" | "" | "ChevronDown" | "Undo" | "Redo" | "Underline" | "Border" | "Filter" | "Link" | "Search" | "Percent" | "PaintRoller" | "Bold" | "Italic" | "Strikethrough" | "AlignLeft" | "AlignCenter" | "AlignRight" | "ArrowUpFromLine" | "AlignVerticalMiddle" | "ArrowDownToLine" | "TextOverflow" | "WrapText" | "TextClip" | "Baseline" | "PaintBucket" | "MergeHorizontal" | "DecimalsArrowLeft" | "DecimalsArrowRight" | "PaintbrushVertical" | "MessageSquarePlus" | "Image" | "Sigma" | "ShieldCheck" | "DuneChart" | "Ellipsis";
|
|
5
5
|
export declare const CurrencySelector: ({ cell, defaultTextFormat, toolTipText, }: {
|
|
6
6
|
cell: Cell | null | undefined;
|
|
7
7
|
defaultTextFormat: string;
|