@tesouro/embedded-components-react 0.5.224 → 0.5.226

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 (41) hide show
  1. package/README.md +335 -413
  2. package/dist/index.d.ts +23 -2
  3. package/dist/index.js +1 -1
  4. package/dist/lib/ReceivablesWidget.d.ts +23 -2
  5. package/dist/lib/ReceivablesWidget.js +1 -1
  6. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +4 -4
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +45 -31
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +51 -32
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +20 -1
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +17 -202
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +220 -31
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +32 -145
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +126 -44
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +145 -117
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index20.js +46 -58
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +113 -87
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js +58 -116
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +98 -225
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +111 -27
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js +225 -462
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js +34 -41
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index27.js +627 -34
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js +39 -77
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index29.js +34 -112
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index30.js +75 -310
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index31.js +124 -0
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js +324 -0
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index6.js +20 -15
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +56 -53
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +33 -29
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +184 -162
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +1 -3
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +78 -69
  35. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/CounterpartSelector.js +7 -6
  36. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js +20 -19
  37. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +39 -39
  38. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +210 -199
  39. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +60 -52
  40. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  41. package/package.json +1 -1
@@ -1,44 +1,37 @@
1
- import { formatMoney as e, getStatusTone as t } from "./index12.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useMyEntityQuery as e } from "../../../shared/data-access/dist/lib/useMyEntityQuery.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 { useCounterpartQuery as n } from "../../../shared/counterpart-management/data-access/dist/index3.js";
9
+ import "../../../shared/counterpart-management/feature/dist/index.js";
10
+ import "../../data-access/dist/index.js";
11
+ import { buildReceivablePreviewView as r } from "./index25.js";
12
+ import { useMemo as i } from "react";
2
13
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js
3
- var n = [
4
- "draft",
5
- "issued",
6
- "overdue",
7
- "partially_paid",
8
- "paid",
9
- "recurring",
10
- "canceled",
11
- "uncollectible"
12
- ];
13
- function r(e) {
14
- let t = n.indexOf(e);
15
- return t === -1 ? n.length : t;
16
- }
17
- function i({ counts: n, amounts: i, statusFilter: a, statusLabels: o, fallback: s }) {
18
- let c = new Map(Object.entries(o)), l = new Map(i.map((e) => [e.dimension_value, e.metric_value])), u = n.flatMap((e) => e.dimension_value ? [{
19
- status: e.dimension_value,
20
- count: e.metric_value
21
- }] : []), d = u.filter(({ status: e }) => e !== "recurring").reduce((e, { count: t }) => e + t, 0);
22
- return {
23
- kind: "ready",
24
- all: {
25
- value: "all",
26
- countLabel: String(d),
27
- selected: a === "all"
28
- },
29
- statuses: [...u].sort((e, t) => r(e.status) - r(t.status)).map(({ status: n, count: r }) => ({
30
- value: n,
31
- statusLabel: c.get(n) ?? o.unknown,
32
- statusTone: t(n),
33
- countLabel: String(r),
34
- amountLabel: e({
35
- amount: l.get(n) ?? 0,
36
- currency: "USD",
37
- fallback: s
38
- }),
39
- selected: a === n
40
- }))
41
- };
14
+ function a({ values: a, totals: o, billingAddress: s, unitNamesById: c, messages: l, enabled: u = !0 }) {
15
+ let d = e({ enabled: u }), f = n(u && a.customerId || void 0), p = t({ enabled: u }), m = d.data, h = f.data, g = p.data?.data;
16
+ return i(() => r({
17
+ values: a,
18
+ totals: o,
19
+ entity: m,
20
+ counterpart: h,
21
+ billingAddress: s,
22
+ paymentTerms: g,
23
+ unitNamesById: c,
24
+ messages: l
25
+ }), [
26
+ s,
27
+ h,
28
+ m,
29
+ l,
30
+ g,
31
+ o,
32
+ c,
33
+ a
34
+ ]);
42
35
  }
43
36
  //#endregion
44
- export { i as buildReceivableStatusCardsView };
37
+ export { a as useReceivablePreview };