@extend-ai/react-xlsx 0.3.0 → 0.4.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/dist/index.cjs +17 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18536,6 +18536,12 @@ function renderFileTooLarge(fileTooLargeState, renderProps, palette) {
|
|
|
18536
18536
|
}
|
|
18537
18537
|
return defaultNode;
|
|
18538
18538
|
}
|
|
18539
|
+
function renderCustomFileTooLarge(fileTooLargeState, renderProps, palette) {
|
|
18540
|
+
if (fileTooLargeState === void 0) {
|
|
18541
|
+
return void 0;
|
|
18542
|
+
}
|
|
18543
|
+
return renderFileTooLarge(fileTooLargeState, renderProps, palette);
|
|
18544
|
+
}
|
|
18539
18545
|
function renderDefaultChartLoadingCard(rect) {
|
|
18540
18546
|
const bars = [18, 32, 24];
|
|
18541
18547
|
const barWidth = Math.max(8, Math.min(12, Math.round(rect.width * 0.018)));
|
|
@@ -22864,7 +22870,17 @@ function XlsxViewerInner({
|
|
|
22864
22870
|
toolbar
|
|
22865
22871
|
}) {
|
|
22866
22872
|
const palette = useViewerPalette(isDark);
|
|
22867
|
-
|
|
22873
|
+
const { displayFileName, error } = controller;
|
|
22874
|
+
const customFileTooLarge = error instanceof XlsxFileSizeLimitExceededError ? renderCustomFileTooLarge(
|
|
22875
|
+
fileTooLargeState,
|
|
22876
|
+
{
|
|
22877
|
+
displayFileName,
|
|
22878
|
+
fileSizeBytes: error.fileSizeBytes,
|
|
22879
|
+
maxFileSizeBytes: error.maxFileSizeBytes
|
|
22880
|
+
},
|
|
22881
|
+
palette
|
|
22882
|
+
) : void 0;
|
|
22883
|
+
return /* @__PURE__ */ jsx3(ViewerAppearanceContext.Provider, { value: { isDark }, children: /* @__PURE__ */ jsx3(ViewerContext.Provider, { value: controller, children: customFileTooLarge !== void 0 ? customFileTooLarge : /* @__PURE__ */ jsxs3(
|
|
22868
22884
|
"div",
|
|
22869
22885
|
{
|
|
22870
22886
|
className: classNames("react-xlsx-viewer", className),
|