@driveflux/pdf 1.7.1 → 2.0.0
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.d.ts +2 -0
- package/dist/__mocks__/subscription.d.ts.map +1 -1
- package/dist/__mocks__/subscription.js +408 -140
- package/dist/__mocks__/subscription.js.map +1 -1
- package/dist/__mocks__/tou.d.ts +10 -0
- package/dist/__mocks__/tou.d.ts.map +1 -0
- package/dist/__mocks__/tou.js +22 -0
- package/dist/__mocks__/tou.js.map +1 -0
- package/dist/components/FluxLogo.js +62 -3
- package/dist/components/StandardPage.js +97 -8
- package/dist/debug.js +207 -27
- package/dist/debug.js.map +1 -1
- 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.d.ts.map +1 -1
- package/dist/templates/QuotationPdf/Pricing.js +574 -208
- package/dist/templates/QuotationPdf/Pricing.js.map +1 -1
- 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.d.ts.map +1 -1
- package/dist/templates/QuotationPdf/translations.js +34 -23
- package/dist/templates/QuotationPdf/translations.js.map +1 -1
- package/dist/templates/QuotationPdf/utils.js +59 -29
- package/dist/templates/SubscriptionAgreement/Confirmation.d.ts +2 -0
- package/dist/templates/SubscriptionAgreement/Confirmation.d.ts.map +1 -1
- package/dist/templates/SubscriptionAgreement/Confirmation.js +66 -11
- package/dist/templates/SubscriptionAgreement/Confirmation.js.map +1 -1
- package/dist/templates/SubscriptionAgreement/CoverPage.d.ts +3 -1
- package/dist/templates/SubscriptionAgreement/CoverPage.d.ts.map +1 -1
- package/dist/templates/SubscriptionAgreement/CoverPage.js +94 -11
- package/dist/templates/SubscriptionAgreement/CoverPage.js.map +1 -1
- package/dist/templates/SubscriptionAgreement/CoverPageSection.js +16 -5
- package/dist/templates/SubscriptionAgreement/Details.d.ts.map +1 -1
- package/dist/templates/SubscriptionAgreement/Details.js +140 -46
- package/dist/templates/SubscriptionAgreement/Details.js.map +1 -1
- 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.d.ts +2 -2
- package/dist/templates/SubscriptionAgreement/TermsOfUse.d.ts.map +1 -1
- package/dist/templates/SubscriptionAgreement/TermsOfUse.js +94 -4
- package/dist/templates/SubscriptionAgreement/TermsOfUse.js.map +1 -1
- package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.js +97 -9
- package/dist/templates/SubscriptionAgreement/index.d.ts +5 -1
- package/dist/templates/SubscriptionAgreement/index.d.ts.map +1 -1
- package/dist/templates/SubscriptionAgreement/index.js +245 -14
- package/dist/templates/SubscriptionAgreement/index.js.map +1 -1
- package/dist/templates/SubscriptionAgreement/translations.d.ts +6 -0
- package/dist/templates/SubscriptionAgreement/translations.d.ts.map +1 -1
- package/dist/templates/SubscriptionAgreement/translations.js +199 -192
- package/dist/templates/SubscriptionAgreement/translations.js.map +1 -1
- package/dist/templates/SubscriptionAgreement/types.d.ts +2 -1
- package/dist/templates/SubscriptionAgreement/types.d.ts.map +1 -1
- package/dist/templates/SubscriptionAgreement/types.js +1 -2
- package/dist/templates/SubscriptionAgreement/utils.js +3 -5
- 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 +7 -7
|
@@ -1,13 +1,44 @@
|
|
|
1
|
+
function _object_without_properties(source, excluded) {
|
|
2
|
+
if (source == null) return {};
|
|
3
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
4
|
+
var key, i;
|
|
5
|
+
if (Object.getOwnPropertySymbols) {
|
|
6
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
7
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
8
|
+
key = sourceSymbolKeys[i];
|
|
9
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
10
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
11
|
+
target[key] = source[key];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return target;
|
|
15
|
+
}
|
|
16
|
+
function _object_without_properties_loose(source, excluded) {
|
|
17
|
+
if (source == null) return {};
|
|
18
|
+
var target = {};
|
|
19
|
+
var sourceKeys = Object.keys(source);
|
|
20
|
+
var key, i;
|
|
21
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
22
|
+
key = sourceKeys[i];
|
|
23
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
24
|
+
target[key] = source[key];
|
|
25
|
+
}
|
|
26
|
+
return target;
|
|
27
|
+
}
|
|
1
28
|
import { formatMoney } from '@driveflux/format-money';
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
29
|
+
export var formatAddress = function(originalAddress) {
|
|
30
|
+
var coordinates = originalAddress.coordinates, metadata = originalAddress.metadata, address = _object_without_properties(originalAddress, [
|
|
31
|
+
"coordinates",
|
|
32
|
+
"metadata"
|
|
33
|
+
]);
|
|
34
|
+
return Object.keys(address).filter(function(key) {
|
|
35
|
+
return key !== 'name' && !!address[key];
|
|
36
|
+
}).map(function(a) {
|
|
37
|
+
return address[a];
|
|
38
|
+
}).join(', ');
|
|
8
39
|
};
|
|
9
|
-
export
|
|
10
|
-
switch
|
|
40
|
+
export var getSimplifiedPlanTranslation = function(plan) {
|
|
41
|
+
switch(plan){
|
|
11
42
|
case 'plan60':
|
|
12
43
|
return '60 Months';
|
|
13
44
|
case 'plan36':
|
|
@@ -24,8 +55,8 @@ export const getSimplifiedPlanTranslation = (plan) => {
|
|
|
24
55
|
return 'Unknown Plan';
|
|
25
56
|
}
|
|
26
57
|
};
|
|
27
|
-
export
|
|
28
|
-
switch
|
|
58
|
+
export var getMileagePackageTranslation = function(mileagePackage) {
|
|
59
|
+
switch(mileagePackage){
|
|
29
60
|
case 'lite':
|
|
30
61
|
return 'Lite';
|
|
31
62
|
case 'standard':
|
|
@@ -38,8 +69,8 @@ export const getMileagePackageTranslation = (mileagePackage) => {
|
|
|
38
69
|
return 'Unknown Mileage Package';
|
|
39
70
|
}
|
|
40
71
|
};
|
|
41
|
-
export
|
|
42
|
-
switch
|
|
72
|
+
export var getFullMileagePackageTranslation = function(plan) {
|
|
73
|
+
switch(plan){
|
|
43
74
|
case 'lite':
|
|
44
75
|
return 'Lite - 1,250KM';
|
|
45
76
|
case 'standard':
|
|
@@ -52,25 +83,25 @@ export const getFullMileagePackageTranslation = (plan) => {
|
|
|
52
83
|
return 'Unknown Mileage Package';
|
|
53
84
|
}
|
|
54
85
|
};
|
|
55
|
-
export
|
|
56
|
-
|
|
57
|
-
switch
|
|
86
|
+
export var getPromoNotes = function(amount, discount) {
|
|
87
|
+
var discountType = discount.discountType, discountValue = discount.discountValue, maxRedemptions = discount.maxRedemptions;
|
|
88
|
+
switch(discountType){
|
|
58
89
|
case 'percentage':
|
|
59
|
-
return
|
|
60
|
-
case 'fixed':
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
?
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
90
|
+
return "Enjoy ".concat(discountValue * 100, "% off for ").concat(maxRedemptions, " month(s) for this vehicle.");
|
|
91
|
+
case 'fixed':
|
|
92
|
+
{
|
|
93
|
+
var money = formatMoney(discountValue);
|
|
94
|
+
return amount <= 0 ? "Enjoy free for ".concat(maxRedemptions, " month(s).") : "Enjoy ".concat(money, " off for the first ").concat(maxRedemptions, " month(s), then your subscription will switch to the regular price.");
|
|
95
|
+
}
|
|
96
|
+
case 'forceAmount':
|
|
97
|
+
{
|
|
98
|
+
var money1 = formatMoney(Math.min(amount, discountValue));
|
|
99
|
+
return "Enjoy only ".concat(money1, " for ").concat(maxRedemptions, " month(s), then your subscription will switch to the regular price.");
|
|
100
|
+
}
|
|
70
101
|
}
|
|
71
102
|
};
|
|
72
|
-
export
|
|
73
|
-
switch
|
|
103
|
+
export var getInspectionTypeTranslation = function(inspectionType) {
|
|
104
|
+
switch(inspectionType){
|
|
74
105
|
case 'exterior':
|
|
75
106
|
return 'Exterior';
|
|
76
107
|
case 'interior':
|
|
@@ -85,4 +116,3 @@ export const getInspectionTypeTranslation = (inspectionType) => {
|
|
|
85
116
|
return inspectionType;
|
|
86
117
|
}
|
|
87
118
|
};
|
|
88
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type { SubscriptionSignature } from '@driveflux/db';
|
|
1
2
|
import type { SubscriptionWithUser, SubscriptionWithVehicle } from '@driveflux/db/types';
|
|
2
3
|
import type { FC } from 'react';
|
|
3
4
|
import type { SubscriptionAgreementTranslation } from './translations.js';
|
|
4
5
|
type Props = {
|
|
5
6
|
tConfirmation: SubscriptionAgreementTranslation['confirmation'];
|
|
6
7
|
subscription: SubscriptionWithUser & SubscriptionWithVehicle;
|
|
8
|
+
signature: SubscriptionSignature;
|
|
7
9
|
};
|
|
8
10
|
declare const Confirmation: FC<Props>;
|
|
9
11
|
export default Confirmation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Confirmation.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/Confirmation.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Confirmation.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/Confirmation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAE1D,OAAO,KAAK,EACX,oBAAoB,EACpB,uBAAuB,EACvB,MAAM,qBAAqB,CAAA;AAG5B,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAA;AAEzE,KAAK,KAAK,GAAG;IACZ,aAAa,EAAE,gCAAgC,CAAC,cAAc,CAAC,CAAA;IAC/D,YAAY,EAAE,oBAAoB,GAAG,uBAAuB,CAAA;IAC5D,SAAS,EAAE,qBAAqB,CAAA;CAChC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,EAAE,CAAC,KAAK,CAgE3B,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -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
|
-
|
|
8
|
-
|
|
7
|
+
var Confirmation = function(param) {
|
|
8
|
+
var tConfirmation = param.tConfirmation, subscription = param.subscription, signature = param.signature;
|
|
9
|
+
var _subscription_user_identification;
|
|
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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Confirmation.js","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/Confirmation.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Confirmation.js","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/Confirmation.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAKpD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,UAAU,MAAM,iBAAiB,CAAA;AASxC,MAAM,YAAY,GAAc,CAAC,EAChC,aAAa,EACb,YAAY,EACZ,SAAS,GACT,EAAE,EAAE;IACJ,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAA;IACrC,CAAC;IAED,MAAM,MAAM,GAAG,aAAa,MAAM,CAAC,QAAQ,EAAE,CAAA;IAE7C,OAAO,CACN,MAAC,IAAI,IACJ,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,aAExE,KAAC,IAAI,I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,eAAe,YAAY,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { User } from '@driveflux/db';
|
|
1
|
+
import type { Business, PayerType, User } from '@driveflux/db';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import type { SubscriptionAgreementTranslation } from './translations.js';
|
|
4
4
|
type Props = {
|
|
@@ -6,6 +6,8 @@ type Props = {
|
|
|
6
6
|
tCover: SubscriptionAgreementTranslation['cover'];
|
|
7
7
|
signedAt: Date;
|
|
8
8
|
user: User;
|
|
9
|
+
payerType: PayerType;
|
|
10
|
+
business?: Business;
|
|
9
11
|
};
|
|
10
12
|
declare const CoverPage: FC<Props>;
|
|
11
13
|
export default CoverPage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoverPage.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/CoverPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"CoverPage.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/CoverPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAI9D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAI/B,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAA;AAEzE,KAAK,KAAK,GAAG;IACZ,MAAM,EAAE,gCAAgC,CAAC,OAAO,CAAC,CAAA;IACjD,MAAM,EAAE,gCAAgC,CAAC,OAAO,CAAC,CAAA;IACjD,QAAQ,EAAE,IAAI,CAAA;IACd,IAAI,EAAE,IAAI,CAAA;IACV,SAAS,EAAE,SAAS,CAAA;IACpB,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACnB,CAAA;AAED,QAAA,MAAM,SAAS,EAAE,EAAE,CAAC,KAAK,CA6ExB,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -1,28 +1,111 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { userName } from '@driveflux/db/models/user';
|
|
3
3
|
import { Text, View } from '@react-pdf/renderer';
|
|
4
4
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoverPage.js","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/CoverPage.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,gBAAgB,MAAM,uBAAuB,CAAA;AACpD,OAAO,UAAU,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"CoverPage.js","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/CoverPage.tsx"],"names":[],"mappings":";A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AW,EAAE,YAC1C,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,GAClB,EACP,KAAC,IAAI,cAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAQ,IACjC,GACW,EACnB,MAAC,gBAAgB,IAAC,KAAK,EAAE,MAAM,CAAC,gBAAgB,aAC9C,SAAS,KAAK,UAAU,IAAI,CAC5B,8BACC,KAAC,UAAU,IAAC,KAAK,EAAE,MAAM,CAAC,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,GAAI,EAChE,KAAC,UAAU,IACV,KAAK,EAAE,MAAM,CAAC,SAAS,EACvB,KAAK,EAAE,QAAQ,EAAE,kBAAkB,GAClC,IACA,CACH,EACA,SAAS,KAAK,MAAM,IAAI,CACxB,8BACC,KAAC,UAAU,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAI,EACzD,KAAC,UAAU,IACV,KAAK,EAAE,MAAM,CAAC,cAAc,EAC5B,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,GACjC,IACA,CACH,IACiB,EACnB,KAAC,IAAI,IACJ,KAAK,EAAE;4BACN,QAAQ,EAAE,CAAC;4BACX,UAAU,EAAE,MAAM;4BAClB,KAAK,EAAE,MAAM,CAAC,QAAQ;4BACtB,aAAa,EAAE,WAAW;4BAC1B,aAAa,EAAE,CAAC;yBAChB,YAEA,MAAM,CAAC,GAAG,GACL,EACP,KAAC,IAAI,2CAAgC,IAC/B,IACD,CACP,CAAA;AACF,CAAC,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Details.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/Details.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAA;AAE1D,KAAK,KAAK,GAAG;IACZ,QAAQ,EAAE,gCAAgC,CAAC,SAAS,CAAC,CAAA;IACrD,YAAY,EAAE,wBAAwB,CAAA;CACtC,CAAA;AAED,QAAA,MAAM,OAAO,EAAE,EAAE,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"Details.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/Details.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAA;AAE1D,KAAK,KAAK,GAAG;IACZ,QAAQ,EAAE,gCAAgC,CAAC,SAAS,CAAC,CAAA;IACrD,YAAY,EAAE,wBAAwB,CAAA;CACtC,CAAA;AAED,QAAA,MAAM,OAAO,EAAE,EAAE,CAAC,KAAK,CAuHtB,CAAA;AAED,eAAe,OAAO,CAAA"}
|