@tesouro/embedded-components-react 0.7.45 → 0.7.46

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 (95) hide show
  1. package/dist/index.d.ts +29 -39
  2. package/dist/lib/CounterpartsWidget.d.ts +29 -22
  3. package/dist/lib/CounterpartsWidgetPublic.d.ts +29 -22
  4. package/dist/lib/CustomersWidget.d.ts +29 -22
  5. package/dist/lib/ReceivablesWidget.d.ts +1 -0
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +12 -12
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +15 -15
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +9 -9
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index5.js +30 -30
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index14.js +3 -2
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index15.js +7 -6
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index33.js +3 -2
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index34.js +9 -8
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index37.js +5 -4
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index48.js +1 -1
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index49.js +1 -1
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index5.js +3 -2
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +40 -40
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +3 -2
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index2.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +8 -7
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index3.js +1 -1
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index5.js +1 -1
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index6.js +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +9 -13
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +7 -10
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +76 -11
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +1 -1
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +27 -9
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +2 -76
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +30 -0
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +1 -1
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +5 -27
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +32 -2
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +2 -30
  36. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +73 -77
  37. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +8 -25
  38. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index7.js +197 -208
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +9 -9
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/auditHistory/labels.js +2 -2
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +1 -1
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +2 -2
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +22 -23
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +10 -24
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +53 -37
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +21 -53
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +8 -21
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +77 -8
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +31 -69
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +17 -38
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +40 -17
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +26 -38
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +18 -27
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +8 -18
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +35 -9
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +14 -36
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +26 -14
  58. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +84 -23
  59. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +487 -80
  60. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +2 -494
  61. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +48 -2
  62. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +62 -38
  63. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +438 -61
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +207 -431
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +20 -222
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +6 -21
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +265 -0
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +2 -265
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +131 -2
  70. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +22 -125
  71. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +235 -23
  72. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +3 -240
  73. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +249 -3
  74. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +54 -242
  75. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +221 -51
  76. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +38 -222
  77. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index.js +8 -0
  78. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index2.js +14 -0
  79. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index3.js +13 -0
  80. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index4.js +18 -0
  81. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index5.js +2 -0
  82. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index6.js +20 -0
  83. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index7.js +32 -0
  84. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index8.js +2 -0
  85. package/dist/libs/tesouro-embedded-components-react/{bill-pay-widget → shared/document-status}/util/dist/lib/derivePayableStatus.js +23 -10
  86. package/dist/libs/tesouro-embedded-components-react/shared/document-status/util/dist/lib/receivableFilledTone.js +22 -0
  87. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  88. package/package.json +1 -1
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +0 -18
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +0 -2
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +0 -7
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +0 -34
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +0 -2
  94. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +0 -8
  95. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js +0 -45
@@ -1,11 +1,29 @@
1
+ import { Popover as e, PopoverContent as t, PopoverTrigger as n } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { useState as r } from "react";
3
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
1
4
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js
2
- var e = {
3
- dropPrefix: "Drop your files here, or",
4
- browseAction: "browse to upload",
5
- fileTypesHint: "PDF, JPG, or PNG (max. 3MB)",
6
- fileCountHint: (e) => `up to ${e} files at a time`,
7
- uploadingText: "Uploading…",
8
- fileInput: "Choose a file to upload"
9
- };
5
+ function o({ children: o, date: s }) {
6
+ let [c, l] = r(!1);
7
+ return /* @__PURE__ */ a(e, {
8
+ open: c,
9
+ onOpenChange: l,
10
+ children: [/* @__PURE__ */ i(n, {
11
+ type: "button",
12
+ className: "ttw:cursor-default",
13
+ onPointerEnter: (e) => {
14
+ e.pointerType === "mouse" && l(!0);
15
+ },
16
+ onPointerLeave: (e) => {
17
+ e.pointerType === "mouse" && l(!1);
18
+ },
19
+ onClick: (e) => e.stopPropagation(),
20
+ children: o
21
+ }), /* @__PURE__ */ i(t, {
22
+ onOpenAutoFocus: (e) => e.preventDefault(),
23
+ className: "ttw:w-auto ttw:px-3 ttw:py-1.5 ttw:text-xs",
24
+ children: s
25
+ })]
26
+ });
27
+ }
10
28
  //#endregion
11
- export { e as BILL_UPLOAD_DROPZONE_LABELS_EN };
29
+ export { o as DateDisclosure };
@@ -1,78 +1,4 @@
1
- import { cn as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { InlineErrorAlert as t } from "../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
3
- import "../../../shared/ui/dist/index.js";
4
- import { BILL_UPLOAD_DROPZONE_LABELS_EN as n } from "./index16.js";
5
- import { useRef as r, useState as i } from "react";
6
- import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
7
- import { Loader2 as c, Upload as l } from "lucide-react";
8
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js
9
- function u(e, t) {
10
- let n = t.split(",").map((e) => e.trim()).filter(Boolean);
11
- return n.length === 0 || n.some((t) => t.startsWith(".") ? e.name.toLowerCase().endsWith(t.toLowerCase()) : t.endsWith("/*") ? e.type.startsWith(t.slice(0, -1)) : e.type === t);
12
- }
13
- function d(e, t, n = !0) {
14
- let r = e.filter((e) => u(e, t));
15
- return n ? r : r.slice(0, 1);
16
- }
17
- function f({ status: u = "idle", errorMessage: f, accept: p = ".pdf,.png,.jpg,.jpeg", multiple: m = !0, maxFiles: h, onFilesSelected: g, testId: _, labels: v }) {
18
- let y = {
19
- ...n,
20
- ...v
21
- }, b = r(null), [x, S] = i(!1), C = u === "uploading";
22
- return /* @__PURE__ */ s("div", {
23
- className: "ttw:flex ttw:flex-col ttw:gap-2",
24
- "data-testid": _,
25
- children: [
26
- /* @__PURE__ */ s("button", {
27
- type: "button",
28
- disabled: C,
29
- className: e("ttw:flex ttw:w-full ttw:items-center ttw:justify-center ttw:gap-3 ttw:rounded-lg ttw:border ttw:border-dashed ttw:px-6 ttw:py-8", x ? "ttw:border-primary ttw:bg-primary/5" : "ttw:border-border ttw:bg-muted/40"),
30
- onClick: () => b.current?.click(),
31
- onDragOver: (e) => {
32
- e.preventDefault(), S(!0);
33
- },
34
- onDragLeave: (e) => {
35
- e.preventDefault(), S(!1);
36
- },
37
- onDrop: (e) => {
38
- if (e.preventDefault(), S(!1), C) return;
39
- let t = d(e.dataTransfer.files ? Array.from(e.dataTransfer.files) : [], p, m);
40
- t.length > 0 && g(t);
41
- },
42
- children: [C ? /* @__PURE__ */ o(c, { className: "ttw:size-5 ttw:animate-spin ttw:text-primary" }) : /* @__PURE__ */ o(l, { className: "ttw:size-5 ttw:text-muted-foreground" }), /* @__PURE__ */ s("span", {
43
- className: "ttw:flex ttw:flex-col ttw:items-start",
44
- children: [/* @__PURE__ */ o("span", {
45
- className: "ttw:text-sm ttw:text-primary",
46
- children: C ? y.uploadingText : /* @__PURE__ */ s(a, { children: [
47
- y.dropPrefix,
48
- " ",
49
- /* @__PURE__ */ o("span", {
50
- className: "ttw:underline",
51
- children: y.browseAction
52
- })
53
- ] })
54
- }), /* @__PURE__ */ o("span", {
55
- className: "ttw:text-xs ttw:text-muted-foreground",
56
- children: h === void 0 ? y.fileTypesHint : `${y.fileTypesHint} · ${y.fileCountHint(h)}`
57
- })]
58
- })]
59
- }),
60
- /* @__PURE__ */ o("input", {
61
- ref: b,
62
- type: "file",
63
- accept: p,
64
- multiple: m,
65
- disabled: C,
66
- "aria-label": y.fileInput,
67
- className: "ttw:hidden",
68
- onChange: (e) => {
69
- let t = d(e.target.files ? Array.from(e.target.files) : [], p, m);
70
- t.length > 0 && g(t), e.target.value = "";
71
- }
72
- }),
73
- u === "error" && f ? /* @__PURE__ */ o(t, { children: f }) : null
74
- ]
75
- });
76
- }
2
+ var e = { overdue: "Overdue" };
77
3
  //#endregion
78
- export { f as BillUploadDropzone, f as default, d as getAcceptedBillUploadFiles };
4
+ export { e as DUE_DATE_VALUE_LABELS_EN };
@@ -0,0 +1,30 @@
1
+ import { cn as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { DUE_DATE_VALUE_LABELS_EN as t } from "./index17.js";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ import { AlertTriangleIcon as i } from "lucide-react";
5
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js
6
+ function a({ value: a, tone: o = "default", labels: s, className: c }) {
7
+ let l = {
8
+ ...t,
9
+ ...s
10
+ };
11
+ return o === "danger" ? /* @__PURE__ */ r("span", {
12
+ className: e("ttw:inline-flex ttw:items-center ttw:gap-1 ttw:whitespace-nowrap ttw:font-medium ttw:text-destructive", c),
13
+ children: [
14
+ /* @__PURE__ */ n(i, {
15
+ "aria-hidden": !0,
16
+ className: "ttw:size-3.5 ttw:shrink-0"
17
+ }),
18
+ a,
19
+ /* @__PURE__ */ n("span", {
20
+ className: "ttw:sr-only",
21
+ children: l.overdue
22
+ })
23
+ ]
24
+ }) : /* @__PURE__ */ n("span", {
25
+ className: c,
26
+ children: a
27
+ });
28
+ }
29
+ //#endregion
30
+ export { a as DueDateValue, a as default };
@@ -1,2 +1,2 @@
1
- import "./index16.js";
2
1
  import "./index17.js";
2
+ import "./index18.js";
@@ -1,29 +1,7 @@
1
- import { Popover as e, PopoverContent as t, PopoverTrigger as n } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { useState as r } from "react";
3
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
4
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js
5
- function o({ children: o, date: s }) {
6
- let [c, l] = r(!1);
7
- return /* @__PURE__ */ a(e, {
8
- open: c,
9
- onOpenChange: l,
10
- children: [/* @__PURE__ */ i(n, {
11
- type: "button",
12
- className: "ttw:cursor-default",
13
- onPointerEnter: (e) => {
14
- e.pointerType === "mouse" && l(!0);
15
- },
16
- onPointerLeave: (e) => {
17
- e.pointerType === "mouse" && l(!1);
18
- },
19
- onClick: (e) => e.stopPropagation(),
20
- children: o
21
- }), /* @__PURE__ */ i(t, {
22
- onOpenAutoFocus: (e) => e.preventDefault(),
23
- className: "ttw:w-auto ttw:px-3 ttw:py-1.5 ttw:text-xs",
24
- children: s
25
- })]
26
- });
27
- }
2
+ var e = {
3
+ revealValue: "Show value",
4
+ hideValue: "Hide value"
5
+ };
28
6
  //#endregion
29
- export { o as DateDisclosure };
7
+ export { e as REVEALABLE_FIELD_LABELS_EN };
@@ -1,4 +1,34 @@
1
+ import { Button as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { REVEALABLE_FIELD_LABELS_EN as t } from "./index20.js";
3
+ import { useState as n } from "react";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ import { Eye as a, EyeOff as o } from "lucide-react";
1
6
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js
2
- var e = { overdue: "Overdue" };
7
+ function s({ field: s, labels: c }) {
8
+ let l = {
9
+ ...t,
10
+ ...c
11
+ }, [u, d] = n(!1), f = s.maskedValue && !u ? s.maskedValue : s.value;
12
+ return /* @__PURE__ */ i("div", {
13
+ className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-3",
14
+ children: [/* @__PURE__ */ i("div", {
15
+ className: "ttw:min-w-0",
16
+ children: [/* @__PURE__ */ r("dt", {
17
+ className: "ttw:text-xs ttw:text-muted-foreground",
18
+ children: s.label
19
+ }), /* @__PURE__ */ r("dd", {
20
+ className: "ttw:break-words ttw:text-sm ttw:font-medium",
21
+ children: f
22
+ })]
23
+ }), s.maskedValue ? /* @__PURE__ */ r(e, {
24
+ type: "button",
25
+ variant: "ghost",
26
+ size: "icon",
27
+ "aria-label": u ? l.hideValue : l.revealValue,
28
+ onClick: () => d((e) => !e),
29
+ children: r(u ? o : a, { className: "ttw:size-4" })
30
+ }) : null]
31
+ });
32
+ }
3
33
  //#endregion
4
- export { e as DUE_DATE_VALUE_LABELS_EN };
34
+ export { s as RevealableField, s as default };
@@ -1,30 +1,2 @@
1
- import { cn as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { DUE_DATE_VALUE_LABELS_EN as t } from "./index21.js";
3
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
- import { AlertTriangleIcon as i } from "lucide-react";
5
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js
6
- function a({ value: a, tone: o = "default", labels: s, className: c }) {
7
- let l = {
8
- ...t,
9
- ...s
10
- };
11
- return o === "danger" ? /* @__PURE__ */ r("span", {
12
- className: e("ttw:inline-flex ttw:items-center ttw:gap-1 ttw:whitespace-nowrap ttw:font-medium ttw:text-destructive", c),
13
- children: [
14
- /* @__PURE__ */ n(i, {
15
- "aria-hidden": !0,
16
- className: "ttw:size-3.5 ttw:shrink-0"
17
- }),
18
- a,
19
- /* @__PURE__ */ n("span", {
20
- className: "ttw:sr-only",
21
- children: l.overdue
22
- })
23
- ]
24
- }) : /* @__PURE__ */ n("span", {
25
- className: c,
26
- children: a
27
- });
28
- }
29
- //#endregion
30
- export { a as DueDateValue, a as default };
1
+ import "./index20.js";
2
+ import "./index21.js";
@@ -1,99 +1,95 @@
1
- import { formatMoney as e, isAchCompatibleBankAccount as t } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
1
+ import { derivePayableStatus as e, isPayableApiStatus as t } from "../../../../../shared/document-status/util/dist/lib/derivePayableStatus.js";
2
+ import { receivableFilledTone as n } from "../../../../../shared/document-status/util/dist/lib/receivableFilledTone.js";
3
+ import { BILL_STATUS_BADGE_LABELS_EN as r } from "../../../../../shared/document-status/ui/dist/index2.js";
4
+ import { RECEIVABLE_STATUS_BADGE_LABELS_EN as i } from "../../../../../shared/document-status/ui/dist/index6.js";
5
+ import "../../../../../shared/document-status/ui/dist/index.js";
6
+ import { formatMoney as a, isAchCompatibleBankAccount as o } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
2
7
  import "../../../../../shared/counterpart-management/feature/dist/index.js";
3
8
  //#region ../../libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js
4
- function n(e) {
9
+ function s(e) {
5
10
  if (!e) return "";
6
11
  let t = [...e], n = t.flatMap((e, t) => /\d/.test(e) ? [t] : []);
7
12
  if (n.length <= 4) return "••••";
8
13
  let r = /* @__PURE__ */ new Set([...n.slice(0, 2), ...n.slice(-2)]);
9
14
  return t.map((e, t) => /\d/.test(e) && !r.has(t) ? "•" : e).join("");
10
15
  }
11
- var r = /* @__PURE__ */ new Set([
12
- "new",
13
- "approve_in_progress",
14
- "waiting_to_be_paid",
15
- "partially_paid"
16
- ]);
17
- function i(e, t) {
18
- if (!t || !e || !r.has(e)) return !1;
19
- let n = /* @__PURE__ */ new Date();
20
- n.setUTCHours(0, 0, 0, 0);
21
- let i = new Date(t);
22
- return i.setUTCHours(0, 0, 0, 0), i.getTime() < n.getTime();
23
- }
24
- var a = {
25
- draft: ["billStatusDraft", "billNeutral"],
26
- new: ["billStatusReadyToSubmit", "billAccent"],
27
- approve_in_progress: ["billStatusPendingApproval", "billInfo"],
28
- waiting_to_be_paid: ["billStatusReadyToPay", "billSuccess"],
29
- partially_paid: ["billStatusReadyToPay", "billSuccess"],
30
- paid: ["billStatusPaid", "billSettled"],
31
- canceled: ["billStatusCanceled", "billNeutral"],
32
- rejected: ["billStatusRejected", "billDanger"]
33
- }, o = {
34
- draft: ["receivableStatusDraft", "invoiceNeutral"],
35
- recurring: ["receivableStatusRecurring", "invoiceNeutral"],
36
- issuing: ["receivableStatusIssuing", "invoiceCyan"],
37
- issued: ["receivableStatusIssued", "invoiceCyan"],
38
- accepted: ["receivableStatusAccepted", "invoiceSuccess"],
39
- paid: ["receivableStatusPaid", "invoiceSuccess"],
40
- partially_paid: ["receivableStatusPartiallyPaid", "invoicePurple"],
41
- overdue: ["receivableStatusOverdue", "invoiceOrange"],
42
- failed: ["receivableStatusFailed", "invoiceDanger"],
43
- expired: ["receivableStatusExpired", "invoiceDanger"],
44
- uncollectible: ["receivableStatusUncollectible", "invoiceDanger"],
45
- canceled: ["receivableStatusCanceled", "invoiceDanger"],
46
- declined: ["receivableStatusDeclined", "invoiceDanger"],
47
- deleted: ["receivableStatusDeleted", "invoiceDanger"]
48
- };
49
- function s(e, t, n) {
50
- let [r, i] = (t === "bill" ? a : o)[e ?? ""] ?? ["receivableStatusUnknown", t === "bill" ? "billNeutral" : "invoiceNeutral"];
16
+ function c(a, o, s, c) {
17
+ if (a === "invoice") {
18
+ let e = {
19
+ ...i,
20
+ ...c.invoiceStatusBadge
21
+ };
22
+ return {
23
+ status: {
24
+ kind: "invoice",
25
+ label: o && Object.hasOwn(e, o) ? e[o] : e.unknown,
26
+ tone: n(o)
27
+ },
28
+ isOverdue: !1
29
+ };
30
+ }
31
+ let l = {
32
+ ...r,
33
+ ...c.billStatusBadge
34
+ };
35
+ if (!t(o)) return {
36
+ status: {
37
+ kind: "bill",
38
+ label: l.unknown,
39
+ tone: "neutral"
40
+ },
41
+ isOverdue: !1
42
+ };
43
+ let u = e({
44
+ apiStatus: o,
45
+ dueDate: s
46
+ });
51
47
  return {
52
- statusLabel: n[r],
53
- statusTone: i
48
+ status: {
49
+ kind: "bill",
50
+ label: l[u.status],
51
+ tone: u.tone
52
+ },
53
+ isOverdue: u.isOverdue
54
54
  };
55
55
  }
56
- var c = new Intl.DateTimeFormat(void 0, {
56
+ var l = new Intl.DateTimeFormat(void 0, {
57
57
  day: "2-digit",
58
58
  month: "short",
59
59
  year: "numeric"
60
60
  });
61
- function l(e) {
61
+ function u(e) {
62
62
  if (!e) return "";
63
63
  let t = new Date(e);
64
- return Number.isNaN(t.getTime()) ? "" : c.format(t);
64
+ return Number.isNaN(t.getTime()) ? "" : l.format(t);
65
65
  }
66
- function u(t, n, r) {
67
- return (t ?? []).map((t) => {
68
- let a = t.status ?? void 0, o = n === "bill" && i(a, t.due_date), c = s(a, n, r);
69
- return {
70
- id: t.id,
71
- amountLabel: e(t.total_amount ?? 0, t.currency ?? void 0),
72
- dateLabel: l(t.issued_at ?? t.issue_date ?? t.created_at),
73
- ...c,
74
- isOverdue: o
75
- };
76
- });
66
+ function d(e, t, n) {
67
+ return (e ?? []).map((e) => ({
68
+ id: e.id,
69
+ amountLabel: a(e.total_amount ?? 0, e.currency ?? void 0),
70
+ dateLabel: u(e.issued_at ?? e.issue_date ?? e.created_at),
71
+ ...c(t, e.status ?? void 0, e.due_date, n)
72
+ }));
77
73
  }
78
- function d(e) {
74
+ function f(e) {
79
75
  return e ? `•••• ${e.slice(-4)}` : "";
80
76
  }
81
- function f(e, n) {
82
- let r = e?.find(t);
83
- if (r) return {
84
- id: r.id,
85
- title: n,
86
- accountHolderLabel: r.account_holder_name ?? "",
87
- accountNumberLabel: d(r.account_number),
88
- routingNumberLabel: r.routing_number ?? "",
89
- isIncomplete: !(r.account_holder_name && r.account_number && r.routing_number)
77
+ function p(e, t) {
78
+ let n = e?.find(o);
79
+ if (n) return {
80
+ id: n.id,
81
+ title: t,
82
+ accountHolderLabel: n.account_holder_name ?? "",
83
+ accountNumberLabel: f(n.account_number),
84
+ routingNumberLabel: n.routing_number ?? "",
85
+ isIncomplete: !(n.account_holder_name && n.account_number && n.routing_number)
90
86
  };
91
87
  }
92
- function p(e, t) {
88
+ function m(e, t) {
93
89
  if (!t) return e;
94
90
  let n = t.address;
95
91
  return {
96
- ...h({
92
+ ...g({
97
93
  editingAddressHeading: t.title,
98
94
  addingAddressHeading: t.title,
99
95
  cancelButton: t.cancelButton,
@@ -110,21 +106,21 @@ function p(e, t) {
110
106
  ...e
111
107
  };
112
108
  }
113
- function m(e) {
109
+ function h(e) {
114
110
  return e ? {
115
111
  fieldMarkers: e.fieldMarkers,
116
112
  addressFieldMarkers: e.address?.fieldMarkers,
117
113
  requiredFieldsLegend: e.requiredFieldsLegend
118
114
  } : {};
119
115
  }
120
- function h(e) {
116
+ function g(e) {
121
117
  return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
122
118
  }
123
- function g(e) {
119
+ function _(e) {
124
120
  if (!e) return {};
125
121
  let t = e.address;
126
122
  return {
127
- labels: h({
123
+ labels: g({
128
124
  editingCustomerDetailsHeading: e.editTitleCustomer,
129
125
  editingVendorDetailsHeading: e.editTitleVendor,
130
126
  firstNameLabel: e.firstNameLabel,
@@ -156,7 +152,7 @@ function g(e) {
156
152
  requiredFieldsLegend: e.requiredFieldsLegend
157
153
  };
158
154
  }
159
- var _ = {
155
+ var v = {
160
156
  firstName: "firstName",
161
157
  lastName: "lastName",
162
158
  businessName: "legalName",
@@ -164,7 +160,7 @@ var _ = {
164
160
  phone: "phone",
165
161
  taxId: "taxId"
166
162
  };
167
- function v(e, t, n, r) {
163
+ function y(e, t, n, r) {
168
164
  let i = e === "vendor", a = t.entityType === "individual";
169
165
  return {
170
166
  heading: i ? r.editingVendorDetailsHeading : r.editingCustomerDetailsHeading,
@@ -210,4 +206,4 @@ function v(e, t, n, r) {
210
206
  };
211
207
  }
212
208
  //#endregion
213
- export { _ as EDIT_FORM_FIELD_KEYS, m as addressFormLabelOverrides, v as buildCounterpartEditFormView, f as buildPaymentMethodView, u as buildRecentDocumentRows, g as editFormLabelOverrides, l as formatDetailsDate, n as maskTaxId, p as withAddressLabelOverrides };
209
+ export { v as EDIT_FORM_FIELD_KEYS, h as addressFormLabelOverrides, y as buildCounterpartEditFormView, p as buildPaymentMethodView, d as buildRecentDocumentRows, _ as editFormLabelOverrides, u as formatDetailsDate, s as maskTaxId, m as withAddressLabelOverrides };
@@ -1,6 +1,9 @@
1
1
  import { FILTER_MENU_BUTTON_LABELS_EN as e, FILTER_TAG_LABELS_EN as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { BILL_STATUS_BADGE_LABELS_EN as n } from "../../../shared/document-status/ui/dist/index2.js";
3
+ import { RECEIVABLE_STATUS_BADGE_LABELS_EN as r } from "../../../shared/document-status/ui/dist/index6.js";
4
+ import "../../../shared/document-status/ui/dist/index.js";
2
5
  //#region ../../libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js
3
- var n = {
6
+ var i = {
4
7
  createButton: "Add customer",
5
8
  vendorsCreateButton: "Add vendor",
6
9
  columnName: "Name",
@@ -39,7 +42,7 @@ var n = {
39
42
  errorRetry: "Reload",
40
43
  accessRestrictedTitle: "Access Restricted",
41
44
  accessRestrictedDescription: "You don’t have permissions to view this page. Contact your system administrator for details."
42
- }, r = {
45
+ }, a = {
43
46
  hiddenDescription: "Counterpart details",
44
47
  loadingTitle: "Loading...",
45
48
  notFoundCustomerTitle: "Customer not found",
@@ -101,28 +104,8 @@ var n = {
101
104
  routingNumberLabel: "Routing number",
102
105
  noPaymentMethods: "No payment methods yet.",
103
106
  editButton: "Edit",
104
- billStatusDraft: "Draft",
105
- billStatusReadyToSubmit: "Ready to submit",
106
- billStatusPendingApproval: "Pending review",
107
- billStatusReadyToPay: "Ready to pay",
108
- billStatusPaid: "Paid",
109
- billStatusCanceled: "Cancelled",
110
- billStatusRejected: "Rejected",
111
- receivableStatusDraft: "Draft",
112
- receivableStatusIssuing: "Issuing",
113
- receivableStatusIssued: "Issued",
114
- receivableStatusFailed: "Failed",
115
- receivableStatusAccepted: "Accepted",
116
- receivableStatusExpired: "Expired",
117
- receivableStatusDeclined: "Declined",
118
- receivableStatusRecurring: "Recurring",
119
- receivableStatusPartiallyPaid: "Partially paid",
120
- receivableStatusPaid: "Paid",
121
- receivableStatusOverdue: "Overdue",
122
- receivableStatusUncollectible: "Uncollectible",
123
- receivableStatusCanceled: "Canceled",
124
- receivableStatusDeleted: "Deleted",
125
- receivableStatusUnknown: "Unknown",
107
+ billStatusBadge: n,
108
+ invoiceStatusBadge: r,
126
109
  optionalSuffix: "(optional)",
127
110
  editingCustomerDetailsHeading: "Editing customer details",
128
111
  editingVendorDetailsHeading: "Editing vendor details",
@@ -147,4 +130,4 @@ var n = {
147
130
  saveButton: "Save"
148
131
  };
149
132
  //#endregion
150
- export { n as COUNTERPARTS_SCREEN_LABELS_EN, r as COUNTERPART_DETAILS_SHEET_LABELS_EN };
133
+ export { i as COUNTERPARTS_SCREEN_LABELS_EN, a as COUNTERPART_DETAILS_SHEET_LABELS_EN };