@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.
- package/dist/experimental/QuickViewWidget.d.ts +62 -2
- package/dist/experimental/index.d.ts +62 -2
- package/dist/index.css +21 -17
- package/dist/index.d.ts +10 -6
- package/dist/lib/CardDetailsWidget.d.ts +6 -4
- package/dist/lib/CreditCardsWidget.d.ts +6 -4
- package/dist/lib/DebitCardsWidget.d.ts +6 -4
- package/dist/lib/SettingsWidget.d.ts +2 -1
- package/dist/lib/WidgetSuite.d.ts +8 -5
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +199 -168
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +44 -43
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index3.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index4.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index6.js +25 -284
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index7.js +291 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index3.js +28 -17
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index5.js +21 -34
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index6.js +71 -78
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index7.js +71 -77
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index8.js +43 -49
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index2.js +8 -1
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/accounts/ui/dist/index2.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/bills/ui/dist/index2.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/data-access/dist/index.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/data-access/dist/index2.js +98 -0
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/index.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/CardsQuickViewWidgetFeature.js +80 -0
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/labels.js +27 -0
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/summarizeCardSpend.js +17 -0
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/testIds.js +7 -0
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/useCardSpendSummary.js +29 -0
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/analytics/events.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/ui/dist/index.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/ui/dist/index2.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/ui/dist/index3.js +31 -0
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/feature/dist/lib/QuickViewWidget/QuickViewWidget.js +57 -44
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/feature/dist/lib/QuickViewWidget/labels.js +6 -3
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/invoices/ui/dist/index2.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/chart-of-accounts/ui/dist/index3.js +98 -91
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/lib/ExpenseSettingsTabs/ExpenseSettingsTabs.js +24 -21
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/lib/SettingsWidget/SettingsWidget.js +14 -8
- package/dist/libs/tesouro-embedded-components-react/settings-widget/help/ui/shadcn/dist/index3.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index10.js +87 -81
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index3.js +63 -44
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index6.js +9 -6
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index17.js +302 -276
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index12.js +36 -36
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index17.js +27 -13
- package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/SettingsSectionContent.js +22 -0
- package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/SettingsWidgetUi.js +6 -7
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/ApprovalPoliciesSettings.js +39 -37
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index11.js +39 -35
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index16.js +59 -61
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index4.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index6.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index7.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +114 -103
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +43 -43
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/debit-card/useAllDebitCardsQuery.js +22 -18
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +97 -97
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +166 -154
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/util/dist/index.js +12 -12
- package/dist/packages/shared-ui-shadcn/dist/index.js +18 -15
- package/package.json +1 -1
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
import { Button as e, Combobox as t, FieldError as n, Label as r, RadioGroup as i, RadioGroupItem as a } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
-
import { AmountConditionBuilder as
|
|
1
|
+
import { Button as e, Combobox as t, FieldError as n, Label as r, RadioGroup as i, RadioGroupItem as a, Typography as o } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { AmountConditionBuilder as s } from "../../../../shared/approval-policy/ui/dist/index3.js";
|
|
3
|
+
import { PolicyCardFrame as c } from "../../../../shared/approval-policy/ui/dist/index17.js";
|
|
3
4
|
import "../../../../shared/approval-policy/ui/dist/index.js";
|
|
4
|
-
import { ApprovalOutcomeType as
|
|
5
|
-
import { ApprovalRuleFormLabels as
|
|
6
|
-
import { useEffect as
|
|
7
|
-
import { jsx as
|
|
8
|
-
import {
|
|
5
|
+
import { ApprovalOutcomeType as l } from "./index2.js";
|
|
6
|
+
import { ApprovalRuleFormLabels as u } from "./index3.js";
|
|
7
|
+
import { useEffect as d, useId as f, useRef as p, useState as m } from "react";
|
|
8
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
9
|
+
import { Trash2 as _ } from "lucide-react";
|
|
9
10
|
// ../../libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index7.js
|
|
10
11
|
var v = ({ values: v, approverOptions: y, validationErrors: b, labels: x, isEditing: S, disabled: C, onValuesChange: w, onSave: T, onCancel: E, onDelete: D, testIds: O }) => {
|
|
11
12
|
let k = {
|
|
12
|
-
...
|
|
13
|
+
...u,
|
|
13
14
|
...x
|
|
14
15
|
}, A = (e) => w({
|
|
15
16
|
...v,
|
|
16
17
|
...e
|
|
17
|
-
}), j =
|
|
18
|
-
|
|
18
|
+
}), j = p(null), [M, N] = m(0);
|
|
19
|
+
d(() => {
|
|
19
20
|
M && j.current?.querySelector("[aria-invalid=\"true\"]")?.focus();
|
|
20
21
|
}, [M]);
|
|
21
22
|
let P = () => {
|
|
22
23
|
T(), N((e) => e + 1);
|
|
23
|
-
}, F =
|
|
24
|
+
}, F = f(), I = f(), L = f(), R = y.map((e) => ({
|
|
24
25
|
value: e.id,
|
|
25
26
|
label: e.label
|
|
26
27
|
})), z = new Set(R.map((e) => e.value)), B = [...R, ...v.approvers.filter((e) => !z.has(e.id)).map((e) => ({
|
|
27
28
|
value: e.id,
|
|
28
29
|
label: e.label
|
|
29
30
|
}))], V = new Map([...v.approvers.map((e) => [e.id, e]), ...y.map((e) => [e.id, e])]);
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ g(c, {
|
|
31
32
|
ref: j,
|
|
32
33
|
"data-testid": O?.root,
|
|
33
|
-
className: "ttw:border
|
|
34
|
+
className: "ttw:border-primary",
|
|
34
35
|
children: [
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ h(s, {
|
|
36
37
|
value: {
|
|
37
38
|
lower: v.minAmount,
|
|
38
39
|
upper: v.maxAmount
|
|
@@ -46,16 +47,6 @@ var v = ({ values: v, approverOptions: y, validationErrors: b, labels: x, isEdit
|
|
|
46
47
|
upper: b.maxAmount
|
|
47
48
|
},
|
|
48
49
|
disabled: C,
|
|
49
|
-
lead: /* @__PURE__ */ m("span", {
|
|
50
|
-
className: "ttw:font-normal",
|
|
51
|
-
children: [
|
|
52
|
-
k.ForExpenses,
|
|
53
|
-
" ",
|
|
54
|
-
/* @__PURE__ */ p("strong", { children: k.ExpensesBold }),
|
|
55
|
-
" ",
|
|
56
|
-
k.GreaterThanOrEqualTo
|
|
57
|
-
]
|
|
58
|
-
}),
|
|
59
50
|
labels: {
|
|
60
51
|
IfAmountIsBetween: `${k.ForExpenses} ${k.ExpensesBold} ${k.GreaterThanOrEqualTo}`,
|
|
61
52
|
And: k.AndLessThan,
|
|
@@ -67,103 +58,106 @@ var v = ({ values: v, approverOptions: y, validationErrors: b, labels: x, isEdit
|
|
|
67
58
|
upperInput: O?.maxAmountInput
|
|
68
59
|
}
|
|
69
60
|
}),
|
|
70
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ g(i, {
|
|
71
62
|
"aria-label": k.Outcome,
|
|
72
63
|
"aria-required": "true",
|
|
73
64
|
className: "ttw:gap-2",
|
|
74
65
|
value: v.outcome,
|
|
75
66
|
disabled: C,
|
|
76
67
|
onValueChange: (e) => {
|
|
77
|
-
e ===
|
|
68
|
+
e === l.AutoApprove ? A({
|
|
78
69
|
outcome: e,
|
|
79
70
|
approvers: []
|
|
80
|
-
}) : e ===
|
|
71
|
+
}) : e === l.RequireApproval && A({ outcome: e });
|
|
81
72
|
},
|
|
82
|
-
children: [/* @__PURE__ */
|
|
73
|
+
children: [/* @__PURE__ */ g("div", {
|
|
83
74
|
className: "ttw:flex ttw:items-center ttw:gap-2",
|
|
84
|
-
children: [/* @__PURE__ */
|
|
75
|
+
children: [/* @__PURE__ */ h(a, {
|
|
85
76
|
id: `${F}-auto`,
|
|
86
|
-
value:
|
|
87
|
-
}), /* @__PURE__ */
|
|
77
|
+
value: l.AutoApprove
|
|
78
|
+
}), /* @__PURE__ */ h(r, {
|
|
88
79
|
htmlFor: `${F}-auto`,
|
|
89
|
-
className: "ttw:cursor-pointer
|
|
90
|
-
children:
|
|
91
|
-
"aria-hidden": "true",
|
|
92
|
-
className: "ttw:size-4 ttw:shrink-0"
|
|
93
|
-
}), k.AutoApprove]
|
|
80
|
+
className: "ttw:cursor-pointer",
|
|
81
|
+
children: k.AutoApprove
|
|
94
82
|
})]
|
|
95
|
-
}), /* @__PURE__ */
|
|
83
|
+
}), /* @__PURE__ */ g("div", {
|
|
96
84
|
className: "ttw:flex ttw:items-start ttw:gap-2",
|
|
97
|
-
children: [/* @__PURE__ */
|
|
85
|
+
children: [/* @__PURE__ */ h(a, {
|
|
98
86
|
id: `${F}-required`,
|
|
99
|
-
value:
|
|
87
|
+
value: l.RequireApproval,
|
|
100
88
|
className: "ttw:mt-0.5"
|
|
101
|
-
}), /* @__PURE__ */
|
|
89
|
+
}), /* @__PURE__ */ g("div", {
|
|
102
90
|
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
103
|
-
children: [/* @__PURE__ */
|
|
91
|
+
children: [/* @__PURE__ */ h(r, {
|
|
104
92
|
htmlFor: `${F}-required`,
|
|
105
93
|
className: "ttw:cursor-pointer",
|
|
106
|
-
children:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}), k.RequireApproval]
|
|
110
|
-
}), /* @__PURE__ */ p("span", {
|
|
111
|
-
className: "ttw:pl-6 ttw:text-xs ttw:text-muted-foreground",
|
|
94
|
+
children: k.RequireApproval
|
|
95
|
+
}), /* @__PURE__ */ h("span", {
|
|
96
|
+
className: "ttw:text-xs ttw:text-muted-foreground",
|
|
112
97
|
children: k.RequireApprovalCaption
|
|
113
98
|
})]
|
|
114
99
|
})]
|
|
115
100
|
})]
|
|
116
101
|
}),
|
|
117
|
-
v.outcome ===
|
|
118
|
-
className: "ttw:flex ttw:flex-col ttw:gap-
|
|
102
|
+
v.outcome === l.RequireApproval ? /* @__PURE__ */ g("div", {
|
|
103
|
+
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
119
104
|
children: [
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
children: k.
|
|
105
|
+
/* @__PURE__ */ h(o, {
|
|
106
|
+
variant: "body2",
|
|
107
|
+
color: "muted",
|
|
108
|
+
children: k.ThenRequireApproval
|
|
124
109
|
}),
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
items:
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
110
|
+
/* @__PURE__ */ g("div", {
|
|
111
|
+
className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-4",
|
|
112
|
+
children: [/* @__PURE__ */ h(r, {
|
|
113
|
+
htmlFor: I,
|
|
114
|
+
children: k.RequireApprovalFrom
|
|
115
|
+
}), /* @__PURE__ */ h("div", {
|
|
116
|
+
className: "ttw:min-w-0 ttw:flex-1",
|
|
117
|
+
children: /* @__PURE__ */ h(t, {
|
|
118
|
+
items: B,
|
|
119
|
+
value: v.approvers.map((e) => e.id),
|
|
120
|
+
onValueChange: (e) => {
|
|
121
|
+
A({ approvers: (Array.isArray(e) ? e : [e]).flatMap((e) => {
|
|
122
|
+
let t = V.get(e);
|
|
123
|
+
return t ? [t] : [];
|
|
124
|
+
}) });
|
|
125
|
+
},
|
|
126
|
+
multiple: !0,
|
|
127
|
+
multipleSeparator: k.ApproverSeparator,
|
|
128
|
+
labels: { placeholder: k.ChooseApprovers },
|
|
129
|
+
disabled: C,
|
|
130
|
+
inputId: I,
|
|
131
|
+
required: !0,
|
|
132
|
+
invalid: !!b.approvers,
|
|
133
|
+
describedBy: b.approvers ? L : void 0
|
|
134
|
+
})
|
|
135
|
+
})]
|
|
142
136
|
}),
|
|
143
|
-
b.approvers ? /* @__PURE__ */
|
|
137
|
+
b.approvers ? /* @__PURE__ */ h(n, {
|
|
144
138
|
id: L,
|
|
145
139
|
children: b.approvers
|
|
146
140
|
}) : null
|
|
147
141
|
]
|
|
148
142
|
}) : null,
|
|
149
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ g("div", {
|
|
150
144
|
className: "ttw:mt-2 ttw:flex ttw:items-center ttw:justify-between",
|
|
151
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ h("div", { children: S && D ? /* @__PURE__ */ g(e, {
|
|
152
146
|
variant: "ghost",
|
|
153
147
|
size: "sm",
|
|
154
148
|
className: "ttw:text-destructive ttw:hover:text-destructive",
|
|
155
149
|
onClick: D,
|
|
156
150
|
disabled: C,
|
|
157
|
-
children: [/* @__PURE__ */
|
|
158
|
-
}) : null }), /* @__PURE__ */
|
|
151
|
+
children: [/* @__PURE__ */ h(_, {}), k.DeleteRule]
|
|
152
|
+
}) : null }), /* @__PURE__ */ g("div", {
|
|
159
153
|
className: "ttw:flex ttw:gap-2",
|
|
160
|
-
children: [/* @__PURE__ */
|
|
154
|
+
children: [/* @__PURE__ */ h(e, {
|
|
161
155
|
variant: "ghost",
|
|
162
156
|
size: "sm",
|
|
163
157
|
onClick: E,
|
|
164
158
|
disabled: C,
|
|
165
159
|
children: k.Cancel
|
|
166
|
-
}), /* @__PURE__ */
|
|
160
|
+
}), /* @__PURE__ */ h(e, {
|
|
167
161
|
size: "sm",
|
|
168
162
|
onClick: P,
|
|
169
163
|
disabled: C,
|
|
@@ -1,62 +1,61 @@
|
|
|
1
1
|
import { Alert as e, AlertDescription as t, AlertTitle as n, Button as r, Skeleton as i } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
2
|
+
import { GapCoverageAlert as a } from "../../../../shared/approval-policy/ui/dist/index7.js";
|
|
3
|
+
import "../../../../shared/approval-policy/ui/dist/index.js";
|
|
4
|
+
import { ExpenseApprovalsPageLabels as o, GapCalloutLabels as s } from "./index3.js";
|
|
5
|
+
import { formatAmount as c } from "./index4.js";
|
|
6
|
+
import { EmptyApprovalRules as l } from "./index5.js";
|
|
7
|
+
import { ApprovalRuleCard as u } from "./index6.js";
|
|
8
|
+
import { ApprovalRuleForm as d } from "./index7.js";
|
|
9
|
+
import { createPortal as f } from "react-dom";
|
|
10
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
11
|
+
import { CircleCheck as g } from "lucide-react";
|
|
10
12
|
// ../../libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index8.js
|
|
11
13
|
function _(e, t) {
|
|
12
|
-
return e.to === null ? `${t.Above} ${
|
|
14
|
+
return e.to === null ? `${t.Above} ${c(e.from)}` : `${c(e.from)} ${t.RangeSeparator} ${c(e.to)}`;
|
|
13
15
|
}
|
|
14
|
-
var v = ({ rules:
|
|
16
|
+
var v = ({ rules: c, labels: v, isBusy: y, isLoading: b, isAddingRule: x, newRuleFormValues: S, newRuleValidationErrors: C, editingRuleId: w, editingRuleFormValues: T, editingRuleValidationErrors: E, approverOptions: D, allExpensesAreCovered: O, gapIntervals: k, onAddRuleClick: A, headerActionContainer: j, onCancelAddRule: M, onSaveNewRule: N, onNewRuleFormChange: P, onEditRule: F, onCancelEditRule: I, onSaveEditRule: L, onEditRuleFormChange: R, onDeleteRule: z, onLearnMore: B, testIds: V }) => {
|
|
15
17
|
let H = {
|
|
16
|
-
...
|
|
18
|
+
...o,
|
|
17
19
|
...v?.page
|
|
18
20
|
}, U = {
|
|
19
|
-
...
|
|
21
|
+
...s,
|
|
20
22
|
...v?.gap
|
|
21
|
-
}, W =
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
+
}, W = c.length > 0;
|
|
24
|
+
return /* @__PURE__ */ m("div", {
|
|
23
25
|
className: "ttw:flex ttw:flex-col ttw:gap-3",
|
|
24
|
-
children: b && !W && !x && !w ? /* @__PURE__ */
|
|
26
|
+
children: b && !W && !x && !w ? /* @__PURE__ */ h("div", {
|
|
25
27
|
role: "status",
|
|
26
28
|
className: "ttw:flex ttw:flex-col ttw:gap-3",
|
|
27
|
-
children: [/* @__PURE__ */
|
|
29
|
+
children: [/* @__PURE__ */ m("span", {
|
|
28
30
|
className: "ttw:sr-only",
|
|
29
31
|
children: H.LoadingRules
|
|
30
|
-
}), Array.from({ length: 2 }).map((e, t) => /* @__PURE__ */
|
|
32
|
+
}), Array.from({ length: 2 }).map((e, t) => /* @__PURE__ */ h("div", {
|
|
31
33
|
className: "ttw:border ttw:border-border ttw:rounded-lg ttw:p-4 ttw:flex ttw:flex-col ttw:gap-3",
|
|
32
|
-
children: [/* @__PURE__ */
|
|
34
|
+
children: [/* @__PURE__ */ h("div", {
|
|
33
35
|
className: "ttw:flex ttw:items-center ttw:justify-between",
|
|
34
|
-
children: [/* @__PURE__ */
|
|
35
|
-
|
|
36
|
-
children: [/* @__PURE__ */ p(i, { className: "ttw:h-8 ttw:w-8" }), /* @__PURE__ */ p(i, { className: "ttw:h-8 ttw:w-8" })]
|
|
37
|
-
})]
|
|
38
|
-
}), /* @__PURE__ */ p(i, { className: "ttw:h-6 ttw:w-32" })]
|
|
36
|
+
children: [/* @__PURE__ */ m(i, { className: "ttw:h-4 ttw:w-64" }), /* @__PURE__ */ m(i, { className: "ttw:h-9 ttw:w-20" })]
|
|
37
|
+
}), /* @__PURE__ */ m(i, { className: "ttw:h-6 ttw:w-32" })]
|
|
39
38
|
}, t))]
|
|
40
|
-
}) : !W && !x ? /* @__PURE__ */
|
|
39
|
+
}) : !W && !x ? /* @__PURE__ */ m(l, {
|
|
41
40
|
labels: v?.empty,
|
|
42
41
|
onAddRule: A,
|
|
43
42
|
onLearnMore: B
|
|
44
|
-
}) : /* @__PURE__ */
|
|
45
|
-
!O && !x && !w && W && (j === void 0 ? /* @__PURE__ */
|
|
43
|
+
}) : /* @__PURE__ */ h(p, { children: [
|
|
44
|
+
!O && !x && !w && W && (j === void 0 ? /* @__PURE__ */ m("div", {
|
|
46
45
|
className: "ttw:flex ttw:justify-end",
|
|
47
|
-
children: /* @__PURE__ */
|
|
46
|
+
children: /* @__PURE__ */ m(r, {
|
|
48
47
|
size: "sm",
|
|
49
48
|
onClick: A,
|
|
50
49
|
disabled: y,
|
|
51
50
|
children: H.AddRule
|
|
52
51
|
})
|
|
53
|
-
}) : j ?
|
|
52
|
+
}) : j ? f(/* @__PURE__ */ m(r, {
|
|
54
53
|
size: "sm",
|
|
55
54
|
onClick: A,
|
|
56
55
|
disabled: y,
|
|
57
56
|
children: H.AddRule
|
|
58
57
|
}), j) : null),
|
|
59
|
-
|
|
58
|
+
c.map((e) => w === e.id && T ? /* @__PURE__ */ m(d, {
|
|
60
59
|
labels: v?.ruleForm,
|
|
61
60
|
values: T,
|
|
62
61
|
approverOptions: D,
|
|
@@ -68,15 +67,14 @@ var v = ({ rules: s, labels: v, isBusy: y, isLoading: b, isAddingRule: x, newRul
|
|
|
68
67
|
onCancel: I,
|
|
69
68
|
onDelete: () => z(e.id),
|
|
70
69
|
testIds: V?.ruleForm
|
|
71
|
-
}, e.id) : /* @__PURE__ */
|
|
70
|
+
}, e.id) : /* @__PURE__ */ m(u, {
|
|
72
71
|
rule: e,
|
|
73
72
|
labels: v?.ruleCard,
|
|
74
73
|
onEdit: F,
|
|
75
|
-
onDelete: z,
|
|
76
74
|
disabled: y,
|
|
77
75
|
testIds: V?.ruleCard
|
|
78
76
|
}, e.id)),
|
|
79
|
-
x && !w && /* @__PURE__ */
|
|
77
|
+
x && !w && /* @__PURE__ */ m(d, {
|
|
80
78
|
labels: v?.ruleForm,
|
|
81
79
|
values: S,
|
|
82
80
|
approverOptions: D,
|
|
@@ -88,28 +86,24 @@ var v = ({ rules: s, labels: v, isBusy: y, isLoading: b, isAddingRule: x, newRul
|
|
|
88
86
|
onCancel: M,
|
|
89
87
|
testIds: V?.ruleForm
|
|
90
88
|
}),
|
|
91
|
-
O && /* @__PURE__ */
|
|
89
|
+
O && /* @__PURE__ */ h(e, {
|
|
92
90
|
variant: "success",
|
|
93
91
|
role: "status",
|
|
94
92
|
children: [
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ m(g, { "aria-hidden": "true" }),
|
|
94
|
+
/* @__PURE__ */ m(n, { children: H.AllExpensesCoveredTitle }),
|
|
95
|
+
/* @__PURE__ */ m(t, { children: H.AllExpensesCoveredBody })
|
|
98
96
|
]
|
|
99
97
|
}),
|
|
100
|
-
!O && k.length > 0 && /* @__PURE__ */ m(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
" ",
|
|
110
|
-
/* @__PURE__ */ p("strong", { children: k.map((e) => _(e, U)).join(", ") }),
|
|
111
|
-
U.Suffix
|
|
112
|
-
] }) })]
|
|
98
|
+
!O && k.length > 0 && /* @__PURE__ */ m(a, {
|
|
99
|
+
gaps: k.map((e, t) => ({
|
|
100
|
+
id: String(t),
|
|
101
|
+
label: _(e, U)
|
|
102
|
+
})),
|
|
103
|
+
labels: {
|
|
104
|
+
Title: U.Title,
|
|
105
|
+
Footer: U.Footer
|
|
106
|
+
}
|
|
113
107
|
})
|
|
114
108
|
] })
|
|
115
109
|
});
|
package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index.js
CHANGED
|
@@ -5,6 +5,6 @@ import "./lib/TransactionDetails/TransactionDetailsFeature.js";
|
|
|
5
5
|
import { ExpenseManagementWidget as e } from "./lib/ExpenseManagementWidget/ExpenseManagementWidget.js";
|
|
6
6
|
import "./lib/ExpenseManagementWidget/index.js";
|
|
7
7
|
import "../../approval-policies/feature/dist/index4.js";
|
|
8
|
-
import { ExpenseApprovalPoliciesWidget as t } from "../../approval-policies/feature/dist/
|
|
8
|
+
import { ExpenseApprovalPoliciesWidget as t } from "../../approval-policies/feature/dist/index7.js";
|
|
9
9
|
import "../../approval-policies/feature/dist/index.js";
|
|
10
10
|
export { t as ExpenseApprovalPoliciesWidget, e as ExpenseManagementWidget };
|
package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index2.js
CHANGED
|
@@ -37,7 +37,14 @@ function m({ row: m, isActionDisabled: h }) {
|
|
|
37
37
|
disabled: h,
|
|
38
38
|
onClick: m.task.onSelect,
|
|
39
39
|
children: m.task.label
|
|
40
|
-
}) : null, m.menuActions.length
|
|
40
|
+
}) : null, m.menuActions.length === 1 && !m.menuActions[0].destructive ? /* @__PURE__ */ d(t, {
|
|
41
|
+
type: "button",
|
|
42
|
+
variant: "outline",
|
|
43
|
+
size: "sm",
|
|
44
|
+
disabled: h,
|
|
45
|
+
onClick: m.menuActions[0].onSelect,
|
|
46
|
+
children: m.menuActions[0].label
|
|
47
|
+
}) : m.menuActions.length > 0 ? /* @__PURE__ */ f(n, { children: [/* @__PURE__ */ f(s, { children: [/* @__PURE__ */ d(l, {
|
|
41
48
|
asChild: !0,
|
|
42
49
|
children: /* @__PURE__ */ d(o, {
|
|
43
50
|
asChild: !0,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useCardSpendReads } from "./index2.js";
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { getDebitCardTransactions as e } from "../../../../shared/data-access/dist/lib/rest/sdk.gen.js";
|
|
6
|
+
import { getDebitCardTransactionsQueryKey as t } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
7
|
+
import { withAuthEpoch as n } from "../../../../shared/data-access/dist/lib/withAuthEpoch.js";
|
|
8
|
+
import { useEmbedApi as r } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
9
|
+
import { organizationHeaders as i } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
10
|
+
import { useAllDebitCardsQuery as a } from "../../../../shared/data-access/dist/lib/debit-card/useAllDebitCardsQuery.js";
|
|
11
|
+
import "../../../../shared/data-access/dist/index.js";
|
|
12
|
+
import { useQueries as o } from "@tanstack/react-query";
|
|
13
|
+
// ../../libs/tesouro-embedded-components-react/quick-view-widget/cards/data-access/dist/index2.js
|
|
14
|
+
var s = 100, c = {
|
|
15
|
+
staleTime: 6e4,
|
|
16
|
+
refetchOnWindowFocus: !0
|
|
17
|
+
}, l = {
|
|
18
|
+
staleTime: 3e5,
|
|
19
|
+
refetchOnWindowFocus: !1
|
|
20
|
+
}, u = {
|
|
21
|
+
retry: 2,
|
|
22
|
+
retryDelay: 300
|
|
23
|
+
};
|
|
24
|
+
function d(e) {
|
|
25
|
+
return {
|
|
26
|
+
transactions: e.every((e) => e.data !== void 0) ? e.flatMap((e) => e.data ?? []) : void 0,
|
|
27
|
+
isLoading: e.some((e) => e.isLoading),
|
|
28
|
+
isFetching: e.some((e) => e.isFetching),
|
|
29
|
+
isError: e.some((e) => e.isError),
|
|
30
|
+
refetch: () => Promise.all(e.map((e) => e.refetch()))
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
async function f(e) {
|
|
34
|
+
let t = [], n = /* @__PURE__ */ new Set(), r;
|
|
35
|
+
do {
|
|
36
|
+
let i = await e(r);
|
|
37
|
+
t.push(...i.data), r && n.add(r), r = i.nextPaginationToken ?? void 0;
|
|
38
|
+
} while (r && !n.has(r));
|
|
39
|
+
return t;
|
|
40
|
+
}
|
|
41
|
+
function p(e) {
|
|
42
|
+
return e.data !== void 0 && !e.isPlaceholderData && !e.hasNextPage && !e.isFetchingNextPage;
|
|
43
|
+
}
|
|
44
|
+
function m(e) {
|
|
45
|
+
return e.data !== void 0 && !e.isError && !p(e);
|
|
46
|
+
}
|
|
47
|
+
function h({ enabled: h = !0 } = {}) {
|
|
48
|
+
let { client: g, organizationId: _, widgetToken: v, authEpoch: y, organizationStatus: b } = r(), x = a({
|
|
49
|
+
enabled: h,
|
|
50
|
+
...c,
|
|
51
|
+
...u
|
|
52
|
+
}), S = p(x) ? x.data?.data : void 0, C = i(_), w = o({
|
|
53
|
+
queries: (S ?? []).map((r) => ({
|
|
54
|
+
...n({
|
|
55
|
+
queryKey: [...t({
|
|
56
|
+
client: g,
|
|
57
|
+
headers: C,
|
|
58
|
+
path: { id: r.id },
|
|
59
|
+
query: { limit: s }
|
|
60
|
+
}), "all-pages"],
|
|
61
|
+
queryFn: ({ signal: t }) => f(async (n) => {
|
|
62
|
+
let { data: i } = await e({
|
|
63
|
+
client: g,
|
|
64
|
+
headers: C,
|
|
65
|
+
path: { id: r.id },
|
|
66
|
+
query: {
|
|
67
|
+
limit: s,
|
|
68
|
+
...n ? { paginationToken: n } : {}
|
|
69
|
+
},
|
|
70
|
+
signal: t,
|
|
71
|
+
throwOnError: !0
|
|
72
|
+
});
|
|
73
|
+
return i;
|
|
74
|
+
})
|
|
75
|
+
}, {
|
|
76
|
+
authEpoch: y,
|
|
77
|
+
organizationStatus: b
|
|
78
|
+
}),
|
|
79
|
+
...l,
|
|
80
|
+
...u,
|
|
81
|
+
enabled: !!(_ && v) && h
|
|
82
|
+
})),
|
|
83
|
+
combine: d
|
|
84
|
+
});
|
|
85
|
+
return {
|
|
86
|
+
data: S && w.transactions ? {
|
|
87
|
+
cards: S,
|
|
88
|
+
transactions: w.transactions
|
|
89
|
+
} : void 0,
|
|
90
|
+
isLoading: x.isLoading || m(x) || w.isLoading,
|
|
91
|
+
isFetching: x.isFetching || w.isFetching,
|
|
92
|
+
isError: x.isError || w.isError,
|
|
93
|
+
refetch: async () => {
|
|
94
|
+
await x.refetch(), await w.refetch();
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
export { p as isCardListComplete, m as isCardListPaging, f as readAllPages, h as useCardSpendReads };
|
package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/index.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CARDS_QUICK_VIEW_WIDGET_LABELS_EN as e } from "./lib/CardsQuickViewWidget/labels.js";
|
|
2
|
+
import { CardsQuickViewWidget as t } from "./lib/CardsQuickViewWidget/CardsQuickViewWidgetFeature.js";
|
|
3
|
+
export { e as CARDS_QUICK_VIEW_WIDGET_LABELS_EN, t as CardsQuickViewWidget };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { amountOutputToMajorUnits as e } from "../../../../../../shared/util/dist/lib/amountOutputToMajorUnits.js";
|
|
6
|
+
import { formatAccountingAmount as t } from "../../../../../../shared/util/dist/lib/formatAccountingAmount.js";
|
|
7
|
+
import "../../../../../../shared/util/dist/index.js";
|
|
8
|
+
import { OrganizationStatus as n, isOrganizationOnItsWay as r } from "../../../../../../shared/data-access/dist/lib/organizationStatus.js";
|
|
9
|
+
import { useEmbedApi as i } from "../../../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
10
|
+
import { Scope as a } from "../../../../../../shared/data-access/dist/lib/scopes.js";
|
|
11
|
+
import "../../../../../../shared/data-access/dist/index.js";
|
|
12
|
+
import { useAnalyticsTrack as o } from "../../../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
13
|
+
import { WidgetProvider as s } from "../../../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
14
|
+
import { useRefetchWidget as c, useWidgetConfig as l, useWidgetError as u, useWidgetLoading as d } from "../../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
15
|
+
import "../../../../../../shared/feature/dist/index.js";
|
|
16
|
+
import { CardsQuickViewTile as f } from "../../../../ui/dist/index3.js";
|
|
17
|
+
import "../../../../ui/dist/index.js";
|
|
18
|
+
import { CARDS_QUICK_VIEW_WIDGET_LABELS_EN as p } from "./labels.js";
|
|
19
|
+
import { CardsQuickViewWidgetAnalyticsEvent as m, WIDGET_NAME as h } from "../analytics/events.js";
|
|
20
|
+
import { cardsQuickViewWidgetTestIds as g } from "./testIds.js";
|
|
21
|
+
import { useCardSpendSummary as _ } from "./useCardSpendSummary.js";
|
|
22
|
+
import { useCallback as v, useEffect as y } from "react";
|
|
23
|
+
import { jsx as b } from "react/jsx-runtime";
|
|
24
|
+
// ../../libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/CardsQuickViewWidgetFeature.js
|
|
25
|
+
var x = (n) => t(e({
|
|
26
|
+
value: n,
|
|
27
|
+
currencyCode: "USD"
|
|
28
|
+
}), "USD"), S = (e) => Number(e.slice(5, 7)) - 1;
|
|
29
|
+
function C({ labels: e, onViewCardsClick: t, className: s, style: h }) {
|
|
30
|
+
let C = {
|
|
31
|
+
...p,
|
|
32
|
+
...e
|
|
33
|
+
}, w = o();
|
|
34
|
+
y(() => {
|
|
35
|
+
w(m.Mounted);
|
|
36
|
+
}, [w]);
|
|
37
|
+
let { initResponse: T } = l(), E = d(), D = u(), O = c(), { organizationId: k, organizationStatus: A } = i(), j = r(A), M = T?.scopes?.includes(a.DebitCardReadOrg) ?? !1, { data: N, today: P, isLoading: F, isError: I, refetch: L } = _({ enabled: M }), R = E && !T || j && N === void 0 || F, z = (!!D || I) && N === void 0, B = v(() => {
|
|
38
|
+
O(), M && k && L();
|
|
39
|
+
}, [
|
|
40
|
+
O,
|
|
41
|
+
L,
|
|
42
|
+
M,
|
|
43
|
+
k
|
|
44
|
+
]);
|
|
45
|
+
if (T && (!M || A === n.None)) return null;
|
|
46
|
+
let V = P === void 0 ? void 0 : S(P), H = N ? x(N.spendAmount) : void 0, U = H?.text ?? "", W = N ? N.hasCards ? C.cardCount(N.cardCount) : C.noCardsYet : void 0;
|
|
47
|
+
return /* @__PURE__ */ b(f, {
|
|
48
|
+
title: V === void 0 ? void 0 : C.titleForMonth(V),
|
|
49
|
+
value: U,
|
|
50
|
+
subtext: W,
|
|
51
|
+
linkText: C.viewCards,
|
|
52
|
+
onClick: t,
|
|
53
|
+
ariaLabel: N && W && V !== void 0 ? C.accessibleName({
|
|
54
|
+
title: C.accessibleTitleForMonth(V),
|
|
55
|
+
value: H?.isNegative ? C.negativeAmount(H.magnitude) : U,
|
|
56
|
+
detail: W,
|
|
57
|
+
action: C.viewCards
|
|
58
|
+
}) : void 0,
|
|
59
|
+
isLoading: R,
|
|
60
|
+
isError: z,
|
|
61
|
+
onRetry: z ? B : void 0,
|
|
62
|
+
labels: C,
|
|
63
|
+
testIds: g,
|
|
64
|
+
className: s,
|
|
65
|
+
style: h
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function w({ labels: e, onViewCardsClick: t, className: n, style: r, ...i }) {
|
|
69
|
+
return /* @__PURE__ */ b(s, {
|
|
70
|
+
...i,
|
|
71
|
+
widgetName: h,
|
|
72
|
+
children: /* @__PURE__ */ b(C, {
|
|
73
|
+
labels: e,
|
|
74
|
+
onViewCardsClick: t,
|
|
75
|
+
className: n,
|
|
76
|
+
style: r
|
|
77
|
+
})
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
export { w as CardsQuickViewWidget, C as CardsQuickViewWidgetWithContext };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CARDS_QUICK_VIEW_TILE_LABELS_EN as e } from "../../../../ui/dist/index2.js";
|
|
2
|
+
import "../../../../ui/dist/index.js";
|
|
3
|
+
// ../../libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/labels.js
|
|
4
|
+
var t = (e) => e.toLocaleString("en-US"), n = [
|
|
5
|
+
"January",
|
|
6
|
+
"February",
|
|
7
|
+
"March",
|
|
8
|
+
"April",
|
|
9
|
+
"May",
|
|
10
|
+
"June",
|
|
11
|
+
"July",
|
|
12
|
+
"August",
|
|
13
|
+
"September",
|
|
14
|
+
"October",
|
|
15
|
+
"November",
|
|
16
|
+
"December"
|
|
17
|
+
], r = {
|
|
18
|
+
...e,
|
|
19
|
+
titleForMonth: (e) => `Card spend · ${n[e]}`,
|
|
20
|
+
accessibleTitleForMonth: (e) => `Card spend in ${n[e]}`,
|
|
21
|
+
viewCards: "View cards",
|
|
22
|
+
noCardsYet: "No cards yet",
|
|
23
|
+
cardCount: (e) => `${t(e)} ${e === 1 ? "card" : "cards"}`,
|
|
24
|
+
negativeAmount: (e) => `negative ${e}`,
|
|
25
|
+
accessibleName: ({ title: e, value: t, detail: n, action: r }) => `${e}, ${t}, ${n}. ${r}.`
|
|
26
|
+
};
|
|
27
|
+
export { r as CARDS_QUICK_VIEW_WIDGET_LABELS_EN };
|