@fileverse-dev/fortune-react 1.2.56-patch-2 → 1.2.58-sm-fix-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/Workbook/api.d.ts +1 -0
- package/es/components/Workbook/api.js +5 -0
- package/es/components/Workbook/index.d.ts +1 -0
- package/es/components/Workbook/index.js +1 -6
- package/lib/components/Workbook/api.d.ts +1 -0
- package/lib/components/Workbook/api.js +5 -0
- package/lib/components/Workbook/index.d.ts +1 -0
- package/lib/components/Workbook/index.js +1 -6
- package/package.json +2 -2
|
@@ -19,6 +19,7 @@ export declare function generateAPIs(context: Context, setContext: (recipe: (ctx
|
|
|
19
19
|
title: string;
|
|
20
20
|
message: string;
|
|
21
21
|
}) => void;
|
|
22
|
+
clearCellError: (row: number, column: number) => void;
|
|
22
23
|
clearCell: (row: number, column: number, options?: api.CommonOptions) => void;
|
|
23
24
|
setCellFormat: (row: number, column: number, attr: keyof Cell, value: any, options?: api.CommonOptions) => void;
|
|
24
25
|
autoFillCell: (copyRange: SingleRange, applyRange: SingleRange, direction: "up" | "down" | "left" | "right") => void;
|
|
@@ -146,6 +146,11 @@ export function generateAPIs(context, setContext, handleUndo, handleRedo, settin
|
|
|
146
146
|
api.setCellError(draftCtx, row, column, errorMessage);
|
|
147
147
|
});
|
|
148
148
|
},
|
|
149
|
+
clearCellError: function clearCellError(row, column) {
|
|
150
|
+
setContext(function (draftCtx) {
|
|
151
|
+
api.clearCellError(draftCtx, row, column);
|
|
152
|
+
});
|
|
153
|
+
},
|
|
149
154
|
clearCell: function clearCell(row, column, options) {
|
|
150
155
|
if (options === void 0) {
|
|
151
156
|
options = {};
|
|
@@ -26,6 +26,7 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
|
|
|
26
26
|
title: string;
|
|
27
27
|
message: string;
|
|
28
28
|
}) => void;
|
|
29
|
+
clearCellError: (row: number, column: number) => void;
|
|
29
30
|
clearCell: (row: number, column: number, options?: api.CommonOptions) => void;
|
|
30
31
|
setCellFormat: (row: number, column: number, 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, options?: api.CommonOptions) => void;
|
|
31
32
|
autoFillCell: (copyRange: import("@fileverse-dev/fortune-core").SingleRange, applyRange: import("@fileverse-dev/fortune-core").SingleRange, direction: "left" | "right" | "down" | "up") => void;
|
|
@@ -612,9 +612,7 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
612
612
|
}, [handleRedo, handleUndo, setContextWithProduce]);
|
|
613
613
|
var onPaste = useCallback(function (e) {
|
|
614
614
|
var _a;
|
|
615
|
-
var startPaste = true;
|
|
616
615
|
if (cellInput.current === document.activeElement || ((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.className) === "fortune-sheet-overlay") {
|
|
617
|
-
if (!startPaste) return;
|
|
618
616
|
var clipboardData = e.clipboardData;
|
|
619
617
|
if (!clipboardData) {
|
|
620
618
|
clipboardData = window.clipboardData;
|
|
@@ -643,10 +641,7 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
643
641
|
}
|
|
644
642
|
setContextWithProduce(function (draftCtx) {
|
|
645
643
|
try {
|
|
646
|
-
|
|
647
|
-
startPaste = false;
|
|
648
|
-
handlePaste(draftCtx, e);
|
|
649
|
-
}
|
|
644
|
+
handlePaste(draftCtx, e);
|
|
650
645
|
} catch (err) {
|
|
651
646
|
console.error(err);
|
|
652
647
|
}
|
|
@@ -19,6 +19,7 @@ export declare function generateAPIs(context: Context, setContext: (recipe: (ctx
|
|
|
19
19
|
title: string;
|
|
20
20
|
message: string;
|
|
21
21
|
}) => void;
|
|
22
|
+
clearCellError: (row: number, column: number) => void;
|
|
22
23
|
clearCell: (row: number, column: number, options?: api.CommonOptions) => void;
|
|
23
24
|
setCellFormat: (row: number, column: number, attr: keyof Cell, value: any, options?: api.CommonOptions) => void;
|
|
24
25
|
autoFillCell: (copyRange: SingleRange, applyRange: SingleRange, direction: "up" | "down" | "left" | "right") => void;
|
|
@@ -153,6 +153,11 @@ function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cel
|
|
|
153
153
|
_fortuneCore.api.setCellError(draftCtx, row, column, errorMessage);
|
|
154
154
|
});
|
|
155
155
|
},
|
|
156
|
+
clearCellError: function clearCellError(row, column) {
|
|
157
|
+
setContext(function (draftCtx) {
|
|
158
|
+
_fortuneCore.api.clearCellError(draftCtx, row, column);
|
|
159
|
+
});
|
|
160
|
+
},
|
|
156
161
|
clearCell: function clearCell(row, column, options) {
|
|
157
162
|
if (options === void 0) {
|
|
158
163
|
options = {};
|
|
@@ -26,6 +26,7 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
|
|
|
26
26
|
title: string;
|
|
27
27
|
message: string;
|
|
28
28
|
}) => void;
|
|
29
|
+
clearCellError: (row: number, column: number) => void;
|
|
29
30
|
clearCell: (row: number, column: number, options?: api.CommonOptions) => void;
|
|
30
31
|
setCellFormat: (row: number, column: number, 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, options?: api.CommonOptions) => void;
|
|
31
32
|
autoFillCell: (copyRange: import("@fileverse-dev/fortune-core").SingleRange, applyRange: import("@fileverse-dev/fortune-core").SingleRange, direction: "left" | "right" | "down" | "up") => void;
|
|
@@ -621,9 +621,7 @@ var Workbook = /*#__PURE__*/_react.default.forwardRef(function (_a, ref) {
|
|
|
621
621
|
}, [handleRedo, handleUndo, setContextWithProduce]);
|
|
622
622
|
var onPaste = (0, _react.useCallback)(function (e) {
|
|
623
623
|
var _a;
|
|
624
|
-
var startPaste = true;
|
|
625
624
|
if (cellInput.current === document.activeElement || ((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.className) === "fortune-sheet-overlay") {
|
|
626
|
-
if (!startPaste) return;
|
|
627
625
|
var clipboardData = e.clipboardData;
|
|
628
626
|
if (!clipboardData) {
|
|
629
627
|
clipboardData = window.clipboardData;
|
|
@@ -652,10 +650,7 @@ var Workbook = /*#__PURE__*/_react.default.forwardRef(function (_a, ref) {
|
|
|
652
650
|
}
|
|
653
651
|
setContextWithProduce(function (draftCtx) {
|
|
654
652
|
try {
|
|
655
|
-
|
|
656
|
-
startPaste = false;
|
|
657
|
-
(0, _fortuneCore.handlePaste)(draftCtx, e);
|
|
658
|
-
}
|
|
653
|
+
(0, _fortuneCore.handlePaste)(draftCtx, e);
|
|
659
654
|
} catch (err) {
|
|
660
655
|
console.error(err);
|
|
661
656
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fileverse-dev/fortune-react",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.58-sm-fix-patch-1",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"tsc": "tsc"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@fileverse-dev/fortune-core": "1.2.
|
|
19
|
+
"@fileverse-dev/fortune-core": "1.2.58-sm-fix-patch-1",
|
|
20
20
|
"@fileverse/ui": "^4.1.7-patch-40",
|
|
21
21
|
"@tippyjs/react": "^4.2.6",
|
|
22
22
|
"@types/regenerator-runtime": "^0.13.6",
|