@tesouro/embedded-components-react 0.2.266 → 0.2.267

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 (39) hide show
  1. package/dist/index.css +45 -9
  2. package/dist/index.js +1 -1
  3. package/dist/lib/BillPayWidget.js +1 -1
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +6 -6
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +99 -7
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +7 -97
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +99 -4
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +4 -4
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +2 -41
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +43 -1
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +1 -50
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +48 -6
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +9 -5
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +8 -91
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +6 -2
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +7 -3
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +100 -6
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +3 -9
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +6 -83
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +9 -3
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +83 -6
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +2 -111
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +8 -1
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +103 -16
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +1 -0
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +25 -0
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +37 -27
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +15 -116
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +126 -31
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +32 -69
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +0 -3
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +34 -69
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +4 -0
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +261 -181
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +32 -33
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index7.js +2 -2
  37. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  38. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index5.js +1 -1
  39. package/package.json +1 -1
package/dist/index.css CHANGED
@@ -155,6 +155,10 @@
155
155
  container-type: inline-size;
156
156
  container-name: field-group;
157
157
  }
158
+ .ttw\:\@container\/line-item {
159
+ container-type: inline-size;
160
+ container-name: line-item;
161
+ }
158
162
  .ttw\:\@container\/widget {
159
163
  container-type: inline-size;
160
164
  container-name: widget;
@@ -353,6 +357,12 @@
353
357
  .ttw\:order-last {
354
358
  order: 9999;
355
359
  }
360
+ .ttw\:col-span-1 {
361
+ grid-column: span 1 / span 1;
362
+ }
363
+ .ttw\:col-span-3 {
364
+ grid-column: span 3 / span 3;
365
+ }
356
366
  .ttw\:col-start-2 {
357
367
  grid-column-start: 2;
358
368
  }
@@ -1624,9 +1634,6 @@
1624
1634
  .ttw\:grid-cols-3 {
1625
1635
  grid-template-columns: repeat(3, minmax(0, 1fr));
1626
1636
  }
1627
- .ttw\:grid-cols-4 {
1628
- grid-template-columns: repeat(4, minmax(0, 1fr));
1629
- }
1630
1637
  .ttw\:grid-cols-\[0_1fr\] {
1631
1638
  grid-template-columns: 0 1fr;
1632
1639
  }
@@ -1958,6 +1965,10 @@
1958
1965
  border-top-left-radius: calc(var(--ttw-radius) - 2px);
1959
1966
  border-bottom-left-radius: calc(var(--ttw-radius) - 2px);
1960
1967
  }
1968
+ .ttw\:rounded-l-none {
1969
+ border-top-left-radius: 0;
1970
+ border-bottom-left-radius: 0;
1971
+ }
1961
1972
  .ttw\:rounded-tl-\[14px\] {
1962
1973
  border-top-left-radius: 14px;
1963
1974
  }
@@ -1968,6 +1979,10 @@
1968
1979
  border-top-right-radius: calc(var(--ttw-radius) - 2px);
1969
1980
  border-bottom-right-radius: calc(var(--ttw-radius) - 2px);
1970
1981
  }
1982
+ .ttw\:rounded-r-none {
1983
+ border-top-right-radius: 0;
1984
+ border-bottom-right-radius: 0;
1985
+ }
1971
1986
  .ttw\:rounded-tr-\[14px\] {
1972
1987
  border-top-right-radius: 14px;
1973
1988
  }
@@ -2817,9 +2832,6 @@
2817
2832
  .ttw\:pt-6 {
2818
2833
  padding-top: calc(var(--ttw-spacing) * 6);
2819
2834
  }
2820
- .ttw\:pt-7 {
2821
- padding-top: calc(var(--ttw-spacing) * 7);
2822
- }
2823
2835
  .ttw\:pt-8 {
2824
2836
  padding-top: calc(var(--ttw-spacing) * 8);
2825
2837
  }
@@ -2949,9 +2961,6 @@
2949
2961
  .ttw\:text-right {
2950
2962
  text-align: right;
2951
2963
  }
2952
- .ttw\:align-baseline {
2953
- vertical-align: baseline;
2954
- }
2955
2964
  .ttw\:align-middle {
2956
2965
  vertical-align: middle;
2957
2966
  }
@@ -4572,6 +4581,28 @@
4572
4581
  .ttw\:has-\[\:disabled\]\:opacity-60:has(:is(:disabled)) {
4573
4582
  opacity: 60%;
4574
4583
  }
4584
+ .ttw\:has-\[\:focus-visible\]\:border-ring:has(:is(:focus-visible)) {
4585
+ border-color: var(--ttw-ring);
4586
+ }
4587
+ .ttw\:has-\[\:focus-visible\]\:ring-\[3px\]:has(:is(:focus-visible)) {
4588
+ --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
4589
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
4590
+ }
4591
+ .ttw\:has-\[\:focus-visible\]\:ring-ring\/50:has(:is(:focus-visible)) {
4592
+ --tw-ring-color: var(--ttw-ring);
4593
+ @supports (color: color-mix(in lab, red, red)) {
4594
+ --tw-ring-color: color-mix(in oklab, var(--ttw-ring) 50%, transparent);
4595
+ }
4596
+ }
4597
+ .ttw\:has-\[\[aria-invalid\=true\]\]\:border-destructive:has(:is([aria-invalid=true])) {
4598
+ border-color: var(--ttw-destructive);
4599
+ }
4600
+ .ttw\:has-\[\[aria-invalid\=true\]\]\:ring-destructive\/20:has(:is([aria-invalid=true])) {
4601
+ --tw-ring-color: var(--ttw-destructive);
4602
+ @supports (color: color-mix(in lab, red, red)) {
4603
+ --tw-ring-color: color-mix(in oklab, var(--ttw-destructive) 20%, transparent);
4604
+ }
4605
+ }
4575
4606
  .ttw\:has-\[\[data-slot\=input-group-control\]\:focus-visible\]\:border-ring:has(:is([data-slot=input-group-control]:focus-visible)) {
4576
4607
  border-color: var(--ttw-ring);
4577
4608
  }
@@ -5453,6 +5484,11 @@
5453
5484
  align-items: flex-start;
5454
5485
  }
5455
5486
  }
5487
+ @container line-item (width >= 32rem) {
5488
+ .ttw\:\@lg\/line-item\:grid-cols-6 {
5489
+ grid-template-columns: repeat(6, minmax(0, 1fr));
5490
+ }
5491
+ }
5456
5492
  .ttw\:dark\:border-input:is(.dark *) {
5457
5493
  border-color: var(--ttw-input);
5458
5494
  }
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import "./lib/AcceptDisclosuresWidget.js";
15
15
  import { BankAccountsWidget as x } from "./libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js";
16
16
  import "./lib/BankAccountsWidget.js";
17
17
  import { CounterpartsWidget as S } from "./libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js";
18
- import { BillPayWidget as C } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js";
18
+ import { BillPayWidget as C } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js";
19
19
  import "./lib/BillPayWidget.js";
20
20
  import { CardDetailsWidget as w } from "./libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js";
21
21
  import { CardFormatValue as T } from "./libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index3.js";
@@ -1,3 +1,3 @@
1
- import { BillPayWidget as e } from "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js";
1
+ import { BillPayWidget as e } from "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js";
2
2
  import "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js";
3
3
  export { e as BillPayWidget };
@@ -1,16 +1,16 @@
1
1
  import "./index2.js";
2
- import "./index7.js";
3
- import "./index9.js";
4
- import "./index11.js";
2
+ import "./index8.js";
3
+ import "./index10.js";
5
4
  import "./index12.js";
6
- import "./index16.js";
5
+ import "./index13.js";
7
6
  import "./index17.js";
8
- import "./index18.js";
9
7
  import "./index19.js";
10
8
  import "./index20.js";
11
9
  import "./index21.js";
12
10
  import "./index22.js";
13
11
  import "./index23.js";
14
12
  import "./index24.js";
15
- import { BillPayWidget as e } from "./index28.js";
13
+ import "./index25.js";
14
+ import "./index26.js";
15
+ import { BillPayWidget as e } from "./index30.js";
16
16
  export { e as BillPayWidget };
@@ -1,9 +1,101 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { calculateTotal as e, displayLineAmount as t } from "./index6.js";
6
+ import { emptyLineItem as n, mapPayableToBillForm as r } from "./index9.js";
7
+ import { useCallback as i, useEffect as a, useMemo as o, useState as s } from "react";
1
8
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js
2
- var e = {
3
- dialog: "bill-pay-bill-create-dialog",
4
- vendorSection: "bill-pay-bill-create-vendor",
5
- lineItems: "bill-pay-bill-create-line-items",
6
- documentPanel: "bill-pay-bill-create-document"
7
- };
9
+ function c({ payable: c, lineItems: l } = {}) {
10
+ let u = o(() => r({
11
+ payable: c ?? {},
12
+ lineItems: l ?? []
13
+ }), [c, l]), [d, f] = s(u.values), [p, m] = s(u.lineItems), [h, g] = s(u.discount), [_, v] = s(u.tax), [y, b] = s(), [x, S] = s(), [C, w] = s(), [T, E] = s(!1), [D, O] = s(!1), [k, A] = s(!1);
14
+ a(() => {
15
+ T || f(u.values);
16
+ }, [u]), a(() => {
17
+ D || m(u.lineItems);
18
+ }, [u]), a(() => {
19
+ k || (g(u.discount), v(u.tax));
20
+ }, [u]);
21
+ let j = i((e) => {
22
+ f((t) => ({
23
+ ...t,
24
+ ...e
25
+ })), E(!0);
26
+ }, []), M = i((e) => {
27
+ w((t) => {
28
+ if (!t?.[e]) return t;
29
+ let n = { ...t };
30
+ return delete n[e], Object.keys(n).length ? n : void 0;
31
+ });
32
+ }, []), N = i((e, n) => {
33
+ M(e), m((r) => r.map((r) => {
34
+ if (r.id !== e) return r;
35
+ let i = {
36
+ ...r,
37
+ ...n
38
+ };
39
+ return "amount" in n ? i : {
40
+ ...i,
41
+ amount: t(i.quantity, i.price)
42
+ };
43
+ })), O(!0), b(void 0);
44
+ }, [M]), P = i((e, n) => {
45
+ M(e), m((r) => r.map((r) => {
46
+ if (r.id !== e) return r;
47
+ let i = Number.parseFloat(r.quantity), a = String(Math.max(1, (Number.isFinite(i) ? i : 1) + n));
48
+ return {
49
+ ...r,
50
+ quantity: a,
51
+ amount: t(a, r.price)
52
+ };
53
+ })), O(!0), b(void 0);
54
+ }, [M]), F = i((e) => {
55
+ M(e), m((t) => t.length <= 1 ? t : t.filter((t) => t.id !== e)), O(!0), b(void 0);
56
+ }, [M]), I = i(() => {
57
+ m((e) => [...e, n()]), O(!0), b(void 0);
58
+ }, []), L = i((e) => {
59
+ g(e), A(!0), b(void 0);
60
+ }, []), R = i((e) => {
61
+ v(e), A(!0), b(void 0);
62
+ }, []), z = i((e) => {
63
+ b(e), A(!0);
64
+ }, []), B = o(() => p.map((e) => ({
65
+ ...e,
66
+ onChange: (t) => N(e.id, t),
67
+ onQuantityStep: (t) => P(e.id, t),
68
+ onRemove: () => F(e.id)
69
+ })), [
70
+ p,
71
+ N,
72
+ F,
73
+ P
74
+ ]), V = o(() => e(p, _, h), [
75
+ p,
76
+ _,
77
+ h
78
+ ]);
79
+ return {
80
+ values: d,
81
+ errors: x,
82
+ setErrors: S,
83
+ lineItemErrors: C,
84
+ setLineItemErrors: w,
85
+ onChange: j,
86
+ lineItems: p,
87
+ lineItemRows: B,
88
+ discount: h,
89
+ onDiscountChange: L,
90
+ tax: _,
91
+ onTaxChange: R,
92
+ total: y ?? V,
93
+ totalOverride: y,
94
+ onTotalChange: z,
95
+ onAddLineItem: I,
96
+ isTotalsDirty: k,
97
+ isDirty: T || D || k
98
+ };
99
+ }
8
100
  //#endregion
9
- export { e as billCreateTestIds };
101
+ export { c as useBillForm };
@@ -1,99 +1,9 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { useLedgerAccountsQuery as e } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
6
- import { usePaymentTermsQuery as t } from "../../../shared/data-access/dist/lib/reference-data/usePaymentTermsQuery.js";
7
- import "../../../shared/data-access/dist/index.js";
8
- import { BILL_CREATE_SCREEN_LABELS_EN as n } from "./index2.js";
9
- import { useAllPayableLineItemsQuery as r } from "../../data-access/dist/index6.js";
10
- import { usePayableQuery as i } from "../../data-access/dist/index10.js";
11
- import "../../data-access/dist/index.js";
12
- import { useBillCreateController as a } from "./index7.js";
13
- import { useBillForm as o } from "./index9.js";
14
- import { BillCreateScreen as s } from "../../ui/dist/index28.js";
15
- import { ExtractionNotice as c } from "../../ui/dist/index45.js";
16
- import "../../ui/dist/index.js";
17
- import { SourceDocumentContainer as l } from "./index3.js";
18
- import { useVendorSectionProps as u } from "./index5.js";
19
- import { billCreateTestIds as d } from "./index10.js";
20
- import { useCallback as f, useEffect as p, useMemo as m, useState as h } from "react";
21
- import { jsx as g } from "react/jsx-runtime";
22
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js
23
- function _({ open: _, onOpenChange: v, payableId: y, copy: b }) {
24
- let x = {
25
- ...n,
26
- ...b
27
- }, [S, C] = h(), [w, T] = h(!1), [E, D] = h(!1), [O, k] = h(), A = y ?? O, j = i(A, { pollWhileOcrProcessing: !0 }), M = r(A), N = e(), P = t(), F = j.data, I = o({
28
- payable: F,
29
- lineItems: M.lineItems
30
- }), L = F?.counterpart_id;
31
- p(() => {
32
- w || L && (C(L), T(!0));
33
- }, [w, L]);
34
- let R = f((e) => {
35
- T(!0), C(e);
36
- }, []), z = P.data?.data?.find((e) => e.id === I.values.paymentTerms), B = m(() => (P.data?.data ?? []).filter((e) => !!(e.id && e.name)).map((e) => ({
37
- value: e.id,
38
- label: e.name
39
- })), [P.data]), V = a({
40
- payableId: y,
41
- form: I,
42
- paymentTerm: z,
43
- counterpartId: S,
44
- onPayableCreated: k,
45
- onSaved: k,
46
- onDraftSaved: () => v(!1),
47
- onFinalized: () => v(!1)
48
- }), H = m(() => (N.data?.data ?? []).map((e) => ({
49
- value: e.id,
50
- label: [e.nominal_code, e.name].filter(Boolean).join(" — ")
51
- })), [N.data]), U = F?.source_of_payable_data === "ocr", W = F?.counterpart_raw_data?.name, G = () => {
52
- I.isDirty && !window.confirm(x.discardConfirm) || v(!1);
53
- }, K = u({
54
- payableId: A,
55
- counterpartId: S,
56
- payableCounterpartId: L,
57
- onCounterpartChange: R
58
- });
59
- return /* @__PURE__ */ g(s, {
60
- open: _,
61
- onOpenChange: (e) => e ? v(!0) : G(),
62
- title: U && W ? x.extractedTitle(W) : x.newTitle,
63
- notice: U && !E ? /* @__PURE__ */ g(c, { onDismiss: () => D(!0) }) : void 0,
64
- vendor: {
65
- ...K,
66
- testId: d.vendorSection
67
- },
68
- values: I.values,
69
- errors: I.errors,
70
- onChange: I.onChange,
71
- paymentTermOptions: B,
72
- lineItems: {
73
- items: I.lineItemRows,
74
- glCodeOptions: H,
75
- totalAmountLabel: I.totalAmountLabel,
76
- onAddLineItem: I.onAddLineItem,
77
- testId: d.lineItems
78
- },
79
- documentPanel: /* @__PURE__ */ g(l, {
80
- payableId: A,
81
- isDocumentPending: !!A && !F?.file && (j.isLoading || F?.ocr_status === "processing"),
82
- file: F?.file ? {
83
- id: F.file.id,
84
- name: F.file.name,
85
- url: F.file.url,
86
- mimetype: F.file.mimetype
87
- } : void 0
88
- }),
89
- isLineItemsLoading: M.isResolving,
90
- isSavingDraft: V.isSavingDraft,
91
- isFinalizing: V.isFinalizing,
92
- onCancel: G,
93
- onSaveDraft: V.saveDraft,
94
- onFinalize: V.finalize,
95
- testId: d.dialog
96
- });
97
- }
2
+ var e = {
3
+ dialog: "bill-pay-bill-create-dialog",
4
+ vendorSection: "bill-pay-bill-create-vendor",
5
+ lineItems: "bill-pay-bill-create-line-items",
6
+ documentPanel: "bill-pay-bill-create-document"
7
+ };
98
8
  //#endregion
99
- export { _ as BillCreateDialog, _ as default };
9
+ export { e as billCreateTestIds };
@@ -1,4 +1,99 @@
1
- import "./index2.js";
2
- import "./index7.js";
3
- import "./index9.js";
4
- import "./index11.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useLedgerAccountsQuery as e } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
6
+ import "../../../shared/data-access/dist/index.js";
7
+ import { BILL_CREATE_SCREEN_LABELS_EN as t } from "./index2.js";
8
+ import { useAllPayableLineItemsQuery as n } from "../../data-access/dist/index6.js";
9
+ import { usePayableQuery as r } from "../../data-access/dist/index10.js";
10
+ import "../../data-access/dist/index.js";
11
+ import { useBillCreateController as i } from "./index8.js";
12
+ import { useBillForm as a } from "./index10.js";
13
+ import { BillCreateScreen as o } from "../../ui/dist/index28.js";
14
+ import { ExtractionNotice as s } from "../../ui/dist/index45.js";
15
+ import "../../ui/dist/index.js";
16
+ import { SourceDocumentContainer as c } from "./index3.js";
17
+ import { useVendorSectionProps as l } from "./index5.js";
18
+ import { billCreateTestIds as u } from "./index11.js";
19
+ import { useCallback as d, useEffect as f, useMemo as p, useState as m } from "react";
20
+ import { jsx as h } from "react/jsx-runtime";
21
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js
22
+ function g({ open: g, onOpenChange: _, payableId: v, copy: y }) {
23
+ let b = {
24
+ ...t,
25
+ ...y
26
+ }, [x, S] = m(), [C, w] = m(!1), [T, E] = m(!1), [D, O] = m(), k = v ?? D, A = r(k, { pollWhileOcrProcessing: !0 }), j = n(k), M = e(), N = A.data, P = a({
27
+ payable: N,
28
+ lineItems: j.lineItems
29
+ }), F = N?.counterpart_id;
30
+ f(() => {
31
+ C || F && (S(F), w(!0));
32
+ }, [C, F]);
33
+ let I = d((e) => {
34
+ w(!0), S(e);
35
+ }, []), L = i({
36
+ payableId: v,
37
+ form: P,
38
+ counterpartId: x,
39
+ onPayableCreated: O,
40
+ onSaved: O,
41
+ onDraftSaved: () => _(!1),
42
+ onFinalized: () => _(!1)
43
+ }), R = p(() => (M.data?.data ?? []).map((e) => ({
44
+ value: e.id,
45
+ label: [e.nominal_code, e.name].filter(Boolean).join(" — ")
46
+ })), [M.data]), z = N?.source_of_payable_data === "ocr", B = N?.counterpart_raw_data?.name, V = () => {
47
+ P.isDirty && !window.confirm(b.discardConfirm) || _(!1);
48
+ }, H = l({
49
+ payableId: k,
50
+ counterpartId: x,
51
+ payableCounterpartId: F,
52
+ onCounterpartChange: I
53
+ });
54
+ return /* @__PURE__ */ h(o, {
55
+ open: g,
56
+ onOpenChange: (e) => e ? _(!0) : V(),
57
+ title: z && B ? b.extractedTitle(B) : b.newTitle,
58
+ notice: z && !T ? /* @__PURE__ */ h(s, { onDismiss: () => E(!0) }) : void 0,
59
+ vendor: {
60
+ ...H,
61
+ testId: u.vendorSection
62
+ },
63
+ values: P.values,
64
+ errors: P.errors,
65
+ onChange: P.onChange,
66
+ lineItems: {
67
+ items: P.lineItemRows,
68
+ glCodeOptions: R,
69
+ discount: P.discount,
70
+ onDiscountChange: P.onDiscountChange,
71
+ tax: P.tax,
72
+ onTaxChange: P.onTaxChange,
73
+ total: P.total,
74
+ onTotalChange: P.onTotalChange,
75
+ onAddLineItem: P.onAddLineItem,
76
+ errors: P.lineItemErrors,
77
+ testId: u.lineItems
78
+ },
79
+ documentPanel: /* @__PURE__ */ h(c, {
80
+ payableId: k,
81
+ isDocumentPending: !!k && !N?.file && (A.isLoading || N?.ocr_status === "processing"),
82
+ file: N?.file ? {
83
+ id: N.file.id,
84
+ name: N.file.name,
85
+ url: N.file.url,
86
+ mimetype: N.file.mimetype
87
+ } : void 0
88
+ }),
89
+ isLineItemsLoading: j.isResolving,
90
+ isSavingDraft: L.isSavingDraft,
91
+ isFinalizing: L.isFinalizing,
92
+ onCancel: V,
93
+ onSaveDraft: L.saveDraft,
94
+ onFinalize: L.finalize,
95
+ testId: u.dialog
96
+ });
97
+ }
98
+ //#endregion
99
+ export { g as BillCreateDialog, g as default };
@@ -1,4 +1,4 @@
1
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js
2
- var e = { Mounted: "bill_pay_widget.mounted" }, t = "bill_pay_widget";
3
- //#endregion
4
- export { e as BillPayWidgetAnalyticsEvent, t as WIDGET_NAME };
1
+ import "./index2.js";
2
+ import "./index8.js";
3
+ import "./index10.js";
4
+ import "./index12.js";
@@ -1,43 +1,4 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
6
- import "../../../shared/feature/dist/index.js";
7
- import { BillPayWidgetAnalyticsEvent as t, WIDGET_NAME as n } from "./index13.js";
8
- import { Payables as r } from "../../../monite-sdk/dist/index431.js";
9
- import "../../../monite-sdk/dist/index.js";
10
- import { MoniteRegionProvider as i } from "../../../shared/monite-wrapper/feature/dist/lib/MoniteRegionProvider.js";
11
- import "../../../shared/monite-wrapper/feature/dist/index.js";
12
- import { useEffect as a } from "react";
13
- import { jsx as o } from "react/jsx-runtime";
14
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js
15
- var s = (e) => e;
16
- function c(n) {
17
- let i = e();
18
- return a(() => {
19
- i(t.Mounted);
20
- }, [i]), /* @__PURE__ */ o(r, { ...n });
21
- }
22
- function l({ baseUrl: e, widgetToken: t, organizationId: r, configClient: a, linkComponent: l, implementation: u, uiFramework: d, errorFallback: f, onError: p, finopsThemeColors: m, analytics: h, pageTitleComponent: g = s, ..._ }) {
23
- return /* @__PURE__ */ o(i, {
24
- widgetName: n,
25
- baseUrl: e,
26
- widgetToken: t,
27
- organizationId: r,
28
- configClient: a,
29
- linkComponent: l,
30
- implementation: u,
31
- uiFramework: d,
32
- errorFallback: f,
33
- onError: p,
34
- finopsThemeColors: m,
35
- analytics: h,
36
- children: /* @__PURE__ */ o(c, {
37
- ..._,
38
- pageTitleComponent: g
39
- })
40
- });
41
- }
2
+ var e = { Mounted: "bill_pay_widget.mounted" }, t = "bill_pay_widget";
42
3
  //#endregion
43
- export { l as BillPayWidgetMonite, l as default };
4
+ export { e as BillPayWidgetAnalyticsEvent, t as WIDGET_NAME };
@@ -1 +1,43 @@
1
- import "./index14.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
6
+ import "../../../shared/feature/dist/index.js";
7
+ import { BillPayWidgetAnalyticsEvent as t, WIDGET_NAME as n } from "./index14.js";
8
+ import { Payables as r } from "../../../monite-sdk/dist/index431.js";
9
+ import "../../../monite-sdk/dist/index.js";
10
+ import { MoniteRegionProvider as i } from "../../../shared/monite-wrapper/feature/dist/lib/MoniteRegionProvider.js";
11
+ import "../../../shared/monite-wrapper/feature/dist/index.js";
12
+ import { useEffect as a } from "react";
13
+ import { jsx as o } from "react/jsx-runtime";
14
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js
15
+ var s = (e) => e;
16
+ function c(n) {
17
+ let i = e();
18
+ return a(() => {
19
+ i(t.Mounted);
20
+ }, [i]), /* @__PURE__ */ o(r, { ...n });
21
+ }
22
+ function l({ baseUrl: e, widgetToken: t, organizationId: r, configClient: a, linkComponent: l, implementation: u, uiFramework: d, errorFallback: f, onError: p, finopsThemeColors: m, analytics: h, pageTitleComponent: g = s, ..._ }) {
23
+ return /* @__PURE__ */ o(i, {
24
+ widgetName: n,
25
+ baseUrl: e,
26
+ widgetToken: t,
27
+ organizationId: r,
28
+ configClient: a,
29
+ linkComponent: l,
30
+ implementation: u,
31
+ uiFramework: d,
32
+ errorFallback: f,
33
+ onError: p,
34
+ finopsThemeColors: m,
35
+ analytics: h,
36
+ children: /* @__PURE__ */ o(c, {
37
+ ..._,
38
+ pageTitleComponent: g
39
+ })
40
+ });
41
+ }
42
+ //#endregion
43
+ export { l as BillPayWidgetMonite, l as default };
@@ -1,50 +1 @@
1
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js
2
- var e = /* @__PURE__ */ new Set([
3
- "new",
4
- "approve_in_progress",
5
- "waiting_to_be_paid",
6
- "partially_paid"
7
- ]);
8
- function t(e, t) {
9
- let n = /* @__PURE__ */ new Date(`${e.slice(0, 10)}T00:00:00Z`), r = Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate());
10
- return n.getTime() < r;
11
- }
12
- function n(n, r, i = /* @__PURE__ */ new Date()) {
13
- if (e.has(n) && r && t(r, i)) return {
14
- status: "overdue",
15
- tone: "danger"
16
- };
17
- switch (n) {
18
- case "draft": return {
19
- status: "draft",
20
- tone: "neutral"
21
- };
22
- case "new":
23
- case "approve_in_progress": return {
24
- status: "pending_approval",
25
- tone: "warning"
26
- };
27
- case "waiting_to_be_paid": return {
28
- status: "ready_to_pay",
29
- tone: "info"
30
- };
31
- case "partially_paid": return {
32
- status: "partially_paid",
33
- tone: "success"
34
- };
35
- case "paid": return {
36
- status: "paid",
37
- tone: "success"
38
- };
39
- case "canceled": return {
40
- status: "canceled",
41
- tone: "neutral"
42
- };
43
- case "rejected": return {
44
- status: "rejected",
45
- tone: "danger"
46
- };
47
- }
48
- }
49
- //#endregion
50
- export { n as derivePayableStatus };
1
+ import "./index15.js";
@@ -1,8 +1,50 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js
2
- var e = {
3
- emptyHeading: "Add your first bill",
4
- nonEmptyHeading: "Add a bill",
5
- createButton: "Add bill"
6
- };
2
+ var e = /* @__PURE__ */ new Set([
3
+ "new",
4
+ "approve_in_progress",
5
+ "waiting_to_be_paid",
6
+ "partially_paid"
7
+ ]);
8
+ function t(e, t) {
9
+ let n = /* @__PURE__ */ new Date(`${e.slice(0, 10)}T00:00:00Z`), r = Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate());
10
+ return n.getTime() < r;
11
+ }
12
+ function n(n, r, i = /* @__PURE__ */ new Date()) {
13
+ if (e.has(n) && r && t(r, i)) return {
14
+ status: "overdue",
15
+ tone: "danger"
16
+ };
17
+ switch (n) {
18
+ case "draft": return {
19
+ status: "draft",
20
+ tone: "neutral"
21
+ };
22
+ case "new":
23
+ case "approve_in_progress": return {
24
+ status: "pending_approval",
25
+ tone: "warning"
26
+ };
27
+ case "waiting_to_be_paid": return {
28
+ status: "ready_to_pay",
29
+ tone: "info"
30
+ };
31
+ case "partially_paid": return {
32
+ status: "partially_paid",
33
+ tone: "success"
34
+ };
35
+ case "paid": return {
36
+ status: "paid",
37
+ tone: "success"
38
+ };
39
+ case "canceled": return {
40
+ status: "canceled",
41
+ tone: "neutral"
42
+ };
43
+ case "rejected": return {
44
+ status: "rejected",
45
+ tone: "danger"
46
+ };
47
+ }
48
+ }
7
49
  //#endregion
8
- export { e as BILLS_TAB_LABELS_EN };
50
+ export { n as derivePayableStatus };