@extend-ai/react-xlsx 0.20.11 → 0.20.12
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 +27 -3
- package/dist/{chunk-OGZ6ROZC.cjs → chunk-A3S3QKJN.cjs} +445 -3
- package/dist/chunk-A3S3QKJN.cjs.map +1 -0
- package/dist/chunk-IRC7BQ6E.js +538 -0
- package/dist/chunk-IRC7BQ6E.js.map +1 -0
- package/dist/{chunk-SXHHFUXA.cjs → chunk-NIN5D556.cjs} +899 -875
- package/dist/chunk-NIN5D556.cjs.map +1 -0
- package/dist/{chunk-VSM7WKLM.js → chunk-O4S5CRDM.js} +134 -110
- package/dist/chunk-O4S5CRDM.js.map +1 -0
- package/dist/{chunk-CVMHJO5H.js → chunk-WHTV6N6S.js} +443 -1
- package/dist/chunk-WHTV6N6S.js.map +1 -0
- package/dist/chunk-ZPDHTVL6.cjs +538 -0
- package/dist/chunk-ZPDHTVL6.cjs.map +1 -0
- package/dist/index.cjs +32 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +60 -2
- package/dist/index.d.ts +60 -2
- package/dist/index.js +32 -14
- package/dist/index.js.map +1 -1
- package/dist/{internal-BBaC9yCh.d.cts → internal-D_np3R-w.d.cts} +60 -2
- package/dist/{internal-BBaC9yCh.d.ts → internal-D_np3R-w.d.ts} +60 -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-XOCTF7KQ.js → shared-chart-7RUN5IKZ.js} +6 -4
- package/dist/shared-chart-7RUN5IKZ.js.map +1 -0
- package/dist/{shared-chart-CIRSCWTO.cjs → shared-chart-P3KU6TQR.cjs} +15 -13
- package/dist/shared-chart-P3KU6TQR.cjs.map +1 -0
- package/dist/{shared-chart-BLOOGI7S.js → shared-chart-UTUK46E4.js} +6 -4
- package/dist/shared-chart-UTUK46E4.js.map +1 -0
- package/dist/{shared-chart-4LUQQI2B.cjs → shared-chart-VRXD57MU.cjs} +6 -4
- package/dist/shared-chart-VRXD57MU.cjs.map +1 -0
- 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/package.json +1 -1
- package/dist/chunk-7GBCRNGO.js +0 -94
- package/dist/chunk-7GBCRNGO.js.map +0 -1
- package/dist/chunk-CVMHJO5H.js.map +0 -1
- package/dist/chunk-MFOGLSFJ.cjs +0 -94
- package/dist/chunk-MFOGLSFJ.cjs.map +0 -1
- package/dist/chunk-OGZ6ROZC.cjs.map +0 -1
- package/dist/chunk-SXHHFUXA.cjs.map +0 -1
- package/dist/chunk-VSM7WKLM.js.map +0 -1
- package/dist/shared-chart-4LUQQI2B.cjs.map +0 -1
- package/dist/shared-chart-BLOOGI7S.js.map +0 -1
- package/dist/shared-chart-CIRSCWTO.cjs.map +0 -1
- package/dist/shared-chart-XOCTF7KQ.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -45,6 +45,60 @@ interface OfficeCharts {
|
|
|
45
45
|
renderChart(xml: string, options?: RenderOptions): string | null;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
declare const englishMessages: {
|
|
49
|
+
sortAscending: string;
|
|
50
|
+
sortDescending: string;
|
|
51
|
+
openMenuForColumn: string;
|
|
52
|
+
cut: string;
|
|
53
|
+
copy: string;
|
|
54
|
+
paste: string;
|
|
55
|
+
editCell: string;
|
|
56
|
+
clearContents: string;
|
|
57
|
+
undo: string;
|
|
58
|
+
redo: string;
|
|
59
|
+
mergeAndCenter: string;
|
|
60
|
+
mergeAcross: string;
|
|
61
|
+
mergeCells: string;
|
|
62
|
+
unmergeCells: string;
|
|
63
|
+
selectRow: string;
|
|
64
|
+
selectColumn: string;
|
|
65
|
+
selectAll: string;
|
|
66
|
+
contextMenu: string;
|
|
67
|
+
clipboardCopyUnavailable: string;
|
|
68
|
+
clipboardPasteUnavailable: string;
|
|
69
|
+
nothingToPaste: string;
|
|
70
|
+
actionFailed: string;
|
|
71
|
+
workbookSheets: string;
|
|
72
|
+
downloadWorkbook: string;
|
|
73
|
+
zoomIn: string;
|
|
74
|
+
zoomOut: string;
|
|
75
|
+
resetZoom: string;
|
|
76
|
+
hiddenSheet: string;
|
|
77
|
+
veryHiddenSheet: string;
|
|
78
|
+
loadingWorkbook: string;
|
|
79
|
+
emptyWorkbook: string;
|
|
80
|
+
loadWorkbookFailed: string;
|
|
81
|
+
fileTooLarge: string;
|
|
82
|
+
largeWorkbook: string;
|
|
83
|
+
deferredLoadDescription: string;
|
|
84
|
+
loadAnyway: string;
|
|
85
|
+
worksheetGrid: string;
|
|
86
|
+
workbookGrid: string;
|
|
87
|
+
dropdownControl: string;
|
|
88
|
+
listBoxControl: string;
|
|
89
|
+
scrollbarControl: string;
|
|
90
|
+
spinnerControl: string;
|
|
91
|
+
chart: string;
|
|
92
|
+
loadingChart: string;
|
|
93
|
+
loadChartFailed: string;
|
|
94
|
+
mapUnavailable: string;
|
|
95
|
+
chartUnavailable: string;
|
|
96
|
+
chartsheetUnavailable: string;
|
|
97
|
+
};
|
|
98
|
+
type XlsxViewerMessages = {
|
|
99
|
+
[Key in keyof typeof englishMessages]: string;
|
|
100
|
+
};
|
|
101
|
+
|
|
48
102
|
interface XlsxThemePalette {
|
|
49
103
|
colorsByIndex: Record<number, string>;
|
|
50
104
|
majorLatinFont?: string;
|
|
@@ -1051,8 +1105,10 @@ interface XlsxScrollerRenderProps {
|
|
|
1051
1105
|
};
|
|
1052
1106
|
}
|
|
1053
1107
|
interface UseXlsxViewerControllerOptions {
|
|
1054
|
-
/** BCP 47 locale for
|
|
1108
|
+
/** BCP 47 locale for number formatting and built-in UI text. Defaults to en-US. */
|
|
1055
1109
|
locale?: string;
|
|
1110
|
+
/** Partial overrides for localized UI text, including accessibility labels. */
|
|
1111
|
+
messages?: Partial<XlsxViewerMessages>;
|
|
1056
1112
|
/**
|
|
1057
1113
|
* Allows row and column resizing even while editing is disabled by `readOnly`.
|
|
1058
1114
|
*
|
|
@@ -1166,6 +1222,8 @@ interface XlsxViewerController {
|
|
|
1166
1222
|
defineNamedRange: (name: string, range?: XlsxCellRange | null) => void;
|
|
1167
1223
|
displayFileName: string;
|
|
1168
1224
|
locale: string;
|
|
1225
|
+
/** Resolved UI text after applying locale defaults and message overrides. */
|
|
1226
|
+
messages: XlsxViewerMessages;
|
|
1169
1227
|
download: () => void;
|
|
1170
1228
|
charts: XlsxChart[];
|
|
1171
1229
|
chartsheets: XlsxChartsheet[];
|
|
@@ -1854,4 +1912,4 @@ declare function useXlsxViewerCharts(): XlsxViewerCharts;
|
|
|
1854
1912
|
declare function useXlsxViewerThumbnails(options?: UseXlsxViewerThumbnailsOptions): XlsxViewerThumbnails;
|
|
1855
1913
|
declare function DefaultXlsxToolbar(): react_jsx_runtime.JSX.Element;
|
|
1856
1914
|
|
|
1857
|
-
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 XlsxContextMenuAction, type XlsxContextMenuActionId, type XlsxContextMenuContext, type XlsxContextMenuRenderProps, type XlsxDrawingLayout, 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 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 XlsxWorkbookTab, useXlsxViewer, useXlsxViewerCharts, useXlsxViewerController, useXlsxViewerEditing, useXlsxViewerImages, useXlsxViewerSelection, useXlsxViewerTables, useXlsxViewerThumbnails, useXlsxViewerZoom };
|
|
1915
|
+
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 XlsxContextMenuAction, type XlsxContextMenuActionId, type XlsxContextMenuContext, type XlsxContextMenuRenderProps, type XlsxDrawingLayout, 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 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 XlsxViewerMessages, type XlsxViewerProps, XlsxViewerProvider, type XlsxViewerProviderProps, type XlsxViewerSelection, type XlsxViewerTables, type XlsxViewerThumbnails, type XlsxViewerZoom, type XlsxWorkbookTab, useXlsxViewer, useXlsxViewerCharts, useXlsxViewerController, useXlsxViewerEditing, useXlsxViewerImages, useXlsxViewerSelection, useXlsxViewerTables, useXlsxViewerThumbnails, useXlsxViewerZoom };
|
package/dist/index.d.ts
CHANGED
|
@@ -45,6 +45,60 @@ interface OfficeCharts {
|
|
|
45
45
|
renderChart(xml: string, options?: RenderOptions): string | null;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
declare const englishMessages: {
|
|
49
|
+
sortAscending: string;
|
|
50
|
+
sortDescending: string;
|
|
51
|
+
openMenuForColumn: string;
|
|
52
|
+
cut: string;
|
|
53
|
+
copy: string;
|
|
54
|
+
paste: string;
|
|
55
|
+
editCell: string;
|
|
56
|
+
clearContents: string;
|
|
57
|
+
undo: string;
|
|
58
|
+
redo: string;
|
|
59
|
+
mergeAndCenter: string;
|
|
60
|
+
mergeAcross: string;
|
|
61
|
+
mergeCells: string;
|
|
62
|
+
unmergeCells: string;
|
|
63
|
+
selectRow: string;
|
|
64
|
+
selectColumn: string;
|
|
65
|
+
selectAll: string;
|
|
66
|
+
contextMenu: string;
|
|
67
|
+
clipboardCopyUnavailable: string;
|
|
68
|
+
clipboardPasteUnavailable: string;
|
|
69
|
+
nothingToPaste: string;
|
|
70
|
+
actionFailed: string;
|
|
71
|
+
workbookSheets: string;
|
|
72
|
+
downloadWorkbook: string;
|
|
73
|
+
zoomIn: string;
|
|
74
|
+
zoomOut: string;
|
|
75
|
+
resetZoom: string;
|
|
76
|
+
hiddenSheet: string;
|
|
77
|
+
veryHiddenSheet: string;
|
|
78
|
+
loadingWorkbook: string;
|
|
79
|
+
emptyWorkbook: string;
|
|
80
|
+
loadWorkbookFailed: string;
|
|
81
|
+
fileTooLarge: string;
|
|
82
|
+
largeWorkbook: string;
|
|
83
|
+
deferredLoadDescription: string;
|
|
84
|
+
loadAnyway: string;
|
|
85
|
+
worksheetGrid: string;
|
|
86
|
+
workbookGrid: string;
|
|
87
|
+
dropdownControl: string;
|
|
88
|
+
listBoxControl: string;
|
|
89
|
+
scrollbarControl: string;
|
|
90
|
+
spinnerControl: string;
|
|
91
|
+
chart: string;
|
|
92
|
+
loadingChart: string;
|
|
93
|
+
loadChartFailed: string;
|
|
94
|
+
mapUnavailable: string;
|
|
95
|
+
chartUnavailable: string;
|
|
96
|
+
chartsheetUnavailable: string;
|
|
97
|
+
};
|
|
98
|
+
type XlsxViewerMessages = {
|
|
99
|
+
[Key in keyof typeof englishMessages]: string;
|
|
100
|
+
};
|
|
101
|
+
|
|
48
102
|
interface XlsxThemePalette {
|
|
49
103
|
colorsByIndex: Record<number, string>;
|
|
50
104
|
majorLatinFont?: string;
|
|
@@ -1051,8 +1105,10 @@ interface XlsxScrollerRenderProps {
|
|
|
1051
1105
|
};
|
|
1052
1106
|
}
|
|
1053
1107
|
interface UseXlsxViewerControllerOptions {
|
|
1054
|
-
/** BCP 47 locale for
|
|
1108
|
+
/** BCP 47 locale for number formatting and built-in UI text. Defaults to en-US. */
|
|
1055
1109
|
locale?: string;
|
|
1110
|
+
/** Partial overrides for localized UI text, including accessibility labels. */
|
|
1111
|
+
messages?: Partial<XlsxViewerMessages>;
|
|
1056
1112
|
/**
|
|
1057
1113
|
* Allows row and column resizing even while editing is disabled by `readOnly`.
|
|
1058
1114
|
*
|
|
@@ -1166,6 +1222,8 @@ interface XlsxViewerController {
|
|
|
1166
1222
|
defineNamedRange: (name: string, range?: XlsxCellRange | null) => void;
|
|
1167
1223
|
displayFileName: string;
|
|
1168
1224
|
locale: string;
|
|
1225
|
+
/** Resolved UI text after applying locale defaults and message overrides. */
|
|
1226
|
+
messages: XlsxViewerMessages;
|
|
1169
1227
|
download: () => void;
|
|
1170
1228
|
charts: XlsxChart[];
|
|
1171
1229
|
chartsheets: XlsxChartsheet[];
|
|
@@ -1854,4 +1912,4 @@ declare function useXlsxViewerCharts(): XlsxViewerCharts;
|
|
|
1854
1912
|
declare function useXlsxViewerThumbnails(options?: UseXlsxViewerThumbnailsOptions): XlsxViewerThumbnails;
|
|
1855
1913
|
declare function DefaultXlsxToolbar(): react_jsx_runtime.JSX.Element;
|
|
1856
1914
|
|
|
1857
|
-
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 XlsxContextMenuAction, type XlsxContextMenuActionId, type XlsxContextMenuContext, type XlsxContextMenuRenderProps, type XlsxDrawingLayout, 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 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 XlsxWorkbookTab, useXlsxViewer, useXlsxViewerCharts, useXlsxViewerController, useXlsxViewerEditing, useXlsxViewerImages, useXlsxViewerSelection, useXlsxViewerTables, useXlsxViewerThumbnails, useXlsxViewerZoom };
|
|
1915
|
+
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 XlsxContextMenuAction, type XlsxContextMenuActionId, type XlsxContextMenuContext, type XlsxContextMenuRenderProps, type XlsxDrawingLayout, 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 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 XlsxViewerMessages, type XlsxViewerProps, XlsxViewerProvider, type XlsxViewerProviderProps, type XlsxViewerSelection, type XlsxViewerTables, type XlsxViewerThumbnails, type XlsxViewerZoom, type XlsxWorkbookTab, useXlsxViewer, useXlsxViewerCharts, useXlsxViewerController, useXlsxViewerEditing, useXlsxViewerImages, useXlsxViewerSelection, useXlsxViewerTables, useXlsxViewerThumbnails, useXlsxViewerZoom };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
formatMessage,
|
|
3
|
+
loadOfficeFonts,
|
|
4
|
+
mergeMessages,
|
|
5
|
+
resolveMessages,
|
|
6
|
+
useXlsxMessages
|
|
7
|
+
} from "./chunk-IRC7BQ6E.js";
|
|
4
8
|
|
|
5
9
|
// src/number-locale.ts
|
|
6
10
|
var separators = /* @__PURE__ */ new Map();
|
|
@@ -9427,6 +9431,7 @@ function useXlsxViewerController(options) {
|
|
|
9427
9431
|
file,
|
|
9428
9432
|
fileName,
|
|
9429
9433
|
locale = "en-US",
|
|
9434
|
+
messages: messageOverrides,
|
|
9430
9435
|
maxFileSizeBytes = DEFAULT_MAX_FILE_SIZE_BYTES,
|
|
9431
9436
|
readOnly: requestedReadOnly = false,
|
|
9432
9437
|
readOnlyAboveBytes = 0,
|
|
@@ -9435,6 +9440,7 @@ function useXlsxViewerController(options) {
|
|
|
9435
9440
|
src,
|
|
9436
9441
|
useWorker = true
|
|
9437
9442
|
} = options;
|
|
9443
|
+
const messages = React.useMemo(() => resolveMessages(locale, messageOverrides), [locale, messageOverrides]);
|
|
9438
9444
|
const [isLoading, setIsLoading] = React.useState(Boolean(file ?? src));
|
|
9439
9445
|
const [error, setError] = React.useState(null);
|
|
9440
9446
|
const [workbook, setWorkbook] = React.useState(null);
|
|
@@ -12177,6 +12183,7 @@ function useXlsxViewerController(options) {
|
|
|
12177
12183
|
defineNamedRange,
|
|
12178
12184
|
displayFileName,
|
|
12179
12185
|
locale,
|
|
12186
|
+
messages,
|
|
12180
12187
|
download,
|
|
12181
12188
|
exportCsv,
|
|
12182
12189
|
exportXlsx,
|
|
@@ -12301,6 +12308,7 @@ function useXlsxViewerController(options) {
|
|
|
12301
12308
|
defineNamedRange,
|
|
12302
12309
|
displayFileName,
|
|
12303
12310
|
locale,
|
|
12311
|
+
messages,
|
|
12304
12312
|
download,
|
|
12305
12313
|
error,
|
|
12306
12314
|
exportCsv,
|
|
@@ -12427,6 +12435,7 @@ function CellEditor({
|
|
|
12427
12435
|
onNavigate
|
|
12428
12436
|
}) {
|
|
12429
12437
|
const rootRef = React2.useRef(null);
|
|
12438
|
+
const messages = useXlsxMessages();
|
|
12430
12439
|
const mirrorRef = React2.useRef(null);
|
|
12431
12440
|
const textRef = React2.useRef(null);
|
|
12432
12441
|
const baselineRef = React2.useRef(null);
|
|
@@ -12612,7 +12621,7 @@ function CellEditor({
|
|
|
12612
12621
|
if (typeof inputRef === "function") inputRef(element);
|
|
12613
12622
|
else if (inputRef) inputRef.current = element;
|
|
12614
12623
|
},
|
|
12615
|
-
"aria-label":
|
|
12624
|
+
"aria-label": messages.editCell,
|
|
12616
12625
|
autoFocus: true,
|
|
12617
12626
|
autoComplete: "off",
|
|
12618
12627
|
spellCheck: false,
|
|
@@ -12786,18 +12795,18 @@ function createChartModule(importModule) {
|
|
|
12786
12795
|
var officeChartRenderer = createChartModule(async () => {
|
|
12787
12796
|
const [{ loadOfficeCharts }, { SharedChartSvg }] = await Promise.all([
|
|
12788
12797
|
import("./browser-AWFV5QM2.js"),
|
|
12789
|
-
import("./shared-chart-
|
|
12798
|
+
import("./shared-chart-UTUK46E4.js")
|
|
12790
12799
|
]);
|
|
12791
12800
|
return { renderer: await loadOfficeCharts(), SharedChartSvg };
|
|
12792
12801
|
});
|
|
12793
12802
|
var suppliedOfficeChartRenderer = createChartModule(async () => {
|
|
12794
|
-
const { SharedChartSvg } = await import("./shared-chart-
|
|
12803
|
+
const { SharedChartSvg } = await import("./shared-chart-UTUK46E4.js");
|
|
12795
12804
|
return { renderer: null, SharedChartSvg };
|
|
12796
12805
|
});
|
|
12797
12806
|
var officeExtendedChartRenderer = createChartModule(async () => {
|
|
12798
12807
|
const [{ loadOfficeCharts }, { SharedChartSvg }] = await Promise.all([
|
|
12799
12808
|
import("./full-ERXNU2LF.js"),
|
|
12800
|
-
import("./shared-chart-
|
|
12809
|
+
import("./shared-chart-UTUK46E4.js")
|
|
12801
12810
|
]);
|
|
12802
12811
|
return { renderer: await loadOfficeCharts(typeof DecompressionStream === "function" ? void 0 : new URL("./office_charts_full_bg.wasm", import.meta.url)), SharedChartSvg };
|
|
12803
12812
|
});
|
|
@@ -13421,8 +13430,8 @@ function drawCanvasConditionalIcon(context, icon, centerX, centerY, size) {
|
|
|
13421
13430
|
context.fill();
|
|
13422
13431
|
context.restore();
|
|
13423
13432
|
}
|
|
13424
|
-
function formatZoomScale(zoomScale) {
|
|
13425
|
-
return
|
|
13433
|
+
function formatZoomScale(zoomScale, locale) {
|
|
13434
|
+
return new Intl.NumberFormat(locale, { style: "percent", maximumFractionDigits: 0 }).format(zoomScale / 100);
|
|
13426
13435
|
}
|
|
13427
13436
|
function parseRgbColor(color) {
|
|
13428
13437
|
const match = /^#?([0-9a-f]{6})$/i.exec(color);
|
|
@@ -15313,6 +15322,7 @@ function mergeResolvedCellStyle(base, overlay, options) {
|
|
|
15313
15322
|
}
|
|
15314
15323
|
function SegmentedControl({
|
|
15315
15324
|
items,
|
|
15325
|
+
messages,
|
|
15316
15326
|
onValueChange,
|
|
15317
15327
|
palette,
|
|
15318
15328
|
value
|
|
@@ -15320,7 +15330,7 @@ function SegmentedControl({
|
|
|
15320
15330
|
return /* @__PURE__ */ jsx4(
|
|
15321
15331
|
"div",
|
|
15322
15332
|
{
|
|
15323
|
-
"aria-label":
|
|
15333
|
+
"aria-label": messages.workbookSheets,
|
|
15324
15334
|
role: "tablist",
|
|
15325
15335
|
style: {
|
|
15326
15336
|
alignItems: "center",
|
|
@@ -15372,6 +15382,8 @@ function DefaultToolbar({ controller, palette }) {
|
|
|
15372
15382
|
canZoomIn,
|
|
15373
15383
|
canZoomOut,
|
|
15374
15384
|
defaultZoomScale,
|
|
15385
|
+
locale,
|
|
15386
|
+
messages,
|
|
15375
15387
|
displayFileName,
|
|
15376
15388
|
download,
|
|
15377
15389
|
resetZoom,
|
|
@@ -15427,6 +15439,7 @@ function DefaultToolbar({ controller, palette }) {
|
|
|
15427
15439
|
/* @__PURE__ */ jsx4(
|
|
15428
15440
|
"button",
|
|
15429
15441
|
{
|
|
15442
|
+
"aria-label": messages.zoomOut,
|
|
15430
15443
|
disabled: !canZoomOut,
|
|
15431
15444
|
onClick: zoomOut,
|
|
15432
15445
|
style: {
|
|
@@ -15445,6 +15458,7 @@ function DefaultToolbar({ controller, palette }) {
|
|
|
15445
15458
|
/* @__PURE__ */ jsx4(
|
|
15446
15459
|
"button",
|
|
15447
15460
|
{
|
|
15461
|
+
"aria-label": messages.resetZoom,
|
|
15448
15462
|
onClick: resetZoom,
|
|
15449
15463
|
style: {
|
|
15450
15464
|
background: Math.round(zoomScale) === Math.round(defaultZoomScale) ? "transparent" : palette.subtleSurface,
|
|
@@ -15459,12 +15473,13 @@ function DefaultToolbar({ controller, palette }) {
|
|
|
15459
15473
|
padding: "6px 10px"
|
|
15460
15474
|
},
|
|
15461
15475
|
type: "button",
|
|
15462
|
-
children: formatZoomScale(zoomScale)
|
|
15476
|
+
children: formatZoomScale(zoomScale, locale)
|
|
15463
15477
|
}
|
|
15464
15478
|
),
|
|
15465
15479
|
/* @__PURE__ */ jsx4(
|
|
15466
15480
|
"button",
|
|
15467
15481
|
{
|
|
15482
|
+
"aria-label": messages.zoomIn,
|
|
15468
15483
|
disabled: !canZoomIn,
|
|
15469
15484
|
onClick: zoomIn,
|
|
15470
15485
|
style: {
|
|
@@ -15486,7 +15501,7 @@ function DefaultToolbar({ controller, palette }) {
|
|
|
15486
15501
|
canDownload ? /* @__PURE__ */ jsx4(
|
|
15487
15502
|
"button",
|
|
15488
15503
|
{
|
|
15489
|
-
"aria-label":
|
|
15504
|
+
"aria-label": messages.downloadWorkbook,
|
|
15490
15505
|
onClick: download,
|
|
15491
15506
|
style: {
|
|
15492
15507
|
alignItems: "center",
|
|
@@ -15503,7 +15518,7 @@ function DefaultToolbar({ controller, palette }) {
|
|
|
15503
15518
|
padding: 0,
|
|
15504
15519
|
width: 32
|
|
15505
15520
|
},
|
|
15506
|
-
title:
|
|
15521
|
+
title: messages.downloadWorkbook,
|
|
15507
15522
|
type: "button",
|
|
15508
15523
|
children: "\u2193"
|
|
15509
15524
|
}
|
|
@@ -15524,10 +15539,11 @@ function DefaultToolbar({ controller, palette }) {
|
|
|
15524
15539
|
children: /* @__PURE__ */ jsx4(
|
|
15525
15540
|
SegmentedControl,
|
|
15526
15541
|
{
|
|
15542
|
+
messages,
|
|
15527
15543
|
items: tabs.map((tab, index) => ({
|
|
15528
15544
|
id: String(index),
|
|
15529
15545
|
label: tab.name,
|
|
15530
|
-
title: tab.visibility === "hidden" ?
|
|
15546
|
+
title: tab.visibility === "hidden" ? formatMessage(messages.hiddenSheet, { sheet: tab.name }) : tab.visibility === "veryHidden" ? formatMessage(messages.veryHiddenSheet, { sheet: tab.name }) : tab.name,
|
|
15531
15547
|
visibility: tab.visibility
|
|
15532
15548
|
})),
|
|
15533
15549
|
onValueChange: (value) => setActiveTabIndex(Number(value)),
|
|
@@ -17982,7 +17998,9 @@ function renderOptions(props, controller, slots, owner) {
|
|
|
17982
17998
|
renderTableHeaderMenu: renderTableHeaderMenu ? (value) => slot(`table:${value.table.name}:${value.cell.row}:${value.cell.col}`, renderTableHeaderMenu(value)) : void 0
|
|
17983
17999
|
};
|
|
17984
18000
|
}
|
|
17985
|
-
function BoundViewer({ props, controller }) {
|
|
18001
|
+
function BoundViewer({ props, controller: sourceController }) {
|
|
18002
|
+
const messages = React7.useMemo(() => mergeMessages(sourceController.messages, props.messages), [sourceController.messages, props.messages]);
|
|
18003
|
+
const controller = React7.useMemo(() => ({ ...sourceController, messages }), [sourceController, messages]);
|
|
17986
18004
|
const hostRef = React7.useRef(null);
|
|
17987
18005
|
const viewerRef = React7.useRef(null);
|
|
17988
18006
|
const slots = React7.useMemo(() => new SlotStore(), []);
|