@fileverse-dev/fortune-react 1.1.43 → 1.1.45
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/SheetOverlay/InputBox.js +12 -7
- package/es/components/SheetOverlay/helper.js +2 -2
- package/es/components/Toolbar/index.js +2 -0
- package/lib/components/SheetOverlay/InputBox.js +12 -7
- package/lib/components/SheetOverlay/helper.js +2 -2
- package/lib/components/Toolbar/index.js +2 -0
- package/package.json +2 -2
|
@@ -46,23 +46,21 @@ var InputBox = function InputBox() {
|
|
|
46
46
|
frozenPosition = _m[0],
|
|
47
47
|
setFrozenPosition = _m[1];
|
|
48
48
|
var firstSelection = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0];
|
|
49
|
+
var _o = useState({}),
|
|
50
|
+
firstSelectionActiveCell = _o[0],
|
|
51
|
+
setFirstSelectionActiveCell = _o[1];
|
|
49
52
|
var row_index = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.row_focus;
|
|
50
53
|
var col_index = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.column_focus;
|
|
51
54
|
var preText = useRef("");
|
|
52
55
|
var placeRef = useRef("");
|
|
53
|
-
useEffect(function () {
|
|
54
|
-
if (isInputBoxActive) {
|
|
55
|
-
setActiveCell(getCellAddress());
|
|
56
|
-
}
|
|
57
|
-
}, [isInputBoxActive]);
|
|
58
56
|
var inputBoxStyle = useMemo(function () {
|
|
59
57
|
if (firstSelection && context.luckysheetCellUpdate.length > 0) {
|
|
60
58
|
var flowdata = getFlowdata(context);
|
|
61
59
|
if (!flowdata) return {};
|
|
62
|
-
return getStyleByCell(context, flowdata,
|
|
60
|
+
return getStyleByCell(context, flowdata, firstSelectionActiveCell.row_focus, firstSelectionActiveCell.column_focus);
|
|
63
61
|
}
|
|
64
62
|
return {};
|
|
65
|
-
}, [context.luckysheetfile, context.currentSheetId, context.luckysheetCellUpdate, firstSelection]);
|
|
63
|
+
}, [context.luckysheetfile, context.currentSheetId, context.luckysheetCellUpdate, firstSelection, firstSelectionActiveCell]);
|
|
66
64
|
useLayoutEffect(function () {
|
|
67
65
|
var _a;
|
|
68
66
|
if (!context.allowEdit) {
|
|
@@ -394,6 +392,13 @@ var InputBox = function InputBox() {
|
|
|
394
392
|
var rowNumber = rowIndex + 1;
|
|
395
393
|
return "".concat(columnChar).concat(rowNumber);
|
|
396
394
|
}, [firstSelection]);
|
|
395
|
+
useEffect(function () {
|
|
396
|
+
var _a;
|
|
397
|
+
if (isInputBoxActive) {
|
|
398
|
+
setActiveCell(getCellAddress());
|
|
399
|
+
setFirstSelectionActiveCell((_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0]);
|
|
400
|
+
}
|
|
401
|
+
}, [isInputBoxActive]);
|
|
397
402
|
var wraperGetCell = function wraperGetCell() {
|
|
398
403
|
var cell = getCellAddress();
|
|
399
404
|
placeRef.current = cell;
|
|
@@ -33,7 +33,7 @@ function parseCell(input) {
|
|
|
33
33
|
}
|
|
34
34
|
function columnToNumber(colPart) {
|
|
35
35
|
var colNumber = 0;
|
|
36
|
-
for (var i = 0; i < colPart.length; i
|
|
36
|
+
for (var i = 0; i < colPart.length; i += 1) {
|
|
37
37
|
colNumber = colNumber * 26 + (colPart.charCodeAt(i) - 64);
|
|
38
38
|
}
|
|
39
39
|
return colNumber;
|
|
@@ -41,7 +41,7 @@ function columnToNumber(colPart) {
|
|
|
41
41
|
function numberToColumn(colNumber) {
|
|
42
42
|
var colPart = "";
|
|
43
43
|
while (colNumber > 0) {
|
|
44
|
-
colNumber
|
|
44
|
+
colNumber -= 1;
|
|
45
45
|
colPart = String.fromCharCode(65 + colNumber % 26) + colPart;
|
|
46
46
|
colNumber = Math.floor(colNumber / 26);
|
|
47
47
|
}
|
|
@@ -647,6 +647,8 @@ var Toolbar = function Toolbar(_a) {
|
|
|
647
647
|
if ((curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) != null) {
|
|
648
648
|
if (format != null) {
|
|
649
649
|
currentFmt = format.text;
|
|
650
|
+
} else if (curr_2.fa === "#,##0" || curr_2.fa === "#,##0.00" || curr_2.fa === "0" || curr_2.fa === "0.00") {
|
|
651
|
+
currentFmt = "Number";
|
|
650
652
|
} else {
|
|
651
653
|
currentFmt = defaultFormat[defaultFormat.length - 1].text;
|
|
652
654
|
}
|
|
@@ -55,23 +55,21 @@ var InputBox = function InputBox() {
|
|
|
55
55
|
frozenPosition = _m[0],
|
|
56
56
|
setFrozenPosition = _m[1];
|
|
57
57
|
var firstSelection = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0];
|
|
58
|
+
var _o = (0, _react.useState)({}),
|
|
59
|
+
firstSelectionActiveCell = _o[0],
|
|
60
|
+
setFirstSelectionActiveCell = _o[1];
|
|
58
61
|
var row_index = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.row_focus;
|
|
59
62
|
var col_index = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.column_focus;
|
|
60
63
|
var preText = (0, _react.useRef)("");
|
|
61
64
|
var placeRef = (0, _react.useRef)("");
|
|
62
|
-
(0, _react.useEffect)(function () {
|
|
63
|
-
if (isInputBoxActive) {
|
|
64
|
-
setActiveCell(getCellAddress());
|
|
65
|
-
}
|
|
66
|
-
}, [isInputBoxActive]);
|
|
67
65
|
var inputBoxStyle = (0, _react.useMemo)(function () {
|
|
68
66
|
if (firstSelection && context.luckysheetCellUpdate.length > 0) {
|
|
69
67
|
var flowdata = (0, _fortuneCore.getFlowdata)(context);
|
|
70
68
|
if (!flowdata) return {};
|
|
71
|
-
return (0, _fortuneCore.getStyleByCell)(context, flowdata,
|
|
69
|
+
return (0, _fortuneCore.getStyleByCell)(context, flowdata, firstSelectionActiveCell.row_focus, firstSelectionActiveCell.column_focus);
|
|
72
70
|
}
|
|
73
71
|
return {};
|
|
74
|
-
}, [context.luckysheetfile, context.currentSheetId, context.luckysheetCellUpdate, firstSelection]);
|
|
72
|
+
}, [context.luckysheetfile, context.currentSheetId, context.luckysheetCellUpdate, firstSelection, firstSelectionActiveCell]);
|
|
75
73
|
(0, _react.useLayoutEffect)(function () {
|
|
76
74
|
var _a;
|
|
77
75
|
if (!context.allowEdit) {
|
|
@@ -403,6 +401,13 @@ var InputBox = function InputBox() {
|
|
|
403
401
|
var rowNumber = rowIndex + 1;
|
|
404
402
|
return "".concat(columnChar).concat(rowNumber);
|
|
405
403
|
}, [firstSelection]);
|
|
404
|
+
(0, _react.useEffect)(function () {
|
|
405
|
+
var _a;
|
|
406
|
+
if (isInputBoxActive) {
|
|
407
|
+
setActiveCell(getCellAddress());
|
|
408
|
+
setFirstSelectionActiveCell((_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0]);
|
|
409
|
+
}
|
|
410
|
+
}, [isInputBoxActive]);
|
|
406
411
|
var wraperGetCell = function wraperGetCell() {
|
|
407
412
|
var cell = getCellAddress();
|
|
408
413
|
placeRef.current = cell;
|
|
@@ -45,7 +45,7 @@ function parseCell(input) {
|
|
|
45
45
|
}
|
|
46
46
|
function columnToNumber(colPart) {
|
|
47
47
|
var colNumber = 0;
|
|
48
|
-
for (var i = 0; i < colPart.length; i
|
|
48
|
+
for (var i = 0; i < colPart.length; i += 1) {
|
|
49
49
|
colNumber = colNumber * 26 + (colPart.charCodeAt(i) - 64);
|
|
50
50
|
}
|
|
51
51
|
return colNumber;
|
|
@@ -53,7 +53,7 @@ function columnToNumber(colPart) {
|
|
|
53
53
|
function numberToColumn(colNumber) {
|
|
54
54
|
var colPart = "";
|
|
55
55
|
while (colNumber > 0) {
|
|
56
|
-
colNumber
|
|
56
|
+
colNumber -= 1;
|
|
57
57
|
colPart = String.fromCharCode(65 + colNumber % 26) + colPart;
|
|
58
58
|
colNumber = Math.floor(colNumber / 26);
|
|
59
59
|
}
|
|
@@ -656,6 +656,8 @@ var Toolbar = function Toolbar(_a) {
|
|
|
656
656
|
if ((curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) != null) {
|
|
657
657
|
if (format != null) {
|
|
658
658
|
currentFmt = format.text;
|
|
659
|
+
} else if (curr_2.fa === "#,##0" || curr_2.fa === "#,##0.00" || curr_2.fa === "0" || curr_2.fa === "0.00") {
|
|
660
|
+
currentFmt = "Number";
|
|
659
661
|
} else {
|
|
660
662
|
currentFmt = defaultFormat[defaultFormat.length - 1].text;
|
|
661
663
|
}
|
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.45",
|
|
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.45",
|
|
20
20
|
"@fileverse/ui": "^4.1.7-patch-21",
|
|
21
21
|
"@tippyjs/react": "^4.2.6",
|
|
22
22
|
"@types/regenerator-runtime": "^0.13.6",
|