@file-viewer/renderer-spreadsheet 3.3.1 → 3.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/dist/spreadsheet/chartRenderer.js +0 -5
- package/dist/spreadsheet/chartSampling.d.ts +0 -4
- package/dist/spreadsheet/chartSampling.js +0 -6
- package/dist/spreadsheet/rangeNavigation.d.ts +0 -2
- package/dist/spreadsheet/rangeNavigation.js +0 -4
- package/dist/spreadsheet/state.d.ts +0 -1
- package/dist/spreadsheet/state.js +0 -2
- package/dist/spreadsheet/view.js +0 -12
- package/dist/spreadsheet/viewport.d.ts +0 -1
- package/dist/spreadsheet/viewport.js +0 -2
- package/dist/spreadsheet/worker/sheetjs/SheetJsModel.js +0 -15
- package/dist/spreadsheet/worker/sheetjs/chartParser.js +0 -19
- package/dist/spreadsheet/worker/sheetjs/color.js +8 -10
- package/dist/spreadsheet/worker/sheetjs/formulaValues.js +0 -9
- package/dist/spreadsheet/worker/sheetjs/parser.d.ts +0 -1
- package/dist/spreadsheet/worker/sheetjs/parser.js +1 -24
- package/dist/spreadsheet/worker/sheetjs/richDataParser.js +0 -2
- package/dist/spreadsheet/worker/sheetjs/richText.js +0 -1
- package/dist/spreadsheet/worker/sheetjs/sheetLayout.d.ts +0 -4
- package/dist/spreadsheet/worker/sheetjs/sheetLayout.js +0 -8
- package/dist/spreadsheet/worker/sheetjs/textEncoding.js +0 -7
- package/dist/spreadsheet/worker/type.d.ts +0 -3
- package/dist/spreadsheet.js +0 -24
- package/dist/worker/sheet.worker.js +24 -24
- package/package.json +3 -3
package/dist/spreadsheet.js
CHANGED
|
@@ -129,12 +129,6 @@ const collectEVirtTableStyleDocuments = (documentRef) => [
|
|
|
129
129
|
].filter((value, index, values) => (!!value && values.indexOf(value) === index));
|
|
130
130
|
const collectStyleElements = (documents) => documents.flatMap(candidateDocument => { var _a; return Array.from(((_a = candidateDocument.head) === null || _a === void 0 ? void 0 : _a.querySelectorAll('style')) || []); });
|
|
131
131
|
let loadedEVirtTableStyleText = '';
|
|
132
|
-
// e-virt-table bundles its complete stylesheet into the ESM entry and injects
|
|
133
|
-
// unscoped :root, .dark, and table selectors into document.head. Capture that
|
|
134
|
-
// exact version-matched CSS, remove only the node created by our import, and
|
|
135
|
-
// install a scoped copy beside the renderer for both light and shadow DOM.
|
|
136
|
-
// Independent layout, overlay, editor, and menu markers avoid mistaking an
|
|
137
|
-
// app's partial compatibility overrides for the complete vendor sheet.
|
|
138
132
|
export const resolveEVirtTableStyleText = (documentRef) => {
|
|
139
133
|
var _a;
|
|
140
134
|
const styles = collectStyleElements(collectEVirtTableStyleDocuments(documentRef));
|
|
@@ -158,9 +152,6 @@ const loadEVirtTable = async (documentRef) => {
|
|
|
158
152
|
injectedStyles.forEach(style => style.remove());
|
|
159
153
|
return {
|
|
160
154
|
constructor: resolveEVirtTableConstructor(module),
|
|
161
|
-
// The vendor entry injects CSS while its dynamic import is evaluated.
|
|
162
|
-
// Prefer that newly-created node so an app's independently loaded table
|
|
163
|
-
// version cannot be mistaken for the renderer-owned dependency.
|
|
164
155
|
styleText: loadedEVirtTableStyleText || resolveEVirtTableStyleText(documentRef),
|
|
165
156
|
};
|
|
166
157
|
};
|
|
@@ -824,8 +815,6 @@ const renderFileViewerSpreadsheet = async (buffer, target, type, context) => {
|
|
|
824
815
|
if (x < 0 || y < 0 || x > viewportRect.width || y > viewportRect.height) {
|
|
825
816
|
return undefined;
|
|
826
817
|
}
|
|
827
|
-
// Charts are appended after images and therefore paint above them. Do not
|
|
828
|
-
// open an image hidden under a chart when their saved bounds overlap.
|
|
829
818
|
if ([...sheetCharts].reverse().some(chart => containsViewportPoint(chart, x, y))) {
|
|
830
819
|
return undefined;
|
|
831
820
|
}
|
|
@@ -907,8 +896,6 @@ const renderFileViewerSpreadsheet = async (buffer, target, type, context) => {
|
|
|
907
896
|
const horizontal = tableContainer
|
|
908
897
|
? Math.max(tableContainer.offsetHeight - tableContainer.clientHeight, 0)
|
|
909
898
|
: 0;
|
|
910
|
-
// e-virt-table may draw overlay scrollbars, so keep a small reserved lane
|
|
911
|
-
// even when native scrollbar metrics report zero.
|
|
912
899
|
return {
|
|
913
900
|
vertical: vertical || EXCEL_IMAGE_SCROLLBAR_GUARD,
|
|
914
901
|
horizontal: horizontal || EXCEL_IMAGE_SCROLLBAR_GUARD,
|
|
@@ -1382,7 +1369,6 @@ const renderFileViewerSpreadsheet = async (buffer, target, type, context) => {
|
|
|
1382
1369
|
}
|
|
1383
1370
|
refreshTableLayoutWhenVisible();
|
|
1384
1371
|
}).catch(() => {
|
|
1385
|
-
// Font readiness is only a paint stabilizer; rendering already has a fallback.
|
|
1386
1372
|
}));
|
|
1387
1373
|
};
|
|
1388
1374
|
function setColumnWidthByKey(columns, key, width) {
|
|
@@ -1403,7 +1389,6 @@ const renderFileViewerSpreadsheet = async (buffer, target, type, context) => {
|
|
|
1403
1389
|
(_a = table === null || table === void 0 ? void 0 : table.setCustomHeader) === null || _a === void 0 ? void 0 : _a.call(table, { resizableData: {} }, true);
|
|
1404
1390
|
}
|
|
1405
1391
|
catch {
|
|
1406
|
-
// 某些旧版 e-virt-table 类型没有公开 setCustomHeader,忽略即可,下一次 loadColumns 仍会使用 core 状态。
|
|
1407
1392
|
}
|
|
1408
1393
|
}
|
|
1409
1394
|
function handleColumnResizeChange(event) {
|
|
@@ -1424,8 +1409,6 @@ const renderFileViewerSpreadsheet = async (buffer, target, type, context) => {
|
|
|
1424
1409
|
if (activeSheetId !== undefined) {
|
|
1425
1410
|
sheetStateCache.set(activeSheetId, virtualState);
|
|
1426
1411
|
}
|
|
1427
|
-
// e-virt-table writes its pixel-width cache after emitting the resize event.
|
|
1428
|
-
// Clear it after that write so our unscaled, per-sheet widths remain authoritative.
|
|
1429
1412
|
queueMicrotask(() => {
|
|
1430
1413
|
if (disposed || !table)
|
|
1431
1414
|
return;
|
|
@@ -1714,8 +1697,6 @@ const renderFileViewerSpreadsheet = async (buffer, target, type, context) => {
|
|
|
1714
1697
|
}
|
|
1715
1698
|
cached.loadingWindows.clear();
|
|
1716
1699
|
virtualState = cached;
|
|
1717
|
-
// Cached rows store display heights from their last active zoom. Rebuild
|
|
1718
|
-
// those heights from unscaled state before loading them into the table.
|
|
1719
1700
|
syncScaledRowHeights();
|
|
1720
1701
|
errorMessage = '';
|
|
1721
1702
|
totalRows = cached.totalRows;
|
|
@@ -1787,7 +1768,6 @@ const renderFileViewerSpreadsheet = async (buffer, target, type, context) => {
|
|
|
1787
1768
|
const scale = Number((_a = state.scale) !== null && _a !== void 0 ? _a : (_b = state.zoom) === null || _b === void 0 ? void 0 : _b.scale);
|
|
1788
1769
|
if (Number.isFinite(scale) && scale > 0)
|
|
1789
1770
|
setZoom(scale);
|
|
1790
|
-
// Coordinate navigation supplies its own final scroll after the target loads.
|
|
1791
1771
|
if (((_c = state.spreadsheet) === null || _c === void 0 ? void 0 : _c.range) || !sheets.length)
|
|
1792
1772
|
return;
|
|
1793
1773
|
const nextSheet = (_e = (_d = state.spreadsheet) === null || _d === void 0 ? void 0 : _d.sheetId) !== null && _e !== void 0 ? _e : getActiveSheetId();
|
|
@@ -1809,8 +1789,6 @@ const renderFileViewerSpreadsheet = async (buffer, target, type, context) => {
|
|
|
1809
1789
|
const restore = pendingViewRestore;
|
|
1810
1790
|
if (!restore || !table || !virtualState.active || restore.sheetId !== getActiveSheetId())
|
|
1811
1791
|
return;
|
|
1812
|
-
// Cached sheet installation runs in a microtask and the table draws in RAF.
|
|
1813
|
-
// Wait through that draw before its scroll bounds can clamp restored values.
|
|
1814
1792
|
requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
1815
1793
|
if (pendingViewRestore !== restore || !restore.isCurrent() || !table || disposed)
|
|
1816
1794
|
return;
|
|
@@ -1849,8 +1827,6 @@ const renderFileViewerSpreadsheet = async (buffer, target, type, context) => {
|
|
|
1849
1827
|
if (navigatingRange && !finishRange)
|
|
1850
1828
|
return;
|
|
1851
1829
|
const targetTop = Math.max(0, getSearchRowTop(pending.row) - Math.max(0, (tableHost.clientHeight || 0) * 0.35));
|
|
1852
|
-
// The vendor's rendered header index can still be empty before its first
|
|
1853
|
-
// draw. Source column geometry is ready as soon as the window is loaded.
|
|
1854
1830
|
const columnLeft = getSearchColumnLeft(getDisplayColumns(virtualState.columns, zoom), virtualState.dataKeys[pending.col] || getDataKey(pending.col));
|
|
1855
1831
|
const targetLeft = columnLeft === undefined
|
|
1856
1832
|
? table.ctx.scrollX || 0
|