@bookipi/htmlgenerator 1.0.0 → 1.0.1
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 +13 -3
- package/assets/css/invoicePreview.css +172 -0
- package/dist/index.css +392 -35
- package/dist/index.js +6 -7
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +6 -7
- package/dist/index.modern.js.map +1 -1
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -12,15 +12,25 @@ npm install --save @bookipi/htmlgenerator
|
|
|
12
12
|
|
|
13
13
|
## Usage
|
|
14
14
|
|
|
15
|
+
please link the react and react-dom first via the following steps.
|
|
16
|
+
|
|
17
|
+
1. In Your Application:
|
|
18
|
+
a) cd node_modules/react && npm link && cd ../../
|
|
19
|
+
b) cd node_modules/react-dom && npm link && cd ../../
|
|
20
|
+
|
|
21
|
+
2. In Your Library
|
|
22
|
+
a) npm link react
|
|
23
|
+
b) npm link react-dom
|
|
24
|
+
|
|
15
25
|
```jsx
|
|
16
26
|
import React, { Component } from 'react'
|
|
17
27
|
|
|
18
|
-
import
|
|
19
|
-
import '@bookipi/htmlgenerator/
|
|
28
|
+
import {Invoice} from '@bookipi/htmlgenerator'
|
|
29
|
+
import '@bookipi/htmlgenerator/assets/css/invoicePreview.css'
|
|
20
30
|
|
|
21
31
|
class Example extends Component {
|
|
22
32
|
render() {
|
|
23
|
-
return <
|
|
33
|
+
return <Invoice invoice={invoice} documentDefinitions={documentDefinitions} />
|
|
24
34
|
}
|
|
25
35
|
}
|
|
26
36
|
```
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
.invoice-preview .invoice-body {
|
|
2
|
+
background: #fff;
|
|
3
|
+
padding: 50px
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.invoice-preview .invoice-company {
|
|
7
|
+
font-size: 20px
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.invoice-preview .invoice-header {
|
|
11
|
+
margin: 0 -50px;
|
|
12
|
+
background: #f0f3f4;
|
|
13
|
+
padding: 30px 62px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.invoice-preview .invoice-date,
|
|
17
|
+
.invoice-preview .invoice-from,
|
|
18
|
+
.invoice-preview .invoice-to {
|
|
19
|
+
display: table-cell;
|
|
20
|
+
width: 1%
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.invoice-preview .invoice-from,
|
|
24
|
+
.invoice-preview .invoice-to {
|
|
25
|
+
padding-right: 20px
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.invoice-preview .invoice-date .date,
|
|
29
|
+
.invoice-preview .invoice-from strong,
|
|
30
|
+
.invoice-preview .invoice-to strong {
|
|
31
|
+
font-size: 16px;
|
|
32
|
+
font-weight: 600
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.invoice-preview .invoice-date {
|
|
36
|
+
text-align: right;
|
|
37
|
+
padding-left: 20px
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
#invoice .invoice-price {
|
|
41
|
+
/* background: #f0f3f4; */
|
|
42
|
+
display: table;
|
|
43
|
+
width: 100%
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.invoice-preview .invoice-price .invoice-price-left,
|
|
47
|
+
.invoice-preview .invoice-price .invoice-price-right {
|
|
48
|
+
display: table-cell;
|
|
49
|
+
padding: 20px;
|
|
50
|
+
padding-right: 12px;
|
|
51
|
+
padding-bottom: 16px;
|
|
52
|
+
font-size: 20px;
|
|
53
|
+
font-weight: 600;
|
|
54
|
+
width: 70%;
|
|
55
|
+
position: relative;
|
|
56
|
+
vertical-align: middle
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.invoice-preview .invoice-price .invoice-price-left .sub-price {
|
|
60
|
+
display: table-cell;
|
|
61
|
+
vertical-align: middle;
|
|
62
|
+
padding: 0 20px
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.invoice-preview .invoice-price small {
|
|
66
|
+
font-size: 12px;
|
|
67
|
+
font-weight: 400;
|
|
68
|
+
display: block
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.invoice-preview .invoice-price .invoice-price-row {
|
|
72
|
+
display: table;
|
|
73
|
+
float: left
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.invoice-preview .invoice-price .invoice-price-right {
|
|
77
|
+
width: 30%;
|
|
78
|
+
background: #2d353c;
|
|
79
|
+
color: #fff;
|
|
80
|
+
font-size: 28px;
|
|
81
|
+
text-align: right;
|
|
82
|
+
vertical-align: bottom;
|
|
83
|
+
font-weight: 300;
|
|
84
|
+
margin-right: -10px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.invoice-preview .invoice-price .invoice-price-right small {
|
|
88
|
+
display: block;
|
|
89
|
+
opacity: .7;
|
|
90
|
+
position: absolute;
|
|
91
|
+
top: 10px;
|
|
92
|
+
left: 12px;
|
|
93
|
+
font-size: 15px
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.invoice-preview .invoice-footer {
|
|
97
|
+
border-top: 1px solid #ddd;
|
|
98
|
+
padding-top: 10px;
|
|
99
|
+
font-size: 10px
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.invoice-preview .invoice-note {
|
|
103
|
+
color: #999;
|
|
104
|
+
margin-top: 80px;
|
|
105
|
+
font-size: 85%
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.invoice-preview .invoice-body > div:not(.invoice-footer) {
|
|
109
|
+
margin-bottom: 20px
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.invoice-preview .btn.btn-white, .btn.btn-white.disabled, .btn.btn-white.disabled:focus, .btn.btn-white.disabled:hover, .btn.btn-white[disabled], .btn.btn-white[disabled]:focus, .btn.btn-white[disabled]:hover {
|
|
113
|
+
color: #2d353c;
|
|
114
|
+
background: #fff;
|
|
115
|
+
border-color: #d9dfe3;
|
|
116
|
+
}
|
|
117
|
+
.invoice-preview .table-inline-block{
|
|
118
|
+
display: inline-block;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.invoice-preview #invoice-logo {
|
|
122
|
+
max-width: 100%;
|
|
123
|
+
/*max-height: 150px;*/
|
|
124
|
+
display: block
|
|
125
|
+
}
|
|
126
|
+
@media print {
|
|
127
|
+
body, page {
|
|
128
|
+
/* width: 21cm; */
|
|
129
|
+
/* margin: 0; */
|
|
130
|
+
box-shadow: 0;
|
|
131
|
+
background-color: #fff
|
|
132
|
+
}
|
|
133
|
+
/* .invoice-body {
|
|
134
|
+
padding:10;
|
|
135
|
+
} */
|
|
136
|
+
.invoice-preview {
|
|
137
|
+
width:100%
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.invoice-price .invoice-price-right {
|
|
141
|
+
background: #f0f3f4;
|
|
142
|
+
color: black;
|
|
143
|
+
border: 2px solid #f0f3f4;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.print {
|
|
147
|
+
width: 100% !important;
|
|
148
|
+
max-width: 100% !important;
|
|
149
|
+
flex: 0 0 100% !important;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
@media only screen {
|
|
154
|
+
.invoice-preview {
|
|
155
|
+
margin-top:10px;
|
|
156
|
+
max-width:28cm;
|
|
157
|
+
zoom: 0.8;
|
|
158
|
+
box-shadow: 0 0 0.5cm rgba(0,0,0,0.2);
|
|
159
|
+
/*box-shadow: 0 0 0.5cm rgba(0,0,0,0.2);*/
|
|
160
|
+
margin-right:auto;margin-left:auto;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.invoice-preview .table-small td{
|
|
165
|
+
padding: 8px 12px
|
|
166
|
+
}
|
|
167
|
+
.invoice-preview .table-invoice-header{
|
|
168
|
+
background: #f0f3f4
|
|
169
|
+
}
|
|
170
|
+
.invoice-preview h1,h2,h3,h4 {margin-top:15px}
|
|
171
|
+
.invoice-preview h1 {font-size:27px}
|
|
172
|
+
.invoice-preview h2 {font-size:22px}
|