@tesouro/embedded-components-react 0.7.45 → 0.7.47
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 +33 -39
- package/dist/lib/CounterpartsWidget.d.ts +33 -22
- package/dist/lib/CounterpartsWidgetPublic.d.ts +33 -22
- package/dist/lib/CustomersWidget.d.ts +31 -22
- package/dist/lib/ReceivablesWidget.d.ts +3 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +12 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +15 -15
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +40 -42
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +1 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index5.js +30 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index14.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index15.js +7 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index33.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index34.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index37.js +5 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index48.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index49.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index5.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +40 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index2.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +8 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index3.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index6.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +9 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +7 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +76 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +27 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +2 -76
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +30 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +5 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +32 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +2 -30
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +73 -77
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +9 -26
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +44 -44
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index7.js +197 -208
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/auditHistory/labels.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +22 -23
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +10 -24
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +53 -37
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +21 -53
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +8 -21
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +77 -8
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +31 -69
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +17 -38
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +40 -17
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +26 -38
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +18 -27
- 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 +35 -9
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +14 -36
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +26 -14
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +84 -23
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +487 -80
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +2 -494
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +48 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +62 -38
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +438 -61
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +207 -431
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +20 -222
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +6 -21
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +265 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +2 -265
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +131 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +22 -125
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +235 -23
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +3 -240
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +249 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +54 -242
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +221 -51
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +38 -222
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +13 -13
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +85 -84
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js +238 -241
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index11.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +6 -5
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index5.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index2.js +14 -0
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index3.js +13 -0
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index4.js +18 -0
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index5.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index6.js +20 -0
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index7.js +32 -0
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index8.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/{bill-pay-widget → shared/document-status}/util/dist/lib/derivePayableStatus.js +23 -10
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/util/dist/lib/receivableFilledTone.js +22 -0
- 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/bill-pay-widget/ui/dist/index14.js +0 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +0 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +0 -34
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +0 -8
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js +0 -45
|
@@ -1,449 +1,225 @@
|
|
|
1
|
-
import { Alert as e, AlertDescription as t, Button as n,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { useId as ne } from "react";
|
|
6
|
-
import { jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
7
|
-
import { CircleAlertIcon as O, MinusIcon as k, PlusIcon as A, Trash2Icon as j, XIcon as M } from "lucide-react";
|
|
1
|
+
import { Alert as e, AlertDescription as t, Button as n, DatePicker as r, Dialog as i, DialogContent as a, DialogFooter as o, DialogHeader as s, DialogTitle as c, FieldRequirement as l, InputGroup as u, InputGroupAddon as d, InputGroupInput as f, Label as p, Skeleton as m } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { RECEIVABLE_PAYMENT_DIALOG_LABELS_EN as h } from "./index14.js";
|
|
3
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
4
|
+
import { NotebookPen as y } from "lucide-react";
|
|
8
5
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
var b = {
|
|
7
|
+
amount: "receivable-payment-amount",
|
|
8
|
+
date: "receivable-payment-date",
|
|
9
|
+
time: "receivable-payment-time"
|
|
10
|
+
};
|
|
11
|
+
function x({ id: e, message: t }) {
|
|
12
|
+
return t ? /* @__PURE__ */ _("p", {
|
|
13
|
+
id: e,
|
|
12
14
|
className: "ttw:text-sm ttw:text-destructive",
|
|
13
|
-
children:
|
|
15
|
+
children: t
|
|
14
16
|
}) : null;
|
|
15
17
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
invalid: !!i?.name,
|
|
26
|
-
focusOnMount: o
|
|
27
|
-
})
|
|
28
|
-
}),
|
|
29
|
-
/* @__PURE__ */ D("div", {
|
|
30
|
-
className: w(F, "ttw:w-26 ttw:min-w-26 ttw:px-[0.3rem]"),
|
|
31
|
-
children: [
|
|
32
|
-
/* @__PURE__ */ E("button", {
|
|
33
|
-
type: "button",
|
|
34
|
-
"aria-label": u.decreaseQuantityButton,
|
|
35
|
-
disabled: a ? !a.canDecreaseQuantity : !1,
|
|
36
|
-
className: R,
|
|
37
|
-
onClick: () => m(-1),
|
|
38
|
-
children: /* @__PURE__ */ E(k, { className: "ttw:size-3.5" })
|
|
39
|
-
}),
|
|
40
|
-
/* @__PURE__ */ E("input", {
|
|
41
|
-
id: `${S}-quantity`,
|
|
42
|
-
"aria-label": u.quantityLabel,
|
|
43
|
-
"aria-invalid": !!i?.quantity || void 0,
|
|
44
|
-
type: "text",
|
|
45
|
-
inputMode: "decimal",
|
|
46
|
-
className: "ttw:h-full ttw:w-full ttw:min-w-0 ttw:bg-transparent ttw:px-0 ttw:text-center ttw:text-sm ttw:outline-none",
|
|
47
|
-
value: t.quantity,
|
|
48
|
-
onChange: (e) => f({ quantity: e.target.value }),
|
|
49
|
-
onBlur: () => p("quantity")
|
|
50
|
-
}),
|
|
51
|
-
/* @__PURE__ */ E("button", {
|
|
52
|
-
type: "button",
|
|
53
|
-
"aria-label": u.increaseQuantityButton,
|
|
54
|
-
disabled: a ? !a.canIncreaseQuantity : !1,
|
|
55
|
-
className: R,
|
|
56
|
-
onClick: () => m(1),
|
|
57
|
-
children: /* @__PURE__ */ E(A, { className: "ttw:size-3.5" })
|
|
58
|
-
})
|
|
59
|
-
]
|
|
60
|
-
}),
|
|
61
|
-
/* @__PURE__ */ E("div", { children: /* @__PURE__ */ D(g, {
|
|
62
|
-
value: t.unit || N,
|
|
63
|
-
onValueChange: (e) => {
|
|
64
|
-
if (e === P) {
|
|
65
|
-
h?.();
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
f({ unit: e === N ? "" : e });
|
|
69
|
-
},
|
|
70
|
-
children: [/* @__PURE__ */ E(y, {
|
|
71
|
-
id: `${S}-unit`,
|
|
72
|
-
"aria-label": u.unitLabel,
|
|
73
|
-
"aria-invalid": !!i?.measureUnit || void 0,
|
|
74
|
-
className: "ttw:w-22",
|
|
75
|
-
children: /* @__PURE__ */ E(b, {
|
|
76
|
-
className: "ttw:truncate",
|
|
77
|
-
placeholder: u.unitPlaceholder
|
|
78
|
-
})
|
|
79
|
-
}), /* @__PURE__ */ D(_, { children: [
|
|
80
|
-
h && /* @__PURE__ */ D(v, {
|
|
81
|
-
value: P,
|
|
82
|
-
className: "ttw:font-semibold ttw:text-primary ttw:hover:text-primary ttw:focus:text-primary",
|
|
83
|
-
children: [/* @__PURE__ */ E(A, { className: "ttw:text-primary" }), u.manageUnitsOption]
|
|
84
|
-
}),
|
|
85
|
-
/* @__PURE__ */ E(v, {
|
|
86
|
-
value: N,
|
|
87
|
-
children: u.unitNone
|
|
88
|
-
}),
|
|
89
|
-
c.map((e) => /* @__PURE__ */ E(v, {
|
|
90
|
-
value: e.value,
|
|
91
|
-
children: e.label
|
|
92
|
-
}, e.value))
|
|
93
|
-
] })]
|
|
94
|
-
}) }),
|
|
95
|
-
/* @__PURE__ */ D("div", {
|
|
96
|
-
className: w(F, "ttw:w-full ttw:max-w-41 ttw:min-w-29"),
|
|
97
|
-
children: [/* @__PURE__ */ E("span", {
|
|
98
|
-
className: w(L, "ttw:pl-3"),
|
|
99
|
-
children: l
|
|
100
|
-
}), /* @__PURE__ */ E("input", {
|
|
101
|
-
id: `${S}-price`,
|
|
102
|
-
"aria-label": u.priceLabel,
|
|
103
|
-
"aria-invalid": !!i?.price || void 0,
|
|
104
|
-
type: "text",
|
|
105
|
-
inputMode: "decimal",
|
|
106
|
-
className: w(I, "ttw:pr-3 ttw:pl-2"),
|
|
107
|
-
value: t.price,
|
|
108
|
-
onChange: (e) => f({ price: e.target.value }),
|
|
109
|
-
onBlur: () => p("price")
|
|
110
|
-
})]
|
|
111
|
-
}),
|
|
112
|
-
/* @__PURE__ */ E("div", {
|
|
113
|
-
className: "ttw:flex ttw:w-12 ttw:min-w-12 ttw:items-center ttw:justify-center",
|
|
114
|
-
children: /* @__PURE__ */ E(r, {
|
|
115
|
-
id: `${S}-taxable`,
|
|
116
|
-
"aria-label": u.taxableLabel,
|
|
117
|
-
checked: t.taxable,
|
|
118
|
-
onCheckedChange: (e) => f({ taxable: e === !0 })
|
|
119
|
-
})
|
|
120
|
-
}),
|
|
121
|
-
s && /* @__PURE__ */ E(n, {
|
|
122
|
-
type: "button",
|
|
123
|
-
variant: "ghost",
|
|
124
|
-
size: "sm",
|
|
125
|
-
"aria-label": u.removeLineItemButton,
|
|
126
|
-
className: "ttw:w-10 ttw:rounded-none ttw:border-l ttw:border-border ttw:pl-4 ttw:text-muted-foreground ttw:hover:bg-transparent ttw:hover:text-destructive ttw:has-[>svg]:pr-0",
|
|
127
|
-
onClick: x,
|
|
128
|
-
children: /* @__PURE__ */ E(j, {})
|
|
129
|
-
})
|
|
130
|
-
]
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
function ae({ inputId: e, discountType: t, value: n, error: r, currencySymbol: i, disabled: a, labels: o, onChange: s, onTypeChange: c, onFocus: l, onBlur: m }) {
|
|
134
|
-
let h = `${e}-error`, g = [{
|
|
135
|
-
type: "amount",
|
|
136
|
-
label: i,
|
|
137
|
-
ariaLabel: o.discountAmountOptionAriaLabel
|
|
138
|
-
}, {
|
|
139
|
-
type: "percentage",
|
|
140
|
-
label: o.discountPercentageOption,
|
|
141
|
-
ariaLabel: o.discountPercentageOptionAriaLabel
|
|
142
|
-
}];
|
|
143
|
-
return /* @__PURE__ */ D(u, {
|
|
144
|
-
className: "ttw:flex-col",
|
|
145
|
-
children: [/* @__PURE__ */ D(d, {
|
|
146
|
-
className: "ttw:flex-row ttw:items-center ttw:justify-end",
|
|
147
|
-
children: [/* @__PURE__ */ E(p, {
|
|
148
|
-
htmlFor: e,
|
|
149
|
-
className: w(r && "ttw:text-destructive"),
|
|
150
|
-
children: o.discountLabel
|
|
151
|
-
}), /* @__PURE__ */ D("div", {
|
|
152
|
-
className: w(F, "ttw:w-40 ttw:overflow-hidden"),
|
|
153
|
-
children: [/* @__PURE__ */ E("div", {
|
|
154
|
-
className: w(L, "ttw:items-stretch ttw:self-stretch"),
|
|
155
|
-
children: g.map((e) => /* @__PURE__ */ E("button", {
|
|
156
|
-
type: "button",
|
|
157
|
-
"aria-label": e.ariaLabel,
|
|
158
|
-
"aria-pressed": t === e.type,
|
|
159
|
-
disabled: a,
|
|
160
|
-
className: w("ttw:h-full ttw:w-9 ttw:cursor-pointer ttw:border-r ttw:border-input ttw:text-sm ttw:transition-colors ttw:disabled:pointer-events-none ttw:disabled:opacity-50", t === e.type ? "ttw:bg-primary ttw:text-primary-foreground" : "ttw:text-muted-foreground ttw:hover:bg-muted ttw:hover:text-foreground"),
|
|
161
|
-
onClick: () => c(e.type),
|
|
162
|
-
children: e.label
|
|
163
|
-
}, e.type))
|
|
164
|
-
}), /* @__PURE__ */ E("input", {
|
|
165
|
-
id: e,
|
|
166
|
-
type: "text",
|
|
167
|
-
inputMode: "decimal",
|
|
168
|
-
className: w(I, "ttw:pr-3 ttw:pl-2"),
|
|
169
|
-
"aria-invalid": !!r || void 0,
|
|
170
|
-
"aria-describedby": r ? h : void 0,
|
|
171
|
-
disabled: a,
|
|
172
|
-
value: n,
|
|
173
|
-
onChange: (e) => s(e.target.value),
|
|
174
|
-
onFocus: l,
|
|
175
|
-
onBlur: m
|
|
176
|
-
})]
|
|
177
|
-
})]
|
|
178
|
-
}), r && /* @__PURE__ */ E(f, {
|
|
179
|
-
id: h,
|
|
180
|
-
className: "ttw:text-right",
|
|
181
|
-
children: r
|
|
18
|
+
function S({ label: e, children: t }) {
|
|
19
|
+
return /* @__PURE__ */ v("div", {
|
|
20
|
+
className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-4 ttw:px-4 ttw:py-3",
|
|
21
|
+
children: [/* @__PURE__ */ _("dt", {
|
|
22
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
23
|
+
children: e
|
|
24
|
+
}), /* @__PURE__ */ _("dd", {
|
|
25
|
+
className: "ttw:text-sm ttw:font-medium ttw:text-right ttw:break-all",
|
|
26
|
+
children: t
|
|
182
27
|
})]
|
|
183
28
|
});
|
|
184
29
|
}
|
|
185
|
-
function
|
|
186
|
-
let
|
|
187
|
-
...
|
|
188
|
-
...
|
|
189
|
-
}
|
|
190
|
-
return /* @__PURE__ */
|
|
191
|
-
open:
|
|
192
|
-
onOpenChange:
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
30
|
+
function C({ open: C, onOpenChange: w, step: T, values: E, errors: D, currencySymbol: O, amountDueLabel: k, review: A, inProgress: j, onChange: M, onFillAmountDue: N, onSave: P, onEdit: F, onConfirm: I, onCancel: L, labels: R }) {
|
|
31
|
+
let z = {
|
|
32
|
+
...h,
|
|
33
|
+
...R
|
|
34
|
+
};
|
|
35
|
+
return /* @__PURE__ */ _(i, {
|
|
36
|
+
open: C,
|
|
37
|
+
onOpenChange: w,
|
|
38
|
+
children: /* @__PURE__ */ _(a, {
|
|
39
|
+
"aria-describedby": void 0,
|
|
40
|
+
className: "ttw:flex ttw:flex-col ttw:gap-6",
|
|
41
|
+
children: T === "review" && A ? /* @__PURE__ */ v(g, { children: [
|
|
42
|
+
/* @__PURE__ */ v(s, {
|
|
43
|
+
className: "ttw:items-center ttw:text-center",
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ _("div", {
|
|
46
|
+
className: "ttw:flex ttw:size-11 ttw:items-center ttw:justify-center ttw:rounded-full ttw:bg-muted",
|
|
47
|
+
children: /* @__PURE__ */ _(y, { className: "ttw:size-5 ttw:text-muted-foreground" })
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ _(c, {
|
|
50
|
+
className: "ttw:text-base ttw:font-normal",
|
|
51
|
+
children: z.reviewTitle
|
|
52
|
+
}),
|
|
53
|
+
/* @__PURE__ */ _("p", {
|
|
54
|
+
className: "ttw:text-2xl ttw:font-semibold",
|
|
55
|
+
children: A.amountLabel
|
|
56
|
+
}),
|
|
57
|
+
/* @__PURE__ */ _("p", {
|
|
58
|
+
className: "ttw:text-sm",
|
|
59
|
+
children: A.fromLabel
|
|
60
|
+
})
|
|
61
|
+
]
|
|
62
|
+
}),
|
|
63
|
+
/* @__PURE__ */ v("dl", {
|
|
64
|
+
className: "ttw:divide-y ttw:divide-border ttw:rounded-lg ttw:border ttw:border-border",
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ _(S, {
|
|
67
|
+
label: z.receivedLabel,
|
|
68
|
+
children: A.receivedLabel
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ _(S, {
|
|
71
|
+
label: z.referenceLabel,
|
|
72
|
+
children: A.referenceLabel
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ _(S, {
|
|
75
|
+
label: z.createdByLabel,
|
|
76
|
+
children: A.isCreatedByLoading ? /* @__PURE__ */ _(m, { className: "ttw:h-4 ttw:w-24" }) : A.createdByLabel
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
}),
|
|
80
|
+
/* @__PURE__ */ _(e, {
|
|
81
|
+
className: "ttw:border-amber-200 ttw:bg-amber-50 ttw:text-amber-800",
|
|
82
|
+
children: /* @__PURE__ */ _(t, {
|
|
83
|
+
className: "ttw:text-amber-800",
|
|
84
|
+
children: z.reviewWarning
|
|
85
|
+
})
|
|
86
|
+
}),
|
|
87
|
+
/* @__PURE__ */ v(o, {
|
|
88
|
+
className: "ttw:sm:justify-between",
|
|
89
|
+
children: [/* @__PURE__ */ _(n, {
|
|
90
|
+
variant: "ghost",
|
|
91
|
+
onClick: L,
|
|
92
|
+
children: z.cancelButton
|
|
93
|
+
}), /* @__PURE__ */ v("div", {
|
|
94
|
+
className: "ttw:flex ttw:gap-2",
|
|
95
|
+
children: [/* @__PURE__ */ _(n, {
|
|
96
|
+
variant: "outline",
|
|
97
|
+
disabled: j,
|
|
98
|
+
onClick: F,
|
|
99
|
+
children: z.editRecordButton
|
|
100
|
+
}), /* @__PURE__ */ _(n, {
|
|
101
|
+
disabled: j,
|
|
102
|
+
onClick: I,
|
|
103
|
+
children: z.confirmButton
|
|
104
|
+
})]
|
|
214
105
|
})]
|
|
215
|
-
})
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
}),
|
|
262
|
-
/* @__PURE__ */ E(re, { message: y?.dueDate })
|
|
263
|
-
]
|
|
106
|
+
})
|
|
107
|
+
] }) : /* @__PURE__ */ v("form", {
|
|
108
|
+
className: "ttw:flex ttw:flex-col ttw:gap-6",
|
|
109
|
+
noValidate: !0,
|
|
110
|
+
onSubmit: (e) => {
|
|
111
|
+
e.preventDefault(), P();
|
|
112
|
+
},
|
|
113
|
+
children: [
|
|
114
|
+
/* @__PURE__ */ _(s, { children: /* @__PURE__ */ _(c, { children: z.title }) }),
|
|
115
|
+
/* @__PURE__ */ v("div", {
|
|
116
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ _(p, {
|
|
119
|
+
htmlFor: b.amount,
|
|
120
|
+
requirement: l.Required,
|
|
121
|
+
children: z.amountLabel
|
|
122
|
+
}),
|
|
123
|
+
/* @__PURE__ */ v(u, { children: [/* @__PURE__ */ _(f, {
|
|
124
|
+
id: b.amount,
|
|
125
|
+
type: "number",
|
|
126
|
+
required: !0,
|
|
127
|
+
placeholder: z.amountPlaceholder,
|
|
128
|
+
"data-has-end-addon": !0,
|
|
129
|
+
"aria-invalid": !!D?.amount || void 0,
|
|
130
|
+
"aria-describedby": D?.amount ? `${b.amount}-error` : void 0,
|
|
131
|
+
value: E.amount,
|
|
132
|
+
onChange: (e) => M({ amount: e.target.value })
|
|
133
|
+
}), /* @__PURE__ */ _(d, {
|
|
134
|
+
align: "inline-end",
|
|
135
|
+
children: O
|
|
136
|
+
})] }),
|
|
137
|
+
/* @__PURE__ */ _(x, {
|
|
138
|
+
id: `${b.amount}-error`,
|
|
139
|
+
message: D?.amount
|
|
140
|
+
}),
|
|
141
|
+
/* @__PURE__ */ v("p", {
|
|
142
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
143
|
+
children: [
|
|
144
|
+
z.fullAmountDuePrefix,
|
|
145
|
+
" ",
|
|
146
|
+
/* @__PURE__ */ _(n, {
|
|
147
|
+
type: "button",
|
|
148
|
+
variant: "link",
|
|
149
|
+
className: "ttw:h-auto ttw:p-0 ttw:underline",
|
|
150
|
+
onClick: N,
|
|
151
|
+
children: k
|
|
264
152
|
})
|
|
153
|
+
]
|
|
154
|
+
})
|
|
155
|
+
]
|
|
156
|
+
}),
|
|
157
|
+
/* @__PURE__ */ v("div", {
|
|
158
|
+
className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
|
|
159
|
+
children: [/* @__PURE__ */ v("div", {
|
|
160
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
161
|
+
children: [
|
|
162
|
+
/* @__PURE__ */ _(p, {
|
|
163
|
+
htmlFor: b.date,
|
|
164
|
+
requirement: l.Required,
|
|
165
|
+
children: z.dateLabel
|
|
265
166
|
}),
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
children: Q.lineItemsHeading
|
|
275
|
-
}), /* @__PURE__ */ E(C, {
|
|
276
|
-
variant: "body2",
|
|
277
|
-
color: "muted",
|
|
278
|
-
className: "ttw:font-medium",
|
|
279
|
-
children: Q.lineItemsDescription
|
|
280
|
-
})]
|
|
281
|
-
}),
|
|
282
|
-
y?.lineItemsSummary?.length ? /* @__PURE__ */ D(e, {
|
|
283
|
-
variant: "destructive",
|
|
284
|
-
className: "ttw:flex ttw:mb-2",
|
|
285
|
-
children: [/* @__PURE__ */ E(O, {}), /* @__PURE__ */ E(t, { children: /* @__PURE__ */ E("ul", { children: y.lineItemsSummary.map((e) => /* @__PURE__ */ E("li", { children: e }, e)) }) })]
|
|
286
|
-
}) : null,
|
|
287
|
-
/* @__PURE__ */ D("ul", {
|
|
288
|
-
className: "ttw:flex ttw:flex-col ttw:gap-2.5",
|
|
289
|
-
children: [/* @__PURE__ */ D("li", {
|
|
290
|
-
"aria-hidden": !0,
|
|
291
|
-
className: "ttw:flex ttw:h-5 ttw:items-center ttw:gap-2.5 ttw:text-sm ttw:leading-5 ttw:font-medium",
|
|
292
|
-
children: [
|
|
293
|
-
/* @__PURE__ */ E("span", {
|
|
294
|
-
className: "ttw:inline-flex ttw:min-w-30 ttw:flex-1 ttw:whitespace-nowrap",
|
|
295
|
-
children: Q.productLabel
|
|
296
|
-
}),
|
|
297
|
-
/* @__PURE__ */ E("span", {
|
|
298
|
-
className: "ttw:w-24 ttw:min-w-24",
|
|
299
|
-
children: Q.quantityLabel
|
|
300
|
-
}),
|
|
301
|
-
/* @__PURE__ */ E("span", {
|
|
302
|
-
className: "ttw:w-20.5 ttw:min-w-20.5",
|
|
303
|
-
children: Q.unitLabel
|
|
304
|
-
}),
|
|
305
|
-
/* @__PURE__ */ E("span", {
|
|
306
|
-
className: "ttw:w-full ttw:max-w-41 ttw:min-w-29",
|
|
307
|
-
children: Q.priceLabel
|
|
308
|
-
}),
|
|
309
|
-
/* @__PURE__ */ E("span", {
|
|
310
|
-
className: "ttw:w-12 ttw:min-w-12",
|
|
311
|
-
children: Q.taxableLabel
|
|
312
|
-
}),
|
|
313
|
-
v.lineItems.length > 1 && /* @__PURE__ */ E("span", { className: "ttw:w-10 ttw:min-w-10" })
|
|
314
|
-
]
|
|
315
|
-
}), P ? /* @__PURE__ */ E("li", {
|
|
316
|
-
className: "ttw:flex ttw:h-9 ttw:items-center ttw:justify-center",
|
|
317
|
-
children: /* @__PURE__ */ E(S, { className: "ttw:size-5" })
|
|
318
|
-
}) : v.lineItems.map((e) => /* @__PURE__ */ E(ie, {
|
|
319
|
-
formId: $,
|
|
320
|
-
lineItem: e,
|
|
321
|
-
errors: y?.lineItems?.[e.id],
|
|
322
|
-
controls: j?.[e.id],
|
|
323
|
-
focusOnMount: e.id === N,
|
|
324
|
-
canRemove: v.lineItems.length > 1,
|
|
325
|
-
unitOptions: b,
|
|
326
|
-
currencySymbol: k,
|
|
327
|
-
labels: Q,
|
|
328
|
-
renderProductSelector: B,
|
|
329
|
-
onChange: (t) => H(e.id, t),
|
|
330
|
-
onCommit: (t) => U(e.id, t),
|
|
331
|
-
onQuantityStep: (t) => W(e.id, t),
|
|
332
|
-
onManageUnits: oe,
|
|
333
|
-
onRemove: () => ce(e.id)
|
|
334
|
-
}, e.id))]
|
|
335
|
-
}),
|
|
336
|
-
/* @__PURE__ */ D(n, {
|
|
337
|
-
type: "button",
|
|
338
|
-
variant: "ghost",
|
|
339
|
-
className: "ttw:w-fit ttw:text-primary ttw:hover:text-primary",
|
|
340
|
-
onClick: se,
|
|
341
|
-
children: [/* @__PURE__ */ E(A, { className: "ttw:size-5 ttw:text-primary" }), Q.addLineItemButton]
|
|
342
|
-
}),
|
|
343
|
-
/* @__PURE__ */ E(ae, {
|
|
344
|
-
inputId: `${$}-discount`,
|
|
345
|
-
discountType: v.discountType,
|
|
346
|
-
value: v.discount,
|
|
347
|
-
error: y?.discount,
|
|
348
|
-
currencySymbol: k,
|
|
349
|
-
disabled: R,
|
|
350
|
-
labels: Q,
|
|
351
|
-
onChange: (e) => V({ discount: e }),
|
|
352
|
-
onTypeChange: (e) => V({ discountType: e }),
|
|
353
|
-
onFocus: K,
|
|
354
|
-
onBlur: q
|
|
355
|
-
}),
|
|
356
|
-
/* @__PURE__ */ D(u, {
|
|
357
|
-
className: "ttw:flex-col",
|
|
358
|
-
children: [/* @__PURE__ */ D(d, {
|
|
359
|
-
className: "ttw:flex-row ttw:justify-end",
|
|
360
|
-
children: [/* @__PURE__ */ E(p, {
|
|
361
|
-
htmlFor: `${$}-tax-rate`,
|
|
362
|
-
className: w(y?.taxRate && "ttw:text-destructive"),
|
|
363
|
-
children: Q.taxRateLabel
|
|
364
|
-
}), /* @__PURE__ */ D("div", {
|
|
365
|
-
className: w(F, "ttw:w-40"),
|
|
366
|
-
children: [/* @__PURE__ */ E("input", {
|
|
367
|
-
id: `${$}-tax-rate`,
|
|
368
|
-
className: w(I, "ttw:pl-3"),
|
|
369
|
-
placeholder: Q.taxRatePlaceholder,
|
|
370
|
-
type: "text",
|
|
371
|
-
inputMode: "decimal",
|
|
372
|
-
"aria-invalid": !!y?.taxRate || void 0,
|
|
373
|
-
"aria-describedby": y?.taxRate ? `${$}-tax-rate-error` : void 0,
|
|
374
|
-
value: v.taxRate,
|
|
375
|
-
onChange: (e) => V({ taxRate: e.target.value }),
|
|
376
|
-
onBlur: G
|
|
377
|
-
}), /* @__PURE__ */ E("span", {
|
|
378
|
-
className: w(L, "ttw:pr-3"),
|
|
379
|
-
children: Q.taxRateSuffix
|
|
380
|
-
})]
|
|
381
|
-
})]
|
|
382
|
-
}), y?.taxRate && /* @__PURE__ */ E(f, {
|
|
383
|
-
id: `${$}-tax-rate-error`,
|
|
384
|
-
className: "ttw:text-right",
|
|
385
|
-
children: y.taxRate
|
|
386
|
-
})]
|
|
387
|
-
}),
|
|
388
|
-
/* @__PURE__ */ E(x, {}),
|
|
389
|
-
/* @__PURE__ */ E(te, {
|
|
390
|
-
totals: J,
|
|
391
|
-
labels: Q
|
|
392
|
-
})
|
|
393
|
-
]
|
|
167
|
+
/* @__PURE__ */ _(r, {
|
|
168
|
+
id: b.date,
|
|
169
|
+
value: E.paymentDate,
|
|
170
|
+
onChange: (e) => M({ paymentDate: e }),
|
|
171
|
+
placeholder: z.datePlaceholder,
|
|
172
|
+
iconPosition: "end",
|
|
173
|
+
"aria-invalid": !!D?.paymentDate || void 0,
|
|
174
|
+
"aria-describedby": D?.paymentDate ? `${b.date}-error` : void 0
|
|
394
175
|
}),
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
176
|
+
/* @__PURE__ */ _(x, {
|
|
177
|
+
id: `${b.date}-error`,
|
|
178
|
+
message: D?.paymentDate
|
|
179
|
+
})
|
|
180
|
+
]
|
|
181
|
+
}), /* @__PURE__ */ v("div", {
|
|
182
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
183
|
+
children: [
|
|
184
|
+
/* @__PURE__ */ _(p, {
|
|
185
|
+
htmlFor: b.time,
|
|
186
|
+
requirement: l.Required,
|
|
187
|
+
children: z.timeLabel
|
|
406
188
|
}),
|
|
407
|
-
|
|
189
|
+
/* @__PURE__ */ v(u, { children: [/* @__PURE__ */ _(f, {
|
|
190
|
+
id: b.time,
|
|
191
|
+
type: "time",
|
|
192
|
+
required: !0,
|
|
193
|
+
"data-has-end-addon": !0,
|
|
194
|
+
"aria-invalid": !!D?.paymentTime || void 0,
|
|
195
|
+
"aria-describedby": D?.paymentTime ? `${b.time}-error` : void 0,
|
|
196
|
+
value: E.paymentTime,
|
|
197
|
+
onChange: (e) => M({ paymentTime: e.target.value })
|
|
198
|
+
}), /* @__PURE__ */ _(d, {
|
|
199
|
+
align: "inline-end",
|
|
200
|
+
children: z.timeZoneSuffix
|
|
201
|
+
})] }),
|
|
202
|
+
/* @__PURE__ */ _(x, {
|
|
203
|
+
id: `${b.time}-error`,
|
|
204
|
+
message: D?.paymentTime
|
|
205
|
+
})
|
|
408
206
|
]
|
|
409
207
|
})]
|
|
410
|
-
}),
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
form: $,
|
|
424
|
-
variant: "outline",
|
|
425
|
-
loading: ge,
|
|
426
|
-
disabled: X,
|
|
427
|
-
onClick: Z,
|
|
428
|
-
children: Y
|
|
429
|
-
}),
|
|
430
|
-
/* @__PURE__ */ E(n, {
|
|
431
|
-
type: "submit",
|
|
432
|
-
form: $,
|
|
433
|
-
loading: ye,
|
|
434
|
-
disabled: ve,
|
|
435
|
-
onClick: Se,
|
|
436
|
-
children: _e
|
|
437
|
-
})
|
|
438
|
-
]
|
|
439
|
-
})]
|
|
440
|
-
}), /* @__PURE__ */ E("div", {
|
|
441
|
-
className: "ttw:h-full ttw:min-h-0 ttw:w-1/2 ttw:overflow-auto ttw:bg-linear-to-b ttw:from-[#F6F6F6] ttw:to-[#E4E4FF]",
|
|
442
|
-
children: pe
|
|
443
|
-
})]
|
|
444
|
-
})]
|
|
208
|
+
}),
|
|
209
|
+
/* @__PURE__ */ v(o, { children: [/* @__PURE__ */ _(n, {
|
|
210
|
+
type: "button",
|
|
211
|
+
variant: "ghost",
|
|
212
|
+
onClick: L,
|
|
213
|
+
children: z.cancelButton
|
|
214
|
+
}), /* @__PURE__ */ _(n, {
|
|
215
|
+
type: "submit",
|
|
216
|
+
loading: j,
|
|
217
|
+
children: z.saveButton
|
|
218
|
+
})] })
|
|
219
|
+
]
|
|
220
|
+
})
|
|
445
221
|
})
|
|
446
222
|
});
|
|
447
223
|
}
|
|
448
224
|
//#endregion
|
|
449
|
-
export {
|
|
225
|
+
export { C as ReceivablePaymentDialog, C as default };
|