@fileverse-dev/fortune-react 1.1.11-patch-4 → 1.1.11
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/Sheet/index.js +87 -93
- package/es/components/SheetTab/index.js +3 -0
- package/es/components/Workbook/api.d.ts +1 -4
- package/es/components/Workbook/api.js +0 -28
- package/es/components/Workbook/index.d.ts +0 -3
- package/es/components/index.d.ts +1 -2
- package/es/components/index.js +1 -2
- package/lib/components/Sheet/index.js +86 -92
- package/lib/components/SheetTab/index.js +3 -0
- package/lib/components/Workbook/api.d.ts +1 -4
- package/lib/components/Workbook/api.js +0 -28
- package/lib/components/Workbook/index.d.ts +0 -3
- package/lib/components/index.d.ts +1 -2
- package/lib/components/index.js +0 -7
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useRef, useEffect, useContext, useCallback } from "react";
|
|
2
|
-
import { Canvas, updateContextWithCanvas, updateContextWithSheetData, handleGlobalWheel, initFreeze
|
|
2
|
+
import { Canvas, updateContextWithCanvas, updateContextWithSheetData, handleGlobalWheel, initFreeze } from "@fileverse-dev/fortune-core";
|
|
3
3
|
import "./index.css";
|
|
4
4
|
import WorkbookContext from "../../context";
|
|
5
5
|
import SheetOverlay from "../SheetOverlay";
|
|
@@ -45,109 +45,103 @@ var Sheet = function Sheet(_a) {
|
|
|
45
45
|
initFreeze(context, refs.globalCache, context.currentSheetId);
|
|
46
46
|
}, [refs.globalCache, sheet.frozen, context.currentSheetId, context.visibledatacolumn, context.visibledatarow]);
|
|
47
47
|
useEffect(function () {
|
|
48
|
+
var _a, _b, _c, _d, _e;
|
|
48
49
|
if (context.groupValuesRefreshData.length > 0) {
|
|
49
50
|
return;
|
|
50
51
|
}
|
|
51
52
|
var tableCanvas = new Canvas(refs.canvas.current, context);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
horizontalScrollTop = horizontalData[2];
|
|
99
|
-
tableCanvas.drawMain({
|
|
100
|
-
scrollWidth: context.scrollLeft,
|
|
101
|
-
scrollHeight: context.scrollTop + horizontalPx - horizontalScrollTop,
|
|
102
|
-
offsetTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight,
|
|
103
|
-
clear: true
|
|
104
|
-
});
|
|
105
|
-
tableCanvas.drawMain({
|
|
106
|
-
scrollWidth: context.scrollLeft,
|
|
107
|
-
scrollHeight: horizontalScrollTop,
|
|
108
|
-
drawHeight: horizontalPx
|
|
109
|
-
});
|
|
110
|
-
tableCanvas.drawColumnHeader(context.scrollLeft);
|
|
111
|
-
tableCanvas.drawRowHeader(context.scrollTop + horizontalPx - horizontalScrollTop, undefined, horizontalPx - horizontalScrollTop + context.columnHeaderHeight);
|
|
112
|
-
tableCanvas.drawRowHeader(horizontalScrollTop, horizontalPx);
|
|
113
|
-
tableCanvas.drawFreezeLine({
|
|
114
|
-
horizontalTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight - 2
|
|
115
|
-
});
|
|
116
|
-
} else if (verticallData) {
|
|
117
|
-
var verticalPx = verticallData[0],
|
|
118
|
-
verticalScrollWidth = verticallData[2];
|
|
119
|
-
tableCanvas.drawMain({
|
|
120
|
-
scrollWidth: context.scrollLeft + verticalPx - verticalScrollWidth,
|
|
121
|
-
scrollHeight: context.scrollTop,
|
|
122
|
-
offsetLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth
|
|
123
|
-
});
|
|
124
|
-
tableCanvas.drawMain({
|
|
125
|
-
scrollWidth: verticalScrollWidth,
|
|
126
|
-
scrollHeight: context.scrollTop,
|
|
127
|
-
drawWidth: verticalPx
|
|
128
|
-
});
|
|
129
|
-
tableCanvas.drawRowHeader(context.scrollTop);
|
|
130
|
-
tableCanvas.drawColumnHeader(context.scrollLeft + verticalPx - verticalScrollWidth, undefined, verticalPx - verticalScrollWidth + context.rowHeaderWidth);
|
|
131
|
-
tableCanvas.drawColumnHeader(verticalScrollWidth, verticalPx);
|
|
132
|
-
tableCanvas.drawFreezeLine({
|
|
133
|
-
verticalLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth - 2
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
} else {
|
|
53
|
+
if (tableCanvas == null) return;
|
|
54
|
+
var freeze = (_a = refs.globalCache.freezen) === null || _a === void 0 ? void 0 : _a[sheet.id];
|
|
55
|
+
if (((_b = freeze === null || freeze === void 0 ? void 0 : freeze.horizontal) === null || _b === void 0 ? void 0 : _b.freezenhorizontaldata) || ((_c = freeze === null || freeze === void 0 ? void 0 : freeze.vertical) === null || _c === void 0 ? void 0 : _c.freezenverticaldata)) {
|
|
56
|
+
var horizontalData = (_d = freeze === null || freeze === void 0 ? void 0 : freeze.horizontal) === null || _d === void 0 ? void 0 : _d.freezenhorizontaldata;
|
|
57
|
+
var verticallData = (_e = freeze === null || freeze === void 0 ? void 0 : freeze.vertical) === null || _e === void 0 ? void 0 : _e.freezenverticaldata;
|
|
58
|
+
if (horizontalData && verticallData) {
|
|
59
|
+
var horizontalPx = horizontalData[0],
|
|
60
|
+
horizontalScrollTop = horizontalData[2];
|
|
61
|
+
var verticalPx = verticallData[0],
|
|
62
|
+
verticalScrollWidth = verticallData[2];
|
|
63
|
+
tableCanvas.drawMain({
|
|
64
|
+
scrollWidth: context.scrollLeft + verticalPx - verticalScrollWidth,
|
|
65
|
+
scrollHeight: context.scrollTop + horizontalPx - horizontalScrollTop,
|
|
66
|
+
offsetLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth,
|
|
67
|
+
offsetTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight,
|
|
68
|
+
clear: true
|
|
69
|
+
});
|
|
70
|
+
tableCanvas.drawMain({
|
|
71
|
+
scrollWidth: context.scrollLeft + verticalPx - verticalScrollWidth,
|
|
72
|
+
scrollHeight: horizontalScrollTop,
|
|
73
|
+
drawHeight: horizontalPx,
|
|
74
|
+
offsetLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth
|
|
75
|
+
});
|
|
76
|
+
tableCanvas.drawMain({
|
|
77
|
+
scrollWidth: verticalScrollWidth,
|
|
78
|
+
scrollHeight: context.scrollTop + horizontalPx - horizontalScrollTop,
|
|
79
|
+
drawWidth: verticalPx,
|
|
80
|
+
offsetTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight
|
|
81
|
+
});
|
|
82
|
+
tableCanvas.drawMain({
|
|
83
|
+
scrollWidth: verticalScrollWidth,
|
|
84
|
+
scrollHeight: horizontalScrollTop,
|
|
85
|
+
drawWidth: verticalPx,
|
|
86
|
+
drawHeight: horizontalPx
|
|
87
|
+
});
|
|
88
|
+
tableCanvas.drawColumnHeader(context.scrollLeft + verticalPx - verticalScrollWidth, undefined, verticalPx - verticalScrollWidth + context.rowHeaderWidth);
|
|
89
|
+
tableCanvas.drawColumnHeader(verticalScrollWidth, verticalPx);
|
|
90
|
+
tableCanvas.drawRowHeader(context.scrollTop + horizontalPx - horizontalScrollTop, undefined, horizontalPx - horizontalScrollTop + context.columnHeaderHeight);
|
|
91
|
+
tableCanvas.drawRowHeader(horizontalScrollTop, horizontalPx);
|
|
92
|
+
tableCanvas.drawFreezeLine({
|
|
93
|
+
horizontalTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight - 2,
|
|
94
|
+
verticalLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth - 2
|
|
95
|
+
});
|
|
96
|
+
} else if (horizontalData) {
|
|
97
|
+
var horizontalPx = horizontalData[0],
|
|
98
|
+
horizontalScrollTop = horizontalData[2];
|
|
137
99
|
tableCanvas.drawMain({
|
|
138
100
|
scrollWidth: context.scrollLeft,
|
|
139
|
-
scrollHeight: context.scrollTop,
|
|
101
|
+
scrollHeight: context.scrollTop + horizontalPx - horizontalScrollTop,
|
|
102
|
+
offsetTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight,
|
|
140
103
|
clear: true
|
|
141
104
|
});
|
|
105
|
+
tableCanvas.drawMain({
|
|
106
|
+
scrollWidth: context.scrollLeft,
|
|
107
|
+
scrollHeight: horizontalScrollTop,
|
|
108
|
+
drawHeight: horizontalPx
|
|
109
|
+
});
|
|
142
110
|
tableCanvas.drawColumnHeader(context.scrollLeft);
|
|
111
|
+
tableCanvas.drawRowHeader(context.scrollTop + horizontalPx - horizontalScrollTop, undefined, horizontalPx - horizontalScrollTop + context.columnHeaderHeight);
|
|
112
|
+
tableCanvas.drawRowHeader(horizontalScrollTop, horizontalPx);
|
|
113
|
+
tableCanvas.drawFreezeLine({
|
|
114
|
+
horizontalTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight - 2
|
|
115
|
+
});
|
|
116
|
+
} else if (verticallData) {
|
|
117
|
+
var verticalPx = verticallData[0],
|
|
118
|
+
verticalScrollWidth = verticallData[2];
|
|
119
|
+
tableCanvas.drawMain({
|
|
120
|
+
scrollWidth: context.scrollLeft + verticalPx - verticalScrollWidth,
|
|
121
|
+
scrollHeight: context.scrollTop,
|
|
122
|
+
offsetLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth
|
|
123
|
+
});
|
|
124
|
+
tableCanvas.drawMain({
|
|
125
|
+
scrollWidth: verticalScrollWidth,
|
|
126
|
+
scrollHeight: context.scrollTop,
|
|
127
|
+
drawWidth: verticalPx
|
|
128
|
+
});
|
|
143
129
|
tableCanvas.drawRowHeader(context.scrollTop);
|
|
130
|
+
tableCanvas.drawColumnHeader(context.scrollLeft + verticalPx - verticalScrollWidth, undefined, verticalPx - verticalScrollWidth + context.rowHeaderWidth);
|
|
131
|
+
tableCanvas.drawColumnHeader(verticalScrollWidth, verticalPx);
|
|
132
|
+
tableCanvas.drawFreezeLine({
|
|
133
|
+
verticalLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth - 2
|
|
134
|
+
});
|
|
144
135
|
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
136
|
+
} else {
|
|
137
|
+
tableCanvas.drawMain({
|
|
138
|
+
scrollWidth: context.scrollLeft,
|
|
139
|
+
scrollHeight: context.scrollTop,
|
|
140
|
+
clear: true
|
|
141
|
+
});
|
|
142
|
+
tableCanvas.drawColumnHeader(context.scrollLeft);
|
|
143
|
+
tableCanvas.drawRowHeader(context.scrollTop);
|
|
144
|
+
}
|
|
151
145
|
}, [context, refs.canvas, refs.globalCache.freezen, setContext, sheet.id]);
|
|
152
146
|
var onWheel = useCallback(function (e) {
|
|
153
147
|
var _a, _b;
|
|
@@ -86,6 +86,9 @@ var SheetTab = function SheetTab() {
|
|
|
86
86
|
setCalInfo(re);
|
|
87
87
|
}
|
|
88
88
|
}, [context.luckysheet_select_save]);
|
|
89
|
+
useEffect(function () {
|
|
90
|
+
console.log(calInfo, "calInfo");
|
|
91
|
+
}, [calInfo]);
|
|
89
92
|
useEffect(function () {
|
|
90
93
|
var tabCurrent = tabContainerRef.current;
|
|
91
94
|
if (!tabCurrent) return;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { api, Cell, Context, Op, Range, Selection, Presence, Settings, SingleRange, Sheet, CellMatrix, CellWithRowAndCol, GlobalCache
|
|
1
|
+
import { api, Cell, Context, Op, Range, Selection, Presence, Settings, SingleRange, Sheet, CellMatrix, CellWithRowAndCol, GlobalCache } from "@fileverse-dev/fortune-core";
|
|
2
2
|
import { getCryptoPrice } from "../../utils/cryptoApi";
|
|
3
3
|
import { SetContextOptions } from "../../context";
|
|
4
4
|
export declare function generateAPIs(context: Context, setContext: (recipe: (ctx: Context) => void, options?: SetContextOptions) => void, handleUndo: () => void, handleRedo: () => void, settings: Required<Settings>, cellInput: HTMLDivElement | null, scrollbarX: HTMLDivElement | null, scrollbarY: HTMLDivElement | null, globalCache: GlobalCache | null): {
|
|
@@ -9,8 +9,6 @@ export declare function generateAPIs(context: Context, setContext: (recipe: (ctx
|
|
|
9
9
|
}) => any;
|
|
10
10
|
onboardingActiveCell: (functionName: string) => void;
|
|
11
11
|
initializeComment: (row: number, column: number) => void;
|
|
12
|
-
updateSheetLiveQueryList: (subsheetIndex: number, _data: LiveQueryData) => void;
|
|
13
|
-
removeFromLiveQueryList: (subSheetIndex: number, id: string) => void;
|
|
14
12
|
setCellValue: (row: number, column: number, value: any, options?: api.CommonOptions & {
|
|
15
13
|
type?: keyof Cell;
|
|
16
14
|
}) => void;
|
|
@@ -111,7 +109,6 @@ export declare function generateAPIs(context: Context, setContext: (recipe: (ctx
|
|
|
111
109
|
column_focus: number;
|
|
112
110
|
} | undefined;
|
|
113
111
|
} | undefined;
|
|
114
|
-
liveQueryList?: Record<string, LiveQueryData> | undefined;
|
|
115
112
|
};
|
|
116
113
|
addSheet: () => void;
|
|
117
114
|
deleteSheet: (options?: api.CommonOptions) => void;
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
var __assign = this && this.__assign || function () {
|
|
2
|
-
__assign = Object.assign || function (t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
6
|
-
}
|
|
7
|
-
return t;
|
|
8
|
-
};
|
|
9
|
-
return __assign.apply(this, arguments);
|
|
10
|
-
};
|
|
11
1
|
import { addSheet, api, deleteRowCol, deleteSheet, insertRowCol, opToPatch, createFilterOptions, getSheetIndex, locale, setCaretPosition, newComment } from "@fileverse-dev/fortune-core";
|
|
12
2
|
import { applyPatches } from "immer";
|
|
13
3
|
import _ from "lodash";
|
|
@@ -113,24 +103,6 @@ export function generateAPIs(context, setContext, handleUndo, handleRedo, settin
|
|
|
113
103
|
newComment(ctx, undefined, row, column);
|
|
114
104
|
});
|
|
115
105
|
},
|
|
116
|
-
updateSheetLiveQueryList: function updateSheetLiveQueryList(subsheetIndex, _data) {
|
|
117
|
-
setContext(function (ctx) {
|
|
118
|
-
var _a;
|
|
119
|
-
var previousLiveQuery = ctx.luckysheetfile[subsheetIndex].liveQueryList;
|
|
120
|
-
ctx.luckysheetfile[subsheetIndex] = __assign(__assign({}, ctx.luckysheetfile[subsheetIndex]), {
|
|
121
|
-
liveQueryList: __assign(__assign({}, previousLiveQuery), (_a = {}, _a["".concat(_data.data.id)] = _data, _a))
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
},
|
|
125
|
-
removeFromLiveQueryList: function removeFromLiveQueryList(subSheetIndex, id) {
|
|
126
|
-
setContext(function (ctx) {
|
|
127
|
-
var previousLiveQuery = __assign({}, ctx.luckysheetfile[subSheetIndex].liveQueryList);
|
|
128
|
-
previousLiveQuery === null || previousLiveQuery === void 0 ? true : delete previousLiveQuery[id];
|
|
129
|
-
ctx.luckysheetfile[subSheetIndex] = __assign(__assign({}, ctx.luckysheetfile[subSheetIndex]), {
|
|
130
|
-
liveQueryList: previousLiveQuery
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
},
|
|
134
106
|
setCellValue: function setCellValue(row, column, value, options) {
|
|
135
107
|
if (options === void 0) {
|
|
136
108
|
options = {};
|
|
@@ -16,8 +16,6 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
|
|
|
16
16
|
}) => any;
|
|
17
17
|
onboardingActiveCell: (functionName: string) => void;
|
|
18
18
|
initializeComment: (row: number, column: number) => void;
|
|
19
|
-
updateSheetLiveQueryList: (subsheetIndex: number, _data: import("@fileverse-dev/fortune-core").LiveQueryData) => void;
|
|
20
|
-
removeFromLiveQueryList: (subSheetIndex: number, id: string) => void;
|
|
21
19
|
setCellValue: (row: number, column: number, value: any, options?: api.CommonOptions & {
|
|
22
20
|
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;
|
|
23
21
|
}) => void;
|
|
@@ -118,7 +116,6 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
|
|
|
118
116
|
column_focus: number;
|
|
119
117
|
} | undefined;
|
|
120
118
|
} | undefined;
|
|
121
|
-
liveQueryList?: Record<string, import("@fileverse-dev/fortune-core").LiveQueryData> | undefined;
|
|
122
119
|
};
|
|
123
120
|
addSheet: () => void;
|
|
124
121
|
deleteSheet: (options?: api.CommonOptions) => void;
|
package/es/components/index.d.ts
CHANGED
|
@@ -2,5 +2,4 @@ import Workbook from "./Workbook";
|
|
|
2
2
|
export { ERROR_MESSAGES_FLAG, SERVICES_API_KEY, } from "@fileverse-dev/formulajs/crypto-constants";
|
|
3
3
|
export { Workbook };
|
|
4
4
|
export type { WorkbookInstance } from "./Workbook";
|
|
5
|
-
export type { Cell, Sheet
|
|
6
|
-
export { markCellChanged as animateChangedCell } from "@fileverse-dev/fortune-core";
|
|
5
|
+
export type { Cell, Sheet } from "@fileverse-dev/fortune-core";
|
package/es/components/index.js
CHANGED
|
@@ -54,109 +54,103 @@ var Sheet = function Sheet(_a) {
|
|
|
54
54
|
(0, _fortuneCore.initFreeze)(context, refs.globalCache, context.currentSheetId);
|
|
55
55
|
}, [refs.globalCache, sheet.frozen, context.currentSheetId, context.visibledatacolumn, context.visibledatarow]);
|
|
56
56
|
(0, _react.useEffect)(function () {
|
|
57
|
+
var _a, _b, _c, _d, _e;
|
|
57
58
|
if (context.groupValuesRefreshData.length > 0) {
|
|
58
59
|
return;
|
|
59
60
|
}
|
|
60
61
|
var tableCanvas = new _fortuneCore.Canvas(refs.canvas.current, context);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
horizontalScrollTop = horizontalData[2];
|
|
108
|
-
tableCanvas.drawMain({
|
|
109
|
-
scrollWidth: context.scrollLeft,
|
|
110
|
-
scrollHeight: context.scrollTop + horizontalPx - horizontalScrollTop,
|
|
111
|
-
offsetTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight,
|
|
112
|
-
clear: true
|
|
113
|
-
});
|
|
114
|
-
tableCanvas.drawMain({
|
|
115
|
-
scrollWidth: context.scrollLeft,
|
|
116
|
-
scrollHeight: horizontalScrollTop,
|
|
117
|
-
drawHeight: horizontalPx
|
|
118
|
-
});
|
|
119
|
-
tableCanvas.drawColumnHeader(context.scrollLeft);
|
|
120
|
-
tableCanvas.drawRowHeader(context.scrollTop + horizontalPx - horizontalScrollTop, undefined, horizontalPx - horizontalScrollTop + context.columnHeaderHeight);
|
|
121
|
-
tableCanvas.drawRowHeader(horizontalScrollTop, horizontalPx);
|
|
122
|
-
tableCanvas.drawFreezeLine({
|
|
123
|
-
horizontalTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight - 2
|
|
124
|
-
});
|
|
125
|
-
} else if (verticallData) {
|
|
126
|
-
var verticalPx = verticallData[0],
|
|
127
|
-
verticalScrollWidth = verticallData[2];
|
|
128
|
-
tableCanvas.drawMain({
|
|
129
|
-
scrollWidth: context.scrollLeft + verticalPx - verticalScrollWidth,
|
|
130
|
-
scrollHeight: context.scrollTop,
|
|
131
|
-
offsetLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth
|
|
132
|
-
});
|
|
133
|
-
tableCanvas.drawMain({
|
|
134
|
-
scrollWidth: verticalScrollWidth,
|
|
135
|
-
scrollHeight: context.scrollTop,
|
|
136
|
-
drawWidth: verticalPx
|
|
137
|
-
});
|
|
138
|
-
tableCanvas.drawRowHeader(context.scrollTop);
|
|
139
|
-
tableCanvas.drawColumnHeader(context.scrollLeft + verticalPx - verticalScrollWidth, undefined, verticalPx - verticalScrollWidth + context.rowHeaderWidth);
|
|
140
|
-
tableCanvas.drawColumnHeader(verticalScrollWidth, verticalPx);
|
|
141
|
-
tableCanvas.drawFreezeLine({
|
|
142
|
-
verticalLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth - 2
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
} else {
|
|
62
|
+
if (tableCanvas == null) return;
|
|
63
|
+
var freeze = (_a = refs.globalCache.freezen) === null || _a === void 0 ? void 0 : _a[sheet.id];
|
|
64
|
+
if (((_b = freeze === null || freeze === void 0 ? void 0 : freeze.horizontal) === null || _b === void 0 ? void 0 : _b.freezenhorizontaldata) || ((_c = freeze === null || freeze === void 0 ? void 0 : freeze.vertical) === null || _c === void 0 ? void 0 : _c.freezenverticaldata)) {
|
|
65
|
+
var horizontalData = (_d = freeze === null || freeze === void 0 ? void 0 : freeze.horizontal) === null || _d === void 0 ? void 0 : _d.freezenhorizontaldata;
|
|
66
|
+
var verticallData = (_e = freeze === null || freeze === void 0 ? void 0 : freeze.vertical) === null || _e === void 0 ? void 0 : _e.freezenverticaldata;
|
|
67
|
+
if (horizontalData && verticallData) {
|
|
68
|
+
var horizontalPx = horizontalData[0],
|
|
69
|
+
horizontalScrollTop = horizontalData[2];
|
|
70
|
+
var verticalPx = verticallData[0],
|
|
71
|
+
verticalScrollWidth = verticallData[2];
|
|
72
|
+
tableCanvas.drawMain({
|
|
73
|
+
scrollWidth: context.scrollLeft + verticalPx - verticalScrollWidth,
|
|
74
|
+
scrollHeight: context.scrollTop + horizontalPx - horizontalScrollTop,
|
|
75
|
+
offsetLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth,
|
|
76
|
+
offsetTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight,
|
|
77
|
+
clear: true
|
|
78
|
+
});
|
|
79
|
+
tableCanvas.drawMain({
|
|
80
|
+
scrollWidth: context.scrollLeft + verticalPx - verticalScrollWidth,
|
|
81
|
+
scrollHeight: horizontalScrollTop,
|
|
82
|
+
drawHeight: horizontalPx,
|
|
83
|
+
offsetLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth
|
|
84
|
+
});
|
|
85
|
+
tableCanvas.drawMain({
|
|
86
|
+
scrollWidth: verticalScrollWidth,
|
|
87
|
+
scrollHeight: context.scrollTop + horizontalPx - horizontalScrollTop,
|
|
88
|
+
drawWidth: verticalPx,
|
|
89
|
+
offsetTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight
|
|
90
|
+
});
|
|
91
|
+
tableCanvas.drawMain({
|
|
92
|
+
scrollWidth: verticalScrollWidth,
|
|
93
|
+
scrollHeight: horizontalScrollTop,
|
|
94
|
+
drawWidth: verticalPx,
|
|
95
|
+
drawHeight: horizontalPx
|
|
96
|
+
});
|
|
97
|
+
tableCanvas.drawColumnHeader(context.scrollLeft + verticalPx - verticalScrollWidth, undefined, verticalPx - verticalScrollWidth + context.rowHeaderWidth);
|
|
98
|
+
tableCanvas.drawColumnHeader(verticalScrollWidth, verticalPx);
|
|
99
|
+
tableCanvas.drawRowHeader(context.scrollTop + horizontalPx - horizontalScrollTop, undefined, horizontalPx - horizontalScrollTop + context.columnHeaderHeight);
|
|
100
|
+
tableCanvas.drawRowHeader(horizontalScrollTop, horizontalPx);
|
|
101
|
+
tableCanvas.drawFreezeLine({
|
|
102
|
+
horizontalTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight - 2,
|
|
103
|
+
verticalLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth - 2
|
|
104
|
+
});
|
|
105
|
+
} else if (horizontalData) {
|
|
106
|
+
var horizontalPx = horizontalData[0],
|
|
107
|
+
horizontalScrollTop = horizontalData[2];
|
|
146
108
|
tableCanvas.drawMain({
|
|
147
109
|
scrollWidth: context.scrollLeft,
|
|
148
|
-
scrollHeight: context.scrollTop,
|
|
110
|
+
scrollHeight: context.scrollTop + horizontalPx - horizontalScrollTop,
|
|
111
|
+
offsetTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight,
|
|
149
112
|
clear: true
|
|
150
113
|
});
|
|
114
|
+
tableCanvas.drawMain({
|
|
115
|
+
scrollWidth: context.scrollLeft,
|
|
116
|
+
scrollHeight: horizontalScrollTop,
|
|
117
|
+
drawHeight: horizontalPx
|
|
118
|
+
});
|
|
151
119
|
tableCanvas.drawColumnHeader(context.scrollLeft);
|
|
120
|
+
tableCanvas.drawRowHeader(context.scrollTop + horizontalPx - horizontalScrollTop, undefined, horizontalPx - horizontalScrollTop + context.columnHeaderHeight);
|
|
121
|
+
tableCanvas.drawRowHeader(horizontalScrollTop, horizontalPx);
|
|
122
|
+
tableCanvas.drawFreezeLine({
|
|
123
|
+
horizontalTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight - 2
|
|
124
|
+
});
|
|
125
|
+
} else if (verticallData) {
|
|
126
|
+
var verticalPx = verticallData[0],
|
|
127
|
+
verticalScrollWidth = verticallData[2];
|
|
128
|
+
tableCanvas.drawMain({
|
|
129
|
+
scrollWidth: context.scrollLeft + verticalPx - verticalScrollWidth,
|
|
130
|
+
scrollHeight: context.scrollTop,
|
|
131
|
+
offsetLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth
|
|
132
|
+
});
|
|
133
|
+
tableCanvas.drawMain({
|
|
134
|
+
scrollWidth: verticalScrollWidth,
|
|
135
|
+
scrollHeight: context.scrollTop,
|
|
136
|
+
drawWidth: verticalPx
|
|
137
|
+
});
|
|
152
138
|
tableCanvas.drawRowHeader(context.scrollTop);
|
|
139
|
+
tableCanvas.drawColumnHeader(context.scrollLeft + verticalPx - verticalScrollWidth, undefined, verticalPx - verticalScrollWidth + context.rowHeaderWidth);
|
|
140
|
+
tableCanvas.drawColumnHeader(verticalScrollWidth, verticalPx);
|
|
141
|
+
tableCanvas.drawFreezeLine({
|
|
142
|
+
verticalLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth - 2
|
|
143
|
+
});
|
|
153
144
|
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
145
|
+
} else {
|
|
146
|
+
tableCanvas.drawMain({
|
|
147
|
+
scrollWidth: context.scrollLeft,
|
|
148
|
+
scrollHeight: context.scrollTop,
|
|
149
|
+
clear: true
|
|
150
|
+
});
|
|
151
|
+
tableCanvas.drawColumnHeader(context.scrollLeft);
|
|
152
|
+
tableCanvas.drawRowHeader(context.scrollTop);
|
|
153
|
+
}
|
|
160
154
|
}, [context, refs.canvas, refs.globalCache.freezen, setContext, sheet.id]);
|
|
161
155
|
var onWheel = (0, _react.useCallback)(function (e) {
|
|
162
156
|
var _a, _b;
|
|
@@ -95,6 +95,9 @@ var SheetTab = function SheetTab() {
|
|
|
95
95
|
setCalInfo(re);
|
|
96
96
|
}
|
|
97
97
|
}, [context.luckysheet_select_save]);
|
|
98
|
+
(0, _react.useEffect)(function () {
|
|
99
|
+
console.log(calInfo, "calInfo");
|
|
100
|
+
}, [calInfo]);
|
|
98
101
|
(0, _react.useEffect)(function () {
|
|
99
102
|
var tabCurrent = tabContainerRef.current;
|
|
100
103
|
if (!tabCurrent) return;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { api, Cell, Context, Op, Range, Selection, Presence, Settings, SingleRange, Sheet, CellMatrix, CellWithRowAndCol, GlobalCache
|
|
1
|
+
import { api, Cell, Context, Op, Range, Selection, Presence, Settings, SingleRange, Sheet, CellMatrix, CellWithRowAndCol, GlobalCache } from "@fileverse-dev/fortune-core";
|
|
2
2
|
import { getCryptoPrice } from "../../utils/cryptoApi";
|
|
3
3
|
import { SetContextOptions } from "../../context";
|
|
4
4
|
export declare function generateAPIs(context: Context, setContext: (recipe: (ctx: Context) => void, options?: SetContextOptions) => void, handleUndo: () => void, handleRedo: () => void, settings: Required<Settings>, cellInput: HTMLDivElement | null, scrollbarX: HTMLDivElement | null, scrollbarY: HTMLDivElement | null, globalCache: GlobalCache | null): {
|
|
@@ -9,8 +9,6 @@ export declare function generateAPIs(context: Context, setContext: (recipe: (ctx
|
|
|
9
9
|
}) => any;
|
|
10
10
|
onboardingActiveCell: (functionName: string) => void;
|
|
11
11
|
initializeComment: (row: number, column: number) => void;
|
|
12
|
-
updateSheetLiveQueryList: (subsheetIndex: number, _data: LiveQueryData) => void;
|
|
13
|
-
removeFromLiveQueryList: (subSheetIndex: number, id: string) => void;
|
|
14
12
|
setCellValue: (row: number, column: number, value: any, options?: api.CommonOptions & {
|
|
15
13
|
type?: keyof Cell;
|
|
16
14
|
}) => void;
|
|
@@ -111,7 +109,6 @@ export declare function generateAPIs(context: Context, setContext: (recipe: (ctx
|
|
|
111
109
|
column_focus: number;
|
|
112
110
|
} | undefined;
|
|
113
111
|
} | undefined;
|
|
114
|
-
liveQueryList?: Record<string, LiveQueryData> | undefined;
|
|
115
112
|
};
|
|
116
113
|
addSheet: () => void;
|
|
117
114
|
deleteSheet: (options?: api.CommonOptions) => void;
|
|
@@ -9,16 +9,6 @@ var _immer = require("immer");
|
|
|
9
9
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
10
10
|
var _cryptoApi = require("../../utils/cryptoApi");
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
var __assign = void 0 && (void 0).__assign || function () {
|
|
13
|
-
__assign = Object.assign || function (t) {
|
|
14
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
15
|
-
s = arguments[i];
|
|
16
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
17
|
-
}
|
|
18
|
-
return t;
|
|
19
|
-
};
|
|
20
|
-
return __assign.apply(this, arguments);
|
|
21
|
-
};
|
|
22
12
|
function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cellInput, scrollbarX, scrollbarY, globalCache) {
|
|
23
13
|
return {
|
|
24
14
|
applyOp: function applyOp(ops) {
|
|
@@ -120,24 +110,6 @@ function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cel
|
|
|
120
110
|
(0, _fortuneCore.newComment)(ctx, undefined, row, column);
|
|
121
111
|
});
|
|
122
112
|
},
|
|
123
|
-
updateSheetLiveQueryList: function updateSheetLiveQueryList(subsheetIndex, _data) {
|
|
124
|
-
setContext(function (ctx) {
|
|
125
|
-
var _a;
|
|
126
|
-
var previousLiveQuery = ctx.luckysheetfile[subsheetIndex].liveQueryList;
|
|
127
|
-
ctx.luckysheetfile[subsheetIndex] = __assign(__assign({}, ctx.luckysheetfile[subsheetIndex]), {
|
|
128
|
-
liveQueryList: __assign(__assign({}, previousLiveQuery), (_a = {}, _a["".concat(_data.data.id)] = _data, _a))
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
},
|
|
132
|
-
removeFromLiveQueryList: function removeFromLiveQueryList(subSheetIndex, id) {
|
|
133
|
-
setContext(function (ctx) {
|
|
134
|
-
var previousLiveQuery = __assign({}, ctx.luckysheetfile[subSheetIndex].liveQueryList);
|
|
135
|
-
previousLiveQuery === null || previousLiveQuery === void 0 ? true : delete previousLiveQuery[id];
|
|
136
|
-
ctx.luckysheetfile[subSheetIndex] = __assign(__assign({}, ctx.luckysheetfile[subSheetIndex]), {
|
|
137
|
-
liveQueryList: previousLiveQuery
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
},
|
|
141
113
|
setCellValue: function setCellValue(row, column, value, options) {
|
|
142
114
|
if (options === void 0) {
|
|
143
115
|
options = {};
|
|
@@ -16,8 +16,6 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
|
|
|
16
16
|
}) => any;
|
|
17
17
|
onboardingActiveCell: (functionName: string) => void;
|
|
18
18
|
initializeComment: (row: number, column: number) => void;
|
|
19
|
-
updateSheetLiveQueryList: (subsheetIndex: number, _data: import("@fileverse-dev/fortune-core").LiveQueryData) => void;
|
|
20
|
-
removeFromLiveQueryList: (subSheetIndex: number, id: string) => void;
|
|
21
19
|
setCellValue: (row: number, column: number, value: any, options?: api.CommonOptions & {
|
|
22
20
|
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;
|
|
23
21
|
}) => void;
|
|
@@ -118,7 +116,6 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
|
|
|
118
116
|
column_focus: number;
|
|
119
117
|
} | undefined;
|
|
120
118
|
} | undefined;
|
|
121
|
-
liveQueryList?: Record<string, import("@fileverse-dev/fortune-core").LiveQueryData> | undefined;
|
|
122
119
|
};
|
|
123
120
|
addSheet: () => void;
|
|
124
121
|
deleteSheet: (options?: api.CommonOptions) => void;
|
|
@@ -2,5 +2,4 @@ import Workbook from "./Workbook";
|
|
|
2
2
|
export { ERROR_MESSAGES_FLAG, SERVICES_API_KEY, } from "@fileverse-dev/formulajs/crypto-constants";
|
|
3
3
|
export { Workbook };
|
|
4
4
|
export type { WorkbookInstance } from "./Workbook";
|
|
5
|
-
export type { Cell, Sheet
|
|
6
|
-
export { markCellChanged as animateChangedCell } from "@fileverse-dev/fortune-core";
|
|
5
|
+
export type { Cell, Sheet } from "@fileverse-dev/fortune-core";
|
package/lib/components/index.js
CHANGED
|
@@ -21,13 +21,6 @@ Object.defineProperty(exports, "Workbook", {
|
|
|
21
21
|
return _Workbook.default;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
Object.defineProperty(exports, "animateChangedCell", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function get() {
|
|
27
|
-
return _fortuneCore.markCellChanged;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
24
|
var _Workbook = _interopRequireDefault(require("./Workbook"));
|
|
31
25
|
var _cryptoConstants = require("@fileverse-dev/formulajs/crypto-constants");
|
|
32
|
-
var _fortuneCore = require("@fileverse-dev/fortune-core");
|
|
33
26
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fileverse-dev/fortune-react",
|
|
3
|
-
"version": "1.1.11
|
|
3
|
+
"version": "1.1.11",
|
|
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.11
|
|
19
|
+
"@fileverse-dev/fortune-core": "1.1.11",
|
|
20
20
|
"@fileverse/ui": "^4.1.7-patch-21",
|
|
21
21
|
"@tippyjs/react": "^4.2.6",
|
|
22
22
|
"@types/regenerator-runtime": "^0.13.6",
|