@extend-ai/react-xlsx 0.24.0 → 0.24.2
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/README.md +30 -5
- package/dist/{chunk-HAV76TR2.js → chunk-EDUJZDOK.js} +33 -1
- package/dist/{chunk-HAV76TR2.js.map → chunk-EDUJZDOK.js.map} +1 -1
- package/dist/{chunk-C4WTJIRG.js → chunk-J3G4UUGR.js} +352 -89
- package/dist/chunk-J3G4UUGR.js.map +1 -0
- package/dist/{chunk-DGNSB5M5.cjs → chunk-LX33ROHL.cjs} +2156 -1893
- package/dist/chunk-LX33ROHL.cjs.map +1 -0
- package/dist/{chunk-MNIFKMIL.js → chunk-MCS2EQEF.js} +33 -1
- package/dist/chunk-MCS2EQEF.js.map +1 -0
- package/dist/{chunk-Z4WMURVU.cjs → chunk-TLEC4K6W.cjs} +33 -1
- package/dist/chunk-TLEC4K6W.cjs.map +1 -0
- package/dist/{chunk-YOLIVKZD.cjs → chunk-UXJAG7MU.cjs} +33 -1
- package/dist/chunk-UXJAG7MU.cjs.map +1 -0
- package/dist/index.cjs +457 -316
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -2
- package/dist/index.d.ts +28 -2
- package/dist/index.js +464 -323
- package/dist/index.js.map +1 -1
- package/dist/{internal-CwTqluL7.d.cts → internal-BhZTIzgZ.d.cts} +28 -2
- package/dist/{internal-CwTqluL7.d.ts → internal-BhZTIzgZ.d.ts} +28 -2
- package/dist/internal.cjs +3 -3
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +2 -2
- package/dist/{shared-chart-CGEK7EAB.js → shared-chart-NR4KWDQM.js} +2 -2
- package/dist/{shared-chart-24MCGSFJ.js → shared-chart-PMIN7YMP.js} +2 -2
- package/dist/{shared-chart-7E6KMGTG.cjs → shared-chart-QIS7OPL3.cjs} +3 -3
- package/dist/{shared-chart-7E6KMGTG.cjs.map → shared-chart-QIS7OPL3.cjs.map} +1 -1
- package/dist/{shared-chart-GKNMM72Q.cjs → shared-chart-ZP5J6OSZ.cjs} +15 -15
- package/dist/{shared-chart-GKNMM72Q.cjs.map → shared-chart-ZP5J6OSZ.cjs.map} +1 -1
- package/dist/vanilla.cjs +3 -3
- package/dist/vanilla.d.cts +2 -2
- package/dist/vanilla.d.ts +2 -2
- package/dist/vanilla.js +2 -2
- package/dist/{workbook-runtime-QFXDLSSI.cjs → workbook-runtime-7WEPIK5Y.cjs} +41 -29
- package/dist/workbook-runtime-7WEPIK5Y.cjs.map +1 -0
- package/dist/{workbook-runtime-56Y3B64Y.js → workbook-runtime-BAAYDYYK.js} +17 -5
- package/dist/workbook-runtime-BAAYDYYK.js.map +1 -0
- package/dist/{workbook-runtime-7DSKESFL.js → workbook-runtime-FCKPXLTW.js} +17 -5
- package/dist/workbook-runtime-FCKPXLTW.js.map +1 -0
- package/dist/{workbook-runtime-MEI3CEWO.cjs → workbook-runtime-MOGSEJ5R.cjs} +41 -29
- package/dist/workbook-runtime-MOGSEJ5R.cjs.map +1 -0
- package/dist/xlsx-worker.js +16 -4
- package/dist/xlsx-worker.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-C4WTJIRG.js.map +0 -1
- package/dist/chunk-DGNSB5M5.cjs.map +0 -1
- package/dist/chunk-MNIFKMIL.js.map +0 -1
- package/dist/chunk-YOLIVKZD.cjs.map +0 -1
- package/dist/chunk-Z4WMURVU.cjs.map +0 -1
- package/dist/workbook-runtime-56Y3B64Y.js.map +0 -1
- package/dist/workbook-runtime-7DSKESFL.js.map +0 -1
- package/dist/workbook-runtime-MEI3CEWO.cjs.map +0 -1
- package/dist/workbook-runtime-QFXDLSSI.cjs.map +0 -1
- /package/dist/{shared-chart-CGEK7EAB.js.map → shared-chart-NR4KWDQM.js.map} +0 -0
- /package/dist/{shared-chart-24MCGSFJ.js.map → shared-chart-PMIN7YMP.js.map} +0 -0
|
@@ -71,7 +71,7 @@ import {
|
|
|
71
71
|
w,
|
|
72
72
|
x,
|
|
73
73
|
y
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-EDUJZDOK.js";
|
|
75
75
|
import {
|
|
76
76
|
configureWorkbookArchiveDecoder,
|
|
77
77
|
configureWorkbookXmlDecoder,
|
|
@@ -154,6 +154,80 @@ function* bandIndices(bands) {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
+
// src/read-only-layout.ts
|
|
158
|
+
function changedVisibilityRanges(existing, ranges, hidden, fromSelection) {
|
|
159
|
+
if (!hidden && !existing.size) return [];
|
|
160
|
+
let firstVisible = 0;
|
|
161
|
+
if (!hidden && fromSelection) {
|
|
162
|
+
while (existing.has(firstVisible)) firstVisible++;
|
|
163
|
+
}
|
|
164
|
+
const changed = [];
|
|
165
|
+
for (const range of ranges) {
|
|
166
|
+
const start = firstVisible > 0 && range.start === firstVisible ? 0 : range.start;
|
|
167
|
+
for (let index = start; index <= range.end; index++) {
|
|
168
|
+
if (existing.has(index) !== hidden) {
|
|
169
|
+
changed.push({ start, end: range.end });
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return changed;
|
|
175
|
+
}
|
|
176
|
+
function nextVisibleIndex(index, limit, isHidden) {
|
|
177
|
+
let next = index;
|
|
178
|
+
while (next < limit && isHidden(next)) next++;
|
|
179
|
+
if (next < limit) return next;
|
|
180
|
+
next = index - 1;
|
|
181
|
+
while (next >= 0 && isHidden(next)) next--;
|
|
182
|
+
return next;
|
|
183
|
+
}
|
|
184
|
+
function visibleAxis(hidden, max, originalIndices, originalSizes, overrides, defaultSize) {
|
|
185
|
+
const indices = [];
|
|
186
|
+
const sizes = [];
|
|
187
|
+
let offset = 0;
|
|
188
|
+
for (let index = 0; index <= max; index++) {
|
|
189
|
+
const originalSize = originalIndices[offset] === index ? originalSizes[offset++] : void 0;
|
|
190
|
+
if (hidden.has(index)) continue;
|
|
191
|
+
indices.push(index);
|
|
192
|
+
sizes.push(originalSize ?? overrides[index] ?? defaultSize);
|
|
193
|
+
}
|
|
194
|
+
return { indices, sizes };
|
|
195
|
+
}
|
|
196
|
+
function applyReadOnlyLayout(sheet, layout) {
|
|
197
|
+
if (!layout) return sheet;
|
|
198
|
+
const view = { ...sheet };
|
|
199
|
+
if (layout.freezePanes !== void 0) view.freezePanes = layout.freezePanes;
|
|
200
|
+
if (layout.hiddenRows) {
|
|
201
|
+
const rows = visibleAxis(
|
|
202
|
+
layout.hiddenRows,
|
|
203
|
+
sheet.maxUsedRow,
|
|
204
|
+
sheet.visibleRows,
|
|
205
|
+
sheet.rowHeights,
|
|
206
|
+
sheet.rowHeightOverridesPx,
|
|
207
|
+
sheet.defaultRowHeightPx
|
|
208
|
+
);
|
|
209
|
+
view.hiddenRows = Array.from(layout.hiddenRows).sort((a, b) => a - b);
|
|
210
|
+
view.visibleRows = rows.indices;
|
|
211
|
+
view.rowHeights = rows.sizes;
|
|
212
|
+
view.rowCount = rows.indices.length;
|
|
213
|
+
}
|
|
214
|
+
if (layout.hiddenCols) {
|
|
215
|
+
const cols = visibleAxis(
|
|
216
|
+
layout.hiddenCols,
|
|
217
|
+
sheet.maxUsedCol,
|
|
218
|
+
sheet.visibleCols,
|
|
219
|
+
sheet.colWidths,
|
|
220
|
+
sheet.colWidthOverridesPx,
|
|
221
|
+
sheet.defaultColWidthPx
|
|
222
|
+
);
|
|
223
|
+
view.hiddenCols = Array.from(layout.hiddenCols).sort((a, b) => a - b);
|
|
224
|
+
view.visibleCols = cols.indices;
|
|
225
|
+
view.colWidths = cols.sizes;
|
|
226
|
+
view.colCount = cols.indices.length;
|
|
227
|
+
}
|
|
228
|
+
return view;
|
|
229
|
+
}
|
|
230
|
+
|
|
157
231
|
// src/merged-range-lookup.ts
|
|
158
232
|
function createMergedRangeLookup(ranges) {
|
|
159
233
|
const normalizedRanges = [];
|
|
@@ -1069,7 +1143,7 @@ var XlsxWorkerClient = class {
|
|
|
1069
1143
|
}
|
|
1070
1144
|
async getMainRuntime() {
|
|
1071
1145
|
if (this.disposed) throw createAbortError();
|
|
1072
|
-
this.mainRuntime ??= import("./workbook-runtime-
|
|
1146
|
+
this.mainRuntime ??= import("./workbook-runtime-FCKPXLTW.js").then(({ createWorkbookRuntime }) => createWorkbookRuntime());
|
|
1073
1147
|
const runtime = await this.mainRuntime;
|
|
1074
1148
|
if (this.disposed) {
|
|
1075
1149
|
runtime.dispose();
|
|
@@ -2045,6 +2119,8 @@ function downloadUrl(src, fileName) {
|
|
|
2045
2119
|
}
|
|
2046
2120
|
function useXlsxViewerController(options2) {
|
|
2047
2121
|
const {
|
|
2122
|
+
allowFreezeInReadOnly = false,
|
|
2123
|
+
allowHideInReadOnly = false,
|
|
2048
2124
|
allowResizeInReadOnly = false,
|
|
2049
2125
|
deferLoadingAboveBytes = DEFAULT_DEFER_LOADING_ABOVE_BYTES,
|
|
2050
2126
|
file,
|
|
@@ -2063,7 +2139,8 @@ function useXlsxViewerController(options2) {
|
|
|
2063
2139
|
const [isLoading, setIsLoading] = d(Boolean(file ?? src));
|
|
2064
2140
|
const [error, setError] = d(null);
|
|
2065
2141
|
const [workbook, setWorkbook] = d(null);
|
|
2066
|
-
const [
|
|
2142
|
+
const [readOnlyLayouts, setReadOnlyLayouts] = d({});
|
|
2143
|
+
const [workbookSheets, setSheets] = d([]);
|
|
2067
2144
|
const [chartsByWorkbookSheetIndex, setChartsByWorkbookSheetIndex] = d([]);
|
|
2068
2145
|
const [chartsheets, setChartsheets] = d([]);
|
|
2069
2146
|
const [tabs, setTabs] = d([]);
|
|
@@ -2118,6 +2195,7 @@ function useXlsxViewerController(options2) {
|
|
|
2118
2195
|
const displayFileName = T(() => resolveDisplayFileName(src, fileName), [fileName, src]);
|
|
2119
2196
|
const shouldDeferLoading = deferLoadingAboveBytes > 0;
|
|
2120
2197
|
const readOnly = requestedReadOnly || forcedReadOnly;
|
|
2198
|
+
const sheets = T(() => readOnly ? workbookSheets.map((sheet) => applyReadOnlyLayout(sheet, readOnlyLayouts[sheet.workbookSheetIndex])) : workbookSheets, [readOnly, readOnlyLayouts, workbookSheets]);
|
|
2121
2199
|
const drawingMutationEpoch = A(0);
|
|
2122
2200
|
const drawingMutationState = A({ workbook, revision, readOnly, activeCell, activeSheetIndex });
|
|
2123
2201
|
drawingMutationState.current = { workbook, revision, readOnly, activeCell, activeSheetIndex };
|
|
@@ -2279,6 +2357,7 @@ function useXlsxViewerController(options2) {
|
|
|
2279
2357
|
}, [disposeWorkerClient]);
|
|
2280
2358
|
h(() => {
|
|
2281
2359
|
loadGenerationRef.current += 1;
|
|
2360
|
+
setReadOnlyLayouts({});
|
|
2282
2361
|
if (!file && !src) {
|
|
2283
2362
|
disposeWorkerClient();
|
|
2284
2363
|
setForcedReadOnly(false);
|
|
@@ -3570,28 +3649,50 @@ function useXlsxViewerController(options2) {
|
|
|
3570
3649
|
}));
|
|
3571
3650
|
setRevision((current) => current + 1);
|
|
3572
3651
|
}, [activeSheet]);
|
|
3652
|
+
const canChangeVisibility = Boolean(activeSheet && !isLoading && (readOnly ? allowHideInReadOnly : workbook));
|
|
3653
|
+
const canChangeFreezePanes = Boolean(activeSheet && !isLoading && (readOnly ? allowFreezeInReadOnly : workbook));
|
|
3654
|
+
const activeLayout = activeSheet && readOnly ? readOnlyLayouts[activeSheet.workbookSheetIndex] : void 0;
|
|
3655
|
+
h(() => {
|
|
3656
|
+
if (!activeCell || !activeLayout) return;
|
|
3657
|
+
const { hiddenRows, hiddenCols } = activeLayout;
|
|
3658
|
+
const row3 = hiddenRows?.has(activeCell.row) ? nextVisibleIndex(activeCell.row, XLSX_MAX_ROWS, (index) => hiddenRows.has(index)) : activeCell.row;
|
|
3659
|
+
const col = hiddenCols?.has(activeCell.col) ? nextVisibleIndex(activeCell.col, XLSX_MAX_COLUMNS, (index) => hiddenCols.has(index)) : activeCell.col;
|
|
3660
|
+
if (row3 === activeCell.row && col === activeCell.col) return;
|
|
3661
|
+
const cell = row3 < 0 || col < 0 ? null : { row: row3, col };
|
|
3662
|
+
setActiveCell(cell);
|
|
3663
|
+
setSelection(cell && { start: cell, end: cell });
|
|
3664
|
+
selectionAnchorRef.current = cell;
|
|
3665
|
+
}, [activeCell, activeLayout, setSelection]);
|
|
3573
3666
|
const setAxisHidden = q((axis, hidden, start, end = start) => {
|
|
3574
|
-
if (
|
|
3667
|
+
if (!canChangeVisibility || !activeSheet) return;
|
|
3575
3668
|
const limit = axis === "row" ? XLSX_MAX_ROWS : XLSX_MAX_COLUMNS;
|
|
3576
|
-
const
|
|
3669
|
+
const fromSelection = start === void 0 && end === void 0;
|
|
3670
|
+
const ranges = fromSelection ? selectionRanges.map((area) => ({ start: area.start[axis], end: area.end[axis] })) : [{ start: start ?? -1, end: end ?? -1 }];
|
|
3577
3671
|
if (!ranges.length || ranges.some((range) => !Number.isInteger(range.start) || !Number.isInteger(range.end) || range.start < 0 || range.end < range.start || range.end >= limit)) return;
|
|
3578
|
-
const
|
|
3579
|
-
|
|
3580
|
-
const
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3672
|
+
const sheetIndex = activeSheet.workbookSheetIndex;
|
|
3673
|
+
if (readOnly) {
|
|
3674
|
+
const key = axis === "row" ? "hiddenRows" : "hiddenCols";
|
|
3675
|
+
setReadOnlyLayouts((current) => {
|
|
3676
|
+
const layout = current[sheetIndex];
|
|
3677
|
+
const existing = layout?.[key] ?? new Set(activeSheet[key]);
|
|
3678
|
+
const changes = changedVisibilityRanges(existing, ranges, hidden, fromSelection);
|
|
3679
|
+
if (!changes.length) return current;
|
|
3680
|
+
const next = new Set(existing);
|
|
3681
|
+
for (const range of changes) {
|
|
3682
|
+
for (let index = range.start; index <= range.end; index++) {
|
|
3683
|
+
if (hidden) next.add(index);
|
|
3684
|
+
else next.delete(index);
|
|
3685
|
+
}
|
|
3592
3686
|
}
|
|
3593
|
-
return
|
|
3687
|
+
return { ...current, [sheetIndex]: { ...layout, [key]: next } };
|
|
3594
3688
|
});
|
|
3689
|
+
return;
|
|
3690
|
+
}
|
|
3691
|
+
if (!workbook) return;
|
|
3692
|
+
const worksheet = workbook.getSheet(sheetIndex);
|
|
3693
|
+
try {
|
|
3694
|
+
const existing = new Set(axis === "row" ? worksheet.hiddenRows : worksheet.hiddenColumns);
|
|
3695
|
+
const changes = changedVisibilityRanges(existing, ranges, hidden, fromSelection);
|
|
3595
3696
|
if (!changes.length) return;
|
|
3596
3697
|
recordHistoryBeforeMutation();
|
|
3597
3698
|
for (const range of changes) {
|
|
@@ -3599,13 +3700,11 @@ function useXlsxViewerController(options2) {
|
|
|
3599
3700
|
else worksheet.setColumnsHidden(range.start, range.end, hidden);
|
|
3600
3701
|
}
|
|
3601
3702
|
if (hidden && activeCell && changes.some((range) => range.start <= activeCell[axis] && activeCell[axis] <= range.end)) {
|
|
3602
|
-
const
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
while (index >= 0 && isHidden(index)) index--;
|
|
3608
|
-
}
|
|
3703
|
+
const index = nextVisibleIndex(
|
|
3704
|
+
activeCell[axis],
|
|
3705
|
+
limit,
|
|
3706
|
+
(value) => axis === "row" ? worksheet.isRowHidden(value) : worksheet.isColumnHidden(value)
|
|
3707
|
+
);
|
|
3609
3708
|
if (index >= 0) {
|
|
3610
3709
|
const cell = { ...activeCell, [axis]: index };
|
|
3611
3710
|
setActiveCell(cell);
|
|
@@ -3617,16 +3716,23 @@ function useXlsxViewerController(options2) {
|
|
|
3617
3716
|
} finally {
|
|
3618
3717
|
worksheet.free();
|
|
3619
3718
|
}
|
|
3620
|
-
}, [activeCell, activeSheet, readOnly, recordHistoryBeforeMutation, refreshWorkbookState, selectionRanges, setSelection, workbook]);
|
|
3719
|
+
}, [activeCell, activeSheet, canChangeVisibility, readOnly, recordHistoryBeforeMutation, refreshWorkbookState, selectionRanges, setSelection, workbook]);
|
|
3621
3720
|
const hideRows = q((start, end) => setAxisHidden("row", true, start, end), [setAxisHidden]);
|
|
3622
3721
|
const unhideRows = q((start, end) => setAxisHidden("row", false, start, end), [setAxisHidden]);
|
|
3623
3722
|
const hideColumns = q((start, end) => setAxisHidden("col", true, start, end), [setAxisHidden]);
|
|
3624
3723
|
const unhideColumns = q((start, end) => setAxisHidden("col", false, start, end), [setAxisHidden]);
|
|
3625
3724
|
const setFreezeBoundary = q((cell) => {
|
|
3626
|
-
if (
|
|
3725
|
+
if (!canChangeFreezePanes || !activeSheet) return;
|
|
3627
3726
|
const { row: row3, col } = cell;
|
|
3628
3727
|
if (!Number.isInteger(row3) || row3 < 0 || row3 >= XLSX_MAX_ROWS || !Number.isInteger(col) || col < 0 || col >= XLSX_MAX_COLUMNS) return;
|
|
3629
|
-
const
|
|
3728
|
+
const sheetIndex = activeSheet.workbookSheetIndex;
|
|
3729
|
+
if (readOnly) {
|
|
3730
|
+
const freezePanes2 = row3 || col ? { row: row3, col } : null;
|
|
3731
|
+
setReadOnlyLayouts((current) => ({ ...current, [sheetIndex]: { ...current[sheetIndex], freezePanes: freezePanes2 } }));
|
|
3732
|
+
return;
|
|
3733
|
+
}
|
|
3734
|
+
if (!workbook) return;
|
|
3735
|
+
const worksheet = workbook.getSheet(sheetIndex);
|
|
3630
3736
|
try {
|
|
3631
3737
|
const current = parseWorksheetFreezePanes(worksheet);
|
|
3632
3738
|
if (row3 === (current?.row ?? 0) && col === (current?.col ?? 0)) return;
|
|
@@ -3636,9 +3742,9 @@ function useXlsxViewerController(options2) {
|
|
|
3636
3742
|
} finally {
|
|
3637
3743
|
worksheet.free();
|
|
3638
3744
|
}
|
|
3639
|
-
}, [activeSheet, readOnly, recordHistoryBeforeMutation, refreshWorkbookState, workbook]);
|
|
3745
|
+
}, [activeSheet, canChangeFreezePanes, readOnly, recordHistoryBeforeMutation, refreshWorkbookState, workbook]);
|
|
3640
3746
|
const freezeCell = resolveFreezePanesCell(activeCell, selection);
|
|
3641
|
-
const canFreezePanes = Boolean(
|
|
3747
|
+
const canFreezePanes = Boolean(canChangeFreezePanes && freezeCell && (freezeCell.row > 0 || freezeCell.col > 0));
|
|
3642
3748
|
const freezePanes = q((cell = freezeCell) => {
|
|
3643
3749
|
if (cell) setFreezeBoundary(cell);
|
|
3644
3750
|
}, [freezeCell, setFreezeBoundary]);
|
|
@@ -4108,7 +4214,8 @@ function useXlsxViewerController(options2) {
|
|
|
4108
4214
|
setSelectedImageId(null);
|
|
4109
4215
|
selectionAnchorRef.current = active?.start ?? null;
|
|
4110
4216
|
const cell = active?.[activeCorner];
|
|
4111
|
-
|
|
4217
|
+
const mergeAnchor = cell && findSelectionMerge(cell)?.start;
|
|
4218
|
+
setActiveCell(mergeAnchor && active && rangeContainsCell(active, mergeAnchor) ? mergeAnchor : cell ?? null);
|
|
4112
4219
|
setSelectionRanges(areas);
|
|
4113
4220
|
}, [findSelectionMerge]);
|
|
4114
4221
|
const selectRange = q((range) => {
|
|
@@ -4929,6 +5036,8 @@ function useXlsxViewerController(options2) {
|
|
|
4929
5036
|
resizeChartBy,
|
|
4930
5037
|
resizeImageBy,
|
|
4931
5038
|
frozenPanes: activeSheet?.freezePanes ?? null,
|
|
5039
|
+
canChangeFreezePanes,
|
|
5040
|
+
canChangeVisibility,
|
|
4932
5041
|
canFreezePanes,
|
|
4933
5042
|
hideRows,
|
|
4934
5043
|
unhideRows,
|
|
@@ -5081,6 +5190,8 @@ function useXlsxViewerController(options2) {
|
|
|
5081
5190
|
revision,
|
|
5082
5191
|
resizeChartBy,
|
|
5083
5192
|
resizeImageBy,
|
|
5193
|
+
canChangeFreezePanes,
|
|
5194
|
+
canChangeVisibility,
|
|
5084
5195
|
canFreezePanes,
|
|
5085
5196
|
hideRows,
|
|
5086
5197
|
unhideRows,
|
|
@@ -7281,6 +7392,83 @@ function getCellGeneralAlignment(worksheet, row3, col) {
|
|
|
7281
7392
|
}
|
|
7282
7393
|
}
|
|
7283
7394
|
|
|
7395
|
+
// src/hidden-range-marker.tsx
|
|
7396
|
+
function resizeCursor(axis) {
|
|
7397
|
+
const transform = axis === "column" ? ' transform="rotate(90 12 12)"' : "";
|
|
7398
|
+
const path = "M6 10h12 M6 14h12 M12 7V3 M9 6l3-3 3 3 M12 17v4 M9 18l3 3 3-3";
|
|
7399
|
+
const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
7400
|
+
<g fill="none" stroke-linecap="round" stroke-linejoin="round"${transform}>
|
|
7401
|
+
<path d="${path}" stroke="white" stroke-width="3.5"/>
|
|
7402
|
+
<path d="${path}" stroke="#111" stroke-width="1.5"/>
|
|
7403
|
+
</g>
|
|
7404
|
+
</svg>`;
|
|
7405
|
+
const fallback = axis === "row" ? "row-resize" : "col-resize";
|
|
7406
|
+
return `url("data:image/svg+xml,${encodeURIComponent(svg)}") 12 12, ${fallback}`;
|
|
7407
|
+
}
|
|
7408
|
+
var ROW_RESIZE_CURSOR = resizeCursor("row");
|
|
7409
|
+
var COLUMN_RESIZE_CURSOR = resizeCursor("column");
|
|
7410
|
+
function hiddenRangeEnds(hidden) {
|
|
7411
|
+
const ends = /* @__PURE__ */ new Map();
|
|
7412
|
+
for (const start of hidden) {
|
|
7413
|
+
if (hidden.has(start - 1)) continue;
|
|
7414
|
+
let end = start;
|
|
7415
|
+
while (hidden.has(end + 1)) end++;
|
|
7416
|
+
ends.set(start, end);
|
|
7417
|
+
}
|
|
7418
|
+
return ends;
|
|
7419
|
+
}
|
|
7420
|
+
function HiddenRangeMarker({ axis, start, end, label, position, color, readOnly, canUnhide, onUnhide, render, zoomFactor }) {
|
|
7421
|
+
const action = A(onUnhide);
|
|
7422
|
+
action.current = onUnhide;
|
|
7423
|
+
const unhide = q(() => {
|
|
7424
|
+
if (canUnhide) action.current(start, end);
|
|
7425
|
+
}, [start, end, canUnhide]);
|
|
7426
|
+
const row3 = axis === "row";
|
|
7427
|
+
const content = T(() => {
|
|
7428
|
+
const hitSize = "max(6px, 0.8em)";
|
|
7429
|
+
const style = {
|
|
7430
|
+
display: "grid",
|
|
7431
|
+
placeItems: "center",
|
|
7432
|
+
boxSizing: "border-box",
|
|
7433
|
+
width: row3 ? "100%" : hitSize,
|
|
7434
|
+
height: row3 ? hitSize : "100%",
|
|
7435
|
+
background: "transparent",
|
|
7436
|
+
border: 0,
|
|
7437
|
+
borderRadius: 0,
|
|
7438
|
+
margin: 0,
|
|
7439
|
+
padding: 0,
|
|
7440
|
+
fontSize: "inherit",
|
|
7441
|
+
outlineOffset: -2
|
|
7442
|
+
};
|
|
7443
|
+
const line = /* @__PURE__ */ u("span", { "aria-hidden": "true", style: { width: row3 ? "100%" : 3, height: row3 ? 3 : "100%", backgroundColor: color } });
|
|
7444
|
+
const defaultNode = canUnhide ? /* @__PURE__ */ u("button", { type: "button", "aria-label": label, title: label, onClick: unhide, style: { ...style, cursor: row3 ? ROW_RESIZE_CURSOR : COLUMN_RESIZE_CURSOR }, children: line }) : /* @__PURE__ */ u("span", { role: "img", "aria-label": label, title: label, style, children: line });
|
|
7445
|
+
return render ? render({ axis, start, end, readOnly, canUnhide, label, unhide, defaultNode }) : defaultNode;
|
|
7446
|
+
}, [axis, start, end, label, row3, color, readOnly, canUnhide, render, unhide]);
|
|
7447
|
+
if (content == null || content === false) return null;
|
|
7448
|
+
return /* @__PURE__ */ u(
|
|
7449
|
+
"span",
|
|
7450
|
+
{
|
|
7451
|
+
"data-xlsx-hidden-range-marker": axis,
|
|
7452
|
+
onPointerDown: (event) => event.stopPropagation(),
|
|
7453
|
+
onKeyDown: (event) => event.stopPropagation(),
|
|
7454
|
+
style: {
|
|
7455
|
+
position: "absolute",
|
|
7456
|
+
display: "grid",
|
|
7457
|
+
placeItems: "center",
|
|
7458
|
+
fontSize: 10 * zoomFactor,
|
|
7459
|
+
zIndex: 6,
|
|
7460
|
+
pointerEvents: "none",
|
|
7461
|
+
left: row3 ? 0 : position - 0.5,
|
|
7462
|
+
right: row3 ? 0 : void 0,
|
|
7463
|
+
top: row3 ? position - 0.5 : 0,
|
|
7464
|
+
bottom: row3 ? void 0 : 0,
|
|
7465
|
+
transform: row3 ? "translateY(-50%)" : "translateX(-50%)"
|
|
7466
|
+
},
|
|
7467
|
+
children: /* @__PURE__ */ u("span", { style: { display: "contents", pointerEvents: canUnhide || render ? "auto" : "none" }, children: content })
|
|
7468
|
+
}
|
|
7469
|
+
);
|
|
7470
|
+
}
|
|
7471
|
+
|
|
7284
7472
|
// src/header-size-dialog.tsx
|
|
7285
7473
|
function HeaderSizeDialog({ axis, context, sizes, maxSize, messages, locale, palette, close, resize }) {
|
|
7286
7474
|
const dialog = A(null);
|
|
@@ -7681,7 +7869,7 @@ function XlsxContextMenu({
|
|
|
7681
7869
|
label: `${row3 ? messages.rowHeight : messages.columnWidth}\u2026`,
|
|
7682
7870
|
separatorBefore: true
|
|
7683
7871
|
}] : [],
|
|
7684
|
-
|
|
7872
|
+
...controller.canChangeVisibility ?? !controller.readOnly ? [
|
|
7685
7873
|
{ id: row3 ? "hideRows" : "hideColumns", label: messages.hide, separatorBefore: !canResize },
|
|
7686
7874
|
{ id: row3 ? "unhideRows" : "unhideColumns", label: messages.unhide }
|
|
7687
7875
|
] : []
|
|
@@ -9258,7 +9446,7 @@ function createChartModule(importModule) {
|
|
|
9258
9446
|
};
|
|
9259
9447
|
}
|
|
9260
9448
|
var officeChartRenderer = createChartModule(async () => {
|
|
9261
|
-
const { SharedChartSvg } = await import("./shared-chart-
|
|
9449
|
+
const { SharedChartSvg } = await import("./shared-chart-NR4KWDQM.js");
|
|
9262
9450
|
return { renderer: null, SharedChartSvg };
|
|
9263
9451
|
});
|
|
9264
9452
|
var suppliedOfficeChartRenderer = officeChartRenderer;
|
|
@@ -14696,6 +14884,7 @@ function XlsxGrid({
|
|
|
14696
14884
|
onFormControlChange,
|
|
14697
14885
|
renderChartLoading,
|
|
14698
14886
|
renderContextMenu,
|
|
14887
|
+
renderHiddenRangeMarker,
|
|
14699
14888
|
enableContextMenu = true,
|
|
14700
14889
|
contextMenuClassName,
|
|
14701
14890
|
contextMenuStyle,
|
|
@@ -14844,6 +15033,7 @@ function XlsxGrid({
|
|
|
14844
15033
|
const selectionOverlayRef = A(null);
|
|
14845
15034
|
const selectionPaneContentRefs = A(/* @__PURE__ */ new Map());
|
|
14846
15035
|
const tableHeaderPaneContentRefs = A(/* @__PURE__ */ new Map());
|
|
15036
|
+
const markerPaneRefs = A(/* @__PURE__ */ new Map());
|
|
14847
15037
|
const cellOverlayContentRefs = A(/* @__PURE__ */ new Map());
|
|
14848
15038
|
const [cellOverlayHosts, setCellOverlayHosts] = d({});
|
|
14849
15039
|
const cellOverlayHostRefs = T(() => Object.fromEntries(
|
|
@@ -15066,6 +15256,8 @@ function XlsxGrid({
|
|
|
15066
15256
|
);
|
|
15067
15257
|
const hiddenRowSet = T(() => new Set(activeSheet?.hiddenRows ?? []), [activeSheet?.hiddenRows]);
|
|
15068
15258
|
const hiddenColSet = T(() => new Set(activeSheet?.hiddenCols ?? []), [activeSheet?.hiddenCols]);
|
|
15259
|
+
const hiddenRowEnds = T(() => hiddenRangeEnds(hiddenRowSet), [hiddenRowSet]);
|
|
15260
|
+
const hiddenColEnds = T(() => hiddenRangeEnds(hiddenColSet), [hiddenColSet]);
|
|
15069
15261
|
const displayDefaultRowHeight = DEFAULT_ROW_HEIGHT2 * zoomFactor;
|
|
15070
15262
|
const displayDefaultColWidth = DEFAULT_COL_WIDTH2 * zoomFactor;
|
|
15071
15263
|
const displayHeaderHeight = HEADER_HEIGHT * zoomFactor;
|
|
@@ -15141,6 +15333,19 @@ function XlsxGrid({
|
|
|
15141
15333
|
shouldTransform ? "transform" : ""
|
|
15142
15334
|
);
|
|
15143
15335
|
};
|
|
15336
|
+
for (const [pane, element] of markerPaneRefs.current) {
|
|
15337
|
+
const scrollX = pane === "column-scroll";
|
|
15338
|
+
const scrollY = pane === "row-scroll";
|
|
15339
|
+
applyCanvasTransform(
|
|
15340
|
+
element,
|
|
15341
|
+
scrollX ? -nextLiveViewport.left : 0,
|
|
15342
|
+
scrollY ? -nextLiveViewport.top : 0,
|
|
15343
|
+
0,
|
|
15344
|
+
0,
|
|
15345
|
+
scrollX ? liveZoomAnchorX : 0,
|
|
15346
|
+
scrollY ? liveZoomAnchorY : 0
|
|
15347
|
+
);
|
|
15348
|
+
}
|
|
15144
15349
|
const applyOverlayTransform = (pane, element, baseTranslateX, baseTranslateY, paneLeft, paneTop, anchorX, anchorY) => {
|
|
15145
15350
|
const translateX = resolveLiveTranslation(baseTranslateX, anchorX, paneLeft);
|
|
15146
15351
|
const translateY = resolveLiveTranslation(baseTranslateY, anchorY, paneTop);
|
|
@@ -15542,7 +15747,7 @@ function XlsxGrid({
|
|
|
15542
15747
|
);
|
|
15543
15748
|
if (worksheet) {
|
|
15544
15749
|
for (let col = 0; col < displayColLimit; col += 1) {
|
|
15545
|
-
if (
|
|
15750
|
+
if (hiddenColSet.has(col)) {
|
|
15546
15751
|
continue;
|
|
15547
15752
|
}
|
|
15548
15753
|
const width = worksheet.getColumnWidth(col);
|
|
@@ -15642,7 +15847,7 @@ function XlsxGrid({
|
|
|
15642
15847
|
estimatedHeights.set(row3, estimatedHeight);
|
|
15643
15848
|
}
|
|
15644
15849
|
for (let row3 = 0; row3 < displayRowLimit; row3 += 1) {
|
|
15645
|
-
if (
|
|
15850
|
+
if (hiddenRowSet.has(row3)) continue;
|
|
15646
15851
|
const height = worksheet.getRowHeight(row3);
|
|
15647
15852
|
if (height !== void 0 && height !== null) {
|
|
15648
15853
|
heights[row3] = Math.max(
|
|
@@ -16561,14 +16766,14 @@ function XlsxGrid({
|
|
|
16561
16766
|
}
|
|
16562
16767
|
return null;
|
|
16563
16768
|
}, []);
|
|
16769
|
+
const pointerAddress = q(
|
|
16770
|
+
(clientX, clientY) => resolvePointerCellFromGeometry(clientX, clientY) ?? resolvePointerCellFromHitTest(clientX, clientY),
|
|
16771
|
+
[resolvePointerCellFromGeometry, resolvePointerCellFromHitTest]
|
|
16772
|
+
);
|
|
16564
16773
|
const resolvePointerCellFromClient = q((clientX, clientY) => {
|
|
16565
|
-
const
|
|
16566
|
-
if (geometryCell) {
|
|
16567
|
-
return resolveMergeAnchorCell(geometryCell);
|
|
16568
|
-
}
|
|
16569
|
-
const resolvedCell = resolvePointerCellFromHitTest(clientX, clientY);
|
|
16774
|
+
const resolvedCell = pointerAddress(clientX, clientY);
|
|
16570
16775
|
return resolvedCell ? resolveMergeAnchorCell(resolvedCell) : null;
|
|
16571
|
-
}, [
|
|
16776
|
+
}, [pointerAddress, resolveMergeAnchorCell]);
|
|
16572
16777
|
const resolveDraggedSelectionCell = q((dragState, clientX, clientY) => {
|
|
16573
16778
|
const geometryCell = resolvePointerCellFromGeometry(clientX, clientY);
|
|
16574
16779
|
const hitCell = resolvePointerCellFromHitTest(clientX, clientY);
|
|
@@ -20687,10 +20892,10 @@ function XlsxGrid({
|
|
|
20687
20892
|
...charts.map((chart) => drawingLayer(chart.zIndex) + 22)
|
|
20688
20893
|
);
|
|
20689
20894
|
const rowHeaderOverlayZIndex = Math.max(35, maxDrawingOverlayZIndex + 1);
|
|
20690
|
-
const
|
|
20895
|
+
const frozenRowHeaderOverlayZIndex = rowHeaderOverlayZIndex + 1;
|
|
20896
|
+
const canvasHeaderOverlayZIndex = Math.max(50, frozenRowHeaderOverlayZIndex + 1);
|
|
20691
20897
|
const stickyHeaderOverlayZIndex = canvasHeaderOverlayZIndex + 1;
|
|
20692
20898
|
const cornerHeaderOverlayZIndex = canvasHeaderOverlayZIndex + 2;
|
|
20693
|
-
const frozenRowHeaderOverlayZIndex = rowHeaderOverlayZIndex;
|
|
20694
20899
|
const headerCellStyle = scaleCssProperties({
|
|
20695
20900
|
backgroundColor: palette.headerSurface,
|
|
20696
20901
|
borderBottom: "none",
|
|
@@ -20710,6 +20915,42 @@ function XlsxGrid({
|
|
|
20710
20915
|
whiteSpace: "nowrap",
|
|
20711
20916
|
zIndex: canvasHeaderOverlayZIndex
|
|
20712
20917
|
}, zoomFactor);
|
|
20918
|
+
function headerMarkers(axis, index, offset, size) {
|
|
20919
|
+
const row3 = axis === "row";
|
|
20920
|
+
const ends = row3 ? hiddenRowEnds : hiddenColEnds;
|
|
20921
|
+
if (!ends.size) return null;
|
|
20922
|
+
const leadingEnd = ends.get(0);
|
|
20923
|
+
const trailingEnd = ends.get(index + 1);
|
|
20924
|
+
if (leadingEnd !== index - 1 && trailingEnd === void 0) return null;
|
|
20925
|
+
function marker(start, end, position) {
|
|
20926
|
+
const first = row3 ? String(start + 1) : columnLabel2(start);
|
|
20927
|
+
const last = row3 ? String(end + 1) : columnLabel2(end);
|
|
20928
|
+
const range = first === last ? first : `${first}\u2013${last}`;
|
|
20929
|
+
const canUnhide = controller.canChangeVisibility ?? !readOnly;
|
|
20930
|
+
const template = row3 ? canUnhide ? messages.unhideRowRange : messages.hiddenRowRange : canUnhide ? messages.unhideColumnRange : messages.hiddenColumnRange;
|
|
20931
|
+
return /* @__PURE__ */ u(
|
|
20932
|
+
HiddenRangeMarker,
|
|
20933
|
+
{
|
|
20934
|
+
axis,
|
|
20935
|
+
start,
|
|
20936
|
+
end,
|
|
20937
|
+
position,
|
|
20938
|
+
readOnly,
|
|
20939
|
+
canUnhide,
|
|
20940
|
+
label: formatMessage(template, { range }),
|
|
20941
|
+
color: selectionStroke,
|
|
20942
|
+
zoomFactor,
|
|
20943
|
+
onUnhide: row3 ? controller.unhideRows : controller.unhideColumns,
|
|
20944
|
+
render: renderHiddenRangeMarker
|
|
20945
|
+
},
|
|
20946
|
+
`${activeSheet?.workbookSheetIndex}:${axis}:${start}`
|
|
20947
|
+
);
|
|
20948
|
+
}
|
|
20949
|
+
const markers = [];
|
|
20950
|
+
if (leadingEnd === index - 1) markers.push(marker(0, leadingEnd, offset));
|
|
20951
|
+
if (trailingEnd !== void 0) markers.push(marker(index + 1, trailingEnd, offset + size));
|
|
20952
|
+
return markers;
|
|
20953
|
+
}
|
|
20713
20954
|
const columnResizeHandleStyle = scaleCssProperties({
|
|
20714
20955
|
backgroundColor: "transparent",
|
|
20715
20956
|
cursor: "col-resize",
|
|
@@ -22238,7 +22479,7 @@ function XlsxGrid({
|
|
|
22238
22479
|
}
|
|
22239
22480
|
return;
|
|
22240
22481
|
}
|
|
22241
|
-
if (!readOnly && !selectedChart && !selectedImage && event.ctrlKey && !event.metaKey && !event.altKey) {
|
|
22482
|
+
if ((controller.canChangeVisibility ?? !readOnly) && !selectedChart && !selectedImage && event.ctrlKey && !event.metaKey && !event.altKey) {
|
|
22242
22483
|
if (event.code === "Digit9" || event.code === "Digit0") {
|
|
22243
22484
|
event.preventDefault();
|
|
22244
22485
|
if (event.code === "Digit9") {
|
|
@@ -22438,7 +22679,7 @@ function XlsxGrid({
|
|
|
22438
22679
|
const isRowHeader = event.clientX - rect.left < displayRowHeaderWidth;
|
|
22439
22680
|
const isColumnHeader = event.clientY - rect.top < displayHeaderHeight;
|
|
22440
22681
|
const kind = isRowHeader && isColumnHeader ? "sheet" : isRowHeader ? "row" : isColumnHeader ? "column" : "cell";
|
|
22441
|
-
const cell =
|
|
22682
|
+
const cell = pointerAddress(event.clientX, event.clientY) ?? (kind === "sheet" ? { row: firstVisibleRow ?? 0, col: firstVisibleCol ?? 0 } : null);
|
|
22442
22683
|
if (!cell) return;
|
|
22443
22684
|
event.preventDefault();
|
|
22444
22685
|
openContextMenu(cell, kind, { x: event.clientX, y: event.clientY });
|
|
@@ -22795,6 +23036,47 @@ function XlsxGrid({
|
|
|
22795
23036
|
]
|
|
22796
23037
|
}
|
|
22797
23038
|
) }, pane)) }) : null;
|
|
23039
|
+
function markerPanes(axis) {
|
|
23040
|
+
const row3 = axis === "row";
|
|
23041
|
+
const ends = row3 ? hiddenRowEnds : hiddenColEnds;
|
|
23042
|
+
if (!ends.size) return null;
|
|
23043
|
+
const items = row3 ? canvasVisibleRowItems : canvasVisibleColItems;
|
|
23044
|
+
const indices = row3 ? visibleRows : visibleCols;
|
|
23045
|
+
const sticky = row3 ? stickyTopByRow : stickyLeftByCol;
|
|
23046
|
+
const gutter = row3 ? displayHeaderHeight : displayRowHeaderWidth;
|
|
23047
|
+
const frozenEdge = row3 ? frozenPaneBottom : frozenPaneRight;
|
|
23048
|
+
const panes = { scroll: [], frozen: [] };
|
|
23049
|
+
for (const item of items) {
|
|
23050
|
+
const index = indices[item.index];
|
|
23051
|
+
const fixedOffset = sticky.get(index);
|
|
23052
|
+
const markers = headerMarkers(axis, index, fixedOffset ?? gutter + item.start, item.size);
|
|
23053
|
+
if (markers) panes[fixedOffset === void 0 ? "scroll" : "frozen"].push(...markers);
|
|
23054
|
+
}
|
|
23055
|
+
return ["scroll", "frozen"].map((pane) => {
|
|
23056
|
+
if (!panes[pane].length) return null;
|
|
23057
|
+
const key = `${axis}-${pane}`;
|
|
23058
|
+
const clipStart = pane === "frozen" ? 0 : frozenEdge - (!sticky.size && ends.has(0) ? 5 : 0);
|
|
23059
|
+
const scroll = liveDrawingViewportRef.current;
|
|
23060
|
+
return /* @__PURE__ */ u("div", { style: {
|
|
23061
|
+
position: "absolute",
|
|
23062
|
+
left: 0,
|
|
23063
|
+
top: 0,
|
|
23064
|
+
pointerEvents: "none",
|
|
23065
|
+
width: row3 ? displayRowHeaderWidth : drawingViewport.width,
|
|
23066
|
+
height: row3 ? drawingViewport.height : displayHeaderHeight,
|
|
23067
|
+
clipPath: row3 ? `inset(${clipStart}px 0 0)` : `inset(0 0 0 ${clipStart}px)`
|
|
23068
|
+
}, children: /* @__PURE__ */ u("div", { ref: (element) => {
|
|
23069
|
+
if (element) markerPaneRefs.current.set(key, element);
|
|
23070
|
+
else markerPaneRefs.current.delete(key);
|
|
23071
|
+
}, style: {
|
|
23072
|
+
position: "absolute",
|
|
23073
|
+
inset: 0,
|
|
23074
|
+
transformOrigin: "0 0",
|
|
23075
|
+
transform: pane === "frozen" ? void 0 : row3 ? `translateY(${-scroll.top}px)` : `translateX(${-scroll.left}px)`,
|
|
23076
|
+
color: palette.headerText
|
|
23077
|
+
}, children: panes[pane] }) }, key);
|
|
23078
|
+
});
|
|
23079
|
+
}
|
|
22798
23080
|
const scrollerContent = /* @__PURE__ */ u(
|
|
22799
23081
|
"div",
|
|
22800
23082
|
{
|
|
@@ -22832,6 +23114,10 @@ function XlsxGrid({
|
|
|
22832
23114
|
selectionOverlayPanes,
|
|
22833
23115
|
tableHeaderOverlayPanes,
|
|
22834
23116
|
cellOverlayPanes,
|
|
23117
|
+
(hiddenRowEnds.size > 0 || hiddenColEnds.size > 0) && /* @__PURE__ */ u("div", { style: { ...canvasHeaderViewportLayerStyle, zIndex: cornerHeaderOverlayZIndex + 1 }, children: [
|
|
23118
|
+
markerPanes("column"),
|
|
23119
|
+
markerPanes("row")
|
|
23120
|
+
] }),
|
|
22835
23121
|
experimentalCanvas ? /* @__PURE__ */ u(S, { children: [
|
|
22836
23122
|
/* @__PURE__ */ u("div", { style: canvasBodyViewportLayerStyle, children: [
|
|
22837
23123
|
/* @__PURE__ */ u(
|
|
@@ -22876,50 +23162,23 @@ function XlsxGrid({
|
|
|
22876
23162
|
)
|
|
22877
23163
|
] }),
|
|
22878
23164
|
/* @__PURE__ */ u("div", { style: canvasHeaderViewportLayerStyle, children: [
|
|
22879
|
-
|
|
22880
|
-
|
|
22881
|
-
{
|
|
22882
|
-
|
|
22883
|
-
|
|
22884
|
-
|
|
22885
|
-
onPointerMove: handleCanvasColumnHeaderPointerMove,
|
|
22886
|
-
onPointerDown: handleCanvasColumnHeaderPointerDown,
|
|
22887
|
-
style: canvasTopFrozenHeaderStyle
|
|
22888
|
-
}
|
|
22889
|
-
),
|
|
22890
|
-
/* @__PURE__ */ u(
|
|
23165
|
+
[
|
|
23166
|
+
{ row: false, frozen: true, ref: topFrozenHeaderCanvasRef, style: canvasTopFrozenHeaderStyle },
|
|
23167
|
+
{ row: false, frozen: false, ref: topScrollHeaderCanvasRef, style: canvasTopScrollHeaderStyle },
|
|
23168
|
+
{ row: true, frozen: true, ref: leftFrozenHeaderCanvasRef, style: canvasLeftFrozenHeaderStyle },
|
|
23169
|
+
{ row: true, frozen: false, ref: leftScrollHeaderCanvasRef, style: canvasLeftScrollHeaderStyle }
|
|
23170
|
+
].map(({ row: row3, frozen, ref, style }) => /* @__PURE__ */ u(
|
|
22891
23171
|
"canvas",
|
|
22892
23172
|
{
|
|
22893
|
-
ref
|
|
22894
|
-
onDoubleClick: handleCanvasColumnHeaderDoubleClick,
|
|
23173
|
+
ref,
|
|
23174
|
+
onDoubleClick: row3 ? handleCanvasRowHeaderDoubleClick : handleCanvasColumnHeaderDoubleClick,
|
|
22895
23175
|
onPointerLeave: handleCanvasHeaderPointerLeave,
|
|
22896
|
-
onPointerMove: handleCanvasColumnHeaderPointerMove,
|
|
22897
|
-
onPointerDown: handleCanvasColumnHeaderPointerDown,
|
|
22898
|
-
style:
|
|
22899
|
-
}
|
|
22900
|
-
|
|
22901
|
-
|
|
22902
|
-
"canvas",
|
|
22903
|
-
{
|
|
22904
|
-
ref: leftFrozenHeaderCanvasRef,
|
|
22905
|
-
onDoubleClick: handleCanvasRowHeaderDoubleClick,
|
|
22906
|
-
onPointerLeave: handleCanvasHeaderPointerLeave,
|
|
22907
|
-
onPointerMove: handleCanvasRowHeaderPointerMove,
|
|
22908
|
-
onPointerDown: handleCanvasRowHeaderPointerDown,
|
|
22909
|
-
style: canvasLeftFrozenHeaderStyle
|
|
22910
|
-
}
|
|
22911
|
-
),
|
|
22912
|
-
/* @__PURE__ */ u(
|
|
22913
|
-
"canvas",
|
|
22914
|
-
{
|
|
22915
|
-
ref: leftScrollHeaderCanvasRef,
|
|
22916
|
-
onDoubleClick: handleCanvasRowHeaderDoubleClick,
|
|
22917
|
-
onPointerLeave: handleCanvasHeaderPointerLeave,
|
|
22918
|
-
onPointerMove: handleCanvasRowHeaderPointerMove,
|
|
22919
|
-
onPointerDown: handleCanvasRowHeaderPointerDown,
|
|
22920
|
-
style: canvasLeftScrollHeaderStyle
|
|
22921
|
-
}
|
|
22922
|
-
),
|
|
23176
|
+
onPointerMove: row3 ? handleCanvasRowHeaderPointerMove : handleCanvasColumnHeaderPointerMove,
|
|
23177
|
+
onPointerDown: row3 ? handleCanvasRowHeaderPointerDown : handleCanvasColumnHeaderPointerDown,
|
|
23178
|
+
style: { ...style, maxWidth: "none" }
|
|
23179
|
+
},
|
|
23180
|
+
`${row3}-${frozen}`
|
|
23181
|
+
)),
|
|
22923
23182
|
/* @__PURE__ */ u("canvas", { ref: cornerHeaderCanvasRef, style: canvasCornerHeaderStyle })
|
|
22924
23183
|
] }),
|
|
22925
23184
|
editingCell && editingOverlayRect ? (() => {
|
|
@@ -23478,6 +23737,7 @@ function XlsxViewerInner({
|
|
|
23478
23737
|
onFormControlChange,
|
|
23479
23738
|
renderChartLoading,
|
|
23480
23739
|
renderContextMenu,
|
|
23740
|
+
renderHiddenRangeMarker,
|
|
23481
23741
|
enableContextMenu = true,
|
|
23482
23742
|
contextMenuClassName,
|
|
23483
23743
|
contextMenuStyle,
|
|
@@ -23590,6 +23850,7 @@ function XlsxViewerInner({
|
|
|
23590
23850
|
onFormControlChange,
|
|
23591
23851
|
palette,
|
|
23592
23852
|
renderChartLoading,
|
|
23853
|
+
renderHiddenRangeMarker,
|
|
23593
23854
|
renderContextMenu,
|
|
23594
23855
|
enableContextMenu,
|
|
23595
23856
|
contextMenuClassName,
|
|
@@ -23664,6 +23925,7 @@ function toReactOptions(options2) {
|
|
|
23664
23925
|
renderPivotTableHeaderMenu,
|
|
23665
23926
|
renderChartLoading,
|
|
23666
23927
|
renderContextMenu,
|
|
23928
|
+
renderHiddenRangeMarker,
|
|
23667
23929
|
renderFormControl,
|
|
23668
23930
|
renderImage,
|
|
23669
23931
|
toolbar,
|
|
@@ -23681,6 +23943,7 @@ function toReactOptions(options2) {
|
|
|
23681
23943
|
renderPivotTableHeaderMenu: renderPivotTableHeaderMenu ? ({ defaultNode: _defaultNode, ...props }) => toReactContent(renderPivotTableHeaderMenu(props)) : void 0,
|
|
23682
23944
|
renderCellEditorOverlay: renderCellEditorOverlay ? (props) => toReactContent(renderCellEditorOverlay(props)) : void 0,
|
|
23683
23945
|
renderChartLoading: renderChartLoading ? ({ defaultNode: _defaultNode, ...props }) => toReactContent(renderChartLoading(props)) : void 0,
|
|
23946
|
+
renderHiddenRangeMarker: renderHiddenRangeMarker ? ({ defaultNode: _defaultNode, ...props }) => toReactContent(renderHiddenRangeMarker(props)) : void 0,
|
|
23684
23947
|
renderContextMenu: renderContextMenu ? ({ defaultNode: _defaultNode, ...props }) => toReactContent(renderContextMenu(props)) : void 0,
|
|
23685
23948
|
renderFormControl: renderFormControl ? (props) => toReactContent(renderFormControl({ ...props, stopPropagation: (event) => event.stopPropagation() })) : void 0,
|
|
23686
23949
|
renderImage: renderImage ? ({ defaultNode: _defaultNode, ...props }) => toReactContent(renderImage(props)) : void 0,
|
|
@@ -23839,4 +24102,4 @@ export {
|
|
|
23839
24102
|
__createContentNode,
|
|
23840
24103
|
__createContentRoot
|
|
23841
24104
|
};
|
|
23842
|
-
//# sourceMappingURL=chunk-
|
|
24105
|
+
//# sourceMappingURL=chunk-J3G4UUGR.js.map
|