@fileverse-dev/fortune-react 1.2.54 → 1.2.56
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.
|
@@ -85,20 +85,18 @@ var FxEditor = function FxEditor() {
|
|
|
85
85
|
return document.querySelector(".luckysheet-formula-search-item-active");
|
|
86
86
|
}, []);
|
|
87
87
|
var insertSelectedFormula = useCallback(function (formulaName) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
cellEditor.innerHTML = ht;
|
|
94
|
-
}
|
|
95
|
-
moveCursorToEnd(refs.fxInput.current);
|
|
96
|
-
setContext(function (draftCtx) {
|
|
97
|
-
draftCtx.functionCandidates = [];
|
|
98
|
-
draftCtx.defaultCandidates = [];
|
|
99
|
-
draftCtx.functionHint = formulaName;
|
|
100
|
-
});
|
|
88
|
+
var ht = "<span dir=\"auto\" class=\"luckysheet-formula-text-color\">=</span><span dir=\"auto\" class=\"luckysheet-formula-text-func\">".concat(formulaName, "</span><span dir=\"auto\" class=\"luckysheet-formula-text-lpar\">(</span>");
|
|
89
|
+
refs.fxInput.current.innerHTML = ht;
|
|
90
|
+
var cellEditor = document.getElementById("luckysheet-rich-text-editor");
|
|
91
|
+
if (cellEditor) {
|
|
92
|
+
cellEditor.innerHTML = ht;
|
|
101
93
|
}
|
|
94
|
+
moveCursorToEnd(refs.fxInput.current);
|
|
95
|
+
setContext(function (draftCtx) {
|
|
96
|
+
draftCtx.functionCandidates = [];
|
|
97
|
+
draftCtx.defaultCandidates = [];
|
|
98
|
+
draftCtx.functionHint = formulaName;
|
|
99
|
+
});
|
|
102
100
|
}, [setContext]);
|
|
103
101
|
var clearSearchItemActiveClass = useCallback(function () {
|
|
104
102
|
var activeFormula = getActiveFormula();
|
|
@@ -139,7 +137,7 @@ var FxEditor = function FxEditor() {
|
|
|
139
137
|
if (key === "ArrowLeft" || key === "ArrowRight") {
|
|
140
138
|
e.stopPropagation();
|
|
141
139
|
}
|
|
142
|
-
if (e.key === "Enter" && context.luckysheetCellUpdate.length > 0) {
|
|
140
|
+
if ((e.key === "Enter" || e.key === "Tab") && context.luckysheetCellUpdate.length > 0) {
|
|
143
141
|
if (e.altKey || e.metaKey) {
|
|
144
142
|
document.execCommand("insertHTML", false, "\n ");
|
|
145
143
|
document.execCommand("delete", false);
|
|
@@ -94,20 +94,18 @@ var FxEditor = function FxEditor() {
|
|
|
94
94
|
return document.querySelector(".luckysheet-formula-search-item-active");
|
|
95
95
|
}, []);
|
|
96
96
|
var insertSelectedFormula = (0, _react.useCallback)(function (formulaName) {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
cellEditor.innerHTML = ht;
|
|
103
|
-
}
|
|
104
|
-
(0, _helper.moveCursorToEnd)(refs.fxInput.current);
|
|
105
|
-
setContext(function (draftCtx) {
|
|
106
|
-
draftCtx.functionCandidates = [];
|
|
107
|
-
draftCtx.defaultCandidates = [];
|
|
108
|
-
draftCtx.functionHint = formulaName;
|
|
109
|
-
});
|
|
97
|
+
var ht = "<span dir=\"auto\" class=\"luckysheet-formula-text-color\">=</span><span dir=\"auto\" class=\"luckysheet-formula-text-func\">".concat(formulaName, "</span><span dir=\"auto\" class=\"luckysheet-formula-text-lpar\">(</span>");
|
|
98
|
+
refs.fxInput.current.innerHTML = ht;
|
|
99
|
+
var cellEditor = document.getElementById("luckysheet-rich-text-editor");
|
|
100
|
+
if (cellEditor) {
|
|
101
|
+
cellEditor.innerHTML = ht;
|
|
110
102
|
}
|
|
103
|
+
(0, _helper.moveCursorToEnd)(refs.fxInput.current);
|
|
104
|
+
setContext(function (draftCtx) {
|
|
105
|
+
draftCtx.functionCandidates = [];
|
|
106
|
+
draftCtx.defaultCandidates = [];
|
|
107
|
+
draftCtx.functionHint = formulaName;
|
|
108
|
+
});
|
|
111
109
|
}, [setContext]);
|
|
112
110
|
var clearSearchItemActiveClass = (0, _react.useCallback)(function () {
|
|
113
111
|
var activeFormula = getActiveFormula();
|
|
@@ -148,7 +146,7 @@ var FxEditor = function FxEditor() {
|
|
|
148
146
|
if (key === "ArrowLeft" || key === "ArrowRight") {
|
|
149
147
|
e.stopPropagation();
|
|
150
148
|
}
|
|
151
|
-
if (e.key === "Enter" && context.luckysheetCellUpdate.length > 0) {
|
|
149
|
+
if ((e.key === "Enter" || e.key === "Tab") && context.luckysheetCellUpdate.length > 0) {
|
|
152
150
|
if (e.altKey || e.metaKey) {
|
|
153
151
|
document.execCommand("insertHTML", false, "\n ");
|
|
154
152
|
document.execCommand("delete", false);
|
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.56",
|
|
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.56",
|
|
20
20
|
"@fileverse/ui": "^4.1.7-patch-40",
|
|
21
21
|
"@tippyjs/react": "^4.2.6",
|
|
22
22
|
"@types/regenerator-runtime": "^0.13.6",
|