@driveflux/pdf 1.0.1 → 1.0.2

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 (67) hide show
  1. package/.turbo/turbo-build.log +3 -3
  2. package/CHANGELOG.md +8 -0
  3. package/dist/__mocks__/quotation.d.ts +3 -0
  4. package/dist/__mocks__/quotation.d.ts.map +1 -0
  5. package/dist/__mocks__/quotation.js +59 -0
  6. package/dist/cjs/__mocks__/quotation.js +69 -0
  7. package/dist/cjs/debug.js +33 -1
  8. package/dist/cjs/templates/QuotationPdf/CustomerSubscriptionSection.js +147 -0
  9. package/dist/cjs/templates/QuotationPdf/GFV.js +57 -0
  10. package/dist/cjs/templates/QuotationPdf/Header.js +86 -0
  11. package/dist/cjs/templates/QuotationPdf/Pricing.js +430 -0
  12. package/dist/cjs/templates/QuotationPdf/QuotationPdfPage.js +45 -0
  13. package/dist/cjs/templates/QuotationPdf/SectionBoxNew.js +43 -0
  14. package/dist/cjs/templates/QuotationPdf/TermsSection.js +60 -0
  15. package/dist/cjs/templates/QuotationPdf/index.js +208 -0
  16. package/dist/cjs/templates/QuotationPdf/translations.js +103 -0
  17. package/dist/cjs/templates/QuotationPdf/utils.js +91 -0
  18. package/dist/cjs/templates/index.js +1 -0
  19. package/dist/debug.js +33 -1
  20. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.d.ts +10 -0
  21. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.d.ts.map +1 -0
  22. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.js +132 -0
  23. package/dist/templates/QuotationPdf/GFV.d.ts +10 -0
  24. package/dist/templates/QuotationPdf/GFV.d.ts.map +1 -0
  25. package/dist/templates/QuotationPdf/GFV.js +47 -0
  26. package/dist/templates/QuotationPdf/Header.d.ts +9 -0
  27. package/dist/templates/QuotationPdf/Header.d.ts.map +1 -0
  28. package/dist/templates/QuotationPdf/Header.js +71 -0
  29. package/dist/templates/QuotationPdf/Pricing.d.ts +10 -0
  30. package/dist/templates/QuotationPdf/Pricing.d.ts.map +1 -0
  31. package/dist/templates/QuotationPdf/Pricing.js +415 -0
  32. package/dist/templates/QuotationPdf/QuotationPdfPage.d.ts +8 -0
  33. package/dist/templates/QuotationPdf/QuotationPdfPage.d.ts.map +1 -0
  34. package/dist/templates/QuotationPdf/QuotationPdfPage.js +30 -0
  35. package/dist/templates/QuotationPdf/SectionBoxNew.d.ts +8 -0
  36. package/dist/templates/QuotationPdf/SectionBoxNew.d.ts.map +1 -0
  37. package/dist/templates/QuotationPdf/SectionBoxNew.js +33 -0
  38. package/dist/templates/QuotationPdf/TermsSection.d.ts +8 -0
  39. package/dist/templates/QuotationPdf/TermsSection.d.ts.map +1 -0
  40. package/dist/templates/QuotationPdf/TermsSection.js +50 -0
  41. package/dist/templates/QuotationPdf/index.d.ts +9 -0
  42. package/dist/templates/QuotationPdf/index.d.ts.map +1 -0
  43. package/dist/templates/QuotationPdf/index.js +193 -0
  44. package/dist/templates/QuotationPdf/translations.d.ts +59 -0
  45. package/dist/templates/QuotationPdf/translations.d.ts.map +1 -0
  46. package/dist/templates/QuotationPdf/translations.js +93 -0
  47. package/dist/templates/QuotationPdf/utils.d.ts +6 -0
  48. package/dist/templates/QuotationPdf/utils.d.ts.map +1 -0
  49. package/dist/templates/QuotationPdf/utils.js +70 -0
  50. package/dist/templates/index.d.ts +1 -0
  51. package/dist/templates/index.d.ts.map +1 -1
  52. package/dist/templates/index.js +1 -0
  53. package/package.json +2 -2
  54. package/src/__mocks__/quotation.ts +62 -0
  55. package/src/debug.ts +12 -3
  56. package/src/templates/QuotationPdf/CustomerSubscriptionSection.tsx +65 -0
  57. package/src/templates/QuotationPdf/GFV.tsx +29 -0
  58. package/src/templates/QuotationPdf/Header.tsx +31 -0
  59. package/src/templates/QuotationPdf/Pricing.tsx +214 -0
  60. package/src/templates/QuotationPdf/QuotationPdfPage.tsx +25 -0
  61. package/src/templates/QuotationPdf/SectionBoxNew.tsx +20 -0
  62. package/src/templates/QuotationPdf/TermsSection.tsx +28 -0
  63. package/src/templates/QuotationPdf/index.tsx +46 -0
  64. package/src/templates/QuotationPdf/translations.ts +82 -0
  65. package/src/templates/QuotationPdf/utils.ts +44 -0
  66. package/src/templates/index.ts +1 -0
  67. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,71 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Link, Text, View } from '@react-pdf/renderer';
3
+ import FluxLogo from '../../components/FluxLogo.js';
4
+ import { colors } from '../../theme/colors.js';
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: {
23
+ fontWeight: 'bold',
24
+ textTransform: 'uppercase',
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
+ });
70
+ };
71
+ export default Header;
@@ -0,0 +1,10 @@
1
+ import { Quotation } from '@driveflux/db';
2
+ import { FC } from 'react';
3
+ import { QuotationPdfTranslation } from './translations.js';
4
+ type Props = {
5
+ quotation: Quotation;
6
+ t?: QuotationPdfTranslation['pricing'];
7
+ };
8
+ declare const Pricing: FC<Props>;
9
+ export default Pricing;
10
+ //# sourceMappingURL=Pricing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pricing.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/Pricing.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAGzC,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAE3D,KAAK,KAAK,GAAG;IACX,SAAS,EAAE,SAAS,CAAA;IACpB,CAAC,CAAC,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAA;CACvC,CAAA;AAED,QAAA,MAAM,OAAO,EAAE,EAAE,CAAC,KAAK,CAsMtB,CAAA;AAED,eAAe,OAAO,CAAA"}
@@ -0,0 +1,415 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { formatMoney } from '@driveflux/format-money';
3
+ import { Text, View } from '@react-pdf/renderer';
4
+ import { colors } from '../../theme/colors.js';
5
+ import SectionBoxNew from './SectionBoxNew.js';
6
+ var Pricing = function(param) {
7
+ var quotation = param.quotation, t = param.t;
8
+ var _quotation_fees_discountAmount, _quotation_fees_discountAmount1;
9
+ var _quotation_fees = quotation.fees, startFee = _quotation_fees.startFee, reservationFee = _quotation_fees.reservationFee, deposit = _quotation_fees.deposit, subscriptionFee = _quotation_fees.subscriptionFee, extraCharges = _quotation_fees.extraCharges, couponCode = _quotation_fees.couponCode, couponType = _quotation_fees.couponType, discountAmount = _quotation_fees.discountAmount;
10
+ var totalUpfrontFee = startFee + (reservationFee || 0) + deposit;
11
+ var totalMonthlyFee = subscriptionFee;
12
+ extraCharges.forEach(function(charge) {
13
+ if (charge.type === 'upfront') {
14
+ totalUpfrontFee += charge.amount;
15
+ } else if (charge.type === 'monthly') {
16
+ totalMonthlyFee += charge.amount;
17
+ }
18
+ });
19
+ if (couponCode && couponType === 'upfront') {
20
+ totalUpfrontFee -= discountAmount || 0;
21
+ }
22
+ if (couponCode && couponType === 'monthly') {
23
+ totalMonthlyFee -= discountAmount || 0;
24
+ }
25
+ var getFeeValue = function(key) {
26
+ switch(key){
27
+ case 'startFee':
28
+ return startFee;
29
+ case 'reservationFee':
30
+ return reservationFee;
31
+ case 'deposit':
32
+ return deposit;
33
+ case 'subscriptionFee':
34
+ return subscriptionFee;
35
+ default:
36
+ return null;
37
+ }
38
+ };
39
+ return /*#__PURE__*/ _jsx(View, {
40
+ children: /*#__PURE__*/ _jsx(SectionBoxNew, {
41
+ topContent: /*#__PURE__*/ _jsxs(_Fragment, {
42
+ children: [
43
+ /*#__PURE__*/ _jsx(Text, {
44
+ style: {
45
+ textTransform: 'uppercase',
46
+ fontSize: 12,
47
+ fontWeight: 'bold'
48
+ },
49
+ children: t === null || t === void 0 ? void 0 : t.title
50
+ }),
51
+ /*#__PURE__*/ _jsx(Text, {
52
+ style: {
53
+ fontWeight: 'bold',
54
+ color: colors.black,
55
+ letterSpacing: 1
56
+ },
57
+ children: t === null || t === void 0 ? void 0 : t.fees.upfront.title
58
+ }),
59
+ t === null || t === void 0 ? void 0 : t.fees.upfront.content.map(function(fee) {
60
+ var _getFeeValue;
61
+ var feeValue = (_getFeeValue = getFeeValue(fee.key)) === null || _getFeeValue === void 0 ? void 0 : _getFeeValue.toFixed(2);
62
+ if (feeValue === '0.00') {
63
+ return null;
64
+ }
65
+ return /*#__PURE__*/ _jsxs(View, {
66
+ style: {
67
+ justifyContent: 'space-between',
68
+ flexDirection: 'row',
69
+ rowGap: 8
70
+ },
71
+ children: [
72
+ /*#__PURE__*/ _jsx(Text, {
73
+ style: {
74
+ paddingRight: 4,
75
+ letterSpacing: 1,
76
+ color: colors.primary3
77
+ },
78
+ children: fee.title
79
+ }),
80
+ /*#__PURE__*/ _jsx(Text, {
81
+ style: {
82
+ color: colors.primary3,
83
+ letterSpacing: 1
84
+ },
85
+ children: feeValue !== null ? feeValue : ''
86
+ })
87
+ ]
88
+ }, fee.key);
89
+ }),
90
+ quotation.fees.extraCharges.length > 0 && /*#__PURE__*/ _jsx(_Fragment, {
91
+ children: quotation.fees.extraCharges.filter(function(charge) {
92
+ return charge.amount > 0;
93
+ }).filter(function(charge) {
94
+ return charge.type === 'upfront';
95
+ }).map(function(charge, i) {
96
+ return /*#__PURE__*/ _jsxs(View, {
97
+ style: {
98
+ justifyContent: 'space-between',
99
+ flexDirection: 'row',
100
+ rowGap: 8
101
+ },
102
+ children: [
103
+ /*#__PURE__*/ _jsxs(Text, {
104
+ style: {
105
+ paddingRight: 4,
106
+ letterSpacing: 1,
107
+ color: colors.primary3
108
+ },
109
+ children: [
110
+ t === null || t === void 0 ? void 0 : t.fees.extraCharge,
111
+ " - ",
112
+ charge.description
113
+ ]
114
+ }),
115
+ /*#__PURE__*/ _jsx(Text, {
116
+ style: {
117
+ color: colors.primary3,
118
+ letterSpacing: 1
119
+ },
120
+ children: charge.amount.toFixed(2)
121
+ })
122
+ ]
123
+ }, i);
124
+ })
125
+ }),
126
+ quotation.fees.couponCode !== null && quotation.fees.couponType === 'upfront' && /*#__PURE__*/ _jsx(_Fragment, {
127
+ children: /*#__PURE__*/ _jsxs(View, {
128
+ style: {
129
+ justifyContent: 'space-between',
130
+ flexDirection: 'row',
131
+ rowGap: 8
132
+ },
133
+ children: [
134
+ /*#__PURE__*/ _jsxs(Text, {
135
+ style: {
136
+ paddingRight: 4,
137
+ letterSpacing: 1,
138
+ color: colors.primary3
139
+ },
140
+ children: [
141
+ t === null || t === void 0 ? void 0 : t.fees.promo,
142
+ " - ",
143
+ quotation.fees.couponCode
144
+ ]
145
+ }),
146
+ /*#__PURE__*/ _jsx(Text, {
147
+ style: {
148
+ color: colors.accent4,
149
+ letterSpacing: 1
150
+ },
151
+ children: (_quotation_fees_discountAmount = quotation.fees.discountAmount) === null || _quotation_fees_discountAmount === void 0 ? void 0 : _quotation_fees_discountAmount.toFixed(2)
152
+ })
153
+ ]
154
+ })
155
+ }),
156
+ /*#__PURE__*/ _jsxs(View, {
157
+ style: {
158
+ backgroundColor: colors.primary1,
159
+ borderTop: "1px solid ".concat(colors.primary1),
160
+ justifyContent: 'space-between',
161
+ flexDirection: 'row',
162
+ padding: 4
163
+ },
164
+ children: [
165
+ /*#__PURE__*/ _jsx(Text, {
166
+ style: {
167
+ letterSpacing: 1,
168
+ paddingRight: 4
169
+ },
170
+ children: "Total"
171
+ }),
172
+ /*#__PURE__*/ _jsx(Text, {
173
+ style: {
174
+ letterSpacing: 1
175
+ },
176
+ children: formatMoney(totalUpfrontFee)
177
+ })
178
+ ]
179
+ }),
180
+ /*#__PURE__*/ _jsx(View, {
181
+ style: {
182
+ borderBottom: "1px solid ".concat(colors.primary2)
183
+ }
184
+ }),
185
+ /*#__PURE__*/ _jsx(Text, {
186
+ style: {
187
+ fontWeight: 'bold',
188
+ color: colors.black,
189
+ letterSpacing: 1
190
+ },
191
+ children: t === null || t === void 0 ? void 0 : t.fees.monthly.title
192
+ }),
193
+ t === null || t === void 0 ? void 0 : t.fees.monthly.content.map(function(fee) {
194
+ var _getFeeValue;
195
+ var feeValue = (_getFeeValue = getFeeValue(fee.key)) === null || _getFeeValue === void 0 ? void 0 : _getFeeValue.toFixed(2);
196
+ return /*#__PURE__*/ _jsxs(View, {
197
+ style: {
198
+ justifyContent: 'space-between',
199
+ flexDirection: 'row',
200
+ rowGap: 8
201
+ },
202
+ children: [
203
+ /*#__PURE__*/ _jsx(Text, {
204
+ style: {
205
+ paddingRight: 4,
206
+ letterSpacing: 1,
207
+ color: colors.primary3
208
+ },
209
+ children: fee.title
210
+ }),
211
+ /*#__PURE__*/ _jsx(Text, {
212
+ style: {
213
+ color: colors.primary3,
214
+ letterSpacing: 1
215
+ },
216
+ children: feeValue !== null ? feeValue : ''
217
+ })
218
+ ]
219
+ }, fee.key);
220
+ }),
221
+ quotation.fees.extraCharges.length > 0 && /*#__PURE__*/ _jsx(_Fragment, {
222
+ children: quotation.fees.extraCharges.filter(function(charge) {
223
+ return charge.type === 'monthly';
224
+ }).map(function(charge, i) {
225
+ return /*#__PURE__*/ _jsxs(View, {
226
+ style: {
227
+ justifyContent: 'space-between',
228
+ flexDirection: 'row',
229
+ rowGap: 8
230
+ },
231
+ children: [
232
+ /*#__PURE__*/ _jsxs(Text, {
233
+ style: {
234
+ paddingRight: 4,
235
+ letterSpacing: 1,
236
+ color: colors.primary3
237
+ },
238
+ children: [
239
+ t === null || t === void 0 ? void 0 : t.fees.extraCharge,
240
+ " - ",
241
+ charge.description
242
+ ]
243
+ }),
244
+ /*#__PURE__*/ _jsx(Text, {
245
+ style: {
246
+ color: colors.primary3,
247
+ letterSpacing: 1
248
+ },
249
+ children: charge.amount.toFixed(2)
250
+ })
251
+ ]
252
+ }, i);
253
+ })
254
+ }),
255
+ quotation.fees.couponCode !== null && quotation.fees.couponType === 'monthly' && /*#__PURE__*/ _jsx(_Fragment, {
256
+ children: /*#__PURE__*/ _jsxs(View, {
257
+ style: {
258
+ justifyContent: 'space-between',
259
+ flexDirection: 'row',
260
+ rowGap: 8
261
+ },
262
+ children: [
263
+ /*#__PURE__*/ _jsxs(Text, {
264
+ style: {
265
+ paddingRight: 4,
266
+ letterSpacing: 1,
267
+ color: colors.primary3
268
+ },
269
+ children: [
270
+ t === null || t === void 0 ? void 0 : t.fees.promo,
271
+ " - ",
272
+ quotation.fees.couponCode
273
+ ]
274
+ }),
275
+ /*#__PURE__*/ _jsx(Text, {
276
+ style: {
277
+ color: colors.accent4,
278
+ letterSpacing: 1
279
+ },
280
+ children: (_quotation_fees_discountAmount1 = quotation.fees.discountAmount) === null || _quotation_fees_discountAmount1 === void 0 ? void 0 : _quotation_fees_discountAmount1.toFixed(2)
281
+ })
282
+ ]
283
+ })
284
+ }),
285
+ /*#__PURE__*/ _jsxs(View, {
286
+ style: {
287
+ backgroundColor: colors.primary1,
288
+ borderTop: "1px solid ".concat(colors.primary1),
289
+ justifyContent: 'space-between',
290
+ flexDirection: 'row',
291
+ padding: 4
292
+ },
293
+ children: [
294
+ /*#__PURE__*/ _jsx(Text, {
295
+ style: {
296
+ letterSpacing: 1,
297
+ paddingRight: 4
298
+ },
299
+ children: "Total"
300
+ }),
301
+ /*#__PURE__*/ _jsx(Text, {
302
+ style: {
303
+ letterSpacing: 1
304
+ },
305
+ children: formatMoney(totalMonthlyFee)
306
+ })
307
+ ]
308
+ })
309
+ ]
310
+ }),
311
+ bottomContent: /*#__PURE__*/ _jsx(_Fragment, {
312
+ children: /*#__PURE__*/ _jsxs(View, {
313
+ style: {
314
+ rowGap: 16
315
+ },
316
+ children: [
317
+ /*#__PURE__*/ _jsx(Text, {
318
+ style: {
319
+ textTransform: 'uppercase',
320
+ fontSize: 12,
321
+ fontWeight: 'bold',
322
+ letterSpacing: 1
323
+ },
324
+ children: t === null || t === void 0 ? void 0 : t.fees.dueToday.title
325
+ }),
326
+ /*#__PURE__*/ _jsx(Text, {
327
+ style: {
328
+ color: colors.primary3,
329
+ letterSpacing: 1
330
+ },
331
+ children: t === null || t === void 0 ? void 0 : t.fees.dueToday.description
332
+ }),
333
+ /*#__PURE__*/ _jsxs(View, {
334
+ style: {
335
+ justifyContent: 'space-between',
336
+ flexDirection: 'row'
337
+ },
338
+ children: [
339
+ /*#__PURE__*/ _jsxs(Text, {
340
+ style: {
341
+ letterSpacing: 1,
342
+ color: colors.primary3
343
+ },
344
+ children: [
345
+ " ",
346
+ t === null || t === void 0 ? void 0 : t.fees.dueToday.subTotal
347
+ ]
348
+ }),
349
+ /*#__PURE__*/ _jsx(Text, {
350
+ style: {
351
+ letterSpacing: 1,
352
+ color: colors.primary3
353
+ },
354
+ children: quotation.fees.amountBeforeTax.toFixed(2)
355
+ })
356
+ ]
357
+ }),
358
+ /*#__PURE__*/ _jsxs(View, {
359
+ style: {
360
+ justifyContent: 'space-between',
361
+ flexDirection: 'row'
362
+ },
363
+ children: [
364
+ /*#__PURE__*/ _jsxs(Text, {
365
+ style: {
366
+ letterSpacing: 1,
367
+ color: colors.primary3
368
+ },
369
+ children: [
370
+ " ",
371
+ t === null || t === void 0 ? void 0 : t.fees.dueToday.serviceFee
372
+ ]
373
+ }),
374
+ /*#__PURE__*/ _jsx(Text, {
375
+ style: {
376
+ letterSpacing: 1,
377
+ color: colors.primary3
378
+ },
379
+ children: quotation.fees.taxAmount.toFixed(2)
380
+ })
381
+ ]
382
+ }),
383
+ /*#__PURE__*/ _jsxs(View, {
384
+ style: {
385
+ backgroundColor: colors.primary1,
386
+ borderTop: "1px solid ".concat(colors.primary1),
387
+ justifyContent: 'space-between',
388
+ flexDirection: 'row',
389
+ padding: 4
390
+ },
391
+ children: [
392
+ /*#__PURE__*/ _jsx(Text, {
393
+ style: {
394
+ letterSpacing: 1,
395
+ paddingRight: 4,
396
+ fontWeight: 'bold'
397
+ },
398
+ children: t === null || t === void 0 ? void 0 : t.fees.dueToday.grandTotal
399
+ }),
400
+ /*#__PURE__*/ _jsx(Text, {
401
+ style: {
402
+ letterSpacing: 1,
403
+ fontWeight: 'bold'
404
+ },
405
+ children: formatMoney(quotation.fees.amountAfterTax)
406
+ })
407
+ ]
408
+ })
409
+ ]
410
+ })
411
+ })
412
+ })
413
+ });
414
+ };
415
+ export default Pricing;
@@ -0,0 +1,8 @@
1
+ import { Quotation } from '@driveflux/db';
2
+ import { FC, PropsWithChildren } from 'react';
3
+ type Props = {
4
+ quotation: Quotation;
5
+ };
6
+ declare const QuotationPdfPage: FC<PropsWithChildren<Props>>;
7
+ export default QuotationPdfPage;
8
+ //# sourceMappingURL=QuotationPdfPage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QuotationPdfPage.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/QuotationPdfPage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAGzC,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAI7C,KAAK,KAAK,GAAG;IACX,SAAS,EAAE,SAAS,CAAA;CACrB,CAAA;AAED,QAAA,MAAM,gBAAgB,EAAE,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAWlD,CAAA;AAED,eAAe,gBAAgB,CAAA"}
@@ -0,0 +1,30 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { View } from '@react-pdf/renderer';
3
+ import { format } from 'date-fns';
4
+ import StandardPage from '../../components/StandardPage.js';
5
+ import Header from './Header.js';
6
+ var QuotationPdfPage = function(param) {
7
+ var quotation = param.quotation, children = param.children;
8
+ return /*#__PURE__*/ _jsxs(StandardPage, {
9
+ style: {
10
+ padding: 40,
11
+ fontSize: 10,
12
+ gap: 16
13
+ },
14
+ children: [
15
+ /*#__PURE__*/ _jsx(Header, {
16
+ tTitle: 'Quotation',
17
+ quotationId: quotation.id,
18
+ quotationDate: format(quotation.createdAt, 'dd-MM-yyyy')
19
+ }),
20
+ /*#__PURE__*/ _jsx(View, {
21
+ style: {
22
+ flex: 1,
23
+ rowGap: 24
24
+ },
25
+ children: children
26
+ })
27
+ ]
28
+ });
29
+ };
30
+ export default QuotationPdfPage;
@@ -0,0 +1,8 @@
1
+ import { FC, ReactNode } from 'react';
2
+ type Props = {
3
+ topContent: ReactNode;
4
+ bottomContent: ReactNode;
5
+ };
6
+ declare const SectionBoxNew: FC<Props>;
7
+ export default SectionBoxNew;
8
+ //# sourceMappingURL=SectionBoxNew.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SectionBoxNew.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/SectionBoxNew.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGrC,KAAK,KAAK,GAAG;IACX,UAAU,EAAE,SAAS,CAAA;IACrB,aAAa,EAAE,SAAS,CAAA;CACzB,CAAA;AAED,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,KAAK,CAQ5B,CAAA;AAED,eAAe,aAAa,CAAA"}
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { View } from '@react-pdf/renderer';
3
+ import { colors } from '../../theme/colors.js';
4
+ var SectionBoxNew = function(param) {
5
+ var topContent = param.topContent, bottomContent = param.bottomContent;
6
+ return /*#__PURE__*/ _jsxs(View, {
7
+ style: {
8
+ border: "1px solid ".concat(colors.primary2)
9
+ },
10
+ children: [
11
+ /*#__PURE__*/ _jsx(View, {
12
+ style: {
13
+ padding: 16,
14
+ rowGap: 16
15
+ },
16
+ children: topContent
17
+ }),
18
+ /*#__PURE__*/ _jsx(View, {
19
+ style: {
20
+ borderBottom: "1px solid ".concat(colors.primary2)
21
+ }
22
+ }),
23
+ /*#__PURE__*/ _jsx(View, {
24
+ style: {
25
+ padding: 16,
26
+ rowGap: 16
27
+ },
28
+ children: bottomContent
29
+ })
30
+ ]
31
+ });
32
+ };
33
+ export default SectionBoxNew;
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ import { QuotationPdfTranslation } from './translations.js';
3
+ type Props = {
4
+ t: QuotationPdfTranslation['terms'];
5
+ };
6
+ declare const TermsSection: FC<Props>;
7
+ export default TermsSection;
8
+ //# sourceMappingURL=TermsSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TermsSection.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/TermsSection.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAE3D,KAAK,KAAK,GAAG;IACX,CAAC,EAAE,uBAAuB,CAAC,OAAO,CAAC,CAAA;CACpC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,EAAE,CAAC,KAAK,CAgB3B,CAAA;AAED,eAAe,YAAY,CAAA"}
@@ -0,0 +1,50 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Text, View } from '@react-pdf/renderer';
3
+ import { colors } from '../../theme/colors.js';
4
+ var TermsSection = function(param) {
5
+ var t = param.t;
6
+ return /*#__PURE__*/ _jsxs(View, {
7
+ style: {
8
+ gap: 16
9
+ },
10
+ children: [
11
+ /*#__PURE__*/ _jsx(Text, {
12
+ style: {
13
+ fontWeight: 'bold',
14
+ color: colors.black,
15
+ letterSpacing: 1,
16
+ textTransform: 'uppercase'
17
+ },
18
+ children: t === null || t === void 0 ? void 0 : t.title
19
+ }),
20
+ /*#__PURE__*/ _jsx(View, {
21
+ children: t.content.map(function(line, i) {
22
+ return /*#__PURE__*/ _jsxs(View, {
23
+ style: {
24
+ flexDirection: 'row',
25
+ alignItems: 'flex-start'
26
+ },
27
+ children: [
28
+ /*#__PURE__*/ _jsx(Text, {
29
+ style: {
30
+ marginRight: 4,
31
+ fontSize: 8
32
+ },
33
+ children: "•"
34
+ }),
35
+ /*#__PURE__*/ _jsx(Text, {
36
+ style: {
37
+ color: colors.primary3,
38
+ letterSpacing: 1,
39
+ fontSize: 8
40
+ },
41
+ children: line
42
+ })
43
+ ]
44
+ }, i);
45
+ })
46
+ })
47
+ ]
48
+ });
49
+ };
50
+ export default TermsSection;
@@ -0,0 +1,9 @@
1
+ import { Quotation } from '@driveflux/db';
2
+ import { PdfTemplatesSupportedLocales } from '../../types.js';
3
+ type Options = {
4
+ locale?: PdfTemplatesSupportedLocales;
5
+ quotation: Quotation;
6
+ };
7
+ export declare const generateQuotationPdf: ({ locale, quotation }: Options, fileName: string) => Promise<void>;
8
+ export {};
9
+ //# sourceMappingURL=index.d.ts.map