@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
|
@@ -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,8 +22,7 @@ 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];
|
|
@@ -46,9 +44,7 @@ var RangeDialog = function RangeDialog() {
|
|
|
46
44
|
showDialog(/*#__PURE__*/_react.default.createElement(_ConditionRules.default, {
|
|
47
45
|
type: rulesType
|
|
48
46
|
}), undefined, (0, _fortuneCore.locale)(context).conditionformat["conditionformat_".concat(rulesType)]);
|
|
49
|
-
return;
|
|
50
47
|
}
|
|
51
|
-
showDialog(/*#__PURE__*/_react.default.createElement(_.default, null), undefined, toolbar.dataVerification);
|
|
52
48
|
}, [setContext, showDialog, context]);
|
|
53
49
|
(0, _react.useEffect)(function () {
|
|
54
50
|
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 = {
|
|
@@ -232,13 +314,12 @@ var ColumnHeader = function ColumnHeader() {
|
|
|
232
314
|
c1 = _a.c1,
|
|
233
315
|
c2 = _a.c2;
|
|
234
316
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
235
|
-
className: "fortune-col-header-selected",
|
|
317
|
+
className: "fortune-col-header-selected color-bg-tertiary",
|
|
236
318
|
key: i,
|
|
237
319
|
style: _lodash.default.assign({
|
|
238
320
|
left: col_pre,
|
|
239
321
|
width: col - col_pre - 1,
|
|
240
322
|
display: "block",
|
|
241
|
-
backgroundColor: "#EFC703",
|
|
242
323
|
mixBlendMode: "multiply"
|
|
243
324
|
}, (0, _fortuneCore.fixColumnStyleOverflowInFreeze)(context, c1, c2, (_b = refs.globalCache.freezen) === null || _b === void 0 ? void 0 : _b[context.currentSheetId]))
|
|
244
325
|
});
|
|
@@ -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",
|
|
@@ -62,7 +62,7 @@ var FormulaSearch = function FormulaSearch(props) {
|
|
|
62
62
|
});
|
|
63
63
|
if (_lodash.default.isEmpty(context.functionCandidates) && _lodash.default.isEmpty(context.defaultCandidates)) return null;
|
|
64
64
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
65
|
-
className: "flex flex-col luckysheet-formula-search-c-p custom-scroll",
|
|
65
|
+
className: "flex color-border-default border flex-col luckysheet-formula-search-c-p custom-scroll",
|
|
66
66
|
id: "luckysheet-formula-search-c-p",
|
|
67
67
|
style: {
|
|
68
68
|
top: top
|
|
@@ -76,7 +76,13 @@ var RowHeader = function RowHeader() {
|
|
|
76
76
|
getRowIndexClicked = _f.getRowIndexClicked,
|
|
77
77
|
isRowDoubleClicked = _f.isRowDoubleClicked;
|
|
78
78
|
var onMouseDown = (0, _react.useCallback)(function (e) {
|
|
79
|
-
if (e.button
|
|
79
|
+
if (e.button === 0 && e.target.tagName === "use" || e.button === 2) {
|
|
80
|
+
var nativeEvent_1 = e.nativeEvent;
|
|
81
|
+
setContext(function (draft) {
|
|
82
|
+
(0, _fortuneCore.handleRowHeaderMouseDown)(draft, refs.globalCache, nativeEvent_1, containerRef.current, refs.cellInput.current, refs.fxInput.current);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
if (e.button !== 0 || context.isFlvReadOnly) return;
|
|
80
86
|
var targetEl = e.target;
|
|
81
87
|
if (targetEl.closest(".fortune-rows-change-size") || targetEl.closest(".fortune-rows-freeze-handle")) return;
|
|
82
88
|
var headerEl = containerRef.current;
|
|
@@ -88,9 +94,9 @@ var RowHeader = function RowHeader() {
|
|
|
88
94
|
draft.luckysheet_scroll_status = true;
|
|
89
95
|
});
|
|
90
96
|
} else {
|
|
91
|
-
var
|
|
97
|
+
var nativeEvent_2 = e.nativeEvent;
|
|
92
98
|
setContext(function (draft) {
|
|
93
|
-
(0, _fortuneCore.handleRowHeaderMouseDown)(draft, refs.globalCache,
|
|
99
|
+
(0, _fortuneCore.handleRowHeaderMouseDown)(draft, refs.globalCache, nativeEvent_2, containerRef.current, refs.cellInput.current, refs.fxInput.current);
|
|
94
100
|
});
|
|
95
101
|
return;
|
|
96
102
|
}
|
|
@@ -156,6 +162,43 @@ var RowHeader = function RowHeader() {
|
|
|
156
162
|
}
|
|
157
163
|
setSelectedLocation(selects);
|
|
158
164
|
}, [context.luckysheet_select_save, context.visibledatarow]);
|
|
165
|
+
var _g = (0, _react.useState)([]),
|
|
166
|
+
hiddenPointers = _g[0],
|
|
167
|
+
setHiddenPointers = _g[1];
|
|
168
|
+
(0, _react.useEffect)(function () {
|
|
169
|
+
var _a, _b;
|
|
170
|
+
if (sheetIndex == null) return;
|
|
171
|
+
var tempPointers = [];
|
|
172
|
+
var rowhidden = (_b = (_a = context.luckysheetfile[sheetIndex]) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.rowhidden;
|
|
173
|
+
if (rowhidden) {
|
|
174
|
+
Object.keys(rowhidden).forEach(function (key) {
|
|
175
|
+
var item = {
|
|
176
|
+
row: key,
|
|
177
|
+
top: context.visibledatarow[Number(key) - 1]
|
|
178
|
+
};
|
|
179
|
+
tempPointers.push(item);
|
|
180
|
+
});
|
|
181
|
+
setHiddenPointers(tempPointers);
|
|
182
|
+
} else {
|
|
183
|
+
setHiddenPointers([]);
|
|
184
|
+
}
|
|
185
|
+
}, [context.visibledatarow, sheetIndex]);
|
|
186
|
+
var showRow = function showRow(e, item) {
|
|
187
|
+
if (context.isFlvReadOnly) return;
|
|
188
|
+
e.stopPropagation();
|
|
189
|
+
setContext(function (ctx) {
|
|
190
|
+
var _a;
|
|
191
|
+
_fortuneCore.api.setSelection(ctx, [{
|
|
192
|
+
row: [Number(item.row) - 1, Number(item.row) + 1],
|
|
193
|
+
column: [0, (_a = context.visibledatacolumn) === null || _a === void 0 ? void 0 : _a.length]
|
|
194
|
+
}], {
|
|
195
|
+
id: context.currentSheetId
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
setContext(function (ctx) {
|
|
199
|
+
(0, _fortuneCore.showSelected)(ctx, "row");
|
|
200
|
+
});
|
|
201
|
+
};
|
|
159
202
|
(0, _react.useEffect)(function () {
|
|
160
203
|
containerRef.current.scrollTop = context.scrollTop;
|
|
161
204
|
}, [context.scrollTop]);
|
|
@@ -170,7 +213,40 @@ var RowHeader = function RowHeader() {
|
|
|
170
213
|
onMouseDown: onMouseDown,
|
|
171
214
|
onMouseLeave: onMouseLeave,
|
|
172
215
|
onContextMenu: onContextMenu
|
|
173
|
-
},
|
|
216
|
+
}, hiddenPointers.map(function (item) {
|
|
217
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
218
|
+
className: "flex flex-col gap-4 cursor-pointer align-center hide-btn-row hide-btn",
|
|
219
|
+
style: {
|
|
220
|
+
top: "".concat(item.top - 16, "px"),
|
|
221
|
+
zIndex: 100
|
|
222
|
+
},
|
|
223
|
+
onClick: function onClick(e) {
|
|
224
|
+
return showRow(e, item);
|
|
225
|
+
}
|
|
226
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
227
|
+
className: "rotate-row-icon"
|
|
228
|
+
}, /*#__PURE__*/_react.default.createElement("svg", {
|
|
229
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
230
|
+
width: "5",
|
|
231
|
+
height: "8",
|
|
232
|
+
viewBox: "0 0 5 8",
|
|
233
|
+
fill: "none"
|
|
234
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
235
|
+
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",
|
|
236
|
+
fill: "#363B3F"
|
|
237
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
238
|
+
className: "rotate-90"
|
|
239
|
+
}, /*#__PURE__*/_react.default.createElement("svg", {
|
|
240
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
241
|
+
width: "5",
|
|
242
|
+
height: "8",
|
|
243
|
+
viewBox: "0 0 5 8",
|
|
244
|
+
fill: "none"
|
|
245
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
246
|
+
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",
|
|
247
|
+
fill: "#363B3F"
|
|
248
|
+
}))));
|
|
249
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
174
250
|
className: "fortune-rows-freeze-handle",
|
|
175
251
|
onMouseDown: onRowFreezeHandleMouseDown,
|
|
176
252
|
style: {
|
|
@@ -198,13 +274,12 @@ var RowHeader = function RowHeader() {
|
|
|
198
274
|
r1 = _a.r1,
|
|
199
275
|
r2 = _a.r2;
|
|
200
276
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
201
|
-
className: "fortune-row-header-selected",
|
|
277
|
+
className: "fortune-row-header-selected color-bg-tertiary",
|
|
202
278
|
key: i,
|
|
203
279
|
style: _lodash.default.assign({
|
|
204
280
|
top: row_pre,
|
|
205
281
|
height: row - row_pre - 1,
|
|
206
282
|
display: "block",
|
|
207
|
-
backgroundColor: "#EFC703",
|
|
208
283
|
mixBlendMode: "multiply"
|
|
209
284
|
}, (0, _fortuneCore.fixRowStyleOverflowInFreeze)(context, r1, r2, (_b = refs.globalCache.freezen) === null || _b === void 0 ? void 0 : _b[context.currentSheetId]))
|
|
210
285
|
});
|
|
@@ -45,12 +45,10 @@
|
|
|
45
45
|
.fortune-row-header-selected {
|
|
46
46
|
position: absolute;
|
|
47
47
|
z-index: 10;
|
|
48
|
-
border-right: 1px solid #0188fb;
|
|
49
48
|
right: 0;
|
|
50
49
|
width: 100%;
|
|
51
50
|
margin-top: 2px;
|
|
52
51
|
display: none;
|
|
53
|
-
background-color: rgba(76, 76, 76, 0.1);
|
|
54
52
|
}
|
|
55
53
|
|
|
56
54
|
.fortune-col-header-wrap {
|
|
@@ -94,12 +92,10 @@
|
|
|
94
92
|
cursor: default;
|
|
95
93
|
position: absolute;
|
|
96
94
|
z-index: 10;
|
|
97
|
-
border-bottom: 1px solid #0188fb;
|
|
98
95
|
bottom: 0;
|
|
99
96
|
height: 100%;
|
|
100
97
|
margin-left: 0px;
|
|
101
98
|
display: none;
|
|
102
|
-
background-color: rgba(76, 76, 76, 0.1);
|
|
103
99
|
}
|
|
104
100
|
|
|
105
101
|
.fortune-left-top {
|
|
@@ -137,7 +133,7 @@
|
|
|
137
133
|
z-index: 14;
|
|
138
134
|
/*border:1px solid #fff;*/
|
|
139
135
|
margin: 0px 0 0 0px;
|
|
140
|
-
background: rgba(0, 80, 208, 0.15);
|
|
136
|
+
/* background: rgba(0, 80, 208, 0.15); */
|
|
141
137
|
display: none;
|
|
142
138
|
}
|
|
143
139
|
|
|
@@ -199,7 +195,7 @@
|
|
|
199
195
|
z-index: 15;
|
|
200
196
|
border: 2.5px solid #efc703;
|
|
201
197
|
margin: -1px 0 0 -1px;
|
|
202
|
-
background: rgba(
|
|
198
|
+
background: rgba(239, 199, 5, 0.02);
|
|
203
199
|
display: none;
|
|
204
200
|
box-sizing: content-box;
|
|
205
201
|
}
|
|
@@ -1010,4 +1006,27 @@
|
|
|
1010
1006
|
background: #555;
|
|
1011
1007
|
/* darker on hover */
|
|
1012
1008
|
/* scrollbar */
|
|
1013
|
-
}
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
.hide-btn {
|
|
1012
|
+
padding-top: 1px;
|
|
1013
|
+
position: absolute;
|
|
1014
|
+
right: 5;
|
|
1015
|
+
top: 5px;
|
|
1016
|
+
z-index: 200;
|
|
1017
|
+
width: 9px;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
.hide-btn:hover {
|
|
1021
|
+
border: 1px solid #0188fb;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
.rotate-row-icon {
|
|
1025
|
+
transform: rotate(-90deg);
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
.hide-btn-row {
|
|
1029
|
+
position: absolute;
|
|
1030
|
+
left: 4px;
|
|
1031
|
+
z-index: 200;
|
|
1032
|
+
}
|
|
@@ -58,7 +58,10 @@ var Combo = function Combo(_a) {
|
|
|
58
58
|
height: 16
|
|
59
59
|
})) : (/*#__PURE__*/_react.default.createElement("span", {
|
|
60
60
|
className: "fortune-toolbar-combo-text"
|
|
61
|
-
}, text !== undefined ? text : ""))
|
|
61
|
+
}, text !== undefined ? text : "")), /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
|
|
62
|
+
className: "w-[16px] h-[16px]",
|
|
63
|
+
name: "ChevronDown"
|
|
64
|
+
})))) : (/*#__PURE__*/_react.default.createElement("span", null, iconId === "font-color" ? (/*#__PURE__*/_react.default.createElement(_ui.Tooltip, {
|
|
62
65
|
text: tooltip,
|
|
63
66
|
placement: "bottom"
|
|
64
67
|
}, /*#__PURE__*/_react.default.createElement(_ui.Button, {
|
|
@@ -141,12 +141,24 @@
|
|
|
141
141
|
|
|
142
142
|
.fortune-toolbar-combo-button {
|
|
143
143
|
font-size: 12px;
|
|
144
|
+
padding-top: 4px;
|
|
145
|
+
padding-bottom: 4px;
|
|
146
|
+
padding-left: 8px;
|
|
147
|
+
padding-right: 8px;
|
|
148
|
+
border-radius: 4px;
|
|
149
|
+
gap: 8px;
|
|
150
|
+
}
|
|
151
|
+
.fortune-toolbar-combo-button:hover {
|
|
152
|
+
background: hsl(var(--color-bg-default-hover));
|
|
144
153
|
}
|
|
145
154
|
|
|
146
155
|
.fortune-toolbar-select-option {
|
|
147
156
|
font-size: 12px;
|
|
148
157
|
min-width: 60px;
|
|
149
|
-
padding: 8px;
|
|
158
|
+
padding-left: 8px;
|
|
159
|
+
padding-right: 8px;
|
|
160
|
+
padding-top: 6px;
|
|
161
|
+
padding-bottom: 6px;
|
|
150
162
|
cursor: pointer;
|
|
151
163
|
user-select: none;
|
|
152
164
|
}
|
|
@@ -171,6 +183,10 @@
|
|
|
171
183
|
font-weight: 500;
|
|
172
184
|
font-size: 14px;
|
|
173
185
|
line-height: 20px;
|
|
186
|
+
max-width: 56px;
|
|
187
|
+
overflow: hidden;
|
|
188
|
+
text-overflow: ellipsis;
|
|
189
|
+
white-space: nowrap;
|
|
174
190
|
}
|
|
175
191
|
|
|
176
192
|
.fortune-toolbar-color-picker-item {
|
|
@@ -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" | "PaintRoller" | "Bold" | "Italic" | "Strikethrough" | "Underline" | "AlignLeft" | "AlignCenter" | "AlignRight" | "ArrowUpFromLine" | "AlignVerticalMiddle" | "ArrowDownToLine" | "TextOverflow" | "WrapText" | "TextClip" | "Baseline" | "PaintBucket" | "Border" | "MergeHorizontal" | "Percent" | "DecimalsArrowLeft" | "DecimalsArrowRight" | "PaintbrushVertical" | "Filter" | "Link" | "MessageSquarePlus" | "Image" | "Sigma" | "ShieldCheck" | "Search" | "DuneChart" | "Ellipsis";
|
|
5
5
|
export declare const CurrencySelector: ({ cell, defaultTextFormat, toolTipText, }: {
|
|
6
6
|
cell: Cell | null | undefined;
|
|
7
7
|
defaultTextFormat: string;
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.getLucideIcon = exports.default = exports.CurrencySelector = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _fortuneCore = require("@fileverse-dev/fortune-core");
|
|
10
|
-
var _api = require("@fileverse-dev/fortune-core/src/api");
|
|
11
10
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
12
11
|
var _ui = require("@fileverse/ui");
|
|
13
12
|
var _dataVerificationPortal = _interopRequireDefault(require("./dataVerificationPortal"));
|
|
@@ -594,9 +593,35 @@ var Toolbar = function Toolbar(_a) {
|
|
|
594
593
|
}
|
|
595
594
|
}
|
|
596
595
|
}, [itemLocations, setMoreItems, settings.toolbarItems.length, sheetWidth, isDesktop]);
|
|
596
|
+
(0, _react.useEffect)(function () {
|
|
597
|
+
setContext(function (ctx) {
|
|
598
|
+
ctx.dataVerification.dataRegulation.value1 = "value1";
|
|
599
|
+
});
|
|
600
|
+
}, []);
|
|
597
601
|
var _o = (0, _react.useState)(false),
|
|
598
602
|
showDataValidation = _o[0],
|
|
599
603
|
setShowDataValidation = _o[1];
|
|
604
|
+
var dataVerificationClick = function dataVerificationClick() {
|
|
605
|
+
var _a;
|
|
606
|
+
var selection = _fortuneCore.api.getSelection(context);
|
|
607
|
+
if (!selection) {
|
|
608
|
+
setContext(function (ctx) {
|
|
609
|
+
_fortuneCore.api.setSelection(ctx, [{
|
|
610
|
+
row: [0, 0],
|
|
611
|
+
column: [0, 0]
|
|
612
|
+
}], {
|
|
613
|
+
id: context.currentSheetId
|
|
614
|
+
});
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
(_a = document.getElementById("data-verification-button")) === null || _a === void 0 ? void 0 : _a.click();
|
|
618
|
+
setTimeout(function () {
|
|
619
|
+
setShowDataValidation(true);
|
|
620
|
+
}, 100);
|
|
621
|
+
};
|
|
622
|
+
(0, _react.useEffect)(function () {
|
|
623
|
+
window.dataVerificationClick = dataVerificationClick;
|
|
624
|
+
}, []);
|
|
600
625
|
var getToolbarItem = (0, _react.useCallback)(function (name, i) {
|
|
601
626
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
602
627
|
var tooltip = toolbar[name];
|
|
@@ -979,24 +1004,7 @@ var Toolbar = function Toolbar(_a) {
|
|
|
979
1004
|
iconId: name,
|
|
980
1005
|
tooltip: tooltip,
|
|
981
1006
|
key: name,
|
|
982
|
-
onClick:
|
|
983
|
-
var _a;
|
|
984
|
-
var selection = (0, _api.getSelection)(context);
|
|
985
|
-
if (!selection) {
|
|
986
|
-
setContext(function (ctx) {
|
|
987
|
-
(0, _api.setSelection)(ctx, [{
|
|
988
|
-
row: [0, 0],
|
|
989
|
-
column: [0, 0]
|
|
990
|
-
}], {
|
|
991
|
-
id: context.currentSheetId
|
|
992
|
-
});
|
|
993
|
-
});
|
|
994
|
-
}
|
|
995
|
-
(_a = document.getElementById("data-verification-button")) === null || _a === void 0 ? void 0 : _a.click();
|
|
996
|
-
setTimeout(function () {
|
|
997
|
-
setShowDataValidation(true);
|
|
998
|
-
}, 100);
|
|
999
|
-
}
|
|
1007
|
+
onClick: dataVerificationClick
|
|
1000
1008
|
}));
|
|
1001
1009
|
}
|
|
1002
1010
|
if (name === "locationCondition") {
|