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