@fileverse-dev/fortune-react 1.1.67 → 1.1.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/ContextMenu/index.js +23 -1
- package/es/components/ErrorState/index.d.ts +3 -0
- package/es/components/ErrorState/index.js +32 -0
- package/es/components/NotationBoxes/index.js +1 -1
- package/es/components/SheetOverlay/FormulaSearch/index.js +1 -1
- package/es/components/SheetOverlay/InputBox.js +1 -1
- package/es/components/SheetOverlay/index.js +2 -1
- package/es/components/Toolbar/index.js +4 -1
- package/es/components/Workbook/api.d.ts +4 -0
- package/es/components/Workbook/api.js +5 -0
- package/es/components/Workbook/index.d.ts +8 -4
- package/lib/components/ContextMenu/index.js +22 -0
- package/lib/components/ErrorState/index.d.ts +3 -0
- package/lib/components/ErrorState/index.js +41 -0
- package/lib/components/NotationBoxes/index.js +1 -1
- package/lib/components/SheetOverlay/FormulaSearch/index.js +1 -1
- package/lib/components/SheetOverlay/InputBox.js +1 -1
- package/lib/components/SheetOverlay/index.js +2 -1
- package/lib/components/Toolbar/index.js +4 -1
- package/lib/components/Workbook/api.d.ts +4 -0
- package/lib/components/Workbook/api.js +5 -0
- package/lib/components/Workbook/index.d.ts +8 -4
- package/package.json +2 -2
|
@@ -113,7 +113,7 @@ var __generator = this && this.__generator || function (thisArg, body) {
|
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
};
|
|
116
|
-
import { locale, handleCopy, handlePasteByClick, deleteRowCol, insertRowCol, removeActiveImage, deleteSelectedCellText, sortSelection, createFilter, showImgChooser, handleLink, hideSelected, showSelected, getSheetIndex, api, isAllowEdit, jfrefreshgrid, newComment, getFreezeState, toggleFreeze, clearFilter } from "@fileverse-dev/fortune-core";
|
|
116
|
+
import { locale, handleCopy, handlePasteByClick, deleteRowCol, insertRowCol, removeActiveImage, deleteSelectedCellText, sortSelection, createFilter, showImgChooser, handleLink, hideSelected, showSelected, getSheetIndex, api, isAllowEdit, jfrefreshgrid, newComment, getFreezeState, toggleFreeze, clearFilter, clearSelectedCellFormat, clearColumnsCellsFormat, clearRowsCellsFormat } from "@fileverse-dev/fortune-core";
|
|
117
117
|
import _ from "lodash";
|
|
118
118
|
import React, { useContext, useRef, useCallback, useLayoutEffect } from "react";
|
|
119
119
|
import regeneratorRuntime from "regenerator-runtime";
|
|
@@ -996,6 +996,28 @@ var ContextMenu = function ContextMenu() {
|
|
|
996
996
|
className: "color-text-secondary w-4 h-4"
|
|
997
997
|
})))));
|
|
998
998
|
}
|
|
999
|
+
if (name === "clear-format") {
|
|
1000
|
+
return /*#__PURE__*/React.createElement(Menu, {
|
|
1001
|
+
key: name,
|
|
1002
|
+
onClick: function onClick() {
|
|
1003
|
+
if (context.allowEdit === false) return;
|
|
1004
|
+
setContext(function (draftCtx) {
|
|
1005
|
+
draftCtx.contextMenu = {};
|
|
1006
|
+
if (draftCtx.contextMenu.headerMenu === "row") {
|
|
1007
|
+
clearRowsCellsFormat(draftCtx);
|
|
1008
|
+
} else if (draftCtx.contextMenu.headerMenu === true) {
|
|
1009
|
+
clearColumnsCellsFormat(draftCtx);
|
|
1010
|
+
} else if (!draftCtx.contextMenu.headerMenu) {
|
|
1011
|
+
clearSelectedCellFormat(draftCtx);
|
|
1012
|
+
}
|
|
1013
|
+
});
|
|
1014
|
+
}
|
|
1015
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1016
|
+
className: "context-item"
|
|
1017
|
+
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
1018
|
+
name: "RemoveFormatting"
|
|
1019
|
+
}), /*#__PURE__*/React.createElement("p", null, "Clear formatting")));
|
|
1020
|
+
}
|
|
999
1021
|
return null;
|
|
1000
1022
|
}, [context, setContext, refs.globalCache, rightclick, showAlert, showDialog, drag.noMulti, info.tipRowHeightLimit, info.tipColumnWidthLimit, generalDialog.partiallyError, generalDialog.readOnlyError, generalDialog.dataNullError]);
|
|
1001
1023
|
useLayoutEffect(function () {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import WorkbookContext from "../../context";
|
|
3
|
+
var ErrorBoxes = function ErrorBoxes() {
|
|
4
|
+
var context = useContext(WorkbookContext).context;
|
|
5
|
+
var error = context.hoverErrorBox;
|
|
6
|
+
if (!error) return null;
|
|
7
|
+
var left = error.left,
|
|
8
|
+
top = error.top,
|
|
9
|
+
title = error.title,
|
|
10
|
+
message = error.message;
|
|
11
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
12
|
+
style: {
|
|
13
|
+
borderLeft: "4px solid #FB3449",
|
|
14
|
+
width: "auto",
|
|
15
|
+
maxWidth: "280px",
|
|
16
|
+
height: "auto",
|
|
17
|
+
left: left,
|
|
18
|
+
top: top,
|
|
19
|
+
position: "absolute",
|
|
20
|
+
padding: "8px",
|
|
21
|
+
background: "#FFFFFF",
|
|
22
|
+
zIndex: 100,
|
|
23
|
+
borderRadius: "4px"
|
|
24
|
+
},
|
|
25
|
+
className: "shadow-lg flex flex-col gap-2"
|
|
26
|
+
}, /*#__PURE__*/React.createElement("h3", {
|
|
27
|
+
className: "text-heading-xsm color-text-danger"
|
|
28
|
+
}, title), /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
className: "color-text-default text-body-sm"
|
|
30
|
+
}, message));
|
|
31
|
+
};
|
|
32
|
+
export default ErrorBoxes;
|
|
@@ -19,7 +19,7 @@ var FormulaSearch = function FormulaSearch(props) {
|
|
|
19
19
|
var _b = useContext(WorkbookContext),
|
|
20
20
|
context = _b.context,
|
|
21
21
|
isAuthorized = _b.settings.isAuthorized;
|
|
22
|
-
var authedFunction = ["Ethereum", "SMARTCONTRACT", "DUNESIM"];
|
|
22
|
+
var authedFunction = ["COINGECKO", "ETHERSCAN", "DEFILLAMA", "GNOSIS", "BASE", "EOA", "PNL", "SAFE", "BLOCKSCOUT", "LENS", "FARCASTER", "Ethereum", "SMARTCONTRACT", "DUNESIM"];
|
|
23
23
|
var filteredDefaultCandidates = context.defaultCandidates.filter(function (item) {
|
|
24
24
|
return !authedFunction.includes(item.n);
|
|
25
25
|
});
|
|
@@ -339,7 +339,7 @@ var InputBox = function InputBox() {
|
|
|
339
339
|
}, [clearSearchItemActiveClass, context.luckysheetCellUpdate.length, selectActiveFormula, setContext, firstSelection]);
|
|
340
340
|
var onChange = useCallback(function (__, isBlur) {
|
|
341
341
|
var _a;
|
|
342
|
-
if ((_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.innerText.includes("=")) {
|
|
342
|
+
if (((_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.innerText.includes("=")) && /^=?[A-Za-z]*$/.test(getLastInputSpanText())) {
|
|
343
343
|
setShowSearchHint(true);
|
|
344
344
|
} else {
|
|
345
345
|
setShowSearchHint(false);
|
|
@@ -28,6 +28,7 @@ import { useDialog } from "../../hooks/useDialog";
|
|
|
28
28
|
import SVGIcon from "../SVGIcon";
|
|
29
29
|
import DropDownList from "../DataVerification/DropdownList";
|
|
30
30
|
import IframeBoxs from "../IFrameBoxs/iFrameBoxs";
|
|
31
|
+
import ErrorBoxes from "../ErrorState";
|
|
31
32
|
var SheetOverlay = function SheetOverlay() {
|
|
32
33
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
33
34
|
var _o = useContext(WorkbookContext),
|
|
@@ -465,7 +466,7 @@ var SheetOverlay = function SheetOverlay() {
|
|
|
465
466
|
getContainer: function getContainer() {
|
|
466
467
|
return containerRef.current;
|
|
467
468
|
}
|
|
468
|
-
}), /*#__PURE__*/React.createElement(InputBox, null), /*#__PURE__*/React.createElement(NotationBoxes, null), /*#__PURE__*/React.createElement("div", {
|
|
469
|
+
}), /*#__PURE__*/React.createElement(InputBox, null), /*#__PURE__*/React.createElement(NotationBoxes, null), /*#__PURE__*/React.createElement(ErrorBoxes, null), /*#__PURE__*/React.createElement("div", {
|
|
469
470
|
id: "luckysheet-multipleRange-show"
|
|
470
471
|
}), /*#__PURE__*/React.createElement("div", {
|
|
471
472
|
id: "luckysheet-dynamicArray-hightShow"
|
|
@@ -14,6 +14,10 @@ export declare function generateAPIs(context: Context, setContext: (recipe: (ctx
|
|
|
14
14
|
setCellValue: (row: number, column: number, value: any, options?: api.CommonOptions & {
|
|
15
15
|
type?: keyof Cell;
|
|
16
16
|
}) => void;
|
|
17
|
+
setCellError: (row: number, column: number, errorMessage: {
|
|
18
|
+
title: string;
|
|
19
|
+
message: string;
|
|
20
|
+
}) => void;
|
|
17
21
|
clearCell: (row: number, column: number, options?: api.CommonOptions) => void;
|
|
18
22
|
setCellFormat: (row: number, column: number, attr: keyof Cell, value: any, options?: api.CommonOptions) => void;
|
|
19
23
|
autoFillCell: (copyRange: SingleRange, applyRange: SingleRange, direction: "up" | "down" | "left" | "right") => void;
|
|
@@ -139,6 +139,11 @@ export function generateAPIs(context, setContext, handleUndo, handleRedo, settin
|
|
|
139
139
|
return api.setCellValue(draftCtx, row, column, value, cellInput, options);
|
|
140
140
|
});
|
|
141
141
|
},
|
|
142
|
+
setCellError: function setCellError(row, column, errorMessage) {
|
|
143
|
+
setContext(function (draftCtx) {
|
|
144
|
+
api.setCellError(draftCtx, row, column, errorMessage);
|
|
145
|
+
});
|
|
146
|
+
},
|
|
142
147
|
clearCell: function clearCell(row, column, options) {
|
|
143
148
|
if (options === void 0) {
|
|
144
149
|
options = {};
|
|
@@ -12,17 +12,21 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
|
|
|
12
12
|
applyOp: (ops: Op[]) => void;
|
|
13
13
|
getCryptoPrice: typeof getCryptoPrice;
|
|
14
14
|
getCellValue: (row: number, column: number, options?: api.CommonOptions & {
|
|
15
|
-
type?: "rt" | "m" | "v" | "mc" | "f" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | keyof import("@fileverse-dev/fortune-core").CellStyle | undefined;
|
|
15
|
+
type?: "rt" | "m" | "error" | "v" | "mc" | "f" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | keyof import("@fileverse-dev/fortune-core").CellStyle | undefined;
|
|
16
16
|
}) => any;
|
|
17
17
|
onboardingActiveCell: (functionName: string) => void;
|
|
18
18
|
initializeComment: (row: number, column: number) => void;
|
|
19
19
|
updateSheetLiveQueryList: (subsheetIndex: number, _data: import("@fileverse-dev/fortune-core").LiveQueryData) => void;
|
|
20
20
|
removeFromLiveQueryList: (subSheetIndex: number, id: string) => void;
|
|
21
21
|
setCellValue: (row: number, column: number, value: any, options?: api.CommonOptions & {
|
|
22
|
-
type?: "rt" | "m" | "v" | "mc" | "f" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | keyof import("@fileverse-dev/fortune-core").CellStyle | undefined;
|
|
22
|
+
type?: "rt" | "m" | "error" | "v" | "mc" | "f" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | keyof import("@fileverse-dev/fortune-core").CellStyle | undefined;
|
|
23
|
+
}) => void;
|
|
24
|
+
setCellError: (row: number, column: number, errorMessage: {
|
|
25
|
+
title: string;
|
|
26
|
+
message: string;
|
|
23
27
|
}) => void;
|
|
24
28
|
clearCell: (row: number, column: number, options?: api.CommonOptions) => void;
|
|
25
|
-
setCellFormat: (row: number, column: number, attr: "rt" | "m" | "v" | "mc" | "f" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | keyof import("@fileverse-dev/fortune-core").CellStyle, value: any, options?: api.CommonOptions) => void;
|
|
29
|
+
setCellFormat: (row: number, column: number, attr: "rt" | "m" | "error" | "v" | "mc" | "f" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | keyof import("@fileverse-dev/fortune-core").CellStyle, value: any, options?: api.CommonOptions) => void;
|
|
26
30
|
autoFillCell: (copyRange: import("@fileverse-dev/fortune-core").SingleRange, applyRange: import("@fileverse-dev/fortune-core").SingleRange, direction: "left" | "right" | "down" | "up") => void;
|
|
27
31
|
freeze: (type: "column" | "both" | "row", range: {
|
|
28
32
|
row: number;
|
|
@@ -53,7 +57,7 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
|
|
|
53
57
|
getHtmlByRange: (range: import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => string | null;
|
|
54
58
|
setSelection: (range: import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => void;
|
|
55
59
|
setCellValuesByRange: (data: any[][], range: import("@fileverse-dev/fortune-core").SingleRange, options?: api.CommonOptions) => void;
|
|
56
|
-
setCellFormatByRange: (attr: "rt" | "m" | "v" | "mc" | "f" | "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").SingleRange | import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => void;
|
|
60
|
+
setCellFormatByRange: (attr: "rt" | "m" | "error" | "v" | "mc" | "f" | "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").SingleRange | import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => void;
|
|
57
61
|
mergeCells: (ranges: import("@fileverse-dev/fortune-core").Range, type: string, options?: api.CommonOptions) => void;
|
|
58
62
|
cancelMerge: (ranges: import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => void;
|
|
59
63
|
getAllSheets: () => SheetType[];
|
|
@@ -1005,6 +1005,28 @@ var ContextMenu = function ContextMenu() {
|
|
|
1005
1005
|
className: "color-text-secondary w-4 h-4"
|
|
1006
1006
|
})))));
|
|
1007
1007
|
}
|
|
1008
|
+
if (name === "clear-format") {
|
|
1009
|
+
return /*#__PURE__*/_react.default.createElement(_Menu.default, {
|
|
1010
|
+
key: name,
|
|
1011
|
+
onClick: function onClick() {
|
|
1012
|
+
if (context.allowEdit === false) return;
|
|
1013
|
+
setContext(function (draftCtx) {
|
|
1014
|
+
draftCtx.contextMenu = {};
|
|
1015
|
+
if (draftCtx.contextMenu.headerMenu === "row") {
|
|
1016
|
+
(0, _fortuneCore.clearRowsCellsFormat)(draftCtx);
|
|
1017
|
+
} else if (draftCtx.contextMenu.headerMenu === true) {
|
|
1018
|
+
(0, _fortuneCore.clearColumnsCellsFormat)(draftCtx);
|
|
1019
|
+
} else if (!draftCtx.contextMenu.headerMenu) {
|
|
1020
|
+
(0, _fortuneCore.clearSelectedCellFormat)(draftCtx);
|
|
1021
|
+
}
|
|
1022
|
+
});
|
|
1023
|
+
}
|
|
1024
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
1025
|
+
className: "context-item"
|
|
1026
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
|
|
1027
|
+
name: "RemoveFormatting"
|
|
1028
|
+
}), /*#__PURE__*/_react.default.createElement("p", null, "Clear formatting")));
|
|
1029
|
+
}
|
|
1008
1030
|
return null;
|
|
1009
1031
|
}, [context, setContext, refs.globalCache, rightclick, showAlert, showDialog, drag.noMulti, info.tipRowHeightLimit, info.tipColumnWidthLimit, generalDialog.partiallyError, generalDialog.readOnlyError, generalDialog.dataNullError]);
|
|
1010
1032
|
(0, _react.useLayoutEffect)(function () {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _context = _interopRequireDefault(require("../../context"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
12
|
+
var ErrorBoxes = function ErrorBoxes() {
|
|
13
|
+
var context = (0, _react.useContext)(_context.default).context;
|
|
14
|
+
var error = context.hoverErrorBox;
|
|
15
|
+
if (!error) return null;
|
|
16
|
+
var left = error.left,
|
|
17
|
+
top = error.top,
|
|
18
|
+
title = error.title,
|
|
19
|
+
message = error.message;
|
|
20
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
21
|
+
style: {
|
|
22
|
+
borderLeft: "4px solid #FB3449",
|
|
23
|
+
width: "auto",
|
|
24
|
+
maxWidth: "280px",
|
|
25
|
+
height: "auto",
|
|
26
|
+
left: left,
|
|
27
|
+
top: top,
|
|
28
|
+
position: "absolute",
|
|
29
|
+
padding: "8px",
|
|
30
|
+
background: "#FFFFFF",
|
|
31
|
+
zIndex: 100,
|
|
32
|
+
borderRadius: "4px"
|
|
33
|
+
},
|
|
34
|
+
className: "shadow-lg flex flex-col gap-2"
|
|
35
|
+
}, /*#__PURE__*/_react.default.createElement("h3", {
|
|
36
|
+
className: "text-heading-xsm color-text-danger"
|
|
37
|
+
}, title), /*#__PURE__*/_react.default.createElement("div", {
|
|
38
|
+
className: "color-text-default text-body-sm"
|
|
39
|
+
}, message));
|
|
40
|
+
};
|
|
41
|
+
var _default = exports.default = ErrorBoxes;
|
|
@@ -28,7 +28,7 @@ var FormulaSearch = function FormulaSearch(props) {
|
|
|
28
28
|
var _b = (0, _react.useContext)(_context.default),
|
|
29
29
|
context = _b.context,
|
|
30
30
|
isAuthorized = _b.settings.isAuthorized;
|
|
31
|
-
var authedFunction = ["Ethereum", "SMARTCONTRACT", "DUNESIM"];
|
|
31
|
+
var authedFunction = ["COINGECKO", "ETHERSCAN", "DEFILLAMA", "GNOSIS", "BASE", "EOA", "PNL", "SAFE", "BLOCKSCOUT", "LENS", "FARCASTER", "Ethereum", "SMARTCONTRACT", "DUNESIM"];
|
|
32
32
|
var filteredDefaultCandidates = context.defaultCandidates.filter(function (item) {
|
|
33
33
|
return !authedFunction.includes(item.n);
|
|
34
34
|
});
|
|
@@ -348,7 +348,7 @@ var InputBox = function InputBox() {
|
|
|
348
348
|
}, [clearSearchItemActiveClass, context.luckysheetCellUpdate.length, selectActiveFormula, setContext, firstSelection]);
|
|
349
349
|
var onChange = (0, _react.useCallback)(function (__, isBlur) {
|
|
350
350
|
var _a;
|
|
351
|
-
if ((_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.innerText.includes("=")) {
|
|
351
|
+
if (((_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.innerText.includes("=")) && /^=?[A-Za-z]*$/.test(getLastInputSpanText())) {
|
|
352
352
|
setShowSearchHint(true);
|
|
353
353
|
} else {
|
|
354
354
|
setShowSearchHint(false);
|
|
@@ -25,6 +25,7 @@ var _useDialog = require("../../hooks/useDialog");
|
|
|
25
25
|
var _SVGIcon = _interopRequireDefault(require("../SVGIcon"));
|
|
26
26
|
var _DropdownList = _interopRequireDefault(require("../DataVerification/DropdownList"));
|
|
27
27
|
var _iFrameBoxs = _interopRequireDefault(require("../IFrameBoxs/iFrameBoxs"));
|
|
28
|
+
var _ErrorState = _interopRequireDefault(require("../ErrorState"));
|
|
28
29
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
29
30
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
30
31
|
var __assign = void 0 && (void 0).__assign || function () {
|
|
@@ -474,7 +475,7 @@ var SheetOverlay = function SheetOverlay() {
|
|
|
474
475
|
getContainer: function getContainer() {
|
|
475
476
|
return containerRef.current;
|
|
476
477
|
}
|
|
477
|
-
}), /*#__PURE__*/_react.default.createElement(_InputBox.default, null), /*#__PURE__*/_react.default.createElement(_NotationBoxes.default, null), /*#__PURE__*/_react.default.createElement("div", {
|
|
478
|
+
}), /*#__PURE__*/_react.default.createElement(_InputBox.default, null), /*#__PURE__*/_react.default.createElement(_NotationBoxes.default, null), /*#__PURE__*/_react.default.createElement(_ErrorState.default, null), /*#__PURE__*/_react.default.createElement("div", {
|
|
478
479
|
id: "luckysheet-multipleRange-show"
|
|
479
480
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
480
481
|
id: "luckysheet-dynamicArray-hightShow"
|
|
@@ -14,6 +14,10 @@ export declare function generateAPIs(context: Context, setContext: (recipe: (ctx
|
|
|
14
14
|
setCellValue: (row: number, column: number, value: any, options?: api.CommonOptions & {
|
|
15
15
|
type?: keyof Cell;
|
|
16
16
|
}) => void;
|
|
17
|
+
setCellError: (row: number, column: number, errorMessage: {
|
|
18
|
+
title: string;
|
|
19
|
+
message: string;
|
|
20
|
+
}) => void;
|
|
17
21
|
clearCell: (row: number, column: number, options?: api.CommonOptions) => void;
|
|
18
22
|
setCellFormat: (row: number, column: number, attr: keyof Cell, value: any, options?: api.CommonOptions) => void;
|
|
19
23
|
autoFillCell: (copyRange: SingleRange, applyRange: SingleRange, direction: "up" | "down" | "left" | "right") => void;
|
|
@@ -146,6 +146,11 @@ function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cel
|
|
|
146
146
|
return _fortuneCore.api.setCellValue(draftCtx, row, column, value, cellInput, options);
|
|
147
147
|
});
|
|
148
148
|
},
|
|
149
|
+
setCellError: function setCellError(row, column, errorMessage) {
|
|
150
|
+
setContext(function (draftCtx) {
|
|
151
|
+
_fortuneCore.api.setCellError(draftCtx, row, column, errorMessage);
|
|
152
|
+
});
|
|
153
|
+
},
|
|
149
154
|
clearCell: function clearCell(row, column, options) {
|
|
150
155
|
if (options === void 0) {
|
|
151
156
|
options = {};
|
|
@@ -12,17 +12,21 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
|
|
|
12
12
|
applyOp: (ops: Op[]) => void;
|
|
13
13
|
getCryptoPrice: typeof getCryptoPrice;
|
|
14
14
|
getCellValue: (row: number, column: number, options?: api.CommonOptions & {
|
|
15
|
-
type?: "rt" | "m" | "v" | "mc" | "f" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | keyof import("@fileverse-dev/fortune-core").CellStyle | undefined;
|
|
15
|
+
type?: "rt" | "m" | "error" | "v" | "mc" | "f" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | keyof import("@fileverse-dev/fortune-core").CellStyle | undefined;
|
|
16
16
|
}) => any;
|
|
17
17
|
onboardingActiveCell: (functionName: string) => void;
|
|
18
18
|
initializeComment: (row: number, column: number) => void;
|
|
19
19
|
updateSheetLiveQueryList: (subsheetIndex: number, _data: import("@fileverse-dev/fortune-core").LiveQueryData) => void;
|
|
20
20
|
removeFromLiveQueryList: (subSheetIndex: number, id: string) => void;
|
|
21
21
|
setCellValue: (row: number, column: number, value: any, options?: api.CommonOptions & {
|
|
22
|
-
type?: "rt" | "m" | "v" | "mc" | "f" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | keyof import("@fileverse-dev/fortune-core").CellStyle | undefined;
|
|
22
|
+
type?: "rt" | "m" | "error" | "v" | "mc" | "f" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | keyof import("@fileverse-dev/fortune-core").CellStyle | undefined;
|
|
23
|
+
}) => void;
|
|
24
|
+
setCellError: (row: number, column: number, errorMessage: {
|
|
25
|
+
title: string;
|
|
26
|
+
message: string;
|
|
23
27
|
}) => void;
|
|
24
28
|
clearCell: (row: number, column: number, options?: api.CommonOptions) => void;
|
|
25
|
-
setCellFormat: (row: number, column: number, attr: "rt" | "m" | "v" | "mc" | "f" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | keyof import("@fileverse-dev/fortune-core").CellStyle, value: any, options?: api.CommonOptions) => void;
|
|
29
|
+
setCellFormat: (row: number, column: number, attr: "rt" | "m" | "error" | "v" | "mc" | "f" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | keyof import("@fileverse-dev/fortune-core").CellStyle, value: any, options?: api.CommonOptions) => void;
|
|
26
30
|
autoFillCell: (copyRange: import("@fileverse-dev/fortune-core").SingleRange, applyRange: import("@fileverse-dev/fortune-core").SingleRange, direction: "left" | "right" | "down" | "up") => void;
|
|
27
31
|
freeze: (type: "column" | "both" | "row", range: {
|
|
28
32
|
row: number;
|
|
@@ -53,7 +57,7 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
|
|
|
53
57
|
getHtmlByRange: (range: import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => string | null;
|
|
54
58
|
setSelection: (range: import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => void;
|
|
55
59
|
setCellValuesByRange: (data: any[][], range: import("@fileverse-dev/fortune-core").SingleRange, options?: api.CommonOptions) => void;
|
|
56
|
-
setCellFormatByRange: (attr: "rt" | "m" | "v" | "mc" | "f" | "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").SingleRange | import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => void;
|
|
60
|
+
setCellFormatByRange: (attr: "rt" | "m" | "error" | "v" | "mc" | "f" | "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").SingleRange | import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => void;
|
|
57
61
|
mergeCells: (ranges: import("@fileverse-dev/fortune-core").Range, type: string, options?: api.CommonOptions) => void;
|
|
58
62
|
cancelMerge: (ranges: import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => void;
|
|
59
63
|
getAllSheets: () => SheetType[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fileverse-dev/fortune-react",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.69",
|
|
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.1.
|
|
19
|
+
"@fileverse-dev/fortune-core": "1.1.69",
|
|
20
20
|
"@fileverse/ui": "^4.1.7-patch-21",
|
|
21
21
|
"@tippyjs/react": "^4.2.6",
|
|
22
22
|
"@types/regenerator-runtime": "^0.13.6",
|