react-pdf-levelup 1.0.4 → 1.0.8
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 +652 -0
- package/dist/index.d.cts +123 -0
- package/dist/index.d.ts +123 -0
- package/dist/index.js +575 -0
- package/package.json +8 -2
- package/fn/aggAlias.js +0 -21
- package/fn/moveComponents.js +0 -129
- package/fn/postinstall.js +0 -66
- package/fn/upVersion.js +0 -12
- package/fn/updateTsconfig.js +0 -10
- package/next.config.mjs +0 -6
- package/public/bg-login.jpg +0 -0
- package/public/codigo_guardado.js +0 -1
- package/public/css/style.css +0 -751
- package/public/dboard/logo.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/fonts/TimesNewerRoman-Bold.otf +0 -0
- package/public/fonts/TimesNewerRoman-BoldItalic.otf +0 -0
- package/public/fonts/TimesNewerRoman-Italic.otf +0 -0
- package/public/fonts/TimesNewerRoman-Regular.otf +0 -0
- package/public/header-pdf.jpg +0 -0
- package/public/home/bgHome.jpg +0 -0
- package/public/home/bgHome2.jpg +0 -0
- package/public/home/download.jpg +0 -0
- package/public/home/undraw_elements_re_25t9.svg +0 -1
- package/public/home/undraw_project_completed_re_jr7u.svg +0 -1
- package/public/home/undraw_shared_goals_re_jvqd.svg +0 -1
- package/public/home/undraw_spread_love_re_v3cl.svg +0 -1
- package/public/home/undraw_target_re_fi8j.svg +0 -1
- package/public/home/undraw_visionary_technology_re_jfp7.svg +0 -1
- package/public/logo.png +0 -0
- package/public/marca/logo.svg +0 -1
- package/src/components/PDF/components/DocumentoTemplate.tsx +0 -140
- package/src/components/PDF/components/PDFContent.tsx +0 -192
- package/src/components/PDF/core/Etiquetas.tsx +0 -152
- package/src/components/PDF/core/Grid.tsx +0 -101
- package/src/components/PDF/core/Img.tsx +0 -22
- package/src/components/PDF/core/LayoutPDF.tsx +0 -186
- package/src/components/PDF/core/Listas.tsx +0 -10
- package/src/components/PDF/core/MakePDF.tsx +0 -50
- package/src/components/PDF/core/PageElements.tsx +0 -50
- package/src/components/PDF/core/Position.tsx +0 -33
- package/src/components/PDF/core/Tablet.tsx +0 -121
- package/src/components/PDF/core/index.tsx +0 -56
- package/src/components/PDF/lib/pdfParser.ts +0 -620
- package/src/components/PDF/services/apiService.ts +0 -17
- package/src/components/PDF/templates/AllTemplate.tsx +0 -134
- package/src/components/PDF/templates/BusinessCardTemplate.tsx +0 -139
- package/src/components/PDF/templates/CertificateTemplate.tsx +0 -31
- package/src/components/PDF/templates/HeaderFooterTemplate.tsx +0 -61
- package/src/components/PDF/templates/InvoiceTemplate.tsx +0 -53
- package/src/components/PDF/templates/ProposalTemplate.tsx +0 -246
- package/src/components/PDF/templates/ReportTemplate.tsx +0 -57
- package/src/components/PDF/templates/ResumeTemplate.tsx +0 -170
- package/src/components/PDF/templates/TablasTemplate.tsx +0 -307
- package/src/components/PDF/templates/index.ts +0 -9
- package/src/components/PDF/view/ColorPicker.tsx +0 -147
- package/src/components/PDF/view/Header.tsx +0 -102
- package/src/components/PDF/view/HomePDF.tsx +0 -177
- package/src/components/PDF/view/SettingsPanel.tsx +0 -703
- package/src/pages/AllTemplate.tsx +0 -53
- package/src/pages/Documento2.tsx +0 -45
- package/src/pages/_app.tsx +0 -6
- package/src/pages/_document.tsx +0 -13
- package/src/pages/api/generatePDF.ts +0 -74
- package/src/pages/api/hello.ts +0 -13
- package/src/pages/api/readFile.ts +0 -18
- package/src/pages/api/readTemplateFile.ts +0 -26
- package/src/pages/api/save.ts +0 -22
- package/src/pages/api/saveFile.ts +0 -20
- package/src/pages/index.tsx +0 -13
- package/src/pages/template/[template].tsx +0 -250
- package/tsconfig.json +0 -63
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import type React from "react"
|
|
2
|
-
import { View, Text, StyleSheet } from "@react-pdf/renderer"
|
|
3
|
-
|
|
4
|
-
interface TableProps {
|
|
5
|
-
children: React.ReactNode
|
|
6
|
-
style?: any
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface CellProps {
|
|
10
|
-
children?: React.ReactNode
|
|
11
|
-
style?: any
|
|
12
|
-
cellSize?: "small" | "medium" | "large"
|
|
13
|
-
width?: string | number
|
|
14
|
-
height?: string | number
|
|
15
|
-
colSpan?: number
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const styles = StyleSheet.create({
|
|
19
|
-
table: {
|
|
20
|
-
width: "100%",
|
|
21
|
-
borderWidth: 1,
|
|
22
|
-
borderColor: "#000",
|
|
23
|
-
|
|
24
|
-
overflow: "hidden",
|
|
25
|
-
marginBottom: 20,
|
|
26
|
-
},
|
|
27
|
-
thead: {
|
|
28
|
-
backgroundColor: "#f0f0f0",
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
tbody: {},
|
|
32
|
-
tr: {
|
|
33
|
-
flexDirection: "row",
|
|
34
|
-
borderBottomWidth: 1,
|
|
35
|
-
borderColor: "#000",
|
|
36
|
-
},
|
|
37
|
-
th: {
|
|
38
|
-
paddingTop: 4,
|
|
39
|
-
fontSize: 10,
|
|
40
|
-
fontFamily: "Helvetica",
|
|
41
|
-
fontWeight: "bold",
|
|
42
|
-
borderRight: 1,
|
|
43
|
-
borderColor: "#000",
|
|
44
|
-
textAlign: "center",
|
|
45
|
-
},
|
|
46
|
-
td: {
|
|
47
|
-
paddingTop: 4,
|
|
48
|
-
paddingLeft: 8,
|
|
49
|
-
paddingRight: 8,
|
|
50
|
-
fontSize: 10,
|
|
51
|
-
fontFamily: "Helvetica",
|
|
52
|
-
borderRight: 1,
|
|
53
|
-
borderColor: "#000",
|
|
54
|
-
},
|
|
55
|
-
cellSmall: {
|
|
56
|
-
width: "25%",
|
|
57
|
-
},
|
|
58
|
-
cellMedium: {
|
|
59
|
-
width: "33.33%",
|
|
60
|
-
},
|
|
61
|
-
cellLarge: {
|
|
62
|
-
width: "50%",
|
|
63
|
-
},
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
// Mapeo explícito de cellSize a su estilo correspondiente
|
|
67
|
-
const cellSizeMapping = {
|
|
68
|
-
small: styles.cellSmall,
|
|
69
|
-
medium: styles.cellMedium,
|
|
70
|
-
large: styles.cellLarge,
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const Table: React.FC<TableProps> = ({ children, style }) => {
|
|
74
|
-
return <View style={[styles.table, style]}>{children}</View>
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const Thead: React.FC<TableProps> = ({ children, style }) => {
|
|
78
|
-
return <View style={[styles.thead, style]}>{children}</View>
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const Tbody: React.FC<TableProps> = ({ children, style }) => {
|
|
82
|
-
return <View style={[styles.tbody, style]}>{children}</View>
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const Tr: React.FC<TableProps> = ({ children, style }) => {
|
|
86
|
-
return <View style={[styles.tr, style]}>{children}</View>
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const Th: React.FC<CellProps> = ({ children, style, cellSize = "medium", width, height, colSpan }) => {
|
|
90
|
-
const spanWidth = colSpan ? `${(100 / 3) * colSpan}%` : undefined
|
|
91
|
-
const sizeStyle = cellSizeMapping[cellSize]
|
|
92
|
-
|
|
93
|
-
const customStyle = {
|
|
94
|
-
width: width || spanWidth || sizeStyle?.width,
|
|
95
|
-
...(height !== undefined && { height }),
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return (
|
|
99
|
-
<View style={[styles.th, customStyle, style]}>
|
|
100
|
-
<Text>{children}</Text>
|
|
101
|
-
</View>
|
|
102
|
-
)
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const Td: React.FC<CellProps> = ({ children, style, cellSize = "medium", width, height, colSpan }) => {
|
|
106
|
-
const spanWidth = colSpan ? `${(100 / 3) * colSpan}%` : undefined
|
|
107
|
-
const sizeStyle = cellSizeMapping[cellSize]
|
|
108
|
-
|
|
109
|
-
const customStyle = {
|
|
110
|
-
width: width || spanWidth || sizeStyle?.width,
|
|
111
|
-
...(height !== undefined && { height }),
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
return (
|
|
115
|
-
<View style={[styles.td, customStyle, style]}>
|
|
116
|
-
<Text>{children}</Text>
|
|
117
|
-
</View>
|
|
118
|
-
)
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export { Table, Thead, Tbody, Tr, Th, Td }
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import LayoutPDF from "./LayoutPDF"
|
|
2
|
-
import MakePDF from "./MakePDF"
|
|
3
|
-
import Img from "./Img"
|
|
4
|
-
import { Left, Right, Center } from "./Position"
|
|
5
|
-
import { P, A, H1, H2, H3, H4, H5, H6, Strong, Em, U, Small, Blockquote, Mark, Span, BR } from "./Etiquetas"
|
|
6
|
-
import { Table, Thead, Tbody, Tr, Th, Td } from "./Tablet"
|
|
7
|
-
import { Container, Row, Col1, Col2, Col3, Col4, Col5, Col6, Col7, Col8, Col9, Col10, Col11, Col12 } from "./Grid"
|
|
8
|
-
import { Header, Footer } from "./PageElements"
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
LayoutPDF,
|
|
12
|
-
MakePDF,
|
|
13
|
-
Img,
|
|
14
|
-
Left,
|
|
15
|
-
Right,
|
|
16
|
-
Center,
|
|
17
|
-
P,
|
|
18
|
-
A,
|
|
19
|
-
H1,
|
|
20
|
-
H2,
|
|
21
|
-
H3,
|
|
22
|
-
H4,
|
|
23
|
-
H5,
|
|
24
|
-
H6,
|
|
25
|
-
Strong,
|
|
26
|
-
Em,
|
|
27
|
-
U,
|
|
28
|
-
Small,
|
|
29
|
-
Blockquote,
|
|
30
|
-
Mark,
|
|
31
|
-
Span,
|
|
32
|
-
BR,
|
|
33
|
-
Table,
|
|
34
|
-
Thead,
|
|
35
|
-
Tbody,
|
|
36
|
-
Tr,
|
|
37
|
-
Th,
|
|
38
|
-
Td,
|
|
39
|
-
Container,
|
|
40
|
-
Row,
|
|
41
|
-
Col1,
|
|
42
|
-
Col2,
|
|
43
|
-
Col3,
|
|
44
|
-
Col4,
|
|
45
|
-
Col5,
|
|
46
|
-
Col6,
|
|
47
|
-
Col7,
|
|
48
|
-
Col8,
|
|
49
|
-
Col9,
|
|
50
|
-
Col10,
|
|
51
|
-
Col11,
|
|
52
|
-
Col12,
|
|
53
|
-
Header,
|
|
54
|
-
Footer,
|
|
55
|
-
}
|
|
56
|
-
|