@loczer/storefront-sdk 0.192.0 → 0.193.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 (29) hide show
  1. package/dist/components/ContractSaleDocument/DocumentAcceptanceSection.d.ts +10 -0
  2. package/dist/components/ContractSaleDocument/DocumentAcceptanceSection.d.ts.map +1 -0
  3. package/dist/components/ContractSaleDocument/DocumentAcceptanceSection.js +104 -0
  4. package/dist/components/ContractSaleDocument/Invoice.d.ts +2 -2
  5. package/dist/components/ContractSaleDocument/Invoice.d.ts.map +1 -1
  6. package/dist/components/ContractSaleDocument/Invoice.js +182 -135
  7. package/dist/components/ContractSaleDocument/InvoiceDetails.d.ts.map +1 -1
  8. package/dist/components/ContractSaleDocument/InvoiceDetails.js +106 -138
  9. package/dist/components/ContractSaleDocument/TermsAndConditionsContent.d.ts +0 -2
  10. package/dist/components/ContractSaleDocument/TermsAndConditionsContent.d.ts.map +1 -1
  11. package/dist/components/ContractSaleDocument/TermsAndConditionsContent.js +32 -37
  12. package/dist/i18n/en.d.ts +4 -0
  13. package/dist/i18n/en.d.ts.map +1 -1
  14. package/dist/i18n/en.js +4 -0
  15. package/dist/i18n/fr.d.ts +4 -0
  16. package/dist/i18n/fr.d.ts.map +1 -1
  17. package/dist/i18n/fr.js +4 -0
  18. package/dist/index.d.ts +121 -9
  19. package/dist/index.js +5 -5
  20. package/dist/lib/contractSaleDocument.d.ts +44 -3
  21. package/dist/lib/contractSaleDocument.d.ts.map +1 -1
  22. package/dist/lib/contractSaleDocument.js +33 -17
  23. package/dist/lib/contractSaleDocumentApi.d.ts +54 -6
  24. package/dist/lib/contractSaleDocumentApi.d.ts.map +1 -1
  25. package/dist/lib/contractSaleDocumentApi.js +41 -37
  26. package/dist/pages/ContractSaleDocumentPage.d.ts +21 -9
  27. package/dist/pages/ContractSaleDocumentPage.d.ts.map +1 -1
  28. package/dist/storefront.css +1 -1
  29. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
1
  import { formatContractSaleDocumentLabel as e, formatContractSaleDocumentLegalLabel as t } from "./language.js";
2
- import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
2
+ import { DocumentAcceptanceSection as n } from "./DocumentAcceptanceSection.js";
3
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
3
4
  import { useTranslation as a } from "react-i18next";
4
5
  //#region src/components/ContractSaleDocument/InvoiceDetails.tsx
5
6
  function o(e) {
@@ -17,9 +18,25 @@ function s(e, t, n) {
17
18
  return `${e.toFixed(2)} ${r}`;
18
19
  }
19
20
  }
20
- function c({ saleDocument: c, items: l, subtotal: u, tax: d, total: f, formatDate: p, documentLanguage: m, showInvoiceMeta: h = !0, showTotalsSection: g = !0, showNotesSection: _ = !0, showAcceptanceSection: v = !0, documentQrCodeUrl: y }) {
21
- let { t: b } = a(), x = (t, n = {}) => e(b, m, t, n), S = (e, n = {}) => t(b, m, e, n), C = (e, t = {}) => {
22
- let n = x(e, t), a = n.indexOf(" / ");
21
+ function c(e, t, n) {
22
+ let r = e instanceof Date ? e : new Date(e);
23
+ if (Number.isNaN(r.getTime())) return "-";
24
+ try {
25
+ return new Intl.DateTimeFormat(t, {
26
+ dateStyle: "long",
27
+ timeStyle: "short",
28
+ ...n ? { timeZone: n } : {}
29
+ }).format(r);
30
+ } catch {
31
+ return new Intl.DateTimeFormat(t, {
32
+ dateStyle: "long",
33
+ timeStyle: "short"
34
+ }).format(r);
35
+ }
36
+ }
37
+ function l({ saleDocument: l, items: u, subtotal: d, tax: f, total: p, formatDate: m, documentLanguage: h, showInvoiceMeta: g = !0, showTotalsSection: _ = !0, showNotesSection: v = !0, showAcceptanceSection: y = !0, documentQrCodeUrl: b }) {
38
+ let { t: x } = a(), S = (t, n = {}) => e(x, h, t, n), C = (e, n = {}) => t(x, h, e, n), w = (e, t = {}) => {
39
+ let n = S(e, t), a = n.indexOf(" / ");
23
40
  return a === -1 ? /* @__PURE__ */ r("span", { children: n }) : /* @__PURE__ */ i("span", {
24
41
  className: "inline-flex flex-col text-left leading-snug",
25
42
  children: [/* @__PURE__ */ r("span", { children: n.slice(0, a) }), /* @__PURE__ */ r("span", {
@@ -27,23 +44,23 @@ function c({ saleDocument: c, items: l, subtotal: u, tax: d, total: f, formatDat
27
44
  children: n.slice(a + 3)
28
45
  })]
29
46
  });
30
- }, w = !g && !_ && !v, T = o(c.issuer.address), E = o(c.recipient.address), D = c.recipient.email?.trim() ?? "", O = c.acceptance?.mode === "signature" ? c.acceptance : null, k = c.acceptance?.mode === "acceptance" ? c.acceptance : null, A = c.acceptanceLevel === "signature" || O !== null, j = c.kind === "credit_note", M = x(j ? "docs_contract_sale_credit_note_title" : c.kind === "quote" ? "docs_contract_sale_quote_title" : "docs_contract_sale_invoice_title"), N = x(j ? "docs_contract_sale_credit_note_date_label" : c.kind === "quote" ? "docs_contract_sale_quote_date_label" : "docs_contract_sale_invoice_date_label"), P = x(j ? "docs_contract_sale_credit_note_recipient_label" : "docs_contract_sale_invoice_recipient_label"), F = j ? -1 : 1;
47
+ }, T = !_ && !v && !y, E = o(l.issuer.address), D = o(l.recipient.address), O = l.recipient.email?.trim() ?? "", k = l.kind === "credit_note", A = S(k ? "docs_contract_sale_credit_note_title" : l.kind === "quote" ? "docs_contract_sale_quote_title" : "docs_contract_sale_invoice_title"), j = S(k ? "docs_contract_sale_credit_note_date_label" : l.kind === "quote" ? "docs_contract_sale_quote_date_label" : "docs_contract_sale_invoice_date_label"), M = S(k ? "docs_contract_sale_credit_note_recipient_label" : "docs_contract_sale_invoice_recipient_label"), N = k ? -1 : 1;
31
48
  return /* @__PURE__ */ i("main", {
32
49
  className: "flex flex-grow flex-col px-4 md:px-8",
33
50
  children: [
34
- h && /* @__PURE__ */ i("header", {
51
+ g && /* @__PURE__ */ i("header", {
35
52
  className: "mb-8 grid gap-6",
36
53
  children: [/* @__PURE__ */ i("div", {
37
54
  className: "grid gap-6 md:grid-cols-2 md:gap-8",
38
55
  children: [/* @__PURE__ */ i("div", { children: [/* @__PURE__ */ i("h1", {
39
56
  className: "flex flex-wrap items-baseline gap-x-2 gap-y-1 text-xl font-semibold text-foreground",
40
- children: [/* @__PURE__ */ r("span", { children: M }), /* @__PURE__ */ i("span", {
57
+ children: [/* @__PURE__ */ r("span", { children: A }), /* @__PURE__ */ i("span", {
41
58
  className: "font-normal text-muted-foreground",
42
- children: ["#", c.saleDocumentNumber]
59
+ children: ["#", l.saleDocumentNumber]
43
60
  })]
44
- }), y ? /* @__PURE__ */ r("img", {
45
- src: y,
46
- alt: b("docs_contract_sale_qr_alt"),
61
+ }), b ? /* @__PURE__ */ r("img", {
62
+ src: b,
63
+ alt: x("docs_contract_sale_qr_alt"),
47
64
  className: "mt-4 block h-24 w-24",
48
65
  "data-testid": "contract-sale-document-public-url-qr"
49
66
  }) : null] }), /* @__PURE__ */ i("div", {
@@ -52,76 +69,115 @@ function c({ saleDocument: c, items: l, subtotal: u, tax: d, total: f, formatDat
52
69
  className: "mb-2",
53
70
  children: [/* @__PURE__ */ r("p", {
54
71
  className: "font-semibold text-foreground",
55
- children: N
72
+ children: j
56
73
  }), /* @__PURE__ */ r("p", {
57
74
  className: "text-muted-foreground",
58
- children: p(c.date)
75
+ children: m(l.date)
59
76
  })]
60
77
  }), /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r("p", {
61
78
  className: "font-semibold text-foreground",
62
- children: x("docs_contract_sale_due_date_label")
79
+ children: S("docs_contract_sale_due_date_label")
63
80
  }), /* @__PURE__ */ r("p", {
64
81
  className: "text-muted-foreground",
65
- children: p(c.dueDate)
82
+ children: m(l.dueDate)
66
83
  })] })]
67
84
  })]
68
85
  }), /* @__PURE__ */ i("div", {
69
86
  className: "grid gap-6 md:grid-cols-2 md:gap-8",
70
87
  children: [/* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r("h2", {
71
88
  className: "text-xl font-semibold text-primary",
72
- children: c.issuer.name
73
- }), T ? /* @__PURE__ */ r("p", {
89
+ children: l.issuer.name
90
+ }), E ? /* @__PURE__ */ r("p", {
74
91
  className: "text-muted-foreground whitespace-pre-line",
75
- children: T
92
+ children: E
76
93
  }) : null] }), /* @__PURE__ */ i("div", {
77
94
  className: "md:text-right",
78
95
  children: [
79
96
  /* @__PURE__ */ r("h3", {
80
97
  className: "mb-2 font-semibold text-foreground",
81
- children: P
98
+ children: M
82
99
  }),
83
100
  /* @__PURE__ */ r("p", {
84
101
  className: "font-bold text-foreground",
85
- children: c.recipient.name
102
+ children: l.recipient.name
86
103
  }),
87
- E ? /* @__PURE__ */ r("p", {
104
+ D ? /* @__PURE__ */ r("p", {
88
105
  className: "text-muted-foreground whitespace-pre-line",
89
- children: E
106
+ children: D
90
107
  }) : null,
91
- D ? /* @__PURE__ */ r("p", {
108
+ O ? /* @__PURE__ */ r("p", {
92
109
  className: "text-muted-foreground",
93
- children: D
110
+ children: O
94
111
  }) : null
95
112
  ]
96
113
  })]
97
114
  })]
98
115
  }),
116
+ g && l.rental ? /* @__PURE__ */ i("section", {
117
+ className: "mb-6 border-y border-border py-3",
118
+ "data-testid": "contract-sale-document-rental-details",
119
+ children: [/* @__PURE__ */ i("div", {
120
+ className: "mb-2 flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1",
121
+ children: [/* @__PURE__ */ r("h3", {
122
+ className: "font-semibold text-foreground",
123
+ children: /* @__PURE__ */ r("span", { children: S("docs_contract_sale_rental_details_title") })
124
+ }), /* @__PURE__ */ r("p", {
125
+ className: "text-xs text-muted-foreground",
126
+ children: /* @__PURE__ */ i("span", { children: [
127
+ S("docs_contract_sale_booking_number_label"),
128
+ ": ",
129
+ l.rental.bookingNumber
130
+ ] })
131
+ })]
132
+ }), /* @__PURE__ */ i("dl", {
133
+ className: "grid gap-3 text-sm md:grid-cols-2 md:gap-6",
134
+ children: [/* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r("dt", {
135
+ className: "font-medium text-foreground",
136
+ children: /* @__PURE__ */ r("span", { children: S("docs_contract_sale_rental_start_label") })
137
+ }), /* @__PURE__ */ i("dd", {
138
+ className: "text-muted-foreground",
139
+ children: [/* @__PURE__ */ r("span", { children: c(l.rental.start, h.legal, l.rental.timeZone) }), l.rental.pickupAddress ? /* @__PURE__ */ r("span", {
140
+ className: "block whitespace-pre-line",
141
+ children: l.rental.pickupAddress
142
+ }) : null]
143
+ })] }), /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r("dt", {
144
+ className: "font-medium text-foreground",
145
+ children: /* @__PURE__ */ r("span", { children: S("docs_contract_sale_rental_end_label") })
146
+ }), /* @__PURE__ */ i("dd", {
147
+ className: "text-muted-foreground",
148
+ children: [/* @__PURE__ */ r("span", { children: c(l.rental.end, h.legal, l.rental.timeZone) }), l.rental.returnAddress ? /* @__PURE__ */ r("span", {
149
+ className: "block whitespace-pre-line",
150
+ children: l.rental.returnAddress
151
+ }) : null]
152
+ })] })]
153
+ })]
154
+ }) : null,
99
155
  /* @__PURE__ */ i("section", {
100
- className: w ? "mb-0 flex flex-grow flex-col" : "mb-8",
156
+ className: T ? "mb-0 flex flex-grow flex-col" : "mb-8",
101
157
  children: [/* @__PURE__ */ i("div", {
102
158
  className: "flex bg-muted p-2 text-xs font-semibold text-muted-foreground md:p-3 md:text-base",
103
159
  children: [
104
160
  /* @__PURE__ */ r("div", {
105
161
  className: "w-5/12 pr-2 md:w-1/2",
106
- children: /* @__PURE__ */ r("span", { children: S("docs_contract_sale_description_label") })
162
+ children: /* @__PURE__ */ r("span", { children: C("docs_contract_sale_description_label") })
107
163
  }),
108
164
  /* @__PURE__ */ r("div", {
109
165
  className: "w-1/6 text-center",
110
- children: /* @__PURE__ */ r("span", { children: S("docs_contract_sale_quantity_label") })
166
+ children: /* @__PURE__ */ r("span", { children: C("docs_contract_sale_quantity_label") })
111
167
  }),
112
168
  /* @__PURE__ */ r("div", {
113
169
  className: "w-3/12 text-right md:w-1/6",
114
- children: /* @__PURE__ */ r("span", { children: S("docs_contract_sale_unit_price_label") })
170
+ children: /* @__PURE__ */ r("span", { children: C("docs_contract_sale_unit_price_label") })
115
171
  }),
116
172
  /* @__PURE__ */ r("div", {
117
173
  className: "w-1/6 text-right",
118
- children: /* @__PURE__ */ r("span", { children: S("docs_contract_sale_line_total_label") })
174
+ children: /* @__PURE__ */ r("span", { children: C("docs_contract_sale_line_total_label") })
119
175
  })
120
176
  ]
121
177
  }), /* @__PURE__ */ r("div", {
122
- className: w ? "flex flex-1 flex-col" : "flex flex-col",
123
- children: l.map((e) => {
124
- let t = 1 + (e.taxRate ?? c.taxRate ?? 0);
178
+ className: T ? "flex flex-1 flex-col" : "flex flex-col",
179
+ children: u.map((e) => {
180
+ let t = 1 + (e.taxRate ?? l.taxRate ?? 0);
125
181
  return /* @__PURE__ */ i("div", {
126
182
  className: "flex items-center border-b border-border p-2 text-sm md:p-3 md:text-base",
127
183
  children: [
@@ -141,18 +197,18 @@ function c({ saleDocument: c, items: l, subtotal: u, tax: d, total: f, formatDat
141
197
  }),
142
198
  /* @__PURE__ */ r("div", {
143
199
  className: "w-3/12 text-right md:w-1/6",
144
- children: /* @__PURE__ */ r("span", { children: s(e.unitPrice / t * F, c.currency, m.customer) })
200
+ children: /* @__PURE__ */ r("span", { children: s(e.unitPrice / t * N, l.currency, h.customer) })
145
201
  }),
146
202
  /* @__PURE__ */ r("div", {
147
203
  className: "w-1/6 text-right",
148
- children: /* @__PURE__ */ r("span", { children: s(e.quantity * e.unitPrice / t * F, c.currency, m.customer) })
204
+ children: /* @__PURE__ */ r("span", { children: s(e.quantity * e.unitPrice / t * N, l.currency, h.customer) })
149
205
  })
150
206
  ]
151
207
  }, e.id);
152
208
  })
153
209
  })]
154
210
  }),
155
- g && /* @__PURE__ */ r("section", {
211
+ _ && /* @__PURE__ */ r("section", {
156
212
  className: "mb-16 flex justify-end",
157
213
  children: /* @__PURE__ */ i("div", {
158
214
  className: "w-full md:w-1/3",
@@ -161,140 +217,52 @@ function c({ saleDocument: c, items: l, subtotal: u, tax: d, total: f, formatDat
161
217
  className: "mb-2 flex items-start justify-between gap-4",
162
218
  children: [/* @__PURE__ */ r("span", {
163
219
  className: "text-muted-foreground",
164
- children: C("docs_contract_sale_subtotal_label")
220
+ children: w("docs_contract_sale_subtotal_label")
165
221
  }), /* @__PURE__ */ r("span", {
166
222
  className: "shrink-0 text-right font-semibold",
167
- children: s(u, c.currency, m.customer)
223
+ children: s(d, l.currency, h.customer)
168
224
  })]
169
225
  }),
170
- d !== 0 && /* @__PURE__ */ i("div", {
226
+ f !== 0 && /* @__PURE__ */ i("div", {
171
227
  className: "mb-2 flex items-start justify-between gap-4",
172
228
  children: [/* @__PURE__ */ r("span", {
173
229
  className: "text-muted-foreground",
174
- children: C("docs_contract_sale_tax_label", { rate: ((c.taxRate ?? 0) * 100).toFixed(0) })
230
+ children: w("docs_contract_sale_tax_label", { rate: ((l.taxRate ?? 0) * 100).toFixed(0) })
175
231
  }), /* @__PURE__ */ r("span", {
176
232
  className: "shrink-0 text-right font-semibold",
177
- children: s(d, c.currency, m.customer)
233
+ children: s(f, l.currency, h.customer)
178
234
  })]
179
235
  }),
180
236
  /* @__PURE__ */ i("div", {
181
237
  className: "mt-2 flex items-start justify-between gap-4 border-t border-border pt-2",
182
238
  children: [/* @__PURE__ */ r("span", {
183
239
  className: "text-xl font-bold",
184
- children: C("docs_contract_sale_total_label")
240
+ children: w("docs_contract_sale_total_label")
185
241
  }), /* @__PURE__ */ r("span", {
186
242
  className: "shrink-0 text-right text-xl font-bold",
187
- children: s(f, c.currency, m.customer)
243
+ children: s(p, l.currency, h.customer)
188
244
  })]
189
245
  })
190
246
  ]
191
247
  })
192
248
  }),
193
- _ && c.notes && /* @__PURE__ */ i("section", {
249
+ v && l.notes && /* @__PURE__ */ i("section", {
194
250
  className: "mb-16",
195
251
  children: [/* @__PURE__ */ r("h3", {
196
252
  className: "mb-4 border-b border-border pb-2 font-semibold text-foreground",
197
- children: x("docs_contract_sale_notes_title")
253
+ children: S("docs_contract_sale_notes_title")
198
254
  }), /* @__PURE__ */ r("div", {
199
255
  className: "gap-8 text-sm text-muted-foreground md:columns-2",
200
- children: /* @__PURE__ */ r("p", { children: c.notes })
256
+ children: /* @__PURE__ */ r("p", { children: l.notes })
201
257
  })]
202
258
  }),
203
- v && (c.acceptanceLevel !== "none" || c.acceptance) ? /* @__PURE__ */ r("section", {
204
- className: "mt-auto border-t border-border pt-8",
205
- children: A ? /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r("p", {
206
- className: "mb-12 text-center text-sm text-muted-foreground",
207
- children: /* @__PURE__ */ r("span", { children: x("docs_contract_sale_signature_acknowledgement") })
208
- }), O ? /* @__PURE__ */ i("div", {
209
- className: "flex flex-col justify-between md:flex-row",
210
- children: [/* @__PURE__ */ i("div", {
211
- className: "mb-8 w-full md:mb-0 md:w-2/5",
212
- children: [
213
- /* @__PURE__ */ r("p", {
214
- className: "font-semibold text-foreground",
215
- children: x("docs_contract_sale_signature_issuer_label")
216
- }),
217
- /* @__PURE__ */ r("p", {
218
- className: "mb-2 mt-2 text-sm text-muted-foreground",
219
- children: /* @__PURE__ */ i("span", { children: [x("docs_contract_sale_signature_date_label"), ": ___________________"] })
220
- }),
221
- /* @__PURE__ */ r("div", { className: "h-24 rounded-lg bg-muted/40" })
222
- ]
223
- }), /* @__PURE__ */ i("div", {
224
- className: "w-full text-left md:w-2/5",
225
- children: [
226
- /* @__PURE__ */ r("p", {
227
- className: "font-semibold text-foreground",
228
- children: x("docs_contract_sale_signature_customer_label")
229
- }),
230
- /* @__PURE__ */ r("p", {
231
- className: "mb-2 mt-2 text-sm text-muted-foreground",
232
- children: /* @__PURE__ */ i("span", { children: [
233
- x("docs_contract_sale_signature_date_label"),
234
- ": ",
235
- p(O.date)
236
- ] })
237
- }),
238
- /* @__PURE__ */ r("div", {
239
- className: "flex h-24 items-center justify-center rounded-lg bg-muted/40 p-2",
240
- children: /* @__PURE__ */ r("img", {
241
- src: O.signature,
242
- alt: x("docs_contract_sale_signature_image_alt"),
243
- className: "max-h-full max-w-full"
244
- })
245
- }),
246
- /* @__PURE__ */ r("p", {
247
- className: "mt-2 text-sm text-foreground",
248
- children: O.name
249
- }),
250
- /* @__PURE__ */ r("p", {
251
- className: "text-sm text-muted-foreground",
252
- children: O.phone
253
- })
254
- ]
255
- })]
256
- }) : /* @__PURE__ */ i("div", {
257
- className: "flex flex-col justify-between md:flex-row",
258
- children: [/* @__PURE__ */ i("div", {
259
- className: "mb-8 w-full md:mb-0 md:w-2/5",
260
- children: [
261
- /* @__PURE__ */ r("p", {
262
- className: "font-semibold text-foreground",
263
- children: x("docs_contract_sale_signature_issuer_label")
264
- }),
265
- /* @__PURE__ */ r("p", {
266
- className: "mb-2 mt-2 text-sm text-muted-foreground",
267
- children: /* @__PURE__ */ i("span", { children: [x("docs_contract_sale_signature_date_label"), ": ___________________"] })
268
- }),
269
- /* @__PURE__ */ r("div", { className: "h-24 rounded-lg bg-muted/40" })
270
- ]
271
- }), /* @__PURE__ */ i("div", {
272
- className: "w-full md:w-2/5",
273
- children: [
274
- /* @__PURE__ */ r("p", {
275
- className: "font-semibold text-foreground",
276
- children: x("docs_contract_sale_signature_customer_label")
277
- }),
278
- /* @__PURE__ */ r("p", {
279
- className: "mb-2 mt-2 text-sm text-muted-foreground",
280
- children: /* @__PURE__ */ i("span", { children: [x("docs_contract_sale_signature_date_label"), ": ___________________"] })
281
- }),
282
- /* @__PURE__ */ r("div", { className: "h-24 rounded-lg bg-muted/40" })
283
- ]
284
- })]
285
- })] }) : /* @__PURE__ */ i("div", {
286
- className: "rounded-lg border border-border bg-muted/30 p-4",
287
- children: [/* @__PURE__ */ r("p", {
288
- className: "text-sm font-medium text-foreground",
289
- children: x(k ? "docs_contract_sale_acceptance_section_accepted_title" : "docs_contract_sale_acceptance_section_required_title")
290
- }), /* @__PURE__ */ r("p", {
291
- className: "mt-1 text-sm text-muted-foreground",
292
- children: k ? x("docs_contract_sale_acceptance_section_accepted_date", { date: p(k.date) }) : x("docs_contract_sale_acceptance_section_required_description")
293
- })]
294
- })
259
+ y ? /* @__PURE__ */ r(n, {
260
+ saleDocument: l,
261
+ documentLanguage: h,
262
+ formatDate: m
295
263
  }) : null
296
264
  ]
297
265
  });
298
266
  }
299
267
  //#endregion
300
- export { c as InvoiceDetails };
268
+ export { l as InvoiceDetails };
@@ -1,6 +1,4 @@
1
1
  import { ContractSaleDocumentTermArticle } from '../../lib/contractSaleDocument';
2
- export declare const DEFAULT_TERMS_TITLE = "Conditions Generales de Vente";
3
- export declare const DEFAULT_TERMS_ARTICLES: ContractSaleDocumentTermArticle[];
4
2
  type TermsAndConditionsContentProps = {
5
3
  title: string;
6
4
  articles: ContractSaleDocumentTermArticle[];
@@ -1 +1 @@
1
- {"version":3,"file":"TermsAndConditionsContent.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/TermsAndConditionsContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAA;AAGrF,eAAO,MAAM,mBAAmB,kCAAkC,CAAA;AAElE,eAAO,MAAM,sBAAsB,EAAE,+BAA+B,EA4BnE,CAAA;AAED,KAAK,8BAA8B,GAAG;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,+BAA+B,EAAE,CAAA;IAC3C,sBAAsB,EAAE,OAAO,CAAA;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,yBAAyB,GAAI,yDAKvC,8BAA8B,4CA4BhC,CAAA"}
1
+ {"version":3,"file":"TermsAndConditionsContent.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/TermsAndConditionsContent.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAA;AAGrF,KAAK,8BAA8B,GAAG;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,+BAA+B,EAAE,CAAA;IAC3C,sBAAsB,EAAE,OAAO,CAAA;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAoDD,eAAO,MAAM,yBAAyB,GAAI,yDAKvC,8BAA8B,4CAoChC,CAAA"}
@@ -1,54 +1,49 @@
1
1
  import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
2
+ import { cn as r } from "@rpcbase/ui";
2
3
  //#region src/components/ContractSaleDocument/TermsAndConditionsContent.tsx
3
- var r = "Conditions Generales de Vente", i = [
4
- {
5
- id: "article-1",
6
- title: "Article 1: Objet",
7
- body: "Le present contrat a pour objet la location du materiel decrit dans la presente facture. Le locataire reconnait avoir recu le materiel en parfait etat de fonctionnement.",
8
- translationTitle: "Article 1: Purpose",
9
- translationBody: "The purpose of this contract is the rental of the equipment described in this invoice. The lessee acknowledges having received the equipment in perfect working order."
10
- },
11
- {
12
- id: "article-2",
13
- title: "Article 2: Duree",
14
- body: "La location prend effet a la date de signature du present contrat et se termine a la date de restitution du materiel. Toute journee commencee est due.",
15
- translationTitle: "Article 2: Duration",
16
- translationBody: "The rental takes effect on the date of signature of this contract and ends on the date of return of the equipment. Any day started is due."
17
- },
18
- {
19
- id: "article-3",
20
- title: "Article 3: Obligations du locataire",
21
- body: "Le locataire s'engage a utiliser le materiel en bon pere de famille et a le restituer dans le meme etat que celui ou il l'a recu. Il est responsable de tout dommage ou perte.",
22
- translationTitle: "Article 3: Lessee's Obligations",
23
- translationBody: "The lessee agrees to use the equipment with due care and to return it in the same condition as received. The lessee is responsible for any damage or loss."
24
- }
25
- ], a = ({ title: r, articles: i, withEnglishTranslation: a, showTitle: o = !0 }) => /* @__PURE__ */ n(e, { children: [o && /* @__PURE__ */ t("h1", {
4
+ var i = r("grid gap-2 text-sm leading-relaxed text-muted-foreground", "[&_a]:underline [&_a]:underline-offset-2", "[&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3", "[&_code]:rounded [&_code]:bg-muted [&_code]:px-1", "[&_img]:max-h-56 [&_img]:max-w-full [&_img]:object-contain", "[&_ol]:list-decimal [&_ol]:space-y-1 [&_ol]:pl-5", "[&_p]:whitespace-pre-wrap", "[&_table]:w-full [&_table]:border-collapse [&_td]:border [&_td]:border-border [&_td]:p-1.5", "[&_th]:border [&_th]:border-border [&_th]:bg-muted [&_th]:p-1.5 [&_th]:font-semibold", "[&_ul]:list-disc [&_ul]:space-y-1 [&_ul]:pl-5");
5
+ function a({ body: e, bodyHtml: n }) {
6
+ return n ? /* @__PURE__ */ t("div", {
7
+ className: i,
8
+ dangerouslySetInnerHTML: { __html: n }
9
+ }) : /* @__PURE__ */ t("p", {
10
+ className: "whitespace-pre-wrap text-sm leading-relaxed text-muted-foreground",
11
+ children: /* @__PURE__ */ t("span", { children: e })
12
+ });
13
+ }
14
+ function o(e) {
15
+ return e.translationBodyHtml === void 0 ? e.translationBody === void 0 ? {
16
+ body: e.body,
17
+ bodyHtml: e.bodyHtml
18
+ } : { body: e.translationBody } : {
19
+ body: e.translationBody ?? e.body,
20
+ bodyHtml: e.translationBodyHtml
21
+ };
22
+ }
23
+ var s = ({ title: r, articles: i, withEnglishTranslation: s, showTitle: c = !0 }) => /* @__PURE__ */ n(e, { children: [c && /* @__PURE__ */ t("h1", {
26
24
  className: "mb-8 text-center text-xl font-serif font-bold text-foreground",
27
25
  children: r
28
26
  }), /* @__PURE__ */ n("div", {
29
- className: `text-sm ${a ? "grid grid-cols-1 gap-8 md:grid-cols-2" : ""}`,
27
+ className: `text-sm ${s ? "grid grid-cols-1 gap-8 md:grid-cols-2" : ""}`,
30
28
  children: [/* @__PURE__ */ t("div", { children: i.map((e) => /* @__PURE__ */ n("section", {
31
29
  className: "mb-4",
32
- children: [/* @__PURE__ */ t("h3", {
30
+ children: [e.title ? /* @__PURE__ */ t("h3", {
33
31
  className: "mb-2 text-left text-lg font-serif font-semibold text-foreground",
34
- children: e.title
35
- }), /* @__PURE__ */ t("p", {
36
- className: "text-muted-foreground",
37
- children: e.body
32
+ children: /* @__PURE__ */ t("span", { children: e.title })
33
+ }) : null, /* @__PURE__ */ t(a, {
34
+ body: e.body,
35
+ bodyHtml: e.bodyHtml
38
36
  })]
39
- }, `fr-${e.id}`)) }), a && /* @__PURE__ */ t("div", {
37
+ }, `fr-${e.id}`)) }), s && /* @__PURE__ */ t("div", {
40
38
  className: "border-t border-border pt-8 md:border-l md:border-t-0 md:pl-8 md:pt-0",
41
39
  children: i.map((e) => /* @__PURE__ */ n("section", {
42
40
  className: "mb-4",
43
- children: [/* @__PURE__ */ t("h3", {
41
+ children: [e.translationTitle ?? e.title ? /* @__PURE__ */ t("h3", {
44
42
  className: "mb-2 text-left text-lg font-serif font-semibold text-foreground",
45
- children: e.translationTitle ?? e.title
46
- }), /* @__PURE__ */ t("p", {
47
- className: "text-muted-foreground",
48
- children: e.translationBody ?? e.body
49
- })]
43
+ children: /* @__PURE__ */ t("span", { children: e.translationTitle ?? e.title })
44
+ }) : null, /* @__PURE__ */ t(a, { ...o(e) })]
50
45
  }, `en-${e.id}`))
51
46
  })]
52
47
  })] });
53
48
  //#endregion
54
- export { i as DEFAULT_TERMS_ARTICLES, r as DEFAULT_TERMS_TITLE, a as TermsAndConditionsContent };
49
+ export { s as TermsAndConditionsContent };
package/dist/i18n/en.d.ts CHANGED
@@ -247,6 +247,10 @@ export declare const storefront: {
247
247
  docs_contract_sale_due_date_label: string;
248
248
  docs_contract_sale_invoice_recipient_label: string;
249
249
  docs_contract_sale_credit_note_recipient_label: string;
250
+ docs_contract_sale_rental_details_title: string;
251
+ docs_contract_sale_booking_number_label: string;
252
+ docs_contract_sale_rental_start_label: string;
253
+ docs_contract_sale_rental_end_label: string;
250
254
  docs_contract_sale_description_label: string;
251
255
  docs_contract_sale_quantity_label: string;
252
256
  docs_contract_sale_unit_price_label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmctB,CAAA"}
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuctB,CAAA"}
package/dist/i18n/en.js CHANGED
@@ -248,6 +248,10 @@ var e = {
248
248
  docs_contract_sale_due_date_label: "Due Date:",
249
249
  docs_contract_sale_invoice_recipient_label: "Bill To:",
250
250
  docs_contract_sale_credit_note_recipient_label: "Issued To:",
251
+ docs_contract_sale_rental_details_title: "Rental details",
252
+ docs_contract_sale_booking_number_label: "Booking",
253
+ docs_contract_sale_rental_start_label: "Start",
254
+ docs_contract_sale_rental_end_label: "Return",
251
255
  docs_contract_sale_description_label: "Description",
252
256
  docs_contract_sale_quantity_label: "Qty",
253
257
  docs_contract_sale_unit_price_label: "Unit price excl. tax",
package/dist/i18n/fr.d.ts CHANGED
@@ -248,6 +248,10 @@ export declare const storefront: {
248
248
  docs_contract_sale_due_date_label: string;
249
249
  docs_contract_sale_invoice_recipient_label: string;
250
250
  docs_contract_sale_credit_note_recipient_label: string;
251
+ docs_contract_sale_rental_details_title: string;
252
+ docs_contract_sale_booking_number_label: string;
253
+ docs_contract_sale_rental_start_label: string;
254
+ docs_contract_sale_rental_end_label: string;
251
255
  docs_contract_sale_description_label: string;
252
256
  docs_contract_sale_quantity_label: string;
253
257
  docs_contract_sale_unit_price_label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../src/i18n/fr.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoctB,CAAA"}
1
+ {"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../src/i18n/fr.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwctB,CAAA"}
package/dist/i18n/fr.js CHANGED
@@ -249,6 +249,10 @@ var e = {
249
249
  docs_contract_sale_due_date_label: "Date d'échéance :",
250
250
  docs_contract_sale_invoice_recipient_label: "Facturé à :",
251
251
  docs_contract_sale_credit_note_recipient_label: "Émis à :",
252
+ docs_contract_sale_rental_details_title: "Détails de la location",
253
+ docs_contract_sale_booking_number_label: "Réservation",
254
+ docs_contract_sale_rental_start_label: "Départ",
255
+ docs_contract_sale_rental_end_label: "Retour",
252
256
  docs_contract_sale_description_label: "Description",
253
257
  docs_contract_sale_quantity_label: "Quantité",
254
258
  docs_contract_sale_unit_price_label: "Prix unitaire HT",