@driveflux/pdf 4.0.40 → 4.0.41-next.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/dist/__mocks__/quotation.js +10 -11
- package/dist/__mocks__/subscription.js +379 -121
- package/dist/__mocks__/tou.js +9 -10
- package/dist/components/FluxLogo.js +62 -3
- package/dist/components/StandardPage.js +99 -10
- package/dist/debug.js +205 -26
- package/dist/index.js +0 -1
- package/dist/templates/QuotationPdf/CustomerSubscriptionSection.js +145 -27
- package/dist/templates/QuotationPdf/GFV.js +49 -12
- package/dist/templates/QuotationPdf/Header.js +63 -5
- package/dist/templates/QuotationPdf/Pricing.js +573 -201
- package/dist/templates/QuotationPdf/QuotationPdfPage.js +23 -3
- package/dist/templates/QuotationPdf/SectionBoxNew.js +34 -4
- package/dist/templates/QuotationPdf/TermsSection.js +42 -5
- package/dist/templates/QuotationPdf/VehiclePhotos.js +54 -24
- package/dist/templates/QuotationPdf/index.js +189 -10
- package/dist/templates/QuotationPdf/translations.js +34 -22
- package/dist/templates/QuotationPdf/utils.js +83 -49
- package/dist/templates/SubscriptionAgreement/Confirmation.js +65 -10
- package/dist/templates/SubscriptionAgreement/CoverPage.js +93 -10
- package/dist/templates/SubscriptionAgreement/CoverPageSection.js +16 -5
- package/dist/templates/SubscriptionAgreement/Details.js +139 -59
- package/dist/templates/SubscriptionAgreement/Footer.js +48 -6
- package/dist/templates/SubscriptionAgreement/Header.js +35 -5
- package/dist/templates/SubscriptionAgreement/LabelValue.js +25 -3
- package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.js +26 -3
- package/dist/templates/SubscriptionAgreement/TermsOfUse.js +94 -8
- package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.js +97 -11
- package/dist/templates/SubscriptionAgreement/index.js +245 -15
- package/dist/templates/SubscriptionAgreement/translations.js +195 -194
- package/dist/templates/SubscriptionAgreement/types.js +1 -2
- package/dist/templates/SubscriptionAgreement/utils.js +16 -11
- package/dist/templates/index.js +0 -1
- package/dist/theme/colors.js +44 -63
- package/dist/theme/index.js +0 -1
- package/dist/types.js +1 -2
- package/dist/utils.js +159 -16
- package/dist/watch.js +3 -4
- package/package.json +5 -5
|
@@ -2,46 +2,164 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { Text, View } from '@react-pdf/renderer';
|
|
3
3
|
import { colors } from '../../theme/colors.js';
|
|
4
4
|
import SectionBoxNew from './SectionBoxNew.js';
|
|
5
|
-
import { formatAddress, getFullMileagePackageTranslation, getSimplifiedPlanTranslation
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
import { formatAddress, getFullMileagePackageTranslation, getSimplifiedPlanTranslation } from './utils.js';
|
|
6
|
+
var CustomerSubscriptionSection = function(param) {
|
|
7
|
+
var quotation = param.quotation, t = param.t;
|
|
8
|
+
var displayContent = function(label, value) {
|
|
9
|
+
var labelColor = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : colors.black, valueColor = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : colors.primary3;
|
|
10
|
+
return /*#__PURE__*/ _jsxs(View, {
|
|
11
|
+
style: {
|
|
12
|
+
gap: 4
|
|
13
|
+
},
|
|
14
|
+
children: [
|
|
15
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
16
|
+
style: {
|
|
17
|
+
color: labelColor,
|
|
18
|
+
letterSpacing: 1
|
|
19
|
+
},
|
|
20
|
+
children: label
|
|
21
|
+
}),
|
|
22
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
23
|
+
style: {
|
|
24
|
+
color: valueColor,
|
|
25
|
+
letterSpacing: 1
|
|
26
|
+
},
|
|
27
|
+
children: value
|
|
28
|
+
})
|
|
29
|
+
]
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
return /*#__PURE__*/ _jsx(View, {
|
|
33
|
+
children: /*#__PURE__*/ _jsx(SectionBoxNew, {
|
|
34
|
+
topContent: /*#__PURE__*/ _jsxs(_Fragment, {
|
|
35
|
+
children: [
|
|
36
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
37
|
+
style: {
|
|
9
38
|
textTransform: 'uppercase',
|
|
10
39
|
fontSize: 12,
|
|
11
|
-
fontWeight: 'bold'
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
|
|
40
|
+
fontWeight: 'bold'
|
|
41
|
+
},
|
|
42
|
+
children: t.customer.title
|
|
43
|
+
}),
|
|
44
|
+
/*#__PURE__*/ _jsxs(View, {
|
|
45
|
+
style: {
|
|
46
|
+
flexDirection: 'row',
|
|
47
|
+
justifyContent: 'space-between'
|
|
48
|
+
},
|
|
49
|
+
children: [
|
|
50
|
+
displayContent(t.customer.name, quotation.customerName),
|
|
51
|
+
quotation.customer.email && displayContent(t.customer.email, quotation.customer.email)
|
|
52
|
+
]
|
|
53
|
+
}),
|
|
54
|
+
quotation.customer.address && displayContent(t.customer.address, formatAddress(quotation.customer.address))
|
|
55
|
+
]
|
|
56
|
+
}),
|
|
57
|
+
bottomContent: /*#__PURE__*/ _jsxs(_Fragment, {
|
|
58
|
+
children: [
|
|
59
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
60
|
+
style: {
|
|
15
61
|
textTransform: 'uppercase',
|
|
16
62
|
fontSize: 12,
|
|
17
|
-
fontWeight: 'bold'
|
|
18
|
-
},
|
|
63
|
+
fontWeight: 'bold'
|
|
64
|
+
},
|
|
65
|
+
children: t.subscription.title
|
|
66
|
+
}),
|
|
67
|
+
/*#__PURE__*/ _jsxs(View, {
|
|
68
|
+
style: {
|
|
19
69
|
flexDirection: 'row',
|
|
20
70
|
justifyContent: 'space-between',
|
|
21
|
-
gap: 4
|
|
22
|
-
},
|
|
71
|
+
gap: 4
|
|
72
|
+
},
|
|
73
|
+
children: [
|
|
74
|
+
displayContent(t.subscription.vehicleName, quotation.vehicleName),
|
|
75
|
+
/*#__PURE__*/ _jsxs(View, {
|
|
76
|
+
style: {
|
|
23
77
|
justifyContent: 'space-between',
|
|
24
78
|
flexDirection: 'row',
|
|
25
|
-
gap: 16
|
|
26
|
-
},
|
|
79
|
+
gap: 16
|
|
80
|
+
},
|
|
81
|
+
children: [
|
|
82
|
+
displayContent(t.subscription.plan, getSimplifiedPlanTranslation(quotation.plan)),
|
|
83
|
+
displayContent(t.subscription.mileagePackage, getFullMileagePackageTranslation(quotation.mileagePackage))
|
|
84
|
+
]
|
|
85
|
+
})
|
|
86
|
+
]
|
|
87
|
+
}),
|
|
88
|
+
/*#__PURE__*/ _jsxs(View, {
|
|
89
|
+
style: {
|
|
90
|
+
rowGap: 8
|
|
91
|
+
},
|
|
92
|
+
children: [
|
|
93
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
94
|
+
style: {
|
|
27
95
|
color: colors.primary3,
|
|
28
96
|
fontWeight: 'bold',
|
|
29
|
-
letterSpacing: 1
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
97
|
+
letterSpacing: 1
|
|
98
|
+
},
|
|
99
|
+
children: t.subIncludes.title
|
|
100
|
+
}),
|
|
101
|
+
t.subIncludes.content.map(function(line, i) {
|
|
102
|
+
return /*#__PURE__*/ _jsxs(View, {
|
|
103
|
+
style: {
|
|
104
|
+
flexDirection: 'row',
|
|
105
|
+
alignItems: 'flex-start',
|
|
106
|
+
rowGap: 8
|
|
107
|
+
},
|
|
108
|
+
children: [
|
|
109
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
110
|
+
style: {
|
|
111
|
+
marginRight: 4
|
|
112
|
+
},
|
|
113
|
+
children: "•"
|
|
114
|
+
}),
|
|
115
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
116
|
+
style: {
|
|
117
|
+
color: colors.primary3,
|
|
118
|
+
letterSpacing: 1
|
|
119
|
+
},
|
|
120
|
+
children: line
|
|
121
|
+
})
|
|
122
|
+
]
|
|
123
|
+
}, i);
|
|
124
|
+
})
|
|
125
|
+
]
|
|
126
|
+
})
|
|
127
|
+
]
|
|
128
|
+
}),
|
|
129
|
+
children: quotation.mileagePackage !== 'unlimited' && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
130
|
+
children: [
|
|
131
|
+
/*#__PURE__*/ _jsx(View, {
|
|
132
|
+
style: {
|
|
133
|
+
borderBottom: "1px solid ".concat(colors.primary2)
|
|
134
|
+
}
|
|
135
|
+
}),
|
|
136
|
+
/*#__PURE__*/ _jsxs(View, {
|
|
137
|
+
style: {
|
|
138
|
+
padding: 16,
|
|
139
|
+
rowGap: 16
|
|
140
|
+
},
|
|
141
|
+
children: [
|
|
142
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
143
|
+
style: {
|
|
37
144
|
color: colors.primary3,
|
|
38
145
|
fontWeight: 'bold',
|
|
39
|
-
letterSpacing: 1
|
|
40
|
-
},
|
|
146
|
+
letterSpacing: 1
|
|
147
|
+
},
|
|
148
|
+
children: t.subIncludes.excessMileage.title
|
|
149
|
+
}),
|
|
150
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
151
|
+
style: {
|
|
41
152
|
fontSize: '9px',
|
|
42
153
|
color: colors.primary3,
|
|
43
|
-
letterSpacing: 1
|
|
44
|
-
},
|
|
154
|
+
letterSpacing: 1
|
|
155
|
+
},
|
|
156
|
+
children: t.subIncludes.excessMileage.description(quotation.fees.excessMileageFee || 0)
|
|
157
|
+
})
|
|
158
|
+
]
|
|
159
|
+
})
|
|
160
|
+
]
|
|
161
|
+
})
|
|
162
|
+
})
|
|
163
|
+
});
|
|
45
164
|
};
|
|
46
165
|
export default CustomerSubscriptionSection;
|
|
47
|
-
//# sourceMappingURL=CustomerSubscriptionSection.js.map
|
|
@@ -2,23 +2,60 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { formatMoney } from '@driveflux/format-money';
|
|
3
3
|
import { Text, View } from '@react-pdf/renderer';
|
|
4
4
|
import { colors } from '../../theme/colors.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return
|
|
9
|
-
|
|
5
|
+
var GFV = function(param) {
|
|
6
|
+
var quotation = param.quotation, t = param.t;
|
|
7
|
+
if (!quotation.fees.gfv) return;
|
|
8
|
+
return /*#__PURE__*/ _jsxs(View, {
|
|
9
|
+
style: {
|
|
10
|
+
border: "1px solid ".concat(colors.primary2),
|
|
10
11
|
padding: 16,
|
|
11
|
-
rowGap: 16
|
|
12
|
-
},
|
|
12
|
+
rowGap: 16
|
|
13
|
+
},
|
|
14
|
+
children: [
|
|
15
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
16
|
+
style: {
|
|
13
17
|
color: colors.black,
|
|
14
18
|
fontWeight: 'bold',
|
|
15
19
|
letterSpacing: 1,
|
|
16
20
|
textTransform: 'uppercase',
|
|
17
|
-
flexWrap: 'nowrap'
|
|
18
|
-
},
|
|
21
|
+
flexWrap: 'nowrap'
|
|
22
|
+
},
|
|
23
|
+
children: t === null || t === void 0 ? void 0 : t.fees.gfv.title
|
|
24
|
+
}),
|
|
25
|
+
/*#__PURE__*/ _jsxs(View, {
|
|
26
|
+
style: {
|
|
27
|
+
display: 'flex',
|
|
28
|
+
flexDirection: 'row',
|
|
29
|
+
flexWrap: 'wrap'
|
|
30
|
+
},
|
|
31
|
+
children: [
|
|
32
|
+
/*#__PURE__*/ _jsxs(Text, {
|
|
33
|
+
style: {
|
|
19
34
|
color: colors.primary3,
|
|
20
|
-
letterSpacing: 1
|
|
21
|
-
},
|
|
35
|
+
letterSpacing: 1
|
|
36
|
+
},
|
|
37
|
+
children: [
|
|
38
|
+
"You have the option to purchase this vehicle with GFV amount of",
|
|
39
|
+
' '
|
|
40
|
+
]
|
|
41
|
+
}),
|
|
42
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
43
|
+
style: {
|
|
44
|
+
fontWeight: 'bold',
|
|
45
|
+
color: colors.primary3
|
|
46
|
+
},
|
|
47
|
+
children: formatMoney(quotation.fees.gfv)
|
|
48
|
+
}),
|
|
49
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
50
|
+
style: {
|
|
51
|
+
color: colors.primary3,
|
|
52
|
+
letterSpacing: 1
|
|
53
|
+
},
|
|
54
|
+
children: "at the end of your subscription."
|
|
55
|
+
})
|
|
56
|
+
]
|
|
57
|
+
})
|
|
58
|
+
]
|
|
59
|
+
});
|
|
22
60
|
};
|
|
23
61
|
export default GFV;
|
|
24
|
-
//# sourceMappingURL=GFV.js.map
|
|
@@ -2,12 +2,70 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Link, Text, View } from '@react-pdf/renderer';
|
|
3
3
|
import FluxLogo from '../../components/FluxLogo.js';
|
|
4
4
|
import { colors } from '../../theme/colors.js';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
var Header = function(param) {
|
|
6
|
+
var tTitle = param.tTitle, quotationId = param.quotationId, quotationDate = param.quotationDate;
|
|
7
|
+
return /*#__PURE__*/ _jsxs(View, {
|
|
8
|
+
style: {
|
|
9
|
+
gap: 24
|
|
10
|
+
},
|
|
11
|
+
children: [
|
|
12
|
+
/*#__PURE__*/ _jsx(Link, {
|
|
13
|
+
src: "https://driveflux.com",
|
|
14
|
+
children: /*#__PURE__*/ _jsx(FluxLogo, {})
|
|
15
|
+
}),
|
|
16
|
+
/*#__PURE__*/ _jsxs(View, {
|
|
17
|
+
style: {
|
|
18
|
+
gap: 4
|
|
19
|
+
},
|
|
20
|
+
children: [
|
|
21
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
22
|
+
style: {
|
|
7
23
|
fontWeight: 'bold',
|
|
8
24
|
textTransform: 'uppercase',
|
|
9
|
-
fontSize: 18
|
|
10
|
-
},
|
|
25
|
+
fontSize: 18
|
|
26
|
+
},
|
|
27
|
+
children: tTitle
|
|
28
|
+
}),
|
|
29
|
+
/*#__PURE__*/ _jsxs(View, {
|
|
30
|
+
style: {
|
|
31
|
+
justifyContent: 'space-between',
|
|
32
|
+
flexDirection: 'row'
|
|
33
|
+
},
|
|
34
|
+
children: [
|
|
35
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
36
|
+
style: {
|
|
37
|
+
color: colors.primary3,
|
|
38
|
+
fontSize: 10
|
|
39
|
+
},
|
|
40
|
+
children: quotationId
|
|
41
|
+
}),
|
|
42
|
+
/*#__PURE__*/ _jsxs(View, {
|
|
43
|
+
style: {
|
|
44
|
+
gap: 8,
|
|
45
|
+
flexDirection: 'row'
|
|
46
|
+
},
|
|
47
|
+
children: [
|
|
48
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
49
|
+
style: {
|
|
50
|
+
fontSize: 10,
|
|
51
|
+
color: colors.black
|
|
52
|
+
},
|
|
53
|
+
children: "Date"
|
|
54
|
+
}),
|
|
55
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
56
|
+
style: {
|
|
57
|
+
color: colors.primary3,
|
|
58
|
+
fontSize: 10
|
|
59
|
+
},
|
|
60
|
+
children: quotationDate
|
|
61
|
+
})
|
|
62
|
+
]
|
|
63
|
+
})
|
|
64
|
+
]
|
|
65
|
+
})
|
|
66
|
+
]
|
|
67
|
+
})
|
|
68
|
+
]
|
|
69
|
+
});
|
|
11
70
|
};
|
|
12
71
|
export default Header;
|
|
13
|
-
//# sourceMappingURL=Header.js.map
|