@driveflux/pdf 1.0.15 → 1.1.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.
Files changed (104) hide show
  1. package/dist/__mocks__/quotation.d.ts +1 -1
  2. package/dist/__mocks__/quotation.d.ts.map +1 -1
  3. package/dist/__mocks__/quotation.js +1 -2
  4. package/dist/__mocks__/subscription.d.ts +1 -1
  5. package/dist/__mocks__/subscription.d.ts.map +1 -1
  6. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.d.ts.map +1 -1
  7. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.js +2 -10
  8. package/dist/templates/QuotationPdf/index.d.ts +1 -1
  9. package/dist/templates/QuotationPdf/index.d.ts.map +1 -1
  10. package/dist/templates/QuotationPdf/translations.d.ts +0 -1
  11. package/dist/templates/QuotationPdf/translations.d.ts.map +1 -1
  12. package/dist/templates/QuotationPdf/translations.js +1 -4
  13. package/dist/templates/QuotationPdf/utils.d.ts +3 -4
  14. package/dist/templates/QuotationPdf/utils.d.ts.map +1 -1
  15. package/dist/templates/QuotationPdf/utils.js +0 -14
  16. package/dist/templates/SubscriptionAgreement/index.d.ts +1 -1
  17. package/dist/templates/SubscriptionAgreement/index.d.ts.map +1 -1
  18. package/dist/templates/SubscriptionAgreement/translations.d.ts.map +1 -1
  19. package/dist/templates/SubscriptionAgreement/utils.d.ts +1 -1
  20. package/dist/templates/SubscriptionAgreement/utils.d.ts.map +1 -1
  21. package/dist/theme/colors.d.ts.map +1 -1
  22. package/dist/theme/colors.js +36 -36
  23. package/dist/utils.d.ts +2 -8
  24. package/dist/utils.d.ts.map +1 -1
  25. package/dist/utils.js +7 -31
  26. package/package.json +23 -20
  27. package/.eslintrc +0 -3
  28. package/.swcrc +0 -14
  29. package/.turbo/turbo-build.log +0 -6
  30. package/CHANGELOG.md +0 -186
  31. package/dist/cjs/__mocks__/quotation.js +0 -70
  32. package/dist/cjs/__mocks__/subscription.js +0 -1079
  33. package/dist/cjs/components/FluxLogo.js +0 -76
  34. package/dist/cjs/components/StandardPage.js +0 -129
  35. package/dist/cjs/debug.js +0 -234
  36. package/dist/cjs/index.js +0 -20
  37. package/dist/cjs/templates/QuotationPdf/CustomerSubscriptionSection.js +0 -155
  38. package/dist/cjs/templates/QuotationPdf/GFV.js +0 -57
  39. package/dist/cjs/templates/QuotationPdf/Header.js +0 -86
  40. package/dist/cjs/templates/QuotationPdf/Pricing.js +0 -430
  41. package/dist/cjs/templates/QuotationPdf/QuotationPdfPage.js +0 -45
  42. package/dist/cjs/templates/QuotationPdf/SectionBoxNew.js +0 -43
  43. package/dist/cjs/templates/QuotationPdf/TermsSection.js +0 -60
  44. package/dist/cjs/templates/QuotationPdf/index.js +0 -208
  45. package/dist/cjs/templates/QuotationPdf/translations.js +0 -106
  46. package/dist/cjs/templates/QuotationPdf/utils.js +0 -108
  47. package/dist/cjs/templates/SubscriptionAgreement/Confirmation.js +0 -95
  48. package/dist/cjs/templates/SubscriptionAgreement/CoverPage.js +0 -110
  49. package/dist/cjs/templates/SubscriptionAgreement/CoverPageSection.js +0 -35
  50. package/dist/cjs/templates/SubscriptionAgreement/Details.js +0 -161
  51. package/dist/cjs/templates/SubscriptionAgreement/Footer.js +0 -68
  52. package/dist/cjs/templates/SubscriptionAgreement/Header.js +0 -61
  53. package/dist/cjs/templates/SubscriptionAgreement/LabelValue.js +0 -39
  54. package/dist/cjs/templates/SubscriptionAgreement/SubscriptionAgreementPage.js +0 -48
  55. package/dist/cjs/templates/SubscriptionAgreement/TermsOfUse.js +0 -72
  56. package/dist/cjs/templates/SubscriptionAgreement/TermsOfUseSubSection.js +0 -108
  57. package/dist/cjs/templates/SubscriptionAgreement/index.js +0 -276
  58. package/dist/cjs/templates/SubscriptionAgreement/translations.js +0 -666
  59. package/dist/cjs/templates/SubscriptionAgreement/utils.js +0 -14
  60. package/dist/cjs/templates/index.js +0 -19
  61. package/dist/cjs/theme/colors.js +0 -147
  62. package/dist/cjs/theme/index.js +0 -18
  63. package/dist/cjs/types.js +0 -4
  64. package/dist/cjs/utils.js +0 -184
  65. package/dist/cjs/watch.js +0 -20
  66. package/index.cjs +0 -1
  67. package/index.d.ts +0 -1
  68. package/src/__mocks__/quotation.ts +0 -63
  69. package/src/__mocks__/subscription.ts +0 -803
  70. package/src/components/FluxLogo.tsx +0 -52
  71. package/src/components/StandardPage.tsx +0 -32
  72. package/src/debug.ts +0 -45
  73. package/src/index.ts +0 -3
  74. package/src/templates/QuotationPdf/CustomerSubscriptionSection.tsx +0 -73
  75. package/src/templates/QuotationPdf/GFV.tsx +0 -29
  76. package/src/templates/QuotationPdf/Header.tsx +0 -31
  77. package/src/templates/QuotationPdf/Pricing.tsx +0 -214
  78. package/src/templates/QuotationPdf/QuotationPdfPage.tsx +0 -25
  79. package/src/templates/QuotationPdf/SectionBoxNew.tsx +0 -20
  80. package/src/templates/QuotationPdf/TermsSection.tsx +0 -28
  81. package/src/templates/QuotationPdf/index.tsx +0 -46
  82. package/src/templates/QuotationPdf/translations.ts +0 -84
  83. package/src/templates/QuotationPdf/utils.ts +0 -59
  84. package/src/templates/SubscriptionAgreement/Confirmation.tsx +0 -49
  85. package/src/templates/SubscriptionAgreement/CoverPage.tsx +0 -52
  86. package/src/templates/SubscriptionAgreement/CoverPageSection.tsx +0 -25
  87. package/src/templates/SubscriptionAgreement/Details.tsx +0 -127
  88. package/src/templates/SubscriptionAgreement/Footer.tsx +0 -37
  89. package/src/templates/SubscriptionAgreement/Header.tsx +0 -37
  90. package/src/templates/SubscriptionAgreement/LabelValue.tsx +0 -19
  91. package/src/templates/SubscriptionAgreement/SubscriptionAgreementPage.tsx +0 -24
  92. package/src/templates/SubscriptionAgreement/TermsOfUse.tsx +0 -30
  93. package/src/templates/SubscriptionAgreement/TermsOfUseSubSection.tsx +0 -44
  94. package/src/templates/SubscriptionAgreement/index.tsx +0 -66
  95. package/src/templates/SubscriptionAgreement/translations.ts +0 -664
  96. package/src/templates/SubscriptionAgreement/utils.ts +0 -7
  97. package/src/templates/index.ts +0 -2
  98. package/src/theme/colors.ts +0 -180
  99. package/src/theme/index.ts +0 -1
  100. package/src/types.ts +0 -1
  101. package/src/utils.ts +0 -27
  102. package/src/watch.ts +0 -16
  103. package/tsconfig.json +0 -13
  104. package/tsconfig.tsbuildinfo +0 -1
@@ -1,208 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "generateQuotationPdf", {
6
- enumerable: true,
7
- get: function() {
8
- return generateQuotationPdf;
9
- }
10
- });
11
- var _jsxruntime = require("react/jsx-runtime");
12
- var _renderer = require("@react-pdf/renderer");
13
- var _react = require("react");
14
- var _utils = require("../../utils.js");
15
- var _CustomerSubscriptionSection = /*#__PURE__*/ _interop_require_default(require("./CustomerSubscriptionSection.js"));
16
- var _GFV = /*#__PURE__*/ _interop_require_default(require("./GFV.js"));
17
- var _Pricing = /*#__PURE__*/ _interop_require_default(require("./Pricing.js"));
18
- var _QuotationPdfPage = /*#__PURE__*/ _interop_require_default(require("./QuotationPdfPage.js"));
19
- var _TermsSection = /*#__PURE__*/ _interop_require_default(require("./TermsSection.js"));
20
- var _translations = require("./translations.js");
21
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
22
- try {
23
- var info = gen[key](arg);
24
- var value = info.value;
25
- } catch (error) {
26
- reject(error);
27
- return;
28
- }
29
- if (info.done) {
30
- resolve(value);
31
- } else {
32
- Promise.resolve(value).then(_next, _throw);
33
- }
34
- }
35
- function _async_to_generator(fn) {
36
- return function() {
37
- var self = this, args = arguments;
38
- return new Promise(function(resolve, reject) {
39
- var gen = fn.apply(self, args);
40
- function _next(value) {
41
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
42
- }
43
- function _throw(err) {
44
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
45
- }
46
- _next(undefined);
47
- });
48
- };
49
- }
50
- function _interop_require_default(obj) {
51
- return obj && obj.__esModule ? obj : {
52
- default: obj
53
- };
54
- }
55
- function _ts_generator(thisArg, body) {
56
- var f, y, t, g, _ = {
57
- label: 0,
58
- sent: function() {
59
- if (t[0] & 1) throw t[1];
60
- return t[1];
61
- },
62
- trys: [],
63
- ops: []
64
- };
65
- return g = {
66
- next: verb(0),
67
- "throw": verb(1),
68
- "return": verb(2)
69
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
70
- return this;
71
- }), g;
72
- function verb(n) {
73
- return function(v) {
74
- return step([
75
- n,
76
- v
77
- ]);
78
- };
79
- }
80
- function step(op) {
81
- if (f) throw new TypeError("Generator is already executing.");
82
- while(_)try {
83
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
84
- if (y = 0, t) op = [
85
- op[0] & 2,
86
- t.value
87
- ];
88
- switch(op[0]){
89
- case 0:
90
- case 1:
91
- t = op;
92
- break;
93
- case 4:
94
- _.label++;
95
- return {
96
- value: op[1],
97
- done: false
98
- };
99
- case 5:
100
- _.label++;
101
- y = op[1];
102
- op = [
103
- 0
104
- ];
105
- continue;
106
- case 7:
107
- op = _.ops.pop();
108
- _.trys.pop();
109
- continue;
110
- default:
111
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
112
- _ = 0;
113
- continue;
114
- }
115
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
116
- _.label = op[1];
117
- break;
118
- }
119
- if (op[0] === 6 && _.label < t[1]) {
120
- _.label = t[1];
121
- t = op;
122
- break;
123
- }
124
- if (t && _.label < t[2]) {
125
- _.label = t[2];
126
- _.ops.push(op);
127
- break;
128
- }
129
- if (t[2]) _.ops.pop();
130
- _.trys.pop();
131
- continue;
132
- }
133
- op = body.call(thisArg, _);
134
- } catch (e) {
135
- op = [
136
- 6,
137
- e
138
- ];
139
- y = 0;
140
- } finally{
141
- f = t = 0;
142
- }
143
- if (op[0] & 5) throw op[1];
144
- return {
145
- value: op[0] ? op[1] : void 0,
146
- done: true
147
- };
148
- }
149
- }
150
- var generateQuotationPdf = function() {
151
- var _ref = _async_to_generator(function(param, fileName) {
152
- var _param_locale, locale, quotation;
153
- return _ts_generator(this, function(_state) {
154
- switch(_state.label){
155
- case 0:
156
- _param_locale = param.locale, locale = _param_locale === void 0 ? 'en' : _param_locale, quotation = param.quotation;
157
- return [
158
- 4,
159
- (0, _utils.toPdf)(/*#__PURE__*/ (0, _jsxruntime.jsx)(QuotationPDF, {
160
- locale: locale,
161
- quotation: quotation
162
- }), fileName)
163
- ];
164
- case 1:
165
- return [
166
- 2,
167
- _state.sent()
168
- ];
169
- }
170
- });
171
- });
172
- return function generateQuotationPdf(_, fileName) {
173
- return _ref.apply(this, arguments);
174
- };
175
- }();
176
- var QuotationPDF = function(param) {
177
- var _param_locale = param.locale, locale = _param_locale === void 0 ? 'en' : _param_locale, quotation = param.quotation;
178
- var pageProps = (0, _react.useMemo)(function() {
179
- return {
180
- t: (0, _translations.useTranslations)(locale),
181
- quotation: quotation
182
- };
183
- }, []);
184
- var t = pageProps.t;
185
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Document, {
186
- language: locale,
187
- children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_QuotationPdfPage.default, {
188
- quotation: quotation,
189
- children: [
190
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_CustomerSubscriptionSection.default, {
191
- quotation: quotation,
192
- t: t
193
- }),
194
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_Pricing.default, {
195
- quotation: quotation,
196
- t: t.pricing
197
- }),
198
- quotation.fees.gfv && /*#__PURE__*/ (0, _jsxruntime.jsx)(_GFV.default, {
199
- quotation: quotation,
200
- t: t.pricing
201
- }),
202
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_TermsSection.default, {
203
- t: t.terms
204
- })
205
- ]
206
- })
207
- });
208
- };
@@ -1,106 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "useTranslations", {
6
- enumerable: true,
7
- get: function() {
8
- return useTranslations;
9
- }
10
- });
11
- var enTranslation = {
12
- quotation: "Quotation",
13
- date: 'Date',
14
- customer: {
15
- title: "Customer",
16
- name: "Name",
17
- email: "Email",
18
- address: "Address"
19
- },
20
- subscription: {
21
- title: "Subscription",
22
- vehicleName: "Vehicle",
23
- plan: "Subscription Plan",
24
- mileagePackage: "Mileage Package"
25
- },
26
- subIncludes: {
27
- title: "What's Included:",
28
- content: [
29
- "Comprehensive insurance",
30
- "Road tax",
31
- "Regularly scheduled maintenance",
32
- "Selective wear & tear",
33
- "Ability to swap vehicles",
34
- "Doorstep delivery",
35
- "24/7 nationwide roadside assistance",
36
- "Theft recovery services",
37
- "Independently rated vehicle inspection",
38
- "Option to purchase the vehicle at the end of the subscription"
39
- ],
40
- excessMileage: function(excessMileage) {
41
- return "*If usage exceeds chosen mileage package, excess mileage fees for this vehicle is RM".concat(excessMileage, " per KM.");
42
- }
43
- },
44
- pricing: {
45
- title: "Pricing",
46
- fees: {
47
- upfront: {
48
- title: "Upfront Fees",
49
- content: [
50
- {
51
- title: "Booking Fee",
52
- key: 'reservationFee'
53
- },
54
- {
55
- title: "Activation Fee",
56
- key: 'startFee'
57
- },
58
- {
59
- title: "Refundable Deposit",
60
- key: 'deposit'
61
- }
62
- ]
63
- },
64
- monthly: {
65
- title: "Monthly Fees",
66
- content: [
67
- {
68
- title: "Subscription Fee",
69
- key: 'subscriptionFee'
70
- }
71
- ]
72
- },
73
- dueToday: {
74
- title: "Due Today",
75
- description: "Grand Total is due before your subscription start. Monthly fee is due on the first day of every cycle period.",
76
- subTotal: "Upfront Fees + Monthly Fee",
77
- serviceFee: "Service Fee (8%)",
78
- grandTotal: "Grand Total"
79
- },
80
- extraCharge: "Extra Charge",
81
- promo: "Promo",
82
- gfv: {
83
- title: "Guaranteed Future Value (GFV)"
84
- }
85
- }
86
- },
87
- terms: {
88
- title: "Terms",
89
- content: [
90
- "This quotation is valid for 7 days.",
91
- "All vehicles proposed are unique and are available to our customers on a first come first served basis.",
92
- "The Mileage Package is the monthly mileage cap for the vehicle. If you exceed this cap for any given month, excess mileage charges will be incurred.",
93
- "Initial payment to be made within 7 days of the invoice date.",
94
- "Subscription starts on the date of the car delivery.",
95
- "The upfront fees are billed one-time per subscription, before the subscription starts.",
96
- "All monthly recurring fees are billed on the same date as the delivery of the vehicle.",
97
- "Scheduling delivery will only commence Grand Total is fully paid, 7 - 30+ days after payment and subject to vehicle availability."
98
- ]
99
- }
100
- };
101
- var useTranslations = function(locale) {
102
- var translation = {
103
- en: enTranslation
104
- };
105
- return translation[locale];
106
- };
@@ -1,108 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- formatAddress: function() {
13
- return formatAddress;
14
- },
15
- getFullMileagePackageTranslation: function() {
16
- return getFullMileagePackageTranslation;
17
- },
18
- getMileagePackageTranslation: function() {
19
- return getMileagePackageTranslation;
20
- },
21
- getSimplifiedPlanTranslation: function() {
22
- return getSimplifiedPlanTranslation;
23
- }
24
- });
25
- function _object_without_properties(source, excluded) {
26
- if (source == null) return {};
27
- var target = _object_without_properties_loose(source, excluded);
28
- var key, i;
29
- if (Object.getOwnPropertySymbols) {
30
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
31
- for(i = 0; i < sourceSymbolKeys.length; i++){
32
- key = sourceSymbolKeys[i];
33
- if (excluded.indexOf(key) >= 0) continue;
34
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
35
- target[key] = source[key];
36
- }
37
- }
38
- return target;
39
- }
40
- function _object_without_properties_loose(source, excluded) {
41
- if (source == null) return {};
42
- var target = {};
43
- var sourceKeys = Object.keys(source);
44
- var key, i;
45
- for(i = 0; i < sourceKeys.length; i++){
46
- key = sourceKeys[i];
47
- if (excluded.indexOf(key) >= 0) continue;
48
- target[key] = source[key];
49
- }
50
- return target;
51
- }
52
- var formatAddress = function(originalAddress) {
53
- var coordinates = originalAddress.coordinates, metadata = originalAddress.metadata, address = _object_without_properties(originalAddress, [
54
- "coordinates",
55
- "metadata"
56
- ]);
57
- return Object.keys(address).filter(function(key) {
58
- return key !== 'name' && !!address[key];
59
- }).map(function(a) {
60
- return address[a];
61
- }).join(', ');
62
- };
63
- var getSimplifiedPlanTranslation = function(plan) {
64
- switch(plan){
65
- case 'plan60':
66
- return "60 Months";
67
- case 'plan36':
68
- return "36 Months";
69
- case 'plan24':
70
- return "24 Months";
71
- case 'plan12':
72
- return "12 Months";
73
- case 'plan1':
74
- return "Monthly";
75
- case 'planWeekly':
76
- return "Weekly";
77
- default:
78
- return "Unknown Plan";
79
- }
80
- };
81
- var getMileagePackageTranslation = function(mileagePackage) {
82
- switch(mileagePackage){
83
- case 'lite':
84
- return "Lite";
85
- case 'standard':
86
- return "Standard";
87
- case 'plus':
88
- return "Plus";
89
- case 'unlimited':
90
- return "Unlimited";
91
- default:
92
- return "Unknown Mileage Package";
93
- }
94
- };
95
- var getFullMileagePackageTranslation = function(plan) {
96
- switch(plan){
97
- case 'lite':
98
- return "Lite - 1,250KM";
99
- case 'standard':
100
- return "Standard - 2,000KM";
101
- case 'plus':
102
- return "Plus - 2,750KM";
103
- case 'unlimited':
104
- return "Unlimited";
105
- default:
106
- return "Unknown Mileage Package";
107
- }
108
- };
@@ -1,95 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "default", {
6
- enumerable: true,
7
- get: function() {
8
- return _default;
9
- }
10
- });
11
- var _jsxruntime = require("react/jsx-runtime");
12
- var _user = require("@driveflux/db/models/user");
13
- var _renderer = require("@react-pdf/renderer");
14
- var _datefns = require("date-fns");
15
- var _index = require("../../theme/index.js");
16
- var _LabelValue = /*#__PURE__*/ _interop_require_default(require("./LabelValue.js"));
17
- function _interop_require_default(obj) {
18
- return obj && obj.__esModule ? obj : {
19
- default: obj
20
- };
21
- }
22
- var Confirmation = function(param) {
23
- var tConfirmation = param.tConfirmation, subscription = param.subscription;
24
- var _subscription_signature, _subscription_user_identification;
25
- if (!((_subscription_signature = subscription.signature) === null || _subscription_signature === void 0 ? void 0 : _subscription_signature.signature)) {
26
- throw new Error('Missing signature');
27
- }
28
- var border = "1px solid ".concat(_index.colors.primary2);
29
- return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_renderer.View, {
30
- style: {
31
- borderLeft: border,
32
- borderRight: border,
33
- borderBottom: border
34
- },
35
- children: [
36
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.View, {
37
- style: {
38
- backgroundColor: _index.colors.primary1,
39
- borderTop: border,
40
- padding: 8
41
- },
42
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Text, {
43
- style: {
44
- fontWeight: 'bold',
45
- textTransform: 'uppercase',
46
- letterSpacing: 1
47
- },
48
- children: tConfirmation.title
49
- })
50
- }),
51
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_renderer.View, {
52
- style: {
53
- padding: 8,
54
- paddingBottom: 16,
55
- rowGap: 8,
56
- borderTop: border
57
- },
58
- children: [
59
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Text, {
60
- children: tConfirmation.agreementText(subscription.businessId ? 'business' : 'member')
61
- }),
62
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.View, {
63
- style: {
64
- height: 160,
65
- alignItems: 'flex-start'
66
- },
67
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Image, {
68
- src: subscription.signature.signature
69
- })
70
- }),
71
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_renderer.View, {
72
- style: {
73
- rowGap: 8
74
- },
75
- children: [
76
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_LabelValue.default, {
77
- label: tConfirmation.name,
78
- value: (0, _user.userName)(subscription.user)
79
- }),
80
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_LabelValue.default, {
81
- label: tConfirmation.idOrPassportNo,
82
- value: (_subscription_user_identification = subscription.user.identification) === null || _subscription_user_identification === void 0 ? void 0 : _subscription_user_identification.number
83
- }),
84
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_LabelValue.default, {
85
- label: tConfirmation.date,
86
- value: subscription.signature.signedAt ? (0, _datefns.format)(subscription.signature.signedAt, 'dd-MM-yyyy hh:mm a') : undefined
87
- })
88
- ]
89
- })
90
- ]
91
- })
92
- ]
93
- });
94
- };
95
- var _default = Confirmation;
@@ -1,110 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "default", {
6
- enumerable: true,
7
- get: function() {
8
- return _default;
9
- }
10
- });
11
- var _jsxruntime = require("react/jsx-runtime");
12
- var _user = require("@driveflux/db/models/user");
13
- var _renderer = require("@react-pdf/renderer");
14
- var _datefns = require("date-fns");
15
- var _colors = require("../../theme/colors.js");
16
- var _CoverPageSection = /*#__PURE__*/ _interop_require_default(require("./CoverPageSection.js"));
17
- var _LabelValue = /*#__PURE__*/ _interop_require_default(require("./LabelValue.js"));
18
- function _interop_require_default(obj) {
19
- return obj && obj.__esModule ? obj : {
20
- default: obj
21
- };
22
- }
23
- var CoverPage = function(param) {
24
- var tTitle = param.tTitle, tCover = param.tCover, signedAt = param.signedAt, user = param.user;
25
- var _user_identification;
26
- return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_renderer.View, {
27
- style: {
28
- flex: 1,
29
- paddingVertical: 80,
30
- justifyContent: 'space-between'
31
- },
32
- children: [
33
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Text, {
34
- style: {
35
- fontWeight: 'bold',
36
- fontSize: 40,
37
- textTransform: 'uppercase',
38
- flex: 1
39
- },
40
- children: tTitle
41
- }),
42
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_renderer.View, {
43
- style: {
44
- padding: 16,
45
- rowGap: 32,
46
- border: "1px solid ".concat(_colors.colors.primary2),
47
- fontSize: 10
48
- },
49
- children: [
50
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_CoverPageSection.default, {
51
- title: tCover.effectiveDate,
52
- children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_renderer.View, {
53
- style: {
54
- flexDirection: 'row',
55
- columnGap: 4
56
- },
57
- children: [
58
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Text, {
59
- style: {
60
- textDecoration: 'underline'
61
- },
62
- children: (0, _datefns.format)(signedAt, 'do')
63
- }),
64
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Text, {
65
- children: tCover.of
66
- }),
67
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Text, {
68
- style: {
69
- textDecoration: 'underline'
70
- },
71
- children: (0, _datefns.format)(signedAt, 'MMM')
72
- }),
73
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Text, {
74
- children: (0, _datefns.format)(signedAt, 'yyyy')
75
- })
76
- ]
77
- })
78
- }),
79
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_CoverPageSection.default, {
80
- title: tCover.agreementBetween,
81
- children: [
82
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_LabelValue.default, {
83
- label: tCover.name,
84
- value: (0, _user.userName)(user)
85
- }),
86
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_LabelValue.default, {
87
- label: tCover.idOrPassportNo,
88
- value: (_user_identification = user.identification) === null || _user_identification === void 0 ? void 0 : _user_identification.number
89
- })
90
- ]
91
- }),
92
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Text, {
93
- style: {
94
- fontSize: 8,
95
- fontWeight: 'bold',
96
- color: _colors.colors.primary3,
97
- textTransform: 'uppercase',
98
- letterSpacing: 1
99
- },
100
- children: tCover.and
101
- }),
102
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Text, {
103
- children: "FLUX Sdn Bhd (1264766-H)"
104
- })
105
- ]
106
- })
107
- ]
108
- });
109
- };
110
- var _default = CoverPage;
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "default", {
6
- enumerable: true,
7
- get: function() {
8
- return _default;
9
- }
10
- });
11
- var _jsxruntime = require("react/jsx-runtime");
12
- var _renderer = require("@react-pdf/renderer");
13
- var _colors = require("../../theme/colors.js");
14
- var CoverPageSection = function(param) {
15
- var title = param.title, children = param.children;
16
- return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_renderer.View, {
17
- style: {
18
- rowGap: 16
19
- },
20
- children: [
21
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Text, {
22
- style: {
23
- fontSize: 8,
24
- fontWeight: 'bold',
25
- color: _colors.colors.primary3,
26
- textTransform: 'uppercase',
27
- letterSpacing: 1
28
- },
29
- children: "".concat(title, ":")
30
- }),
31
- children
32
- ]
33
- });
34
- };
35
- var _default = CoverPageSection;