@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.
- package/dist/index.d.ts +16 -0
- package/dist/index.js +1 -1
- package/dist/lib/ReceivablesWidget.d.ts +16 -0
- package/dist/lib/ReceivablesWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index2.js +24 -18
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index4.js +65 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +188 -45
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index11.js +30 -265
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +144 -64
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +47 -109
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js +293 -216
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +75 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +114 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +237 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index4.js +14 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +28 -243
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index6.js +212 -375
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index7.js +64 -62
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +409 -187
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +73 -40
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +10 -9
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +0 -9
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +4 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +10 -263
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +1 -72
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +241 -398
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +66 -100
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +406 -76
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +92 -330
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +93 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +344 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +6 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +157 -20
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index5.js +24 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +1 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +3 -18
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index8.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +18 -4
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +37 -37
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +54 -54
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +115 -94
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- 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
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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 {
|
|
66
|
+
export { u as attachmentFormValuesToPayload, s as buildReceivableAttachmentsView, a as formatFileSize, l as receivableToAttachmentFormValues, r as toFileArray, i as validateAttachmentFile };
|