@tesouro/embedded-components-react 0.11.101 → 0.11.104

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 (50) hide show
  1. package/dist/index.css +21 -17
  2. package/dist/index.d.ts +10 -6
  3. package/dist/lib/CardDetailsWidget.d.ts +6 -4
  4. package/dist/lib/CreditCardsWidget.d.ts +6 -4
  5. package/dist/lib/DebitCardsWidget.d.ts +6 -4
  6. package/dist/lib/SettingsWidget.d.ts +2 -1
  7. package/dist/lib/WidgetSuite.d.ts +8 -5
  8. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +199 -168
  9. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +1 -0
  10. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +44 -43
  11. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +56 -52
  12. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +68 -63
  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/settings-widget/chart-of-accounts/ui/dist/index3.js +98 -91
  27. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/lib/ExpenseSettingsTabs/ExpenseSettingsTabs.js +24 -21
  28. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/lib/SettingsWidget/SettingsWidget.js +14 -8
  29. package/dist/libs/tesouro-embedded-components-react/settings-widget/help/ui/shadcn/dist/index3.js +2 -2
  30. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index10.js +87 -81
  31. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index3.js +63 -44
  32. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index6.js +9 -6
  33. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index17.js +302 -276
  34. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index.js +10 -10
  35. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index12.js +36 -36
  36. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index17.js +27 -13
  37. package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/SettingsSectionContent.js +22 -0
  38. package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/SettingsWidgetUi.js +6 -7
  39. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/ApprovalPoliciesSettings.js +39 -37
  40. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index.js +9 -9
  41. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index11.js +39 -35
  42. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index16.js +59 -61
  43. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index4.js +2 -2
  44. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index6.js +2 -2
  45. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index7.js +3 -3
  46. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +114 -103
  47. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  48. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/index.js +12 -12
  49. package/dist/packages/shared-ui-shadcn/dist/index.js +18 -15
  50. package/package.json +1 -1
@@ -19,95 +19,96 @@ import { useCounterpartsWidget as u } from "./useCounterpartsWidget.js";
19
19
  import { useEffect as d } from "react";
20
20
  import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
21
21
  // ../../libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js
22
- function h({ counterpartType: n, pageSizeOptions: o = l, onViewAllDocuments: h, onCreateDocument: g, screenLabels: _, formLabels: v, detailsLabels: y, bankAccountLabels: b, deleteLabels: x, messageLabels: S }) {
23
- let C = t();
22
+ function h({ counterpartType: n, pageSizeOptions: o = l, onViewAllDocuments: h, onCreateDocument: g, screenLabels: _, formLabels: v, detailsLabels: y, bankAccountLabels: b, deleteLabels: x, messageLabels: S, headerActionContainer: C }) {
23
+ let w = t();
24
24
  d(() => {
25
- C(a.Mounted);
26
- }, [C]);
27
- let { stateOptions: w, selectedId: T, view: E, table: D, listError: O, details: k, detailsSheetView: A, permissions: j, isPermissionLoading: M, actions: N, handleRowClick: P, closeDetails: F } = u({
25
+ w(a.Mounted);
26
+ }, [w]);
27
+ let { stateOptions: T, selectedId: E, view: D, table: O, listError: k, details: A, detailsSheetView: j, permissions: M, isPermissionLoading: N, actions: P, handleRowClick: F, closeDetails: I } = u({
28
28
  counterpartType: n,
29
29
  pageSizeOptions: o,
30
30
  detailsLabels: y,
31
31
  messageLabels: S,
32
32
  screenLabels: _
33
- }), { form: I } = N;
33
+ }), { form: L } = P;
34
34
  return /* @__PURE__ */ m(f, { children: [
35
35
  /* @__PURE__ */ p(e, {}),
36
36
  /* @__PURE__ */ p(s, {
37
37
  mode: n,
38
- counterparts: D.rows,
39
- isLoading: M || D.isLoading,
40
- isError: D.isError,
41
- errorTitle: O.title,
42
- errorDescription: O.description,
43
- sorting: D.sorting,
44
- onSortingChange: D.onSortingChange,
45
- pageSize: D.pageSize,
46
- onPageSizeChange: D.onPageSizeChange,
38
+ counterparts: O.rows,
39
+ isLoading: N || O.isLoading,
40
+ isError: O.isError,
41
+ errorTitle: k.title,
42
+ errorDescription: k.description,
43
+ sorting: O.sorting,
44
+ onSortingChange: O.onSortingChange,
45
+ pageSize: O.pageSize,
46
+ onPageSizeChange: O.onPageSizeChange,
47
47
  pageSizeOptions: o,
48
- hasNextPage: D.hasNextPage,
49
- hasPrevPage: D.hasPrevPage,
50
- onNextPage: D.onNextPage,
51
- onPrevPage: D.onPrevPage,
52
- filters: D.filters,
53
- isFiltering: D.isFiltering,
54
- isAmountsError: D.isAmountsError,
55
- onRetryAmounts: D.onRetryAmounts,
56
- canCreate: j.canCreate,
57
- isAccessRestricted: !M && !j.canRead,
58
- onCreateClick: j.canCreate ? I.openCreate : () => void 0,
59
- onRowClick: P,
60
- onRetry: D.onRetry,
48
+ hasNextPage: O.hasNextPage,
49
+ hasPrevPage: O.hasPrevPage,
50
+ onNextPage: O.onNextPage,
51
+ onPrevPage: O.onPrevPage,
52
+ filters: O.filters,
53
+ isFiltering: O.isFiltering,
54
+ isAmountsError: O.isAmountsError,
55
+ onRetryAmounts: O.onRetryAmounts,
56
+ canCreate: M.canCreate,
57
+ isAccessRestricted: !N && !M.canRead,
58
+ onCreateClick: M.canCreate ? L.openCreate : () => void 0,
59
+ onRowClick: F,
60
+ onRetry: O.onRetry,
61
+ headerActionContainer: C,
61
62
  labels: _,
62
63
  emptyStateTestId: "counterparts-widget-empty-state",
63
64
  accessRestrictedTestId: "counterparts-widget-access-restricted"
64
65
  }),
65
66
  /* @__PURE__ */ p(r, {
66
- open: E === "create",
67
+ open: D === "create",
67
68
  onOpenChange: (e) => {
68
- e || I.close();
69
+ e || L.close();
69
70
  },
70
71
  mode: "create",
71
72
  counterpartMode: n,
72
- values: I.values,
73
- errors: I.errors,
74
- stateOptions: w,
75
- taxIdField: i(I.values.entityType, n, v),
76
- inProgress: I.isSubmitting,
77
- onChange: (e) => I.setValues((t) => ({
73
+ values: L.values,
74
+ errors: L.errors,
75
+ stateOptions: T,
76
+ taxIdField: i(L.values.entityType, n, v),
77
+ inProgress: L.isSubmitting,
78
+ onChange: (e) => L.setValues((t) => ({
78
79
  ...t,
79
80
  ...e
80
81
  })),
81
- onAddressChange: (e) => I.setValues((t) => ({
82
+ onAddressChange: (e) => L.setValues((t) => ({
82
83
  ...t,
83
84
  address: {
84
85
  ...t.address,
85
86
  ...e
86
87
  }
87
88
  })),
88
- onBankAccountChange: (e) => I.setValues((t) => ({
89
+ onBankAccountChange: (e) => L.setValues((t) => ({
89
90
  ...t,
90
91
  bankAccount: {
91
92
  ...t.bankAccount,
92
93
  ...e
93
94
  }
94
95
  })),
95
- onSubmit: I.submit,
96
- onCancel: I.close,
96
+ onSubmit: L.submit,
97
+ onCancel: L.close,
97
98
  labels: v
98
99
  }),
99
100
  /* @__PURE__ */ p(c, {
100
101
  counterpartType: n,
101
- open: T !== void 0 && E !== "create",
102
- selectedId: T,
103
- view: E,
104
- details: k,
105
- detailsSheetView: A,
106
- actions: N,
107
- stateOptions: w,
108
- canEdit: j.canUpdate,
109
- canDelete: j.canDelete,
110
- onClose: F,
102
+ open: E !== void 0 && D !== "create",
103
+ selectedId: E,
104
+ view: D,
105
+ details: A,
106
+ detailsSheetView: j,
107
+ actions: P,
108
+ stateOptions: T,
109
+ canEdit: M.canUpdate,
110
+ canDelete: M.canDelete,
111
+ onClose: I,
111
112
  onViewAllDocuments: h,
112
113
  onCreateDocument: g,
113
114
  formLabels: v,
@@ -117,7 +118,7 @@ function h({ counterpartType: n, pageSizeOptions: o = l, onViewAllDocuments: h,
117
118
  })
118
119
  ] });
119
120
  }
120
- function g({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gatewayRouting: a, linkComponent: s, uiFramework: c, errorFallback: l, onError: u, analytics: d, disclosuresAcceptance: f, providerLabels: m, passThrough: g, ..._ }) {
121
+ function g({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gatewayRouting: a, linkComponent: s, uiFramework: c, errorFallback: l, onError: u, analytics: d, disclosuresAcceptance: f, providerLabels: m, passThrough: g, headerActionContainer: _, ...v }) {
121
122
  return /* @__PURE__ */ p(n, {
122
123
  widgetName: g === !0 && e === void 0 && t === void 0 ? void 0 : o,
123
124
  baseUrl: e,
@@ -132,7 +133,10 @@ function g({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gat
132
133
  analytics: d,
133
134
  disclosuresAcceptance: f,
134
135
  providerLabels: m,
135
- children: /* @__PURE__ */ p(h, { ..._ }, _.counterpartType)
136
+ children: /* @__PURE__ */ p(h, {
137
+ ...v,
138
+ headerActionContainer: _
139
+ }, v.counterpartType)
136
140
  });
137
141
  }
138
142
  export { g as CounterpartsWidget, g as default };
@@ -4,6 +4,7 @@ import { ErrorState as h } from "../../../shared/ui/dist/lib/ErrorState/ErrorSta
4
4
  import { NoAccessState as g } from "../../../shared/ui/dist/lib/StatePanel/NoAccessState.js";
5
5
  import "../../../shared/ui/dist/index.js";
6
6
  import { COUNTERPARTS_SCREEN_LABELS_EN as _ } from "./index2.js";
7
+ import { createPortal as ee } from "react-dom";
7
8
  import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
8
9
  import { TriangleAlertIcon as x } from "lucide-react";
9
10
  // ../../libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js
@@ -13,7 +14,7 @@ var S = [
13
14
  50,
14
15
  100
15
16
  ], C = "all";
16
- function w({ labels: e, filters: t, disabled: r, action: i }) {
17
+ function te({ labels: e, filters: t, disabled: r, action: i }) {
17
18
  return /* @__PURE__ */ y(p, {
18
19
  className: "ttw:px-4",
19
20
  search: /* @__PURE__ */ y(o, {
@@ -53,13 +54,13 @@ function w({ labels: e, filters: t, disabled: r, action: i }) {
53
54
  })] }) : void 0
54
55
  });
55
56
  }
56
- function T({ value: e, isLoading: t }) {
57
+ function w({ value: e, isLoading: t }) {
57
58
  return /* @__PURE__ */ y("div", {
58
59
  className: "ttw:flex ttw:justify-end ttw:tabular-nums",
59
60
  children: t ? /* @__PURE__ */ y(f, { className: "ttw:h-4 ttw:w-20" }) : e
60
61
  });
61
62
  }
62
- function E({ labels: r, onRetry: i }) {
63
+ function T({ labels: r, onRetry: i }) {
63
64
  return /* @__PURE__ */ b(e, {
64
65
  variant: "warning",
65
66
  children: [/* @__PURE__ */ y(x, {}), /* @__PURE__ */ y(t, { children: /* @__PURE__ */ b("div", {
@@ -74,17 +75,17 @@ function E({ labels: r, onRetry: i }) {
74
75
  }) })]
75
76
  });
76
77
  }
77
- function D({ mode: e, counterparts: t, isLoading: a, isError: o, errorTitle: s, errorDescription: c, sorting: l, onSortingChange: u, pageSize: d, onPageSizeChange: f, pageSizeOptions: p = S, hasNextPage: v, hasPrevPage: x, onNextPage: C, onPrevPage: D, filters: O, isFiltering: k, isAmountsError: A, onRetryAmounts: j, canCreate: M = !0, isAccessRestricted: N, onCreateClick: P, onRowClick: F, onRetry: I, labels: L, emptyStateTestId: R, accessRestrictedTestId: z }) {
78
- let B = {
78
+ function E({ mode: e, counterparts: t, isLoading: a, isError: o, errorTitle: s, errorDescription: c, sorting: l, onSortingChange: u, pageSize: d, onPageSizeChange: f, pageSizeOptions: p = S, hasNextPage: v, hasPrevPage: x, onNextPage: C, onPrevPage: E, filters: D, isFiltering: O, isAmountsError: k, onRetryAmounts: A, canCreate: j = !0, isAccessRestricted: M, onCreateClick: N, onRowClick: ne, onRetry: P, headerActionContainer: F, labels: I, emptyStateTestId: L, accessRestrictedTestId: R }) {
79
+ let z = {
79
80
  ..._,
80
- ...L
81
- }, V = e === "customer", H = V ? B.columnInvoicedAmount : B.columnBilledAmount, U = V ? B.columnReceivedAmount : B.columnTotalPaidToDate, W = V ? B.columnAmountDue : B.columnBalanceDue, G = [
81
+ ...I
82
+ }, B = e === "customer", V = B ? z.columnInvoicedAmount : z.columnBilledAmount, H = B ? z.columnReceivedAmount : z.columnTotalPaidToDate, U = B ? z.columnAmountDue : z.columnBalanceDue, W = [
82
83
  {
83
84
  accessorKey: "name",
84
85
  enableSorting: !0,
85
86
  header: ({ column: e }) => /* @__PURE__ */ y(i, {
86
87
  column: e,
87
- title: B.columnName
88
+ title: z.columnName
88
89
  }),
89
90
  cell: ({ row: e }) => /* @__PURE__ */ b("div", {
90
91
  className: "ttw:flex ttw:flex-col ttw:gap-1",
@@ -101,9 +102,9 @@ function D({ mode: e, counterparts: t, isLoading: a, isError: o, errorTitle: s,
101
102
  accessorKey: "billedAmountLabel",
102
103
  header: () => /* @__PURE__ */ y("div", {
103
104
  className: "ttw:text-right",
104
- children: H
105
+ children: V
105
106
  }),
106
- cell: ({ row: e }) => /* @__PURE__ */ y(T, {
107
+ cell: ({ row: e }) => /* @__PURE__ */ y(w, {
107
108
  value: e.original.billedAmountLabel,
108
109
  isLoading: e.original.isBilledAmountLoading
109
110
  })
@@ -112,9 +113,9 @@ function D({ mode: e, counterparts: t, isLoading: a, isError: o, errorTitle: s,
112
113
  accessorKey: "receivedOrPaidAmountLabel",
113
114
  header: () => /* @__PURE__ */ y("div", {
114
115
  className: "ttw:text-right",
115
- children: U
116
+ children: H
116
117
  }),
117
- cell: ({ row: e }) => /* @__PURE__ */ y(T, {
118
+ cell: ({ row: e }) => /* @__PURE__ */ y(w, {
118
119
  value: e.original.receivedOrPaidAmountLabel,
119
120
  isLoading: e.original.isReceivedOrPaidAmountLoading
120
121
  })
@@ -123,14 +124,14 @@ function D({ mode: e, counterparts: t, isLoading: a, isError: o, errorTitle: s,
123
124
  accessorKey: "dueOrOwedAmountLabel",
124
125
  header: () => /* @__PURE__ */ y("div", {
125
126
  className: "ttw:text-right",
126
- children: W
127
+ children: U
127
128
  }),
128
- cell: ({ row: e }) => /* @__PURE__ */ y(T, {
129
+ cell: ({ row: e }) => /* @__PURE__ */ y(w, {
129
130
  value: e.original.dueOrOwedAmountLabel,
130
131
  isLoading: e.original.isDueOrOwedAmountLoading
131
132
  })
132
133
  }
133
- ], K = (e) => /* @__PURE__ */ b("div", {
134
+ ], G = (e) => /* @__PURE__ */ b("div", {
134
135
  className: "ttw:flex ttw:flex-col ttw:gap-2",
135
136
  children: [/* @__PURE__ */ b("div", {
136
137
  className: "ttw:flex ttw:flex-col ttw:gap-1",
@@ -143,17 +144,17 @@ function D({ mode: e, counterparts: t, isLoading: a, isError: o, errorTitle: s,
143
144
  })]
144
145
  }), [
145
146
  {
146
- label: H,
147
+ label: V,
147
148
  value: e.billedAmountLabel,
148
149
  isLoading: e.isBilledAmountLoading
149
150
  },
150
151
  {
151
- label: U,
152
+ label: H,
152
153
  value: e.receivedOrPaidAmountLabel,
153
154
  isLoading: e.isReceivedOrPaidAmountLoading
154
155
  },
155
156
  {
156
- label: W,
157
+ label: U,
157
158
  value: e.dueOrOwedAmountLabel,
158
159
  isLoading: e.isDueOrOwedAmountLoading
159
160
  }
@@ -162,60 +163,64 @@ function D({ mode: e, counterparts: t, isLoading: a, isError: o, errorTitle: s,
162
163
  children: [/* @__PURE__ */ y("span", {
163
164
  className: "ttw:text-muted-foreground",
164
165
  children: e.label
165
- }), /* @__PURE__ */ y(T, {
166
+ }), /* @__PURE__ */ y(w, {
166
167
  value: e.value,
167
168
  isLoading: e.isLoading
168
169
  })]
169
170
  }, e.label))]
170
- }), q = V ? B.customersEmptyTitle : B.vendorsEmptyTitle, J = V ? B.customersEmptyDescription : B.vendorsEmptyDescription, Y = V ? B.customersEmptyAction : B.vendorsEmptyAction, X = V ? B.customersFilterEmptyTitle : B.vendorsFilterEmptyTitle, Z = !k && !O.searchValue && !t.length && !a, Q = !(!M || N), $ = !(k || !Q), ee = !k && !a && !o && !t.length, te = Q && !ee, ne = V ? B.createButton : B.vendorsCreateButton;
171
- return N ? /* @__PURE__ */ y(g, {
172
- testId: z,
173
- title: B.accessRestrictedTitle,
174
- description: B.accessRestrictedDescription
171
+ }), K = B ? z.customersEmptyTitle : z.vendorsEmptyTitle, q = B ? z.customersEmptyDescription : z.vendorsEmptyDescription, J = B ? z.customersEmptyAction : z.vendorsEmptyAction, Y = B ? z.customersFilterEmptyTitle : z.vendorsFilterEmptyTitle, X = !O && !D.searchValue && !t.length && !a, Z = !(!j || M), Q = !(O || !Z), re = !O && !a && !o && !t.length, ie = Z && !re, ae = B ? z.createButton : z.vendorsCreateButton, $ = ie ? /* @__PURE__ */ y(n, {
172
+ onClick: N,
173
+ children: ae
174
+ }) : void 0;
175
+ return M ? /* @__PURE__ */ y(g, {
176
+ testId: R,
177
+ title: z.accessRestrictedTitle,
178
+ description: z.accessRestrictedDescription
175
179
  }) : o ? /* @__PURE__ */ y(h, {
176
180
  title: s,
177
181
  description: c,
178
- retryLabel: I ? B.errorRetry : void 0,
179
- onRetry: I
182
+ retryLabel: P ? z.errorRetry : void 0,
183
+ onRetry: P
180
184
  }) : /* @__PURE__ */ b("div", {
181
185
  className: "ttw:flex ttw:flex-col ttw:gap-4",
182
- children: [A && /* @__PURE__ */ y(E, {
183
- labels: B,
184
- onRetry: j
185
- }), /* @__PURE__ */ y(r, {
186
- columns: G,
187
- data: t,
188
- isLoading: a,
189
- sorting: l,
190
- onSortingChange: u,
191
- pageSize: d,
192
- onPageSizeChange: f,
193
- pageSizeOptions: p,
194
- hasNextPage: v,
195
- hasPrevPage: x,
196
- onNextPage: C,
197
- onPrevPage: D,
198
- showPagination: !!(a || t.length > 0 || x),
199
- onRowClick: F,
200
- rowAriaLabel: (e) => B.openRow(e.name),
201
- renderCard: K,
202
- filterComponent: /* @__PURE__ */ y(w, {
203
- labels: B,
204
- filters: O,
205
- disabled: Z,
206
- action: te ? /* @__PURE__ */ y(n, {
207
- onClick: P,
208
- children: ne
209
- }) : void 0
186
+ children: [
187
+ k && /* @__PURE__ */ y(T, {
188
+ labels: z,
189
+ onRetry: A
210
190
  }),
211
- children: /* @__PURE__ */ y(m, {
212
- testId: R,
213
- title: k ? X : q,
214
- description: k ? B.filterEmptyDescription : J,
215
- actionLabel: k ? B.filterEmptyAction : $ ? Y : void 0,
216
- onAction: k ? O.onClearAll : $ ? P : void 0
217
- })
218
- })]
191
+ /* @__PURE__ */ y(r, {
192
+ columns: W,
193
+ data: t,
194
+ isLoading: a,
195
+ sorting: l,
196
+ onSortingChange: u,
197
+ pageSize: d,
198
+ onPageSizeChange: f,
199
+ pageSizeOptions: p,
200
+ hasNextPage: v,
201
+ hasPrevPage: x,
202
+ onNextPage: C,
203
+ onPrevPage: E,
204
+ showPagination: !!(a || t.length > 0 || x),
205
+ onRowClick: ne,
206
+ rowAriaLabel: (e) => z.openRow(e.name),
207
+ renderCard: G,
208
+ filterComponent: /* @__PURE__ */ y(te, {
209
+ labels: z,
210
+ filters: D,
211
+ disabled: X,
212
+ action: F === void 0 ? $ : void 0
213
+ }),
214
+ children: /* @__PURE__ */ y(m, {
215
+ testId: L,
216
+ title: O ? Y : K,
217
+ description: O ? z.filterEmptyDescription : q,
218
+ actionLabel: O ? z.filterEmptyAction : Q ? J : void 0,
219
+ onAction: O ? D.onClearAll : Q ? N : void 0
220
+ })
221
+ }),
222
+ F && $ && ee($, F)
223
+ ]
219
224
  });
220
225
  }
221
- export { D as CounterpartsScreen, D as default };
226
+ export { E as CounterpartsScreen, E as default };
@@ -1,2 +1,2 @@
1
1
  import "./index4.js";
2
- export { ExpenseApprovalPoliciesWidget } from "./index6.js";
2
+ export { ExpenseApprovalPoliciesWidget } from "./index7.js";
@@ -14,24 +14,24 @@ function m(e, t, n) {
14
14
  case o.LessThan: return { all: [p, {
15
15
  operator: "<",
16
16
  left_operand: { name: "transaction.amount" },
17
- right_operand: (n ?? 0) * 100
17
+ right_operand: Math.round((n ?? 0) * 100)
18
18
  }] };
19
19
  case o.GreaterThanOrEqual: return { all: [p, {
20
20
  operator: ">=",
21
21
  left_operand: { name: "transaction.amount" },
22
- right_operand: (t ?? 0) * 100
22
+ right_operand: Math.round((t ?? 0) * 100)
23
23
  }] };
24
24
  case o.InRange: return { all: [
25
25
  p,
26
26
  {
27
27
  operator: ">=",
28
28
  left_operand: { name: "transaction.amount" },
29
- right_operand: (t ?? 0) * 100
29
+ right_operand: Math.round((t ?? 0) * 100)
30
30
  },
31
31
  {
32
32
  operator: "<",
33
33
  left_operand: { name: "transaction.amount" },
34
- right_operand: (n ?? 0) * 100
34
+ right_operand: Math.round((n ?? 0) * 100)
35
35
  }
36
36
  ] };
37
37
  }
@@ -86,7 +86,7 @@ function _(e) {
86
86
  let t = e;
87
87
  if (t.left_operand?.name !== "transaction.amount") continue;
88
88
  let i = Number(t.right_operand) / 100;
89
- t.operator === ">=" && (n = i), t.operator === "<" && (r = i), t.operator === "<=" && (r = i);
89
+ t.operator === ">=" && (n = i), t.operator === "<" && (r = i), t.operator === "<=" && (r = (Number(t.right_operand) + 1) / 100);
90
90
  }
91
91
  return n !== void 0 && r !== void 0 ? {
92
92
  conditionType: o.InRange,
@@ -101,16 +101,16 @@ function _(e) {
101
101
  };
102
102
  }
103
103
  if (typeof e != "string") return { conditionType: o.All };
104
- let t = e.replace(/^\{(.*)\}$/, "$1").trim().replace(/^event_name\s*==\s*["'][^'"]*["']\s*&&\s*/, "").trim(), n = t.match(/(?:transaction\.)?amount\s*>=\s*([\d.]+)\s*&&\s*(?:transaction\.)?amount\s*<\s*([\d.]+)/);
104
+ let t = e.replace(/^\{(.*)\}$/, "$1").trim().replace(/^event_name\s*==\s*["'][^'"]*["']\s*&&\s*/, "").trim(), n = t.match(/(?:transaction\.)?amount\s*>=\s*([\d.]+)\s*&&\s*(?:transaction\.)?amount\s*(<=|<)\s*([\d.]+)/);
105
105
  if (n) return {
106
106
  conditionType: o.InRange,
107
107
  minAmount: Number(n[1]),
108
- maxAmount: Number(n[2])
108
+ maxAmount: (Math.round(Number(n[3]) * 100) + +(n[2] === "<=")) / 100
109
109
  };
110
- let r = t.match(/^(?:transaction\.)?amount\s*<\s*([\d.]+)$/);
110
+ let r = t.match(/^(?:transaction\.)?amount\s*(<=|<)\s*([\d.]+)$/);
111
111
  if (r) return {
112
112
  conditionType: o.LessThan,
113
- maxAmount: Number(r[1])
113
+ maxAmount: (Math.round(Number(r[2]) * 100) + +(r[1] === "<=")) / 100
114
114
  };
115
115
  let i = t.match(/^(?:transaction\.)?amount\s*>=\s*([\d.]+)$/);
116
116
  return i ? {
@@ -2,14 +2,14 @@
2
2
  var e = {
3
3
  AdminLabel: "Company admin",
4
4
  AdminSublabel: "Any company admin can approve",
5
- ReportingManagerLabel: "Reporting Managers",
5
+ ReportingManagerLabel: "Reporting manager",
6
6
  ReportingManagerSublabel: "Assigned reporting managers can approve",
7
7
  CfoLabel: "Finance admin",
8
8
  CfoSublabel: "Any finance admin can approve"
9
9
  }, t = {
10
10
  InvalidMinAmount: "Enter a valid minimum amount",
11
11
  InvalidMaxAmount: "Enter a valid maximum amount",
12
- MaxLessThanOrEqualToMin: "Maximum amount can not be less than or equal to the minimum amount",
12
+ MaxLessThanOrEqualToMin: "Maximum amount cannot be less than the minimum amount",
13
13
  ApproversRequired: "At least one approver is required",
14
14
  ConflictsWithAnotherRule: "This conflicts with another rule"
15
15
  }, n = {