@pipelinesolucoes/display 1.0.8 → 1.0.9
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.d.ts +0 -2
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -4
- package/dist/components/VisualizadorPdfBase.d.ts +0 -14
- package/dist/components/VisualizadorPdfBase.js +0 -41
- package/dist/components/VisualizadorPdfBase.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipelinesolucoes/display",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/pipeline-solucoes/display.git"
|
|
@@ -58,8 +58,6 @@
|
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@pipelinesolucoes/theme": "^1.0.9",
|
|
61
|
-
"framer-motion": "^12.38.0"
|
|
62
|
-
"pdfjs-dist": "^5.7.284",
|
|
63
|
-
"react-pdf": "^10.4.1"
|
|
61
|
+
"framer-motion": "^12.38.0"
|
|
64
62
|
}
|
|
65
63
|
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const AnteriorIcon: import("@emotion/styled").StyledComponent<import("@mui/material").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").SVGProps<SVGSVGElement>, "style" | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "className" | "classes" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
2
|
-
iconColor?: string;
|
|
3
|
-
}, {}, {}>;
|
|
4
|
-
export declare const ProximoIcon: import("@emotion/styled").StyledComponent<import("@mui/material").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").SVGProps<SVGSVGElement>, "style" | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "className" | "classes" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
5
|
-
iconColor?: string;
|
|
6
|
-
}, {}, {}>;
|
|
7
|
-
export type VisualizadorPdfBaseProps = {
|
|
8
|
-
fileUrl: string;
|
|
9
|
-
width?: string;
|
|
10
|
-
height?: string;
|
|
11
|
-
iconColor?: string;
|
|
12
|
-
scale?: number;
|
|
13
|
-
};
|
|
14
|
-
export declare function VisualizadorPdfBase({ fileUrl, width, height, iconColor, scale, }: VisualizadorPdfBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { Box, IconButton, Stack, styled, Typography, useTheme } from "@mui/material";
|
|
5
|
-
import { Document, Page, pdfjs } from "react-pdf";
|
|
6
|
-
import ArrowCircleLeftIcon from "@mui/icons-material/ArrowCircleLeft";
|
|
7
|
-
import ArrowCircleRightIcon from "@mui/icons-material/ArrowCircleRight";
|
|
8
|
-
if (typeof window !== "undefined") {
|
|
9
|
-
pdfjs.GlobalWorkerOptions.workerSrc = "/pdf.worker.min.mjs";
|
|
10
|
-
}
|
|
11
|
-
export const AnteriorIcon = styled(ArrowCircleLeftIcon, {
|
|
12
|
-
shouldForwardProp: (prop) => prop !== "iconColor",
|
|
13
|
-
})(({ iconColor }) => ({
|
|
14
|
-
color: iconColor,
|
|
15
|
-
fontSize: "24px",
|
|
16
|
-
}));
|
|
17
|
-
export const ProximoIcon = styled(ArrowCircleRightIcon, {
|
|
18
|
-
shouldForwardProp: (prop) => prop !== "iconColor",
|
|
19
|
-
})(({ iconColor }) => ({
|
|
20
|
-
color: iconColor,
|
|
21
|
-
fontSize: "24px",
|
|
22
|
-
}));
|
|
23
|
-
export function VisualizadorPdfBase({ fileUrl, width = "100%", height = "480px", iconColor = "black", scale = 1.5, }) {
|
|
24
|
-
const theme = useTheme();
|
|
25
|
-
const [numPages, setNumPages] = useState(0);
|
|
26
|
-
const [pageNumber, setPageNumber] = useState(1);
|
|
27
|
-
return (_jsxs(Box, { sx: {
|
|
28
|
-
width,
|
|
29
|
-
height,
|
|
30
|
-
}, children: [_jsxs(Stack, { direction: "row", spacing: "16px", alignItems: "center", justifyContent: "center", padding: "16px", width: "100%", children: [_jsx(IconButton, { "aria-label": "botao anterior", disabled: pageNumber <= 1, onClick: () => setPageNumber((prev) => Math.max(prev - 1, 1)), children: _jsx(AnteriorIcon, { iconColor: iconColor }) }), _jsxs(Typography, { variant: "caption", color: theme.palette.text.primary, children: ["P\u00E1gina ", pageNumber, " de ", numPages || "..."] }), _jsx(IconButton, { "aria-label": "botao proximo", disabled: !numPages || pageNumber >= numPages, onClick: () => setPageNumber((prev) => Math.min(prev + 1, numPages)), children: _jsx(ProximoIcon, { iconColor: iconColor }) })] }), _jsx(Box, { sx: {
|
|
31
|
-
display: "flex",
|
|
32
|
-
justifyContent: "center",
|
|
33
|
-
overflow: "auto",
|
|
34
|
-
height: `calc(${height} - 64px)`,
|
|
35
|
-
width: "100%",
|
|
36
|
-
}, children: _jsx(Document, { file: fileUrl, onLoadSuccess: ({ numPages }) => {
|
|
37
|
-
setNumPages(numPages);
|
|
38
|
-
setPageNumber(1);
|
|
39
|
-
}, loading: _jsx(Typography, { children: "Carregando documento..." }), error: _jsx(Typography, { children: "N\u00E3o foi poss\u00EDvel carregar o documento." }), children: _jsx(Page, { pageNumber: pageNumber, renderTextLayer: false, renderAnnotationLayer: false, scale: scale }) }) })] }));
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=VisualizadorPdfBase.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VisualizadorPdfBase.js","sourceRoot":"","sources":["../../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