@fileverse-dev/fortune-core 1.3.2 → 1.3.3
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/events/mouse.d.ts +1 -0
- package/es/events/mouse.js +50 -1
- package/es/modules/toolbar.js +0 -1
- package/es/paste-helpers/calculate-range-cell-size.d.ts +1 -0
- package/es/paste-helpers/calculate-range-cell-size.js +39 -0
- package/lib/events/mouse.d.ts +1 -0
- package/lib/events/mouse.js +51 -1
- package/lib/modules/toolbar.js +0 -1
- package/lib/paste-helpers/calculate-range-cell-size.d.ts +1 -0
- package/lib/paste-helpers/calculate-range-cell-size.js +40 -0
- package/package.json +1 -1
package/es/events/mouse.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export declare function handleOverlayMouseUp(ctx: Context, globalCache: GlobalCa
|
|
|
18
18
|
export declare function handleRowHeaderMouseDown(ctx: Context, globalCache: GlobalCache, e: MouseEvent, container: HTMLDivElement, cellInput: HTMLDivElement, fxInput: HTMLDivElement | null): void;
|
|
19
19
|
export declare function handleColumnHeaderMouseDown(ctx: Context, globalCache: GlobalCache, e: MouseEvent, container: HTMLElement, cellInput: HTMLDivElement, fxInput: HTMLDivElement | null): void;
|
|
20
20
|
export declare function handleColSizeHandleMouseDown(ctx: Context, globalCache: GlobalCache, e: MouseEvent, headerContainer: HTMLDivElement, workbookContainer: HTMLDivElement, cellArea: HTMLDivElement): void;
|
|
21
|
+
export declare function handleColSizeHandleDoubleClick(ctx: Context, globalCache: GlobalCache, e: MouseEvent, headerContainer: HTMLDivElement): void;
|
|
21
22
|
export declare function handleRowSizeHandleMouseDown(ctx: Context, globalCache: GlobalCache, e: MouseEvent, headerContainer: HTMLDivElement, workbookContainer: HTMLDivElement, cellArea: HTMLDivElement): void;
|
|
22
23
|
export declare function handleColFreezeHandleMouseDown(ctx: Context, globalCache: GlobalCache, e: MouseEvent, headerContainer: HTMLDivElement, workbookContainer: HTMLDivElement, cellArea: HTMLDivElement): void;
|
|
23
24
|
export declare function handleRowFreezeHandleMouseDown(ctx: Context, globalCache: GlobalCache, e: MouseEvent, headerContainer: HTMLDivElement, workbookContainer: HTMLDivElement, cellArea: HTMLDivElement): void;
|
package/es/events/mouse.js
CHANGED
|
@@ -11,6 +11,7 @@ import { onDropCellSelectEnd, onDropCellSelect } from "../modules/dropCell";
|
|
|
11
11
|
import { handleFormulaInput, rangeDragColumn, rangeDragRow } from "../modules/formula";
|
|
12
12
|
import { showLinkCard, onRangeSelectionModalMove, onRangeSelectionModalMoveEnd } from "../modules/hyperlink";
|
|
13
13
|
import { onSearchDialogMove, onSearchDialogMoveEnd } from "../modules/searchReplace";
|
|
14
|
+
import { getColumnAutoFitWidth } from "../paste-helpers/calculate-range-cell-size";
|
|
14
15
|
var mouseWheelUniqueTimeout;
|
|
15
16
|
var scrollLockTimeout;
|
|
16
17
|
export function handleGlobalWheel(ctx, e, cache, scrollbarX, scrollbarY) {
|
|
@@ -733,7 +734,6 @@ export function mouseRender(ctx, globalCache, e, cellInput, scrollX, scrollY, co
|
|
|
733
734
|
return;
|
|
734
735
|
}
|
|
735
736
|
if (ctx.luckysheet_select_status) {
|
|
736
|
-
console.log("ctx.scrollLeft", ctx.scrollLeft);
|
|
737
737
|
var mouseX = e.pageX - rect.left - window.scrollX;
|
|
738
738
|
var mouseY = e.pageY - rect.top - window.scrollY;
|
|
739
739
|
var _x = mouseX - ctx.rowHeaderWidth + ctx.scrollLeft;
|
|
@@ -1669,6 +1669,55 @@ export function handleColSizeHandleMouseDown(ctx, globalCache, e, headerContaine
|
|
|
1669
1669
|
ctx.luckysheet_cols_change_size_start = [_x, col_index];
|
|
1670
1670
|
e.stopPropagation();
|
|
1671
1671
|
}
|
|
1672
|
+
export function handleColSizeHandleDoubleClick(ctx, globalCache, e, headerContainer) {
|
|
1673
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1674
|
+
var scrollLeft = ctx.scrollLeft;
|
|
1675
|
+
var mouseX = e.pageX - headerContainer.getBoundingClientRect().left - window.scrollX;
|
|
1676
|
+
var _x = mouseX + scrollLeft;
|
|
1677
|
+
var freeze = (_a = globalCache.freezen) === null || _a === void 0 ? void 0 : _a[ctx.currentSheetId];
|
|
1678
|
+
var x = fixPositionOnFrozenCells(freeze, _x, 0, mouseX, 0).x;
|
|
1679
|
+
var col_location = colLocation(x, ctx.visibledatacolumn);
|
|
1680
|
+
var col_index = col_location[2];
|
|
1681
|
+
var cfg = ctx.config;
|
|
1682
|
+
if (cfg.columnlen == null) {
|
|
1683
|
+
cfg.columnlen = {};
|
|
1684
|
+
}
|
|
1685
|
+
if (cfg.customWidth == null) {
|
|
1686
|
+
cfg.customWidth = {};
|
|
1687
|
+
}
|
|
1688
|
+
var applyAutoFit = function applyAutoFit(colIdx) {
|
|
1689
|
+
var autoWidth = getColumnAutoFitWidth(ctx, colIdx);
|
|
1690
|
+
cfg.columnlen[colIdx] = autoWidth;
|
|
1691
|
+
cfg.customWidth[colIdx] = 1;
|
|
1692
|
+
};
|
|
1693
|
+
var changeColumnSelected = false;
|
|
1694
|
+
if (((_c = (_b = ctx.luckysheet_select_save) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0) > 0) {
|
|
1695
|
+
(_e = (_d = ctx.luckysheet_select_save) === null || _d === void 0 ? void 0 : _d.filter(function (select) {
|
|
1696
|
+
return select.column_select;
|
|
1697
|
+
})) === null || _e === void 0 ? void 0 : _e.some(function (select) {
|
|
1698
|
+
if (col_index >= select.column[0] && col_index <= select.column[1]) {
|
|
1699
|
+
changeColumnSelected = true;
|
|
1700
|
+
}
|
|
1701
|
+
return changeColumnSelected;
|
|
1702
|
+
});
|
|
1703
|
+
}
|
|
1704
|
+
if (changeColumnSelected) {
|
|
1705
|
+
(_g = (_f = ctx.luckysheet_select_save) === null || _f === void 0 ? void 0 : _f.filter(function (select) {
|
|
1706
|
+
return select.column_select;
|
|
1707
|
+
})) === null || _g === void 0 ? void 0 : _g.forEach(function (select) {
|
|
1708
|
+
for (var c = select.column[0]; c <= select.column[1]; c += 1) {
|
|
1709
|
+
applyAutoFit(c);
|
|
1710
|
+
}
|
|
1711
|
+
});
|
|
1712
|
+
} else {
|
|
1713
|
+
applyAutoFit(col_index);
|
|
1714
|
+
}
|
|
1715
|
+
ctx.config = cfg;
|
|
1716
|
+
var idx = getSheetIndex(ctx, ctx.currentSheetId);
|
|
1717
|
+
if (idx == null) return;
|
|
1718
|
+
ctx.luckysheetfile[idx].config = ctx.config;
|
|
1719
|
+
e.stopPropagation();
|
|
1720
|
+
}
|
|
1672
1721
|
export function handleRowSizeHandleMouseDown(ctx, globalCache, e, headerContainer, workbookContainer, cellArea) {
|
|
1673
1722
|
var _a;
|
|
1674
1723
|
removeEditingComment(ctx, globalCache);
|
package/es/modules/toolbar.js
CHANGED
|
@@ -727,7 +727,6 @@ export function handleVerticalAlign(ctx, cellInput, value) {
|
|
|
727
727
|
setAttr(ctx, cellInput, "vt", value);
|
|
728
728
|
}
|
|
729
729
|
export function handleFormatPainter(ctx) {
|
|
730
|
-
console.log("handleFormatPainter", ctx);
|
|
731
730
|
var allowEdit = isAllowEdit(ctx);
|
|
732
731
|
if (!allowEdit) return;
|
|
733
732
|
if (ctx.luckysheet_select_save == null || ctx.luckysheet_select_save.length === 0) {
|
|
@@ -3,6 +3,7 @@ export declare function calculateRangeCellSize(ctx: Context, sheetId: string, st
|
|
|
3
3
|
rowMax: Record<number, number>;
|
|
4
4
|
colMax: Record<number, number>;
|
|
5
5
|
};
|
|
6
|
+
export declare function getColumnAutoFitWidth(ctx: Context, colIndex: number): number;
|
|
6
7
|
export declare const updateSheetCellSizes: (ctx: Context, sheetIndex: number, measurements: {
|
|
7
8
|
rowMax: Record<number, number>;
|
|
8
9
|
colMax: Record<number, number>;
|
|
@@ -101,6 +101,45 @@ export function calculateRangeCellSize(ctx, sheetId, startRow, endRow, startCol,
|
|
|
101
101
|
colMax: maxColumnWidths
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
|
+
export function getColumnAutoFitWidth(ctx, colIndex) {
|
|
105
|
+
var _a, _b;
|
|
106
|
+
var flowdata = getFlowdata(ctx);
|
|
107
|
+
if (!flowdata) return ctx.defaultcollen;
|
|
108
|
+
var rowCount = flowdata.length;
|
|
109
|
+
var cellSizeMeasurer = document.getElementById("fs-cell-measurer");
|
|
110
|
+
if (!cellSizeMeasurer) {
|
|
111
|
+
cellSizeMeasurer = document.createElement("div");
|
|
112
|
+
cellSizeMeasurer.id = "fs-cell-measurer";
|
|
113
|
+
Object.assign(cellSizeMeasurer.style, {
|
|
114
|
+
position: "fixed",
|
|
115
|
+
left: "-99999px",
|
|
116
|
+
top: "-99999px",
|
|
117
|
+
visibility: "hidden",
|
|
118
|
+
lineHeight: "1.3",
|
|
119
|
+
whiteSpace: "pre",
|
|
120
|
+
wordBreak: "normal",
|
|
121
|
+
overflowWrap: "break-word"
|
|
122
|
+
});
|
|
123
|
+
document.body.appendChild(cellSizeMeasurer);
|
|
124
|
+
}
|
|
125
|
+
var maxWidth = ctx.defaultcollen;
|
|
126
|
+
for (var row = 0; row < rowCount; row++) {
|
|
127
|
+
var cell = (_a = flowdata[row]) === null || _a === void 0 ? void 0 : _a[colIndex];
|
|
128
|
+
if (!cell) continue;
|
|
129
|
+
if (cell.mc && cell.mc.rs == null) continue;
|
|
130
|
+
var text = getCellDisplayText(cell);
|
|
131
|
+
if (!text) continue;
|
|
132
|
+
applyFontOnMeasurer(cell, cellSizeMeasurer);
|
|
133
|
+
var fontSizePt = (_b = cell.fs) !== null && _b !== void 0 ? _b : ctx.defaultFontSize;
|
|
134
|
+
cellSizeMeasurer.style.fontSize = "".concat(fontSizePt, "pt");
|
|
135
|
+
cellSizeMeasurer.style.whiteSpace = "pre";
|
|
136
|
+
cellSizeMeasurer.style.width = "auto";
|
|
137
|
+
cellSizeMeasurer.textContent = text;
|
|
138
|
+
var intrinsicWidth = Math.ceil(cellSizeMeasurer.scrollWidth + 12);
|
|
139
|
+
if (intrinsicWidth > maxWidth) maxWidth = intrinsicWidth;
|
|
140
|
+
}
|
|
141
|
+
return maxWidth;
|
|
142
|
+
}
|
|
104
143
|
export var updateSheetCellSizes = function updateSheetCellSizes(ctx, sheetIndex, measurements, maxColumnWidth) {
|
|
105
144
|
var _a;
|
|
106
145
|
if (maxColumnWidth === void 0) {
|
package/lib/events/mouse.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export declare function handleOverlayMouseUp(ctx: Context, globalCache: GlobalCa
|
|
|
18
18
|
export declare function handleRowHeaderMouseDown(ctx: Context, globalCache: GlobalCache, e: MouseEvent, container: HTMLDivElement, cellInput: HTMLDivElement, fxInput: HTMLDivElement | null): void;
|
|
19
19
|
export declare function handleColumnHeaderMouseDown(ctx: Context, globalCache: GlobalCache, e: MouseEvent, container: HTMLElement, cellInput: HTMLDivElement, fxInput: HTMLDivElement | null): void;
|
|
20
20
|
export declare function handleColSizeHandleMouseDown(ctx: Context, globalCache: GlobalCache, e: MouseEvent, headerContainer: HTMLDivElement, workbookContainer: HTMLDivElement, cellArea: HTMLDivElement): void;
|
|
21
|
+
export declare function handleColSizeHandleDoubleClick(ctx: Context, globalCache: GlobalCache, e: MouseEvent, headerContainer: HTMLDivElement): void;
|
|
21
22
|
export declare function handleRowSizeHandleMouseDown(ctx: Context, globalCache: GlobalCache, e: MouseEvent, headerContainer: HTMLDivElement, workbookContainer: HTMLDivElement, cellArea: HTMLDivElement): void;
|
|
22
23
|
export declare function handleColFreezeHandleMouseDown(ctx: Context, globalCache: GlobalCache, e: MouseEvent, headerContainer: HTMLDivElement, workbookContainer: HTMLDivElement, cellArea: HTMLDivElement): void;
|
|
23
24
|
export declare function handleRowFreezeHandleMouseDown(ctx: Context, globalCache: GlobalCache, e: MouseEvent, headerContainer: HTMLDivElement, workbookContainer: HTMLDivElement, cellArea: HTMLDivElement): void;
|
package/lib/events/mouse.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.fixPositionOnFrozenCells = fixPositionOnFrozenCells;
|
|
|
7
7
|
exports.handleCellAreaDoubleClick = handleCellAreaDoubleClick;
|
|
8
8
|
exports.handleCellAreaMouseDown = handleCellAreaMouseDown;
|
|
9
9
|
exports.handleColFreezeHandleMouseDown = handleColFreezeHandleMouseDown;
|
|
10
|
+
exports.handleColSizeHandleDoubleClick = handleColSizeHandleDoubleClick;
|
|
10
11
|
exports.handleColSizeHandleMouseDown = handleColSizeHandleMouseDown;
|
|
11
12
|
exports.handleColumnHeaderMouseDown = handleColumnHeaderMouseDown;
|
|
12
13
|
exports.handleContextMenu = handleContextMenu;
|
|
@@ -30,6 +31,7 @@ var _dropCell = require("../modules/dropCell");
|
|
|
30
31
|
var _formula = require("../modules/formula");
|
|
31
32
|
var _hyperlink = require("../modules/hyperlink");
|
|
32
33
|
var _searchReplace = require("../modules/searchReplace");
|
|
34
|
+
var _calculateRangeCellSize = require("../paste-helpers/calculate-range-cell-size");
|
|
33
35
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
34
36
|
var mouseWheelUniqueTimeout;
|
|
35
37
|
var scrollLockTimeout;
|
|
@@ -753,7 +755,6 @@ function mouseRender(ctx, globalCache, e, cellInput, scrollX, scrollY, container
|
|
|
753
755
|
return;
|
|
754
756
|
}
|
|
755
757
|
if (ctx.luckysheet_select_status) {
|
|
756
|
-
console.log("ctx.scrollLeft", ctx.scrollLeft);
|
|
757
758
|
var mouseX = e.pageX - rect.left - window.scrollX;
|
|
758
759
|
var mouseY = e.pageY - rect.top - window.scrollY;
|
|
759
760
|
var _x = mouseX - ctx.rowHeaderWidth + ctx.scrollLeft;
|
|
@@ -1689,6 +1690,55 @@ function handleColSizeHandleMouseDown(ctx, globalCache, e, headerContainer, work
|
|
|
1689
1690
|
ctx.luckysheet_cols_change_size_start = [_x, col_index];
|
|
1690
1691
|
e.stopPropagation();
|
|
1691
1692
|
}
|
|
1693
|
+
function handleColSizeHandleDoubleClick(ctx, globalCache, e, headerContainer) {
|
|
1694
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1695
|
+
var scrollLeft = ctx.scrollLeft;
|
|
1696
|
+
var mouseX = e.pageX - headerContainer.getBoundingClientRect().left - window.scrollX;
|
|
1697
|
+
var _x = mouseX + scrollLeft;
|
|
1698
|
+
var freeze = (_a = globalCache.freezen) === null || _a === void 0 ? void 0 : _a[ctx.currentSheetId];
|
|
1699
|
+
var x = fixPositionOnFrozenCells(freeze, _x, 0, mouseX, 0).x;
|
|
1700
|
+
var col_location = (0, _location.colLocation)(x, ctx.visibledatacolumn);
|
|
1701
|
+
var col_index = col_location[2];
|
|
1702
|
+
var cfg = ctx.config;
|
|
1703
|
+
if (cfg.columnlen == null) {
|
|
1704
|
+
cfg.columnlen = {};
|
|
1705
|
+
}
|
|
1706
|
+
if (cfg.customWidth == null) {
|
|
1707
|
+
cfg.customWidth = {};
|
|
1708
|
+
}
|
|
1709
|
+
var applyAutoFit = function applyAutoFit(colIdx) {
|
|
1710
|
+
var autoWidth = (0, _calculateRangeCellSize.getColumnAutoFitWidth)(ctx, colIdx);
|
|
1711
|
+
cfg.columnlen[colIdx] = autoWidth;
|
|
1712
|
+
cfg.customWidth[colIdx] = 1;
|
|
1713
|
+
};
|
|
1714
|
+
var changeColumnSelected = false;
|
|
1715
|
+
if (((_c = (_b = ctx.luckysheet_select_save) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0) > 0) {
|
|
1716
|
+
(_e = (_d = ctx.luckysheet_select_save) === null || _d === void 0 ? void 0 : _d.filter(function (select) {
|
|
1717
|
+
return select.column_select;
|
|
1718
|
+
})) === null || _e === void 0 ? void 0 : _e.some(function (select) {
|
|
1719
|
+
if (col_index >= select.column[0] && col_index <= select.column[1]) {
|
|
1720
|
+
changeColumnSelected = true;
|
|
1721
|
+
}
|
|
1722
|
+
return changeColumnSelected;
|
|
1723
|
+
});
|
|
1724
|
+
}
|
|
1725
|
+
if (changeColumnSelected) {
|
|
1726
|
+
(_g = (_f = ctx.luckysheet_select_save) === null || _f === void 0 ? void 0 : _f.filter(function (select) {
|
|
1727
|
+
return select.column_select;
|
|
1728
|
+
})) === null || _g === void 0 ? void 0 : _g.forEach(function (select) {
|
|
1729
|
+
for (var c = select.column[0]; c <= select.column[1]; c += 1) {
|
|
1730
|
+
applyAutoFit(c);
|
|
1731
|
+
}
|
|
1732
|
+
});
|
|
1733
|
+
} else {
|
|
1734
|
+
applyAutoFit(col_index);
|
|
1735
|
+
}
|
|
1736
|
+
ctx.config = cfg;
|
|
1737
|
+
var idx = (0, _utils.getSheetIndex)(ctx, ctx.currentSheetId);
|
|
1738
|
+
if (idx == null) return;
|
|
1739
|
+
ctx.luckysheetfile[idx].config = ctx.config;
|
|
1740
|
+
e.stopPropagation();
|
|
1741
|
+
}
|
|
1692
1742
|
function handleRowSizeHandleMouseDown(ctx, globalCache, e, headerContainer, workbookContainer, cellArea) {
|
|
1693
1743
|
var _a;
|
|
1694
1744
|
(0, _modules.removeEditingComment)(ctx, globalCache);
|
package/lib/modules/toolbar.js
CHANGED
|
@@ -760,7 +760,6 @@ function handleVerticalAlign(ctx, cellInput, value) {
|
|
|
760
760
|
setAttr(ctx, cellInput, "vt", value);
|
|
761
761
|
}
|
|
762
762
|
function handleFormatPainter(ctx) {
|
|
763
|
-
console.log("handleFormatPainter", ctx);
|
|
764
763
|
var allowEdit = (0, _utils.isAllowEdit)(ctx);
|
|
765
764
|
if (!allowEdit) return;
|
|
766
765
|
if (ctx.luckysheet_select_save == null || ctx.luckysheet_select_save.length === 0) {
|
|
@@ -3,6 +3,7 @@ export declare function calculateRangeCellSize(ctx: Context, sheetId: string, st
|
|
|
3
3
|
rowMax: Record<number, number>;
|
|
4
4
|
colMax: Record<number, number>;
|
|
5
5
|
};
|
|
6
|
+
export declare function getColumnAutoFitWidth(ctx: Context, colIndex: number): number;
|
|
6
7
|
export declare const updateSheetCellSizes: (ctx: Context, sheetIndex: number, measurements: {
|
|
7
8
|
rowMax: Record<number, number>;
|
|
8
9
|
colMax: Record<number, number>;
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.calculateRangeCellSize = calculateRangeCellSize;
|
|
7
|
+
exports.getColumnAutoFitWidth = getColumnAutoFitWidth;
|
|
7
8
|
exports.updateSheetCellSizes = void 0;
|
|
8
9
|
var _pasteTableHelpers = require("../paste-table-helpers");
|
|
9
10
|
var _utils = require("../utils");
|
|
@@ -108,6 +109,45 @@ function calculateRangeCellSize(ctx, sheetId, startRow, endRow, startCol, endCol
|
|
|
108
109
|
colMax: maxColumnWidths
|
|
109
110
|
};
|
|
110
111
|
}
|
|
112
|
+
function getColumnAutoFitWidth(ctx, colIndex) {
|
|
113
|
+
var _a, _b;
|
|
114
|
+
var flowdata = (0, _context.getFlowdata)(ctx);
|
|
115
|
+
if (!flowdata) return ctx.defaultcollen;
|
|
116
|
+
var rowCount = flowdata.length;
|
|
117
|
+
var cellSizeMeasurer = document.getElementById("fs-cell-measurer");
|
|
118
|
+
if (!cellSizeMeasurer) {
|
|
119
|
+
cellSizeMeasurer = document.createElement("div");
|
|
120
|
+
cellSizeMeasurer.id = "fs-cell-measurer";
|
|
121
|
+
Object.assign(cellSizeMeasurer.style, {
|
|
122
|
+
position: "fixed",
|
|
123
|
+
left: "-99999px",
|
|
124
|
+
top: "-99999px",
|
|
125
|
+
visibility: "hidden",
|
|
126
|
+
lineHeight: "1.3",
|
|
127
|
+
whiteSpace: "pre",
|
|
128
|
+
wordBreak: "normal",
|
|
129
|
+
overflowWrap: "break-word"
|
|
130
|
+
});
|
|
131
|
+
document.body.appendChild(cellSizeMeasurer);
|
|
132
|
+
}
|
|
133
|
+
var maxWidth = ctx.defaultcollen;
|
|
134
|
+
for (var row = 0; row < rowCount; row++) {
|
|
135
|
+
var cell = (_a = flowdata[row]) === null || _a === void 0 ? void 0 : _a[colIndex];
|
|
136
|
+
if (!cell) continue;
|
|
137
|
+
if (cell.mc && cell.mc.rs == null) continue;
|
|
138
|
+
var text = getCellDisplayText(cell);
|
|
139
|
+
if (!text) continue;
|
|
140
|
+
applyFontOnMeasurer(cell, cellSizeMeasurer);
|
|
141
|
+
var fontSizePt = (_b = cell.fs) !== null && _b !== void 0 ? _b : ctx.defaultFontSize;
|
|
142
|
+
cellSizeMeasurer.style.fontSize = "".concat(fontSizePt, "pt");
|
|
143
|
+
cellSizeMeasurer.style.whiteSpace = "pre";
|
|
144
|
+
cellSizeMeasurer.style.width = "auto";
|
|
145
|
+
cellSizeMeasurer.textContent = text;
|
|
146
|
+
var intrinsicWidth = Math.ceil(cellSizeMeasurer.scrollWidth + 12);
|
|
147
|
+
if (intrinsicWidth > maxWidth) maxWidth = intrinsicWidth;
|
|
148
|
+
}
|
|
149
|
+
return maxWidth;
|
|
150
|
+
}
|
|
111
151
|
var updateSheetCellSizes = exports.updateSheetCellSizes = function updateSheetCellSizes(ctx, sheetIndex, measurements, maxColumnWidth) {
|
|
112
152
|
var _a;
|
|
113
153
|
if (maxColumnWidth === void 0) {
|