@tesouro/embedded-components-react 0.5.227 → 0.5.228
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 +21 -21
- package/dist/index.d.ts +54 -34
- package/dist/index.js +1 -1
- package/dist/lib/ReceivablesWidget.d.ts +54 -34
- package/dist/lib/ReceivablesWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +29 -59
- 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/index12.js +36 -141
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +26 -16
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +58 -37
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +228 -122
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +300 -147
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index20.js +34 -37
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +126 -122
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js +150 -58
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +38 -91
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +113 -107
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js +98 -231
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js +111 -27
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index27.js +25 -624
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js +631 -39
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index29.js +41 -40
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index30.js +35 -74
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index31.js +73 -115
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js +115 -313
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index33.js +325 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index7.js +15 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +11 -12
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +42 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +19 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +73 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +3 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +16 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +32 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +304 -11
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +42 -258
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +62 -38
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +485 -61
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +90 -480
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +3 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +0 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +100 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +23 -95
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +231 -23
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +3 -236
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +249 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +78 -234
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +53 -87
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +343 -49
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +29 -20
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +40 -40
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +189 -211
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +43 -59
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +0 -106
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +0 -353
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js
CHANGED
|
@@ -2,36 +2,120 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import "../../../shared/data-access/dist/
|
|
8
|
-
import
|
|
9
|
-
import "../../../shared/
|
|
5
|
+
import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { extractApiErrorMessage as t } from "../../../shared/util/dist/lib/apiErrors.js";
|
|
7
|
+
import { usePaymentTermsQuery as n } from "../../../shared/data-access/dist/lib/reference-data/usePaymentTermsQuery.js";
|
|
8
|
+
import "../../../shared/ui/dist/index.js";
|
|
9
|
+
import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
10
|
+
import "../../../shared/feature/dist/index.js";
|
|
11
|
+
import { areOverdueTermsValid as i, buildOverdueReminderPayload as a, buildPaymentReminderPayload as o, buildRemindersView as s, canCreateReminders as c, getImpliedDueDate as l, isBeforeDueDaysValid as u, sanitizeReminderDays as d } from "./index14.js";
|
|
12
|
+
import { useCreateOverdueReminderMutation as f, useCreatePaymentReminderMutation as p, useOverdueRemindersQuery as m, usePaymentRemindersQuery as h } from "../../data-access/dist/index11.js";
|
|
10
13
|
import "../../data-access/dist/index.js";
|
|
11
|
-
import {
|
|
12
|
-
import { useMemo as i } from "react";
|
|
14
|
+
import { useCallback as g, useMemo as _, useState as v } from "react";
|
|
13
15
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
var y = [""];
|
|
17
|
+
function b({ open: b, isInvoice: x, disabled: S, paymentTermsId: C, paymentTermsCustomDate: w, paymentReminderId: T, overdueReminderId: E, messages: D, onSelect: O }) {
|
|
18
|
+
let { initResponse: k } = r(), A = n().data?.data, j = _(() => c(k?.scopes), [k?.scopes]), [M, N] = v(!1), [P, F] = v(""), [I, L] = v(y), R = b && x && M, z = h({ enabled: R }), B = m({ enabled: R }), V = p(), H = f(), U = g((e) => {
|
|
19
|
+
N(e), F(""), L(y);
|
|
20
|
+
}, []), W = g((e) => {
|
|
21
|
+
e || (O({
|
|
22
|
+
paymentReminderId: "",
|
|
23
|
+
overdueReminderId: ""
|
|
24
|
+
}), F(""), L(y)), N(e);
|
|
25
|
+
}, [O]), G = g((e) => O({ paymentReminderId: e }), [O]), K = g((e) => O({ overdueReminderId: e }), [O]), q = g((e) => F(d(e)), []), J = g((e, t) => {
|
|
26
|
+
let n = d(t);
|
|
27
|
+
L((t) => t.map((t, r) => r === e ? n : t));
|
|
28
|
+
}, []), Y = g(() => {
|
|
29
|
+
L((e) => e.length < 3 ? [...e, ""] : e);
|
|
30
|
+
}, []), X = g(() => L(y), []), Z = g(() => l({
|
|
31
|
+
paymentTermsId: C,
|
|
32
|
+
paymentTermsCustomDate: w,
|
|
33
|
+
paymentTerms: A,
|
|
34
|
+
today: /* @__PURE__ */ new Date()
|
|
25
35
|
}), [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
A,
|
|
37
|
+
w,
|
|
38
|
+
C
|
|
39
|
+
]), Q = g(async () => {
|
|
40
|
+
if (u(P)) try {
|
|
41
|
+
let t = await V.mutateAsync({ body: o({
|
|
42
|
+
daysBefore: Number(P),
|
|
43
|
+
dueDate: Z(),
|
|
44
|
+
messages: D
|
|
45
|
+
}) });
|
|
46
|
+
F(""), O({ paymentReminderId: t.id }), e.success(D.reminderAdded);
|
|
47
|
+
} catch (n) {
|
|
48
|
+
e.error(t(n) ?? D.genericError);
|
|
49
|
+
}
|
|
50
|
+
}, [
|
|
51
|
+
P,
|
|
52
|
+
V,
|
|
53
|
+
Z,
|
|
54
|
+
D,
|
|
55
|
+
O
|
|
56
|
+
]), $ = g(async () => {
|
|
57
|
+
if (i(I)) try {
|
|
58
|
+
let t = await H.mutateAsync({ body: a({
|
|
59
|
+
terms: I,
|
|
60
|
+
dueDate: Z(),
|
|
61
|
+
messages: D
|
|
62
|
+
}) });
|
|
63
|
+
L(y), O({ overdueReminderId: t.id }), e.success(D.reminderAdded);
|
|
64
|
+
} catch (n) {
|
|
65
|
+
e.error(t(n) ?? D.genericError);
|
|
66
|
+
}
|
|
67
|
+
}, [
|
|
68
|
+
H,
|
|
69
|
+
Z,
|
|
70
|
+
D,
|
|
71
|
+
O,
|
|
72
|
+
I
|
|
34
73
|
]);
|
|
74
|
+
return {
|
|
75
|
+
view: _(() => x ? s({
|
|
76
|
+
showReminders: M,
|
|
77
|
+
paymentTermsId: C,
|
|
78
|
+
paymentTermsCustomDate: w,
|
|
79
|
+
paymentReminderId: T,
|
|
80
|
+
overdueReminderId: E,
|
|
81
|
+
paymentReminders: z.data?.data,
|
|
82
|
+
overdueReminders: B.data?.data,
|
|
83
|
+
canCreate: j,
|
|
84
|
+
disabled: S,
|
|
85
|
+
beforeDueInput: P,
|
|
86
|
+
overdueTerms: I,
|
|
87
|
+
isCreatingPaymentReminder: V.isPending,
|
|
88
|
+
isCreatingOverdueReminder: H.isPending,
|
|
89
|
+
today: /* @__PURE__ */ new Date(),
|
|
90
|
+
messages: D
|
|
91
|
+
}) : void 0, [
|
|
92
|
+
P,
|
|
93
|
+
j,
|
|
94
|
+
H.isPending,
|
|
95
|
+
V.isPending,
|
|
96
|
+
S,
|
|
97
|
+
x,
|
|
98
|
+
D,
|
|
99
|
+
E,
|
|
100
|
+
B.data?.data,
|
|
101
|
+
I,
|
|
102
|
+
T,
|
|
103
|
+
z.data?.data,
|
|
104
|
+
w,
|
|
105
|
+
C,
|
|
106
|
+
M
|
|
107
|
+
]),
|
|
108
|
+
reset: U,
|
|
109
|
+
toggle: W,
|
|
110
|
+
selectPaymentReminder: G,
|
|
111
|
+
selectOverdueReminder: K,
|
|
112
|
+
changeBeforeDueInput: q,
|
|
113
|
+
saveBeforeDue: Q,
|
|
114
|
+
changeOverdueTerm: J,
|
|
115
|
+
addOverdueTerm: Y,
|
|
116
|
+
clearOverdueTerms: X,
|
|
117
|
+
saveOverdue: $
|
|
118
|
+
};
|
|
35
119
|
}
|
|
36
120
|
//#endregion
|
|
37
|
-
export {
|
|
121
|
+
export { b as useReceivableReminders };
|