@extend-ai/react-xlsx 0.23.2 → 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.
Files changed (80) hide show
  1. package/README.md +22 -2
  2. package/dist/{chunk-UICWNF5V.js → chunk-2TLD35UF.js} +3 -27
  3. package/dist/chunk-2TLD35UF.js.map +1 -0
  4. package/dist/{chunk-A3WA6ZLI.cjs → chunk-GP5SOQQH.cjs} +3 -29
  5. package/dist/chunk-GP5SOQQH.cjs.map +1 -0
  6. package/dist/{chunk-MEZOJBL5.js → chunk-HAV76TR2.js} +57 -1
  7. package/dist/{chunk-MEZOJBL5.js.map → chunk-HAV76TR2.js.map} +1 -1
  8. package/dist/{chunk-JJJZYWAL.js → chunk-MNIFKMIL.js} +57 -1
  9. package/dist/chunk-MNIFKMIL.js.map +1 -0
  10. package/dist/{chunk-3JFYU42O.js → chunk-Q6YY3AB4.js} +2 -28
  11. package/dist/chunk-Q6YY3AB4.js.map +1 -0
  12. package/dist/{chunk-FGJY2TIS.cjs → chunk-WW6G674Q.cjs} +2672 -2340
  13. package/dist/chunk-WW6G674Q.cjs.map +1 -0
  14. package/dist/{chunk-M7QVMFYT.js → chunk-XUHSQ3GF.js} +819 -487
  15. package/dist/chunk-XUHSQ3GF.js.map +1 -0
  16. package/dist/{chunk-JCSAS3M2.cjs → chunk-XZJLPW64.cjs} +2 -26
  17. package/dist/chunk-XZJLPW64.cjs.map +1 -0
  18. package/dist/{chunk-TMYAG7GY.cjs → chunk-YOLIVKZD.cjs} +57 -1
  19. package/dist/chunk-YOLIVKZD.cjs.map +1 -0
  20. package/dist/{chunk-R3FQM7V3.cjs → chunk-Z4WMURVU.cjs} +57 -1
  21. package/dist/chunk-Z4WMURVU.cjs.map +1 -0
  22. package/dist/duke-sheets-provenance.json +5 -5
  23. package/dist/{duke_sheets_wasm-TLSZAVKP.cjs → duke_sheets_wasm-GM4K5QQX.cjs} +57 -1
  24. package/dist/duke_sheets_wasm-GM4K5QQX.cjs.map +1 -0
  25. package/dist/{duke_sheets_wasm-V4J6QYIZ.js → duke_sheets_wasm-MYY4ZNUI.js} +57 -1
  26. package/dist/duke_sheets_wasm-MYY4ZNUI.js.map +1 -0
  27. package/dist/{duke_sheets_wasm-R7KXJNYL.js → duke_sheets_wasm-UXZ2KTVD.js} +57 -1
  28. package/dist/duke_sheets_wasm-UXZ2KTVD.js.map +1 -0
  29. package/dist/duke_sheets_wasm_bg.wasm +0 -0
  30. package/dist/index.cjs +805 -606
  31. package/dist/index.cjs.map +1 -1
  32. package/dist/index.d.cts +53 -7
  33. package/dist/index.d.ts +53 -7
  34. package/dist/index.js +784 -585
  35. package/dist/index.js.map +1 -1
  36. package/dist/{internal-BVZRgYaH.d.ts → internal-D5HReXVR.d.cts} +114 -64
  37. package/dist/{internal-BVZRgYaH.d.cts → internal-D5HReXVR.d.ts} +114 -64
  38. package/dist/internal.cjs +4 -4
  39. package/dist/internal.d.cts +1 -1
  40. package/dist/internal.d.ts +1 -1
  41. package/dist/internal.js +3 -3
  42. package/dist/{shared-chart-V24MOVXX.js → shared-chart-24MCGSFJ.js} +2 -2
  43. package/dist/{shared-chart-N44DT2QV.cjs → shared-chart-7E6KMGTG.cjs} +3 -3
  44. package/dist/{shared-chart-N44DT2QV.cjs.map → shared-chart-7E6KMGTG.cjs.map} +1 -1
  45. package/dist/{shared-chart-64L5EL3Z.js → shared-chart-CGEK7EAB.js} +2 -2
  46. package/dist/{shared-chart-BZTEPO7C.cjs → shared-chart-GKNMM72Q.cjs} +15 -15
  47. package/dist/{shared-chart-BZTEPO7C.cjs.map → shared-chart-GKNMM72Q.cjs.map} +1 -1
  48. package/dist/vanilla.cjs +4 -4
  49. package/dist/vanilla.d.cts +2 -2
  50. package/dist/vanilla.d.ts +2 -2
  51. package/dist/vanilla.js +3 -3
  52. package/dist/{workbook-runtime-OJDBGHMM.cjs → workbook-runtime-7WEPIK5Y.cjs} +85 -77
  53. package/dist/workbook-runtime-7WEPIK5Y.cjs.map +1 -0
  54. package/dist/{workbook-runtime-O3QY5UED.js → workbook-runtime-BAAYDYYK.js} +24 -16
  55. package/dist/workbook-runtime-BAAYDYYK.js.map +1 -0
  56. package/dist/{workbook-runtime-FXUSOOFT.js → workbook-runtime-FCKPXLTW.js} +24 -16
  57. package/dist/workbook-runtime-FCKPXLTW.js.map +1 -0
  58. package/dist/{workbook-runtime-2HYFRGZD.cjs → workbook-runtime-MOGSEJ5R.cjs} +83 -75
  59. package/dist/workbook-runtime-MOGSEJ5R.cjs.map +1 -0
  60. package/dist/xlsx-worker.js +23 -15
  61. package/dist/xlsx-worker.js.map +1 -1
  62. package/package.json +2 -2
  63. package/dist/chunk-3JFYU42O.js.map +0 -1
  64. package/dist/chunk-A3WA6ZLI.cjs.map +0 -1
  65. package/dist/chunk-FGJY2TIS.cjs.map +0 -1
  66. package/dist/chunk-JCSAS3M2.cjs.map +0 -1
  67. package/dist/chunk-JJJZYWAL.js.map +0 -1
  68. package/dist/chunk-M7QVMFYT.js.map +0 -1
  69. package/dist/chunk-R3FQM7V3.cjs.map +0 -1
  70. package/dist/chunk-TMYAG7GY.cjs.map +0 -1
  71. package/dist/chunk-UICWNF5V.js.map +0 -1
  72. package/dist/duke_sheets_wasm-R7KXJNYL.js.map +0 -1
  73. package/dist/duke_sheets_wasm-TLSZAVKP.cjs.map +0 -1
  74. package/dist/duke_sheets_wasm-V4J6QYIZ.js.map +0 -1
  75. package/dist/workbook-runtime-2HYFRGZD.cjs.map +0 -1
  76. package/dist/workbook-runtime-FXUSOOFT.js.map +0 -1
  77. package/dist/workbook-runtime-O3QY5UED.js.map +0 -1
  78. package/dist/workbook-runtime-OJDBGHMM.cjs.map +0 -1
  79. /package/dist/{shared-chart-V24MOVXX.js.map → shared-chart-24MCGSFJ.js.map} +0 -0
  80. /package/dist/{shared-chart-64L5EL3Z.js.map → shared-chart-CGEK7EAB.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -65,6 +65,13 @@ declare const englishMessages: {
65
65
  mergeAcross: string;
66
66
  mergeCells: string;
67
67
  unmergeCells: string;
68
+ rowHeight: string;
69
+ columnWidth: string;
70
+ pixels: string;
71
+ cancel: string;
72
+ ok: string;
73
+ hide: string;
74
+ unhide: string;
68
75
  selectRow: string;
69
76
  selectColumn: string;
70
77
  selectAll: string;
@@ -949,11 +956,14 @@ declare class Worksheet {
949
956
  setCellStyle(address: string, style: any): void;
950
957
  setCellStyleAt(row: number, col: number, style: any): void;
951
958
  setColumnWidth(col: number, width: number): void;
959
+ setColumnsHidden(start: number, end: number, hidden: boolean): void;
952
960
  setFormula(address: string, formula: string): void;
961
+ setFreezePanes(row: number, col: number): void;
953
962
  setProtectedRanges(ranges: any): void;
954
963
  setProtection(protection: any): void;
955
964
  setRangeStyle(range_str: string, style: any): void;
956
965
  setRowHeight(row: number, height: number): void;
966
+ setRowsHidden(start: number, end: number, hidden: boolean): void;
957
967
  unmergeCells(range_str: string): boolean;
958
968
  usedRange(): any;
959
969
  readonly autoFilter: any;
@@ -975,6 +985,8 @@ declare class Worksheet {
975
985
  */
976
986
  readonly formulaCount: number;
977
987
  readonly freezePanes: any;
988
+ readonly hiddenColumns: Uint32Array;
989
+ readonly hiddenRows: Uint32Array;
978
990
  readonly hyperlinkCount: number;
979
991
  readonly hyperlinks: any;
980
992
  readonly isEmpty: boolean;
@@ -2290,6 +2302,10 @@ interface UseXlsxViewerControllerOptions {
2290
2302
  * @default false
2291
2303
  */
2292
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;
2293
2309
  /**
2294
2310
  * Defers loading until `continueDeferredLoad()` is called when the file is larger than this byte threshold.
2295
2311
  * Set to `0` to parse immediately.
@@ -2368,7 +2384,29 @@ interface UseXlsxViewerControllerOptions {
2368
2384
  */
2369
2385
  useWorker?: boolean;
2370
2386
  }
2371
- interface XlsxViewerController extends XlsxViewerPivots {
2387
+ interface XlsxViewerLayout {
2388
+ /** Frozen row and column counts on the active worksheet, or null when unfrozen. */
2389
+ frozenPanes: XlsxFreezePanes | null;
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. */
2395
+ canFreezePanes: boolean;
2396
+ /** Hide selected rows, or an inclusive, zero-based row interval. */
2397
+ hideRows: (start?: number, end?: number) => void;
2398
+ /** Reveal hidden rows in the selection or an inclusive, zero-based row interval. */
2399
+ unhideRows: (start?: number, end?: number) => void;
2400
+ /** Hide selected columns, or an inclusive, zero-based column interval. */
2401
+ hideColumns: (start?: number, end?: number) => void;
2402
+ /** Reveal hidden columns in the selection or an inclusive, zero-based column interval. */
2403
+ unhideColumns: (start?: number, end?: number) => void;
2404
+ /** Freeze rows above and columns left of the given cell, defaulting to the selected header or active cell. */
2405
+ freezePanes: (cell?: XlsxCellAddress) => void;
2406
+ /** Remove the freeze boundary on the active worksheet. */
2407
+ unfreezePanes: () => void;
2408
+ }
2409
+ interface XlsxViewerController extends XlsxViewerPivots, XlsxViewerLayout {
2372
2410
  activeCell: XlsxCellAddress | null;
2373
2411
  activeCellAddress: string | null;
2374
2412
  activeSheet: XlsxSheetData | null;
@@ -2453,8 +2491,8 @@ interface XlsxViewerController extends XlsxViewerPivots {
2453
2491
  resetZoom: () => void;
2454
2492
  resizeChartBy: (id: string, handle: XlsxImageResizeHandlePosition, deltaX: number, deltaY: number) => void;
2455
2493
  resizeImageBy: (id: string, handle: XlsxImageResizeHandlePosition, deltaX: number, deltaY: number) => void;
2456
- resizeColumn: (col: number, widthPx: number) => void;
2457
- resizeRow: (row: number, heightPx: number) => void;
2494
+ resizeColumn: (col: number | readonly number[], widthPx: number) => void;
2495
+ resizeRow: (row: number | readonly number[], heightPx: number) => void;
2458
2496
  redo: () => void;
2459
2497
  /** Reads browser clipboard representations. Pass paste-event data to retain image and text fallbacks. */
2460
2498
  pasteFromClipboard: (clipboardData?: DataTransfer) => Promise<boolean>;
@@ -2509,7 +2547,7 @@ interface XlsxViewerController extends XlsxViewerPivots {
2509
2547
  * @param range Zero-based cell range in the active worksheet.
2510
2548
  * @param style Partial Excel style patch to apply to the target range.
2511
2549
  */
2512
- setRangeStyle: (range: XlsxCellRange, style: XlsxCellStyleInput) => void;
2550
+ setRangeStyle: (range: XlsxCellRange | readonly XlsxCellRange[], style: XlsxCellStyleInput) => void;
2513
2551
  setZoomScale: (zoomScale: number) => void;
2514
2552
  selectCell: (cell: XlsxCellAddress, options?: {
2515
2553
  extend?: boolean;
@@ -2517,6 +2555,9 @@ interface XlsxViewerController extends XlsxViewerPivots {
2517
2555
  selectChart: (id: string | null) => void;
2518
2556
  selectChartElement: (selection: XlsxChartElementSelection | null) => void;
2519
2557
  selectRange: (range: XlsxCellRange) => void;
2558
+ selectRanges: (ranges: readonly XlsxCellRange[], activeCorner?: "start" | "end") => void;
2559
+ /** Selected areas in selection order. The last area is the active selection. */
2560
+ selectionRanges: readonly XlsxCellRange[];
2520
2561
  selection: XlsxCellRange | null;
2521
2562
  setActiveSheetIndex: (index: number) => void;
2522
2563
  setActiveTabIndex: (index: number) => void;
@@ -2581,6 +2622,9 @@ interface XlsxViewerSelection {
2581
2622
  extend?: boolean;
2582
2623
  }) => void;
2583
2624
  selectRange: (range: XlsxCellRange) => void;
2625
+ selectRanges: (ranges: readonly XlsxCellRange[], activeCorner?: "start" | "end") => void;
2626
+ /** Selected areas in selection order. The last area is the active selection. */
2627
+ selectionRanges: readonly XlsxCellRange[];
2584
2628
  selection: XlsxCellRange | null;
2585
2629
  }
2586
2630
  interface XlsxViewerZoom {
@@ -2595,7 +2639,7 @@ interface XlsxViewerZoom {
2595
2639
  zoomOut: () => void;
2596
2640
  zoomScale: number;
2597
2641
  }
2598
- type XlsxContextMenuActionId = "bringToFront" | "bringForward" | "sendBackward" | "sendToBack" | "arrange" | "changeChartType" | `chartType:${string}` | `chartFamily:${string}` | "cut" | "copy" | "paste" | "clearContents" | "editCell" | "undo" | "redo" | "mergeCells" | "mergeAndCenter" | "mergeAcross" | "unmergeCells" | "sortAscending" | "sortDescending" | "refreshPivotTable" | "showPivotDetails" | "togglePivotFieldList" | "selectRow" | "selectColumn" | "selectAll";
2642
+ type XlsxContextMenuActionId = "bringToFront" | "bringForward" | "sendBackward" | "sendToBack" | "arrange" | "changeChartType" | `chartType:${string}` | `chartFamily:${string}` | "cut" | "copy" | "paste" | "clearContents" | "editCell" | "undo" | "redo" | "mergeCells" | "mergeAndCenter" | "mergeAcross" | "unmergeCells" | "sortAscending" | "sortDescending" | "refreshPivotTable" | "showPivotDetails" | "togglePivotFieldList" | "rowHeight" | "columnWidth" | "hideRows" | "unhideRows" | "hideColumns" | "unhideColumns" | "selectRow" | "selectColumn" | "selectAll";
2599
2643
  interface XlsxContextMenuAction {
2600
2644
  id: XlsxContextMenuActionId;
2601
2645
  label: string;
@@ -2613,6 +2657,7 @@ interface XlsxContextMenuContext {
2613
2657
  chart?: XlsxChart;
2614
2658
  cell: XlsxCellAddress;
2615
2659
  selection: XlsxCellRange;
2660
+ selectionRanges?: readonly XlsxCellRange[];
2616
2661
  sheetIndex: number;
2617
2662
  sheetName: string;
2618
2663
  readOnly: boolean;
@@ -2700,7 +2745,7 @@ interface XlsxViewerEditing {
2700
2745
  * @param range Zero-based cell range in the active worksheet.
2701
2746
  * @param style Partial Excel style patch to apply to the target range.
2702
2747
  */
2703
- setRangeStyle: (range: XlsxCellRange, style: XlsxCellStyleInput) => void;
2748
+ setRangeStyle: (range: XlsxCellRange | readonly XlsxCellRange[], style: XlsxCellStyleInput) => void;
2704
2749
  setSelectedFormula: (formula: string) => boolean;
2705
2750
  setSelectedCellFormula: (formula: string) => void;
2706
2751
  /**
@@ -3190,6 +3235,7 @@ declare function XlsxViewer(props: XlsxViewerProps): react_jsx_runtime.JSX.Eleme
3190
3235
  declare function XlsxViewerProvider({ children, controller, isDark, ...options }: XlsxViewerProviderProps): react_jsx_runtime.JSX.Element;
3191
3236
  declare function useXlsxViewer(): XlsxViewerController;
3192
3237
  declare function useXlsxViewerSelection(): XlsxViewerSelection;
3238
+ declare function useXlsxViewerLayout(): XlsxViewerLayout;
3193
3239
  declare function useXlsxViewerZoom(): XlsxViewerZoom;
3194
3240
  declare function useXlsxViewerEditing(): XlsxViewerEditing;
3195
3241
  declare function useXlsxViewerTables(): XlsxViewerTables;
@@ -3224,4 +3270,4 @@ interface DefaultXlsxPivotTableFieldListProps {
3224
3270
  }
3225
3271
  declare function DefaultXlsxPivotTableFieldList({ editor, isDark, className, style }: DefaultXlsxPivotTableFieldListProps): react_jsx_runtime.JSX.Element;
3226
3272
 
3227
- export { DefaultXlsxPivotTableFieldList, type DefaultXlsxPivotTableFieldListProps, DefaultXlsxToolbar, type UseXlsxViewerControllerOptions, type UseXlsxViewerThumbnailsOptions, type XlsxActiveCellOverlayRenderProps, type XlsxCellAddress, type XlsxCellAlignmentInput, type XlsxCellBorderEdgeInput, type XlsxCellBorderStyleInput, type XlsxCellEditorContext, type XlsxCellEditorOverlayRenderProps, type XlsxCellEditorSession, type XlsxCellFillStyleInput, type XlsxCellFontStyleInput, type XlsxCellGradientStopInput, type XlsxCellNumberFormatInput, type XlsxCellProtectionInput, type XlsxCellRange, type XlsxCellStyleColorInput, type XlsxCellStyleContext, type XlsxCellStyleInput, type XlsxChart, type XlsxChartAxis, type XlsxChartDataLabels, type XlsxChartElementSelection, type XlsxChartLoadingRenderProps, type XlsxChartReference, type XlsxChartSeries, type XlsxChartsheet, type XlsxContextMenuAction, type XlsxContextMenuActionId, type XlsxContextMenuContext, type XlsxContextMenuRenderProps, type XlsxDrawingLayout, type XlsxDrawingOrder, type XlsxFileTooLargeRenderProps, type XlsxFormControl, type XlsxFormControlActionEvent, type XlsxFormControlCaption, type XlsxFormControlCaptionInput, type XlsxFormControlCaptionRun, type XlsxFormControlChangeEvent, type XlsxFormControlInput, type XlsxFormControlKind, type XlsxFormControlKindInput, type XlsxFormControlPatch, type XlsxFormControlRenderProps, type XlsxFormControlSelectionMode, type XlsxFormControlState, type XlsxFormulaTarget, type XlsxHighlightRangeOptions, type XlsxImage, type XlsxImageAnchor, type XlsxImageRect, type XlsxImageRenderProps, type XlsxImageResizeHandlePosition, type XlsxImageSelectionRenderProps, type XlsxMergeMode, type XlsxParsedRange, type XlsxPivotAggregation, type XlsxPivotAxisField, type XlsxPivotCalculatedItem, type XlsxPivotChart, type XlsxPivotChartInput, type XlsxPivotChartType, type XlsxPivotDrillDown, type XlsxPivotFieldArea, type XlsxPivotFilter, type XlsxPivotGrouping, type XlsxPivotHeader, type XlsxPivotHeaderField, type XlsxPivotMember, type XlsxPivotShowAs, type XlsxPivotSource, type XlsxPivotSourceField, type XlsxPivotTable, type XlsxPivotTableControlsRenderProps, type XlsxPivotTableEditor, type XlsxPivotTableEditorOptions, type XlsxPivotTableHeaderMenuRenderProps, type XlsxPivotTableInput, type XlsxPivotTarget, type XlsxPivotToggle, type XlsxPivotValueField, type XlsxRangeHighlight, type XlsxScrollerRenderProps, type XlsxSelectionPopoverContext, type XlsxSelectionPopoverRenderProps, type XlsxShape, type XlsxShapeFill, type XlsxShapeParagraph, type XlsxShapeStroke, type XlsxShapeTextBox, type XlsxShapeTextRun, type XlsxSheetData, type XlsxSheetThumbnail, type XlsxSheetThumbnailResolution, type XlsxSheetVisibility, type XlsxTable, type XlsxTableColumn, type XlsxTableHeaderMenuRenderProps, type XlsxTableSortDirection, type XlsxTableSortState, type XlsxThemePalette, XlsxViewer, type XlsxViewerCharts, type XlsxViewerController, type XlsxViewerEditing, type XlsxViewerImages, type XlsxViewerMessages, type XlsxViewerPivots, type XlsxViewerProps, XlsxViewerProvider, type XlsxViewerProviderProps, type XlsxViewerSelection, type XlsxViewerTables, type XlsxViewerThumbnails, type XlsxViewerZoom, type XlsxWorkbookTab, useXlsxPivotTableEditor, useXlsxViewer, useXlsxViewerCharts, useXlsxViewerController, useXlsxViewerEditing, useXlsxViewerImages, useXlsxViewerPivots, useXlsxViewerSelection, useXlsxViewerTables, useXlsxViewerThumbnails, useXlsxViewerZoom };
3273
+ export { DefaultXlsxPivotTableFieldList, type DefaultXlsxPivotTableFieldListProps, DefaultXlsxToolbar, type UseXlsxViewerControllerOptions, type UseXlsxViewerThumbnailsOptions, type XlsxActiveCellOverlayRenderProps, type XlsxCellAddress, type XlsxCellAlignmentInput, type XlsxCellBorderEdgeInput, type XlsxCellBorderStyleInput, type XlsxCellEditorContext, type XlsxCellEditorOverlayRenderProps, type XlsxCellEditorSession, type XlsxCellFillStyleInput, type XlsxCellFontStyleInput, type XlsxCellGradientStopInput, type XlsxCellNumberFormatInput, type XlsxCellProtectionInput, type XlsxCellRange, type XlsxCellStyleColorInput, type XlsxCellStyleContext, type XlsxCellStyleInput, type XlsxChart, type XlsxChartAxis, type XlsxChartDataLabels, type XlsxChartElementSelection, type XlsxChartLoadingRenderProps, type XlsxChartReference, type XlsxChartSeries, type XlsxChartsheet, type XlsxContextMenuAction, type XlsxContextMenuActionId, type XlsxContextMenuContext, type XlsxContextMenuRenderProps, type XlsxDrawingLayout, type XlsxDrawingOrder, type XlsxFileTooLargeRenderProps, type XlsxFormControl, type XlsxFormControlActionEvent, type XlsxFormControlCaption, type XlsxFormControlCaptionInput, type XlsxFormControlCaptionRun, type XlsxFormControlChangeEvent, type XlsxFormControlInput, type XlsxFormControlKind, type XlsxFormControlKindInput, type XlsxFormControlPatch, type XlsxFormControlRenderProps, type XlsxFormControlSelectionMode, type XlsxFormControlState, type XlsxFormulaTarget, type XlsxFreezePanes, type XlsxHighlightRangeOptions, type XlsxImage, type XlsxImageAnchor, type XlsxImageRect, type XlsxImageRenderProps, type XlsxImageResizeHandlePosition, type XlsxImageSelectionRenderProps, type XlsxMergeMode, type XlsxParsedRange, type XlsxPivotAggregation, type XlsxPivotAxisField, type XlsxPivotCalculatedItem, type XlsxPivotChart, type XlsxPivotChartInput, type XlsxPivotChartType, type XlsxPivotDrillDown, type XlsxPivotFieldArea, type XlsxPivotFilter, type XlsxPivotGrouping, type XlsxPivotHeader, type XlsxPivotHeaderField, type XlsxPivotMember, type XlsxPivotShowAs, type XlsxPivotSource, type XlsxPivotSourceField, type XlsxPivotTable, type XlsxPivotTableControlsRenderProps, type XlsxPivotTableEditor, type XlsxPivotTableEditorOptions, type XlsxPivotTableHeaderMenuRenderProps, type XlsxPivotTableInput, type XlsxPivotTarget, type XlsxPivotToggle, type XlsxPivotValueField, type XlsxRangeHighlight, type XlsxScrollerRenderProps, type XlsxSelectionPopoverContext, type XlsxSelectionPopoverRenderProps, type XlsxShape, type XlsxShapeFill, type XlsxShapeParagraph, type XlsxShapeStroke, type XlsxShapeTextBox, type XlsxShapeTextRun, type XlsxSheetData, type XlsxSheetThumbnail, type XlsxSheetThumbnailResolution, type XlsxSheetVisibility, type XlsxTable, type XlsxTableColumn, type XlsxTableHeaderMenuRenderProps, type XlsxTableSortDirection, type XlsxTableSortState, type XlsxThemePalette, XlsxViewer, type XlsxViewerCharts, type XlsxViewerController, type XlsxViewerEditing, type XlsxViewerImages, type XlsxViewerLayout, type XlsxViewerMessages, type XlsxViewerPivots, type XlsxViewerProps, XlsxViewerProvider, type XlsxViewerProviderProps, type XlsxViewerSelection, type XlsxViewerTables, type XlsxViewerThumbnails, type XlsxViewerZoom, type XlsxWorkbookTab, useXlsxPivotTableEditor, useXlsxViewer, useXlsxViewerCharts, useXlsxViewerController, useXlsxViewerEditing, useXlsxViewerImages, useXlsxViewerLayout, useXlsxViewerPivots, useXlsxViewerSelection, useXlsxViewerTables, useXlsxViewerThumbnails, useXlsxViewerZoom };
package/dist/index.d.ts CHANGED
@@ -65,6 +65,13 @@ declare const englishMessages: {
65
65
  mergeAcross: string;
66
66
  mergeCells: string;
67
67
  unmergeCells: string;
68
+ rowHeight: string;
69
+ columnWidth: string;
70
+ pixels: string;
71
+ cancel: string;
72
+ ok: string;
73
+ hide: string;
74
+ unhide: string;
68
75
  selectRow: string;
69
76
  selectColumn: string;
70
77
  selectAll: string;
@@ -949,11 +956,14 @@ declare class Worksheet {
949
956
  setCellStyle(address: string, style: any): void;
950
957
  setCellStyleAt(row: number, col: number, style: any): void;
951
958
  setColumnWidth(col: number, width: number): void;
959
+ setColumnsHidden(start: number, end: number, hidden: boolean): void;
952
960
  setFormula(address: string, formula: string): void;
961
+ setFreezePanes(row: number, col: number): void;
953
962
  setProtectedRanges(ranges: any): void;
954
963
  setProtection(protection: any): void;
955
964
  setRangeStyle(range_str: string, style: any): void;
956
965
  setRowHeight(row: number, height: number): void;
966
+ setRowsHidden(start: number, end: number, hidden: boolean): void;
957
967
  unmergeCells(range_str: string): boolean;
958
968
  usedRange(): any;
959
969
  readonly autoFilter: any;
@@ -975,6 +985,8 @@ declare class Worksheet {
975
985
  */
976
986
  readonly formulaCount: number;
977
987
  readonly freezePanes: any;
988
+ readonly hiddenColumns: Uint32Array;
989
+ readonly hiddenRows: Uint32Array;
978
990
  readonly hyperlinkCount: number;
979
991
  readonly hyperlinks: any;
980
992
  readonly isEmpty: boolean;
@@ -2290,6 +2302,10 @@ interface UseXlsxViewerControllerOptions {
2290
2302
  * @default false
2291
2303
  */
2292
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;
2293
2309
  /**
2294
2310
  * Defers loading until `continueDeferredLoad()` is called when the file is larger than this byte threshold.
2295
2311
  * Set to `0` to parse immediately.
@@ -2368,7 +2384,29 @@ interface UseXlsxViewerControllerOptions {
2368
2384
  */
2369
2385
  useWorker?: boolean;
2370
2386
  }
2371
- interface XlsxViewerController extends XlsxViewerPivots {
2387
+ interface XlsxViewerLayout {
2388
+ /** Frozen row and column counts on the active worksheet, or null when unfrozen. */
2389
+ frozenPanes: XlsxFreezePanes | null;
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. */
2395
+ canFreezePanes: boolean;
2396
+ /** Hide selected rows, or an inclusive, zero-based row interval. */
2397
+ hideRows: (start?: number, end?: number) => void;
2398
+ /** Reveal hidden rows in the selection or an inclusive, zero-based row interval. */
2399
+ unhideRows: (start?: number, end?: number) => void;
2400
+ /** Hide selected columns, or an inclusive, zero-based column interval. */
2401
+ hideColumns: (start?: number, end?: number) => void;
2402
+ /** Reveal hidden columns in the selection or an inclusive, zero-based column interval. */
2403
+ unhideColumns: (start?: number, end?: number) => void;
2404
+ /** Freeze rows above and columns left of the given cell, defaulting to the selected header or active cell. */
2405
+ freezePanes: (cell?: XlsxCellAddress) => void;
2406
+ /** Remove the freeze boundary on the active worksheet. */
2407
+ unfreezePanes: () => void;
2408
+ }
2409
+ interface XlsxViewerController extends XlsxViewerPivots, XlsxViewerLayout {
2372
2410
  activeCell: XlsxCellAddress | null;
2373
2411
  activeCellAddress: string | null;
2374
2412
  activeSheet: XlsxSheetData | null;
@@ -2453,8 +2491,8 @@ interface XlsxViewerController extends XlsxViewerPivots {
2453
2491
  resetZoom: () => void;
2454
2492
  resizeChartBy: (id: string, handle: XlsxImageResizeHandlePosition, deltaX: number, deltaY: number) => void;
2455
2493
  resizeImageBy: (id: string, handle: XlsxImageResizeHandlePosition, deltaX: number, deltaY: number) => void;
2456
- resizeColumn: (col: number, widthPx: number) => void;
2457
- resizeRow: (row: number, heightPx: number) => void;
2494
+ resizeColumn: (col: number | readonly number[], widthPx: number) => void;
2495
+ resizeRow: (row: number | readonly number[], heightPx: number) => void;
2458
2496
  redo: () => void;
2459
2497
  /** Reads browser clipboard representations. Pass paste-event data to retain image and text fallbacks. */
2460
2498
  pasteFromClipboard: (clipboardData?: DataTransfer) => Promise<boolean>;
@@ -2509,7 +2547,7 @@ interface XlsxViewerController extends XlsxViewerPivots {
2509
2547
  * @param range Zero-based cell range in the active worksheet.
2510
2548
  * @param style Partial Excel style patch to apply to the target range.
2511
2549
  */
2512
- setRangeStyle: (range: XlsxCellRange, style: XlsxCellStyleInput) => void;
2550
+ setRangeStyle: (range: XlsxCellRange | readonly XlsxCellRange[], style: XlsxCellStyleInput) => void;
2513
2551
  setZoomScale: (zoomScale: number) => void;
2514
2552
  selectCell: (cell: XlsxCellAddress, options?: {
2515
2553
  extend?: boolean;
@@ -2517,6 +2555,9 @@ interface XlsxViewerController extends XlsxViewerPivots {
2517
2555
  selectChart: (id: string | null) => void;
2518
2556
  selectChartElement: (selection: XlsxChartElementSelection | null) => void;
2519
2557
  selectRange: (range: XlsxCellRange) => void;
2558
+ selectRanges: (ranges: readonly XlsxCellRange[], activeCorner?: "start" | "end") => void;
2559
+ /** Selected areas in selection order. The last area is the active selection. */
2560
+ selectionRanges: readonly XlsxCellRange[];
2520
2561
  selection: XlsxCellRange | null;
2521
2562
  setActiveSheetIndex: (index: number) => void;
2522
2563
  setActiveTabIndex: (index: number) => void;
@@ -2581,6 +2622,9 @@ interface XlsxViewerSelection {
2581
2622
  extend?: boolean;
2582
2623
  }) => void;
2583
2624
  selectRange: (range: XlsxCellRange) => void;
2625
+ selectRanges: (ranges: readonly XlsxCellRange[], activeCorner?: "start" | "end") => void;
2626
+ /** Selected areas in selection order. The last area is the active selection. */
2627
+ selectionRanges: readonly XlsxCellRange[];
2584
2628
  selection: XlsxCellRange | null;
2585
2629
  }
2586
2630
  interface XlsxViewerZoom {
@@ -2595,7 +2639,7 @@ interface XlsxViewerZoom {
2595
2639
  zoomOut: () => void;
2596
2640
  zoomScale: number;
2597
2641
  }
2598
- type XlsxContextMenuActionId = "bringToFront" | "bringForward" | "sendBackward" | "sendToBack" | "arrange" | "changeChartType" | `chartType:${string}` | `chartFamily:${string}` | "cut" | "copy" | "paste" | "clearContents" | "editCell" | "undo" | "redo" | "mergeCells" | "mergeAndCenter" | "mergeAcross" | "unmergeCells" | "sortAscending" | "sortDescending" | "refreshPivotTable" | "showPivotDetails" | "togglePivotFieldList" | "selectRow" | "selectColumn" | "selectAll";
2642
+ type XlsxContextMenuActionId = "bringToFront" | "bringForward" | "sendBackward" | "sendToBack" | "arrange" | "changeChartType" | `chartType:${string}` | `chartFamily:${string}` | "cut" | "copy" | "paste" | "clearContents" | "editCell" | "undo" | "redo" | "mergeCells" | "mergeAndCenter" | "mergeAcross" | "unmergeCells" | "sortAscending" | "sortDescending" | "refreshPivotTable" | "showPivotDetails" | "togglePivotFieldList" | "rowHeight" | "columnWidth" | "hideRows" | "unhideRows" | "hideColumns" | "unhideColumns" | "selectRow" | "selectColumn" | "selectAll";
2599
2643
  interface XlsxContextMenuAction {
2600
2644
  id: XlsxContextMenuActionId;
2601
2645
  label: string;
@@ -2613,6 +2657,7 @@ interface XlsxContextMenuContext {
2613
2657
  chart?: XlsxChart;
2614
2658
  cell: XlsxCellAddress;
2615
2659
  selection: XlsxCellRange;
2660
+ selectionRanges?: readonly XlsxCellRange[];
2616
2661
  sheetIndex: number;
2617
2662
  sheetName: string;
2618
2663
  readOnly: boolean;
@@ -2700,7 +2745,7 @@ interface XlsxViewerEditing {
2700
2745
  * @param range Zero-based cell range in the active worksheet.
2701
2746
  * @param style Partial Excel style patch to apply to the target range.
2702
2747
  */
2703
- setRangeStyle: (range: XlsxCellRange, style: XlsxCellStyleInput) => void;
2748
+ setRangeStyle: (range: XlsxCellRange | readonly XlsxCellRange[], style: XlsxCellStyleInput) => void;
2704
2749
  setSelectedFormula: (formula: string) => boolean;
2705
2750
  setSelectedCellFormula: (formula: string) => void;
2706
2751
  /**
@@ -3190,6 +3235,7 @@ declare function XlsxViewer(props: XlsxViewerProps): react_jsx_runtime.JSX.Eleme
3190
3235
  declare function XlsxViewerProvider({ children, controller, isDark, ...options }: XlsxViewerProviderProps): react_jsx_runtime.JSX.Element;
3191
3236
  declare function useXlsxViewer(): XlsxViewerController;
3192
3237
  declare function useXlsxViewerSelection(): XlsxViewerSelection;
3238
+ declare function useXlsxViewerLayout(): XlsxViewerLayout;
3193
3239
  declare function useXlsxViewerZoom(): XlsxViewerZoom;
3194
3240
  declare function useXlsxViewerEditing(): XlsxViewerEditing;
3195
3241
  declare function useXlsxViewerTables(): XlsxViewerTables;
@@ -3224,4 +3270,4 @@ interface DefaultXlsxPivotTableFieldListProps {
3224
3270
  }
3225
3271
  declare function DefaultXlsxPivotTableFieldList({ editor, isDark, className, style }: DefaultXlsxPivotTableFieldListProps): react_jsx_runtime.JSX.Element;
3226
3272
 
3227
- export { DefaultXlsxPivotTableFieldList, type DefaultXlsxPivotTableFieldListProps, DefaultXlsxToolbar, type UseXlsxViewerControllerOptions, type UseXlsxViewerThumbnailsOptions, type XlsxActiveCellOverlayRenderProps, type XlsxCellAddress, type XlsxCellAlignmentInput, type XlsxCellBorderEdgeInput, type XlsxCellBorderStyleInput, type XlsxCellEditorContext, type XlsxCellEditorOverlayRenderProps, type XlsxCellEditorSession, type XlsxCellFillStyleInput, type XlsxCellFontStyleInput, type XlsxCellGradientStopInput, type XlsxCellNumberFormatInput, type XlsxCellProtectionInput, type XlsxCellRange, type XlsxCellStyleColorInput, type XlsxCellStyleContext, type XlsxCellStyleInput, type XlsxChart, type XlsxChartAxis, type XlsxChartDataLabels, type XlsxChartElementSelection, type XlsxChartLoadingRenderProps, type XlsxChartReference, type XlsxChartSeries, type XlsxChartsheet, type XlsxContextMenuAction, type XlsxContextMenuActionId, type XlsxContextMenuContext, type XlsxContextMenuRenderProps, type XlsxDrawingLayout, type XlsxDrawingOrder, type XlsxFileTooLargeRenderProps, type XlsxFormControl, type XlsxFormControlActionEvent, type XlsxFormControlCaption, type XlsxFormControlCaptionInput, type XlsxFormControlCaptionRun, type XlsxFormControlChangeEvent, type XlsxFormControlInput, type XlsxFormControlKind, type XlsxFormControlKindInput, type XlsxFormControlPatch, type XlsxFormControlRenderProps, type XlsxFormControlSelectionMode, type XlsxFormControlState, type XlsxFormulaTarget, type XlsxHighlightRangeOptions, type XlsxImage, type XlsxImageAnchor, type XlsxImageRect, type XlsxImageRenderProps, type XlsxImageResizeHandlePosition, type XlsxImageSelectionRenderProps, type XlsxMergeMode, type XlsxParsedRange, type XlsxPivotAggregation, type XlsxPivotAxisField, type XlsxPivotCalculatedItem, type XlsxPivotChart, type XlsxPivotChartInput, type XlsxPivotChartType, type XlsxPivotDrillDown, type XlsxPivotFieldArea, type XlsxPivotFilter, type XlsxPivotGrouping, type XlsxPivotHeader, type XlsxPivotHeaderField, type XlsxPivotMember, type XlsxPivotShowAs, type XlsxPivotSource, type XlsxPivotSourceField, type XlsxPivotTable, type XlsxPivotTableControlsRenderProps, type XlsxPivotTableEditor, type XlsxPivotTableEditorOptions, type XlsxPivotTableHeaderMenuRenderProps, type XlsxPivotTableInput, type XlsxPivotTarget, type XlsxPivotToggle, type XlsxPivotValueField, type XlsxRangeHighlight, type XlsxScrollerRenderProps, type XlsxSelectionPopoverContext, type XlsxSelectionPopoverRenderProps, type XlsxShape, type XlsxShapeFill, type XlsxShapeParagraph, type XlsxShapeStroke, type XlsxShapeTextBox, type XlsxShapeTextRun, type XlsxSheetData, type XlsxSheetThumbnail, type XlsxSheetThumbnailResolution, type XlsxSheetVisibility, type XlsxTable, type XlsxTableColumn, type XlsxTableHeaderMenuRenderProps, type XlsxTableSortDirection, type XlsxTableSortState, type XlsxThemePalette, XlsxViewer, type XlsxViewerCharts, type XlsxViewerController, type XlsxViewerEditing, type XlsxViewerImages, type XlsxViewerMessages, type XlsxViewerPivots, type XlsxViewerProps, XlsxViewerProvider, type XlsxViewerProviderProps, type XlsxViewerSelection, type XlsxViewerTables, type XlsxViewerThumbnails, type XlsxViewerZoom, type XlsxWorkbookTab, useXlsxPivotTableEditor, useXlsxViewer, useXlsxViewerCharts, useXlsxViewerController, useXlsxViewerEditing, useXlsxViewerImages, useXlsxViewerPivots, useXlsxViewerSelection, useXlsxViewerTables, useXlsxViewerThumbnails, useXlsxViewerZoom };
3273
+ export { DefaultXlsxPivotTableFieldList, type DefaultXlsxPivotTableFieldListProps, DefaultXlsxToolbar, type UseXlsxViewerControllerOptions, type UseXlsxViewerThumbnailsOptions, type XlsxActiveCellOverlayRenderProps, type XlsxCellAddress, type XlsxCellAlignmentInput, type XlsxCellBorderEdgeInput, type XlsxCellBorderStyleInput, type XlsxCellEditorContext, type XlsxCellEditorOverlayRenderProps, type XlsxCellEditorSession, type XlsxCellFillStyleInput, type XlsxCellFontStyleInput, type XlsxCellGradientStopInput, type XlsxCellNumberFormatInput, type XlsxCellProtectionInput, type XlsxCellRange, type XlsxCellStyleColorInput, type XlsxCellStyleContext, type XlsxCellStyleInput, type XlsxChart, type XlsxChartAxis, type XlsxChartDataLabels, type XlsxChartElementSelection, type XlsxChartLoadingRenderProps, type XlsxChartReference, type XlsxChartSeries, type XlsxChartsheet, type XlsxContextMenuAction, type XlsxContextMenuActionId, type XlsxContextMenuContext, type XlsxContextMenuRenderProps, type XlsxDrawingLayout, type XlsxDrawingOrder, type XlsxFileTooLargeRenderProps, type XlsxFormControl, type XlsxFormControlActionEvent, type XlsxFormControlCaption, type XlsxFormControlCaptionInput, type XlsxFormControlCaptionRun, type XlsxFormControlChangeEvent, type XlsxFormControlInput, type XlsxFormControlKind, type XlsxFormControlKindInput, type XlsxFormControlPatch, type XlsxFormControlRenderProps, type XlsxFormControlSelectionMode, type XlsxFormControlState, type XlsxFormulaTarget, type XlsxFreezePanes, type XlsxHighlightRangeOptions, type XlsxImage, type XlsxImageAnchor, type XlsxImageRect, type XlsxImageRenderProps, type XlsxImageResizeHandlePosition, type XlsxImageSelectionRenderProps, type XlsxMergeMode, type XlsxParsedRange, type XlsxPivotAggregation, type XlsxPivotAxisField, type XlsxPivotCalculatedItem, type XlsxPivotChart, type XlsxPivotChartInput, type XlsxPivotChartType, type XlsxPivotDrillDown, type XlsxPivotFieldArea, type XlsxPivotFilter, type XlsxPivotGrouping, type XlsxPivotHeader, type XlsxPivotHeaderField, type XlsxPivotMember, type XlsxPivotShowAs, type XlsxPivotSource, type XlsxPivotSourceField, type XlsxPivotTable, type XlsxPivotTableControlsRenderProps, type XlsxPivotTableEditor, type XlsxPivotTableEditorOptions, type XlsxPivotTableHeaderMenuRenderProps, type XlsxPivotTableInput, type XlsxPivotTarget, type XlsxPivotToggle, type XlsxPivotValueField, type XlsxRangeHighlight, type XlsxScrollerRenderProps, type XlsxSelectionPopoverContext, type XlsxSelectionPopoverRenderProps, type XlsxShape, type XlsxShapeFill, type XlsxShapeParagraph, type XlsxShapeStroke, type XlsxShapeTextBox, type XlsxShapeTextRun, type XlsxSheetData, type XlsxSheetThumbnail, type XlsxSheetThumbnailResolution, type XlsxSheetVisibility, type XlsxTable, type XlsxTableColumn, type XlsxTableHeaderMenuRenderProps, type XlsxTableSortDirection, type XlsxTableSortState, type XlsxThemePalette, XlsxViewer, type XlsxViewerCharts, type XlsxViewerController, type XlsxViewerEditing, type XlsxViewerImages, type XlsxViewerLayout, type XlsxViewerMessages, type XlsxViewerPivots, type XlsxViewerProps, XlsxViewerProvider, type XlsxViewerProviderProps, type XlsxViewerSelection, type XlsxViewerTables, type XlsxViewerThumbnails, type XlsxViewerZoom, type XlsxWorkbookTab, useXlsxPivotTableEditor, useXlsxViewer, useXlsxViewerCharts, useXlsxViewerController, useXlsxViewerEditing, useXlsxViewerImages, useXlsxViewerLayout, useXlsxViewerPivots, useXlsxViewerSelection, useXlsxViewerTables, useXlsxViewerThumbnails, useXlsxViewerZoom };