@extend-ai/react-xlsx 0.16.6 → 0.17.0
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 +56 -0
- package/dist/index.cjs +345 -78
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -1
- package/dist/index.d.ts +33 -1
- package/dist/index.js +344 -78
- package/dist/index.js.map +1 -1
- package/dist/xlsx-worker.js +5 -1
- package/dist/xlsx-worker.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -117,6 +117,7 @@ interface XlsxSheetData {
|
|
|
117
117
|
hasVerticalMerges: boolean;
|
|
118
118
|
maxHorizontalMergeEndCol: number;
|
|
119
119
|
maxVerticalMergeEndRow: number;
|
|
120
|
+
mergedRanges?: XlsxCellRange[];
|
|
120
121
|
minUsedCol: number;
|
|
121
122
|
minUsedRow: number;
|
|
122
123
|
maxUsedCol: number;
|
|
@@ -146,6 +147,23 @@ interface XlsxCellRange {
|
|
|
146
147
|
end: XlsxCellAddress;
|
|
147
148
|
start: XlsxCellAddress;
|
|
148
149
|
}
|
|
150
|
+
interface XlsxParsedRange {
|
|
151
|
+
kind: "cells" | "rows" | "columns";
|
|
152
|
+
range: XlsxCellRange;
|
|
153
|
+
sheetName: string | null;
|
|
154
|
+
}
|
|
155
|
+
interface XlsxHighlightRangeOptions {
|
|
156
|
+
/** Navigates to the worksheet and reveals the first range. Defaults to true. */
|
|
157
|
+
autoScroll?: boolean;
|
|
158
|
+
/** Visible worksheet index for an unqualified reference. Defaults to the active worksheet. */
|
|
159
|
+
sheetIndex?: number;
|
|
160
|
+
}
|
|
161
|
+
interface XlsxRangeHighlight extends XlsxParsedRange {
|
|
162
|
+
/** Whether this entry is the navigation target for the current highlight update. */
|
|
163
|
+
autoScroll: boolean;
|
|
164
|
+
sheetName: string;
|
|
165
|
+
workbookSheetIndex: number;
|
|
166
|
+
}
|
|
149
167
|
/**
|
|
150
168
|
* Color value accepted by persisted workbook style mutation APIs.
|
|
151
169
|
*
|
|
@@ -1037,6 +1055,11 @@ interface XlsxViewerController {
|
|
|
1037
1055
|
addFormControl: (input: XlsxFormControlInput, sheetIndex?: number) => number | null;
|
|
1038
1056
|
clearSelectedCells: () => void;
|
|
1039
1057
|
clearSelection: () => void;
|
|
1058
|
+
/** Removes all render-only range highlights. */
|
|
1059
|
+
clearHighlightedRanges: () => void;
|
|
1060
|
+
/** Replaces the highlights with validated A1 ranges. Returns false without changing state if any reference cannot be resolved. */
|
|
1061
|
+
highlightRanges: (references: string | readonly string[], options?: XlsxHighlightRangeOptions) => boolean;
|
|
1062
|
+
highlightedRanges: XlsxRangeHighlight[];
|
|
1040
1063
|
continueDeferredLoad: () => void;
|
|
1041
1064
|
copySelectionToClipboard: () => Promise<boolean>;
|
|
1042
1065
|
defaultZoomScale: number;
|
|
@@ -1455,6 +1478,12 @@ interface XlsxViewerProviderProps extends UseXlsxViewerControllerOptions {
|
|
|
1455
1478
|
isDark?: boolean;
|
|
1456
1479
|
}
|
|
1457
1480
|
interface XlsxViewerProps extends UseXlsxViewerControllerOptions {
|
|
1481
|
+
/** Render-only A1 ranges to highlight. Null or an empty array clears them; undefined leaves controller state alone. */
|
|
1482
|
+
highlightedRanges?: string | readonly string[] | null;
|
|
1483
|
+
/** Reveals the first newly highlighted range, including switching worksheets. Defaults to true. */
|
|
1484
|
+
autoScrollToHighlightedRanges?: boolean;
|
|
1485
|
+
/** Additional CSS class applied to the range highlight in both renderers. */
|
|
1486
|
+
highlightClassName?: string;
|
|
1458
1487
|
/**
|
|
1459
1488
|
* Allows row and column resizing even while editing is disabled by `readOnly`.
|
|
1460
1489
|
*
|
|
@@ -1669,6 +1698,9 @@ declare class XlsxFileSizeLimitExceededError extends Error {
|
|
|
1669
1698
|
}
|
|
1670
1699
|
declare function useXlsxViewerController(options: UseXlsxViewerControllerOptions): XlsxViewerController;
|
|
1671
1700
|
|
|
1701
|
+
/** Parses one rectangular A1 reference into normalized, zero-based coordinates. */
|
|
1702
|
+
declare function parseXlsxRange(reference: string): XlsxParsedRange | null;
|
|
1703
|
+
|
|
1672
1704
|
type XlsxWasmSource = string | URL | Request | Response | BufferSource | WebAssembly.Module;
|
|
1673
1705
|
declare function setWasmSource(source: XlsxWasmSource): void;
|
|
1674
1706
|
declare function initWasm(source?: XlsxWasmSource): Promise<typeof _dukelib_sheets_wasm>;
|
|
@@ -1685,4 +1717,4 @@ declare function useXlsxViewerThumbnails(options?: UseXlsxViewerThumbnailsOption
|
|
|
1685
1717
|
declare function XlsxViewer(props: XlsxViewerProps): react_jsx_runtime.JSX.Element;
|
|
1686
1718
|
declare function DefaultXlsxToolbar(): react_jsx_runtime.JSX.Element;
|
|
1687
1719
|
|
|
1688
|
-
export { DefaultXlsxToolbar, type UseXlsxViewerControllerOptions, type UseXlsxViewerThumbnailsOptions, type XlsxActiveCellOverlayRenderProps, type XlsxCellAddress, type XlsxCellAlignmentInput, type XlsxCellBorderEdgeInput, type XlsxCellBorderStyleInput, 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 XlsxDrawingLayout, XlsxFileSizeLimitExceededError, 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 XlsxImage, type XlsxImageAnchor, type XlsxImageRect, type XlsxImageRenderProps, type XlsxImageResizeHandlePosition, type XlsxImageSelectionRenderProps, type XlsxScrollerRenderProps, 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 XlsxViewerProps, XlsxViewerProvider, type XlsxViewerProviderProps, type XlsxViewerSelection, type XlsxViewerTables, type XlsxViewerThumbnails, type XlsxViewerZoom, type XlsxWasmSource, type XlsxWorkbookTab, initWasm, setWasmSource, useXlsxViewer, useXlsxViewerCharts, useXlsxViewerController, useXlsxViewerEditing, useXlsxViewerImages, useXlsxViewerSelection, useXlsxViewerTables, useXlsxViewerThumbnails, useXlsxViewerZoom };
|
|
1720
|
+
export { DefaultXlsxToolbar, type UseXlsxViewerControllerOptions, type UseXlsxViewerThumbnailsOptions, type XlsxActiveCellOverlayRenderProps, type XlsxCellAddress, type XlsxCellAlignmentInput, type XlsxCellBorderEdgeInput, type XlsxCellBorderStyleInput, 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 XlsxDrawingLayout, XlsxFileSizeLimitExceededError, 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 XlsxParsedRange, type XlsxRangeHighlight, type XlsxScrollerRenderProps, 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 XlsxViewerProps, XlsxViewerProvider, type XlsxViewerProviderProps, type XlsxViewerSelection, type XlsxViewerTables, type XlsxViewerThumbnails, type XlsxViewerZoom, type XlsxWasmSource, type XlsxWorkbookTab, initWasm, parseXlsxRange, setWasmSource, useXlsxViewer, useXlsxViewerCharts, useXlsxViewerController, useXlsxViewerEditing, useXlsxViewerImages, useXlsxViewerSelection, useXlsxViewerTables, useXlsxViewerThumbnails, useXlsxViewerZoom };
|
package/dist/index.d.ts
CHANGED
|
@@ -117,6 +117,7 @@ interface XlsxSheetData {
|
|
|
117
117
|
hasVerticalMerges: boolean;
|
|
118
118
|
maxHorizontalMergeEndCol: number;
|
|
119
119
|
maxVerticalMergeEndRow: number;
|
|
120
|
+
mergedRanges?: XlsxCellRange[];
|
|
120
121
|
minUsedCol: number;
|
|
121
122
|
minUsedRow: number;
|
|
122
123
|
maxUsedCol: number;
|
|
@@ -146,6 +147,23 @@ interface XlsxCellRange {
|
|
|
146
147
|
end: XlsxCellAddress;
|
|
147
148
|
start: XlsxCellAddress;
|
|
148
149
|
}
|
|
150
|
+
interface XlsxParsedRange {
|
|
151
|
+
kind: "cells" | "rows" | "columns";
|
|
152
|
+
range: XlsxCellRange;
|
|
153
|
+
sheetName: string | null;
|
|
154
|
+
}
|
|
155
|
+
interface XlsxHighlightRangeOptions {
|
|
156
|
+
/** Navigates to the worksheet and reveals the first range. Defaults to true. */
|
|
157
|
+
autoScroll?: boolean;
|
|
158
|
+
/** Visible worksheet index for an unqualified reference. Defaults to the active worksheet. */
|
|
159
|
+
sheetIndex?: number;
|
|
160
|
+
}
|
|
161
|
+
interface XlsxRangeHighlight extends XlsxParsedRange {
|
|
162
|
+
/** Whether this entry is the navigation target for the current highlight update. */
|
|
163
|
+
autoScroll: boolean;
|
|
164
|
+
sheetName: string;
|
|
165
|
+
workbookSheetIndex: number;
|
|
166
|
+
}
|
|
149
167
|
/**
|
|
150
168
|
* Color value accepted by persisted workbook style mutation APIs.
|
|
151
169
|
*
|
|
@@ -1037,6 +1055,11 @@ interface XlsxViewerController {
|
|
|
1037
1055
|
addFormControl: (input: XlsxFormControlInput, sheetIndex?: number) => number | null;
|
|
1038
1056
|
clearSelectedCells: () => void;
|
|
1039
1057
|
clearSelection: () => void;
|
|
1058
|
+
/** Removes all render-only range highlights. */
|
|
1059
|
+
clearHighlightedRanges: () => void;
|
|
1060
|
+
/** Replaces the highlights with validated A1 ranges. Returns false without changing state if any reference cannot be resolved. */
|
|
1061
|
+
highlightRanges: (references: string | readonly string[], options?: XlsxHighlightRangeOptions) => boolean;
|
|
1062
|
+
highlightedRanges: XlsxRangeHighlight[];
|
|
1040
1063
|
continueDeferredLoad: () => void;
|
|
1041
1064
|
copySelectionToClipboard: () => Promise<boolean>;
|
|
1042
1065
|
defaultZoomScale: number;
|
|
@@ -1455,6 +1478,12 @@ interface XlsxViewerProviderProps extends UseXlsxViewerControllerOptions {
|
|
|
1455
1478
|
isDark?: boolean;
|
|
1456
1479
|
}
|
|
1457
1480
|
interface XlsxViewerProps extends UseXlsxViewerControllerOptions {
|
|
1481
|
+
/** Render-only A1 ranges to highlight. Null or an empty array clears them; undefined leaves controller state alone. */
|
|
1482
|
+
highlightedRanges?: string | readonly string[] | null;
|
|
1483
|
+
/** Reveals the first newly highlighted range, including switching worksheets. Defaults to true. */
|
|
1484
|
+
autoScrollToHighlightedRanges?: boolean;
|
|
1485
|
+
/** Additional CSS class applied to the range highlight in both renderers. */
|
|
1486
|
+
highlightClassName?: string;
|
|
1458
1487
|
/**
|
|
1459
1488
|
* Allows row and column resizing even while editing is disabled by `readOnly`.
|
|
1460
1489
|
*
|
|
@@ -1669,6 +1698,9 @@ declare class XlsxFileSizeLimitExceededError extends Error {
|
|
|
1669
1698
|
}
|
|
1670
1699
|
declare function useXlsxViewerController(options: UseXlsxViewerControllerOptions): XlsxViewerController;
|
|
1671
1700
|
|
|
1701
|
+
/** Parses one rectangular A1 reference into normalized, zero-based coordinates. */
|
|
1702
|
+
declare function parseXlsxRange(reference: string): XlsxParsedRange | null;
|
|
1703
|
+
|
|
1672
1704
|
type XlsxWasmSource = string | URL | Request | Response | BufferSource | WebAssembly.Module;
|
|
1673
1705
|
declare function setWasmSource(source: XlsxWasmSource): void;
|
|
1674
1706
|
declare function initWasm(source?: XlsxWasmSource): Promise<typeof _dukelib_sheets_wasm>;
|
|
@@ -1685,4 +1717,4 @@ declare function useXlsxViewerThumbnails(options?: UseXlsxViewerThumbnailsOption
|
|
|
1685
1717
|
declare function XlsxViewer(props: XlsxViewerProps): react_jsx_runtime.JSX.Element;
|
|
1686
1718
|
declare function DefaultXlsxToolbar(): react_jsx_runtime.JSX.Element;
|
|
1687
1719
|
|
|
1688
|
-
export { DefaultXlsxToolbar, type UseXlsxViewerControllerOptions, type UseXlsxViewerThumbnailsOptions, type XlsxActiveCellOverlayRenderProps, type XlsxCellAddress, type XlsxCellAlignmentInput, type XlsxCellBorderEdgeInput, type XlsxCellBorderStyleInput, 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 XlsxDrawingLayout, XlsxFileSizeLimitExceededError, 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 XlsxImage, type XlsxImageAnchor, type XlsxImageRect, type XlsxImageRenderProps, type XlsxImageResizeHandlePosition, type XlsxImageSelectionRenderProps, type XlsxScrollerRenderProps, 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 XlsxViewerProps, XlsxViewerProvider, type XlsxViewerProviderProps, type XlsxViewerSelection, type XlsxViewerTables, type XlsxViewerThumbnails, type XlsxViewerZoom, type XlsxWasmSource, type XlsxWorkbookTab, initWasm, setWasmSource, useXlsxViewer, useXlsxViewerCharts, useXlsxViewerController, useXlsxViewerEditing, useXlsxViewerImages, useXlsxViewerSelection, useXlsxViewerTables, useXlsxViewerThumbnails, useXlsxViewerZoom };
|
|
1720
|
+
export { DefaultXlsxToolbar, type UseXlsxViewerControllerOptions, type UseXlsxViewerThumbnailsOptions, type XlsxActiveCellOverlayRenderProps, type XlsxCellAddress, type XlsxCellAlignmentInput, type XlsxCellBorderEdgeInput, type XlsxCellBorderStyleInput, 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 XlsxDrawingLayout, XlsxFileSizeLimitExceededError, 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 XlsxParsedRange, type XlsxRangeHighlight, type XlsxScrollerRenderProps, 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 XlsxViewerProps, XlsxViewerProvider, type XlsxViewerProviderProps, type XlsxViewerSelection, type XlsxViewerTables, type XlsxViewerThumbnails, type XlsxViewerZoom, type XlsxWasmSource, type XlsxWorkbookTab, initWasm, parseXlsxRange, setWasmSource, useXlsxViewer, useXlsxViewerCharts, useXlsxViewerController, useXlsxViewerEditing, useXlsxViewerImages, useXlsxViewerSelection, useXlsxViewerTables, useXlsxViewerThumbnails, useXlsxViewerZoom };
|