@tesouro/embedded-components-react 0.5.109 → 0.5.111
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/README.md +29 -10
- package/dist/index.css +0 -3
- package/dist/lib/monite-sdk.d.ts +2 -29
- package/dist/lib/monite-sdk.js +4 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index.js +5 -6
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index166.js +123 -123
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index21.js +1 -10
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index22.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index426.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index440.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index453.js +6 -3
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index458.js +7 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index459.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index509.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index536.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index585.js +1 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index586.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index600.js +64 -24
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index601.js +32 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index602.js +2 -11
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index603.js +33 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index604.js +14 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index605.js +29 -8
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index606.js +29 -6
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index607.js +2 -6
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index608.js +93 -18
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/monite-wrapper/feature/dist/lib/MoniteWrapper.js +2 -6
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index609.js +0 -73
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index610.js +0 -120
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index611.js +0 -80
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index612.js +0 -146
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index613.js +0 -30
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index614.js +0 -18
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index615.js +0 -91
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index616.js +0 -3
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index617.js +0 -26
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index618.js +0 -71
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index619.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index620.js +0 -66
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index621.js +0 -32
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index622.js +0 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index623.js +0 -36
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index624.js +0 -18
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index625.js +0 -33
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index626.js +0 -31
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index627.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index628.js +0 -97
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.5.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.5.111", n = "67c34b15ba7828e3cad0e803f498a05cab84dc80", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|
|
@@ -7,7 +7,7 @@ import "../../../../data-access/dist/index.js";
|
|
|
7
7
|
import { useOptionalWidgetToken as t } from "../../../../feature/dist/lib/WidgetProvider/useWidgetToken.js";
|
|
8
8
|
import { useWidgetConfig as n, useWidgetError as r, useWidgetInitStaleForToken as i } from "../../../../feature/dist/lib/WidgetProvider/hooks.js";
|
|
9
9
|
import "../../../../feature/dist/index.js";
|
|
10
|
-
import { MoniteProvider as a } from "../../../../../monite-sdk/dist/
|
|
10
|
+
import { MoniteProvider as a } from "../../../../../monite-sdk/dist/index606.js";
|
|
11
11
|
import "../../../../../monite-sdk/dist/index.js";
|
|
12
12
|
import { useMemo as o, useState as s } from "react";
|
|
13
13
|
import { jsx as c } from "react/jsx-runtime";
|
|
@@ -111,11 +111,7 @@ function d({ finopsThemeColors: d, children: f }) {
|
|
|
111
111
|
bankAccountCurrencies: ["USD"],
|
|
112
112
|
enableEntityBankAccount: !0
|
|
113
113
|
},
|
|
114
|
-
financing: { enableFinanceWidgetButton: !1 }
|
|
115
|
-
templateSettings: {
|
|
116
|
-
availableARDocuments: ["invoice"],
|
|
117
|
-
availableAPDocuments: []
|
|
118
|
-
}
|
|
114
|
+
financing: { enableFinanceWidgetButton: !1 }
|
|
119
115
|
},
|
|
120
116
|
children: f
|
|
121
117
|
}, M ?? "no-user");
|
package/package.json
CHANGED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { LoadingSpinner as e } from "./index50.js";
|
|
2
|
-
import "./index51.js";
|
|
3
|
-
import { Typography as t } from "./index61.js";
|
|
4
|
-
import { UploadBar as n } from "./index608.js";
|
|
5
|
-
import { useEffect as r } from "react";
|
|
6
|
-
import { AlertCircle as i, CheckCircle2 as a, CloudUpload as o, X as s } from "lucide-react";
|
|
7
|
-
import { Fragment as c, jsx as l, jsxs as u } from "@emotion/react/jsx-runtime";
|
|
8
|
-
import { useLingui as d } from "@lingui/react";
|
|
9
|
-
import { twMerge as f } from "tailwind-merge";
|
|
10
|
-
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index609.js
|
|
11
|
-
var p = ({ isUploading: p, isSuccess: m, isError: h, isDraggingOver: g, resetUpload: _, fileName: v, onClick: y }) => {
|
|
12
|
-
let { i18n: b } = d(), x = p || m || h;
|
|
13
|
-
function S() {
|
|
14
|
-
return h ? /* @__PURE__ */ l(i, { className: "ttw:size-5 ttw:text-danger" }) : m ? /* @__PURE__ */ l(a, { className: "ttw:size-5 ttw:text-success" }) : /* @__PURE__ */ l(e, { className: "ttw:w-5 ttw:h-5" });
|
|
15
|
-
}
|
|
16
|
-
return r(() => {
|
|
17
|
-
let e;
|
|
18
|
-
return m && (e = setTimeout(() => _(), 2e3)), () => clearTimeout(e);
|
|
19
|
-
}, [m, _]), /* @__PURE__ */ l("div", {
|
|
20
|
-
className: f("ttw:w-full ttw:h-38 ttw:bg-white ttw:box-border ttw:transition-all ttw:flex ttw:flex-col ttw:items-center ttw:justify-center ttw:text-center ttw:gap-2 ttw:rounded-lg ttw:border ttw:px-4 ttw:py-6", g ? "ttw:border-solid ttw:border-primary" : "ttw:border-dashed ttw:border-border"),
|
|
21
|
-
onClick: () => {
|
|
22
|
-
x || y();
|
|
23
|
-
},
|
|
24
|
-
children: x ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ u("div", {
|
|
25
|
-
className: "ttw:flex ttw:gap-4 ttw:justify-center ttw:w-full",
|
|
26
|
-
children: [/* @__PURE__ */ u("div", {
|
|
27
|
-
className: "ttw:flex ttw:gap-2 ttw:w-1/2 ttw:items-center",
|
|
28
|
-
children: [S(), /* @__PURE__ */ l("span", {
|
|
29
|
-
className: "ttw:w-full ttw:text-sm ttw:leading-5 ttw:text-medium ttw:text-neutral ttw:truncate",
|
|
30
|
-
children: v
|
|
31
|
-
})]
|
|
32
|
-
}), /* @__PURE__ */ u("div", {
|
|
33
|
-
className: "ttw:flex ttw:gap-2 ttw:items-center",
|
|
34
|
-
children: [/* @__PURE__ */ l(n, {
|
|
35
|
-
shouldStartProgress: p,
|
|
36
|
-
isError: h,
|
|
37
|
-
isSuccess: m
|
|
38
|
-
}), h && /* @__PURE__ */ l("button", {
|
|
39
|
-
type: "button",
|
|
40
|
-
disabled: p,
|
|
41
|
-
onClick: _,
|
|
42
|
-
className: "ttw:border-none ttw:cursor-pointer",
|
|
43
|
-
children: /* @__PURE__ */ l(s, { className: "ttw:size-4" })
|
|
44
|
-
})]
|
|
45
|
-
})]
|
|
46
|
-
}), h && /* @__PURE__ */ l(t, {
|
|
47
|
-
variant: "body2",
|
|
48
|
-
color: "destructive",
|
|
49
|
-
className: "ttw:font-medium",
|
|
50
|
-
children: b._("Wrong file format. Please, upload the file in JPEG, PNG or GIF format.")
|
|
51
|
-
})] }) : /* @__PURE__ */ u(c, { children: [
|
|
52
|
-
/* @__PURE__ */ l("div", {
|
|
53
|
-
className: "ttw:p-3 ttw:bg-primary ttw:rounded-full",
|
|
54
|
-
children: /* @__PURE__ */ l(o, { className: "ttw:text-white ttw:size-5" })
|
|
55
|
-
}),
|
|
56
|
-
/* @__PURE__ */ u(t, {
|
|
57
|
-
variant: "body2",
|
|
58
|
-
className: "ttw:font-medium",
|
|
59
|
-
children: [b._("Drop your files here, or "), /* @__PURE__ */ l("span", {
|
|
60
|
-
className: "ttw:text-primary ttw:underline ttw:hover:cursor-pointer",
|
|
61
|
-
children: b._("click to browse")
|
|
62
|
-
})]
|
|
63
|
-
}),
|
|
64
|
-
/* @__PURE__ */ l(t, {
|
|
65
|
-
variant: "caption",
|
|
66
|
-
color: "muted",
|
|
67
|
-
children: b._("PNG, JPG or GIF (max. 10MB)")
|
|
68
|
-
})
|
|
69
|
-
] })
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
//#endregion
|
|
73
|
-
export { p as DragAndDropBox };
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { Button as e } from "./index55.js";
|
|
2
|
-
import { useMyEntity as t } from "./index139.js";
|
|
3
|
-
import "./index144.js";
|
|
4
|
-
import { LOGO_SUPPORTED_FORMATS as n, useFileInput as r } from "./index214.js";
|
|
5
|
-
import "./index222.js";
|
|
6
|
-
import { Skeleton as i } from "./index53.js";
|
|
7
|
-
import { Typography as a } from "./index61.js";
|
|
8
|
-
import { useUploadEntityLogo as o } from "./index602.js";
|
|
9
|
-
import { useDeleteEntityLogo as s } from "./index603.js";
|
|
10
|
-
import "./index607.js";
|
|
11
|
-
import { DragAndDropBox as c } from "./index609.js";
|
|
12
|
-
import { useState as l } from "react";
|
|
13
|
-
import { SquarePen as u, Trash2 as d } from "lucide-react";
|
|
14
|
-
import { Fragment as f, jsx as p, jsxs as m } from "@emotion/react/jsx-runtime";
|
|
15
|
-
import { toast as h } from "react-hot-toast";
|
|
16
|
-
import { useLingui as g } from "@lingui/react";
|
|
17
|
-
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index610.js
|
|
18
|
-
var _ = () => {
|
|
19
|
-
let { i18n: _ } = g(), { data: v, isLoading: y } = t(), b = v?.id ?? "", { FileInput: x, openFileInput: S, checkFileError: C, resetInput: w } = r({
|
|
20
|
-
acceptedFormats: n,
|
|
21
|
-
maxFileSizeInMB: 10
|
|
22
|
-
}), [T, E] = l(!1), [D, O] = l(""), { mutateAsync: k, isSuccess: A, isError: j, isPending: M, reset: N } = o(), { mutate: P, isPending: F } = s(b);
|
|
23
|
-
async function I(e) {
|
|
24
|
-
if (e) {
|
|
25
|
-
let t = C(e);
|
|
26
|
-
if (t) {
|
|
27
|
-
h.error(t);
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
O(e.name), await k({
|
|
31
|
-
body: { file: e },
|
|
32
|
-
path: { entity_id: b }
|
|
33
|
-
}), w(), O("");
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
let L = M || j, R = !!v?.logo && !D && !L && !y;
|
|
37
|
-
return /* @__PURE__ */ m("div", {
|
|
38
|
-
className: "ttw:flex ttw:flex-col ttw:gap-2.5",
|
|
39
|
-
children: [/* @__PURE__ */ m("div", {
|
|
40
|
-
className: "ttw:pt-5 ttw:pb-2.5 ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
41
|
-
children: [/* @__PURE__ */ p(a, {
|
|
42
|
-
variant: "h3",
|
|
43
|
-
children: _._("Branding")
|
|
44
|
-
}), /* @__PURE__ */ p(a, {
|
|
45
|
-
variant: "body2",
|
|
46
|
-
color: "muted",
|
|
47
|
-
children: _._("Control how your invoices will appear to your customers by adding your company's logo. Changes apply to new invoices only.")
|
|
48
|
-
})]
|
|
49
|
-
}), /* @__PURE__ */ m("div", {
|
|
50
|
-
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
51
|
-
onDragEnter: (e) => {
|
|
52
|
-
e.preventDefault(), E(!0);
|
|
53
|
-
},
|
|
54
|
-
onDragLeave: (e) => {
|
|
55
|
-
e.preventDefault(), E(!1);
|
|
56
|
-
},
|
|
57
|
-
onDragOver: (e) => e.preventDefault(),
|
|
58
|
-
onDrop: (e) => {
|
|
59
|
-
e.preventDefault(), E(!1), I(e.dataTransfer?.files ? e.dataTransfer?.files?.[0] : null);
|
|
60
|
-
},
|
|
61
|
-
children: [
|
|
62
|
-
/* @__PURE__ */ m("div", {
|
|
63
|
-
className: "ttw:flex ttw:flex-col ttw:gap-0.5",
|
|
64
|
-
children: [/* @__PURE__ */ p(a, {
|
|
65
|
-
variant: "body1",
|
|
66
|
-
className: "ttw:font-medium",
|
|
67
|
-
children: _._("Upload your company logo")
|
|
68
|
-
}), /* @__PURE__ */ p(a, {
|
|
69
|
-
variant: "body2",
|
|
70
|
-
className: "ttw:leading-5",
|
|
71
|
-
color: "muted",
|
|
72
|
-
children: _._("Proudly display your logo on all your invoices.")
|
|
73
|
-
})]
|
|
74
|
-
}),
|
|
75
|
-
/* @__PURE__ */ m("div", {
|
|
76
|
-
className: "ttw:flex ttw:flex-col ttw:items-end ttw:gap-2",
|
|
77
|
-
children: [y ? /* @__PURE__ */ p(i, { className: "ttw:w-full ttw:h-38 ttw:bg-zinc-200" }) : /* @__PURE__ */ p(f, { children: R ? /* @__PURE__ */ p("div", {
|
|
78
|
-
className: "ttw:flex ttw:w-full ttw:h-38 ttw:box-border",
|
|
79
|
-
children: /* @__PURE__ */ p("img", {
|
|
80
|
-
src: v?.logo?.url,
|
|
81
|
-
className: "ttw:w-auto ttw:max-w-full ttw:object-contain ttw:max-h-38",
|
|
82
|
-
alt: _._("Organization logo")
|
|
83
|
-
})
|
|
84
|
-
}) : /* @__PURE__ */ p(c, {
|
|
85
|
-
isUploading: M,
|
|
86
|
-
isSuccess: A,
|
|
87
|
-
isError: j,
|
|
88
|
-
isDraggingOver: T,
|
|
89
|
-
fileName: D,
|
|
90
|
-
resetUpload: () => {
|
|
91
|
-
w(), N(), O("");
|
|
92
|
-
},
|
|
93
|
-
onClick: S
|
|
94
|
-
}) }), !T && R && /* @__PURE__ */ m("div", {
|
|
95
|
-
className: "ttw:flex ttw:gap-4",
|
|
96
|
-
children: [/* @__PURE__ */ p(e, {
|
|
97
|
-
variant: "ghost",
|
|
98
|
-
size: "sm",
|
|
99
|
-
onClick: S,
|
|
100
|
-
"aria-label": _._("Edit logo"),
|
|
101
|
-
children: /* @__PURE__ */ p(u, { className: "ttw:size-4 ttw:w-fit" })
|
|
102
|
-
}), v?.logo && /* @__PURE__ */ p(e, {
|
|
103
|
-
variant: "ghost",
|
|
104
|
-
size: "sm",
|
|
105
|
-
disabled: F,
|
|
106
|
-
"aria-label": _._("Delete logo"),
|
|
107
|
-
onClick: () => P(),
|
|
108
|
-
children: /* @__PURE__ */ p(d, { className: "ttw:size-4" })
|
|
109
|
-
})]
|
|
110
|
-
})]
|
|
111
|
-
}),
|
|
112
|
-
/* @__PURE__ */ p(x, { onChange: (e) => {
|
|
113
|
-
I(e.target.files ? e.target.files[0] : null);
|
|
114
|
-
} })
|
|
115
|
-
]
|
|
116
|
-
})]
|
|
117
|
-
});
|
|
118
|
-
};
|
|
119
|
-
//#endregion
|
|
120
|
-
export { _ as LogoSection };
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { Typography as e } from "./index61.js";
|
|
2
|
-
import { Switch as t } from "./index473.js";
|
|
3
|
-
import { jsx as n, jsxs as r } from "@emotion/react/jsx-runtime";
|
|
4
|
-
import { useLingui as i } from "@lingui/react";
|
|
5
|
-
import { twMerge as a } from "tailwind-merge";
|
|
6
|
-
import { Controller as o, useFormContext as s } from "react-hook-form";
|
|
7
|
-
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index611.js
|
|
8
|
-
var c = ({ control: c, isDialog: l }) => {
|
|
9
|
-
let { i18n: u } = i(), { watch: d, setValue: f } = s(), p = d("invoice_bank_display");
|
|
10
|
-
return /* @__PURE__ */ r("div", {
|
|
11
|
-
className: "ttw:flex ttw:flex-col ttw:gap-2.5",
|
|
12
|
-
children: [/* @__PURE__ */ r("div", {
|
|
13
|
-
className: "ttw:flex ttw:flex-col ttw:gap-1.5 ttw:pt-5 ttw:pb-2.5",
|
|
14
|
-
children: [/* @__PURE__ */ n(e, {
|
|
15
|
-
variant: "h3",
|
|
16
|
-
children: u._("PDF settings")
|
|
17
|
-
}), /* @__PURE__ */ n(e, {
|
|
18
|
-
variant: "body2",
|
|
19
|
-
color: "muted",
|
|
20
|
-
children: u._("Invoices are generated as PDFs")
|
|
21
|
-
})]
|
|
22
|
-
}), /* @__PURE__ */ r("div", {
|
|
23
|
-
className: a("ttw:flex ttw:flex-col ttw:gap-2.5 ttw:rounded-lg", l ? "ttw:bg-zinc-100 ttw:p-4" : ""),
|
|
24
|
-
children: [/* @__PURE__ */ r("section", {
|
|
25
|
-
className: "ttw:flex ttw:justify-between ttw:gap-4",
|
|
26
|
-
children: [/* @__PURE__ */ r("div", {
|
|
27
|
-
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
28
|
-
children: [/* @__PURE__ */ n(e, {
|
|
29
|
-
variant: "body1",
|
|
30
|
-
className: "ttw:font-medium",
|
|
31
|
-
children: u._("Display your bank account details on the PDF")
|
|
32
|
-
}), /* @__PURE__ */ n(e, {
|
|
33
|
-
variant: "body2",
|
|
34
|
-
color: "muted",
|
|
35
|
-
children: u._("Shows your bank account number, routing number, and account holder name so that customers can pay using an ACH bank transfer. Should only be used with accounts that have a debit block.")
|
|
36
|
-
})]
|
|
37
|
-
}), /* @__PURE__ */ n(t, {
|
|
38
|
-
checked: p,
|
|
39
|
-
onCheckedChange: (e) => {
|
|
40
|
-
f("invoice_bank_display", e, { shouldDirty: !0 });
|
|
41
|
-
},
|
|
42
|
-
"aria-label": u._("Display bank display options")
|
|
43
|
-
})]
|
|
44
|
-
}), /* @__PURE__ */ r("section", {
|
|
45
|
-
className: "ttw:flex ttw:justify-between ttw:gap-4",
|
|
46
|
-
children: [/* @__PURE__ */ r("div", {
|
|
47
|
-
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
48
|
-
children: [
|
|
49
|
-
/* @__PURE__ */ n(e, {
|
|
50
|
-
variant: "body1",
|
|
51
|
-
className: "ttw:font-medium",
|
|
52
|
-
children: u._("Update PDF files for paid invoices")
|
|
53
|
-
}),
|
|
54
|
-
/* @__PURE__ */ n(e, {
|
|
55
|
-
variant: "body2",
|
|
56
|
-
color: "muted",
|
|
57
|
-
children: u._("PDF invoice files will be regenerated to reflect payments made and any remaining amount due. Once a PDF has been updated, you won't be able to revert it.")
|
|
58
|
-
}),
|
|
59
|
-
/* @__PURE__ */ n(e, {
|
|
60
|
-
variant: "body2",
|
|
61
|
-
color: "muted",
|
|
62
|
-
className: "ttw:font-medium",
|
|
63
|
-
children: u._("Once updated, you won't be able to revert the PDFs.")
|
|
64
|
-
})
|
|
65
|
-
]
|
|
66
|
-
}), /* @__PURE__ */ n(o, {
|
|
67
|
-
name: "update_paid_invoices",
|
|
68
|
-
control: c,
|
|
69
|
-
render: ({ field: e }) => /* @__PURE__ */ n(t, {
|
|
70
|
-
checked: e.value,
|
|
71
|
-
onCheckedChange: e.onChange,
|
|
72
|
-
"aria-label": u._("Enable update paid invoices pdf")
|
|
73
|
-
})
|
|
74
|
-
})]
|
|
75
|
-
})]
|
|
76
|
-
})]
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
//#endregion
|
|
80
|
-
export { c as PDFSettings };
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { Input as e } from "./index88.js";
|
|
2
|
-
import { Typography as t } from "./index61.js";
|
|
3
|
-
import { Field as n, FieldContent as r, FieldError as i, FieldLabel as a } from "./index87.js";
|
|
4
|
-
import { Checkbox as o } from "./index105.js";
|
|
5
|
-
import { jsx as s, jsxs as c } from "@emotion/react/jsx-runtime";
|
|
6
|
-
import { useLingui as l } from "@lingui/react";
|
|
7
|
-
import { Controller as u, useFormContext as d } from "react-hook-form";
|
|
8
|
-
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index612.js
|
|
9
|
-
var f = ({ control: f }) => {
|
|
10
|
-
let { i18n: p } = l(), { setValue: m, watch: h } = d(), g = h("min_digits"), _ = h("prefix"), v = h("separator"), y = h("include_date"), b = h("invoice"), x = h("invoice_number");
|
|
11
|
-
function S() {
|
|
12
|
-
return `${b}${v}${_ ? `${_}${v}` : ""}${y ? `${(/* @__PURE__ */ new Date()).getFullYear()}${v}` : ""}${x.toString().padStart(g, "0")}`;
|
|
13
|
-
}
|
|
14
|
-
let C = S();
|
|
15
|
-
return /* @__PURE__ */ c("div", {
|
|
16
|
-
className: "ttw:flex ttw:flex-col ttw:gap-2.5",
|
|
17
|
-
children: [
|
|
18
|
-
/* @__PURE__ */ c("div", {
|
|
19
|
-
className: "ttw:flex ttw:flex-col ttw:gap-1.5 ttw:pt-5 ttw:pb-2.5",
|
|
20
|
-
children: [/* @__PURE__ */ s(t, {
|
|
21
|
-
variant: "h3",
|
|
22
|
-
children: p._("Invoice numbering")
|
|
23
|
-
}), /* @__PURE__ */ s(t, {
|
|
24
|
-
variant: "body2",
|
|
25
|
-
color: "muted",
|
|
26
|
-
children: p._("Specify how you want your invoices to be numbered. Changes apply to new invoices only. Existing invoice numbers won't be updated.")
|
|
27
|
-
})]
|
|
28
|
-
}),
|
|
29
|
-
/* @__PURE__ */ c("div", {
|
|
30
|
-
className: "ttw:flex ttw:flex-col ttw:w-94 ttw:gap-0.5 ttw:p-4 ttw:bg-neutral-200 ttw:rounded-xl",
|
|
31
|
-
children: [/* @__PURE__ */ s(t, {
|
|
32
|
-
variant: "body2",
|
|
33
|
-
color: "muted",
|
|
34
|
-
children: p._("Preview")
|
|
35
|
-
}), /* @__PURE__ */ s(t, {
|
|
36
|
-
variant: "h4",
|
|
37
|
-
className: "ttw:font-medium",
|
|
38
|
-
children: C
|
|
39
|
-
})]
|
|
40
|
-
}),
|
|
41
|
-
/* @__PURE__ */ c("div", {
|
|
42
|
-
className: "ttw:flex ttw:w-min ttw:gap-2 ttw:p-2",
|
|
43
|
-
children: [
|
|
44
|
-
/* @__PURE__ */ s(u, {
|
|
45
|
-
name: "invoice",
|
|
46
|
-
control: f,
|
|
47
|
-
render: ({ field: t, fieldState: { error: o } }) => /* @__PURE__ */ s(n, { children: /* @__PURE__ */ c(r, {
|
|
48
|
-
className: "ttw:grow-0",
|
|
49
|
-
children: [
|
|
50
|
-
/* @__PURE__ */ s(a, {
|
|
51
|
-
htmlFor: t.name,
|
|
52
|
-
children: p._("Invoice prefix")
|
|
53
|
-
}),
|
|
54
|
-
/* @__PURE__ */ s(e, {
|
|
55
|
-
...t,
|
|
56
|
-
id: t.name,
|
|
57
|
-
maxLength: 25,
|
|
58
|
-
"aria-invalid": !!o || void 0,
|
|
59
|
-
className: "ttw:w-29 ttw:min-w-29 ttw:bg-white"
|
|
60
|
-
}),
|
|
61
|
-
/* @__PURE__ */ s(i, { errors: [o] })
|
|
62
|
-
]
|
|
63
|
-
}) })
|
|
64
|
-
}),
|
|
65
|
-
/* @__PURE__ */ s(u, {
|
|
66
|
-
name: "invoice_number",
|
|
67
|
-
control: f,
|
|
68
|
-
render: ({ field: t, fieldState: { error: o } }) => /* @__PURE__ */ s(n, { children: /* @__PURE__ */ c(r, {
|
|
69
|
-
className: "ttw:grow-0",
|
|
70
|
-
children: [
|
|
71
|
-
/* @__PURE__ */ s(a, {
|
|
72
|
-
htmlFor: t.name,
|
|
73
|
-
children: p._("Starting number")
|
|
74
|
-
}),
|
|
75
|
-
/* @__PURE__ */ s(e, {
|
|
76
|
-
...t,
|
|
77
|
-
id: t.name,
|
|
78
|
-
type: "number",
|
|
79
|
-
"aria-invalid": !!o || void 0,
|
|
80
|
-
onChange: (e) => {
|
|
81
|
-
let n = e.target.value.replace(/^0+(?=\d)/, "");
|
|
82
|
-
t.onChange(Number(n));
|
|
83
|
-
},
|
|
84
|
-
value: t.value.toString().padStart(g, "0"),
|
|
85
|
-
className: "ttw:w-29 ttw:min-w-29 ttw:bg-white"
|
|
86
|
-
}),
|
|
87
|
-
/* @__PURE__ */ s(i, { errors: [o] })
|
|
88
|
-
]
|
|
89
|
-
}) })
|
|
90
|
-
}),
|
|
91
|
-
/* @__PURE__ */ s(u, {
|
|
92
|
-
name: "min_digits",
|
|
93
|
-
control: f,
|
|
94
|
-
render: ({ field: t, fieldState: { error: o } }) => /* @__PURE__ */ s(n, { children: /* @__PURE__ */ c(r, {
|
|
95
|
-
className: "ttw:grow-0",
|
|
96
|
-
children: [
|
|
97
|
-
/* @__PURE__ */ s(a, {
|
|
98
|
-
htmlFor: t.name,
|
|
99
|
-
children: p._("Digit count")
|
|
100
|
-
}),
|
|
101
|
-
/* @__PURE__ */ s(e, {
|
|
102
|
-
...t,
|
|
103
|
-
id: t.name,
|
|
104
|
-
type: "number",
|
|
105
|
-
className: "ttw:bg-white ttw:w-29 ttw:max-w-29",
|
|
106
|
-
onChange: (e) => {
|
|
107
|
-
+e.target.value > 20 ? m("min_digits", 20, { shouldDirty: !0 }) : t.onChange(e);
|
|
108
|
-
},
|
|
109
|
-
"aria-invalid": !!o || void 0
|
|
110
|
-
}),
|
|
111
|
-
/* @__PURE__ */ s(i, { errors: [o] })
|
|
112
|
-
]
|
|
113
|
-
}) })
|
|
114
|
-
})
|
|
115
|
-
]
|
|
116
|
-
}),
|
|
117
|
-
/* @__PURE__ */ s("div", {
|
|
118
|
-
className: "ttw:bg-transparent ttw:w-full ttw:p-2",
|
|
119
|
-
children: /* @__PURE__ */ s(u, {
|
|
120
|
-
name: "include_date",
|
|
121
|
-
control: f,
|
|
122
|
-
render: ({ field: e }) => /* @__PURE__ */ s(n, {
|
|
123
|
-
orientation: "horizontal",
|
|
124
|
-
children: /* @__PURE__ */ c(r, {
|
|
125
|
-
className: "ttw:flex-row ttw:items-center",
|
|
126
|
-
children: [/* @__PURE__ */ s(o, {
|
|
127
|
-
id: e.name,
|
|
128
|
-
ref: e.ref,
|
|
129
|
-
checked: e.value ?? !1,
|
|
130
|
-
onCheckedChange: e.onChange,
|
|
131
|
-
onBlur: e.onBlur,
|
|
132
|
-
className: "ttw:bg-white"
|
|
133
|
-
}), /* @__PURE__ */ s(a, {
|
|
134
|
-
htmlFor: e.name,
|
|
135
|
-
className: "ttw:font-normal",
|
|
136
|
-
children: p._("Include the current year in the invoice number prefix")
|
|
137
|
-
})]
|
|
138
|
-
})
|
|
139
|
-
})
|
|
140
|
-
})
|
|
141
|
-
})
|
|
142
|
-
]
|
|
143
|
-
});
|
|
144
|
-
};
|
|
145
|
-
//#endregion
|
|
146
|
-
export { f as InvoiceNumbering };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { z as e } from "zod";
|
|
2
|
-
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index613.js
|
|
3
|
-
var t = (t, n) => e.object({
|
|
4
|
-
min_digits: e.coerce.number().int().min(1, t._("Can't be less than 1")).max(20, t._("Can't be greater than 20")),
|
|
5
|
-
credit_note: e.string().min(1),
|
|
6
|
-
credit_note_number: e.coerce.number().int().min(n.credit_note, t._("Can't be less than {nextNumbersCredit_note}", { nextNumbersCredit_note: n.credit_note })),
|
|
7
|
-
delivery_note: e.string().min(1),
|
|
8
|
-
delivery_note_number: e.coerce.number().int().min(n.delivery_note, t._("Can't be less than {nextNumbersDelivery_note}", { nextNumbersDelivery_note: n.delivery_note })),
|
|
9
|
-
quote: e.string().min(1),
|
|
10
|
-
quote_number: e.coerce.number().int().min(n.quote, t._("Can't be less than {nextNumbersQuote}", { nextNumbersQuote: n.quote })),
|
|
11
|
-
invoice: e.string().min(1, t._("Invoice prefix is required")).max(25, t._("Invoice prefix should have at most 25 characters")),
|
|
12
|
-
invoice_number: e.coerce.number().int().min(n.invoice, t._("Can't be less than {nextNumbersInvoice}", { nextNumbersInvoice: n.invoice })),
|
|
13
|
-
purchase_order: e.string().min(1),
|
|
14
|
-
purchase_order_number: e.coerce.number().int().min(n.purchase_order, t._("Can't be less than {nextNumbersPurchase_order}", { nextNumbersPurchase_order: n.purchase_order })),
|
|
15
|
-
include_date: e.boolean(),
|
|
16
|
-
prefix: e.string().max(25, t._("Prefix should have at most 25 characters")),
|
|
17
|
-
separator: e.enum([
|
|
18
|
-
"/",
|
|
19
|
-
"-",
|
|
20
|
-
"|",
|
|
21
|
-
".",
|
|
22
|
-
""
|
|
23
|
-
]),
|
|
24
|
-
invoice_bank_display: e.boolean(),
|
|
25
|
-
update_paid_invoices: e.boolean(),
|
|
26
|
-
quote_signature_display: e.boolean(),
|
|
27
|
-
quote_electronic_signature: e.union([e.boolean(), e.string()])
|
|
28
|
-
});
|
|
29
|
-
//#endregion
|
|
30
|
-
export { t as getInvoiceSettingsFormSchema };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index614.js
|
|
2
|
-
var e = (e) => !!e && typeof e == "object" && "display_organization_bank_account" in e, t = (t, n) => e(t) ? !!(t.display_organization_bank_account ?? n) : n, n = (t, n) => {
|
|
3
|
-
let r = e(t?.invoice);
|
|
4
|
-
return {
|
|
5
|
-
...t,
|
|
6
|
-
display_organization_bank_account: n.invoice_bank_display,
|
|
7
|
-
quote: {
|
|
8
|
-
...t?.quote,
|
|
9
|
-
display_signature: n.quote_signature_display
|
|
10
|
-
},
|
|
11
|
-
...r ? { invoice: {
|
|
12
|
-
...t?.invoice,
|
|
13
|
-
display_organization_bank_account: n.invoice_bank_display
|
|
14
|
-
} } : {}
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
//#endregion
|
|
18
|
-
export { n as buildDocumentRendering, t as getBankDisplayValue, e as hasBankDisplay };
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { Button as e } from "./index55.js";
|
|
2
|
-
import { safeZodResolver as t } from "./index395.js";
|
|
3
|
-
import { useDiscardChangesContext as n } from "./index600.js";
|
|
4
|
-
import { usePatchEntitySettings as r } from "./index605.js";
|
|
5
|
-
import { PDFSettings as i } from "./index611.js";
|
|
6
|
-
import { InvoiceNumbering as a } from "./index612.js";
|
|
7
|
-
import { getInvoiceSettingsFormSchema as o } from "./index613.js";
|
|
8
|
-
import { buildDocumentRendering as s, getBankDisplayValue as c } from "./index614.js";
|
|
9
|
-
import { useEffect as l } from "react";
|
|
10
|
-
import { jsx as u, jsxs as d } from "@emotion/react/jsx-runtime";
|
|
11
|
-
import { useLingui as f } from "@lingui/react";
|
|
12
|
-
import { FormProvider as p, useForm as m } from "react-hook-form";
|
|
13
|
-
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index615.js
|
|
14
|
-
var h = ({ entityId: h, entitySettings: g, nextNumbers: _, isDialog: v }) => {
|
|
15
|
-
let { i18n: y } = f(), { handleShowModal: b } = n(), { mutate: x, isPending: S } = r(h), C = m({
|
|
16
|
-
resolver: t(o(y, _)),
|
|
17
|
-
defaultValues: {
|
|
18
|
-
credit_note: g?.document_ids?.document_type_prefix?.credit_note ?? "CN",
|
|
19
|
-
credit_note_number: _?.credit_note ?? 1,
|
|
20
|
-
delivery_note: g?.document_ids?.document_type_prefix?.delivery_note ?? "DN",
|
|
21
|
-
delivery_note_number: _?.delivery_note ?? 1,
|
|
22
|
-
invoice: g?.document_ids?.document_type_prefix?.invoice ?? "INV",
|
|
23
|
-
invoice_number: _?.invoice ?? 1,
|
|
24
|
-
purchase_order: g?.document_ids?.document_type_prefix?.purchase_order ?? "PO",
|
|
25
|
-
purchase_order_number: _?.purchase_order ?? 1,
|
|
26
|
-
quote: g?.document_ids?.document_type_prefix?.quote ?? "Q",
|
|
27
|
-
quote_number: _?.quote ?? 1,
|
|
28
|
-
include_date: g?.document_ids?.include_date ?? !1,
|
|
29
|
-
min_digits: g?.document_ids?.min_digits ?? 5,
|
|
30
|
-
prefix: g?.document_ids?.prefix ?? "",
|
|
31
|
-
separator: g?.document_ids?.separator ?? "-",
|
|
32
|
-
invoice_bank_display: c(g?.document_rendering?.invoice, !!(g?.document_rendering?.display_organization_bank_account ?? !1)),
|
|
33
|
-
credit_note_bank_display: c(g?.document_rendering?.credit_note, !!(g?.document_rendering?.display_organization_bank_account ?? !1)),
|
|
34
|
-
quote_bank_display: c(g?.document_rendering?.quote, !!(g?.document_rendering?.display_organization_bank_account ?? !1)),
|
|
35
|
-
update_paid_invoices: g?.generate_paid_invoice_pdf ?? !1,
|
|
36
|
-
quote_signature_display: g?.document_rendering?.quote?.display_signature ?? !1,
|
|
37
|
-
quote_electronic_signature: g?.quote_signature_required ?? !1
|
|
38
|
-
}
|
|
39
|
-
}), { control: w, handleSubmit: T, formState: E, reset: D } = C, O = (e) => {
|
|
40
|
-
let { dirtyFields: t } = E, n = s(g?.document_rendering, e), r = t.invoice_number;
|
|
41
|
-
x({
|
|
42
|
-
path: { entity_id: h },
|
|
43
|
-
body: {
|
|
44
|
-
...g,
|
|
45
|
-
document_ids: {
|
|
46
|
-
document_type_prefix: {
|
|
47
|
-
invoice: e.invoice,
|
|
48
|
-
credit_note: e.credit_note,
|
|
49
|
-
delivery_note: e.delivery_note,
|
|
50
|
-
purchase_order: e.purchase_order,
|
|
51
|
-
quote: e.quote
|
|
52
|
-
},
|
|
53
|
-
...r && { next_number: { invoice: e.invoice_number } },
|
|
54
|
-
min_digits: e.min_digits,
|
|
55
|
-
separator: e.separator,
|
|
56
|
-
include_date: e.include_date,
|
|
57
|
-
prefix: e.prefix || null
|
|
58
|
-
},
|
|
59
|
-
document_rendering: n,
|
|
60
|
-
generate_paid_invoice_pdf: e.update_paid_invoices,
|
|
61
|
-
quote_signature_required: e.quote_electronic_signature === !0 || e.quote_electronic_signature === "true"
|
|
62
|
-
}
|
|
63
|
-
}, { onSuccess: () => {
|
|
64
|
-
D(C.getValues());
|
|
65
|
-
} });
|
|
66
|
-
};
|
|
67
|
-
return l(() => {
|
|
68
|
-
b(E?.isDirty);
|
|
69
|
-
}, [E?.isDirty, b]), /* @__PURE__ */ u(p, {
|
|
70
|
-
...C,
|
|
71
|
-
children: /* @__PURE__ */ d("form", {
|
|
72
|
-
className: "ttw:flex ttw:flex-col ttw:gap-6",
|
|
73
|
-
onSubmit: T(O),
|
|
74
|
-
children: [
|
|
75
|
-
/* @__PURE__ */ u(a, { control: w }),
|
|
76
|
-
/* @__PURE__ */ u(i, {
|
|
77
|
-
control: w,
|
|
78
|
-
isDialog: v
|
|
79
|
-
}),
|
|
80
|
-
/* @__PURE__ */ u(e, {
|
|
81
|
-
type: "submit",
|
|
82
|
-
className: "ttw:w-fit",
|
|
83
|
-
disabled: S || !E?.isDirty,
|
|
84
|
-
children: y._("Save changes")
|
|
85
|
-
})
|
|
86
|
-
]
|
|
87
|
-
})
|
|
88
|
-
});
|
|
89
|
-
};
|
|
90
|
-
//#endregion
|
|
91
|
-
export { h as TemplateSettingsContent };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ConfirmationModal as e } from "./index58.js";
|
|
2
|
-
import "./index59.js";
|
|
3
|
-
import { Typography as t } from "./index61.js";
|
|
4
|
-
import { jsx as n, jsxs as r } from "@emotion/react/jsx-runtime";
|
|
5
|
-
import { useLingui as i } from "@lingui/react";
|
|
6
|
-
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index617.js
|
|
7
|
-
var a = ({ open: a, onClose: o, onContinue: s }) => {
|
|
8
|
-
let { i18n: c } = i();
|
|
9
|
-
return /* @__PURE__ */ r(e, {
|
|
10
|
-
open: a,
|
|
11
|
-
title: c._("You have unsaved changes"),
|
|
12
|
-
confirmLabel: c._("Quit without saving"),
|
|
13
|
-
cancelLabel: c._("Cancel"),
|
|
14
|
-
onClose: o,
|
|
15
|
-
onConfirm: s,
|
|
16
|
-
children: [/* @__PURE__ */ n(t, {
|
|
17
|
-
variant: "body1",
|
|
18
|
-
children: c._("Any unsaved changes will be lost.")
|
|
19
|
-
}), /* @__PURE__ */ n(t, {
|
|
20
|
-
variant: "body1",
|
|
21
|
-
children: c._("Are you sure you want to quit without saving?")
|
|
22
|
-
})]
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
//#endregion
|
|
26
|
-
export { a as DiscardChangesModal };
|