@driveflux/pdf 4.0.27 → 4.0.28
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 +58 -29
- 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 +129 -51
- 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 +2 -2
|
@@ -4,22 +4,77 @@ import { Image, Text, View } from '@react-pdf/renderer';
|
|
|
4
4
|
import { format } from 'date-fns';
|
|
5
5
|
import { colors } from '../../theme/index.js';
|
|
6
6
|
import LabelValue from './LabelValue.js';
|
|
7
|
-
|
|
7
|
+
var Confirmation = function(param) {
|
|
8
|
+
var tConfirmation = param.tConfirmation, subscription = param.subscription, signature = param.signature;
|
|
9
|
+
var _subscription_user_identification;
|
|
8
10
|
if (!signature.signature) {
|
|
9
11
|
throw new Error('Missing signature');
|
|
10
12
|
}
|
|
11
|
-
|
|
12
|
-
return
|
|
13
|
+
var border = "1px solid ".concat(colors.primary2);
|
|
14
|
+
return /*#__PURE__*/ _jsxs(View, {
|
|
15
|
+
style: {
|
|
16
|
+
borderLeft: border,
|
|
17
|
+
borderRight: border,
|
|
18
|
+
borderBottom: border
|
|
19
|
+
},
|
|
20
|
+
children: [
|
|
21
|
+
/*#__PURE__*/ _jsx(View, {
|
|
22
|
+
style: {
|
|
13
23
|
backgroundColor: colors.primary1,
|
|
14
24
|
borderTop: border,
|
|
15
|
-
padding: 8
|
|
16
|
-
},
|
|
25
|
+
padding: 8
|
|
26
|
+
},
|
|
27
|
+
children: /*#__PURE__*/ _jsx(Text, {
|
|
28
|
+
style: {
|
|
17
29
|
fontWeight: 'bold',
|
|
18
30
|
textTransform: 'uppercase',
|
|
19
|
-
letterSpacing: 1
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
|
|
31
|
+
letterSpacing: 1
|
|
32
|
+
},
|
|
33
|
+
children: tConfirmation.title
|
|
34
|
+
})
|
|
35
|
+
}),
|
|
36
|
+
/*#__PURE__*/ _jsxs(View, {
|
|
37
|
+
style: {
|
|
38
|
+
padding: 8,
|
|
39
|
+
paddingBottom: 16,
|
|
40
|
+
rowGap: 8,
|
|
41
|
+
borderTop: border
|
|
42
|
+
},
|
|
43
|
+
children: [
|
|
44
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
45
|
+
children: tConfirmation.agreementText(subscription.businessId ? 'business' : 'member')
|
|
46
|
+
}),
|
|
47
|
+
/*#__PURE__*/ _jsx(View, {
|
|
48
|
+
style: {
|
|
49
|
+
height: 160,
|
|
50
|
+
alignItems: 'flex-start'
|
|
51
|
+
},
|
|
52
|
+
children: /*#__PURE__*/ _jsx(Image, {
|
|
53
|
+
src: signature.signature || ''
|
|
54
|
+
})
|
|
55
|
+
}),
|
|
56
|
+
/*#__PURE__*/ _jsxs(View, {
|
|
57
|
+
style: {
|
|
58
|
+
rowGap: 8
|
|
59
|
+
},
|
|
60
|
+
children: [
|
|
61
|
+
/*#__PURE__*/ _jsx(LabelValue, {
|
|
62
|
+
label: tConfirmation.name,
|
|
63
|
+
value: userName(subscription.user)
|
|
64
|
+
}),
|
|
65
|
+
/*#__PURE__*/ _jsx(LabelValue, {
|
|
66
|
+
label: tConfirmation.idOrPassportNo,
|
|
67
|
+
value: (_subscription_user_identification = subscription.user.identification) === null || _subscription_user_identification === void 0 ? void 0 : _subscription_user_identification.number
|
|
68
|
+
}),
|
|
69
|
+
/*#__PURE__*/ _jsx(LabelValue, {
|
|
70
|
+
label: tConfirmation.date,
|
|
71
|
+
value: signature.signedAt ? format(signature.signedAt, 'dd-MM-yyyy hh:mm a') : undefined
|
|
72
|
+
})
|
|
73
|
+
]
|
|
74
|
+
})
|
|
75
|
+
]
|
|
76
|
+
})
|
|
77
|
+
]
|
|
78
|
+
});
|
|
23
79
|
};
|
|
24
80
|
export default Confirmation;
|
|
25
|
-
//# sourceMappingURL=Confirmation.js.map
|
|
@@ -5,24 +5,107 @@ import { format } from 'date-fns';
|
|
|
5
5
|
import { colors } from '../../theme/colors.js';
|
|
6
6
|
import CoverPageSection from './CoverPageSection.js';
|
|
7
7
|
import LabelValue from './LabelValue.js';
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
var CoverPage = function(param) {
|
|
9
|
+
var tTitle = param.tTitle, tCover = param.tCover, signedAt = param.signedAt, user = param.user, payerType = param.payerType, business = param.business;
|
|
10
|
+
var _user_identification;
|
|
11
|
+
return /*#__PURE__*/ _jsxs(View, {
|
|
12
|
+
style: {
|
|
13
|
+
flex: 1,
|
|
14
|
+
paddingVertical: 80,
|
|
15
|
+
justifyContent: 'space-between'
|
|
16
|
+
},
|
|
17
|
+
children: [
|
|
18
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
19
|
+
style: {
|
|
10
20
|
fontWeight: 'bold',
|
|
11
21
|
fontSize: 40,
|
|
12
22
|
textTransform: 'uppercase',
|
|
13
|
-
flex: 1
|
|
14
|
-
},
|
|
23
|
+
flex: 1
|
|
24
|
+
},
|
|
25
|
+
children: tTitle
|
|
26
|
+
}),
|
|
27
|
+
/*#__PURE__*/ _jsxs(View, {
|
|
28
|
+
style: {
|
|
15
29
|
padding: 16,
|
|
16
30
|
rowGap: 32,
|
|
17
|
-
border:
|
|
18
|
-
fontSize: 10
|
|
19
|
-
},
|
|
31
|
+
border: "1px solid ".concat(colors.primary2),
|
|
32
|
+
fontSize: 10
|
|
33
|
+
},
|
|
34
|
+
children: [
|
|
35
|
+
/*#__PURE__*/ _jsx(CoverPageSection, {
|
|
36
|
+
title: tCover.effectiveDate,
|
|
37
|
+
children: /*#__PURE__*/ _jsxs(View, {
|
|
38
|
+
style: {
|
|
39
|
+
flexDirection: 'row',
|
|
40
|
+
columnGap: 4
|
|
41
|
+
},
|
|
42
|
+
children: [
|
|
43
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
44
|
+
style: {
|
|
45
|
+
textDecoration: 'underline'
|
|
46
|
+
},
|
|
47
|
+
children: format(signedAt, 'do')
|
|
48
|
+
}),
|
|
49
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
50
|
+
children: tCover.of
|
|
51
|
+
}),
|
|
52
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
53
|
+
style: {
|
|
54
|
+
textDecoration: 'underline'
|
|
55
|
+
},
|
|
56
|
+
children: format(signedAt, 'MMM')
|
|
57
|
+
}),
|
|
58
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
59
|
+
children: format(signedAt, 'yyyy')
|
|
60
|
+
})
|
|
61
|
+
]
|
|
62
|
+
})
|
|
63
|
+
}),
|
|
64
|
+
/*#__PURE__*/ _jsxs(CoverPageSection, {
|
|
65
|
+
title: tCover.agreementBetween,
|
|
66
|
+
children: [
|
|
67
|
+
payerType === 'business' && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
68
|
+
children: [
|
|
69
|
+
/*#__PURE__*/ _jsx(LabelValue, {
|
|
70
|
+
label: tCover.companyName,
|
|
71
|
+
value: business === null || business === void 0 ? void 0 : business.name
|
|
72
|
+
}),
|
|
73
|
+
/*#__PURE__*/ _jsx(LabelValue, {
|
|
74
|
+
label: tCover.companyNo,
|
|
75
|
+
value: business === null || business === void 0 ? void 0 : business.registrationNumber
|
|
76
|
+
})
|
|
77
|
+
]
|
|
78
|
+
}),
|
|
79
|
+
payerType === 'user' && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
80
|
+
children: [
|
|
81
|
+
/*#__PURE__*/ _jsx(LabelValue, {
|
|
82
|
+
label: tCover.name,
|
|
83
|
+
value: userName(user)
|
|
84
|
+
}),
|
|
85
|
+
/*#__PURE__*/ _jsx(LabelValue, {
|
|
86
|
+
label: tCover.idOrPassportNo,
|
|
87
|
+
value: (_user_identification = user.identification) === null || _user_identification === void 0 ? void 0 : _user_identification.number
|
|
88
|
+
})
|
|
89
|
+
]
|
|
90
|
+
})
|
|
91
|
+
]
|
|
92
|
+
}),
|
|
93
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
94
|
+
style: {
|
|
20
95
|
fontSize: 8,
|
|
21
96
|
fontWeight: 'bold',
|
|
22
97
|
color: colors.primary3,
|
|
23
98
|
textTransform: 'uppercase',
|
|
24
|
-
letterSpacing: 1
|
|
25
|
-
},
|
|
99
|
+
letterSpacing: 1
|
|
100
|
+
},
|
|
101
|
+
children: tCover.and
|
|
102
|
+
}),
|
|
103
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
104
|
+
children: "FLUX Sdn Bhd (1264766-H)"
|
|
105
|
+
})
|
|
106
|
+
]
|
|
107
|
+
})
|
|
108
|
+
]
|
|
109
|
+
});
|
|
26
110
|
};
|
|
27
111
|
export default CoverPage;
|
|
28
|
-
//# sourceMappingURL=CoverPage.js.map
|
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Text, View } from '@react-pdf/renderer';
|
|
3
3
|
import { colors } from '../../theme/colors.js';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
var CoverPageSection = function(param) {
|
|
5
|
+
var title = param.title, children = param.children;
|
|
6
|
+
return /*#__PURE__*/ _jsxs(View, {
|
|
7
|
+
style: {
|
|
8
|
+
rowGap: 16
|
|
9
|
+
},
|
|
10
|
+
children: [
|
|
11
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
12
|
+
style: {
|
|
6
13
|
fontSize: 8,
|
|
7
14
|
fontWeight: 'bold',
|
|
8
15
|
color: colors.primary3,
|
|
9
16
|
textTransform: 'uppercase',
|
|
10
|
-
letterSpacing: 1
|
|
11
|
-
},
|
|
17
|
+
letterSpacing: 1
|
|
18
|
+
},
|
|
19
|
+
children: "".concat(title, ":")
|
|
20
|
+
}),
|
|
21
|
+
children
|
|
22
|
+
]
|
|
23
|
+
});
|
|
12
24
|
};
|
|
13
25
|
export default CoverPageSection;
|
|
14
|
-
//# sourceMappingURL=CoverPageSection.js.map
|
|
@@ -1,105 +1,184 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _object_spread(target) {
|
|
15
|
+
for(var i = 1; i < arguments.length; i++){
|
|
16
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
+
var ownKeys = Object.keys(source);
|
|
18
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
ownKeys.forEach(function(key) {
|
|
24
|
+
_define_property(target, key, source[key]);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
}
|
|
29
|
+
function ownKeys(object, enumerableOnly) {
|
|
30
|
+
var keys = Object.keys(object);
|
|
31
|
+
if (Object.getOwnPropertySymbols) {
|
|
32
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
+
if (enumerableOnly) {
|
|
34
|
+
symbols = symbols.filter(function(sym) {
|
|
35
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
keys.push.apply(keys, symbols);
|
|
39
|
+
}
|
|
40
|
+
return keys;
|
|
41
|
+
}
|
|
42
|
+
function _object_spread_props(target, source) {
|
|
43
|
+
source = source != null ? source : {};
|
|
44
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
+
} else {
|
|
47
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
1
53
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
54
|
import { userName } from '@driveflux/db/models/user';
|
|
3
55
|
import { format } from '@driveflux/time';
|
|
4
56
|
import { Text, View } from '@react-pdf/renderer';
|
|
5
57
|
import { colors } from '../../theme/index.js';
|
|
6
58
|
import LabelValue from './LabelValue.js';
|
|
7
|
-
|
|
8
|
-
|
|
59
|
+
var Details = function(param) {
|
|
60
|
+
var tDetails = param.tDetails, subscription = param.subscription;
|
|
61
|
+
var _subscription_vehicle, _subscription_vehicle1, _subscription_vehicle2, _subscription_vehicle3, _subscription_vehicle4;
|
|
62
|
+
var details = {};
|
|
9
63
|
if (subscription.payerType === 'business') {
|
|
64
|
+
var _subscription_business;
|
|
10
65
|
details.business = [
|
|
11
66
|
{
|
|
12
67
|
key: tDetails.business.name,
|
|
13
|
-
value: subscription
|
|
68
|
+
value: subscription === null || subscription === void 0 ? void 0 : subscription.businessName
|
|
14
69
|
},
|
|
15
70
|
{
|
|
16
71
|
key: tDetails.business.companyNo,
|
|
17
|
-
value: subscription
|
|
18
|
-
}
|
|
72
|
+
value: subscription === null || subscription === void 0 ? void 0 : (_subscription_business = subscription.business) === null || _subscription_business === void 0 ? void 0 : _subscription_business.registrationNumber
|
|
73
|
+
}
|
|
19
74
|
];
|
|
20
|
-
}
|
|
21
|
-
|
|
75
|
+
} else {
|
|
76
|
+
var _subscription_user_identification;
|
|
22
77
|
details.member = [
|
|
23
78
|
{
|
|
24
79
|
key: tDetails.member.name,
|
|
25
|
-
value: userName(subscription.user)
|
|
80
|
+
value: userName(subscription.user)
|
|
26
81
|
},
|
|
27
82
|
{
|
|
28
83
|
key: tDetails.member.idOrPassportNo,
|
|
29
|
-
value: subscription.user.identification
|
|
30
|
-
}
|
|
84
|
+
value: (_subscription_user_identification = subscription.user.identification) === null || _subscription_user_identification === void 0 ? void 0 : _subscription_user_identification.number
|
|
85
|
+
}
|
|
31
86
|
];
|
|
32
87
|
}
|
|
33
|
-
details = {
|
|
34
|
-
...details,
|
|
88
|
+
details = _object_spread_props(_object_spread({}, details), {
|
|
35
89
|
vehicle: [
|
|
36
90
|
{
|
|
37
91
|
key: tDetails.vehicle.make,
|
|
38
|
-
value: subscription.vehicle
|
|
92
|
+
value: (_subscription_vehicle = subscription.vehicle) === null || _subscription_vehicle === void 0 ? void 0 : _subscription_vehicle.make
|
|
39
93
|
},
|
|
40
94
|
{
|
|
41
95
|
key: tDetails.vehicle.model,
|
|
42
|
-
value:
|
|
96
|
+
value: "".concat((_subscription_vehicle1 = subscription.vehicle) === null || _subscription_vehicle1 === void 0 ? void 0 : _subscription_vehicle1.vehicleModel, " ").concat((_subscription_vehicle2 = subscription.vehicle) === null || _subscription_vehicle2 === void 0 ? void 0 : _subscription_vehicle2.variant)
|
|
43
97
|
},
|
|
44
98
|
{
|
|
45
99
|
key: tDetails.vehicle.year,
|
|
46
|
-
value: subscription.vehicle
|
|
100
|
+
value: (_subscription_vehicle3 = subscription.vehicle) === null || _subscription_vehicle3 === void 0 ? void 0 : _subscription_vehicle3.year
|
|
47
101
|
},
|
|
48
102
|
{
|
|
49
103
|
key: tDetails.vehicle.plateNo,
|
|
50
|
-
value: subscription.vehicle
|
|
51
|
-
}
|
|
104
|
+
value: (_subscription_vehicle4 = subscription.vehicle) === null || _subscription_vehicle4 === void 0 ? void 0 : _subscription_vehicle4.registrationNumber
|
|
105
|
+
}
|
|
52
106
|
],
|
|
53
107
|
subscription: [
|
|
54
108
|
{
|
|
55
109
|
key: tDetails.subscription.subscriptionPlan,
|
|
56
|
-
value: getPlanTranslation(subscription.plan)
|
|
110
|
+
value: getPlanTranslation(subscription.plan)
|
|
57
111
|
},
|
|
58
112
|
{
|
|
59
113
|
key: tDetails.subscription.mileagePackage,
|
|
60
|
-
value: getFullMileagePackageTranslation(subscription.mileagePackage)
|
|
114
|
+
value: getFullMileagePackageTranslation(subscription.mileagePackage)
|
|
61
115
|
},
|
|
62
116
|
{
|
|
63
117
|
key: tDetails.subscription.startDate,
|
|
64
|
-
value: subscription.startedAt
|
|
65
|
-
? format(subscription.startedAt, 'dd-MM-yyyy')
|
|
66
|
-
: undefined,
|
|
118
|
+
value: subscription.startedAt ? format(subscription.startedAt, 'dd-MM-yyyy') : undefined
|
|
67
119
|
},
|
|
68
120
|
{
|
|
69
121
|
key: tDetails.subscription.endDate,
|
|
70
|
-
value: subscription.endedAt
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
122
|
+
value: subscription.endedAt ? format(subscription.endedAt, 'dd-MM-yyyy') : subscription.scheduledEndAt ? format(subscription.scheduledEndAt, 'dd-MM-yyyy') : undefined
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
});
|
|
126
|
+
var border = "1px solid ".concat(colors.primary2);
|
|
127
|
+
return /*#__PURE__*/ _jsxs(View, {
|
|
128
|
+
style: {
|
|
129
|
+
borderLeft: border,
|
|
130
|
+
borderRight: border
|
|
131
|
+
},
|
|
132
|
+
children: [
|
|
133
|
+
/*#__PURE__*/ _jsx(View, {
|
|
134
|
+
style: {
|
|
80
135
|
backgroundColor: colors.primary1,
|
|
81
136
|
borderTop: border,
|
|
82
|
-
padding: 8
|
|
83
|
-
},
|
|
137
|
+
padding: 8
|
|
138
|
+
},
|
|
139
|
+
children: /*#__PURE__*/ _jsx(Text, {
|
|
140
|
+
style: {
|
|
84
141
|
fontWeight: 'bold',
|
|
85
142
|
textTransform: 'uppercase',
|
|
86
|
-
letterSpacing: 1
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
143
|
+
letterSpacing: 1
|
|
144
|
+
},
|
|
145
|
+
children: tDetails.agreement
|
|
146
|
+
})
|
|
147
|
+
}),
|
|
148
|
+
Object.keys(details).map(function(key, _i) {
|
|
149
|
+
return /*#__PURE__*/ _jsxs(View, {
|
|
150
|
+
style: {
|
|
151
|
+
padding: 8,
|
|
152
|
+
paddingBottom: 16,
|
|
153
|
+
rowGap: 8,
|
|
154
|
+
borderTop: border
|
|
155
|
+
},
|
|
156
|
+
children: [
|
|
157
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
158
|
+
style: {
|
|
159
|
+
textTransform: 'uppercase',
|
|
160
|
+
color: colors.primary2,
|
|
161
|
+
fontSize: 8,
|
|
162
|
+
letterSpacing: 1
|
|
163
|
+
},
|
|
164
|
+
children: "".concat(key, " details")
|
|
165
|
+
}),
|
|
166
|
+
details[key].map(function(line) {
|
|
167
|
+
return /*#__PURE__*/ _jsx(LabelValue, {
|
|
168
|
+
label: line.key,
|
|
169
|
+
value: line.value
|
|
170
|
+
}, line.key);
|
|
171
|
+
})
|
|
172
|
+
]
|
|
173
|
+
}, key);
|
|
174
|
+
})
|
|
175
|
+
]
|
|
176
|
+
});
|
|
98
177
|
};
|
|
99
178
|
export default Details;
|
|
100
179
|
// TODO: replace this with dump's once the package is ready
|
|
101
|
-
|
|
102
|
-
switch
|
|
180
|
+
var getPlanTranslation = function(plan, vehicleType) {
|
|
181
|
+
switch(plan){
|
|
103
182
|
case 'plan60':
|
|
104
183
|
return vehicleType === 'motorcycle' ? '60 Months' : '60 Months (Basic)';
|
|
105
184
|
case 'plan36':
|
|
@@ -116,8 +195,8 @@ const getPlanTranslation = (plan, vehicleType) => {
|
|
|
116
195
|
return 'Unknown Plan';
|
|
117
196
|
}
|
|
118
197
|
};
|
|
119
|
-
|
|
120
|
-
switch
|
|
198
|
+
var getFullMileagePackageTranslation = function(plan) {
|
|
199
|
+
switch(plan){
|
|
121
200
|
case 'lite':
|
|
122
201
|
return 'Lite - 1,250KM';
|
|
123
202
|
case 'standard':
|
|
@@ -130,4 +209,3 @@ const getFullMileagePackageTranslation = (plan) => {
|
|
|
130
209
|
return 'Unknown Mileage Package';
|
|
131
210
|
}
|
|
132
211
|
};
|
|
133
|
-
//# sourceMappingURL=Details.js.map
|
|
@@ -1,16 +1,58 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Text, View } from '@react-pdf/renderer';
|
|
3
3
|
import { colors } from '../../theme/colors.js';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
var Footer = function(param) {
|
|
5
|
+
var tComputerGenerated = param.tComputerGenerated, tPage = param.tPage, tOf = param.tOf;
|
|
6
|
+
return /*#__PURE__*/ _jsxs(View, {
|
|
7
|
+
fixed: true,
|
|
8
|
+
style: {
|
|
6
9
|
justifyContent: 'space-between',
|
|
7
10
|
flexDirection: 'row',
|
|
8
11
|
paddingTop: 16,
|
|
9
12
|
marginTop: 16,
|
|
10
|
-
borderTop:
|
|
13
|
+
borderTop: "1px solid ".concat(colors.links),
|
|
11
14
|
color: colors.primary2,
|
|
12
|
-
fontSize: 8
|
|
13
|
-
},
|
|
15
|
+
fontSize: 8
|
|
16
|
+
},
|
|
17
|
+
children: [
|
|
18
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
19
|
+
children: tComputerGenerated
|
|
20
|
+
}),
|
|
21
|
+
/*#__PURE__*/ _jsxs(View, {
|
|
22
|
+
style: {
|
|
23
|
+
flexDirection: 'row',
|
|
24
|
+
columnGap: 4
|
|
25
|
+
},
|
|
26
|
+
children: [
|
|
27
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
28
|
+
children: tPage
|
|
29
|
+
}),
|
|
30
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
31
|
+
style: {
|
|
32
|
+
fontWeight: 'bold',
|
|
33
|
+
color: colors.black
|
|
34
|
+
},
|
|
35
|
+
render: function(param) {
|
|
36
|
+
var pageNumber = param.pageNumber;
|
|
37
|
+
return "".concat(pageNumber);
|
|
38
|
+
}
|
|
39
|
+
}),
|
|
40
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
41
|
+
children: tOf
|
|
42
|
+
}),
|
|
43
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
44
|
+
style: {
|
|
45
|
+
fontWeight: 'bold',
|
|
46
|
+
color: colors.black
|
|
47
|
+
},
|
|
48
|
+
render: function(param) {
|
|
49
|
+
var totalPages = param.totalPages;
|
|
50
|
+
return "".concat(totalPages);
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
});
|
|
14
57
|
};
|
|
15
58
|
export default Footer;
|
|
16
|
-
//# sourceMappingURL=Footer.js.map
|
|
@@ -2,15 +2,45 @@ 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, userId = param.userId, subscriptionId = param.subscriptionId;
|
|
7
|
+
return /*#__PURE__*/ _jsxs(View, {
|
|
8
|
+
fixed: true,
|
|
9
|
+
style: {
|
|
7
10
|
flexDirection: 'row',
|
|
8
11
|
justifyContent: 'space-between',
|
|
9
12
|
alignItems: 'center',
|
|
10
13
|
paddingBottom: 40,
|
|
11
14
|
// to not get pushed by the content
|
|
12
|
-
minHeight: 69
|
|
13
|
-
},
|
|
15
|
+
minHeight: 69
|
|
16
|
+
},
|
|
17
|
+
children: [
|
|
18
|
+
/*#__PURE__*/ _jsx(Link, {
|
|
19
|
+
src: "https://driveflux.com",
|
|
20
|
+
children: /*#__PURE__*/ _jsx(FluxLogo, {})
|
|
21
|
+
}),
|
|
22
|
+
/*#__PURE__*/ _jsxs(View, {
|
|
23
|
+
style: {
|
|
24
|
+
rowGap: 4,
|
|
25
|
+
fontSize: 8,
|
|
26
|
+
alignItems: 'flex-end'
|
|
27
|
+
},
|
|
28
|
+
children: [
|
|
29
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
30
|
+
style: {
|
|
31
|
+
fontWeight: 'bold'
|
|
32
|
+
},
|
|
33
|
+
children: tTitle
|
|
34
|
+
}),
|
|
35
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
36
|
+
style: {
|
|
37
|
+
color: colors.primary2
|
|
38
|
+
},
|
|
39
|
+
children: "FLUX-".concat(userId, "-").concat(subscriptionId)
|
|
40
|
+
})
|
|
41
|
+
]
|
|
42
|
+
})
|
|
43
|
+
]
|
|
44
|
+
});
|
|
14
45
|
};
|
|
15
46
|
export default Header;
|
|
16
|
-
//# sourceMappingURL=Header.js.map
|
|
@@ -1,7 +1,29 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Text, View } from '@react-pdf/renderer';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
var LabelValue = function(param) {
|
|
4
|
+
var label = param.label, value = param.value;
|
|
5
|
+
return /*#__PURE__*/ _jsxs(View, {
|
|
6
|
+
style: {
|
|
7
|
+
flexDirection: 'row'
|
|
8
|
+
},
|
|
9
|
+
children: [
|
|
10
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
11
|
+
style: {
|
|
12
|
+
minWidth: 120,
|
|
13
|
+
textTransform: 'capitalize'
|
|
14
|
+
},
|
|
15
|
+
children: label
|
|
16
|
+
}),
|
|
17
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
18
|
+
children: ':'
|
|
19
|
+
}),
|
|
20
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
21
|
+
style: {
|
|
22
|
+
paddingLeft: 16
|
|
23
|
+
},
|
|
24
|
+
children: value ? "".concat(value) : '-'
|
|
25
|
+
})
|
|
26
|
+
]
|
|
27
|
+
});
|
|
5
28
|
};
|
|
6
29
|
export default LabelValue;
|
|
7
|
-
//# sourceMappingURL=LabelValue.js.map
|