@tesouro/embedded-components-react 0.11.206 → 0.11.211
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.css +13 -126
- package/dist/index.d.ts +6 -5
- package/dist/lib/ReceivablesWidget.d.ts +6 -5
- package/dist/lib/WidgetSuite.d.ts +6 -5
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivableAttachmentsSection.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivableCustomerSection.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +16 -18
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js +186 -239
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +59 -52
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +5 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/paymentRecord.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/paymentTerms.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/preview.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurrence.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurringSeries.js +19 -23
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/reminders.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/statusColors.js +34 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +2 -6
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActionsModal.js +5 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +16 -16
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentRecord.js +1 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +28 -27
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +18 -120
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +89 -84
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +91 -36
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +41 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +2 -12
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +9 -25
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +26 -208
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +209 -52
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +50 -208
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +186 -138
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +157 -12
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +10 -19
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +23 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +2 -116
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +117 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +3 -198
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +198 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +2 -54
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +14 -19
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +22 -8
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +40 -77
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +17 -37
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +8 -18
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +61 -38
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +27 -27
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +26 -15
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +14 -6
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +19 -35
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +31 -14
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +67 -24
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +391 -84
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +2 -494
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +47 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +62 -38
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +433 -61
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +176 -428
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +20 -224
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +6 -21
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +264 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +2 -264
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +131 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +22 -126
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +235 -23
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +3 -239
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +247 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js +26 -244
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index59.js +183 -26
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index60.js +21 -194
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index61.js +143 -21
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index62.js +2 -143
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index63.js +47 -2
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index16.js +47 -48
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index17.js +127 -144
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index3.js +0 -3
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index16.js +107 -111
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index7.js +2 -31
- 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/product-catalog/feature/dist/lib/helpers.js +1 -1
- package/dist/packages/shared-ui-shadcn/dist/index.js +1554 -1544
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +0 -7
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index64.js +0 -47
|
@@ -1,3 +1,247 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import "./
|
|
3
|
-
import "
|
|
1
|
+
import { Alert as e, AlertDescription as t, Button as n, Input as r, Label as i, RadioGroup as a, RadioGroupItem as o, Switch as s, Typography as c } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { RECEIVABLE_FORM_DIALOG_LABELS_EN as l } from "./index19.js";
|
|
3
|
+
import { Fragment as u } from "react";
|
|
4
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
5
|
+
import { PlusIcon as m, TriangleAlert as h } from "lucide-react";
|
|
6
|
+
// ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js
|
|
7
|
+
function g(e) {
|
|
8
|
+
e.key === "Enter" && e.preventDefault();
|
|
9
|
+
}
|
|
10
|
+
var _ = "ttw:border ttw:border-border ttw:rounded-lg ttw:min-h-28 ttw:p-2.5 ttw:flex ttw:w-full ttw:flex-col ttw:gap-4 ttw:xl:w-1/2";
|
|
11
|
+
function v({ id: e, value: t, label: n }) {
|
|
12
|
+
return /* @__PURE__ */ p("li", {
|
|
13
|
+
className: "ttw:flex ttw:items-center ttw:gap-2",
|
|
14
|
+
children: [/* @__PURE__ */ f(o, {
|
|
15
|
+
value: t,
|
|
16
|
+
id: e
|
|
17
|
+
}), /* @__PURE__ */ f(i, {
|
|
18
|
+
htmlFor: e,
|
|
19
|
+
className: "ttw:text-sm ttw:font-normal ttw:leading-snug",
|
|
20
|
+
children: n
|
|
21
|
+
})]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function y({ idPrefix: e, options: t, selectedId: n, noneLabel: r, onSelect: i }) {
|
|
25
|
+
return /* @__PURE__ */ f(a, {
|
|
26
|
+
className: "ttw:contents",
|
|
27
|
+
value: n,
|
|
28
|
+
onValueChange: i,
|
|
29
|
+
children: /* @__PURE__ */ p("ul", {
|
|
30
|
+
className: "ttw:flex ttw:flex-col ttw:gap-3",
|
|
31
|
+
children: [/* @__PURE__ */ f(v, {
|
|
32
|
+
id: `${e}-none`,
|
|
33
|
+
value: "",
|
|
34
|
+
label: r
|
|
35
|
+
}), t.map((t) => /* @__PURE__ */ f(v, {
|
|
36
|
+
id: `${e}-${t.value}`,
|
|
37
|
+
value: t.value,
|
|
38
|
+
label: t.label
|
|
39
|
+
}, t.value))]
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function b({ direction: e, directionClassName: t, labels: n }) {
|
|
44
|
+
return /* @__PURE__ */ p(c, {
|
|
45
|
+
variant: "body2",
|
|
46
|
+
children: [
|
|
47
|
+
n.reminderNumberOfDays,
|
|
48
|
+
" ",
|
|
49
|
+
/* @__PURE__ */ f("span", {
|
|
50
|
+
className: t,
|
|
51
|
+
children: e
|
|
52
|
+
}),
|
|
53
|
+
" ",
|
|
54
|
+
n.reminderDueDate
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function x({ idPrefix: i, view: a, labels: o, onSelect: s, onInputChange: l, onSave: u }) {
|
|
59
|
+
let { create: d } = a, m = `${i}-error`;
|
|
60
|
+
return /* @__PURE__ */ p("div", {
|
|
61
|
+
className: _,
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ f(b, {
|
|
64
|
+
direction: o.reminderBefore,
|
|
65
|
+
directionClassName: "ttw:font-semibold",
|
|
66
|
+
labels: o
|
|
67
|
+
}),
|
|
68
|
+
/* @__PURE__ */ f(y, {
|
|
69
|
+
idPrefix: `${i}-option`,
|
|
70
|
+
options: a.options,
|
|
71
|
+
selectedId: a.selectedId,
|
|
72
|
+
noneLabel: o.reminderNone,
|
|
73
|
+
onSelect: s
|
|
74
|
+
}),
|
|
75
|
+
d && /* @__PURE__ */ p("div", {
|
|
76
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2.5",
|
|
77
|
+
children: [
|
|
78
|
+
d.caption && /* @__PURE__ */ f(c, {
|
|
79
|
+
variant: "caption",
|
|
80
|
+
color: "muted",
|
|
81
|
+
children: d.caption
|
|
82
|
+
}),
|
|
83
|
+
/* @__PURE__ */ p("div", {
|
|
84
|
+
className: "ttw:flex ttw:items-center ttw:gap-2.5",
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ f(r, {
|
|
87
|
+
type: "text",
|
|
88
|
+
inputMode: "numeric",
|
|
89
|
+
value: d.value,
|
|
90
|
+
onChange: (e) => l(e.target.value),
|
|
91
|
+
onKeyDown: g,
|
|
92
|
+
disabled: d.inputDisabled,
|
|
93
|
+
className: "ttw:text-right ttw:w-full ttw:p-1.5 ttw:max-w-56",
|
|
94
|
+
placeholder: o.reminderPlaceholder,
|
|
95
|
+
"aria-label": o.reminderBeforeDueInputLabel,
|
|
96
|
+
"aria-invalid": !!d.error,
|
|
97
|
+
"aria-describedby": d.error ? m : void 0
|
|
98
|
+
}),
|
|
99
|
+
/* @__PURE__ */ f(c, {
|
|
100
|
+
variant: "body2",
|
|
101
|
+
children: d.unitLabel
|
|
102
|
+
}),
|
|
103
|
+
/* @__PURE__ */ f(n, {
|
|
104
|
+
type: "button",
|
|
105
|
+
variant: "secondary",
|
|
106
|
+
className: "ttw:hover:brightness-95 ttw:text-secondary-foreground ttw:text-xs",
|
|
107
|
+
disabled: d.saveDisabled,
|
|
108
|
+
loading: d.isSaving,
|
|
109
|
+
onClick: u,
|
|
110
|
+
children: o.reminderSaveButton
|
|
111
|
+
})
|
|
112
|
+
]
|
|
113
|
+
}),
|
|
114
|
+
d.error && /* @__PURE__ */ f(c, {
|
|
115
|
+
id: m,
|
|
116
|
+
variant: "caption",
|
|
117
|
+
color: "destructive",
|
|
118
|
+
children: d.error
|
|
119
|
+
})
|
|
120
|
+
]
|
|
121
|
+
}),
|
|
122
|
+
a.warning && /* @__PURE__ */ p(e, {
|
|
123
|
+
variant: "warning",
|
|
124
|
+
children: [/* @__PURE__ */ f(h, { "aria-hidden": "true" }), /* @__PURE__ */ f(t, { children: a.warning })]
|
|
125
|
+
})
|
|
126
|
+
]
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function S({ idPrefix: e, view: t, labels: i, onSelect: a, onTermChange: o, onAddTerm: s, onClear: l, onSave: d }) {
|
|
130
|
+
let { create: h } = t;
|
|
131
|
+
return /* @__PURE__ */ p("div", {
|
|
132
|
+
className: _,
|
|
133
|
+
children: [
|
|
134
|
+
/* @__PURE__ */ f(b, {
|
|
135
|
+
direction: i.reminderAfter,
|
|
136
|
+
directionClassName: "ttw:font-semibold",
|
|
137
|
+
labels: i
|
|
138
|
+
}),
|
|
139
|
+
/* @__PURE__ */ f(y, {
|
|
140
|
+
idPrefix: `${e}-option`,
|
|
141
|
+
options: t.options,
|
|
142
|
+
selectedId: t.selectedId,
|
|
143
|
+
noneLabel: i.reminderNone,
|
|
144
|
+
onSelect: a
|
|
145
|
+
}),
|
|
146
|
+
h && /* @__PURE__ */ p("div", {
|
|
147
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2.5",
|
|
148
|
+
children: [
|
|
149
|
+
/* @__PURE__ */ f(c, {
|
|
150
|
+
variant: "caption",
|
|
151
|
+
color: "muted",
|
|
152
|
+
children: h.caption
|
|
153
|
+
}),
|
|
154
|
+
/* @__PURE__ */ p("div", {
|
|
155
|
+
className: "ttw:flex ttw:items-center ttw:gap-2.5",
|
|
156
|
+
children: [h.terms.map((e, t) => /* @__PURE__ */ p(u, { children: [/* @__PURE__ */ f(r, {
|
|
157
|
+
type: "text",
|
|
158
|
+
inputMode: "numeric",
|
|
159
|
+
value: e.value,
|
|
160
|
+
onChange: (e) => o(t, e.target.value),
|
|
161
|
+
onKeyDown: g,
|
|
162
|
+
disabled: h.inputsDisabled,
|
|
163
|
+
className: "ttw:text-right ttw:w-15 ttw:p-1.5",
|
|
164
|
+
placeholder: e.showPlaceholder ? i.reminderPlaceholder : void 0,
|
|
165
|
+
"aria-label": e.ariaLabel
|
|
166
|
+
}), /* @__PURE__ */ f(c, {
|
|
167
|
+
variant: "body2",
|
|
168
|
+
children: e.unitLabel
|
|
169
|
+
})] }, t)), h.showAddTerm && /* @__PURE__ */ p(n, {
|
|
170
|
+
type: "button",
|
|
171
|
+
variant: "ghost",
|
|
172
|
+
className: "ttw:text-xs ttw:text-primary ttw:hover:text-primary",
|
|
173
|
+
disabled: h.addTermDisabled,
|
|
174
|
+
onClick: s,
|
|
175
|
+
children: [/* @__PURE__ */ f(m, {}), i.reminderAddTermButton]
|
|
176
|
+
})]
|
|
177
|
+
}),
|
|
178
|
+
/* @__PURE__ */ p("div", {
|
|
179
|
+
className: "ttw:flex ttw:items-center ttw:gap-2.5",
|
|
180
|
+
children: [/* @__PURE__ */ f(n, {
|
|
181
|
+
type: "button",
|
|
182
|
+
variant: "ghost",
|
|
183
|
+
className: "ttw:text-xs",
|
|
184
|
+
disabled: h.clearDisabled,
|
|
185
|
+
onClick: l,
|
|
186
|
+
children: i.reminderClearButton
|
|
187
|
+
}), /* @__PURE__ */ f(n, {
|
|
188
|
+
type: "button",
|
|
189
|
+
variant: "secondary",
|
|
190
|
+
className: "ttw:hover:brightness-95 ttw:text-secondary-foreground ttw:text-xs",
|
|
191
|
+
disabled: h.saveDisabled,
|
|
192
|
+
loading: h.isSaving,
|
|
193
|
+
onClick: d,
|
|
194
|
+
children: i.reminderSaveButton
|
|
195
|
+
})]
|
|
196
|
+
})
|
|
197
|
+
]
|
|
198
|
+
})
|
|
199
|
+
]
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
function C({ idPrefix: e, view: t, onToggle: n, onPaymentReminderSelect: r, onOverdueReminderSelect: i, onBeforeDueInputChange: a, onBeforeDueSave: o, onOverdueTermChange: u, onOverdueAddTerm: m, onOverdueClear: h, onOverdueSave: g, labels: _ }) {
|
|
203
|
+
let v = {
|
|
204
|
+
...l,
|
|
205
|
+
..._
|
|
206
|
+
}, { cards: y } = t;
|
|
207
|
+
return /* @__PURE__ */ p("section", {
|
|
208
|
+
className: "ttw:flex ttw:flex-col ttw:gap-6",
|
|
209
|
+
children: [/* @__PURE__ */ p("div", {
|
|
210
|
+
className: "ttw:flex ttw:items-center ttw:gap-3",
|
|
211
|
+
children: [/* @__PURE__ */ f(s, {
|
|
212
|
+
checked: t.checked,
|
|
213
|
+
disabled: t.toggleDisabled,
|
|
214
|
+
onCheckedChange: n,
|
|
215
|
+
"aria-label": v.remindersToggleLabel
|
|
216
|
+
}), /* @__PURE__ */ f(c, {
|
|
217
|
+
variant: "body2",
|
|
218
|
+
children: v.remindersDescription
|
|
219
|
+
})]
|
|
220
|
+
}), y && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ p("div", {
|
|
221
|
+
className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:w-full ttw:xl:flex-row",
|
|
222
|
+
children: [y.beforeDue && /* @__PURE__ */ f(x, {
|
|
223
|
+
idPrefix: `${e}-before`,
|
|
224
|
+
view: y.beforeDue,
|
|
225
|
+
labels: v,
|
|
226
|
+
onSelect: r,
|
|
227
|
+
onInputChange: a,
|
|
228
|
+
onSave: o
|
|
229
|
+
}), /* @__PURE__ */ f(S, {
|
|
230
|
+
idPrefix: `${e}-overdue`,
|
|
231
|
+
view: y.overdue,
|
|
232
|
+
labels: v,
|
|
233
|
+
onSelect: i,
|
|
234
|
+
onTermChange: u,
|
|
235
|
+
onAddTerm: m,
|
|
236
|
+
onClear: h,
|
|
237
|
+
onSave: g
|
|
238
|
+
})]
|
|
239
|
+
}), /* @__PURE__ */ f(c, {
|
|
240
|
+
variant: "body2",
|
|
241
|
+
color: "muted",
|
|
242
|
+
className: "ttw:font-medium",
|
|
243
|
+
children: v.remindersLibraryNote
|
|
244
|
+
})] })]
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
export { C as ReceivableRemindersSection };
|
|
@@ -1,248 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { Skeleton as e, SummaryCard as t, SummaryCardGroup as n } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { LoadingRegion as r } from "../../../shared/ui/dist/lib/LoadingRegion/LoadingRegion.js";
|
|
3
|
+
import "../../../shared/ui/dist/index.js";
|
|
4
|
+
import { RECEIVABLE_STATUS_CARDS_LABELS_EN as i } from "./index19.js";
|
|
5
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
6
6
|
// ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
value: n,
|
|
28
|
-
onValueChange: a,
|
|
29
|
-
children: /* @__PURE__ */ d("ul", {
|
|
30
|
-
className: "ttw:flex ttw:flex-col ttw:gap-3",
|
|
31
|
-
children: [/* @__PURE__ */ u(h, {
|
|
32
|
-
id: `${e}-none`,
|
|
33
|
-
value: "",
|
|
34
|
-
label: i
|
|
35
|
-
}), t.map((t) => /* @__PURE__ */ u(h, {
|
|
36
|
-
id: `${e}-${t.value}`,
|
|
37
|
-
value: t.value,
|
|
38
|
-
label: t.label
|
|
39
|
-
}, t.value))]
|
|
7
|
+
var o = 4;
|
|
8
|
+
function s({ view: s, onSelect: c, labels: l }) {
|
|
9
|
+
let u = {
|
|
10
|
+
...i,
|
|
11
|
+
...l
|
|
12
|
+
}, d = s.kind === "loading";
|
|
13
|
+
return /* @__PURE__ */ a(r, {
|
|
14
|
+
isLoading: d,
|
|
15
|
+
loadingLabel: u.loading,
|
|
16
|
+
children: /* @__PURE__ */ a(n, {
|
|
17
|
+
"aria-label": u.group,
|
|
18
|
+
children: s.kind === "loading" ? Array.from({ length: o }).map((t, n) => /* @__PURE__ */ a(e, { className: "ttw:h-28 ttw:rounded-lg" }, n)) : s.cards.map((e) => /* @__PURE__ */ a(t, {
|
|
19
|
+
label: e.label,
|
|
20
|
+
labelTone: e.labelTone,
|
|
21
|
+
amount: e.amountLabel,
|
|
22
|
+
caption: e.captionLabel,
|
|
23
|
+
selected: e.selected,
|
|
24
|
+
disabled: e.disabled,
|
|
25
|
+
onClick: () => c(e.value)
|
|
26
|
+
}, e.value))
|
|
40
27
|
})
|
|
41
28
|
});
|
|
42
29
|
}
|
|
43
|
-
|
|
44
|
-
return /* @__PURE__ */ d(o, {
|
|
45
|
-
variant: "body2",
|
|
46
|
-
children: [
|
|
47
|
-
n.reminderNumberOfDays,
|
|
48
|
-
" ",
|
|
49
|
-
/* @__PURE__ */ u("span", {
|
|
50
|
-
className: t,
|
|
51
|
-
children: e
|
|
52
|
-
}),
|
|
53
|
-
" ",
|
|
54
|
-
n.reminderDueDate
|
|
55
|
-
]
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
function v({ idPrefix: n, view: r, labels: i, onSelect: a, onInputChange: s, onSave: c }) {
|
|
59
|
-
let { create: l } = r, f = `${n}-error`;
|
|
60
|
-
return /* @__PURE__ */ d("div", {
|
|
61
|
-
className: m,
|
|
62
|
-
children: [
|
|
63
|
-
/* @__PURE__ */ u(_, {
|
|
64
|
-
direction: i.reminderBefore,
|
|
65
|
-
directionClassName: "ttw:text-green-700 ttw:font-bold",
|
|
66
|
-
labels: i
|
|
67
|
-
}),
|
|
68
|
-
/* @__PURE__ */ u(g, {
|
|
69
|
-
idPrefix: `${n}-option`,
|
|
70
|
-
options: r.options,
|
|
71
|
-
selectedId: r.selectedId,
|
|
72
|
-
noneLabel: i.reminderNone,
|
|
73
|
-
onSelect: a
|
|
74
|
-
}),
|
|
75
|
-
l && /* @__PURE__ */ d("div", {
|
|
76
|
-
className: "ttw:flex ttw:flex-col ttw:gap-2.5",
|
|
77
|
-
children: [
|
|
78
|
-
l.caption && /* @__PURE__ */ u(o, {
|
|
79
|
-
variant: "caption",
|
|
80
|
-
color: "muted",
|
|
81
|
-
children: l.caption
|
|
82
|
-
}),
|
|
83
|
-
/* @__PURE__ */ d("div", {
|
|
84
|
-
className: "ttw:flex ttw:items-center ttw:gap-2.5",
|
|
85
|
-
children: [
|
|
86
|
-
/* @__PURE__ */ u(t, {
|
|
87
|
-
type: "text",
|
|
88
|
-
inputMode: "numeric",
|
|
89
|
-
value: l.value,
|
|
90
|
-
onChange: (e) => s(e.target.value),
|
|
91
|
-
onKeyDown: p,
|
|
92
|
-
disabled: l.inputDisabled,
|
|
93
|
-
className: "ttw:text-right ttw:w-full ttw:p-1.5 ttw:max-w-56",
|
|
94
|
-
placeholder: i.reminderPlaceholder,
|
|
95
|
-
"aria-label": i.reminderBeforeDueInputLabel,
|
|
96
|
-
"aria-invalid": !!l.error,
|
|
97
|
-
"aria-describedby": l.error ? f : void 0
|
|
98
|
-
}),
|
|
99
|
-
/* @__PURE__ */ u(o, {
|
|
100
|
-
variant: "body2",
|
|
101
|
-
children: l.unitLabel
|
|
102
|
-
}),
|
|
103
|
-
/* @__PURE__ */ u(e, {
|
|
104
|
-
type: "button",
|
|
105
|
-
variant: "secondary",
|
|
106
|
-
className: "ttw:hover:brightness-95 ttw:text-secondary-foreground ttw:text-xs",
|
|
107
|
-
disabled: l.saveDisabled,
|
|
108
|
-
loading: l.isSaving,
|
|
109
|
-
onClick: c,
|
|
110
|
-
children: i.reminderSaveButton
|
|
111
|
-
})
|
|
112
|
-
]
|
|
113
|
-
}),
|
|
114
|
-
l.error && /* @__PURE__ */ u(o, {
|
|
115
|
-
id: f,
|
|
116
|
-
variant: "caption",
|
|
117
|
-
color: "destructive",
|
|
118
|
-
children: l.error
|
|
119
|
-
})
|
|
120
|
-
]
|
|
121
|
-
}),
|
|
122
|
-
r.warning && /* @__PURE__ */ u(o, {
|
|
123
|
-
variant: "body2",
|
|
124
|
-
className: "ttw:text-amber-700",
|
|
125
|
-
children: r.warning
|
|
126
|
-
})
|
|
127
|
-
]
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
function y({ idPrefix: n, view: r, labels: i, onSelect: a, onTermChange: s, onAddTerm: l, onClear: h, onSave: v }) {
|
|
131
|
-
let { create: y } = r;
|
|
132
|
-
return /* @__PURE__ */ d("div", {
|
|
133
|
-
className: m,
|
|
134
|
-
children: [
|
|
135
|
-
/* @__PURE__ */ u(_, {
|
|
136
|
-
direction: i.reminderAfter,
|
|
137
|
-
directionClassName: "ttw:text-destructive ttw:font-bold",
|
|
138
|
-
labels: i
|
|
139
|
-
}),
|
|
140
|
-
/* @__PURE__ */ u(g, {
|
|
141
|
-
idPrefix: `${n}-option`,
|
|
142
|
-
options: r.options,
|
|
143
|
-
selectedId: r.selectedId,
|
|
144
|
-
noneLabel: i.reminderNone,
|
|
145
|
-
onSelect: a
|
|
146
|
-
}),
|
|
147
|
-
y && /* @__PURE__ */ d("div", {
|
|
148
|
-
className: "ttw:flex ttw:flex-col ttw:gap-2.5",
|
|
149
|
-
children: [
|
|
150
|
-
/* @__PURE__ */ u(o, {
|
|
151
|
-
variant: "caption",
|
|
152
|
-
color: "muted",
|
|
153
|
-
children: y.caption
|
|
154
|
-
}),
|
|
155
|
-
/* @__PURE__ */ d("div", {
|
|
156
|
-
className: "ttw:flex ttw:items-center ttw:gap-2.5",
|
|
157
|
-
children: [y.terms.map((e, n) => /* @__PURE__ */ d(c, { children: [/* @__PURE__ */ u(t, {
|
|
158
|
-
type: "text",
|
|
159
|
-
inputMode: "numeric",
|
|
160
|
-
value: e.value,
|
|
161
|
-
onChange: (e) => s(n, e.target.value),
|
|
162
|
-
onKeyDown: p,
|
|
163
|
-
disabled: y.inputsDisabled,
|
|
164
|
-
className: "ttw:text-right ttw:w-15 ttw:p-1.5",
|
|
165
|
-
placeholder: e.showPlaceholder ? i.reminderPlaceholder : void 0,
|
|
166
|
-
"aria-label": e.ariaLabel
|
|
167
|
-
}), /* @__PURE__ */ u(o, {
|
|
168
|
-
variant: "body2",
|
|
169
|
-
children: e.unitLabel
|
|
170
|
-
})] }, n)), y.showAddTerm && /* @__PURE__ */ d(e, {
|
|
171
|
-
type: "button",
|
|
172
|
-
variant: "ghost",
|
|
173
|
-
className: "ttw:text-xs ttw:text-primary ttw:hover:text-primary",
|
|
174
|
-
disabled: y.addTermDisabled,
|
|
175
|
-
onClick: l,
|
|
176
|
-
children: [/* @__PURE__ */ u(f, {}), i.reminderAddTermButton]
|
|
177
|
-
})]
|
|
178
|
-
}),
|
|
179
|
-
/* @__PURE__ */ d("div", {
|
|
180
|
-
className: "ttw:flex ttw:items-center ttw:gap-2.5",
|
|
181
|
-
children: [/* @__PURE__ */ u(e, {
|
|
182
|
-
type: "button",
|
|
183
|
-
variant: "ghost",
|
|
184
|
-
className: "ttw:text-xs",
|
|
185
|
-
disabled: y.clearDisabled,
|
|
186
|
-
onClick: h,
|
|
187
|
-
children: i.reminderClearButton
|
|
188
|
-
}), /* @__PURE__ */ u(e, {
|
|
189
|
-
type: "button",
|
|
190
|
-
variant: "secondary",
|
|
191
|
-
className: "ttw:hover:brightness-95 ttw:text-secondary-foreground ttw:text-xs",
|
|
192
|
-
disabled: y.saveDisabled,
|
|
193
|
-
loading: y.isSaving,
|
|
194
|
-
onClick: v,
|
|
195
|
-
children: i.reminderSaveButton
|
|
196
|
-
})]
|
|
197
|
-
})
|
|
198
|
-
]
|
|
199
|
-
})
|
|
200
|
-
]
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
function b({ idPrefix: e, view: t, onToggle: n, onPaymentReminderSelect: r, onOverdueReminderSelect: i, onBeforeDueInputChange: c, onBeforeDueSave: f, onOverdueTermChange: p, onOverdueAddTerm: m, onOverdueClear: h, onOverdueSave: g, labels: _ }) {
|
|
204
|
-
let b = {
|
|
205
|
-
...s,
|
|
206
|
-
..._
|
|
207
|
-
}, { cards: x } = t;
|
|
208
|
-
return /* @__PURE__ */ d("section", {
|
|
209
|
-
className: "ttw:flex ttw:flex-col ttw:gap-6",
|
|
210
|
-
children: [/* @__PURE__ */ d("div", {
|
|
211
|
-
className: "ttw:flex ttw:items-center ttw:gap-3",
|
|
212
|
-
children: [/* @__PURE__ */ u(a, {
|
|
213
|
-
checked: t.checked,
|
|
214
|
-
disabled: t.toggleDisabled,
|
|
215
|
-
onCheckedChange: n,
|
|
216
|
-
"aria-label": b.remindersToggleLabel
|
|
217
|
-
}), /* @__PURE__ */ u(o, {
|
|
218
|
-
variant: "body2",
|
|
219
|
-
children: b.remindersDescription
|
|
220
|
-
})]
|
|
221
|
-
}), x && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("div", {
|
|
222
|
-
className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:w-full ttw:xl:flex-row",
|
|
223
|
-
children: [x.beforeDue && /* @__PURE__ */ u(v, {
|
|
224
|
-
idPrefix: `${e}-before`,
|
|
225
|
-
view: x.beforeDue,
|
|
226
|
-
labels: b,
|
|
227
|
-
onSelect: r,
|
|
228
|
-
onInputChange: c,
|
|
229
|
-
onSave: f
|
|
230
|
-
}), /* @__PURE__ */ u(y, {
|
|
231
|
-
idPrefix: `${e}-overdue`,
|
|
232
|
-
view: x.overdue,
|
|
233
|
-
labels: b,
|
|
234
|
-
onSelect: i,
|
|
235
|
-
onTermChange: p,
|
|
236
|
-
onAddTerm: m,
|
|
237
|
-
onClear: h,
|
|
238
|
-
onSave: g
|
|
239
|
-
})]
|
|
240
|
-
}), /* @__PURE__ */ u(o, {
|
|
241
|
-
variant: "body2",
|
|
242
|
-
color: "muted",
|
|
243
|
-
className: "ttw:font-medium",
|
|
244
|
-
children: b.remindersLibraryNote
|
|
245
|
-
})] })]
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
export { b as ReceivableRemindersSection };
|
|
30
|
+
export { s as ReceivableStatusCards, s as default };
|