@tesouro/embedded-components-react 0.5.201 → 0.5.202

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 (45) hide show
  1. package/dist/index.d.ts +16 -0
  2. package/dist/index.js +1 -1
  3. package/dist/lib/ReceivablesWidget.d.ts +16 -0
  4. package/dist/lib/ReceivablesWidget.js +1 -1
  5. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +6 -6
  6. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index2.js +24 -18
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index4.js +65 -2
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +188 -45
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index11.js +30 -265
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +144 -64
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +47 -109
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js +293 -216
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +75 -0
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +114 -0
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +237 -0
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index4.js +14 -1
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +28 -243
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index6.js +212 -375
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index7.js +64 -62
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +409 -187
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +73 -40
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +10 -9
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +0 -9
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +4 -1
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +10 -263
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +1 -72
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +241 -398
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +66 -100
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +406 -76
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +92 -330
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +93 -0
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +344 -0
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +6 -1
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +157 -20
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index5.js +24 -1
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +1 -3
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +3 -18
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index8.js +2 -0
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +18 -4
  41. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +37 -37
  42. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +54 -54
  43. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +115 -94
  44. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  45. package/package.json +1 -1
@@ -1,64 +1,66 @@
1
+ import { ATTACHMENT_ACCEPTED_EXTENSIONS as e, ATTACHMENT_ACCEPTED_FORMATS as t } from "./index4.js";
1
2
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index7.js
2
- var e = {
3
- customerRequired: "Customer is required",
4
- customerAddressRequired: "The selected customer needs a billing address before a receivable can be created.",
5
- currencyRequired: "Currency is required",
6
- lineItemNameTooLong: "Product name must be 100 characters or less",
7
- lineItemPriceTooHigh: "Price must be {maxAmount} or less",
8
- sendToRequired: "Enter at least one recipient",
9
- sendSubjectRequired: "Subject is required",
10
- sendBodyRequired: "Message is required",
11
- paymentAmountInvalid: "Amount paid must be greater than 0",
12
- genericError: "Something went wrong. Please try again.",
13
- lineItemsLoading: "Please wait for invoice details to finish loading.",
14
- untitledDocument: "Untitled document",
15
- unknownCustomer: "Unknown customer",
16
- notAvailable: "Not available",
17
- invoiceType: "Invoice",
18
- quoteType: "Quote",
19
- creditNoteType: "Credit note",
20
- summaryDocumentType: "Document type",
21
- summaryDocumentNumber: "Document number",
22
- summaryCustomer: "Customer",
23
- summaryIssued: "Issued",
24
- summaryDue: "Due",
25
- summaryCreated: "Created",
26
- summaryUpdated: "Updated",
27
- summaryTotal: "Total",
28
- summaryAmountDue: "Amount due",
29
- activityStatusChanged: "Status changed",
30
- activityReceivableCreated: "Receivable created",
31
- activityReceivableUpdated: "Receivable updated",
32
- activityPaymentReceived: "Payment received",
33
- activityMailSent: "Email sent",
34
- activityUnknown: "Activity",
35
- recipientsNone: "No recipients",
36
- sendSubjectDefault: "Your receivable document",
37
- sendBodyDefault: "Please find the receivable document attached.",
38
- issueTitle: "Issue receivable?",
39
- issueDescription: "Issuing locks the document and makes it ready to send to the customer.",
40
- issueConfirm: "Issue",
41
- acceptTitle: "Accept quote?",
42
- acceptDescription: "This marks the quote as accepted.",
43
- acceptConfirm: "Accept",
44
- declineTitle: "Decline quote?",
45
- declineDescription: "This marks the quote as declined.",
46
- declineConfirm: "Decline",
47
- cancelTitle: "Cancel receivable?",
48
- cancelDescription: "This cancels the document. You cannot undo this action.",
49
- cancelConfirm: "Cancel document",
50
- cloneTitle: "Clone receivable?",
51
- cloneDescription: "This creates a new draft based on the selected document.",
52
- cloneConfirm: "Clone",
53
- deleteTitle: "Delete draft?",
54
- deleteDescription: "This permanently deletes the draft document. You cannot undo this action.",
55
- deleteConfirm: "Delete",
56
- markPaidTitle: "Mark invoice as paid?",
57
- markPaidDescription: "This records the invoice as fully paid.",
58
- markPaidConfirm: "Mark paid",
59
- markUncollectibleTitle: "Mark invoice uncollectible?",
60
- markUncollectibleDescription: "This records the invoice as uncollectible. You cannot undo this action.",
61
- markUncollectibleConfirm: "Mark uncollectible"
62
- };
3
+ var n = (e) => {
4
+ let t = e.lastIndexOf(".");
5
+ return t >= 0 ? e.slice(t + 1).toLowerCase() : "";
6
+ }, r = (e) => e ? Array.from(e) : [];
7
+ function i(r) {
8
+ let i = t.includes(r.type), a = e.includes(n(r.name));
9
+ return !i && !a ? "unsupported_type" : r.size > 3145728 ? "too_large" : null;
10
+ }
11
+ function a(e) {
12
+ if (e < 1024) return `${e} B`;
13
+ let t = e / 1024;
14
+ return t < 1024 ? `${Math.round(t)} KB` : `${(t / 1024).toFixed(1)} MB`;
15
+ }
16
+ function o(e, t) {
17
+ switch (e) {
18
+ case "uploading": return t.attachmentUploading;
19
+ case "upload_failed": return t.attachmentUploadFailed;
20
+ case "too_large": return t.attachmentTooLarge;
21
+ case "unsupported_type": return t.attachmentUnsupportedType;
22
+ }
23
+ }
24
+ function s({ attachments: n, pendingUploads: r, isCountLimitReached: i, isRecurring: s, messages: c }) {
25
+ let l = s ? c.attachmentsRecurringEmailCaption : c.attachmentsEmailCaption;
26
+ return {
27
+ attachedRows: n.map((e) => ({
28
+ id: e.id,
29
+ name: e.name,
30
+ sizeLabel: a(e.size),
31
+ includeInEmail: e.includeInEmail,
32
+ includeInEmailLabel: `${c.attachmentIncludeInEmail} ${e.name}`,
33
+ removeLabel: `${c.attachmentRemove} ${e.name}`
34
+ })),
35
+ pendingRows: r.map((e) => ({
36
+ id: e.id,
37
+ name: e.name,
38
+ state: e.status === "uploading" ? "uploading" : "error",
39
+ message: o(e.status, c),
40
+ removeLabel: `${c.attachmentRemove} ${e.name}`
41
+ })),
42
+ showRows: n.length > 0 || r.length > 0,
43
+ emailCaption: n.length > 0 ? l : void 0,
44
+ countLimitMessage: i ? c.attachmentsCountLimit : void 0,
45
+ accept: [...t, ...e.map((e) => `.${e}`)].join(",")
46
+ };
47
+ }
48
+ function c(e) {
49
+ return "attachments" in e ? e.attachments ?? [] : [];
50
+ }
51
+ function l(e) {
52
+ return c(e).map((e) => ({
53
+ id: e.id,
54
+ includeInEmail: e.include_in_email ?? !1,
55
+ name: e.name,
56
+ size: e.size
57
+ }));
58
+ }
59
+ function u(e) {
60
+ if (e.length !== 0) return e.map(({ id: e, includeInEmail: t }) => ({
61
+ id: e,
62
+ include_in_email: t
63
+ }));
64
+ }
63
65
  //#endregion
64
- export { e as RECEIVABLE_MESSAGE_LABELS_EN };
66
+ export { u as attachmentFormValuesToPayload, s as buildReceivableAttachmentsView, a as formatFileSize, l as receivableToAttachmentFormValues, r as toFileArray, i as validateAttachmentFile };