@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
package/README.md
CHANGED
|
@@ -274,7 +274,7 @@ viewer.destroy();
|
|
|
274
274
|
|
|
275
275
|
`subscribe` also exposes `isLoadDeferred` and `continueDeferredLoad()` for deferred workbooks.
|
|
276
276
|
|
|
277
|
-
`XlsxVanillaViewerOptions` supports the non-React viewer options, including `getCellStyle`, form-control events, themes, worker settings, and highlighting. `toolbar`, loading/empty/error states, and the `renderActiveCellOverlay`, `renderCellEditorOverlay`, `renderSelectionPopover`, `renderChartLoading`, `renderContextMenu`, `renderFormControl`, and `renderImage` callbacks accept text or DOM nodes. Their vanilla callback props omit React's `defaultNode`. React-specific custom scroller, image-selection, and table-header render callbacks are not available through this entry point.
|
|
277
|
+
`XlsxVanillaViewerOptions` supports the non-React viewer options, including `getCellStyle`, form-control events, themes, worker settings, and highlighting. `toolbar`, loading/empty/error states, and the `renderActiveCellOverlay`, `renderCellEditorOverlay`, `renderSelectionPopover`, `renderChartLoading`, `renderContextMenu`, `renderHiddenRangeMarker`, `renderFormControl`, and `renderImage` callbacks accept text or DOM nodes. Their vanilla callback props omit React's `defaultNode`. React-specific custom scroller, image-selection, and table-header render callbacks are not available through this entry point.
|
|
278
278
|
|
|
279
279
|
The vanilla entry also exports `setWasmSource`, `initWasm`, `parseXlsxRange`, and workbook types. The same WASM, worker, font, and chart assets need to be served as in the React integration.
|
|
280
280
|
|
|
@@ -524,7 +524,9 @@ Exports contain native pivot definitions, cache definitions/records, relationshi
|
|
|
524
524
|
|
|
525
525
|
## Worksheet Layout
|
|
526
526
|
|
|
527
|
-
`useXlsxViewerLayout()` and the viewer controller expose the same commands for the active worksheet.
|
|
527
|
+
`useXlsxViewerLayout()` and the viewer controller expose the same commands for the active worksheet. In editing mode, layout changes participate in undo and redo and persist in XLSX exports.
|
|
528
|
+
|
|
529
|
+
In read-only mode, set `allowFreezeInReadOnly` to allow freezing and unfreezing or `allowHideInReadOnly` to allow hiding and unhiding rows and columns. Both options default to `false` and also apply when `readOnlyAboveBytes` activates read-only mode. Set them on the controller when supplying your own. Each worksheet keeps its view until the workbook is reloaded. Exports and edit history retain the workbook layout.
|
|
528
530
|
|
|
529
531
|
| Command | Default target | Explicit target |
|
|
530
532
|
| --- | --- | --- |
|
|
@@ -533,7 +535,28 @@ Exports contain native pivot definitions, cache definitions/records, relationshi
|
|
|
533
535
|
| `freezePanes()` | Rows above the selected row header, columns to the left of the selected column header, or both axes at the active cell | A zero-based cell address. `freezePanes({ row: 2, col: 1 })` keeps rows 1–2 and column A visible |
|
|
534
536
|
| `unfreezePanes()` | The active worksheet | — |
|
|
535
537
|
|
|
536
|
-
Read `canFreezePanes` to enable a freeze command for the current selection and `frozenPanes` for the current row and column counts, or `null` when unfrozen. To unhide a block from the grid, select headers on both sides and choose **Unhide**. For hidden leading rows or columns, select the first visible header.
|
|
538
|
+
Read `canChangeVisibility` and `canChangeFreezePanes` to enable layout menus. Use `canFreezePanes` to enable a freeze command for the current selection and `frozenPanes` for the current row and column counts, or `null` when unfrozen. To unhide a block from the grid, select headers on both sides and choose **Unhide**. For hidden leading rows or columns, select the first visible header.
|
|
539
|
+
|
|
540
|
+
### Hidden row and column markers
|
|
541
|
+
|
|
542
|
+
The row and column headers mark each contiguous hidden range with a thick line in the selection border color. Click the line to reveal that range. In read-only mode, `allowHideInReadOnly` enables clicking for the current session. Otherwise, the line is a visual indicator.
|
|
543
|
+
|
|
544
|
+
Use `renderHiddenRangeMarker` to replace the line. It receives the `axis` (`"row"` or `"column"`), inclusive zero-based `start` and `end`, a localized `label`, `readOnly`, `canUnhide`, and an `unhide()` action for that range. React also supplies `defaultNode`. Return `null` to omit a marker. Vanilla JavaScript accepts the same option and can return a DOM node or text.
|
|
545
|
+
|
|
546
|
+
```tsx
|
|
547
|
+
import type { XlsxHiddenRangeMarkerRenderProps } from "@extend-ai/react-xlsx";
|
|
548
|
+
|
|
549
|
+
function renderMarker({ axis, label, canUnhide, unhide }: XlsxHiddenRangeMarkerRenderProps) {
|
|
550
|
+
const icon = axis === "row" ? "↕" : "↔";
|
|
551
|
+
return canUnhide
|
|
552
|
+
? <button type="button" aria-label={label} onClick={unhide}>{icon}</button>
|
|
553
|
+
: <span role="img" aria-label={label}>{icon}</span>;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
<XlsxViewer src={url} renderHiddenRangeMarker={renderMarker} />
|
|
557
|
+
```
|
|
558
|
+
|
|
559
|
+
Both grid modes mount markers alongside virtualized headers. Keep the renderer reference stable to reuse its content while scrolling or changing the selection.
|
|
537
560
|
|
|
538
561
|
## Merging Cells
|
|
539
562
|
|
|
@@ -736,7 +759,7 @@ Right-click a chart, image, worksheet cell, row header, column header, or the to
|
|
|
736
759
|
|
|
737
760
|
Viewer mode (`readOnly`) offers Copy and selection actions. Editor mode also offers Cut, Paste, Edit cell, Clear contents, Undo/Redo, Merge/Unmerge, and sorting when the target belongs to a table. Actions use the existing controller and undo history. Row and column selections span the displayed grid, matching header selection. Worker-backed viewers copy tab-separated text; editable workbooks also preserve structured cell data when the browser supports custom clipboard formats. Clipboard commands require browser clipboard access; failed operations display an error and Cut only clears cells after copying succeeds.
|
|
738
761
|
|
|
739
|
-
Row and column headers have their own menus. In editing mode they offer Cut, Copy, Paste, Clear Contents, Row Height or Column Width, Hide, and Unhide. Sizing uses logical pixels and applies to all selected headers in one undo step. Read-only headers offer Copy and optionally sizing
|
|
762
|
+
Row and column headers have their own menus. In editing mode they offer Cut, Copy, Paste, Clear Contents, Row Height or Column Width, Hide, and Unhide. Sizing uses logical pixels and applies to all selected headers in one undo step. Read-only headers offer Copy and optionally sizing with `allowResizeInReadOnly` and Hide and Unhide with `allowHideInReadOnly`. Shift+F10 opens the same menu for a header selection.
|
|
740
763
|
|
|
741
764
|
Chart and image menus start with Undo and Redo, followed by a separator. Drawing Cut and Copy are not offered; copying worksheet cells remains supported. Bring to Front and Send to Back contain the one-step layer commands. Charts also have a nested Change Chart Type menu, grouped by family; options that require a different series count are disabled. Drawing positions, sizes, layer order, and chart types participate in undo/redo and are preserved by `download()` and `exportXlsx()`.
|
|
742
765
|
|
|
@@ -1101,7 +1124,7 @@ Common source and loading props:
|
|
|
1101
1124
|
|
|
1102
1125
|
Double-click the divider at the right edge of a column header to fit its contents. Double-click the divider at the bottom of a row header to fit its contents at the current column widths, including wrapped text. Autofit includes offscreen cells and skips hidden cells and merges that span the axis being resized.
|
|
1103
1126
|
|
|
1104
|
-
`allowResizeInReadOnly` enables autofit and drag resizing in a read-only viewer. When supplying your own controller, set this option on both `useXlsxViewerController` (or `XlsxViewerProvider`) and `XlsxViewer`. Workbooks forced into read-only mode by `readOnlyAboveBytes`
|
|
1127
|
+
`allowResizeInReadOnly` enables autofit and drag resizing in a read-only viewer. When supplying your own controller, set this option on both `useXlsxViewerController` (or `XlsxViewerProvider`) and `XlsxViewer`. Workbooks forced into read-only mode by `readOnlyAboveBytes` keep their original row and column sizes. Autofit uses the selected row or column, so it can evaluate conditional styles whose operands are literals or cells on that axis.
|
|
1105
1128
|
|
|
1106
1129
|
Common rendering props:
|
|
1107
1130
|
|
|
@@ -1116,6 +1139,8 @@ Common rendering props:
|
|
|
1116
1139
|
- `experimentalCanvas?: boolean`
|
|
1117
1140
|
- `enableGestureZoom?: boolean`
|
|
1118
1141
|
- `enableCanvasSelectionAnimation?: boolean`
|
|
1142
|
+
- `allowFreezeInReadOnly?: boolean`
|
|
1143
|
+
- `allowHideInReadOnly?: boolean`
|
|
1119
1144
|
- `allowResizeInReadOnly?: boolean`
|
|
1120
1145
|
- `highlightedRanges?: string | readonly string[] | null`
|
|
1121
1146
|
- `autoScrollToHighlightedRanges?: boolean`
|
|
@@ -720,6 +720,10 @@ var englishMessages = {
|
|
|
720
720
|
"ok": "OK",
|
|
721
721
|
"hide": "Hide",
|
|
722
722
|
"unhide": "Unhide",
|
|
723
|
+
"hiddenRowRange": "Hidden rows {range}",
|
|
724
|
+
"hiddenColumnRange": "Hidden columns {range}",
|
|
725
|
+
"unhideRowRange": "Unhide rows {range}",
|
|
726
|
+
"unhideColumnRange": "Unhide columns {range}",
|
|
723
727
|
"selectRow": "Select row",
|
|
724
728
|
"selectColumn": "Select column",
|
|
725
729
|
"selectAll": "Select all",
|
|
@@ -784,6 +788,10 @@ var frMessages = {
|
|
|
784
788
|
"ok": "OK",
|
|
785
789
|
"hide": "Masquer",
|
|
786
790
|
"unhide": "Afficher",
|
|
791
|
+
"hiddenRowRange": "Lignes masqu\xE9es {range}",
|
|
792
|
+
"hiddenColumnRange": "Colonnes masqu\xE9es {range}",
|
|
793
|
+
"unhideRowRange": "Afficher les lignes {range}",
|
|
794
|
+
"unhideColumnRange": "Afficher les colonnes {range}",
|
|
787
795
|
"selectRow": "S\xE9lectionner la ligne",
|
|
788
796
|
"selectColumn": "S\xE9lectionner la colonne",
|
|
789
797
|
"selectAll": "Tout s\xE9lectionner",
|
|
@@ -848,6 +856,10 @@ var deMessages = {
|
|
|
848
856
|
"ok": "OK",
|
|
849
857
|
"hide": "Ausblenden",
|
|
850
858
|
"unhide": "Einblenden",
|
|
859
|
+
"hiddenRowRange": "Ausgeblendete Zeilen {range}",
|
|
860
|
+
"hiddenColumnRange": "Ausgeblendete Spalten {range}",
|
|
861
|
+
"unhideRowRange": "Zeilen {range} einblenden",
|
|
862
|
+
"unhideColumnRange": "Spalten {range} einblenden",
|
|
851
863
|
"selectRow": "Zeile ausw\xE4hlen",
|
|
852
864
|
"selectColumn": "Spalte ausw\xE4hlen",
|
|
853
865
|
"selectAll": "Alles ausw\xE4hlen",
|
|
@@ -912,6 +924,10 @@ var esMessages = {
|
|
|
912
924
|
"ok": "Aceptar",
|
|
913
925
|
"hide": "Ocultar",
|
|
914
926
|
"unhide": "Mostrar",
|
|
927
|
+
"hiddenRowRange": "Filas ocultas {range}",
|
|
928
|
+
"hiddenColumnRange": "Columnas ocultas {range}",
|
|
929
|
+
"unhideRowRange": "Mostrar filas {range}",
|
|
930
|
+
"unhideColumnRange": "Mostrar columnas {range}",
|
|
915
931
|
"selectRow": "Seleccionar fila",
|
|
916
932
|
"selectColumn": "Seleccionar columna",
|
|
917
933
|
"selectAll": "Seleccionar todo",
|
|
@@ -976,6 +992,10 @@ var jaMessages = {
|
|
|
976
992
|
"ok": "OK",
|
|
977
993
|
"hide": "\u975E\u8868\u793A",
|
|
978
994
|
"unhide": "\u518D\u8868\u793A",
|
|
995
|
+
"hiddenRowRange": "\u975E\u8868\u793A\u306E\u884C {range}",
|
|
996
|
+
"hiddenColumnRange": "\u975E\u8868\u793A\u306E\u5217 {range}",
|
|
997
|
+
"unhideRowRange": "\u884C {range} \u3092\u518D\u8868\u793A",
|
|
998
|
+
"unhideColumnRange": "\u5217 {range} \u3092\u518D\u8868\u793A",
|
|
979
999
|
"selectRow": "\u884C\u3092\u9078\u629E",
|
|
980
1000
|
"selectColumn": "\u5217\u3092\u9078\u629E",
|
|
981
1001
|
"selectAll": "\u3059\u3079\u3066\u9078\u629E",
|
|
@@ -1040,6 +1060,10 @@ var ptMessages = {
|
|
|
1040
1060
|
"ok": "OK",
|
|
1041
1061
|
"hide": "Ocultar",
|
|
1042
1062
|
"unhide": "Reexibir",
|
|
1063
|
+
"hiddenRowRange": "Linhas ocultas {range}",
|
|
1064
|
+
"hiddenColumnRange": "Colunas ocultas {range}",
|
|
1065
|
+
"unhideRowRange": "Reexibir linhas {range}",
|
|
1066
|
+
"unhideColumnRange": "Reexibir colunas {range}",
|
|
1043
1067
|
"selectRow": "Selecionar linha",
|
|
1044
1068
|
"selectColumn": "Selecionar coluna",
|
|
1045
1069
|
"selectAll": "Selecionar tudo",
|
|
@@ -1104,6 +1128,10 @@ var itMessages = {
|
|
|
1104
1128
|
"ok": "OK",
|
|
1105
1129
|
"hide": "Nascondi",
|
|
1106
1130
|
"unhide": "Scopri",
|
|
1131
|
+
"hiddenRowRange": "Righe nascoste {range}",
|
|
1132
|
+
"hiddenColumnRange": "Colonne nascoste {range}",
|
|
1133
|
+
"unhideRowRange": "Scopri righe {range}",
|
|
1134
|
+
"unhideColumnRange": "Scopri colonne {range}",
|
|
1107
1135
|
"selectRow": "Seleziona riga",
|
|
1108
1136
|
"selectColumn": "Seleziona colonna",
|
|
1109
1137
|
"selectAll": "Seleziona tutto",
|
|
@@ -1168,6 +1196,10 @@ var zhMessages = {
|
|
|
1168
1196
|
"ok": "\u786E\u5B9A",
|
|
1169
1197
|
"hide": "\u9690\u85CF",
|
|
1170
1198
|
"unhide": "\u53D6\u6D88\u9690\u85CF",
|
|
1199
|
+
"hiddenRowRange": "\u9690\u85CF\u7684\u884C {range}",
|
|
1200
|
+
"hiddenColumnRange": "\u9690\u85CF\u7684\u5217 {range}",
|
|
1201
|
+
"unhideRowRange": "\u53D6\u6D88\u9690\u85CF\u884C {range}",
|
|
1202
|
+
"unhideColumnRange": "\u53D6\u6D88\u9690\u85CF\u5217 {range}",
|
|
1171
1203
|
"selectRow": "\u9009\u62E9\u884C",
|
|
1172
1204
|
"selectColumn": "\u9009\u62E9\u5217",
|
|
1173
1205
|
"selectAll": "\u5168\u9009",
|
|
@@ -1285,4 +1317,4 @@ export {
|
|
|
1285
1317
|
useXlsxMessages,
|
|
1286
1318
|
u3 as u
|
|
1287
1319
|
};
|
|
1288
|
-
//# sourceMappingURL=chunk-
|
|
1320
|
+
//# sourceMappingURL=chunk-EDUJZDOK.js.map
|