@extend-ai/react-xlsx 0.24.0 → 0.24.1
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 +8 -4
- package/dist/{chunk-DGNSB5M5.cjs → chunk-WW6G674Q.cjs} +728 -618
- package/dist/chunk-WW6G674Q.cjs.map +1 -0
- package/dist/{chunk-C4WTJIRG.js → chunk-XUHSQ3GF.js} +146 -36
- package/dist/chunk-XUHSQ3GF.js.map +1 -0
- package/dist/index.cjs +344 -234
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +146 -36
- package/dist/index.js.map +1 -1
- package/dist/{internal-CwTqluL7.d.cts → internal-D5HReXVR.d.cts} +9 -1
- package/dist/{internal-CwTqluL7.d.ts → internal-D5HReXVR.d.ts} +9 -1
- package/dist/internal.cjs +2 -2
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +1 -1
- package/dist/vanilla.cjs +2 -2
- package/dist/vanilla.d.cts +2 -2
- package/dist/vanilla.d.ts +2 -2
- package/dist/vanilla.js +1 -1
- 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/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/index.d.cts
CHANGED
|
@@ -2302,6 +2302,10 @@ interface UseXlsxViewerControllerOptions {
|
|
|
2302
2302
|
* @default false
|
|
2303
2303
|
*/
|
|
2304
2304
|
allowResizeInReadOnly?: boolean;
|
|
2305
|
+
/** Allow session-only freeze and unfreeze in read-only mode. Defaults to false. */
|
|
2306
|
+
allowFreezeInReadOnly?: boolean;
|
|
2307
|
+
/** Allow session-only hiding and unhiding of rows and columns in read-only mode. Defaults to false. */
|
|
2308
|
+
allowHideInReadOnly?: boolean;
|
|
2305
2309
|
/**
|
|
2306
2310
|
* Defers loading until `continueDeferredLoad()` is called when the file is larger than this byte threshold.
|
|
2307
2311
|
* Set to `0` to parse immediately.
|
|
@@ -2383,7 +2387,11 @@ interface UseXlsxViewerControllerOptions {
|
|
|
2383
2387
|
interface XlsxViewerLayout {
|
|
2384
2388
|
/** Frozen row and column counts on the active worksheet, or null when unfrozen. */
|
|
2385
2389
|
frozenPanes: XlsxFreezePanes | null;
|
|
2386
|
-
/** Whether
|
|
2390
|
+
/** Whether freeze and unfreeze are available on the active worksheet. */
|
|
2391
|
+
canChangeFreezePanes?: boolean;
|
|
2392
|
+
/** Whether rows and columns can be hidden or revealed on the active worksheet. */
|
|
2393
|
+
canChangeVisibility?: boolean;
|
|
2394
|
+
/** Whether the current selection can be used as a freeze boundary. */
|
|
2387
2395
|
canFreezePanes: boolean;
|
|
2388
2396
|
/** Hide selected rows, or an inclusive, zero-based row interval. */
|
|
2389
2397
|
hideRows: (start?: number, end?: number) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -2302,6 +2302,10 @@ interface UseXlsxViewerControllerOptions {
|
|
|
2302
2302
|
* @default false
|
|
2303
2303
|
*/
|
|
2304
2304
|
allowResizeInReadOnly?: boolean;
|
|
2305
|
+
/** Allow session-only freeze and unfreeze in read-only mode. Defaults to false. */
|
|
2306
|
+
allowFreezeInReadOnly?: boolean;
|
|
2307
|
+
/** Allow session-only hiding and unhiding of rows and columns in read-only mode. Defaults to false. */
|
|
2308
|
+
allowHideInReadOnly?: boolean;
|
|
2305
2309
|
/**
|
|
2306
2310
|
* Defers loading until `continueDeferredLoad()` is called when the file is larger than this byte threshold.
|
|
2307
2311
|
* Set to `0` to parse immediately.
|
|
@@ -2383,7 +2387,11 @@ interface UseXlsxViewerControllerOptions {
|
|
|
2383
2387
|
interface XlsxViewerLayout {
|
|
2384
2388
|
/** Frozen row and column counts on the active worksheet, or null when unfrozen. */
|
|
2385
2389
|
frozenPanes: XlsxFreezePanes | null;
|
|
2386
|
-
/** Whether
|
|
2390
|
+
/** Whether freeze and unfreeze are available on the active worksheet. */
|
|
2391
|
+
canChangeFreezePanes?: boolean;
|
|
2392
|
+
/** Whether rows and columns can be hidden or revealed on the active worksheet. */
|
|
2393
|
+
canChangeVisibility?: boolean;
|
|
2394
|
+
/** Whether the current selection can be used as a freeze boundary. */
|
|
2387
2395
|
canFreezePanes: boolean;
|
|
2388
2396
|
/** Hide selected rows, or an inclusive, zero-based row interval. */
|
|
2389
2397
|
hideRows: (start?: number, end?: number) => void;
|
package/dist/index.js
CHANGED
|
@@ -93,6 +93,80 @@ function* bandIndices(bands) {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
// src/read-only-layout.ts
|
|
97
|
+
function changedVisibilityRanges(existing, ranges, hidden, fromSelection) {
|
|
98
|
+
if (!hidden && !existing.size) return [];
|
|
99
|
+
let firstVisible = 0;
|
|
100
|
+
if (!hidden && fromSelection) {
|
|
101
|
+
while (existing.has(firstVisible)) firstVisible++;
|
|
102
|
+
}
|
|
103
|
+
const changed = [];
|
|
104
|
+
for (const range of ranges) {
|
|
105
|
+
const start = firstVisible > 0 && range.start === firstVisible ? 0 : range.start;
|
|
106
|
+
for (let index = start; index <= range.end; index++) {
|
|
107
|
+
if (existing.has(index) !== hidden) {
|
|
108
|
+
changed.push({ start, end: range.end });
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return changed;
|
|
114
|
+
}
|
|
115
|
+
function nextVisibleIndex(index, limit, isHidden) {
|
|
116
|
+
let next = index;
|
|
117
|
+
while (next < limit && isHidden(next)) next++;
|
|
118
|
+
if (next < limit) return next;
|
|
119
|
+
next = index - 1;
|
|
120
|
+
while (next >= 0 && isHidden(next)) next--;
|
|
121
|
+
return next;
|
|
122
|
+
}
|
|
123
|
+
function visibleAxis(hidden, max, originalIndices, originalSizes, overrides, defaultSize) {
|
|
124
|
+
const indices = [];
|
|
125
|
+
const sizes = [];
|
|
126
|
+
let offset = 0;
|
|
127
|
+
for (let index = 0; index <= max; index++) {
|
|
128
|
+
const originalSize = originalIndices[offset] === index ? originalSizes[offset++] : void 0;
|
|
129
|
+
if (hidden.has(index)) continue;
|
|
130
|
+
indices.push(index);
|
|
131
|
+
sizes.push(originalSize ?? overrides[index] ?? defaultSize);
|
|
132
|
+
}
|
|
133
|
+
return { indices, sizes };
|
|
134
|
+
}
|
|
135
|
+
function applyReadOnlyLayout(sheet, layout) {
|
|
136
|
+
if (!layout) return sheet;
|
|
137
|
+
const view = { ...sheet };
|
|
138
|
+
if (layout.freezePanes !== void 0) view.freezePanes = layout.freezePanes;
|
|
139
|
+
if (layout.hiddenRows) {
|
|
140
|
+
const rows = visibleAxis(
|
|
141
|
+
layout.hiddenRows,
|
|
142
|
+
sheet.maxUsedRow,
|
|
143
|
+
sheet.visibleRows,
|
|
144
|
+
sheet.rowHeights,
|
|
145
|
+
sheet.rowHeightOverridesPx,
|
|
146
|
+
sheet.defaultRowHeightPx
|
|
147
|
+
);
|
|
148
|
+
view.hiddenRows = Array.from(layout.hiddenRows).sort((a, b) => a - b);
|
|
149
|
+
view.visibleRows = rows.indices;
|
|
150
|
+
view.rowHeights = rows.sizes;
|
|
151
|
+
view.rowCount = rows.indices.length;
|
|
152
|
+
}
|
|
153
|
+
if (layout.hiddenCols) {
|
|
154
|
+
const cols = visibleAxis(
|
|
155
|
+
layout.hiddenCols,
|
|
156
|
+
sheet.maxUsedCol,
|
|
157
|
+
sheet.visibleCols,
|
|
158
|
+
sheet.colWidths,
|
|
159
|
+
sheet.colWidthOverridesPx,
|
|
160
|
+
sheet.defaultColWidthPx
|
|
161
|
+
);
|
|
162
|
+
view.hiddenCols = Array.from(layout.hiddenCols).sort((a, b) => a - b);
|
|
163
|
+
view.visibleCols = cols.indices;
|
|
164
|
+
view.colWidths = cols.sizes;
|
|
165
|
+
view.colCount = cols.indices.length;
|
|
166
|
+
}
|
|
167
|
+
return view;
|
|
168
|
+
}
|
|
169
|
+
|
|
96
170
|
// src/merged-range-lookup.ts
|
|
97
171
|
function createMergedRangeLookup(ranges) {
|
|
98
172
|
const normalizedRanges = [];
|
|
@@ -962,7 +1036,7 @@ var XlsxWorkerClient = class {
|
|
|
962
1036
|
}
|
|
963
1037
|
async getMainRuntime() {
|
|
964
1038
|
if (this.disposed) throw createAbortError();
|
|
965
|
-
this.mainRuntime ??= import("./workbook-runtime-
|
|
1039
|
+
this.mainRuntime ??= import("./workbook-runtime-BAAYDYYK.js").then(({ createWorkbookRuntime }) => createWorkbookRuntime());
|
|
966
1040
|
const runtime = await this.mainRuntime;
|
|
967
1041
|
if (this.disposed) {
|
|
968
1042
|
runtime.dispose();
|
|
@@ -1938,6 +2012,8 @@ function downloadUrl(src, fileName) {
|
|
|
1938
2012
|
}
|
|
1939
2013
|
function useXlsxViewerController(options2) {
|
|
1940
2014
|
const {
|
|
2015
|
+
allowFreezeInReadOnly = false,
|
|
2016
|
+
allowHideInReadOnly = false,
|
|
1941
2017
|
allowResizeInReadOnly = false,
|
|
1942
2018
|
deferLoadingAboveBytes = DEFAULT_DEFER_LOADING_ABOVE_BYTES,
|
|
1943
2019
|
file,
|
|
@@ -1956,7 +2032,8 @@ function useXlsxViewerController(options2) {
|
|
|
1956
2032
|
const [isLoading, setIsLoading] = React.useState(Boolean(file ?? src));
|
|
1957
2033
|
const [error, setError] = React.useState(null);
|
|
1958
2034
|
const [workbook, setWorkbook] = React.useState(null);
|
|
1959
|
-
const [
|
|
2035
|
+
const [readOnlyLayouts, setReadOnlyLayouts] = React.useState({});
|
|
2036
|
+
const [workbookSheets, setSheets] = React.useState([]);
|
|
1960
2037
|
const [chartsByWorkbookSheetIndex, setChartsByWorkbookSheetIndex] = React.useState([]);
|
|
1961
2038
|
const [chartsheets, setChartsheets] = React.useState([]);
|
|
1962
2039
|
const [tabs, setTabs] = React.useState([]);
|
|
@@ -2011,6 +2088,7 @@ function useXlsxViewerController(options2) {
|
|
|
2011
2088
|
const displayFileName = React.useMemo(() => resolveDisplayFileName(src, fileName), [fileName, src]);
|
|
2012
2089
|
const shouldDeferLoading = deferLoadingAboveBytes > 0;
|
|
2013
2090
|
const readOnly = requestedReadOnly || forcedReadOnly;
|
|
2091
|
+
const sheets = React.useMemo(() => readOnly ? workbookSheets.map((sheet) => applyReadOnlyLayout(sheet, readOnlyLayouts[sheet.workbookSheetIndex])) : workbookSheets, [readOnly, readOnlyLayouts, workbookSheets]);
|
|
2014
2092
|
const drawingMutationEpoch = React.useRef(0);
|
|
2015
2093
|
const drawingMutationState = React.useRef({ workbook, revision, readOnly, activeCell, activeSheetIndex });
|
|
2016
2094
|
drawingMutationState.current = { workbook, revision, readOnly, activeCell, activeSheetIndex };
|
|
@@ -2172,6 +2250,7 @@ function useXlsxViewerController(options2) {
|
|
|
2172
2250
|
}, [disposeWorkerClient]);
|
|
2173
2251
|
React.useEffect(() => {
|
|
2174
2252
|
loadGenerationRef.current += 1;
|
|
2253
|
+
setReadOnlyLayouts({});
|
|
2175
2254
|
if (!file && !src) {
|
|
2176
2255
|
disposeWorkerClient();
|
|
2177
2256
|
setForcedReadOnly(false);
|
|
@@ -3463,28 +3542,50 @@ function useXlsxViewerController(options2) {
|
|
|
3463
3542
|
}));
|
|
3464
3543
|
setRevision((current) => current + 1);
|
|
3465
3544
|
}, [activeSheet]);
|
|
3545
|
+
const canChangeVisibility = Boolean(activeSheet && !isLoading && (readOnly ? allowHideInReadOnly : workbook));
|
|
3546
|
+
const canChangeFreezePanes = Boolean(activeSheet && !isLoading && (readOnly ? allowFreezeInReadOnly : workbook));
|
|
3547
|
+
const activeLayout = activeSheet && readOnly ? readOnlyLayouts[activeSheet.workbookSheetIndex] : void 0;
|
|
3548
|
+
React.useEffect(() => {
|
|
3549
|
+
if (!activeCell || !activeLayout) return;
|
|
3550
|
+
const { hiddenRows, hiddenCols } = activeLayout;
|
|
3551
|
+
const row2 = hiddenRows?.has(activeCell.row) ? nextVisibleIndex(activeCell.row, XLSX_MAX_ROWS, (index) => hiddenRows.has(index)) : activeCell.row;
|
|
3552
|
+
const col = hiddenCols?.has(activeCell.col) ? nextVisibleIndex(activeCell.col, XLSX_MAX_COLUMNS, (index) => hiddenCols.has(index)) : activeCell.col;
|
|
3553
|
+
if (row2 === activeCell.row && col === activeCell.col) return;
|
|
3554
|
+
const cell = row2 < 0 || col < 0 ? null : { row: row2, col };
|
|
3555
|
+
setActiveCell(cell);
|
|
3556
|
+
setSelection(cell && { start: cell, end: cell });
|
|
3557
|
+
selectionAnchorRef.current = cell;
|
|
3558
|
+
}, [activeCell, activeLayout, setSelection]);
|
|
3466
3559
|
const setAxisHidden = React.useCallback((axis, hidden, start, end = start) => {
|
|
3467
|
-
if (
|
|
3560
|
+
if (!canChangeVisibility || !activeSheet) return;
|
|
3468
3561
|
const limit = axis === "row" ? XLSX_MAX_ROWS : XLSX_MAX_COLUMNS;
|
|
3469
|
-
const
|
|
3562
|
+
const fromSelection = start === void 0 && end === void 0;
|
|
3563
|
+
const ranges = fromSelection ? selectionRanges.map((area) => ({ start: area.start[axis], end: area.end[axis] })) : [{ start: start ?? -1, end: end ?? -1 }];
|
|
3470
3564
|
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;
|
|
3471
|
-
const
|
|
3472
|
-
|
|
3473
|
-
const
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3565
|
+
const sheetIndex = activeSheet.workbookSheetIndex;
|
|
3566
|
+
if (readOnly) {
|
|
3567
|
+
const key = axis === "row" ? "hiddenRows" : "hiddenCols";
|
|
3568
|
+
setReadOnlyLayouts((current) => {
|
|
3569
|
+
const layout = current[sheetIndex];
|
|
3570
|
+
const existing = layout?.[key] ?? new Set(activeSheet[key]);
|
|
3571
|
+
const changes = changedVisibilityRanges(existing, ranges, hidden, fromSelection);
|
|
3572
|
+
if (!changes.length) return current;
|
|
3573
|
+
const next = new Set(existing);
|
|
3574
|
+
for (const range of changes) {
|
|
3575
|
+
for (let index = range.start; index <= range.end; index++) {
|
|
3576
|
+
if (hidden) next.add(index);
|
|
3577
|
+
else next.delete(index);
|
|
3578
|
+
}
|
|
3485
3579
|
}
|
|
3486
|
-
return
|
|
3580
|
+
return { ...current, [sheetIndex]: { ...layout, [key]: next } };
|
|
3487
3581
|
});
|
|
3582
|
+
return;
|
|
3583
|
+
}
|
|
3584
|
+
if (!workbook) return;
|
|
3585
|
+
const worksheet = workbook.getSheet(sheetIndex);
|
|
3586
|
+
try {
|
|
3587
|
+
const existing = new Set(axis === "row" ? worksheet.hiddenRows : worksheet.hiddenColumns);
|
|
3588
|
+
const changes = changedVisibilityRanges(existing, ranges, hidden, fromSelection);
|
|
3488
3589
|
if (!changes.length) return;
|
|
3489
3590
|
recordHistoryBeforeMutation();
|
|
3490
3591
|
for (const range of changes) {
|
|
@@ -3492,13 +3593,11 @@ function useXlsxViewerController(options2) {
|
|
|
3492
3593
|
else worksheet.setColumnsHidden(range.start, range.end, hidden);
|
|
3493
3594
|
}
|
|
3494
3595
|
if (hidden && activeCell && changes.some((range) => range.start <= activeCell[axis] && activeCell[axis] <= range.end)) {
|
|
3495
|
-
const
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
while (index >= 0 && isHidden(index)) index--;
|
|
3501
|
-
}
|
|
3596
|
+
const index = nextVisibleIndex(
|
|
3597
|
+
activeCell[axis],
|
|
3598
|
+
limit,
|
|
3599
|
+
(value) => axis === "row" ? worksheet.isRowHidden(value) : worksheet.isColumnHidden(value)
|
|
3600
|
+
);
|
|
3502
3601
|
if (index >= 0) {
|
|
3503
3602
|
const cell = { ...activeCell, [axis]: index };
|
|
3504
3603
|
setActiveCell(cell);
|
|
@@ -3510,16 +3609,23 @@ function useXlsxViewerController(options2) {
|
|
|
3510
3609
|
} finally {
|
|
3511
3610
|
worksheet.free();
|
|
3512
3611
|
}
|
|
3513
|
-
}, [activeCell, activeSheet, readOnly, recordHistoryBeforeMutation, refreshWorkbookState, selectionRanges, setSelection, workbook]);
|
|
3612
|
+
}, [activeCell, activeSheet, canChangeVisibility, readOnly, recordHistoryBeforeMutation, refreshWorkbookState, selectionRanges, setSelection, workbook]);
|
|
3514
3613
|
const hideRows = React.useCallback((start, end) => setAxisHidden("row", true, start, end), [setAxisHidden]);
|
|
3515
3614
|
const unhideRows = React.useCallback((start, end) => setAxisHidden("row", false, start, end), [setAxisHidden]);
|
|
3516
3615
|
const hideColumns = React.useCallback((start, end) => setAxisHidden("col", true, start, end), [setAxisHidden]);
|
|
3517
3616
|
const unhideColumns = React.useCallback((start, end) => setAxisHidden("col", false, start, end), [setAxisHidden]);
|
|
3518
3617
|
const setFreezeBoundary = React.useCallback((cell) => {
|
|
3519
|
-
if (
|
|
3618
|
+
if (!canChangeFreezePanes || !activeSheet) return;
|
|
3520
3619
|
const { row: row2, col } = cell;
|
|
3521
3620
|
if (!Number.isInteger(row2) || row2 < 0 || row2 >= XLSX_MAX_ROWS || !Number.isInteger(col) || col < 0 || col >= XLSX_MAX_COLUMNS) return;
|
|
3522
|
-
const
|
|
3621
|
+
const sheetIndex = activeSheet.workbookSheetIndex;
|
|
3622
|
+
if (readOnly) {
|
|
3623
|
+
const freezePanes2 = row2 || col ? { row: row2, col } : null;
|
|
3624
|
+
setReadOnlyLayouts((current) => ({ ...current, [sheetIndex]: { ...current[sheetIndex], freezePanes: freezePanes2 } }));
|
|
3625
|
+
return;
|
|
3626
|
+
}
|
|
3627
|
+
if (!workbook) return;
|
|
3628
|
+
const worksheet = workbook.getSheet(sheetIndex);
|
|
3523
3629
|
try {
|
|
3524
3630
|
const current = parseWorksheetFreezePanes(worksheet);
|
|
3525
3631
|
if (row2 === (current?.row ?? 0) && col === (current?.col ?? 0)) return;
|
|
@@ -3529,9 +3635,9 @@ function useXlsxViewerController(options2) {
|
|
|
3529
3635
|
} finally {
|
|
3530
3636
|
worksheet.free();
|
|
3531
3637
|
}
|
|
3532
|
-
}, [activeSheet, readOnly, recordHistoryBeforeMutation, refreshWorkbookState, workbook]);
|
|
3638
|
+
}, [activeSheet, canChangeFreezePanes, readOnly, recordHistoryBeforeMutation, refreshWorkbookState, workbook]);
|
|
3533
3639
|
const freezeCell = resolveFreezePanesCell(activeCell, selection);
|
|
3534
|
-
const canFreezePanes = Boolean(
|
|
3640
|
+
const canFreezePanes = Boolean(canChangeFreezePanes && freezeCell && (freezeCell.row > 0 || freezeCell.col > 0));
|
|
3535
3641
|
const freezePanes = React.useCallback((cell = freezeCell) => {
|
|
3536
3642
|
if (cell) setFreezeBoundary(cell);
|
|
3537
3643
|
}, [freezeCell, setFreezeBoundary]);
|
|
@@ -4822,6 +4928,8 @@ function useXlsxViewerController(options2) {
|
|
|
4822
4928
|
resizeChartBy,
|
|
4823
4929
|
resizeImageBy,
|
|
4824
4930
|
frozenPanes: activeSheet?.freezePanes ?? null,
|
|
4931
|
+
canChangeFreezePanes,
|
|
4932
|
+
canChangeVisibility,
|
|
4825
4933
|
canFreezePanes,
|
|
4826
4934
|
hideRows,
|
|
4827
4935
|
unhideRows,
|
|
@@ -4974,6 +5082,8 @@ function useXlsxViewerController(options2) {
|
|
|
4974
5082
|
revision,
|
|
4975
5083
|
resizeChartBy,
|
|
4976
5084
|
resizeImageBy,
|
|
5085
|
+
canChangeFreezePanes,
|
|
5086
|
+
canChangeVisibility,
|
|
4977
5087
|
canFreezePanes,
|
|
4978
5088
|
hideRows,
|
|
4979
5089
|
unhideRows,
|
|
@@ -10395,10 +10505,10 @@ function useXlsxViewerSelection() {
|
|
|
10395
10505
|
);
|
|
10396
10506
|
}
|
|
10397
10507
|
function useXlsxViewerLayout() {
|
|
10398
|
-
const { canFreezePanes, frozenPanes, hideRows, unhideRows, hideColumns, unhideColumns, freezePanes, unfreezePanes } = useXlsxViewer();
|
|
10508
|
+
const { canChangeFreezePanes, canChangeVisibility, canFreezePanes, frozenPanes, hideRows, unhideRows, hideColumns, unhideColumns, freezePanes, unfreezePanes } = useXlsxViewer();
|
|
10399
10509
|
return React15.useMemo(
|
|
10400
|
-
() => ({ canFreezePanes, frozenPanes, hideRows, unhideRows, hideColumns, unhideColumns, freezePanes, unfreezePanes }),
|
|
10401
|
-
[canFreezePanes, frozenPanes, hideRows, unhideRows, hideColumns, unhideColumns, freezePanes, unfreezePanes]
|
|
10510
|
+
() => ({ canChangeFreezePanes, canChangeVisibility, canFreezePanes, frozenPanes, hideRows, unhideRows, hideColumns, unhideColumns, freezePanes, unfreezePanes }),
|
|
10511
|
+
[canChangeFreezePanes, canChangeVisibility, canFreezePanes, frozenPanes, hideRows, unhideRows, hideColumns, unhideColumns, freezePanes, unfreezePanes]
|
|
10402
10512
|
);
|
|
10403
10513
|
}
|
|
10404
10514
|
function useXlsxViewerZoom() {
|
|
@@ -10966,7 +11076,7 @@ function useXlsxViewerThumbnails(options2 = {}) {
|
|
|
10966
11076
|
hiddenColSet
|
|
10967
11077
|
);
|
|
10968
11078
|
const resolveColumnWidthPx = (actualCol) => {
|
|
10969
|
-
if (worksheet && !
|
|
11079
|
+
if (worksheet && !hiddenColSet.has(actualCol)) {
|
|
10970
11080
|
const width = worksheet.getColumnWidth(actualCol);
|
|
10971
11081
|
if (width !== void 0 && width !== null) {
|
|
10972
11082
|
return Math.max(
|
|
@@ -10984,7 +11094,7 @@ function useXlsxViewerThumbnails(options2 = {}) {
|
|
|
10984
11094
|
);
|
|
10985
11095
|
};
|
|
10986
11096
|
const resolveRowHeightPx = (actualRow) => {
|
|
10987
|
-
if (worksheet && !
|
|
11097
|
+
if (worksheet && !hiddenRowSet.has(actualRow)) {
|
|
10988
11098
|
const height = worksheet.getRowHeight(actualRow);
|
|
10989
11099
|
if (height !== void 0 && height !== null) {
|
|
10990
11100
|
return Math.max(
|