@fileverse-dev/fortune-react 1.0.2-mod-12 → 1.0.2-mod-10-test
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/dist/components/Workbook/api.d.ts +2 -6
- package/dist/components/Workbook/index.d.ts +2 -6
- package/dist/index.css +1 -26
- package/dist/index.esm.css +1 -26
- package/dist/index.esm.js +108 -230
- package/dist/index.js +107 -229
- package/dist/index.umd.css +1 -26
- package/dist/index.umd.js +810 -312
- package/dist/index.umd.min.css +1 -1
- package/dist/index.umd.min.js +2 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -640,7 +640,7 @@ var ColumnHeader = function ColumnHeader() {
|
|
|
640
640
|
className: "fortune-cols-freeze-handle",
|
|
641
641
|
onMouseDown: onColFreezeHandleMouseDown,
|
|
642
642
|
style: {
|
|
643
|
-
left: freezeHandleLeft
|
|
643
|
+
left: freezeHandleLeft
|
|
644
644
|
}
|
|
645
645
|
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
646
646
|
className: "fortune-cols-change-size",
|
|
@@ -843,7 +843,7 @@ var RowHeader = function RowHeader() {
|
|
|
843
843
|
className: "fortune-rows-freeze-handle",
|
|
844
844
|
onMouseDown: onRowFreezeHandleMouseDown,
|
|
845
845
|
style: {
|
|
846
|
-
top: freezeHandleTop
|
|
846
|
+
top: freezeHandleTop
|
|
847
847
|
}
|
|
848
848
|
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
849
849
|
className: "fortune-rows-change-size",
|
|
@@ -1250,7 +1250,7 @@ var InputBox = function InputBox() {
|
|
|
1250
1250
|
}
|
|
1251
1251
|
e.preventDefault();
|
|
1252
1252
|
}
|
|
1253
|
-
}, [clearSearchItemActiveClass, context.luckysheetCellUpdate.length, selectActiveFormula, setContext]);
|
|
1253
|
+
}, [clearSearchItemActiveClass, context.luckysheetCellUpdate.length, selectActiveFormula, setContext, firstSelection]);
|
|
1254
1254
|
var onChange = React.useCallback(function (__, isBlur) {
|
|
1255
1255
|
var e = lastKeyDownEventRef.current;
|
|
1256
1256
|
if (!e) return;
|
|
@@ -1296,8 +1296,8 @@ var InputBox = function InputBox() {
|
|
|
1296
1296
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1297
1297
|
className: "luckysheet-input-box-inner",
|
|
1298
1298
|
style: firstSelection ? _objectSpread2({
|
|
1299
|
-
minWidth:
|
|
1300
|
-
minHeight:
|
|
1299
|
+
minWidth: firstSelection.width,
|
|
1300
|
+
minHeight: firstSelection.height
|
|
1301
1301
|
}, inputBoxStyle) : {}
|
|
1302
1302
|
}, /*#__PURE__*/React__default['default'].createElement(ContentEditable, {
|
|
1303
1303
|
innerRef: function innerRef(e) {
|
|
@@ -1312,6 +1312,7 @@ var InputBox = function InputBox() {
|
|
|
1312
1312
|
width: "".concat(100 / context.zoomRatio, "%"),
|
|
1313
1313
|
height: "".concat(100 / context.zoomRatio, "%")
|
|
1314
1314
|
},
|
|
1315
|
+
"aria-autocomplete": "list",
|
|
1315
1316
|
onChange: onChange,
|
|
1316
1317
|
onKeyDown: onKeyDown,
|
|
1317
1318
|
onPaste: onPaste,
|
|
@@ -2580,7 +2581,7 @@ var DataVerification = function DataVerification() {
|
|
|
2580
2581
|
setContext(function (ctx) {
|
|
2581
2582
|
var isPass = fortuneCore.confirmMessage(ctx, generalDialog, dataVerification);
|
|
2582
2583
|
if (isPass) {
|
|
2583
|
-
var _ctx$dataVerification, _ctx$dataVerification2, _ctx$luckysheetfile$g
|
|
2584
|
+
var _ctx$dataVerification, _ctx$dataVerification2, _ctx$luckysheetfile$g;
|
|
2584
2585
|
var range = fortuneCore.getRangeByTxt(ctx, (_ctx$dataVerification = ctx.dataVerification) === null || _ctx$dataVerification === void 0 ? void 0 : (_ctx$dataVerification2 = _ctx$dataVerification.dataRegulation) === null || _ctx$dataVerification2 === void 0 ? void 0 : _ctx$dataVerification2.rangeTxt);
|
|
2585
2586
|
if (range.length === 0) {
|
|
2586
2587
|
return;
|
|
@@ -2596,12 +2597,12 @@ var DataVerification = function DataVerification() {
|
|
|
2596
2597
|
item.value1 = list.join(",");
|
|
2597
2598
|
}
|
|
2598
2599
|
var currentDataVerification = (_ctx$luckysheetfile$g = ctx.luckysheetfile[fortuneCore.getSheetIndex(ctx, ctx.currentSheetId)].dataVerification) !== null && _ctx$luckysheetfile$g !== void 0 ? _ctx$luckysheetfile$g : {};
|
|
2599
|
-
var str =
|
|
2600
|
-
var edr =
|
|
2601
|
-
var stc =
|
|
2602
|
-
var edc =
|
|
2600
|
+
var str = range[range.length - 1].row[0];
|
|
2601
|
+
var edr = range[range.length - 1].row[1];
|
|
2602
|
+
var stc = range[range.length - 1].column[0];
|
|
2603
|
+
var edc = range[range.length - 1].column[1];
|
|
2603
2604
|
var d = fortuneCore.getFlowdata(ctx);
|
|
2604
|
-
if (!d
|
|
2605
|
+
if (!d) return;
|
|
2605
2606
|
for (var r = str; r <= edr; r += 1) {
|
|
2606
2607
|
for (var c = stc; c <= edc; c += 1) {
|
|
2607
2608
|
var key = "".concat(r, "_").concat(c);
|
|
@@ -2616,18 +2617,17 @@ var DataVerification = function DataVerification() {
|
|
|
2616
2617
|
});
|
|
2617
2618
|
} else if (type === "delete") {
|
|
2618
2619
|
setContext(function (ctx) {
|
|
2619
|
-
var _ctx$dataVerification3, _ctx$dataVerification4, _ctx$luckysheetfile$g2
|
|
2620
|
+
var _ctx$dataVerification3, _ctx$dataVerification4, _ctx$luckysheetfile$g2;
|
|
2620
2621
|
var range = fortuneCore.getRangeByTxt(ctx, (_ctx$dataVerification3 = ctx.dataVerification) === null || _ctx$dataVerification3 === void 0 ? void 0 : (_ctx$dataVerification4 = _ctx$dataVerification3.dataRegulation) === null || _ctx$dataVerification4 === void 0 ? void 0 : _ctx$dataVerification4.rangeTxt);
|
|
2621
2622
|
if (range.length === 0) {
|
|
2622
2623
|
showDialog(generalDialog.noSeletionError, "ok");
|
|
2623
2624
|
return;
|
|
2624
2625
|
}
|
|
2625
2626
|
var currentDataVerification = (_ctx$luckysheetfile$g2 = ctx.luckysheetfile[fortuneCore.getSheetIndex(ctx, ctx.currentSheetId)].dataVerification) !== null && _ctx$luckysheetfile$g2 !== void 0 ? _ctx$luckysheetfile$g2 : {};
|
|
2626
|
-
var str =
|
|
2627
|
-
var edr =
|
|
2628
|
-
var stc =
|
|
2629
|
-
var edc =
|
|
2630
|
-
if (___default['default'].isNil(str) || ___default['default'].isNil(stc) || ___default['default'].isNil(edr) || ___default['default'].isNil(edc)) return;
|
|
2627
|
+
var str = range[range.length - 1].row[0];
|
|
2628
|
+
var edr = range[range.length - 1].row[1];
|
|
2629
|
+
var stc = range[range.length - 1].column[0];
|
|
2630
|
+
var edc = range[range.length - 1].column[1];
|
|
2631
2631
|
for (var r = str; r <= edr; r += 1) {
|
|
2632
2632
|
for (var c = stc; c <= edc; c += 1) {
|
|
2633
2633
|
delete currentDataVerification["".concat(r, "_").concat(c)];
|
|
@@ -2639,41 +2639,56 @@ var DataVerification = function DataVerification() {
|
|
|
2639
2639
|
}, [dataVerification, generalDialog, hideDialog, setContext, showDialog]);
|
|
2640
2640
|
React.useEffect(function () {
|
|
2641
2641
|
setContext(function (ctx) {
|
|
2642
|
-
var _defaultItem$value, _ctx$rangeDialog, _ctx$rangeDialog2;
|
|
2643
2642
|
var rangeT = "";
|
|
2644
2643
|
if (ctx.luckysheet_select_save) {
|
|
2645
2644
|
var range = ctx.luckysheet_select_save[ctx.luckysheet_select_save.length - 1];
|
|
2646
2645
|
rangeT = fortuneCore.getRangetxt(context, context.currentSheetId, range, context.currentSheetId);
|
|
2647
2646
|
}
|
|
2648
2647
|
var index = fortuneCore.getSheetIndex(ctx, ctx.currentSheetId);
|
|
2649
|
-
var ctxDataVerification = ctx.luckysheetfile[index].dataVerification
|
|
2650
|
-
if (
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
ctx.
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2648
|
+
var ctxDataVerification = ctx.luckysheetfile[index].dataVerification;
|
|
2649
|
+
if (ctxDataVerification) {
|
|
2650
|
+
var _defaultItem$value, _ctx$rangeDialog, _ctx$rangeDialog2;
|
|
2651
|
+
if (!ctx.luckysheet_select_save) return;
|
|
2652
|
+
var last = ctx.luckysheet_select_save[ctx.luckysheet_select_save.length - 1];
|
|
2653
|
+
var rowIndex = last.row_focus;
|
|
2654
|
+
var colIndex = last.column_focus;
|
|
2655
|
+
if (rowIndex == null || colIndex == null) return;
|
|
2656
|
+
var item = ctxDataVerification["".concat(rowIndex, "_").concat(colIndex)];
|
|
2657
|
+
var defaultItem = item !== null && item !== void 0 ? item : {};
|
|
2658
|
+
var rangValue = (_defaultItem$value = defaultItem.value1) !== null && _defaultItem$value !== void 0 ? _defaultItem$value : "";
|
|
2659
|
+
if (((_ctx$rangeDialog = ctx.rangeDialog) === null || _ctx$rangeDialog === void 0 ? void 0 : _ctx$rangeDialog.type) === "dropDown" && ctx.dataVerification && ctx.dataVerification.dataRegulation && ctx.dataVerification.dataRegulation.rangeTxt) {
|
|
2660
|
+
rangeT = ctx.dataVerification.dataRegulation.rangeTxt;
|
|
2661
|
+
rangValue = ctx.rangeDialog.rangeTxt;
|
|
2662
|
+
} else if (((_ctx$rangeDialog2 = ctx.rangeDialog) === null || _ctx$rangeDialog2 === void 0 ? void 0 : _ctx$rangeDialog2.type) === "rangeTxt" && ctx.dataVerification && ctx.dataVerification.dataRegulation && ctx.dataVerification.dataRegulation.value1) {
|
|
2663
|
+
rangValue = ctx.dataVerification.dataRegulation.value1;
|
|
2664
|
+
rangeT = ctx.rangeDialog.rangeTxt;
|
|
2665
|
+
}
|
|
2666
|
+
ctx.rangeDialog.type = "";
|
|
2667
|
+
if (item) {
|
|
2668
|
+
ctx.dataVerification.dataRegulation = _objectSpread2(_objectSpread2({}, item), {}, {
|
|
2669
|
+
value1: rangValue,
|
|
2670
|
+
rangeTxt: rangeT
|
|
2671
|
+
});
|
|
2672
|
+
} else {
|
|
2673
|
+
ctx.dataVerification.dataRegulation = {
|
|
2674
|
+
type: "dropdown",
|
|
2675
|
+
type2: "",
|
|
2676
|
+
rangeTxt: rangeT,
|
|
2677
|
+
value1: rangValue,
|
|
2678
|
+
value2: "",
|
|
2679
|
+
validity: "",
|
|
2680
|
+
remote: false,
|
|
2681
|
+
prohibitInput: false,
|
|
2682
|
+
hintShow: false,
|
|
2683
|
+
hintValue: ""
|
|
2684
|
+
};
|
|
2685
|
+
}
|
|
2671
2686
|
} else {
|
|
2672
2687
|
ctx.dataVerification.dataRegulation = {
|
|
2673
2688
|
type: "dropdown",
|
|
2674
2689
|
type2: "",
|
|
2675
2690
|
rangeTxt: rangeT,
|
|
2676
|
-
value1:
|
|
2691
|
+
value1: "",
|
|
2677
2692
|
value2: "",
|
|
2678
2693
|
validity: "",
|
|
2679
2694
|
remote: false,
|
|
@@ -3517,7 +3532,7 @@ var DropDownList = function DropDownList() {
|
|
|
3517
3532
|
};
|
|
3518
3533
|
|
|
3519
3534
|
var SheetOverlay = function SheetOverlay() {
|
|
3520
|
-
var _refs$cellArea$curren, _refs$cellArea$curren2, _context$
|
|
3535
|
+
var _refs$cellArea$curren, _refs$cellArea$curren2, _context$luckysheet_s, _context$luckysheet_s2, _context$luckysheet_s3, _context$luckysheet_s4, _context$luckysheet_s5, _context$luckysheet_s6, _context$presences$le, _context$presences, _context$linkCard, _context$rangeDialog;
|
|
3521
3536
|
var _useContext = React.useContext(WorkbookContext),
|
|
3522
3537
|
context = _useContext.context,
|
|
3523
3538
|
setContext = _useContext.setContext,
|
|
@@ -3531,14 +3546,6 @@ var SheetOverlay = function SheetOverlay() {
|
|
|
3531
3546
|
var containerRef = React.useRef(null);
|
|
3532
3547
|
var bottomAddRowInputRef = React.useRef(null);
|
|
3533
3548
|
var dataVerificationHintBoxRef = React.useRef(null);
|
|
3534
|
-
var _useState = React.useState(""),
|
|
3535
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
3536
|
-
lastRangeText = _useState2[0],
|
|
3537
|
-
setLastRangeText = _useState2[1];
|
|
3538
|
-
var _useState3 = React.useState(""),
|
|
3539
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
3540
|
-
lastCellValue = _useState4[0],
|
|
3541
|
-
setLastCellValue = _useState4[1];
|
|
3542
3549
|
var _useAlert = useAlert(),
|
|
3543
3550
|
showAlert = _useAlert.showAlert;
|
|
3544
3551
|
var cellAreaMouseDown = React.useCallback(function (e) {
|
|
@@ -3661,20 +3668,6 @@ var SheetOverlay = function SheetOverlay() {
|
|
|
3661
3668
|
insertRowColOp: insertRowColOp
|
|
3662
3669
|
});
|
|
3663
3670
|
}, [context, rightclick.rowOverLimit, setContext, showAlert]);
|
|
3664
|
-
React.useEffect(function () {
|
|
3665
|
-
setContext(function (draftCtx) {
|
|
3666
|
-
var _currentSheet$luckysh;
|
|
3667
|
-
var sheetIndex = fortuneCore.getSheetIndex(draftCtx, draftCtx.currentSheetId);
|
|
3668
|
-
if (sheetIndex === undefined || sheetIndex === null) return;
|
|
3669
|
-
var currentSheet = draftCtx.luckysheetfile[sheetIndex];
|
|
3670
|
-
if (!((_currentSheet$luckysh = currentSheet.luckysheet_select_save) === null || _currentSheet$luckysh === void 0 ? void 0 : _currentSheet$luckysh.length)) {
|
|
3671
|
-
fortuneCore.api.setSelection(draftCtx, [{
|
|
3672
|
-
row: [0],
|
|
3673
|
-
column: [0]
|
|
3674
|
-
}], {});
|
|
3675
|
-
}
|
|
3676
|
-
});
|
|
3677
|
-
}, [context.currentSheetId, setContext]);
|
|
3678
3671
|
React.useEffect(function () {
|
|
3679
3672
|
if (context.warnDialog) {
|
|
3680
3673
|
setTimeout(function () {
|
|
@@ -3717,43 +3710,7 @@ var SheetOverlay = function SheetOverlay() {
|
|
|
3717
3710
|
document.removeEventListener("keydown", onKeyDownForZoom);
|
|
3718
3711
|
};
|
|
3719
3712
|
}, [onKeyDownForZoom]);
|
|
3720
|
-
|
|
3721
|
-
var lastSelection = ___default['default'].last(context.luckysheet_select_save);
|
|
3722
|
-
if (!(lastSelection && lastSelection.row_focus != null && lastSelection.column_focus != null)) return "";
|
|
3723
|
-
var rf = lastSelection.row_focus;
|
|
3724
|
-
var cf = lastSelection.column_focus;
|
|
3725
|
-
if (context.config.merge != null && "".concat(rf, "_").concat(cf) in context.config.merge) {
|
|
3726
|
-
return fortuneCore.getRangetxt(context, context.currentSheetId, {
|
|
3727
|
-
column: [cf, cf],
|
|
3728
|
-
row: [rf, rf]
|
|
3729
|
-
});
|
|
3730
|
-
}
|
|
3731
|
-
var rawRangeTxt = fortuneCore.getRangetxt(context, context.currentSheetId, lastSelection);
|
|
3732
|
-
return rawRangeTxt.replace(/([A-Z]+)(\d+)/g, "$1. $2");
|
|
3733
|
-
}, [context.currentSheetId, context.luckysheet_select_save]);
|
|
3734
|
-
var cellValue = function cellValue() {
|
|
3735
|
-
var _context$luckysheet_s, _context$luckysheet_s2;
|
|
3736
|
-
if (((_context$luckysheet_s = (_context$luckysheet_s2 = context.luckysheet_select_save) === null || _context$luckysheet_s2 === void 0 ? void 0 : _context$luckysheet_s2.length) !== null && _context$luckysheet_s !== void 0 ? _context$luckysheet_s : 0) > 0) {
|
|
3737
|
-
var _context$luckysheet_s3, _selection$row_focus, _selection$column_foc, _context$luckysheetfi, _context$luckysheetfi2, _context$luckysheetfi3, _context$luckysheetfi4;
|
|
3738
|
-
var selection = (_context$luckysheet_s3 = context.luckysheet_select_save) === null || _context$luckysheet_s3 === void 0 ? void 0 : _context$luckysheet_s3[context.luckysheet_select_save.length - 1];
|
|
3739
|
-
if (!selection) return "";
|
|
3740
|
-
var sheetIndex = fortuneCore.getSheetIndex(context, context.currentSheetId);
|
|
3741
|
-
if (sheetIndex === undefined || sheetIndex === null) return "";
|
|
3742
|
-
var rowFocus = (_selection$row_focus = selection.row_focus) !== null && _selection$row_focus !== void 0 ? _selection$row_focus : 0;
|
|
3743
|
-
var columnFocus = (_selection$column_foc = selection.column_focus) !== null && _selection$column_foc !== void 0 ? _selection$column_foc : 0;
|
|
3744
|
-
var cellVal = ((_context$luckysheetfi = context.luckysheetfile[sheetIndex]) === null || _context$luckysheetfi === void 0 ? void 0 : (_context$luckysheetfi2 = _context$luckysheetfi.data) === null || _context$luckysheetfi2 === void 0 ? void 0 : (_context$luckysheetfi3 = _context$luckysheetfi2[rowFocus]) === null || _context$luckysheetfi3 === void 0 ? void 0 : (_context$luckysheetfi4 = _context$luckysheetfi3[columnFocus]) === null || _context$luckysheetfi4 === void 0 ? void 0 : _context$luckysheetfi4.m) || "";
|
|
3745
|
-
return cellVal;
|
|
3746
|
-
}
|
|
3747
|
-
return "";
|
|
3748
|
-
};
|
|
3749
|
-
var computedCellValue = cellValue();
|
|
3750
|
-
React.useEffect(function () {
|
|
3751
|
-
if (context.sheetFocused) {
|
|
3752
|
-
setLastRangeText(String(rangeText));
|
|
3753
|
-
setLastCellValue(String(cellValue()));
|
|
3754
|
-
}
|
|
3755
|
-
}, [context.sheetFocused]);
|
|
3756
|
-
return /*#__PURE__*/React__default['default'].createElement("main", {
|
|
3713
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3757
3714
|
className: "fortune-sheet-overlay",
|
|
3758
3715
|
ref: containerRef,
|
|
3759
3716
|
onTouchStart: onTouchStart,
|
|
@@ -3856,20 +3813,20 @@ var SheetOverlay = function SheetOverlay() {
|
|
|
3856
3813
|
hidden: !context.luckysheet_cols_freeze_drag && !context.luckysheet_rows_freeze_drag
|
|
3857
3814
|
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3858
3815
|
className: "luckysheet-cell-selected-focus",
|
|
3859
|
-
style: ((_context$
|
|
3816
|
+
style: ((_context$luckysheet_s = (_context$luckysheet_s2 = context.luckysheet_select_save) === null || _context$luckysheet_s2 === void 0 ? void 0 : _context$luckysheet_s2.length) !== null && _context$luckysheet_s !== void 0 ? _context$luckysheet_s : 0) > 0 ? function (_refs$globalCache$fre, _refs$globalCache$fre2) {
|
|
3860
3817
|
var selection = ___default['default'].last(context.luckysheet_select_save);
|
|
3861
3818
|
return ___default['default'].assign({
|
|
3862
3819
|
left: selection.left,
|
|
3863
3820
|
top: selection.top,
|
|
3864
|
-
width:
|
|
3865
|
-
height:
|
|
3821
|
+
width: selection.width,
|
|
3822
|
+
height: selection.height,
|
|
3866
3823
|
display: "block"
|
|
3867
3824
|
}, fortuneCore.fixRowStyleOverflowInFreeze(context, selection.row_focus || 0, selection.row_focus || 0, (_refs$globalCache$fre = refs.globalCache.freezen) === null || _refs$globalCache$fre === void 0 ? void 0 : _refs$globalCache$fre[context.currentSheetId]), fortuneCore.fixColumnStyleOverflowInFreeze(context, selection.column_focus || 0, selection.column_focus || 0, (_refs$globalCache$fre2 = refs.globalCache.freezen) === null || _refs$globalCache$fre2 === void 0 ? void 0 : _refs$globalCache$fre2[context.currentSheetId]));
|
|
3868
3825
|
}() : {},
|
|
3869
3826
|
onMouseDown: function onMouseDown(e) {
|
|
3870
3827
|
return e.preventDefault();
|
|
3871
3828
|
}
|
|
3872
|
-
}), ((_context$
|
|
3829
|
+
}), ((_context$luckysheet_s3 = (_context$luckysheet_s4 = context.luckysheet_selection_range) === null || _context$luckysheet_s4 === void 0 ? void 0 : _context$luckysheet_s4.length) !== null && _context$luckysheet_s3 !== void 0 ? _context$luckysheet_s3 : 0) > 0 && (/*#__PURE__*/React__default['default'].createElement("div", {
|
|
3873
3830
|
id: "fortune-selection-copy"
|
|
3874
3831
|
}, context.luckysheet_selection_range.map(function (range) {
|
|
3875
3832
|
var r1 = range.row[0];
|
|
@@ -3910,7 +3867,7 @@ var SheetOverlay = function SheetOverlay() {
|
|
|
3910
3867
|
onMouseDown: function onMouseDown(e) {
|
|
3911
3868
|
return e.preventDefault();
|
|
3912
3869
|
}
|
|
3913
|
-
}), ((_context$
|
|
3870
|
+
}), ((_context$luckysheet_s5 = (_context$luckysheet_s6 = context.luckysheet_select_save) === null || _context$luckysheet_s6 === void 0 ? void 0 : _context$luckysheet_s6.length) !== null && _context$luckysheet_s5 !== void 0 ? _context$luckysheet_s5 : 0) > 0 && (/*#__PURE__*/React__default['default'].createElement("div", {
|
|
3914
3871
|
id: "luckysheet-cell-selected-boxs"
|
|
3915
3872
|
}, context.luckysheet_select_save.map(function (selection, index) {
|
|
3916
3873
|
var _refs$globalCache$fre3, _refs$globalCache$fre4;
|
|
@@ -3921,8 +3878,8 @@ var SheetOverlay = function SheetOverlay() {
|
|
|
3921
3878
|
style: ___default['default'].assign({
|
|
3922
3879
|
left: selection.left_move,
|
|
3923
3880
|
top: selection.top_move,
|
|
3924
|
-
width:
|
|
3925
|
-
height:
|
|
3881
|
+
width: selection.width_move,
|
|
3882
|
+
height: selection.height_move,
|
|
3926
3883
|
display: "block"
|
|
3927
3884
|
}, fortuneCore.fixRowStyleOverflowInFreeze(context, selection.row[0], selection.row[1], (_refs$globalCache$fre3 = refs.globalCache.freezen) === null || _refs$globalCache$fre3 === void 0 ? void 0 : _refs$globalCache$fre3[context.currentSheetId]), fortuneCore.fixColumnStyleOverflowInFreeze(context, selection.column[0], selection.column[1], (_refs$globalCache$fre4 = refs.globalCache.freezen) === null || _refs$globalCache$fre4 === void 0 ? void 0 : _refs$globalCache$fre4[context.currentSheetId])),
|
|
3928
3885
|
onMouseDown: function onMouseDown(e) {
|
|
@@ -4115,15 +4072,7 @@ var SheetOverlay = function SheetOverlay() {
|
|
|
4115
4072
|
});
|
|
4116
4073
|
},
|
|
4117
4074
|
tabIndex: 0
|
|
4118
|
-
}, info.backTop)))))))
|
|
4119
|
-
id: "sr-selection",
|
|
4120
|
-
className: "sr-only",
|
|
4121
|
-
role: "alert"
|
|
4122
|
-
}, !rangeText.includes("NaN") ? "".concat(rangeText, " ").concat(computedCellValue) : "A1. ".concat(info.sheetSrIntro)), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4123
|
-
id: "sr-sheetFocus",
|
|
4124
|
-
className: "sr-only",
|
|
4125
|
-
role: "alert"
|
|
4126
|
-
}, context.sheetFocused ? "".concat(lastRangeText, " ").concat(lastCellValue ? "".concat(lastCellValue, ".") : "", " ").concat(info.sheetIsFocused) : "Toolbar. ".concat(info.sheetNotFocused)));
|
|
4075
|
+
}, info.backTop))))))));
|
|
4127
4076
|
};
|
|
4128
4077
|
|
|
4129
4078
|
var Sheet = function Sheet(_ref) {
|
|
@@ -4142,7 +4091,7 @@ var Sheet = function Sheet(_ref) {
|
|
|
4142
4091
|
if (!data) return;
|
|
4143
4092
|
setContext(function (draftCtx) {
|
|
4144
4093
|
if (settings.devicePixelRatio === 0) {
|
|
4145
|
-
draftCtx.devicePixelRatio = (
|
|
4094
|
+
draftCtx.devicePixelRatio = (globalThis || window).devicePixelRatio;
|
|
4146
4095
|
}
|
|
4147
4096
|
fortuneCore.updateContextWithSheetData(draftCtx, data);
|
|
4148
4097
|
fortuneCore.updateContextWithCanvas(draftCtx, refs.canvas.current, placeholderRef.current);
|
|
@@ -4292,8 +4241,7 @@ var Sheet = function Sheet(_ref) {
|
|
|
4292
4241
|
className: "fortune-sheet-canvas-placeholder"
|
|
4293
4242
|
}), /*#__PURE__*/React__default['default'].createElement("canvas", {
|
|
4294
4243
|
className: "fortune-sheet-canvas",
|
|
4295
|
-
ref: refs.canvas
|
|
4296
|
-
"aria-hidden": "true"
|
|
4244
|
+
ref: refs.canvas
|
|
4297
4245
|
}), /*#__PURE__*/React__default['default'].createElement(SheetOverlay, null));
|
|
4298
4246
|
};
|
|
4299
4247
|
|
|
@@ -5583,17 +5531,16 @@ var FormatSearch = function FormatSearch(_ref) {
|
|
|
5583
5531
|
button = _locale.button,
|
|
5584
5532
|
format = _locale.format,
|
|
5585
5533
|
currencyDetail = _locale.currencyDetail,
|
|
5586
|
-
dateFmtList = _locale.dateFmtList
|
|
5587
|
-
numberFmtList = _locale.numberFmtList;
|
|
5534
|
+
dateFmtList = _locale.dateFmtList;
|
|
5588
5535
|
var _useDialog = useDialog(),
|
|
5589
5536
|
showDialog = _useDialog.showDialog;
|
|
5590
5537
|
var toolbarFormatAll = React.useMemo(function () {
|
|
5591
5538
|
return {
|
|
5592
5539
|
currency: currencyDetail,
|
|
5593
5540
|
date: dateFmtList,
|
|
5594
|
-
number:
|
|
5541
|
+
number: []
|
|
5595
5542
|
};
|
|
5596
|
-
}, [currencyDetail, dateFmtList
|
|
5543
|
+
}, [currencyDetail, dateFmtList]);
|
|
5597
5544
|
var toolbarFormat = React.useMemo(function () {
|
|
5598
5545
|
return toolbarFormatAll[type];
|
|
5599
5546
|
}, [toolbarFormatAll, type]);
|
|
@@ -5607,22 +5554,15 @@ var FormatSearch = function FormatSearch(_ref) {
|
|
|
5607
5554
|
setContext(function (ctx) {
|
|
5608
5555
|
var index = fortuneCore.getSheetIndex(ctx, ctx.currentSheetId);
|
|
5609
5556
|
if (___default['default'].isNil(index)) return;
|
|
5610
|
-
var
|
|
5611
|
-
var selectedFormatPos;
|
|
5612
|
-
if ("pos" in toolbarFormat[selectedFormatIndex]) selectedFormatPos = toolbarFormat[selectedFormatIndex].pos || "before";
|
|
5557
|
+
var selectedFormat = toolbarFormat[selectedFormatIndex].value;
|
|
5613
5558
|
___default['default'].forEach(ctx.luckysheet_select_save, function (selection) {
|
|
5614
5559
|
for (var r = selection.row[0]; r <= selection.row[1]; r += 1) {
|
|
5615
5560
|
for (var c = selection.column[0]; c <= selection.column[1]; c += 1) {
|
|
5616
5561
|
var _ctx$luckysheetfile$i, _ctx$luckysheetfile$i2, _ctx$luckysheetfile$i3, _ctx$luckysheetfile$i4;
|
|
5617
5562
|
if (((_ctx$luckysheetfile$i = ctx.luckysheetfile[index].data) === null || _ctx$luckysheetfile$i === void 0 ? void 0 : _ctx$luckysheetfile$i[r][c]) && ((_ctx$luckysheetfile$i2 = ctx.luckysheetfile[index].data) === null || _ctx$luckysheetfile$i2 === void 0 ? void 0 : (_ctx$luckysheetfile$i3 = _ctx$luckysheetfile$i2[r][c]) === null || _ctx$luckysheetfile$i3 === void 0 ? void 0 : (_ctx$luckysheetfile$i4 = _ctx$luckysheetfile$i3.ct) === null || _ctx$luckysheetfile$i4 === void 0 ? void 0 : _ctx$luckysheetfile$i4.t) === "n") {
|
|
5618
5563
|
var zero = 0;
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
ctx.luckysheetfile[index].data[r][c].m = fortuneCore.update(zero.toFixed(decimalPlace).concat("".concat(selectedFormatVal)), ctx.luckysheetfile[index].data[r][c].v);
|
|
5622
|
-
} else {
|
|
5623
|
-
ctx.luckysheetfile[index].data[r][c].ct.fa = "".concat(selectedFormatVal).concat(zero.toFixed(decimalPlace));
|
|
5624
|
-
ctx.luckysheetfile[index].data[r][c].m = fortuneCore.update("".concat(selectedFormatVal).concat(zero.toFixed(decimalPlace)), ctx.luckysheetfile[index].data[r][c].v);
|
|
5625
|
-
}
|
|
5564
|
+
ctx.luckysheetfile[index].data[r][c].ct.fa = "".concat(selectedFormat).concat(zero.toFixed(decimalPlace));
|
|
5565
|
+
ctx.luckysheetfile[index].data[r][c].m = fortuneCore.update("".concat(selectedFormat).concat(zero.toFixed(decimalPlace)), ctx.luckysheetfile[index].data[r][c].v);
|
|
5626
5566
|
}
|
|
5627
5567
|
}
|
|
5628
5568
|
}
|
|
@@ -5652,8 +5592,10 @@ var FormatSearch = function FormatSearch(_ref) {
|
|
|
5652
5592
|
}
|
|
5653
5593
|
}, tips, format.format, "\uFF1A"), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5654
5594
|
className: "inpbox",
|
|
5655
|
-
style: {
|
|
5595
|
+
style: type === "currency" ? {
|
|
5656
5596
|
display: "block"
|
|
5597
|
+
} : {
|
|
5598
|
+
display: "none"
|
|
5657
5599
|
}
|
|
5658
5600
|
}, format.decimalPlaces, "\uFF1A", /*#__PURE__*/React__default['default'].createElement("input", {
|
|
5659
5601
|
className: "decimal-places-input",
|
|
@@ -5678,8 +5620,10 @@ var FormatSearch = function FormatSearch(_ref) {
|
|
|
5678
5620
|
}, /*#__PURE__*/React__default['default'].createElement("div", null, v.name), /*#__PURE__*/React__default['default'].createElement("div", null, v.value));
|
|
5679
5621
|
}))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5680
5622
|
className: "fortune-dialog-box-button-container",
|
|
5681
|
-
style: {
|
|
5623
|
+
style: type === "currency" ? {
|
|
5682
5624
|
marginTop: 40
|
|
5625
|
+
} : {
|
|
5626
|
+
marginTop: 30
|
|
5683
5627
|
}
|
|
5684
5628
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5685
5629
|
className: "fortune-message-box-button button-primary",
|
|
@@ -6862,7 +6806,8 @@ var LocationBox = function LocationBox() {
|
|
|
6862
6806
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
6863
6807
|
className: "fortune-name-box",
|
|
6864
6808
|
tabIndex: 0,
|
|
6865
|
-
dir: "ltr"
|
|
6809
|
+
dir: "ltr",
|
|
6810
|
+
"aria-autocomplete": "list"
|
|
6866
6811
|
}, rangeText));
|
|
6867
6812
|
};
|
|
6868
6813
|
|
|
@@ -6886,8 +6831,6 @@ var FxEditor = function FxEditor() {
|
|
|
6886
6831
|
var prevFirstSelection = usePrevious(firstSelection);
|
|
6887
6832
|
var prevSheetId = usePrevious(context.currentSheetId);
|
|
6888
6833
|
var recentText = React.useRef("");
|
|
6889
|
-
var _locale = fortuneCore.locale(context),
|
|
6890
|
-
info = _locale.info;
|
|
6891
6834
|
React.useEffect(function () {
|
|
6892
6835
|
setIsHidenRC(fortuneCore.isShowHidenCR(context));
|
|
6893
6836
|
if (___default['default'].isEqual(prevFirstSelection, firstSelection) && context.currentSheetId === prevSheetId) {
|
|
@@ -7004,7 +6947,7 @@ var FxEditor = function FxEditor() {
|
|
|
7004
6947
|
}
|
|
7005
6948
|
return true;
|
|
7006
6949
|
}, [context.config, context.luckysheet_select_save, context.luckysheetfile, context.currentSheetId, isHidenRC]);
|
|
7007
|
-
return /*#__PURE__*/React__default['default'].createElement("
|
|
6950
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
7008
6951
|
className: "fortune-fx-editor"
|
|
7009
6952
|
}, /*#__PURE__*/React__default['default'].createElement(LocationBox, null), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
7010
6953
|
className: "fortune-fx-icon"
|
|
@@ -7020,9 +6963,8 @@ var FxEditor = function FxEditor() {
|
|
|
7020
6963
|
refs.fxInput.current = e;
|
|
7021
6964
|
},
|
|
7022
6965
|
className: "fortune-fx-input",
|
|
7023
|
-
role: "textbox",
|
|
7024
6966
|
id: "luckysheet-functionbox-cell",
|
|
7025
|
-
"aria-
|
|
6967
|
+
"aria-autocomplete": "list",
|
|
7026
6968
|
onFocus: onFocus,
|
|
7027
6969
|
onKeyDown: onKeyDown,
|
|
7028
6970
|
onChange: onChange,
|
|
@@ -7039,7 +6981,7 @@ var FxEditor = function FxEditor() {
|
|
|
7039
6981
|
style: {
|
|
7040
6982
|
top: inputContainerRef.current.clientHeight
|
|
7041
6983
|
}
|
|
7042
|
-
})))))
|
|
6984
|
+
})))));
|
|
7043
6985
|
};
|
|
7044
6986
|
|
|
7045
6987
|
var SheetItem = function SheetItem(_ref) {
|
|
@@ -7065,8 +7007,6 @@ var SheetItem = function SheetItem(_ref) {
|
|
|
7065
7007
|
setSvgColor = _useState6[1];
|
|
7066
7008
|
var _useAlert = useAlert(),
|
|
7067
7009
|
showAlert = _useAlert.showAlert;
|
|
7068
|
-
var _locale = fortuneCore.locale(context),
|
|
7069
|
-
info = _locale.info;
|
|
7070
7010
|
React.useEffect(function () {
|
|
7071
7011
|
setContext(function (draftCtx) {
|
|
7072
7012
|
var r = context.sheetScrollRecord[draftCtx === null || draftCtx === void 0 ? void 0 : draftCtx.currentSheetId];
|
|
@@ -7153,7 +7093,6 @@ var SheetItem = function SheetItem(_ref) {
|
|
|
7153
7093
|
e.stopPropagation();
|
|
7154
7094
|
}, [context.allowEdit, isDropPlaceholder, setContext, sheet.id]);
|
|
7155
7095
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
7156
|
-
role: "button",
|
|
7157
7096
|
onDragOver: function onDragOver(e) {
|
|
7158
7097
|
e.preventDefault();
|
|
7159
7098
|
e.stopPropagation();
|
|
@@ -7256,8 +7195,7 @@ var SheetItem = function SheetItem(_ref) {
|
|
|
7256
7195
|
};
|
|
7257
7196
|
});
|
|
7258
7197
|
},
|
|
7259
|
-
tabIndex: 0
|
|
7260
|
-
"aria-label": info.sheetOptions
|
|
7198
|
+
tabIndex: 0
|
|
7261
7199
|
}, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
|
|
7262
7200
|
name: "downArrow",
|
|
7263
7201
|
width: 12,
|
|
@@ -7309,8 +7247,6 @@ var ZoomControl = function ZoomControl() {
|
|
|
7309
7247
|
_useState2 = _slicedToArray(_useState, 2),
|
|
7310
7248
|
radioMenuOpen = _useState2[0],
|
|
7311
7249
|
setRadioMenuOpen = _useState2[1];
|
|
7312
|
-
var _locale = fortuneCore.locale(context),
|
|
7313
|
-
info = _locale.info;
|
|
7314
7250
|
useOutsideClick(menuRef, function () {
|
|
7315
7251
|
setRadioMenuOpen(false);
|
|
7316
7252
|
}, []);
|
|
@@ -7330,18 +7266,15 @@ var ZoomControl = function ZoomControl() {
|
|
|
7330
7266
|
noHistory: true
|
|
7331
7267
|
});
|
|
7332
7268
|
}, [setContext]);
|
|
7333
|
-
return /*#__PURE__*/React__default['default'].createElement("
|
|
7334
|
-
title: "Zoom settings",
|
|
7269
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
7335
7270
|
className: "fortune-zoom-container"
|
|
7336
7271
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
7337
7272
|
className: "fortune-zoom-button",
|
|
7338
|
-
"aria-label": info.zoomOut,
|
|
7339
7273
|
onClick: function onClick(e) {
|
|
7340
7274
|
zoomTo(context.zoomRatio - 0.1);
|
|
7341
7275
|
e.stopPropagation();
|
|
7342
7276
|
},
|
|
7343
|
-
tabIndex: 0
|
|
7344
|
-
role: "button"
|
|
7277
|
+
tabIndex: 0
|
|
7345
7278
|
}, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
|
|
7346
7279
|
name: "minus",
|
|
7347
7280
|
width: 16,
|
|
@@ -7371,13 +7304,11 @@ var ZoomControl = function ZoomControl() {
|
|
|
7371
7304
|
}, v.text));
|
|
7372
7305
|
})))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
7373
7306
|
className: "fortune-zoom-button",
|
|
7374
|
-
"aria-label": info.zoomIn,
|
|
7375
7307
|
onClick: function onClick(e) {
|
|
7376
7308
|
zoomTo(context.zoomRatio + 0.1);
|
|
7377
7309
|
e.stopPropagation();
|
|
7378
7310
|
},
|
|
7379
|
-
tabIndex: 0
|
|
7380
|
-
role: "button"
|
|
7311
|
+
tabIndex: 0
|
|
7381
7312
|
}, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
|
|
7382
7313
|
name: "plus",
|
|
7383
7314
|
width: 16,
|
|
@@ -7402,8 +7333,6 @@ var SheetTab = function SheetTab() {
|
|
|
7402
7333
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
7403
7334
|
isShowBoundary = _useState4[0],
|
|
7404
7335
|
setIsShowBoundary = _useState4[1];
|
|
7405
|
-
var _locale = fortuneCore.locale(context),
|
|
7406
|
-
info = _locale.info;
|
|
7407
7336
|
var scrollDelta = 150;
|
|
7408
7337
|
var scrollBy = React.useCallback(function (amount) {
|
|
7409
7338
|
var _tabContainerRef$curr;
|
|
@@ -7446,10 +7375,7 @@ var SheetTab = function SheetTab() {
|
|
|
7446
7375
|
id: "luckysheet-sheet-content"
|
|
7447
7376
|
}, context.allowEdit && (/*#__PURE__*/React__default['default'].createElement("div", {
|
|
7448
7377
|
className: "fortune-sheettab-button",
|
|
7449
|
-
onClick: onAddSheetClick
|
|
7450
|
-
tabIndex: 0,
|
|
7451
|
-
"aria-label": info.newSheet,
|
|
7452
|
-
role: "button"
|
|
7378
|
+
onClick: onAddSheetClick
|
|
7453
7379
|
}, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
|
|
7454
7380
|
name: "plus",
|
|
7455
7381
|
width: 16,
|
|
@@ -7534,12 +7460,6 @@ var Menu = function Menu(_ref) {
|
|
|
7534
7460
|
_onMouseLeave = _ref.onMouseLeave,
|
|
7535
7461
|
_onMouseEnter = _ref.onMouseEnter,
|
|
7536
7462
|
children = _ref.children;
|
|
7537
|
-
React.useEffect(function () {
|
|
7538
|
-
var element = document.querySelector(".luckysheet-cols-menuitem");
|
|
7539
|
-
if (element) {
|
|
7540
|
-
element.focus();
|
|
7541
|
-
}
|
|
7542
|
-
}, []);
|
|
7543
7463
|
var containerRef = React.useRef(null);
|
|
7544
7464
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
7545
7465
|
ref: containerRef,
|
|
@@ -7720,34 +7640,23 @@ var ContextMenu = function ContextMenu() {
|
|
|
7720
7640
|
key: name,
|
|
7721
7641
|
onClick: function () {
|
|
7722
7642
|
var _onClick = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
7723
|
-
var clipboardText
|
|
7643
|
+
var clipboardText;
|
|
7724
7644
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
7725
7645
|
while (1) switch (_context.prev = _context.next) {
|
|
7726
7646
|
case 0:
|
|
7727
|
-
|
|
7728
|
-
sessionClipboardText = sessionStorage.getItem("localClipboard") || "";
|
|
7729
|
-
_context.prev = 2;
|
|
7730
|
-
_context.next = 5;
|
|
7647
|
+
_context.next = 2;
|
|
7731
7648
|
return navigator.clipboard.readText();
|
|
7732
|
-
case
|
|
7649
|
+
case 2:
|
|
7733
7650
|
clipboardText = _context.sent;
|
|
7734
|
-
_context.next = 11;
|
|
7735
|
-
break;
|
|
7736
|
-
case 8:
|
|
7737
|
-
_context.prev = 8;
|
|
7738
|
-
_context.t0 = _context["catch"](2);
|
|
7739
|
-
console.warn("Clipboard access blocked. Attempting to use sessionStorage fallback.");
|
|
7740
|
-
case 11:
|
|
7741
|
-
finalText = clipboardText || sessionClipboardText;
|
|
7742
7651
|
setContext(function (draftCtx) {
|
|
7743
|
-
fortuneCore.handlePasteByClick(draftCtx,
|
|
7652
|
+
fortuneCore.handlePasteByClick(draftCtx, clipboardText);
|
|
7744
7653
|
draftCtx.contextMenu = {};
|
|
7745
7654
|
});
|
|
7746
|
-
case
|
|
7655
|
+
case 4:
|
|
7747
7656
|
case "end":
|
|
7748
7657
|
return _context.stop();
|
|
7749
7658
|
}
|
|
7750
|
-
}, _callee
|
|
7659
|
+
}, _callee);
|
|
7751
7660
|
}));
|
|
7752
7661
|
function onClick() {
|
|
7753
7662
|
return _onClick.apply(this, arguments);
|
|
@@ -10271,17 +10180,10 @@ function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cel
|
|
|
10271
10180
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
10272
10181
|
return fortuneCore.api.getSheetWithLatestCelldata(context, options);
|
|
10273
10182
|
},
|
|
10274
|
-
addSheet: function addSheet(
|
|
10275
|
-
|
|
10276
|
-
return
|
|
10183
|
+
addSheet: function addSheet() {
|
|
10184
|
+
return setContext(function (draftCtx) {
|
|
10185
|
+
return fortuneCore.api.addSheet(draftCtx, settings);
|
|
10277
10186
|
});
|
|
10278
|
-
if (sheetId && existingSheetIds.includes(sheetId)) {
|
|
10279
|
-
console.error("Failed to add new sheet: A sheet with the id \"".concat(sheetId, "\" already exists. Please use a unique sheet id."));
|
|
10280
|
-
} else {
|
|
10281
|
-
setContext(function (draftCtx) {
|
|
10282
|
-
return fortuneCore.api.addSheet(draftCtx, settings, sheetId);
|
|
10283
|
-
});
|
|
10284
|
-
}
|
|
10285
10187
|
},
|
|
10286
10188
|
deleteSheet: function deleteSheet() {
|
|
10287
10189
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -10332,9 +10234,11 @@ function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cel
|
|
|
10332
10234
|
},
|
|
10333
10235
|
handleUndo: handleUndo,
|
|
10334
10236
|
handleRedo: handleRedo,
|
|
10335
|
-
calculateFormula: function calculateFormula(
|
|
10237
|
+
calculateFormula: function calculateFormula() {
|
|
10336
10238
|
setContext(function (draftCtx) {
|
|
10337
|
-
|
|
10239
|
+
___default['default'].forEach(draftCtx.luckysheetfile, function (sheet_obj) {
|
|
10240
|
+
fortuneCore.api.calculateSheetFromula(draftCtx, sheet_obj.id);
|
|
10241
|
+
});
|
|
10338
10242
|
});
|
|
10339
10243
|
},
|
|
10340
10244
|
dataToCelldata: function dataToCelldata(data) {
|
|
@@ -10342,19 +10246,6 @@ function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cel
|
|
|
10342
10246
|
},
|
|
10343
10247
|
celldataToData: function celldataToData(celldata, rowCount, colCount) {
|
|
10344
10248
|
return fortuneCore.api.celldataToData(celldata, rowCount, colCount);
|
|
10345
|
-
},
|
|
10346
|
-
batchCallApis: function batchCallApis(apiCalls) {
|
|
10347
|
-
setContext(function (draftCtx) {
|
|
10348
|
-
apiCalls.forEach(function (apiCall) {
|
|
10349
|
-
var name = apiCall.name,
|
|
10350
|
-
args = apiCall.args;
|
|
10351
|
-
if (typeof fortuneCore.api[name] === "function") {
|
|
10352
|
-
fortuneCore.api[name].apply(fortuneCore.api, [draftCtx].concat(_toConsumableArray(args)));
|
|
10353
|
-
} else {
|
|
10354
|
-
console.warn("API ".concat(name, " does not exist"));
|
|
10355
|
-
}
|
|
10356
|
-
});
|
|
10357
|
-
});
|
|
10358
10249
|
}
|
|
10359
10250
|
};
|
|
10360
10251
|
}
|
|
@@ -11135,8 +11026,7 @@ var Workbook = /*#__PURE__*/React__default['default'].forwardRef(function (_ref,
|
|
|
11135
11026
|
context = _useState2[0],
|
|
11136
11027
|
setContext = _useState2[1];
|
|
11137
11028
|
var _locale = fortuneCore.locale(context),
|
|
11138
|
-
formula = _locale.formula
|
|
11139
|
-
info = _locale.info;
|
|
11029
|
+
formula = _locale.formula;
|
|
11140
11030
|
var _useState3 = React.useState(null),
|
|
11141
11031
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
11142
11032
|
moreToolbarItems = _useState4[0],
|
|
@@ -11322,7 +11212,7 @@ var Workbook = /*#__PURE__*/React__default['default'].forwardRef(function (_ref,
|
|
|
11322
11212
|
var history = globalCache.current.undoList.pop();
|
|
11323
11213
|
if (history) {
|
|
11324
11214
|
setContext(function (ctx_) {
|
|
11325
|
-
var _history$options, _history$options3
|
|
11215
|
+
var _history$options, _history$options3;
|
|
11326
11216
|
if ((_history$options = history.options) === null || _history$options === void 0 ? void 0 : _history$options.deleteSheetOp) {
|
|
11327
11217
|
var _history$options$dele, _history$options$dele2;
|
|
11328
11218
|
history.inversePatches[0].path[1] = ctx_.luckysheetfile.length;
|
|
@@ -11357,7 +11247,6 @@ var Workbook = /*#__PURE__*/React__default['default'].forwardRef(function (_ref,
|
|
|
11357
11247
|
delete inversedOptions.addSheet.value.data;
|
|
11358
11248
|
}
|
|
11359
11249
|
emitOp(newContext, history.inversePatches, inversedOptions, true);
|
|
11360
|
-
if (((_history$options4 = history.options) === null || _history$options4 === void 0 ? void 0 : _history$options4.deleteRowColOp) || ((_history$options5 = history.options) === null || _history$options5 === void 0 ? void 0 : _history$options5.insertRowColOp) || ((_history$options6 = history.options) === null || _history$options6 === void 0 ? void 0 : _history$options6.restoreDeletedCells)) newContext.formulaCache.formulaCellInfoMap = null;else newContext.formulaCache.updateFormulaCache(newContext, history, "undo");
|
|
11361
11250
|
return newContext;
|
|
11362
11251
|
});
|
|
11363
11252
|
}
|
|
@@ -11366,11 +11255,9 @@ var Workbook = /*#__PURE__*/React__default['default'].forwardRef(function (_ref,
|
|
|
11366
11255
|
var history = globalCache.current.redoList.pop();
|
|
11367
11256
|
if (history) {
|
|
11368
11257
|
setContext(function (ctx_) {
|
|
11369
|
-
var _history$options7, _history$options8, _history$options9;
|
|
11370
11258
|
var newContext = produce.applyPatches(ctx_, history.patches);
|
|
11371
11259
|
globalCache.current.undoList.push(history);
|
|
11372
11260
|
emitOp(newContext, history.patches, history.options);
|
|
11373
|
-
if (((_history$options7 = history.options) === null || _history$options7 === void 0 ? void 0 : _history$options7.deleteRowColOp) || ((_history$options8 = history.options) === null || _history$options8 === void 0 ? void 0 : _history$options8.insertRowColOp) || ((_history$options9 = history.options) === null || _history$options9 === void 0 ? void 0 : _history$options9.restoreDeletedCells)) newContext.formulaCache.formulaCellInfoMap = null;else newContext.formulaCache.updateFormulaCache(newContext, history, "redo");
|
|
11374
11261
|
return newContext;
|
|
11375
11262
|
});
|
|
11376
11263
|
}
|
|
@@ -11411,8 +11298,7 @@ var Workbook = /*#__PURE__*/React__default['default'].forwardRef(function (_ref,
|
|
|
11411
11298
|
var _draftCtx$luckysheetf;
|
|
11412
11299
|
var index = fortuneCore.getSheetIndex(draftCtx, newDatum.id);
|
|
11413
11300
|
var sheet = (_draftCtx$luckysheetf = draftCtx.luckysheetfile) === null || _draftCtx$luckysheetf === void 0 ? void 0 : _draftCtx$luckysheetf[index];
|
|
11414
|
-
|
|
11415
|
-
fortuneCore.setFormulaCellInfoMap(draftCtx, sheet.calcChain, cellMatrixData || undefined);
|
|
11301
|
+
initSheetData(draftCtx, sheet, index);
|
|
11416
11302
|
});
|
|
11417
11303
|
}
|
|
11418
11304
|
if (mergedSettings.devicePixelRatio > 0) {
|
|
@@ -11583,15 +11469,7 @@ var Workbook = /*#__PURE__*/React__default['default'].forwardRef(function (_ref,
|
|
|
11583
11469
|
className: "fortune-container",
|
|
11584
11470
|
ref: workbookContainer,
|
|
11585
11471
|
onKeyDown: onKeyDown
|
|
11586
|
-
}, /*#__PURE__*/React__default['default'].createElement(
|
|
11587
|
-
"aria-labelledby": "shortcuts-heading",
|
|
11588
|
-
id: "shortcut-list",
|
|
11589
|
-
className: "sr-only",
|
|
11590
|
-
tabIndex: 0,
|
|
11591
|
-
"aria-live": "polite"
|
|
11592
|
-
}, /*#__PURE__*/React__default['default'].createElement("h2", {
|
|
11593
|
-
id: "shortcuts-heading"
|
|
11594
|
-
}, info.shortcuts), /*#__PURE__*/React__default['default'].createElement("ul", null, /*#__PURE__*/React__default['default'].createElement("li", null, info.toggleSheetFocusShortcut), /*#__PURE__*/React__default['default'].createElement("li", null, info.selectRangeShortcut), /*#__PURE__*/React__default['default'].createElement("li", null, info.autoFillDownShortcut), /*#__PURE__*/React__default['default'].createElement("li", null, info.autoFillRightShortcut), /*#__PURE__*/React__default['default'].createElement("li", null, info.boldTextShortcut), /*#__PURE__*/React__default['default'].createElement("li", null, info.copyShortcut), /*#__PURE__*/React__default['default'].createElement("li", null, info.pasteShortcut), /*#__PURE__*/React__default['default'].createElement("li", null, info.undoShortcut), /*#__PURE__*/React__default['default'].createElement("li", null, info.redoShortcut), /*#__PURE__*/React__default['default'].createElement("li", null, info.deleteCellContentShortcut), /*#__PURE__*/React__default['default'].createElement("li", null, info.confirmCellEditShortcut), /*#__PURE__*/React__default['default'].createElement("li", null, info.moveRightShortcut), /*#__PURE__*/React__default['default'].createElement("li", null, info.moveLeftShortcut))), /*#__PURE__*/React__default['default'].createElement(SVGDefines, {
|
|
11472
|
+
}, /*#__PURE__*/React__default['default'].createElement(SVGDefines, {
|
|
11595
11473
|
currency: mergedSettings.currency
|
|
11596
11474
|
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
11597
11475
|
className: "fortune-workarea"
|