@tesouro/embedded-components-react 0.5.293 → 0.5.295

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.
Files changed (52) hide show
  1. package/README.md +1 -1
  2. package/dist/index.d.ts +26 -1
  3. package/dist/lib/CounterpartsWidget.d.ts +2 -0
  4. package/dist/lib/CounterpartsWidgetPublic.d.ts +2 -0
  5. package/dist/lib/CustomersWidget.d.ts +2 -0
  6. package/dist/lib/ReceivablesWidget.d.ts +26 -1
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +4 -4
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +3 -2
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index14.js +5 -88
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index15.js +70 -173
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index16.js +210 -17
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index17.js +29 -0
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +6 -7
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js +142 -141
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +84 -54
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +21 -3
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/paymentTerms.js +27 -27
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurrence.js +2 -1
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/reminders.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/totals.js +13 -10
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +84 -80
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActionsModal.js +1 -1
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +32 -30
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +417 -414
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableIssuePreflight.js +1 -1
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableReminders.js +1 -1
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableStatusCards.js +1 -1
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +83 -66
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +133 -129
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useSendReceivableWithPaymentLink.js +26 -22
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useUtcDayStart.js +16 -0
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +0 -1
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +20 -22
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +2 -2
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +1 -1
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +91 -85
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +1 -0
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +119 -88
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +19 -16
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +130 -96
  41. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +24 -8
  42. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +2 -0
  43. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +101 -98
  44. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js +34 -20
  45. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +40 -39
  46. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/applicationStatusQueryOptions.js +6 -6
  47. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  48. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/interceptor.js +55 -41
  49. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index6.js +4 -3
  50. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/widgetTokenManager.js +51 -30
  51. package/dist/packages/shared-ui-shadcn/dist/index.js +15 -10
  52. package/package.json +1 -1
@@ -1,100 +1,131 @@
1
- import { Button as e, Dialog as t, DialogContent as n, DialogDescription as r, DialogFooter as i, DialogHeader as a, DialogTitle as o, Field as s, FieldContent as c, FieldLabel as l, Input as u, InputTags as d, Textarea as f, Typography as p } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { RECEIVABLE_RECURRENCE_EMAIL_DIALOG_LABELS_EN as m } from "./index13.js";
3
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
1
+ import { Button as e, Dialog as t, DialogContent as n, DialogDescription as r, DialogFooter as i, DialogHeader as a, DialogTitle as o, Input as s, InputTags as c, Label as l, Textarea as u, Typography as d, cn as f } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { RECEIVABLE_RECURRENCE_EMAIL_DIALOG_LABELS_EN as p } from "./index13.js";
3
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
4
4
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js
5
- function _({ idPrefix: _, view: v, onOpenChange: y, onChange: b, onSave: x, labels: S }) {
6
- let C = {
7
- ...m,
8
- ...S
9
- }, w = {
10
- to: `${_}-recipients-to`,
11
- cc: `${_}-recipients-cc`,
12
- bcc: `${_}-recipients-bcc`,
13
- subject: `${_}-subject`,
14
- message: `${_}-message`
5
+ function g({ idPrefix: l, view: f, onOpenChange: g, onChange: v, onSave: y, labels: b }) {
6
+ let x = {
7
+ ...p,
8
+ ...b
9
+ }, S = {
10
+ to: `${l}-recipients-to`,
11
+ cc: `${l}-recipients-cc`,
12
+ bcc: `${l}-recipients-bcc`,
13
+ subject: `${l}-subject`,
14
+ message: `${l}-message`
15
15
  };
16
- return /* @__PURE__ */ h(t, {
17
- open: v.open,
18
- onOpenChange: y,
19
- children: /* @__PURE__ */ g(n, {
20
- className: "ttw:sm:max-w-lg",
21
- children: [/* @__PURE__ */ g(a, { children: [/* @__PURE__ */ h(o, { children: C.recurrenceEmailTitle }), /* @__PURE__ */ h(r, { children: C.recurrenceEmailDescription })] }), v.ready && /* @__PURE__ */ g("form", {
22
- className: "ttw:flex ttw:flex-col ttw:gap-4",
16
+ return /* @__PURE__ */ m(t, {
17
+ open: f.open,
18
+ onOpenChange: g,
19
+ children: /* @__PURE__ */ h(n, {
20
+ className: "ttw:gap-0 ttw:p-0 ttw:max-w-150 ttw:sm:max-w-150",
21
+ children: [/* @__PURE__ */ h(a, {
22
+ className: "ttw:border-b ttw:border-border ttw:p-6",
23
+ children: [/* @__PURE__ */ m(o, { children: x.recurrenceEmailTitle }), /* @__PURE__ */ m(r, {
24
+ className: "ttw:text-xs",
25
+ children: x.recurrenceEmailDescription
26
+ })]
27
+ }), f.ready && /* @__PURE__ */ h("form", {
23
28
  onSubmit: (e) => {
24
- e.preventDefault(), e.stopPropagation(), v.saveDisabled || x();
29
+ e.preventDefault(), e.stopPropagation(), f.saveDisabled || y();
25
30
  },
26
- children: [
27
- /* @__PURE__ */ h(s, { children: /* @__PURE__ */ g(c, { children: [/* @__PURE__ */ h(l, {
28
- htmlFor: w.to,
29
- children: C.recurrenceEmailTo
30
- }), /* @__PURE__ */ h(d, {
31
- id: w.to,
32
- value: v.to,
33
- onChange: (e) => b("to", e),
34
- inputValue: v.toInput,
35
- onInputValueChange: (e) => b("toInput", e),
36
- removeTagLabel: v.removeRecipientLabel,
37
- placeholder: v.showToPlaceholder ? C.recurrenceEmailRecipientPlaceholder : void 0
38
- })] }) }),
39
- /* @__PURE__ */ h(s, { children: /* @__PURE__ */ g(c, { children: [/* @__PURE__ */ h(l, {
40
- htmlFor: w.cc,
41
- children: C.recurrenceEmailCc
42
- }), /* @__PURE__ */ h(d, {
43
- id: w.cc,
44
- value: v.cc,
45
- onChange: (e) => b("cc", e),
46
- inputValue: v.ccInput,
47
- onInputValueChange: (e) => b("ccInput", e),
48
- removeTagLabel: v.removeRecipientLabel
49
- })] }) }),
50
- /* @__PURE__ */ h(s, { children: /* @__PURE__ */ g(c, { children: [/* @__PURE__ */ h(l, {
51
- htmlFor: w.bcc,
52
- children: C.recurrenceEmailBcc
53
- }), /* @__PURE__ */ h(d, {
54
- id: w.bcc,
55
- value: v.bcc,
56
- onChange: (e) => b("bcc", e),
57
- inputValue: v.bccInput,
58
- onInputValueChange: (e) => b("bccInput", e),
59
- removeTagLabel: v.removeRecipientLabel
60
- })] }) }),
61
- /* @__PURE__ */ h(s, { children: /* @__PURE__ */ g(c, { children: [/* @__PURE__ */ h(l, {
62
- htmlFor: w.subject,
63
- children: C.recurrenceEmailSubject
64
- }), /* @__PURE__ */ h(u, {
65
- id: w.subject,
66
- value: v.subject,
67
- onChange: (e) => b("subject", e.target.value)
68
- })] }) }),
69
- /* @__PURE__ */ h(s, { children: /* @__PURE__ */ g(c, { children: [/* @__PURE__ */ h(l, {
70
- htmlFor: w.message,
71
- children: C.recurrenceEmailMessage
72
- }), /* @__PURE__ */ h(f, {
73
- id: w.message,
74
- rows: 5,
75
- placeholder: C.recurrenceEmailMessagePlaceholder,
76
- value: v.message,
77
- onChange: (e) => b("message", e.target.value)
78
- })] }) }),
79
- /* @__PURE__ */ h(p, {
80
- variant: "caption",
81
- color: "muted",
82
- children: C.recurrenceEmailFootnote
83
- }),
84
- /* @__PURE__ */ g(i, { children: [/* @__PURE__ */ h(e, {
31
+ children: [/* @__PURE__ */ h("div", {
32
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:p-6",
33
+ children: [
34
+ /* @__PURE__ */ m(_, {
35
+ label: x.recurrenceEmailTo,
36
+ htmlFor: S.to,
37
+ children: /* @__PURE__ */ m(c, {
38
+ id: S.to,
39
+ value: f.to,
40
+ onChange: (e) => v("to", e),
41
+ inputValue: f.toInput,
42
+ onInputValueChange: (e) => v("toInput", e),
43
+ removeTagLabel: f.removeRecipientLabel,
44
+ placeholder: f.showToPlaceholder ? x.recurrenceEmailRecipientPlaceholder : void 0
45
+ })
46
+ }),
47
+ /* @__PURE__ */ m(_, {
48
+ label: x.recurrenceEmailCc,
49
+ htmlFor: S.cc,
50
+ children: /* @__PURE__ */ m(c, {
51
+ id: S.cc,
52
+ value: f.cc,
53
+ onChange: (e) => v("cc", e),
54
+ inputValue: f.ccInput,
55
+ onInputValueChange: (e) => v("ccInput", e),
56
+ removeTagLabel: f.removeRecipientLabel
57
+ })
58
+ }),
59
+ /* @__PURE__ */ m(_, {
60
+ label: x.recurrenceEmailBcc,
61
+ htmlFor: S.bcc,
62
+ children: /* @__PURE__ */ m(c, {
63
+ id: S.bcc,
64
+ value: f.bcc,
65
+ onChange: (e) => v("bcc", e),
66
+ inputValue: f.bccInput,
67
+ onInputValueChange: (e) => v("bccInput", e),
68
+ removeTagLabel: f.removeRecipientLabel
69
+ })
70
+ }),
71
+ /* @__PURE__ */ m(_, {
72
+ label: x.recurrenceEmailSubject,
73
+ htmlFor: S.subject,
74
+ children: /* @__PURE__ */ m(s, {
75
+ id: S.subject,
76
+ value: f.subject,
77
+ onChange: (e) => v("subject", e.target.value)
78
+ })
79
+ }),
80
+ /* @__PURE__ */ m(_, {
81
+ label: x.recurrenceEmailMessage,
82
+ htmlFor: S.message,
83
+ alignTop: !0,
84
+ children: /* @__PURE__ */ m(u, {
85
+ id: S.message,
86
+ placeholder: x.recurrenceEmailMessagePlaceholder,
87
+ value: f.message,
88
+ onChange: (e) => v("message", e.target.value)
89
+ })
90
+ }),
91
+ /* @__PURE__ */ m(d, {
92
+ variant: "caption",
93
+ color: "muted",
94
+ className: "ttw:pl-20",
95
+ children: x.recurrenceEmailFootnote
96
+ })
97
+ ]
98
+ }), /* @__PURE__ */ h(i, {
99
+ className: "ttw:flex ttw:flex-row ttw:gap-4 ttw:border-t ttw:border-border ttw:p-6",
100
+ children: [/* @__PURE__ */ m(e, {
85
101
  type: "button",
86
102
  variant: "outline",
87
- onClick: () => y(!1),
88
- children: C.recurrenceEmailCancel
89
- }), /* @__PURE__ */ h(e, {
103
+ className: "ttw:flex-1",
104
+ onClick: () => g(!1),
105
+ children: x.recurrenceEmailCancel
106
+ }), /* @__PURE__ */ m(e, {
90
107
  type: "submit",
91
- disabled: v.saveDisabled,
92
- children: C.recurrenceEmailSave
93
- })] })
94
- ]
108
+ className: "ttw:flex-1",
109
+ disabled: f.saveDisabled,
110
+ children: x.recurrenceEmailSave
111
+ })]
112
+ })]
95
113
  })]
96
114
  })
97
115
  });
98
116
  }
117
+ function _({ label: e, htmlFor: t, alignTop: n = !1, children: r }) {
118
+ return /* @__PURE__ */ h("div", {
119
+ className: f("ttw:flex ttw:gap-4", n ? "ttw:items-start" : "ttw:items-center"),
120
+ children: [/* @__PURE__ */ m(l, {
121
+ htmlFor: t,
122
+ className: f("ttw:w-16 ttw:shrink-0 ttw:font-normal ttw:text-muted-foreground", n && "ttw:pt-2"),
123
+ children: e
124
+ }), /* @__PURE__ */ m("div", {
125
+ className: "ttw:flex-1",
126
+ children: r
127
+ })]
128
+ });
129
+ }
99
130
  //#endregion
100
- export { _ as ReceivableRecurrenceEmailDialog, _ as default };
131
+ export { g as ReceivableRecurrenceEmailDialog, g as default };
@@ -32,16 +32,23 @@ function y({ idPrefix: y, view: b, disabled: x, onFrequencyChange: S, onMonthDay
32
32
  "aria-invalid": n.invalid || void 0,
33
33
  className: "ttw:flex-row-reverse ttw:justify-between ttw:text-foreground ttw:[&>svg]:mr-0"
34
34
  })
35
- }), R = (e) => /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(r, {
36
- id: P.occurrences,
37
- className: "ttw:w-16",
38
- type: "text",
39
- inputMode: "numeric",
40
- value: e.value,
41
- disabled: x,
42
- "aria-invalid": e.invalid || void 0,
43
- "aria-describedby": F?.maxOccurrencesError ? `${P.occurrences}-error` : void 0,
44
- onChange: (e) => O(e.target.value)
35
+ }), R = (e) => /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _("div", {
36
+ className: "ttw:relative",
37
+ children: [/* @__PURE__ */ g(r, {
38
+ id: P.occurrences,
39
+ className: "ttw:w-16",
40
+ type: "text",
41
+ inputMode: "numeric",
42
+ value: e.value,
43
+ disabled: x,
44
+ "aria-invalid": e.invalid || void 0,
45
+ "aria-describedby": F?.maxOccurrencesError ? `${P.occurrences}-error` : void 0,
46
+ onChange: (e) => O(e.target.value)
47
+ }), F?.maxOccurrencesError && /* @__PURE__ */ g(n, {
48
+ id: `${P.occurrences}-error`,
49
+ className: "ttw:absolute ttw:top-full ttw:left-0 ttw:mt-1 ttw:text-nowrap",
50
+ errors: [{ message: F.maxOccurrencesError }]
51
+ })]
45
52
  }), /* @__PURE__ */ g(i, {
46
53
  htmlFor: P.occurrences,
47
54
  className: v,
@@ -103,7 +110,7 @@ function y({ idPrefix: y, view: b, disabled: x, onFrequencyChange: S, onMonthDay
103
110
  color: "muted",
104
111
  component: "span",
105
112
  className: "ttw:text-nowrap",
106
- children: N.recurrenceMonthDayTrail
113
+ children: b.monthDay.trailLabel
107
114
  })
108
115
  ] }),
109
116
  b.weekday && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(d, {
@@ -125,7 +132,7 @@ function y({ idPrefix: y, view: b, disabled: x, onFrequencyChange: S, onMonthDay
125
132
  ]
126
133
  }),
127
134
  F && /* @__PURE__ */ _("div", {
128
- className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-2.5",
135
+ className: f("ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-2.5", F.maxOccurrencesError && "ttw:pb-6"),
129
136
  children: [
130
137
  /* @__PURE__ */ g(i, {
131
138
  htmlFor: P.startDate,
@@ -162,10 +169,6 @@ function y({ idPrefix: y, view: b, disabled: x, onFrequencyChange: S, onMonthDay
162
169
  }), R(F.end.occurrences)] })
163
170
  ]
164
171
  }),
165
- F?.maxOccurrencesError && /* @__PURE__ */ g(n, {
166
- id: `${P.occurrences}-error`,
167
- errors: [{ message: F.maxOccurrencesError }]
168
- }),
169
172
  j,
170
173
  b.lastDayCaption && /* @__PURE__ */ g(d, {
171
174
  variant: "caption",
@@ -4,191 +4,225 @@ import { ErrorState as c } from "../../../shared/ui/dist/lib/ErrorState/ErrorSta
4
4
  import "../../../shared/ui/dist/index.js";
5
5
  import { RECEIVABLES_SCREEN_LABELS_EN as l } from "./index14.js";
6
6
  import { ReceivableStatusBadge as u } from "./index25.js";
7
- import { ReceivableStatusCards as d } from "./index56.js";
8
- import { jsx as f, jsxs as p } from "react/jsx-runtime";
9
- import { ArrowDownIcon as m, ArrowUpDownIcon as h, ArrowUpIcon as g, CogIcon as _, LockKeyholeIcon as v } from "lucide-react";
7
+ import { SeriesStatusChip as d } from "./index38.js";
8
+ import { ReceivableStatusCards as f } from "./index56.js";
9
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
10
+ import { ArrowDownIcon as h, ArrowUpDownIcon as g, ArrowUpIcon as _, CogIcon as v, LockKeyholeIcon as y, RefreshCwIcon as b } from "lucide-react";
10
11
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js
11
- var y = [
12
+ var x = [
12
13
  10,
13
14
  25,
14
15
  50,
15
16
  100
16
17
  ];
17
- function b({ label: t, ariaLabel: n, column: r }) {
18
+ function S({ label: t, ariaLabel: n, column: r }) {
18
19
  let i = r.getIsSorted();
19
- return /* @__PURE__ */ p("div", {
20
+ return /* @__PURE__ */ m("div", {
20
21
  className: "ttw:flex ttw:items-center ttw:gap-2 ttw:text-inherit",
21
- children: [t, /* @__PURE__ */ f(e, {
22
+ children: [t, /* @__PURE__ */ p(e, {
22
23
  variant: "ghost",
23
24
  size: "icon-sm",
24
25
  "aria-label": n,
25
26
  onClick: () => r.toggleSorting(i === "asc"),
26
- children: f(i === "asc" ? g : i === "desc" ? m : h, { className: "ttw:size-4" })
27
+ children: p(i === "asc" ? _ : i === "desc" ? h : g, { className: "ttw:size-4" })
27
28
  })]
28
29
  });
29
30
  }
30
- function x({ row: e }) {
31
- return e.customerState === "resolving" ? /* @__PURE__ */ f(n, { className: "ttw:h-4 ttw:w-full" }) : e.customerState === "missing" ? /* @__PURE__ */ f("span", {
31
+ function C({ row: e }) {
32
+ return e.dueDateOverdueLabel ? /* @__PURE__ */ m("div", {
33
+ className: "ttw:flex ttw:flex-col ttw:justify-center ttw:gap-1 ttw:text-destructive",
34
+ children: [/* @__PURE__ */ p("span", {
35
+ className: "ttw:text-sm ttw:leading-5",
36
+ children: e.dueDateLabel
37
+ }), /* @__PURE__ */ p("span", {
38
+ className: "ttw:text-xs ttw:leading-4.5",
39
+ children: e.dueDateOverdueLabel
40
+ })]
41
+ }) : e.dueDateLabel;
42
+ }
43
+ function w({ row: e, statusBadgeLabels: t }) {
44
+ let r = e.statusOverride;
45
+ return r ? r.kind === "loading" ? /* @__PURE__ */ p(n, { className: "ttw:h-4 ttw:w-full" }) : r.kind === "chip" ? /* @__PURE__ */ p(d, {
46
+ label: r.label,
47
+ tone: r.tone
48
+ }) : null : /* @__PURE__ */ p(u, {
49
+ status: e.status,
50
+ variant: "filled",
51
+ labels: t
52
+ });
53
+ }
54
+ function T({ row: e }) {
55
+ return e.showDocumentSyncIcon ? /* @__PURE__ */ m("span", {
56
+ className: "ttw:flex ttw:items-center ttw:gap-1",
57
+ children: [/* @__PURE__ */ p(b, {
58
+ className: "ttw:size-[1em]",
59
+ "aria-hidden": !0
60
+ }), e.documentLabel]
61
+ }) : e.documentLabel;
62
+ }
63
+ function E({ row: e }) {
64
+ return e.customerState === "resolving" ? /* @__PURE__ */ p(n, { className: "ttw:h-4 ttw:w-full" }) : e.customerState === "missing" ? /* @__PURE__ */ p("span", {
32
65
  className: "ttw:opacity-40",
33
66
  children: e.customerLabel
34
- }) : /* @__PURE__ */ f("span", { children: e.customerLabel });
67
+ }) : /* @__PURE__ */ p("span", { children: e.customerLabel });
35
68
  }
36
- function S({ rows: n, isLoading: m, isError: h, isAccessRestricted: g, sorting: S, onSortingChange: C, pageSize: w, onPageSizeChange: T, pageSizeOptions: E = y, pageInfo: D, hasNextPage: O, hasPrevPage: k, onNextPage: A, onPrevPage: j, statusCards: M, onStatusCardSelect: N, filterBar: P, isFiltering: F, headerStart: I, bankAttribution: L, onCreateClick: R, onSettingsClick: z, onRowClick: B, onRetry: V, labels: H }) {
37
- let U = {
69
+ function D({ rows: n, isLoading: u, isError: d, isAccessRestricted: h, sorting: g, onSortingChange: _, pageSize: b, onPageSizeChange: D, pageSizeOptions: O = x, pageInfo: k, hasNextPage: A, hasPrevPage: j, onNextPage: M, onPrevPage: N, statusCards: P, onStatusCardSelect: F, filterBar: I, isFiltering: L, headerStart: R, bankAttribution: z, onCreateClick: B, onSettingsClick: V, onRowClick: H, onRetry: U, labels: W }) {
70
+ let G = {
38
71
  ...l,
39
- ...H,
72
+ ...W,
40
73
  statusBadge: {
41
74
  ...l.statusBadge,
42
- ...H?.statusBadge
75
+ ...W?.statusBadge
43
76
  }
44
- }, W = [
77
+ }, K = [
45
78
  {
46
79
  accessorKey: "dueDateLabel",
47
80
  enableSorting: !0,
48
- header: ({ column: e }) => /* @__PURE__ */ f(b, {
81
+ header: ({ column: e }) => /* @__PURE__ */ p(S, {
49
82
  column: e,
50
- label: U.columnDueDate,
51
- ariaLabel: U.sortByDueDate
52
- })
83
+ label: G.columnDueDate,
84
+ ariaLabel: G.sortByDueDate
85
+ }),
86
+ cell: ({ row: e }) => /* @__PURE__ */ p(C, { row: e.original })
53
87
  },
54
88
  {
55
89
  accessorKey: "status",
56
90
  enableSorting: !0,
57
- header: ({ column: e }) => /* @__PURE__ */ f(b, {
91
+ header: ({ column: e }) => /* @__PURE__ */ p(S, {
58
92
  column: e,
59
- label: U.columnStatus,
60
- ariaLabel: U.sortByStatus
93
+ label: G.columnStatus,
94
+ ariaLabel: G.sortByStatus
61
95
  }),
62
- cell: ({ row: e }) => /* @__PURE__ */ f(u, {
63
- status: e.original.status,
64
- variant: "filled",
65
- labels: U.statusBadge
96
+ cell: ({ row: e }) => /* @__PURE__ */ p(w, {
97
+ row: e.original,
98
+ statusBadgeLabels: G.statusBadge
66
99
  })
67
100
  },
68
101
  {
69
102
  accessorKey: "documentLabel",
70
103
  enableSorting: !0,
71
- header: ({ column: e }) => /* @__PURE__ */ f(b, {
104
+ header: ({ column: e }) => /* @__PURE__ */ p(S, {
72
105
  column: e,
73
- label: U.columnNumber,
74
- ariaLabel: U.sortByNumber
75
- })
106
+ label: G.columnNumber,
107
+ ariaLabel: G.sortByNumber
108
+ }),
109
+ cell: ({ row: e }) => /* @__PURE__ */ p(T, { row: e.original })
76
110
  },
77
111
  {
78
112
  accessorKey: "customerLabel",
79
- header: U.columnCustomer,
80
- cell: ({ row: e }) => /* @__PURE__ */ f(x, { row: e.original }),
113
+ header: G.columnCustomer,
114
+ cell: ({ row: e }) => /* @__PURE__ */ p(E, { row: e.original }),
81
115
  minSize: 180
82
116
  },
83
117
  {
84
118
  accessorKey: "issueDateLabel",
85
119
  enableSorting: !0,
86
- header: ({ column: e }) => /* @__PURE__ */ f(b, {
120
+ header: ({ column: e }) => /* @__PURE__ */ p(S, {
87
121
  column: e,
88
- label: U.columnIssueDate,
89
- ariaLabel: U.sortByIssueDate
122
+ label: G.columnIssueDate,
123
+ ariaLabel: G.sortByIssueDate
90
124
  })
91
125
  },
92
126
  {
93
127
  accessorKey: "totalLabel",
94
128
  enableSorting: !0,
95
- header: ({ column: e }) => /* @__PURE__ */ f("div", {
129
+ header: ({ column: e }) => /* @__PURE__ */ p("div", {
96
130
  className: "ttw:flex ttw:justify-end",
97
- children: /* @__PURE__ */ f(b, {
131
+ children: /* @__PURE__ */ p(S, {
98
132
  column: e,
99
- label: U.columnAmount,
100
- ariaLabel: U.sortByAmount
133
+ label: G.columnAmount,
134
+ ariaLabel: G.sortByAmount
101
135
  })
102
136
  }),
103
- cell: ({ row: e }) => /* @__PURE__ */ f("div", {
137
+ cell: ({ row: e }) => /* @__PURE__ */ p("div", {
104
138
  className: "ttw:text-right",
105
139
  children: e.original.totalLabel
106
140
  })
107
141
  }
108
142
  ];
109
- return /* @__PURE__ */ p("div", {
143
+ return /* @__PURE__ */ m("div", {
110
144
  className: "ttw:flex ttw:flex-col ttw:gap-4",
111
145
  children: [
112
- /* @__PURE__ */ p("div", {
146
+ /* @__PURE__ */ m("div", {
113
147
  className: "ttw:flex ttw:justify-between ttw:gap-4",
114
- children: [/* @__PURE__ */ p("div", {
148
+ children: [/* @__PURE__ */ m("div", {
115
149
  className: "ttw:flex ttw:flex-col ttw:gap-2",
116
- children: [I, L && /* @__PURE__ */ p("div", {
150
+ children: [R, z && /* @__PURE__ */ m("div", {
117
151
  className: "ttw:flex ttw:items-center ttw:gap-2",
118
- children: [/* @__PURE__ */ f("span", {
152
+ children: [/* @__PURE__ */ p("span", {
119
153
  className: "ttw:text-muted-foreground",
120
- children: U.bankAttributionPrefix
121
- }), /* @__PURE__ */ f("img", {
154
+ children: G.bankAttributionPrefix
155
+ }), /* @__PURE__ */ p("img", {
122
156
  width: 120,
123
- src: L.logoSrc,
124
- alt: L.logoAlt
157
+ src: z.logoSrc,
158
+ alt: z.logoAlt
125
159
  })]
126
160
  })]
127
- }), /* @__PURE__ */ p("div", {
161
+ }), /* @__PURE__ */ m("div", {
128
162
  className: "ttw:flex ttw:items-center ttw:gap-2",
129
- children: [z && /* @__PURE__ */ f(a, { children: /* @__PURE__ */ p(r, { children: [/* @__PURE__ */ f(o, {
163
+ children: [V && /* @__PURE__ */ p(a, { children: /* @__PURE__ */ m(r, { children: [/* @__PURE__ */ p(o, {
130
164
  asChild: !0,
131
- children: /* @__PURE__ */ f(e, {
165
+ children: /* @__PURE__ */ p(e, {
132
166
  type: "button",
133
167
  variant: "outline",
134
168
  size: "lg",
135
- "aria-label": U.settingsButton,
136
- onClick: z,
137
- children: /* @__PURE__ */ f(_, {
169
+ "aria-label": G.settingsButton,
170
+ onClick: V,
171
+ children: /* @__PURE__ */ p(v, {
138
172
  className: "ttw:size-4.5",
139
173
  "aria-hidden": !0
140
174
  })
141
175
  })
142
- }), /* @__PURE__ */ f(i, {
176
+ }), /* @__PURE__ */ p(i, {
143
177
  sideOffset: 4,
144
- children: U.settingsButton
145
- })] }) }), R && /* @__PURE__ */ f(e, {
178
+ children: G.settingsButton
179
+ })] }) }), B && /* @__PURE__ */ p(e, {
146
180
  size: "lg",
147
- onClick: R,
148
- children: U.createInvoiceButton
181
+ onClick: B,
182
+ children: G.createInvoiceButton
149
183
  })]
150
184
  })]
151
185
  }),
152
- !g && M && N && /* @__PURE__ */ f(d, {
153
- view: M,
154
- onSelect: N,
155
- labels: { all: U.statusCardsAll }
186
+ !h && P && F && /* @__PURE__ */ p(f, {
187
+ view: P,
188
+ onSelect: F,
189
+ labels: { all: G.statusCardsAll }
156
190
  }),
157
- g ? /* @__PURE__ */ f(c, {
158
- icon: /* @__PURE__ */ f(v, { className: "ttw:size-8 ttw:text-primary" }),
159
- title: U.accessRestrictedTitle,
160
- description: U.accessRestrictedDescription
161
- }) : h ? /* @__PURE__ */ f(c, {
162
- title: U.errorTitle,
163
- description: U.errorDescription,
164
- retryLabel: V ? U.errorRetry : void 0,
165
- onRetry: V
166
- }) : /* @__PURE__ */ f(t, {
167
- columns: W,
191
+ h ? /* @__PURE__ */ p(c, {
192
+ icon: /* @__PURE__ */ p(y, { className: "ttw:size-8 ttw:text-primary" }),
193
+ title: G.accessRestrictedTitle,
194
+ description: G.accessRestrictedDescription
195
+ }) : /* @__PURE__ */ p(t, {
196
+ columns: K,
168
197
  data: n,
169
- isLoading: m,
170
- sorting: S,
171
- onSortingChange: C,
172
- pageSize: w,
173
- onPageSizeChange: T,
174
- pageSizeOptions: E,
175
- pageInfo: D,
176
- hasNextPage: O,
177
- hasPrevPage: k,
178
- onNextPage: A,
179
- onPrevPage: j,
180
- onRowClick: B,
181
- rowAriaLabel: (e) => U.openRow(e.documentLabel),
182
- filterComponent: P,
183
- children: /* @__PURE__ */ f(s, {
184
- title: F ? U.filterEmptyTitle : U.emptyTitle,
185
- description: F ? void 0 : U.emptyDescription,
186
- actionLabel: F ? void 0 : U.createInvoiceButton,
187
- onAction: F ? void 0 : R
198
+ isLoading: u,
199
+ sorting: g,
200
+ onSortingChange: _,
201
+ pageSize: b,
202
+ onPageSizeChange: D,
203
+ pageSizeOptions: O,
204
+ pageInfo: k,
205
+ hasNextPage: A,
206
+ hasPrevPage: j,
207
+ onNextPage: M,
208
+ onPrevPage: N,
209
+ onRowClick: H,
210
+ rowAriaLabel: (e) => G.openRow(e.documentLabel),
211
+ filterComponent: I,
212
+ children: d && !L ? /* @__PURE__ */ p(c, {
213
+ title: G.errorTitle,
214
+ description: G.errorDescription,
215
+ retryLabel: U ? G.errorRetry : void 0,
216
+ onRetry: U
217
+ }) : /* @__PURE__ */ p(s, {
218
+ title: L ? G.filterEmptyTitle : G.emptyTitle,
219
+ description: L ? void 0 : G.emptyDescription,
220
+ actionLabel: L ? void 0 : G.createInvoiceButton,
221
+ onAction: L ? void 0 : B
188
222
  })
189
223
  })
190
224
  ]
191
225
  });
192
226
  }
193
227
  //#endregion
194
- export { S as ReceivablesScreen, S as default };
228
+ export { D as ReceivablesScreen, D as default };