react-pdf-levelup 2.0.33 → 3.0.34
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 +237 -47
- package/dist/index.cjs +165 -92
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +185 -111
- package/license +17 -0
- package/package.json +7 -2
package/dist/index.cjs
CHANGED
|
@@ -48,8 +48,7 @@ __export(index_exports, {
|
|
|
48
48
|
Col9: () => Col9,
|
|
49
49
|
Container: () => Container,
|
|
50
50
|
Em: () => Em,
|
|
51
|
-
Font: () =>
|
|
52
|
-
Footer: () => Footer,
|
|
51
|
+
Font: () => import_renderer10.Font,
|
|
53
52
|
H1: () => H1,
|
|
54
53
|
H2: () => H2,
|
|
55
54
|
H3: () => H3,
|
|
@@ -70,17 +69,17 @@ __export(index_exports, {
|
|
|
70
69
|
Small: () => Small,
|
|
71
70
|
Span: () => Span,
|
|
72
71
|
Strong: () => Strong,
|
|
73
|
-
StyleSheet: () =>
|
|
72
|
+
StyleSheet: () => import_renderer10.StyleSheet,
|
|
74
73
|
Table: () => Table,
|
|
75
74
|
Tbody: () => Tbody,
|
|
76
75
|
Td: () => Td,
|
|
77
|
-
Text: () =>
|
|
76
|
+
Text: () => import_renderer10.Text,
|
|
78
77
|
Th: () => Th,
|
|
79
78
|
Thead: () => Thead,
|
|
80
79
|
Tr: () => Tr,
|
|
81
80
|
U: () => U,
|
|
82
81
|
UL: () => UL,
|
|
83
|
-
View: () =>
|
|
82
|
+
View: () => import_renderer10.View,
|
|
84
83
|
decodeBase64Pdf: () => decodeBase64Pdf_default,
|
|
85
84
|
generatePDF: () => generatePDF_default
|
|
86
85
|
});
|
|
@@ -94,66 +93,160 @@ var styles = import_renderer.StyleSheet.create({
|
|
|
94
93
|
backgroundColor: "white",
|
|
95
94
|
padding: 30,
|
|
96
95
|
fontFamily: "Helvetica",
|
|
97
|
-
fontSize:
|
|
98
|
-
lineHeight: 1.5
|
|
96
|
+
fontSize: 14
|
|
99
97
|
},
|
|
100
|
-
|
|
98
|
+
footer: {
|
|
101
99
|
position: "absolute",
|
|
102
|
-
fontSize: 10,
|
|
103
|
-
top: 792 - 14,
|
|
104
100
|
left: 0,
|
|
105
101
|
right: 0,
|
|
106
|
-
textAlign: "center"
|
|
107
|
-
color: "grey"
|
|
102
|
+
textAlign: "center"
|
|
108
103
|
}
|
|
109
104
|
});
|
|
110
105
|
var LayoutPDF = ({
|
|
111
106
|
children,
|
|
112
107
|
size = "A4",
|
|
113
|
-
orientation = "
|
|
108
|
+
orientation = "vertical",
|
|
114
109
|
backgroundColor = "white",
|
|
115
|
-
showPageNumbers = true,
|
|
116
110
|
padding = 30,
|
|
117
|
-
|
|
111
|
+
margen = "normal",
|
|
112
|
+
style = {},
|
|
113
|
+
footer,
|
|
114
|
+
lines = footer ? 2 : 1
|
|
118
115
|
}) => {
|
|
116
|
+
const LINE_HEIGHT = 20;
|
|
117
|
+
const FOOTER_PADDING = 10;
|
|
118
|
+
const footerHeight = lines * LINE_HEIGHT + FOOTER_PADDING;
|
|
119
|
+
const getMargins = (margen2, pageSize) => {
|
|
120
|
+
const normalizedSize = pageSize.toUpperCase();
|
|
121
|
+
switch (margen2) {
|
|
122
|
+
case "apa":
|
|
123
|
+
if (normalizedSize === "LETTER" || normalizedSize === "LEGAL") {
|
|
124
|
+
return {
|
|
125
|
+
paddingTop: 72,
|
|
126
|
+
paddingRight: 72,
|
|
127
|
+
paddingBottom: 72,
|
|
128
|
+
paddingLeft: 72
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
paddingTop: 72,
|
|
133
|
+
paddingRight: 72,
|
|
134
|
+
paddingBottom: 72,
|
|
135
|
+
paddingLeft: 72
|
|
136
|
+
};
|
|
137
|
+
case "estrecho":
|
|
138
|
+
return {
|
|
139
|
+
paddingTop: 36,
|
|
140
|
+
paddingRight: 36,
|
|
141
|
+
paddingBottom: 36,
|
|
142
|
+
paddingLeft: 36
|
|
143
|
+
};
|
|
144
|
+
case "ancho":
|
|
145
|
+
return {
|
|
146
|
+
paddingTop: 108,
|
|
147
|
+
paddingRight: 108,
|
|
148
|
+
paddingBottom: 108,
|
|
149
|
+
paddingLeft: 108
|
|
150
|
+
};
|
|
151
|
+
case "normal":
|
|
152
|
+
default:
|
|
153
|
+
return {
|
|
154
|
+
paddingTop: padding,
|
|
155
|
+
paddingRight: padding,
|
|
156
|
+
paddingBottom: padding,
|
|
157
|
+
paddingLeft: padding
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
};
|
|
119
161
|
let safeSize = size;
|
|
120
162
|
let safeOrientation = orientation;
|
|
121
163
|
let safeBackgroundColor = backgroundColor;
|
|
122
|
-
let
|
|
164
|
+
let safeLines = Math.max(1, Math.min(lines, 10));
|
|
165
|
+
let safeMargen = margen;
|
|
123
166
|
try {
|
|
124
|
-
const validSizes = ["
|
|
167
|
+
const validSizes = ["A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "LETTER", "LEGAL", "TABLOID"];
|
|
125
168
|
if (typeof size === "string" && !validSizes.includes(size.toUpperCase())) {
|
|
126
|
-
console.warn(`
|
|
169
|
+
console.warn(`Invalid page size: ${size}. Using A4 as default.`);
|
|
127
170
|
safeSize = "A4";
|
|
128
171
|
}
|
|
129
|
-
if (orientation !== "
|
|
130
|
-
console.warn(`
|
|
131
|
-
safeOrientation = "
|
|
172
|
+
if (orientation !== "vertical" && orientation !== "horizontal") {
|
|
173
|
+
console.warn(`Invalid orientation: ${orientation}. Using vertical as default.`);
|
|
174
|
+
safeOrientation = "vertical";
|
|
132
175
|
}
|
|
133
176
|
if (typeof backgroundColor !== "string") {
|
|
134
|
-
console.warn(`
|
|
177
|
+
console.warn(`Invalid background color: ${backgroundColor}. Using white as default.`);
|
|
135
178
|
safeBackgroundColor = "white";
|
|
136
179
|
}
|
|
137
|
-
|
|
138
|
-
|
|
180
|
+
const validMargins = ["apa", "normal", "estrecho", "ancho"];
|
|
181
|
+
if (!validMargins.includes(margen)) {
|
|
182
|
+
console.warn(`Invalid margin type: ${margen}. Using normal as default.`);
|
|
183
|
+
safeMargen = "normal";
|
|
184
|
+
}
|
|
185
|
+
if (typeof lines !== "number" || lines < 1) {
|
|
186
|
+
console.warn(`Invalid lines value: ${lines}. Using 1 as default.`);
|
|
187
|
+
safeLines = 1;
|
|
139
188
|
}
|
|
140
189
|
} catch (e) {
|
|
141
|
-
console.warn("Error
|
|
190
|
+
console.warn("Error processing props in LayoutPDF:", e);
|
|
142
191
|
}
|
|
192
|
+
const transformOrientation = (orientation2) => {
|
|
193
|
+
switch (orientation2) {
|
|
194
|
+
case "vertical":
|
|
195
|
+
return "portrait";
|
|
196
|
+
case "horizontal":
|
|
197
|
+
return "landscape";
|
|
198
|
+
default:
|
|
199
|
+
console.warn(`Unrecognized orientation: ${orientation2}. Using portrait as default.`);
|
|
200
|
+
return "portrait";
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
const getFooterPosition = (pageSize, orientation2, footerHeight2) => {
|
|
204
|
+
const pageDimensions = {
|
|
205
|
+
A0: { width: 841, height: 1189 },
|
|
206
|
+
A1: { width: 594, height: 841 },
|
|
207
|
+
A2: { width: 420, height: 594 },
|
|
208
|
+
A3: { width: 297, height: 420 },
|
|
209
|
+
A4: { width: 210, height: 297 },
|
|
210
|
+
A5: { width: 148, height: 210 },
|
|
211
|
+
A6: { width: 105, height: 148 },
|
|
212
|
+
A7: { width: 74, height: 105 },
|
|
213
|
+
A8: { width: 52, height: 74 },
|
|
214
|
+
A9: { width: 37, height: 52 },
|
|
215
|
+
LETTER: { width: 216, height: 279 },
|
|
216
|
+
LEGAL: { width: 216, height: 356 },
|
|
217
|
+
TABLOID: { width: 279, height: 432 }
|
|
218
|
+
};
|
|
219
|
+
const mmToPoints = 2.834645669;
|
|
220
|
+
const dimensions = pageDimensions[pageSize.toUpperCase()];
|
|
221
|
+
if (!dimensions) {
|
|
222
|
+
return orientation2 === "landscape" ? 595 - footerHeight2 - 10 : 842 - footerHeight2 - 10;
|
|
223
|
+
}
|
|
224
|
+
const heightInPoints = dimensions.height * mmToPoints;
|
|
225
|
+
const widthInPoints = dimensions.width * mmToPoints;
|
|
226
|
+
return orientation2 === "landscape" ? widthInPoints - footerHeight2 - 10 : heightInPoints - footerHeight2 - 10;
|
|
227
|
+
};
|
|
228
|
+
const pdfOrientation = transformOrientation(safeOrientation);
|
|
229
|
+
const margins = getMargins(safeMargen, safeSize);
|
|
230
|
+
const footerTop = getFooterPosition(safeSize, pdfOrientation, footerHeight);
|
|
143
231
|
const pageStyle = {
|
|
144
232
|
...styles.page,
|
|
145
233
|
backgroundColor: safeBackgroundColor,
|
|
146
|
-
|
|
234
|
+
...margins,
|
|
235
|
+
paddingBottom: margins.paddingBottom + footerHeight,
|
|
147
236
|
...style
|
|
148
237
|
};
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
238
|
+
const footerStyle = {
|
|
239
|
+
...styles.footer,
|
|
240
|
+
top: footerTop,
|
|
241
|
+
height: footerHeight,
|
|
242
|
+
display: "flex",
|
|
243
|
+
flexDirection: "column",
|
|
244
|
+
justifyContent: "center",
|
|
245
|
+
alignItems: "center",
|
|
246
|
+
fontSize: 10,
|
|
247
|
+
color: "grey"
|
|
248
|
+
};
|
|
249
|
+
return /* @__PURE__ */ import_react.default.createElement(import_renderer.Document, null, /* @__PURE__ */ import_react.default.createElement(import_renderer.Page, { size: safeSize, orientation: pdfOrientation, style: pageStyle, wrap: true }, /* @__PURE__ */ import_react.default.createElement(import_renderer.View, { style: { paddingBottom: footerHeight } }, children), /* @__PURE__ */ import_react.default.createElement(import_renderer.View, { style: footerStyle, fixed: true }, footer, /* @__PURE__ */ import_react.default.createElement(import_renderer.Text, { style: { fontSize: footerStyle.fontSize }, render: ({ pageNumber, totalPages }) => `${pageNumber} / ${totalPages}` }))));
|
|
157
250
|
};
|
|
158
251
|
var LayoutPDF_default = LayoutPDF;
|
|
159
252
|
|
|
@@ -202,8 +295,8 @@ var import_renderer4 = require("@react-pdf/renderer");
|
|
|
202
295
|
var styles4 = import_renderer4.StyleSheet.create({
|
|
203
296
|
p: {
|
|
204
297
|
fontSize: 12,
|
|
205
|
-
marginBottom:
|
|
206
|
-
lineHeight: 1.
|
|
298
|
+
marginBottom: 5,
|
|
299
|
+
lineHeight: 1.2
|
|
207
300
|
},
|
|
208
301
|
h1: {
|
|
209
302
|
fontSize: 24,
|
|
@@ -266,6 +359,16 @@ var styles4 = import_renderer4.StyleSheet.create({
|
|
|
266
359
|
height: 1,
|
|
267
360
|
marginTop: 7,
|
|
268
361
|
marginBottom: 7
|
|
362
|
+
},
|
|
363
|
+
header: {
|
|
364
|
+
position: "absolute",
|
|
365
|
+
top: 20,
|
|
366
|
+
left: 0,
|
|
367
|
+
right: 0,
|
|
368
|
+
textAlign: "center",
|
|
369
|
+
fontSize: 10,
|
|
370
|
+
color: "#666",
|
|
371
|
+
paddingHorizontal: 40
|
|
269
372
|
}
|
|
270
373
|
});
|
|
271
374
|
var P = ({ children, style }) => {
|
|
@@ -316,6 +419,9 @@ var BR = ({ style }) => {
|
|
|
316
419
|
var Span = ({ children, style }) => {
|
|
317
420
|
return /* @__PURE__ */ import_react4.default.createElement(import_renderer4.Text, { style: [style] }, children);
|
|
318
421
|
};
|
|
422
|
+
var Header = ({ children, style, fixed = false }) => {
|
|
423
|
+
return /* @__PURE__ */ import_react4.default.createElement(import_renderer4.View, { style: [styles4.header, style], fixed }, typeof children === "string" ? /* @__PURE__ */ import_react4.default.createElement(import_renderer4.Text, null, children) : children);
|
|
424
|
+
};
|
|
319
425
|
|
|
320
426
|
// src/components/core/Tablet.tsx
|
|
321
427
|
var import_react5 = __toESM(require("react"), 1);
|
|
@@ -493,42 +599,10 @@ var Col12 = ({ children, style }) => {
|
|
|
493
599
|
return /* @__PURE__ */ import_react6.default.createElement(import_renderer6.View, { style: [styles6.col, styles6.col12, style] }, children);
|
|
494
600
|
};
|
|
495
601
|
|
|
496
|
-
// src/components/core/
|
|
602
|
+
// src/components/core/QR.tsx
|
|
497
603
|
var import_react7 = __toESM(require("react"), 1);
|
|
498
604
|
var import_renderer7 = require("@react-pdf/renderer");
|
|
499
|
-
var
|
|
500
|
-
header: {
|
|
501
|
-
position: "absolute",
|
|
502
|
-
top: 20,
|
|
503
|
-
left: 0,
|
|
504
|
-
right: 0,
|
|
505
|
-
textAlign: "center",
|
|
506
|
-
fontSize: 10,
|
|
507
|
-
color: "#666",
|
|
508
|
-
paddingHorizontal: 40
|
|
509
|
-
},
|
|
510
|
-
footer: {
|
|
511
|
-
position: "absolute",
|
|
512
|
-
bottom: 20,
|
|
513
|
-
left: 0,
|
|
514
|
-
right: 0,
|
|
515
|
-
textAlign: "center",
|
|
516
|
-
fontSize: 10,
|
|
517
|
-
color: "#666",
|
|
518
|
-
paddingHorizontal: 40
|
|
519
|
-
}
|
|
520
|
-
});
|
|
521
|
-
var Header = ({ children, style, fixed = false }) => {
|
|
522
|
-
return /* @__PURE__ */ import_react7.default.createElement(import_renderer7.View, { style: [styles7.header, style], fixed }, typeof children === "string" ? /* @__PURE__ */ import_react7.default.createElement(import_renderer7.Text, null, children) : children);
|
|
523
|
-
};
|
|
524
|
-
var Footer = ({ children, style, fixed = false }) => {
|
|
525
|
-
return /* @__PURE__ */ import_react7.default.createElement(import_renderer7.View, { style: [styles7.footer, style], fixed }, typeof children === "string" ? /* @__PURE__ */ import_react7.default.createElement(import_renderer7.Text, null, children) : children);
|
|
526
|
-
};
|
|
527
|
-
|
|
528
|
-
// src/components/core/QR.tsx
|
|
529
|
-
var import_react8 = __toESM(require("react"), 1);
|
|
530
|
-
var import_renderer8 = require("@react-pdf/renderer");
|
|
531
|
-
var import_react9 = require("react");
|
|
605
|
+
var import_react8 = require("react");
|
|
532
606
|
|
|
533
607
|
// src/components/core/QRGenerator.tsx
|
|
534
608
|
var import_qrcode = __toESM(require("qrcode"), 1);
|
|
@@ -608,7 +682,7 @@ var addLogoToQR = async (qrDataUrl, logoUrl, logoWidth, logoHeight) => {
|
|
|
608
682
|
};
|
|
609
683
|
|
|
610
684
|
// src/components/core/QR.tsx
|
|
611
|
-
var
|
|
685
|
+
var styles7 = import_renderer7.StyleSheet.create({
|
|
612
686
|
qrContainer: {
|
|
613
687
|
display: "flex",
|
|
614
688
|
alignItems: "center",
|
|
@@ -634,8 +708,8 @@ var QR = ({
|
|
|
634
708
|
logoHeight = 30,
|
|
635
709
|
errorCorrectionLevel = "M"
|
|
636
710
|
}) => {
|
|
637
|
-
const [qrDataUrl, setQrDataUrl] = (0,
|
|
638
|
-
(0,
|
|
711
|
+
const [qrDataUrl, setQrDataUrl] = (0, import_react8.useState)("");
|
|
712
|
+
(0, import_react8.useEffect)(() => {
|
|
639
713
|
const generateQR = async () => {
|
|
640
714
|
try {
|
|
641
715
|
const baseQrDataUrl = await generateQRAsBase64({
|
|
@@ -667,14 +741,14 @@ var QR = ({
|
|
|
667
741
|
const fallbackUrl = `https://api.qrserver.com/v1/create-qr-code/?data=${encodeURIComponent(
|
|
668
742
|
value
|
|
669
743
|
)}&size=${size}x${size}`;
|
|
670
|
-
return /* @__PURE__ */
|
|
744
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_renderer7.View, { style: [styles7.qrContainer, style] }, /* @__PURE__ */ import_react7.default.createElement(import_renderer7.Image, { src: qrDataUrl || fallbackUrl, style: { width: size, height: size } }));
|
|
671
745
|
};
|
|
672
746
|
var QR_default = QR;
|
|
673
747
|
|
|
674
748
|
// src/components/core/Lista.tsx
|
|
675
|
-
var
|
|
676
|
-
var
|
|
677
|
-
var
|
|
749
|
+
var import_react9 = __toESM(require("react"), 1);
|
|
750
|
+
var import_renderer8 = require("@react-pdf/renderer");
|
|
751
|
+
var styles8 = import_renderer8.StyleSheet.create({
|
|
678
752
|
ul: {
|
|
679
753
|
marginBottom: 10,
|
|
680
754
|
paddingLeft: 15
|
|
@@ -734,9 +808,9 @@ var toRoman = (num) => {
|
|
|
734
808
|
return romanNumerals[3][Math.floor(num / 1e3)] + romanNumerals[2][Math.floor(num % 1e3 / 100)] + romanNumerals[1][Math.floor(num % 100 / 10)] + romanNumerals[0][num % 10];
|
|
735
809
|
};
|
|
736
810
|
var UL = ({ children, style, type = "disc" }) => {
|
|
737
|
-
const childrenWithBullets =
|
|
738
|
-
if (
|
|
739
|
-
return
|
|
811
|
+
const childrenWithBullets = import_react9.default.Children.map(children, (child, index) => {
|
|
812
|
+
if (import_react9.default.isValidElement(child)) {
|
|
813
|
+
return import_react9.default.cloneElement(child, {
|
|
740
814
|
bulletType: type,
|
|
741
815
|
isOrdered: false,
|
|
742
816
|
index: index + 1
|
|
@@ -744,12 +818,12 @@ var UL = ({ children, style, type = "disc" }) => {
|
|
|
744
818
|
}
|
|
745
819
|
return child;
|
|
746
820
|
});
|
|
747
|
-
return /* @__PURE__ */
|
|
821
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_renderer8.View, { style: [styles8.ul, style] }, childrenWithBullets);
|
|
748
822
|
};
|
|
749
823
|
var OL = ({ children, style, type = "decimal", start = 1 }) => {
|
|
750
|
-
const childrenWithNumbers =
|
|
751
|
-
if (
|
|
752
|
-
return
|
|
824
|
+
const childrenWithNumbers = import_react9.default.Children.map(children, (child, index) => {
|
|
825
|
+
if (import_react9.default.isValidElement(child)) {
|
|
826
|
+
return import_react9.default.cloneElement(child, {
|
|
753
827
|
bulletType: type,
|
|
754
828
|
isOrdered: true,
|
|
755
829
|
index: index + 1,
|
|
@@ -758,7 +832,7 @@ var OL = ({ children, style, type = "decimal", start = 1 }) => {
|
|
|
758
832
|
}
|
|
759
833
|
return child;
|
|
760
834
|
});
|
|
761
|
-
return /* @__PURE__ */
|
|
835
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_renderer8.View, { style: [styles8.ol, style] }, childrenWithNumbers);
|
|
762
836
|
};
|
|
763
837
|
var LI = ({ children, style, bulletType = "disc", isOrdered = false, index = 1, start = 1, value }) => {
|
|
764
838
|
let marker;
|
|
@@ -768,11 +842,11 @@ var LI = ({ children, style, bulletType = "disc", isOrdered = false, index = 1,
|
|
|
768
842
|
} else {
|
|
769
843
|
marker = getBulletPoint(bulletType);
|
|
770
844
|
}
|
|
771
|
-
return /* @__PURE__ */
|
|
845
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_renderer8.View, { style: [styles8.li, style] }, /* @__PURE__ */ import_react9.default.createElement(import_renderer8.Text, { style: styles8.bulletPoint }, marker), /* @__PURE__ */ import_react9.default.createElement(import_renderer8.View, { style: styles8.itemContent }, typeof children === "string" ? /* @__PURE__ */ import_react9.default.createElement(import_renderer8.Text, null, children) : children));
|
|
772
846
|
};
|
|
773
847
|
|
|
774
848
|
// src/components/core/index.tsx
|
|
775
|
-
var
|
|
849
|
+
var import_renderer10 = require("@react-pdf/renderer");
|
|
776
850
|
|
|
777
851
|
// src/functions/decodeBase64Pdf.ts
|
|
778
852
|
var decodeBase64Pdf = (base64, fileName) => {
|
|
@@ -802,15 +876,15 @@ var decodeBase64Pdf = (base64, fileName) => {
|
|
|
802
876
|
var decodeBase64Pdf_default = decodeBase64Pdf;
|
|
803
877
|
|
|
804
878
|
// src/functions/generatePDF.ts
|
|
805
|
-
var
|
|
806
|
-
var
|
|
879
|
+
var import_renderer9 = require("@react-pdf/renderer");
|
|
880
|
+
var import_react10 = require("react");
|
|
807
881
|
var generatePDF = async ({ template: Template, data }) => {
|
|
808
882
|
try {
|
|
809
883
|
if (!Template) {
|
|
810
884
|
throw new Error("Template not provided");
|
|
811
885
|
}
|
|
812
|
-
const MyDocument = (0,
|
|
813
|
-
const stream = await (0,
|
|
886
|
+
const MyDocument = (0, import_react10.createElement)(Template, { data });
|
|
887
|
+
const stream = await (0, import_renderer9.renderToStream)(MyDocument);
|
|
814
888
|
const base64String = await new Promise((resolve, reject) => {
|
|
815
889
|
const chunks = [];
|
|
816
890
|
stream.on("data", (chunk) => chunks.push(chunk));
|
|
@@ -844,7 +918,6 @@ var generatePDF_default = generatePDF;
|
|
|
844
918
|
Container,
|
|
845
919
|
Em,
|
|
846
920
|
Font,
|
|
847
|
-
Footer,
|
|
848
921
|
H1,
|
|
849
922
|
H2,
|
|
850
923
|
H3,
|
package/dist/index.d.cts
CHANGED
|
@@ -4,11 +4,13 @@ export { Font, StyleSheet, Text, View } from '@react-pdf/renderer';
|
|
|
4
4
|
interface LayoutPDFProps {
|
|
5
5
|
children: React$1.ReactNode;
|
|
6
6
|
size?: string;
|
|
7
|
-
orientation?: "
|
|
7
|
+
orientation?: "vertical" | "horizontal";
|
|
8
8
|
backgroundColor?: string;
|
|
9
|
-
showPageNumbers?: boolean;
|
|
10
9
|
padding?: number;
|
|
10
|
+
margen?: "apa" | "normal" | "estrecho" | "ancho";
|
|
11
11
|
style?: any;
|
|
12
|
+
footer?: React$1.ReactNode;
|
|
13
|
+
lines?: number;
|
|
12
14
|
}
|
|
13
15
|
declare const LayoutPDF: React$1.FC<LayoutPDFProps>;
|
|
14
16
|
|
|
@@ -49,6 +51,12 @@ declare const BR: React$1.FC<{
|
|
|
49
51
|
style?: any;
|
|
50
52
|
}>;
|
|
51
53
|
declare const Span: React$1.FC<TextProps>;
|
|
54
|
+
interface HeaderProps {
|
|
55
|
+
children: React$1.ReactNode;
|
|
56
|
+
style?: any;
|
|
57
|
+
fixed?: boolean;
|
|
58
|
+
}
|
|
59
|
+
declare const Header: React$1.FC<HeaderProps>;
|
|
52
60
|
|
|
53
61
|
interface TableProps {
|
|
54
62
|
children: React$1.ReactNode;
|
|
@@ -101,14 +109,6 @@ declare const Col10: React$1.FC<ColProps>;
|
|
|
101
109
|
declare const Col11: React$1.FC<ColProps>;
|
|
102
110
|
declare const Col12: React$1.FC<ColProps>;
|
|
103
111
|
|
|
104
|
-
interface PageElementProps {
|
|
105
|
-
children: React$1.ReactNode;
|
|
106
|
-
style?: any;
|
|
107
|
-
fixed?: boolean;
|
|
108
|
-
}
|
|
109
|
-
declare const Header: React$1.FC<PageElementProps>;
|
|
110
|
-
declare const Footer: React$1.FC<PageElementProps>;
|
|
111
|
-
|
|
112
112
|
interface QRProps {
|
|
113
113
|
value: string;
|
|
114
114
|
size?: number;
|
|
@@ -151,4 +151,4 @@ interface PDFData {
|
|
|
151
151
|
}
|
|
152
152
|
declare const generatePDF: ({ template: Template, data }: PDFData) => Promise<string>;
|
|
153
153
|
|
|
154
|
-
export { A, BR, Blockquote, Center, Col1, Col10, Col11, Col12, Col2, Col3, Col4, Col5, Col6, Col7, Col8, Col9, Container, Em,
|
|
154
|
+
export { A, BR, Blockquote, Center, Col1, Col10, Col11, Col12, Col2, Col3, Col4, Col5, Col6, Col7, Col8, Col9, Container, Em, H1, H2, H3, H4, H5, H6, Header, Img, LI, LayoutPDF, Left, Mark, OL, P, QR, Right, Row, Small, Span, Strong, Table, Tbody, Td, Th, Thead, Tr, U, UL, decodeBase64Pdf, generatePDF };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,11 +4,13 @@ export { Font, StyleSheet, Text, View } from '@react-pdf/renderer';
|
|
|
4
4
|
interface LayoutPDFProps {
|
|
5
5
|
children: React$1.ReactNode;
|
|
6
6
|
size?: string;
|
|
7
|
-
orientation?: "
|
|
7
|
+
orientation?: "vertical" | "horizontal";
|
|
8
8
|
backgroundColor?: string;
|
|
9
|
-
showPageNumbers?: boolean;
|
|
10
9
|
padding?: number;
|
|
10
|
+
margen?: "apa" | "normal" | "estrecho" | "ancho";
|
|
11
11
|
style?: any;
|
|
12
|
+
footer?: React$1.ReactNode;
|
|
13
|
+
lines?: number;
|
|
12
14
|
}
|
|
13
15
|
declare const LayoutPDF: React$1.FC<LayoutPDFProps>;
|
|
14
16
|
|
|
@@ -49,6 +51,12 @@ declare const BR: React$1.FC<{
|
|
|
49
51
|
style?: any;
|
|
50
52
|
}>;
|
|
51
53
|
declare const Span: React$1.FC<TextProps>;
|
|
54
|
+
interface HeaderProps {
|
|
55
|
+
children: React$1.ReactNode;
|
|
56
|
+
style?: any;
|
|
57
|
+
fixed?: boolean;
|
|
58
|
+
}
|
|
59
|
+
declare const Header: React$1.FC<HeaderProps>;
|
|
52
60
|
|
|
53
61
|
interface TableProps {
|
|
54
62
|
children: React$1.ReactNode;
|
|
@@ -101,14 +109,6 @@ declare const Col10: React$1.FC<ColProps>;
|
|
|
101
109
|
declare const Col11: React$1.FC<ColProps>;
|
|
102
110
|
declare const Col12: React$1.FC<ColProps>;
|
|
103
111
|
|
|
104
|
-
interface PageElementProps {
|
|
105
|
-
children: React$1.ReactNode;
|
|
106
|
-
style?: any;
|
|
107
|
-
fixed?: boolean;
|
|
108
|
-
}
|
|
109
|
-
declare const Header: React$1.FC<PageElementProps>;
|
|
110
|
-
declare const Footer: React$1.FC<PageElementProps>;
|
|
111
|
-
|
|
112
112
|
interface QRProps {
|
|
113
113
|
value: string;
|
|
114
114
|
size?: number;
|
|
@@ -151,4 +151,4 @@ interface PDFData {
|
|
|
151
151
|
}
|
|
152
152
|
declare const generatePDF: ({ template: Template, data }: PDFData) => Promise<string>;
|
|
153
153
|
|
|
154
|
-
export { A, BR, Blockquote, Center, Col1, Col10, Col11, Col12, Col2, Col3, Col4, Col5, Col6, Col7, Col8, Col9, Container, Em,
|
|
154
|
+
export { A, BR, Blockquote, Center, Col1, Col10, Col11, Col12, Col2, Col3, Col4, Col5, Col6, Col7, Col8, Col9, Container, Em, H1, H2, H3, H4, H5, H6, Header, Img, LI, LayoutPDF, Left, Mark, OL, P, QR, Right, Row, Small, Span, Strong, Table, Tbody, Td, Th, Thead, Tr, U, UL, decodeBase64Pdf, generatePDF };
|