react-pdf-levelup 2.0.14 → 2.0.17
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.mts +149 -0
- package/dist/index.d.ts +69 -60
- package/dist/index.js +257 -96
- package/dist/{index.cjs → index.mjs} +170 -181
- package/package.json +6 -5
- package/dist/index.d.cts +0 -140
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import React$1 from 'react';
|
|
2
|
+
export { Text, View } from '@react-pdf/renderer';
|
|
3
|
+
|
|
4
|
+
interface LayoutPDFProps {
|
|
5
|
+
children: React$1.ReactNode;
|
|
6
|
+
size?: string;
|
|
7
|
+
orientation?: "portrait" | "landscape";
|
|
8
|
+
backgroundColor?: string;
|
|
9
|
+
showPageNumbers?: boolean;
|
|
10
|
+
padding?: number;
|
|
11
|
+
style?: any;
|
|
12
|
+
}
|
|
13
|
+
declare const LayoutPDF: React$1.FC<LayoutPDFProps>;
|
|
14
|
+
|
|
15
|
+
interface ImgProps {
|
|
16
|
+
src?: string;
|
|
17
|
+
style?: any;
|
|
18
|
+
}
|
|
19
|
+
declare const Img: React$1.FC<ImgProps>;
|
|
20
|
+
|
|
21
|
+
interface PositionProps {
|
|
22
|
+
children: React$1.ReactNode;
|
|
23
|
+
style?: any;
|
|
24
|
+
}
|
|
25
|
+
declare const Left: React$1.FC<PositionProps>;
|
|
26
|
+
declare const Right: React$1.FC<PositionProps>;
|
|
27
|
+
declare const Center: React$1.FC<PositionProps>;
|
|
28
|
+
|
|
29
|
+
interface TextProps {
|
|
30
|
+
children: React$1.ReactNode;
|
|
31
|
+
style?: any;
|
|
32
|
+
href?: string;
|
|
33
|
+
}
|
|
34
|
+
declare const P: React$1.FC<TextProps>;
|
|
35
|
+
declare const H1: React$1.FC<TextProps>;
|
|
36
|
+
declare const H2: React$1.FC<TextProps>;
|
|
37
|
+
declare const H3: React$1.FC<TextProps>;
|
|
38
|
+
declare const H4: React$1.FC<TextProps>;
|
|
39
|
+
declare const H5: React$1.FC<TextProps>;
|
|
40
|
+
declare const H6: React$1.FC<TextProps>;
|
|
41
|
+
declare const Strong: React$1.FC<TextProps>;
|
|
42
|
+
declare const Em: React$1.FC<TextProps>;
|
|
43
|
+
declare const U: React$1.FC<TextProps>;
|
|
44
|
+
declare const Small: React$1.FC<TextProps>;
|
|
45
|
+
declare const Blockquote: React$1.FC<TextProps>;
|
|
46
|
+
declare const Mark: React$1.FC<TextProps>;
|
|
47
|
+
declare const A: React$1.FC<TextProps>;
|
|
48
|
+
declare const BR: React$1.FC<{
|
|
49
|
+
style?: any;
|
|
50
|
+
}>;
|
|
51
|
+
declare const Span: React$1.FC<TextProps>;
|
|
52
|
+
|
|
53
|
+
interface TableProps {
|
|
54
|
+
children: React$1.ReactNode;
|
|
55
|
+
style?: any;
|
|
56
|
+
}
|
|
57
|
+
interface CellProps {
|
|
58
|
+
children?: React$1.ReactNode;
|
|
59
|
+
style?: any;
|
|
60
|
+
cellSize?: "small" | "medium" | "large";
|
|
61
|
+
width?: string | number;
|
|
62
|
+
height?: string | number;
|
|
63
|
+
colSpan?: number;
|
|
64
|
+
}
|
|
65
|
+
declare const Table: React$1.FC<TableProps>;
|
|
66
|
+
declare const Thead: React$1.FC<TableProps>;
|
|
67
|
+
declare const Tbody: React$1.FC<TableProps>;
|
|
68
|
+
declare const Tr: React$1.FC<TableProps>;
|
|
69
|
+
declare const Th: React$1.FC<CellProps>;
|
|
70
|
+
declare const Td: React$1.FC<CellProps>;
|
|
71
|
+
|
|
72
|
+
interface ContainerProps {
|
|
73
|
+
children: React$1.ReactNode;
|
|
74
|
+
style?: any;
|
|
75
|
+
}
|
|
76
|
+
interface RowProps {
|
|
77
|
+
children: React$1.ReactNode;
|
|
78
|
+
style?: any;
|
|
79
|
+
}
|
|
80
|
+
interface ColProps {
|
|
81
|
+
children: React$1.ReactNode;
|
|
82
|
+
style?: any;
|
|
83
|
+
}
|
|
84
|
+
declare const Container: React$1.FC<ContainerProps>;
|
|
85
|
+
declare const Row: React$1.FC<RowProps>;
|
|
86
|
+
declare const Col1: React$1.FC<ColProps>;
|
|
87
|
+
declare const Col2: React$1.FC<ColProps>;
|
|
88
|
+
declare const Col3: React$1.FC<ColProps>;
|
|
89
|
+
declare const Col4: React$1.FC<ColProps>;
|
|
90
|
+
declare const Col5: React$1.FC<ColProps>;
|
|
91
|
+
declare const Col6: React$1.FC<ColProps>;
|
|
92
|
+
declare const Col7: React$1.FC<ColProps>;
|
|
93
|
+
declare const Col8: React$1.FC<ColProps>;
|
|
94
|
+
declare const Col9: React$1.FC<ColProps>;
|
|
95
|
+
declare const Col10: React$1.FC<ColProps>;
|
|
96
|
+
declare const Col11: React$1.FC<ColProps>;
|
|
97
|
+
declare const Col12: React$1.FC<ColProps>;
|
|
98
|
+
|
|
99
|
+
interface PageElementProps {
|
|
100
|
+
children: React$1.ReactNode;
|
|
101
|
+
style?: any;
|
|
102
|
+
fixed?: boolean;
|
|
103
|
+
}
|
|
104
|
+
declare const Header: React$1.FC<PageElementProps>;
|
|
105
|
+
declare const Footer: React$1.FC<PageElementProps>;
|
|
106
|
+
|
|
107
|
+
interface QRProps {
|
|
108
|
+
value: string;
|
|
109
|
+
size?: number;
|
|
110
|
+
style?: any;
|
|
111
|
+
colorDark?: string;
|
|
112
|
+
colorLight?: string;
|
|
113
|
+
margin?: number;
|
|
114
|
+
logo?: string;
|
|
115
|
+
logoWidth?: number;
|
|
116
|
+
logoHeight?: number;
|
|
117
|
+
errorCorrectionLevel?: "L" | "M" | "Q" | "H";
|
|
118
|
+
}
|
|
119
|
+
declare const QR: React$1.FC<QRProps>;
|
|
120
|
+
|
|
121
|
+
interface ListProps {
|
|
122
|
+
children: React$1.ReactNode;
|
|
123
|
+
style?: any;
|
|
124
|
+
start?: number;
|
|
125
|
+
type?: "disc" | "circle" | "square" | "decimal" | "lower-alpha" | "upper-alpha" | "lower-roman" | "upper-roman";
|
|
126
|
+
}
|
|
127
|
+
interface ListItemProps {
|
|
128
|
+
children: React$1.ReactNode;
|
|
129
|
+
style?: any;
|
|
130
|
+
value?: number | string;
|
|
131
|
+
}
|
|
132
|
+
declare const UL: React$1.FC<ListProps>;
|
|
133
|
+
declare const OL: React$1.FC<ListProps>;
|
|
134
|
+
declare const LI: React$1.FC<ListItemProps & {
|
|
135
|
+
bulletType?: string;
|
|
136
|
+
isOrdered?: boolean;
|
|
137
|
+
index?: number;
|
|
138
|
+
start?: number;
|
|
139
|
+
}>;
|
|
140
|
+
|
|
141
|
+
declare const decodeBase64Pdf: (base64: string, fileName: string) => void;
|
|
142
|
+
|
|
143
|
+
interface PDFData {
|
|
144
|
+
template: React.ElementType;
|
|
145
|
+
data?: any;
|
|
146
|
+
}
|
|
147
|
+
declare const generatePDF: ({ template: Template, data }: PDFData) => Promise<string>;
|
|
148
|
+
|
|
149
|
+
export { A, BR, Blockquote, Center, Col1, Col10, Col11, Col12, Col2, Col3, Col4, Col5, Col6, Col7, Col8, Col9, Container, Em, Footer, 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
|
@@ -1,107 +1,108 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React$1 from 'react';
|
|
2
2
|
export { Text, View } from '@react-pdf/renderer';
|
|
3
3
|
|
|
4
4
|
interface LayoutPDFProps {
|
|
5
|
-
children: React.ReactNode;
|
|
5
|
+
children: React$1.ReactNode;
|
|
6
6
|
size?: string;
|
|
7
7
|
orientation?: "portrait" | "landscape";
|
|
8
8
|
backgroundColor?: string;
|
|
9
9
|
showPageNumbers?: boolean;
|
|
10
|
+
padding?: number;
|
|
10
11
|
style?: any;
|
|
11
12
|
}
|
|
12
|
-
declare const LayoutPDF: React.FC<LayoutPDFProps>;
|
|
13
|
+
declare const LayoutPDF: React$1.FC<LayoutPDFProps>;
|
|
13
14
|
|
|
14
15
|
interface ImgProps {
|
|
15
16
|
src?: string;
|
|
16
17
|
style?: any;
|
|
17
18
|
}
|
|
18
|
-
declare const Img: React.FC<ImgProps>;
|
|
19
|
+
declare const Img: React$1.FC<ImgProps>;
|
|
19
20
|
|
|
20
21
|
interface PositionProps {
|
|
21
|
-
children: React.ReactNode;
|
|
22
|
+
children: React$1.ReactNode;
|
|
22
23
|
style?: any;
|
|
23
24
|
}
|
|
24
|
-
declare const Left: React.FC<PositionProps>;
|
|
25
|
-
declare const Right: React.FC<PositionProps>;
|
|
26
|
-
declare const Center: React.FC<PositionProps>;
|
|
25
|
+
declare const Left: React$1.FC<PositionProps>;
|
|
26
|
+
declare const Right: React$1.FC<PositionProps>;
|
|
27
|
+
declare const Center: React$1.FC<PositionProps>;
|
|
27
28
|
|
|
28
29
|
interface TextProps {
|
|
29
|
-
children: React.ReactNode;
|
|
30
|
+
children: React$1.ReactNode;
|
|
30
31
|
style?: any;
|
|
31
32
|
href?: string;
|
|
32
33
|
}
|
|
33
|
-
declare const P: React.FC<TextProps>;
|
|
34
|
-
declare const H1: React.FC<TextProps>;
|
|
35
|
-
declare const H2: React.FC<TextProps>;
|
|
36
|
-
declare const H3: React.FC<TextProps>;
|
|
37
|
-
declare const H4: React.FC<TextProps>;
|
|
38
|
-
declare const H5: React.FC<TextProps>;
|
|
39
|
-
declare const H6: React.FC<TextProps>;
|
|
40
|
-
declare const Strong: React.FC<TextProps>;
|
|
41
|
-
declare const Em: React.FC<TextProps>;
|
|
42
|
-
declare const U: React.FC<TextProps>;
|
|
43
|
-
declare const Small: React.FC<TextProps>;
|
|
44
|
-
declare const Blockquote: React.FC<TextProps>;
|
|
45
|
-
declare const Mark: React.FC<TextProps>;
|
|
46
|
-
declare const A: React.FC<TextProps>;
|
|
47
|
-
declare const BR: React.FC<{
|
|
34
|
+
declare const P: React$1.FC<TextProps>;
|
|
35
|
+
declare const H1: React$1.FC<TextProps>;
|
|
36
|
+
declare const H2: React$1.FC<TextProps>;
|
|
37
|
+
declare const H3: React$1.FC<TextProps>;
|
|
38
|
+
declare const H4: React$1.FC<TextProps>;
|
|
39
|
+
declare const H5: React$1.FC<TextProps>;
|
|
40
|
+
declare const H6: React$1.FC<TextProps>;
|
|
41
|
+
declare const Strong: React$1.FC<TextProps>;
|
|
42
|
+
declare const Em: React$1.FC<TextProps>;
|
|
43
|
+
declare const U: React$1.FC<TextProps>;
|
|
44
|
+
declare const Small: React$1.FC<TextProps>;
|
|
45
|
+
declare const Blockquote: React$1.FC<TextProps>;
|
|
46
|
+
declare const Mark: React$1.FC<TextProps>;
|
|
47
|
+
declare const A: React$1.FC<TextProps>;
|
|
48
|
+
declare const BR: React$1.FC<{
|
|
48
49
|
style?: any;
|
|
49
50
|
}>;
|
|
50
|
-
declare const Span: React.FC<TextProps>;
|
|
51
|
+
declare const Span: React$1.FC<TextProps>;
|
|
51
52
|
|
|
52
53
|
interface TableProps {
|
|
53
|
-
children: React.ReactNode;
|
|
54
|
+
children: React$1.ReactNode;
|
|
54
55
|
style?: any;
|
|
55
56
|
}
|
|
56
57
|
interface CellProps {
|
|
57
|
-
children?: React.ReactNode;
|
|
58
|
+
children?: React$1.ReactNode;
|
|
58
59
|
style?: any;
|
|
59
60
|
cellSize?: "small" | "medium" | "large";
|
|
60
61
|
width?: string | number;
|
|
61
62
|
height?: string | number;
|
|
62
63
|
colSpan?: number;
|
|
63
64
|
}
|
|
64
|
-
declare const Table: React.FC<TableProps>;
|
|
65
|
-
declare const Thead: React.FC<TableProps>;
|
|
66
|
-
declare const Tbody: React.FC<TableProps>;
|
|
67
|
-
declare const Tr: React.FC<TableProps>;
|
|
68
|
-
declare const Th: React.FC<CellProps>;
|
|
69
|
-
declare const Td: React.FC<CellProps>;
|
|
65
|
+
declare const Table: React$1.FC<TableProps>;
|
|
66
|
+
declare const Thead: React$1.FC<TableProps>;
|
|
67
|
+
declare const Tbody: React$1.FC<TableProps>;
|
|
68
|
+
declare const Tr: React$1.FC<TableProps>;
|
|
69
|
+
declare const Th: React$1.FC<CellProps>;
|
|
70
|
+
declare const Td: React$1.FC<CellProps>;
|
|
70
71
|
|
|
71
72
|
interface ContainerProps {
|
|
72
|
-
children: React.ReactNode;
|
|
73
|
+
children: React$1.ReactNode;
|
|
73
74
|
style?: any;
|
|
74
75
|
}
|
|
75
76
|
interface RowProps {
|
|
76
|
-
children: React.ReactNode;
|
|
77
|
+
children: React$1.ReactNode;
|
|
77
78
|
style?: any;
|
|
78
79
|
}
|
|
79
80
|
interface ColProps {
|
|
80
|
-
children: React.ReactNode;
|
|
81
|
+
children: React$1.ReactNode;
|
|
81
82
|
style?: any;
|
|
82
83
|
}
|
|
83
|
-
declare const Container: React.FC<ContainerProps>;
|
|
84
|
-
declare const Row: React.FC<RowProps>;
|
|
85
|
-
declare const Col1: React.FC<ColProps>;
|
|
86
|
-
declare const Col2: React.FC<ColProps>;
|
|
87
|
-
declare const Col3: React.FC<ColProps>;
|
|
88
|
-
declare const Col4: React.FC<ColProps>;
|
|
89
|
-
declare const Col5: React.FC<ColProps>;
|
|
90
|
-
declare const Col6: React.FC<ColProps>;
|
|
91
|
-
declare const Col7: React.FC<ColProps>;
|
|
92
|
-
declare const Col8: React.FC<ColProps>;
|
|
93
|
-
declare const Col9: React.FC<ColProps>;
|
|
94
|
-
declare const Col10: React.FC<ColProps>;
|
|
95
|
-
declare const Col11: React.FC<ColProps>;
|
|
96
|
-
declare const Col12: React.FC<ColProps>;
|
|
84
|
+
declare const Container: React$1.FC<ContainerProps>;
|
|
85
|
+
declare const Row: React$1.FC<RowProps>;
|
|
86
|
+
declare const Col1: React$1.FC<ColProps>;
|
|
87
|
+
declare const Col2: React$1.FC<ColProps>;
|
|
88
|
+
declare const Col3: React$1.FC<ColProps>;
|
|
89
|
+
declare const Col4: React$1.FC<ColProps>;
|
|
90
|
+
declare const Col5: React$1.FC<ColProps>;
|
|
91
|
+
declare const Col6: React$1.FC<ColProps>;
|
|
92
|
+
declare const Col7: React$1.FC<ColProps>;
|
|
93
|
+
declare const Col8: React$1.FC<ColProps>;
|
|
94
|
+
declare const Col9: React$1.FC<ColProps>;
|
|
95
|
+
declare const Col10: React$1.FC<ColProps>;
|
|
96
|
+
declare const Col11: React$1.FC<ColProps>;
|
|
97
|
+
declare const Col12: React$1.FC<ColProps>;
|
|
97
98
|
|
|
98
99
|
interface PageElementProps {
|
|
99
|
-
children: React.ReactNode;
|
|
100
|
+
children: React$1.ReactNode;
|
|
100
101
|
style?: any;
|
|
101
102
|
fixed?: boolean;
|
|
102
103
|
}
|
|
103
|
-
declare const Header: React.FC<PageElementProps>;
|
|
104
|
-
declare const Footer: React.FC<PageElementProps>;
|
|
104
|
+
declare const Header: React$1.FC<PageElementProps>;
|
|
105
|
+
declare const Footer: React$1.FC<PageElementProps>;
|
|
105
106
|
|
|
106
107
|
interface QRProps {
|
|
107
108
|
value: string;
|
|
@@ -115,26 +116,34 @@ interface QRProps {
|
|
|
115
116
|
logoHeight?: number;
|
|
116
117
|
errorCorrectionLevel?: "L" | "M" | "Q" | "H";
|
|
117
118
|
}
|
|
118
|
-
declare const QR: React.FC<QRProps>;
|
|
119
|
+
declare const QR: React$1.FC<QRProps>;
|
|
119
120
|
|
|
120
121
|
interface ListProps {
|
|
121
|
-
children: React.ReactNode;
|
|
122
|
+
children: React$1.ReactNode;
|
|
122
123
|
style?: any;
|
|
123
124
|
start?: number;
|
|
124
125
|
type?: "disc" | "circle" | "square" | "decimal" | "lower-alpha" | "upper-alpha" | "lower-roman" | "upper-roman";
|
|
125
126
|
}
|
|
126
127
|
interface ListItemProps {
|
|
127
|
-
children: React.ReactNode;
|
|
128
|
+
children: React$1.ReactNode;
|
|
128
129
|
style?: any;
|
|
129
130
|
value?: number | string;
|
|
130
131
|
}
|
|
131
|
-
declare const UL: React.FC<ListProps>;
|
|
132
|
-
declare const OL: React.FC<ListProps>;
|
|
133
|
-
declare const LI: React.FC<ListItemProps & {
|
|
132
|
+
declare const UL: React$1.FC<ListProps>;
|
|
133
|
+
declare const OL: React$1.FC<ListProps>;
|
|
134
|
+
declare const LI: React$1.FC<ListItemProps & {
|
|
134
135
|
bulletType?: string;
|
|
135
136
|
isOrdered?: boolean;
|
|
136
137
|
index?: number;
|
|
137
138
|
start?: number;
|
|
138
139
|
}>;
|
|
139
140
|
|
|
140
|
-
|
|
141
|
+
declare const decodeBase64Pdf: (base64: string, fileName: string) => void;
|
|
142
|
+
|
|
143
|
+
interface PDFData {
|
|
144
|
+
template: React.ElementType;
|
|
145
|
+
data?: any;
|
|
146
|
+
}
|
|
147
|
+
declare const generatePDF: ({ template: Template, data }: PDFData) => Promise<string>;
|
|
148
|
+
|
|
149
|
+
export { A, BR, Blockquote, Center, Col1, Col10, Col11, Col12, Col2, Col3, Col4, Col5, Col6, Col7, Col8, Col9, Container, Em, Footer, 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 };
|