@tesouro/embedded-components-react 0.11.100 → 0.11.102

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 (71) hide show
  1. package/dist/experimental/QuickViewWidget.d.ts +62 -2
  2. package/dist/experimental/index.d.ts +62 -2
  3. package/dist/index.css +21 -17
  4. package/dist/index.d.ts +10 -6
  5. package/dist/lib/CardDetailsWidget.d.ts +6 -4
  6. package/dist/lib/CreditCardsWidget.d.ts +6 -4
  7. package/dist/lib/DebitCardsWidget.d.ts +6 -4
  8. package/dist/lib/SettingsWidget.d.ts +2 -1
  9. package/dist/lib/WidgetSuite.d.ts +8 -5
  10. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +199 -168
  11. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +1 -0
  12. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +44 -43
  13. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index.js +1 -1
  14. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index3.js +9 -9
  15. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index4.js +2 -2
  16. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index6.js +25 -284
  17. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index7.js +291 -0
  18. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index.js +3 -3
  19. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index3.js +28 -17
  20. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index5.js +21 -34
  21. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index6.js +71 -78
  22. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index7.js +71 -77
  23. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index8.js +43 -49
  24. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index.js +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index2.js +8 -1
  26. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/accounts/ui/dist/index2.js +1 -1
  27. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/bills/ui/dist/index2.js +1 -1
  28. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/data-access/dist/index.js +1 -0
  29. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/data-access/dist/index2.js +98 -0
  30. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/index.js +3 -0
  31. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/CardsQuickViewWidgetFeature.js +80 -0
  32. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/labels.js +27 -0
  33. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/summarizeCardSpend.js +17 -0
  34. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/testIds.js +7 -0
  35. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/useCardSpendSummary.js +29 -0
  36. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/analytics/events.js +4 -0
  37. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/ui/dist/index.js +3 -0
  38. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/ui/dist/index2.js +8 -0
  39. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/ui/dist/index3.js +31 -0
  40. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/feature/dist/lib/QuickViewWidget/QuickViewWidget.js +57 -44
  41. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/feature/dist/lib/QuickViewWidget/labels.js +6 -3
  42. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/invoices/ui/dist/index2.js +1 -1
  43. package/dist/libs/tesouro-embedded-components-react/settings-widget/chart-of-accounts/ui/dist/index3.js +98 -91
  44. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/lib/ExpenseSettingsTabs/ExpenseSettingsTabs.js +24 -21
  45. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/lib/SettingsWidget/SettingsWidget.js +14 -8
  46. package/dist/libs/tesouro-embedded-components-react/settings-widget/help/ui/shadcn/dist/index3.js +2 -2
  47. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index10.js +87 -81
  48. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index3.js +63 -44
  49. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index6.js +9 -6
  50. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index17.js +302 -276
  51. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index.js +10 -10
  52. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index12.js +36 -36
  53. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index17.js +27 -13
  54. package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/SettingsSectionContent.js +22 -0
  55. package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/SettingsWidgetUi.js +6 -7
  56. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/ApprovalPoliciesSettings.js +39 -37
  57. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index.js +9 -9
  58. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index11.js +39 -35
  59. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index16.js +59 -61
  60. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index4.js +2 -2
  61. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index6.js +2 -2
  62. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index7.js +3 -3
  63. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +114 -103
  64. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +43 -43
  65. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/debit-card/useAllDebitCardsQuery.js +22 -18
  66. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +97 -97
  67. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +166 -154
  68. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  69. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/index.js +12 -12
  70. package/dist/packages/shared-ui-shadcn/dist/index.js +18 -15
  71. package/package.json +1 -1
@@ -0,0 +1,17 @@
1
+ // ../../libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/summarizeCardSpend.js
2
+ var e = ["PENDING", "SETTLED"], t = (e) => {
3
+ let t = new Date(e);
4
+ return `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}`;
5
+ }, n = (e) => e.settledAmount ?? e.authorizedAmount;
6
+ function r({ cards: r, transactions: i }, a) {
7
+ let o = a.slice(0, 7), s = i.filter((r) => e.includes(r.state) && n(r).currencyCode === "USD" && t(r.authorizedAt) === o).reduce((e, t) => {
8
+ let r = Number(n(t).value);
9
+ return t.type === "REFUND" ? e - r : e + r;
10
+ }, 0);
11
+ return {
12
+ hasCards: r.length > 0,
13
+ cardCount: r.filter((e) => e.cardStatus !== "CLOSED").length,
14
+ spendAmount: s
15
+ };
16
+ }
17
+ export { r as summarizeCardSpend };
@@ -0,0 +1,7 @@
1
+ // ../../libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/testIds.js
2
+ var e = {
3
+ tile: "cards-quick-view-widget-tile",
4
+ skeleton: "cards-quick-view-widget-skeleton",
5
+ error: "cards-quick-view-widget-error"
6
+ };
7
+ export { e as cardsQuickViewWidgetTestIds };
@@ -0,0 +1,29 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useEmbedApi as e } from "../../../../../../shared/data-access/dist/lib/EmbedApiContext.js";
6
+ import "../../../../../../shared/data-access/dist/index.js";
7
+ import { useLocalCalendarDay as t } from "../../../../../../shared/feature/dist/lib/calendar/useLocalCalendarDay.js";
8
+ import "../../../../../../shared/feature/dist/index.js";
9
+ import { summarizeCardSpend as n } from "./summarizeCardSpend.js";
10
+ import { useCardSpendReads as r } from "../../../../data-access/dist/index2.js";
11
+ import "../../../../data-access/dist/index.js";
12
+ import { useMemo as i, useState as a } from "react";
13
+ // ../../libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/useCardSpendSummary.js
14
+ var o = (e, t) => Object.keys(e).every((n) => e[n] === t[n]);
15
+ function s({ enabled: s } = {}) {
16
+ let c = t(), l = r({ enabled: s }), { organizationId: u, authEpoch: d } = e(), f = i(() => l.data && c ? n(l.data, c) : void 0, [l.data, c]), [p, m] = a(), h = c?.slice(0, 7), g = p !== void 0 && p.organizationId === u && p.authEpoch === d && p.month === h, _ = f !== void 0 && (!l.isFetching && !l.isError || !g), v = g ? p.summary : f;
17
+ return _ && !(g && o(p.summary, f)) && (m({
18
+ organizationId: u,
19
+ authEpoch: d,
20
+ month: h,
21
+ summary: f
22
+ }), v = f), {
23
+ ...l,
24
+ data: v,
25
+ today: c,
26
+ isLoading: (l.isLoading || c === void 0) && !v
27
+ };
28
+ }
29
+ export { s as useCardSpendSummary };
@@ -0,0 +1,4 @@
1
+ import { QUICK_VIEW_WIDGET_NAME as e } from "../../../../../shared/util/dist/lib/widgetName.js";
2
+ // ../../libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/analytics/events.js
3
+ var t = `${e}.cards_quick_view_widget`, n = { Mounted: `${t}.mounted` };
4
+ export { n as CardsQuickViewWidgetAnalyticsEvent, t as WIDGET_NAME };
@@ -0,0 +1,3 @@
1
+ import { CARDS_QUICK_VIEW_TILE_LABELS_EN as e } from "./index2.js";
2
+ import { CardsQuickViewTile as t } from "./index3.js";
3
+ export { e as CARDS_QUICK_VIEW_TILE_LABELS_EN, t as CardsQuickViewTile };
@@ -0,0 +1,8 @@
1
+ // ../../libs/tesouro-embedded-components-react/quick-view-widget/cards/ui/dist/index2.js
2
+ var e = {
3
+ title: "Card spend · this month",
4
+ loadingLabel: "Loading card spend",
5
+ loadErrorTitle: "Couldn't load card spend",
6
+ loadErrorRetry: "Try again"
7
+ };
8
+ export { e as CARDS_QUICK_VIEW_TILE_LABELS_EN };
@@ -0,0 +1,31 @@
1
+ import { QuickViewTile as e } from "../../../../shared/quick-view/ui/dist/index3.js";
2
+ import "../../../../shared/quick-view/ui/dist/index.js";
3
+ import { CARDS_QUICK_VIEW_TILE_LABELS_EN as t } from "./index2.js";
4
+ import { jsx as n } from "react/jsx-runtime";
5
+ // ../../libs/tesouro-embedded-components-react/quick-view-widget/cards/ui/dist/index3.js
6
+ function r({ title: r, value: i, subtext: a, linkText: o, onClick: s, ariaLabel: c, isLoading: l, isError: u, onRetry: d, labels: f, testIds: p, className: m, style: h }) {
7
+ let g = {
8
+ ...t,
9
+ ...f
10
+ };
11
+ return /* @__PURE__ */ n(e, {
12
+ title: r ?? g.title,
13
+ value: i,
14
+ subtext: a,
15
+ linkText: o,
16
+ onClick: s,
17
+ ariaLabel: c,
18
+ isLoading: l,
19
+ isError: u,
20
+ onRetry: d,
21
+ labels: {
22
+ loadingLabel: g.loadingLabel,
23
+ loadErrorTitle: g.loadErrorTitle,
24
+ loadErrorRetry: g.loadErrorRetry
25
+ },
26
+ testIds: p,
27
+ className: m,
28
+ style: h
29
+ });
30
+ }
31
+ export { r as CardsQuickViewTile };
@@ -8,65 +8,78 @@ import { InvoicesQuickViewWidget as t } from "../../../../invoices/feature/dist/
8
8
  import "../../../../invoices/feature/dist/index.js";
9
9
  import { BillsQuickViewWidget as n } from "../../../../bills/feature/dist/lib/BillsQuickViewWidget/BillsQuickViewWidgetFeature.js";
10
10
  import "../../../../bills/feature/dist/index.js";
11
- import { useEffect as r } from "react";
12
- import { jsx as i } from "react/jsx-runtime";
11
+ import { CardsQuickViewWidget as r } from "../../../../cards/feature/dist/lib/CardsQuickViewWidget/CardsQuickViewWidgetFeature.js";
12
+ import "../../../../cards/feature/dist/index.js";
13
+ import { useEffect as i } from "react";
14
+ import { jsx as a } from "react/jsx-runtime";
13
15
  // ../../libs/tesouro-embedded-components-react/quick-view-widget/feature/dist/lib/QuickViewWidget/QuickViewWidget.js
14
- var a = {
16
+ var o = {
15
17
  Accounts: "accounts",
16
18
  Invoices: "invoices",
17
- Bills: "bills"
18
- }, o = {
19
+ Bills: "bills",
20
+ Cards: "cards"
21
+ }, s = {
19
22
  accounts: ["onViewAccountsClick"],
20
23
  invoices: ["onViewInvoicesClick", "onCreateInvoiceClick"],
21
- bills: ["onViewBillsClick", "onAddBillClick"]
22
- }, s = [
24
+ bills: ["onViewBillsClick", "onAddBillClick"],
25
+ cards: ["onViewCardsClick"]
26
+ }, c = [
23
27
  "onViewAccountsClick",
24
28
  "onViewInvoicesClick",
25
29
  "onCreateInvoiceClick",
26
30
  "onViewBillsClick",
27
- "onAddBillClick"
31
+ "onAddBillClick",
32
+ "onViewCardsClick"
28
33
  ];
29
- function c(e) {
30
- return Object.values(a).includes(e);
34
+ function l(e) {
35
+ return Object.values(o).includes(e);
31
36
  }
32
- function l(e, t) {
33
- let n = c(e) ? o[e] : [], i = s.filter((e) => t[e] !== void 0 && !n.includes(e)).join(", ");
34
- r(() => {
35
- c(e) ? i && console.warn(`[tesouro-embedded] QuickViewWidget: ${i} ${i.includes(",") ? "do" : "does"} not apply to type="${e}" and will never be called. type="${e}" uses: ${o[e].join(", ")}.`) : console.warn(`[tesouro-embedded] QuickViewWidget: unknown type "${String(e)}". Expected one of: ${Object.values(a).join(", ")}. Rendering nothing.`);
36
- }, [e, i]);
37
+ function u(e, t) {
38
+ let n = l(e) ? s[e] : [], r = c.filter((e) => t[e] !== void 0 && !n.includes(e)).join(", ");
39
+ i(() => {
40
+ l(e) ? r && console.warn(`[tesouro-embedded] QuickViewWidget: ${r} ${r.includes(",") ? "do" : "does"} not apply to type="${e}" and will never be called. type="${e}" uses: ${s[e].join(", ")}.`) : console.warn(`[tesouro-embedded] QuickViewWidget: unknown type "${String(e)}". Expected one of: ${Object.values(o).join(", ")}. Rendering nothing.`);
41
+ }, [e, r]);
37
42
  }
38
- function u({ type: r, labels: o, onViewAccountsClick: s, onViewInvoicesClick: c, onCreateInvoiceClick: u, onViewBillsClick: d, onAddBillClick: f, className: p, style: m, ...h }) {
39
- switch (l(r, {
40
- onViewAccountsClick: s,
41
- onViewInvoicesClick: c,
42
- onCreateInvoiceClick: u,
43
- onViewBillsClick: d,
44
- onAddBillClick: f
45
- }), r) {
46
- case a.Accounts: return /* @__PURE__ */ i(e, {
47
- ...h,
48
- labels: o?.accounts,
49
- onViewAccountsClick: s,
50
- className: p,
51
- style: m
43
+ function d({ type: i, labels: s, onViewAccountsClick: c, onViewInvoicesClick: l, onCreateInvoiceClick: d, onViewBillsClick: f, onAddBillClick: p, onViewCardsClick: m, className: h, style: g, ..._ }) {
44
+ switch (u(i, {
45
+ onViewAccountsClick: c,
46
+ onViewInvoicesClick: l,
47
+ onCreateInvoiceClick: d,
48
+ onViewBillsClick: f,
49
+ onAddBillClick: p,
50
+ onViewCardsClick: m
51
+ }), i) {
52
+ case o.Accounts: return /* @__PURE__ */ a(e, {
53
+ ..._,
54
+ labels: s?.accounts,
55
+ onViewAccountsClick: c,
56
+ className: h,
57
+ style: g
52
58
  });
53
- case a.Invoices: return /* @__PURE__ */ i(t, {
54
- ...h,
55
- labels: o?.invoices,
56
- onViewInvoicesClick: c,
57
- onCreateInvoiceClick: u,
58
- className: p,
59
- style: m
59
+ case o.Invoices: return /* @__PURE__ */ a(t, {
60
+ ..._,
61
+ labels: s?.invoices,
62
+ onViewInvoicesClick: l,
63
+ onCreateInvoiceClick: d,
64
+ className: h,
65
+ style: g
60
66
  });
61
- case a.Bills: return /* @__PURE__ */ i(n, {
62
- ...h,
63
- labels: o?.bills,
64
- onViewBillsClick: d,
65
- onAddBillClick: f,
66
- className: p,
67
- style: m
67
+ case o.Bills: return /* @__PURE__ */ a(n, {
68
+ ..._,
69
+ labels: s?.bills,
70
+ onViewBillsClick: f,
71
+ onAddBillClick: p,
72
+ className: h,
73
+ style: g
74
+ });
75
+ case o.Cards: return /* @__PURE__ */ a(r, {
76
+ ..._,
77
+ labels: s?.cards,
78
+ onViewCardsClick: m,
79
+ className: h,
80
+ style: g
68
81
  });
69
82
  default: return null;
70
83
  }
71
84
  }
72
- export { o as QUICK_VIEW_CLICK_HANDLERS, a as QuickViewType, u as QuickViewWidget };
85
+ export { s as QUICK_VIEW_CLICK_HANDLERS, o as QuickViewType, d as QuickViewWidget };
@@ -4,10 +4,13 @@ import { INVOICES_QUICK_VIEW_WIDGET_LABELS_EN as t } from "../../../../invoices/
4
4
  import "../../../../invoices/feature/dist/index.js";
5
5
  import { BILLS_QUICK_VIEW_WIDGET_LABELS_EN as n } from "../../../../bills/feature/dist/lib/BillsQuickViewWidget/labels.js";
6
6
  import "../../../../bills/feature/dist/index.js";
7
+ import { CARDS_QUICK_VIEW_WIDGET_LABELS_EN as r } from "../../../../cards/feature/dist/lib/CardsQuickViewWidget/labels.js";
8
+ import "../../../../cards/feature/dist/index.js";
7
9
  // ../../libs/tesouro-embedded-components-react/quick-view-widget/feature/dist/lib/QuickViewWidget/labels.js
8
- var r = {
10
+ var i = {
9
11
  accounts: e,
10
12
  invoices: t,
11
- bills: n
13
+ bills: n,
14
+ cards: r
12
15
  };
13
- export { r as QUICK_VIEW_WIDGET_LABELS_EN };
16
+ export { i as QUICK_VIEW_WIDGET_LABELS_EN };
@@ -3,6 +3,6 @@ var e = {
3
3
  title: "Open invoices",
4
4
  loadingLabel: "Loading invoices",
5
5
  loadErrorTitle: "Couldn't load invoices",
6
- loadErrorRetry: "Retry"
6
+ loadErrorRetry: "Try again"
7
7
  };
8
8
  export { e as INVOICES_QUICK_VIEW_TILE_LABELS_EN };
@@ -3,59 +3,66 @@ import { EmptyState as p } from "../../../../shared/ui/dist/lib/EmptyState/Empty
3
3
  import { ErrorState as m } from "../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
4
4
  import "../../../../shared/ui/dist/index.js";
5
5
  import { CHART_OF_ACCOUNTS_LABELS_EN as h } from "./index2.js";
6
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
7
- import { ArrowDownIcon as y, ArrowUpDownIcon as b, ArrowUpIcon as x, MoreVerticalIcon as S, PencilIcon as C, Trash2Icon as w } from "lucide-react";
6
+ import { createPortal as g } from "react-dom";
7
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
8
+ import { ArrowDownIcon as b, ArrowUpDownIcon as x, ArrowUpIcon as S, MoreVerticalIcon as C, PencilIcon as w, Trash2Icon as T } from "lucide-react";
8
9
  // ../../libs/tesouro-embedded-components-react/settings-widget/chart-of-accounts/ui/dist/index3.js
9
- function T({ data: T, isLoading: E, isError: D, sorting: O, onSortingChange: k, pageSize: A, onPageSizeChange: j, pageSizeOptions: M, hasNextPage: N, hasPrevPage: P, onNextPage: F, onPrevPage: I, labels: L, emptyStateTestId: R, onEdit: z, onDelete: B, onAdd: V }) {
10
- let H = {
10
+ function E({ headerStart: E, headerActionContainer: D, data: O, isLoading: k, isError: A, sorting: j, onSortingChange: M, pageSize: N, onPageSizeChange: P, pageSizeOptions: F, hasNextPage: I, hasPrevPage: L, onNextPage: R, onPrevPage: z, labels: B, emptyStateTestId: V, onEdit: H, onDelete: U, onAdd: W }) {
11
+ let G = {
11
12
  ...h,
12
- ...L
13
- }, U = !!(z ?? B), W = H.subtitle ? /* @__PURE__ */ _("div", {
14
- className: "ttw:mb-4",
15
- children: /* @__PURE__ */ _("p", {
16
- className: "ttw:text-sm ttw:text-muted-foreground",
17
- children: H.subtitle
18
- })
19
- }) : null, G = T.length === 0 && !P, K = /* @__PURE__ */ v(g, { children: [W, V && !G && /* @__PURE__ */ _("div", {
20
- className: "ttw:mb-4 ttw:flex ttw:items-center ttw:justify-end",
21
- children: /* @__PURE__ */ _(e, {
22
- onClick: V,
23
- children: H.addAccount
24
- })
25
- })] }), q = (t) => t.is_external ? null : /* @__PURE__ */ _("div", {
13
+ ...B
14
+ }, K = !!(H ?? U), q = G.subtitle ? /* @__PURE__ */ v("p", {
15
+ className: "ttw:text-sm ttw:text-muted-foreground",
16
+ children: G.subtitle
17
+ }) : null, J = O.length === 0 && !L, Y = W && !J ? /* @__PURE__ */ v(e, {
18
+ size: "sm",
19
+ className: "ttw:ml-auto ttw:shrink-0",
20
+ onClick: W,
21
+ children: G.addAccount
22
+ }) : null, X = /* @__PURE__ */ y("div", {
23
+ className: "ttw:mb-4 ttw:flex ttw:flex-col ttw:gap-2",
24
+ children: [
25
+ D ? g(Y, D) : null,
26
+ E || D === void 0 && Y ? /* @__PURE__ */ y("div", {
27
+ className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:justify-between ttw:gap-4",
28
+ children: [E, D === void 0 ? Y : null]
29
+ }) : null,
30
+ q
31
+ ]
32
+ }), Z = (t) => t.is_external ? null : /* @__PURE__ */ v("div", {
26
33
  className: "ttw:flex ttw:justify-end",
27
- children: /* @__PURE__ */ v(i, { children: [/* @__PURE__ */ _(d, { children: /* @__PURE__ */ v(l, { children: [/* @__PURE__ */ _(f, {
34
+ children: /* @__PURE__ */ y(i, { children: [/* @__PURE__ */ v(d, { children: /* @__PURE__ */ y(l, { children: [/* @__PURE__ */ v(f, {
28
35
  asChild: !0,
29
- children: /* @__PURE__ */ _(c, {
36
+ children: /* @__PURE__ */ v(c, {
30
37
  asChild: !0,
31
- children: /* @__PURE__ */ _(e, {
38
+ children: /* @__PURE__ */ v(e, {
32
39
  variant: "ghost",
33
40
  size: "icon-sm",
34
- "aria-label": H.openActionsMenu,
41
+ "aria-label": G.openActionsMenu,
35
42
  onClick: (e) => e.stopPropagation(),
36
- children: /* @__PURE__ */ _(S, { className: "ttw:h-4 ttw:w-4" })
43
+ children: /* @__PURE__ */ v(C, { className: "ttw:h-4 ttw:w-4" })
37
44
  })
38
45
  })
39
- }), /* @__PURE__ */ _(u, { children: H.openActionsMenu })] }) }), /* @__PURE__ */ v(a, {
46
+ }), /* @__PURE__ */ v(u, { children: G.openActionsMenu })] }) }), /* @__PURE__ */ y(a, {
40
47
  align: "end",
41
48
  onClick: (e) => e.stopPropagation(),
42
49
  children: [
43
- z && /* @__PURE__ */ v(o, {
44
- onClick: () => z(t),
45
- children: [/* @__PURE__ */ _(C, { className: "ttw:mr-2 ttw:h-4 ttw:w-4" }), H.actionEdit]
50
+ H && /* @__PURE__ */ y(o, {
51
+ onClick: () => H(t),
52
+ children: [/* @__PURE__ */ v(w, { className: "ttw:mr-2 ttw:h-4 ttw:w-4" }), G.actionEdit]
46
53
  }),
47
- z && B && /* @__PURE__ */ _(s, {}),
48
- B && /* @__PURE__ */ v(o, {
54
+ H && U && /* @__PURE__ */ v(s, {}),
55
+ U && /* @__PURE__ */ y(o, {
49
56
  variant: "destructive",
50
- onClick: () => B(t),
51
- children: [/* @__PURE__ */ _(w, { className: "ttw:mr-2 ttw:h-4 ttw:w-4" }), H.actionDelete]
57
+ onClick: () => U(t),
58
+ children: [/* @__PURE__ */ v(T, { className: "ttw:mr-2 ttw:h-4 ttw:w-4" }), G.actionDelete]
52
59
  })
53
60
  ]
54
61
  })] })
55
- }), J = [
62
+ }), Q = [
56
63
  {
57
64
  accessorKey: "nominal_code",
58
- header: H.columnGlCode,
65
+ header: G.columnGlCode,
59
66
  meta: { fitContent: !0 }
60
67
  },
61
68
  {
@@ -63,105 +70,105 @@ function T({ data: T, isLoading: E, isError: D, sorting: O, onSortingChange: k,
63
70
  enableSorting: !0,
64
71
  header: ({ column: t }) => {
65
72
  let n = t.getIsSorted();
66
- return /* @__PURE__ */ v("div", {
73
+ return /* @__PURE__ */ y("div", {
67
74
  className: "ttw:flex ttw:items-center ttw:gap-2 ttw:text-inherit",
68
- children: [H.columnName, /* @__PURE__ */ _(e, {
75
+ children: [G.columnName, /* @__PURE__ */ v(e, {
69
76
  variant: "ghost",
70
- "aria-label": H.sortByName,
77
+ "aria-label": G.sortByName,
71
78
  onClick: () => t.toggleSorting(n === "asc"),
72
- children: _(n === "asc" ? x : n === "desc" ? y : b, { className: "ttw:size-4" })
79
+ children: v(n === "asc" ? S : n === "desc" ? b : x, { className: "ttw:size-4" })
73
80
  })]
74
81
  });
75
82
  }
76
83
  },
77
84
  {
78
85
  accessorKey: "description",
79
- header: H.columnDescription,
80
- cell: ({ row: e }) => /* @__PURE__ */ _("span", {
86
+ header: G.columnDescription,
87
+ cell: ({ row: e }) => /* @__PURE__ */ v("span", {
81
88
  className: "ttw:block ttw:max-w-50 ttw:truncate",
82
89
  title: e.original.description,
83
90
  children: e.original.description
84
91
  })
85
92
  },
86
- ...U ? [{
93
+ ...K ? [{
87
94
  id: "actions",
88
- header: () => /* @__PURE__ */ _("div", {
95
+ header: () => /* @__PURE__ */ v("div", {
89
96
  className: "ttw:flex ttw:justify-end",
90
- children: H.columnActions
97
+ children: G.columnActions
91
98
  }),
92
- cell: ({ row: e }) => q(e.original),
99
+ cell: ({ row: e }) => Z(e.original),
93
100
  meta: { fitContent: !0 }
94
101
  }] : []
95
- ], Y = z ? {
96
- onRowClick: (e) => z(e),
97
- rowAriaLabel: (e) => `${H.editAccount}: ${e.name}, ${e.nominal_code}`,
102
+ ], $ = H ? {
103
+ onRowClick: (e) => H(e),
104
+ rowAriaLabel: (e) => `${G.editAccount}: ${e.name}, ${e.nominal_code}`,
98
105
  isRowActionable: (e) => !e.is_external
99
106
  } : {};
100
- return /* @__PURE__ */ v(g, { children: [K, /* @__PURE__ */ _(r, {
101
- columns: J,
102
- data: D ? [] : T,
103
- sorting: O,
104
- onSortingChange: k,
105
- pageSize: A,
106
- onPageSizeChange: j,
107
- pageSizeOptions: M,
108
- hasNextPage: N,
109
- hasPrevPage: P,
110
- onNextPage: F,
111
- onPrevPage: I,
112
- showPagination: T.length > 0 || !!P,
113
- isLoading: !(!E || T.length !== 0 || D),
107
+ return /* @__PURE__ */ y(_, { children: [X, /* @__PURE__ */ v(r, {
108
+ columns: Q,
109
+ data: A ? [] : O,
110
+ sorting: j,
111
+ onSortingChange: M,
112
+ pageSize: N,
113
+ onPageSizeChange: P,
114
+ pageSizeOptions: F,
115
+ hasNextPage: I,
116
+ hasPrevPage: L,
117
+ onNextPage: R,
118
+ onPrevPage: z,
119
+ showPagination: O.length > 0 || !!L,
120
+ isLoading: !(!k || O.length !== 0 || A),
114
121
  labels: {
115
- loading: H.loading,
116
- previousPage: H.paginationPrev,
117
- nextPage: H.paginationNext
122
+ loading: G.loading,
123
+ previousPage: G.paginationPrev,
124
+ nextPage: G.paginationNext
118
125
  },
119
126
  getRowId: (e) => e.id,
120
- ...Y,
121
- rowContextMenu: (e) => !e.is_external && (z || B) ? /* @__PURE__ */ v(g, { children: [
122
- z && /* @__PURE__ */ _(t, {
123
- onClick: () => z(e),
124
- children: H.actionEdit
127
+ ...$,
128
+ rowContextMenu: (e) => !e.is_external && (H || U) ? /* @__PURE__ */ y(_, { children: [
129
+ H && /* @__PURE__ */ v(t, {
130
+ onClick: () => H(e),
131
+ children: G.actionEdit
125
132
  }),
126
- z && B && /* @__PURE__ */ _(n, {}),
127
- B && /* @__PURE__ */ _(t, {
133
+ H && U && /* @__PURE__ */ v(n, {}),
134
+ U && /* @__PURE__ */ v(t, {
128
135
  variant: "destructive",
129
- onClick: () => B(e),
130
- children: H.actionDelete
136
+ onClick: () => U(e),
137
+ children: G.actionDelete
131
138
  })
132
139
  ] }) : void 0,
133
- renderCard: !D && T.length > 0 ? (e) => /* @__PURE__ */ v("div", {
140
+ renderCard: !A && O.length > 0 ? (e) => /* @__PURE__ */ y("div", {
134
141
  className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-4",
135
- children: [/* @__PURE__ */ v("div", {
142
+ children: [/* @__PURE__ */ y("div", {
136
143
  className: "ttw:flex ttw:min-w-0 ttw:flex-col ttw:gap-1",
137
144
  children: [
138
- /* @__PURE__ */ _("span", {
145
+ /* @__PURE__ */ v("span", {
139
146
  className: "ttw:truncate ttw:font-medium",
140
147
  title: e.name,
141
148
  children: e.name
142
149
  }),
143
- /* @__PURE__ */ _("span", { children: e.nominal_code }),
144
- /* @__PURE__ */ _("span", {
150
+ /* @__PURE__ */ v("span", { children: e.nominal_code }),
151
+ /* @__PURE__ */ v("span", {
145
152
  className: "ttw:truncate ttw:text-muted-foreground",
146
153
  title: e.description,
147
154
  children: e.description
148
155
  })
149
156
  ]
150
- }), U && q(e)]
157
+ }), K && Z(e)]
151
158
  }) : void 0,
152
- children: D ? /* @__PURE__ */ _(m, {
153
- title: H.errorTitle,
154
- description: H.errorDescription
155
- }) : P ? /* @__PURE__ */ _(p, {
156
- title: H.emptyPageTitle,
157
- description: H.emptyPageDescription
158
- }) : /* @__PURE__ */ _(p, {
159
- title: H.emptyTitle,
160
- description: H.emptyDescription,
161
- actionLabel: H.addAccount,
162
- onAction: V,
163
- testId: R
159
+ children: A ? /* @__PURE__ */ v(m, {
160
+ title: G.errorTitle,
161
+ description: G.errorDescription
162
+ }) : L ? /* @__PURE__ */ v(p, {
163
+ title: G.emptyPageTitle,
164
+ description: G.emptyPageDescription
165
+ }) : /* @__PURE__ */ v(p, {
166
+ title: G.emptyTitle,
167
+ description: G.emptyDescription,
168
+ actionLabel: G.addAccount,
169
+ onAction: W,
170
+ testId: V
164
171
  })
165
172
  })] });
166
173
  }
167
- export { T as ChartOfAccountsTable, T as default };
174
+ export { E as ChartOfAccountsTable, E as default };
@@ -3,42 +3,45 @@
3
3
  "use client";
4
4
  "use client";
5
5
  import { Tabs as e, TabsContent as t, TabsList as n, TabsTrigger as r } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { ExpenseApprovalPoliciesWidget as i } from "../../../../../expense-management-widget/approval-policies/feature/dist/index6.js";
6
+ import { ExpenseApprovalPoliciesWidget as i } from "../../../../../expense-management-widget/approval-policies/feature/dist/index7.js";
7
7
  import "../../../../../expense-management-widget/feature/dist/index.js";
8
8
  import { ExpenseRequirementsWidget as a } from "../../../../../shared/expense-requirements/feature/dist/lib/ExpenseRequirementsWidget.js";
9
9
  import "../../../../../shared/expense-requirements/feature/dist/index.js";
10
10
  import { useState as o } from "react";
11
11
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
12
12
  // ../../libs/tesouro-embedded-components-react/settings-widget/feature/dist/lib/ExpenseSettingsTabs/ExpenseSettingsTabs.js
13
- function l({ approvalsLabel: l, requirementsLabel: u }) {
14
- let [d, f] = o("approvals"), [p, m] = o(null);
15
- return /* @__PURE__ */ s("div", {
16
- className: "ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:p-6",
17
- children: /* @__PURE__ */ c(e, {
18
- value: d,
19
- onValueChange: f,
20
- className: "ttw:flex ttw:w-full ttw:flex-col ttw:gap-4",
13
+ function l({ headerStart: l, headerActionContainer: u, approvalsLabel: d, requirementsLabel: f }) {
14
+ let [p, m] = o("approvals"), [h, g] = o(null);
15
+ return /* @__PURE__ */ c(e, {
16
+ value: p,
17
+ onValueChange: m,
18
+ className: "ttw:w-full ttw:gap-4",
19
+ children: [u === void 0 ? /* @__PURE__ */ c("header", {
20
+ className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:justify-between ttw:gap-4",
21
+ children: [l, /* @__PURE__ */ s("div", {
22
+ ref: g,
23
+ className: "ttw:ml-auto ttw:shrink-0"
24
+ })]
25
+ }) : null, /* @__PURE__ */ c("div", {
26
+ className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:p-6",
21
27
  children: [
22
- /* @__PURE__ */ c("div", {
23
- className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-4",
24
- children: [/* @__PURE__ */ c(n, { children: [/* @__PURE__ */ s(r, {
25
- value: "approvals",
26
- children: l
27
- }), /* @__PURE__ */ s(r, {
28
- value: "requirements",
29
- children: u
30
- })] }), /* @__PURE__ */ s("div", { ref: m })]
31
- }),
28
+ /* @__PURE__ */ c(n, { children: [/* @__PURE__ */ s(r, {
29
+ value: "approvals",
30
+ children: d
31
+ }), /* @__PURE__ */ s(r, {
32
+ value: "requirements",
33
+ children: f
34
+ })] }),
32
35
  /* @__PURE__ */ s(t, {
33
36
  value: "approvals",
34
- children: /* @__PURE__ */ s(i, { headerActionContainer: p })
37
+ children: /* @__PURE__ */ s(i, { headerActionContainer: u === void 0 ? h : u })
35
38
  }),
36
39
  /* @__PURE__ */ s(t, {
37
40
  value: "requirements",
38
41
  children: /* @__PURE__ */ s(a, {})
39
42
  })
40
43
  ]
41
- })
44
+ })]
42
45
  });
43
46
  }
44
47
  export { l as ExpenseSettingsTabs, l as default };