@tesouro/embedded-components-react 0.11.120 → 0.11.122
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/index.css +32 -154
- package/dist/index.d.ts +11 -2
- package/dist/lib/ExpenseManagementWidget.d.ts +11 -2
- package/dist/lib/WidgetSuite.d.ts +11 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/ExpenseManagementWidget.js +343 -264
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/labels.js +14 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/permissions.js +6 -3
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/useExpenseTabBadgeCounts.js +34 -19
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/useExpensesTransactions.js +100 -98
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/TransactionDetails/TransactionDetailsActionsFeature.js +27 -24
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/TransactionDetails/TransactionDetailsFeature.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/expenseStatus.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index2.js +43 -44
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index4.js +79 -40
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index2.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index3.js +47 -46
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index4.js +78 -84
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index5.js +165 -158
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index6.js +38 -100
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index7.js +77 -54
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/AccordionItemCard/AccordionItemCard.js +213 -229
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/ExpenseStatusBadge.js +6 -8
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesScreen/ExpensesScreen.js +66 -73
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsFilterBar/ExpensesTransactionsFilterBar.js +13 -13
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsTable/ExpensesTransactionsTable.js +123 -80
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsTable/labels.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/FileViewer/FileViewer.js +83 -74
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/DeleteReceiptDialog/DeleteReceiptDialog.js +22 -30
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/TransactionDetails.js +176 -259
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/labels.js +4 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetailsActions/BulkProgress.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetailsActions/TransactionDetailsActions.js +112 -121
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetailsActions/labels.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/feature/dist/lib/ExpenseRequirementsWidget.js +41 -32
- package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/ui/dist/index3.js +43 -53
- 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/ui/dist/index.js +3 -1
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/CopyAddress/CopyAddress.js +55 -0
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/UploadTray/UploadTray.js +84 -0
- package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/feature/dist/lib/UploadReceiptWidget.js +126 -73
- package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/ui/dist/index2.js +14 -1
- package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/ui/dist/index3.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/ui/dist/index4.js +75 -128
- package/dist/packages/shared-ui-shadcn/dist/index.js +1399 -1302
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/badgeTones.js +0 -9
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { Badge as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
-
import {
|
|
3
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
3
|
// ../../libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/ExpenseStatusBadge.js
|
|
5
|
-
function
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
children: r
|
|
4
|
+
function n({ label: n, tone: r }) {
|
|
5
|
+
return /* @__PURE__ */ t(e, {
|
|
6
|
+
tone: r,
|
|
7
|
+
children: n
|
|
10
8
|
});
|
|
11
9
|
}
|
|
12
|
-
export {
|
|
10
|
+
export { n as ExpenseStatusBadge, n as default };
|
|
@@ -2,116 +2,109 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
5
|
+
import { Button as e, Skeleton as t, Tabs as n, TabsContent as r, TabsList as i, TabsTrigger as a, Tooltip as o, TooltipContent as s, TooltipProvider as c, TooltipTrigger as l } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { LoadingRegion as u } from "../../../../../shared/ui/dist/lib/LoadingRegion/LoadingRegion.js";
|
|
7
|
+
import "../../../../../shared/ui/dist/index.js";
|
|
8
|
+
import { EXPENSES_HEADER_LABELS_EN as d } from "../ExpensesHeader/labels.js";
|
|
9
|
+
import { ExpensesHeader as f } from "../ExpensesHeader/ExpensesHeader.js";
|
|
10
|
+
import { DEFAULT_LABELS as p } from "./labels.js";
|
|
11
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
12
|
+
import { SettingsIcon as g } from "lucide-react";
|
|
11
13
|
// ../../libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesScreen/ExpensesScreen.js
|
|
12
|
-
function
|
|
13
|
-
let
|
|
14
|
-
...
|
|
15
|
-
...
|
|
16
|
-
},
|
|
17
|
-
...
|
|
18
|
-
...
|
|
19
|
-
}, { onSettingsClick:
|
|
20
|
-
return /* @__PURE__ */
|
|
14
|
+
function _({ labels: _, header: v, headerLabels: y, myTransactionsContent: b, teamTransactionsContent: x, myTransactionsCount: S, teamTransactionsCount: C, policiesContent: w, requirementsContent: T, matchingContent: E, activeTab: D, onActiveTabChange: O, isLoading: k = !1 }) {
|
|
15
|
+
let A = {
|
|
16
|
+
...p,
|
|
17
|
+
..._
|
|
18
|
+
}, j = {
|
|
19
|
+
...d,
|
|
20
|
+
...y
|
|
21
|
+
}, { onSettingsClick: M, actions: N, ...P } = v ?? {}, F = !!(M || N), I = x ? "team-transactions" : "my-transactions";
|
|
22
|
+
return /* @__PURE__ */ h("section", {
|
|
21
23
|
className: "ttw:w-full ttw:space-y-4",
|
|
22
|
-
children: [/* @__PURE__ */
|
|
23
|
-
...
|
|
24
|
-
labels:
|
|
25
|
-
}),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
onValueChange: w,
|
|
24
|
+
children: [/* @__PURE__ */ m(f, {
|
|
25
|
+
...P,
|
|
26
|
+
labels: y
|
|
27
|
+
}), k ? /* @__PURE__ */ h(u, {
|
|
28
|
+
isLoading: !0,
|
|
29
|
+
loadingLabel: A.loading,
|
|
30
|
+
className: "ttw:space-y-4 ttw:py-4",
|
|
31
|
+
children: [/* @__PURE__ */ m(t, { className: "ttw:h-10 ttw:w-full" }), /* @__PURE__ */ m(t, { className: "ttw:h-32 ttw:w-full" })]
|
|
32
|
+
}) : /* @__PURE__ */ h(n, {
|
|
33
|
+
defaultValue: I,
|
|
34
|
+
value: D,
|
|
35
|
+
onValueChange: O,
|
|
35
36
|
children: [
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ h("div", {
|
|
37
38
|
className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:justify-between ttw:gap-2",
|
|
38
|
-
children: [/* @__PURE__ */
|
|
39
|
+
children: [/* @__PURE__ */ h(i, {
|
|
39
40
|
variant: "underline",
|
|
40
41
|
className: "ttw:flex ttw:flex-wrap ttw:justify-start",
|
|
41
42
|
children: [
|
|
42
|
-
|
|
43
|
+
x ? /* @__PURE__ */ m(a, {
|
|
43
44
|
value: "team-transactions",
|
|
44
|
-
|
|
45
|
-
children:
|
|
46
|
-
variant: "default",
|
|
47
|
-
className: "ttw:h-4.5 ttw:min-w-4.5 ttw:rounded-full ttw:px-1.5",
|
|
48
|
-
"aria-label": `${y} ${E.tabCountAriaSuffix}`,
|
|
49
|
-
children: y
|
|
50
|
-
}) : null]
|
|
45
|
+
count: C,
|
|
46
|
+
children: A.teamTransactionsTab
|
|
51
47
|
}) : null,
|
|
52
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ m(a, {
|
|
53
49
|
value: "my-transactions",
|
|
54
|
-
|
|
55
|
-
children:
|
|
56
|
-
variant: "default",
|
|
57
|
-
className: "ttw:h-4.5 ttw:min-w-4.5 ttw:rounded-full ttw:px-1.5",
|
|
58
|
-
"aria-label": `${v} ${E.tabCountAriaSuffix}`,
|
|
59
|
-
children: v
|
|
60
|
-
}) : null]
|
|
50
|
+
count: S,
|
|
51
|
+
children: A.myTransactionsTab
|
|
61
52
|
}),
|
|
62
|
-
|
|
53
|
+
w ? /* @__PURE__ */ m(a, {
|
|
63
54
|
value: "policies",
|
|
64
|
-
children:
|
|
55
|
+
children: A.policiesTab
|
|
65
56
|
}) : null,
|
|
66
|
-
|
|
57
|
+
T ? /* @__PURE__ */ m(a, {
|
|
67
58
|
value: "requirements",
|
|
68
|
-
children:
|
|
59
|
+
children: A.requirementsTab
|
|
69
60
|
}) : null,
|
|
70
|
-
|
|
61
|
+
E ? /* @__PURE__ */ m(a, {
|
|
71
62
|
value: "matching",
|
|
72
|
-
children:
|
|
63
|
+
children: A.matchingTab
|
|
73
64
|
}) : null
|
|
74
65
|
]
|
|
75
|
-
}),
|
|
66
|
+
}), F ? /* @__PURE__ */ h("div", {
|
|
76
67
|
className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-2",
|
|
77
|
-
children: [
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
68
|
+
children: [M ? /* @__PURE__ */ m(c, { children: /* @__PURE__ */ h(o, { children: [/* @__PURE__ */ m(l, {
|
|
69
|
+
asChild: !0,
|
|
70
|
+
children: /* @__PURE__ */ m(e, {
|
|
71
|
+
type: "button",
|
|
72
|
+
variant: "ghost",
|
|
73
|
+
size: "icon",
|
|
74
|
+
"aria-label": j.settingsButtonAriaLabel,
|
|
75
|
+
onClick: M,
|
|
76
|
+
children: /* @__PURE__ */ m(g, { className: "ttw:size-4" })
|
|
77
|
+
})
|
|
78
|
+
}), /* @__PURE__ */ m(s, { children: j.settingsButtonAriaLabel })] }) }) : null, N]
|
|
86
79
|
}) : null]
|
|
87
80
|
}),
|
|
88
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ m(r, {
|
|
89
82
|
value: "my-transactions",
|
|
90
83
|
className: "ttw:pt-2",
|
|
91
|
-
children:
|
|
84
|
+
children: b
|
|
92
85
|
}),
|
|
93
|
-
|
|
86
|
+
x ? /* @__PURE__ */ m(r, {
|
|
94
87
|
value: "team-transactions",
|
|
95
88
|
className: "ttw:pt-2",
|
|
96
|
-
children:
|
|
89
|
+
children: x
|
|
97
90
|
}) : null,
|
|
98
|
-
|
|
91
|
+
w ? /* @__PURE__ */ m(r, {
|
|
99
92
|
value: "policies",
|
|
100
93
|
className: "ttw:pt-2",
|
|
101
|
-
children:
|
|
94
|
+
children: w
|
|
102
95
|
}) : null,
|
|
103
|
-
|
|
96
|
+
T ? /* @__PURE__ */ m(r, {
|
|
104
97
|
value: "requirements",
|
|
105
98
|
className: "ttw:pt-2",
|
|
106
|
-
children:
|
|
99
|
+
children: T
|
|
107
100
|
}) : null,
|
|
108
|
-
|
|
101
|
+
E ? /* @__PURE__ */ m(r, {
|
|
109
102
|
value: "matching",
|
|
110
103
|
className: "ttw:pt-2",
|
|
111
|
-
children:
|
|
104
|
+
children: E
|
|
112
105
|
}) : null
|
|
113
106
|
]
|
|
114
107
|
})]
|
|
115
108
|
});
|
|
116
109
|
}
|
|
117
|
-
export {
|
|
110
|
+
export { _ as ExpensesScreen, _ as default };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { AmountFilter as e, DateRangePicker as t,
|
|
5
|
+
import { AmountFilter as e, DateRangePicker as t, FilterMenuButton as n, FilterTag as r, MultiSelectFilter as i, Popover as a, PopoverContent as o, PopoverTrigger as s, SearchInput as c, TableToolbar as l, useFilterPanel as u } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
6
|
import { EXPENSES_TRANSACTIONS_FILTER_BAR_LABELS_EN as d } from "./labels.js";
|
|
7
7
|
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
8
8
|
import { ListFilter as h } from "lucide-react";
|
|
@@ -57,26 +57,26 @@ function _(_) {
|
|
|
57
57
|
}, D = (e) => {
|
|
58
58
|
e === "card" ? (_.onCardToggle(), x.closeMenu()) : x.openPanel(e);
|
|
59
59
|
};
|
|
60
|
-
return /* @__PURE__ */ p(
|
|
60
|
+
return /* @__PURE__ */ p(l, {
|
|
61
61
|
className: "ttw:pl-4",
|
|
62
|
-
|
|
62
|
+
search: /* @__PURE__ */ p(c, {
|
|
63
63
|
value: _.searchValue,
|
|
64
64
|
onChange: (e) => _.onSearchChange(e.target.value),
|
|
65
65
|
placeholder: v.searchPlaceholder,
|
|
66
66
|
"aria-label": v.searchAriaLabel,
|
|
67
67
|
className: "ttw:min-w-56"
|
|
68
68
|
}),
|
|
69
|
-
|
|
69
|
+
filterButton: /* @__PURE__ */ m(a, {
|
|
70
70
|
open: C,
|
|
71
71
|
onOpenChange: E,
|
|
72
|
-
children: [/* @__PURE__ */ p(
|
|
72
|
+
children: [/* @__PURE__ */ p(s, {
|
|
73
73
|
asChild: !0,
|
|
74
|
-
children: /* @__PURE__ */ p(
|
|
74
|
+
children: /* @__PURE__ */ p(n, {
|
|
75
75
|
activeCount: _.activeFilterCount,
|
|
76
76
|
onClick: x.toggleMenu,
|
|
77
77
|
"aria-label": v.filtersButtonAriaLabel
|
|
78
78
|
})
|
|
79
|
-
}), /* @__PURE__ */ m(
|
|
79
|
+
}), /* @__PURE__ */ m(o, {
|
|
80
80
|
align: "start",
|
|
81
81
|
className: `ttw:p-0 ${w}`,
|
|
82
82
|
children: [
|
|
@@ -90,7 +90,7 @@ function _(_) {
|
|
|
90
90
|
/* @__PURE__ */ p(h, { className: "ttw:size-4 ttw:text-muted-foreground ttw:shrink-0" }),
|
|
91
91
|
e.label,
|
|
92
92
|
e.id === "card" && _.cardOnly ? /* @__PURE__ */ p("span", {
|
|
93
|
-
className: "ttw:ml-auto ttw:text-xs ttw:text-
|
|
93
|
+
className: "ttw:ml-auto ttw:text-xs ttw:text-primary ttw:font-semibold",
|
|
94
94
|
children: v.cardOnlyOn
|
|
95
95
|
}) : null
|
|
96
96
|
]
|
|
@@ -105,22 +105,22 @@ function _(_) {
|
|
|
105
105
|
presets: T,
|
|
106
106
|
labels: { fieldLabel: v.dateRangeFieldLabel }
|
|
107
107
|
}) : null,
|
|
108
|
-
x.activePanelId === "paymentStatus" ? /* @__PURE__ */ p(
|
|
108
|
+
x.activePanelId === "paymentStatus" ? /* @__PURE__ */ p(i, {
|
|
109
109
|
options: _.paymentStatusOptions,
|
|
110
110
|
selectedValues: _.selectedPaymentStatus,
|
|
111
111
|
onSelectionChange: _.onPaymentStatusChange
|
|
112
112
|
}) : null,
|
|
113
|
-
x.activePanelId === "approvalStatus" ? /* @__PURE__ */ p(
|
|
113
|
+
x.activePanelId === "approvalStatus" ? /* @__PURE__ */ p(i, {
|
|
114
114
|
options: _.approvalStatusOptions,
|
|
115
115
|
selectedValues: _.selectedApprovalStatus,
|
|
116
116
|
onSelectionChange: _.onApprovalStatusChange
|
|
117
117
|
}) : null,
|
|
118
|
-
x.activePanelId === "type" ? /* @__PURE__ */ p(
|
|
118
|
+
x.activePanelId === "type" ? /* @__PURE__ */ p(i, {
|
|
119
119
|
options: _.typeOptions,
|
|
120
120
|
selectedValues: _.selectedTypes,
|
|
121
121
|
onSelectionChange: _.onTypeChange
|
|
122
122
|
}) : null,
|
|
123
|
-
x.activePanelId === "teamMember" ? /* @__PURE__ */ p(
|
|
123
|
+
x.activePanelId === "teamMember" ? /* @__PURE__ */ p(i, {
|
|
124
124
|
options: _.teamMemberOptions,
|
|
125
125
|
selectedValues: _.selectedTeamMembers,
|
|
126
126
|
onSelectionChange: _.onTeamMembersChange,
|
|
@@ -141,7 +141,7 @@ function _(_) {
|
|
|
141
141
|
]
|
|
142
142
|
})]
|
|
143
143
|
}),
|
|
144
|
-
|
|
144
|
+
tags: /* @__PURE__ */ m(f, { children: [_.activeChips.map((e) => /* @__PURE__ */ p(r, {
|
|
145
145
|
label: e.label,
|
|
146
146
|
count: e.count,
|
|
147
147
|
variant: "default",
|
|
@@ -2,144 +2,187 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import { ExpenseStatusBadge as
|
|
7
|
-
import { EXPENSES_TRANSACTIONS_TABLE_LABELS_EN as
|
|
8
|
-
import { useMemo as
|
|
9
|
-
import { jsx as
|
|
10
|
-
import { Loader2 as
|
|
5
|
+
import { Badge as e, Button as t, DataTable as n, DataTableSortableHeader as r } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { ExpenseStatusBadge as i } from "../ExpenseStatusBadge/ExpenseStatusBadge.js";
|
|
7
|
+
import { EXPENSES_TRANSACTIONS_TABLE_LABELS_EN as a } from "./labels.js";
|
|
8
|
+
import { useMemo as o } from "react";
|
|
9
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
10
|
+
import { Loader2 as l, Plus as u, ReceiptIcon as d } from "lucide-react";
|
|
11
11
|
// ../../libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsTable/ExpensesTransactionsTable.js
|
|
12
|
-
function
|
|
13
|
-
let
|
|
14
|
-
...
|
|
15
|
-
...
|
|
16
|
-
},
|
|
17
|
-
onRowClick: (e) =>
|
|
18
|
-
rowAriaLabel: (e) =>
|
|
19
|
-
} : {},
|
|
20
|
-
let
|
|
12
|
+
function f({ labels: f, rows: p, isLoading: m, sorting: h, onSortingChange: g, pageSize: _, onPageSizeChange: v, pageSizeOptions: y, hasNextPage: b, hasPrevPage: x, onNextPage: S, onPrevPage: C, pageInfo: w, filterComponent: T, emptyState: E, showCardholderColumn: D = !0, showDepartmentColumn: O = !0, onAddReceiptClick: k, uploadingReceiptId: A, onRowClick: j }) {
|
|
13
|
+
let M = o(() => ({
|
|
14
|
+
...a,
|
|
15
|
+
...f
|
|
16
|
+
}), [f]), N = j ? {
|
|
17
|
+
onRowClick: (e) => j(e.id),
|
|
18
|
+
rowAriaLabel: (e) => M.rowAriaLabel(e.merchantLabel, e.amountLabel)
|
|
19
|
+
} : {}, P = o(() => {
|
|
20
|
+
let n = [
|
|
21
21
|
{
|
|
22
22
|
id: "startedAt",
|
|
23
|
-
|
|
23
|
+
meta: { fitContent: !0 },
|
|
24
|
+
header: ({ column: e }) => /* @__PURE__ */ s(r, {
|
|
24
25
|
column: e,
|
|
25
|
-
title:
|
|
26
|
+
title: M.dateColumn
|
|
26
27
|
}),
|
|
27
28
|
enableSorting: !0,
|
|
28
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
29
|
+
cell: ({ row: e }) => /* @__PURE__ */ s("span", {
|
|
29
30
|
className: "ttw:whitespace-nowrap",
|
|
30
31
|
children: e.original.dateLabel
|
|
31
32
|
})
|
|
32
33
|
},
|
|
33
34
|
{
|
|
34
35
|
id: "status",
|
|
35
|
-
|
|
36
|
+
meta: { fitContent: !0 },
|
|
37
|
+
header: M.statusColumn,
|
|
36
38
|
enableSorting: !1,
|
|
37
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
39
|
+
cell: ({ row: e }) => /* @__PURE__ */ s(i, {
|
|
38
40
|
label: e.original.statusLabel,
|
|
39
41
|
tone: e.original.statusTone
|
|
40
42
|
})
|
|
41
43
|
},
|
|
42
44
|
{
|
|
43
45
|
accessorKey: "merchantLabel",
|
|
44
|
-
header:
|
|
46
|
+
header: M.merchantColumn,
|
|
45
47
|
enableSorting: !1,
|
|
46
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
47
|
-
className: "ttw:truncate",
|
|
48
|
+
cell: ({ row: e }) => /* @__PURE__ */ s("div", {
|
|
49
|
+
className: "ttw:max-w-50 ttw:truncate",
|
|
50
|
+
title: e.original.merchantLabel,
|
|
48
51
|
children: e.original.merchantLabel
|
|
49
52
|
})
|
|
50
53
|
}
|
|
51
54
|
];
|
|
52
|
-
return
|
|
55
|
+
return D && n.push({
|
|
53
56
|
accessorKey: "cardholderLabel",
|
|
54
|
-
header:
|
|
57
|
+
header: M.cardholderColumn,
|
|
55
58
|
enableSorting: !1,
|
|
56
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
57
|
-
className: "ttw:inline-block ttw:w-
|
|
59
|
+
cell: ({ row: e }) => /* @__PURE__ */ s("span", {
|
|
60
|
+
className: "ttw:inline-block ttw:max-w-50 ttw:truncate",
|
|
61
|
+
title: e.original.cardholderLabel,
|
|
58
62
|
children: e.original.cardholderLabel
|
|
59
63
|
})
|
|
60
|
-
}),
|
|
64
|
+
}), n.push({
|
|
61
65
|
accessorKey: "cardLabel",
|
|
62
|
-
header:
|
|
66
|
+
header: M.cardColumn,
|
|
63
67
|
enableSorting: !1,
|
|
64
|
-
cell: ({ row:
|
|
68
|
+
cell: ({ row: t }) => /* @__PURE__ */ c("div", {
|
|
65
69
|
className: "ttw:flex ttw:items-center ttw:gap-1",
|
|
66
|
-
children: [/* @__PURE__ */
|
|
67
|
-
className: "ttw:text-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
children: [/* @__PURE__ */ s("span", {
|
|
71
|
+
className: "ttw:max-w-50 ttw:truncate ttw:text-muted-foreground",
|
|
72
|
+
title: t.original.cardLabel,
|
|
73
|
+
children: t.original.cardLabel
|
|
74
|
+
}), t.original.cardFormatLabel ? /* @__PURE__ */ s(e, {
|
|
75
|
+
tone: "neutral",
|
|
76
|
+
children: t.original.cardFormatLabel
|
|
72
77
|
}) : null]
|
|
73
78
|
})
|
|
74
|
-
}),
|
|
79
|
+
}), O && n.push({
|
|
75
80
|
accessorKey: "departmentLabel",
|
|
76
|
-
header:
|
|
81
|
+
header: M.departmentColumn,
|
|
77
82
|
enableSorting: !1,
|
|
78
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
83
|
+
cell: ({ row: e }) => /* @__PURE__ */ s("span", {
|
|
79
84
|
className: "ttw:whitespace-nowrap",
|
|
80
85
|
children: e.original.departmentLabel
|
|
81
86
|
})
|
|
82
|
-
}),
|
|
87
|
+
}), n.push({
|
|
83
88
|
id: "receipt",
|
|
84
|
-
header:
|
|
89
|
+
header: M.receiptColumn,
|
|
85
90
|
enableSorting: !1,
|
|
86
|
-
cell: ({ row:
|
|
87
|
-
if (
|
|
88
|
-
className:
|
|
91
|
+
cell: ({ row: e }) => {
|
|
92
|
+
if (e.original.hasReceipt) return /* @__PURE__ */ s(d, {
|
|
93
|
+
className: e.original.isReceiptHighlighted ? "ttw:size-4 ttw:text-violet-foreground" : "ttw:size-4",
|
|
89
94
|
role: "img",
|
|
90
|
-
"aria-label":
|
|
95
|
+
"aria-label": M.receiptPresentAriaLabel
|
|
91
96
|
});
|
|
92
|
-
if (!
|
|
93
|
-
let n =
|
|
94
|
-
return /* @__PURE__ */
|
|
97
|
+
if (!k) return null;
|
|
98
|
+
let n = e.original.id === A;
|
|
99
|
+
return /* @__PURE__ */ s(t, {
|
|
95
100
|
type: "button",
|
|
96
|
-
variant: "
|
|
101
|
+
variant: "ghost",
|
|
97
102
|
size: "icon-sm",
|
|
98
|
-
"aria-label": n ?
|
|
103
|
+
"aria-label": n ? M.addingReceiptAriaLabel : M.addReceiptAriaLabel,
|
|
99
104
|
disabled: n,
|
|
100
|
-
onClick: (
|
|
101
|
-
|
|
105
|
+
onClick: (t) => {
|
|
106
|
+
t.stopPropagation(), k(e.original.id);
|
|
102
107
|
},
|
|
103
|
-
children: n ? /* @__PURE__ */
|
|
108
|
+
children: n ? /* @__PURE__ */ s(l, { className: "ttw:size-4 ttw:animate-spin" }) : /* @__PURE__ */ s(u, { className: "ttw:size-4" })
|
|
104
109
|
});
|
|
105
110
|
}
|
|
106
111
|
}, {
|
|
107
112
|
id: "amount",
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
113
|
+
meta: { fitContent: !0 },
|
|
114
|
+
header: ({ column: e }) => /* @__PURE__ */ s("div", {
|
|
115
|
+
className: "ttw:flex ttw:justify-end",
|
|
116
|
+
children: /* @__PURE__ */ s(r, {
|
|
117
|
+
column: e,
|
|
118
|
+
title: M.amountColumn
|
|
119
|
+
})
|
|
111
120
|
}),
|
|
112
121
|
enableSorting: !0,
|
|
113
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
114
|
-
className: "ttw:font-medium ttw:whitespace-nowrap",
|
|
122
|
+
cell: ({ row: e }) => /* @__PURE__ */ s("span", {
|
|
123
|
+
className: "ttw:block ttw:text-right ttw:tabular-nums ttw:font-medium ttw:whitespace-nowrap",
|
|
115
124
|
children: e.original.amountLabel
|
|
116
125
|
})
|
|
117
|
-
}),
|
|
126
|
+
}), n;
|
|
118
127
|
}, [
|
|
119
|
-
|
|
120
|
-
E,
|
|
128
|
+
M,
|
|
121
129
|
D,
|
|
122
130
|
O,
|
|
123
|
-
k
|
|
131
|
+
k,
|
|
132
|
+
A
|
|
124
133
|
]);
|
|
125
|
-
return /* @__PURE__ */
|
|
126
|
-
columns:
|
|
127
|
-
data:
|
|
128
|
-
sorting:
|
|
129
|
-
onSortingChange:
|
|
130
|
-
pageSize:
|
|
131
|
-
onPageSizeChange:
|
|
132
|
-
pageSizeOptions:
|
|
133
|
-
hasNextPage:
|
|
134
|
-
hasPrevPage:
|
|
135
|
-
onNextPage:
|
|
136
|
-
onPrevPage:
|
|
137
|
-
pageInfo:
|
|
138
|
-
filterComponent:
|
|
139
|
-
isLoading:
|
|
134
|
+
return /* @__PURE__ */ s(n, {
|
|
135
|
+
columns: P,
|
|
136
|
+
data: p,
|
|
137
|
+
sorting: h,
|
|
138
|
+
onSortingChange: g,
|
|
139
|
+
pageSize: _,
|
|
140
|
+
onPageSizeChange: v,
|
|
141
|
+
pageSizeOptions: y,
|
|
142
|
+
hasNextPage: b,
|
|
143
|
+
hasPrevPage: x,
|
|
144
|
+
onNextPage: S,
|
|
145
|
+
onPrevPage: C,
|
|
146
|
+
pageInfo: w,
|
|
147
|
+
filterComponent: T,
|
|
148
|
+
isLoading: m,
|
|
149
|
+
labels: { loading: M.loading },
|
|
150
|
+
renderCard: (e) => /* @__PURE__ */ c("div", {
|
|
151
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2",
|
|
152
|
+
children: [
|
|
153
|
+
/* @__PURE__ */ c("div", {
|
|
154
|
+
className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-4",
|
|
155
|
+
children: [/* @__PURE__ */ s("span", {
|
|
156
|
+
className: "ttw:truncate",
|
|
157
|
+
title: e.merchantLabel,
|
|
158
|
+
children: e.merchantLabel
|
|
159
|
+
}), /* @__PURE__ */ s("span", {
|
|
160
|
+
className: "ttw:tabular-nums",
|
|
161
|
+
children: e.amountLabel
|
|
162
|
+
})]
|
|
163
|
+
}),
|
|
164
|
+
/* @__PURE__ */ c("div", {
|
|
165
|
+
className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-4",
|
|
166
|
+
children: [/* @__PURE__ */ s("span", { children: e.dateLabel }), /* @__PURE__ */ s(i, {
|
|
167
|
+
label: e.statusLabel,
|
|
168
|
+
tone: e.statusTone
|
|
169
|
+
})]
|
|
170
|
+
}),
|
|
171
|
+
e.hasReceipt ? /* @__PURE__ */ s("span", { children: M.receiptPresentAriaLabel }) : k ? /* @__PURE__ */ s(t, {
|
|
172
|
+
type: "button",
|
|
173
|
+
variant: "ghost",
|
|
174
|
+
size: "sm",
|
|
175
|
+
disabled: e.id === A,
|
|
176
|
+
onClick: (t) => {
|
|
177
|
+
t.stopPropagation(), k(e.id);
|
|
178
|
+
},
|
|
179
|
+
children: e.id === A ? M.addingReceiptAriaLabel : M.addReceiptAriaLabel
|
|
180
|
+
}) : null
|
|
181
|
+
]
|
|
182
|
+
}),
|
|
140
183
|
getRowId: (e) => e.id,
|
|
141
|
-
...
|
|
142
|
-
children:
|
|
184
|
+
...N,
|
|
185
|
+
children: E
|
|
143
186
|
});
|
|
144
187
|
}
|
|
145
|
-
export {
|
|
188
|
+
export { f as ExpensesTransactionsTable, f as default };
|