@tesouro/embedded-components-react 0.11.65 → 0.11.68
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/README.md +28 -28
- package/dist/index.css +6 -27
- package/dist/index.d.ts +29 -41
- package/dist/lib/CardDetailsWidget.d.ts +1 -1
- package/dist/lib/CounterpartsWidget.d.ts +26 -39
- package/dist/lib/CounterpartsWidgetPublic.d.ts +26 -39
- package/dist/lib/CreditCardsWidget.d.ts +2 -2
- package/dist/lib/CustomersWidget.d.ts +26 -39
- package/dist/lib/DebitCardsWidget.d.ts +2 -2
- package/dist/lib/ReceivablesWidget.d.ts +14 -4
- package/dist/lib/WidgetSuite.d.ts +2 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/CardDetailsWidget.js +0 -4
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/cardDetailsView.js +7 -8
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js +37 -39
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +72 -73
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFace.js +16 -22
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsContainer.js +8 -12
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsPanel.js +93 -110
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +52 -52
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsActions.js +72 -107
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsSheetView.js +27 -27
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsTable.js +112 -145
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js +13 -16
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +3 -122
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/mocks/labels.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +44 -65
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +157 -134
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +18 -14
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index5.js +362 -55
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +16 -9
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useAddressForm.js +2 -66
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useDeleteController.js +48 -46
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js +138 -149
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index11.js +19 -20
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index13.js +21 -27
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index3.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index8.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js +30 -63
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index6.js +0 -211
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index7.js +0 -509
|
@@ -1,71 +1,74 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BILL_STATUS_BADGE_LABELS_EN as
|
|
3
|
-
import { RECEIVABLE_STATUS_BADGE_LABELS_EN as
|
|
1
|
+
import { FILTER_TAG_LABELS_EN as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { BILL_STATUS_BADGE_LABELS_EN as t } from "../../../shared/document-status/ui/dist/index2.js";
|
|
3
|
+
import { RECEIVABLE_STATUS_BADGE_LABELS_EN as n } from "../../../shared/document-status/ui/dist/index6.js";
|
|
4
4
|
import "../../../shared/document-status/ui/dist/index.js";
|
|
5
5
|
// ../../libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js
|
|
6
|
-
var
|
|
6
|
+
var r = {
|
|
7
7
|
createButton: "Add customer",
|
|
8
8
|
vendorsCreateButton: "Add vendor",
|
|
9
9
|
columnName: "Name",
|
|
10
|
-
sortByName: "Sort by name",
|
|
11
10
|
columnBilledAmount: "Billed amount",
|
|
11
|
+
columnInvoicedAmount: "Invoiced amount",
|
|
12
12
|
columnReceivedAmount: "Received amount",
|
|
13
13
|
columnAmountDue: "Amount due",
|
|
14
|
-
columnTotalPaidToDate: "
|
|
14
|
+
columnTotalPaidToDate: "Paid amount",
|
|
15
15
|
columnBalanceDue: "Balance due",
|
|
16
16
|
openRow: (e) => `View details — ${e}`,
|
|
17
17
|
unnamedCounterpart: "Unspecified",
|
|
18
18
|
searchPlaceholder: "Search by name",
|
|
19
19
|
searchLabel: "Search by name",
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
entityFilterLabel: "Type",
|
|
21
|
+
entityFilterAll: "All types",
|
|
22
|
+
entityFilterOrganization: "Companies",
|
|
23
|
+
entityFilterIndividual: "Individuals",
|
|
24
|
+
filterChipRemove: e.remove,
|
|
23
25
|
typeChip: (e) => `Type: ${e}`,
|
|
24
26
|
searchChip: (e) => `Search: ${e}`,
|
|
25
27
|
clearAllFilters: "Clear all",
|
|
26
|
-
entityFilterOrganization: "Companies",
|
|
27
|
-
entityFilterIndividual: "Individuals",
|
|
28
28
|
customersEmptyTitle: "No customers yet",
|
|
29
|
-
customersEmptyDescription: "
|
|
30
|
-
customersEmptyAction: "
|
|
31
|
-
vendorsEmptyTitle: "Build your vendors list
|
|
29
|
+
customersEmptyDescription: "Add a customer to start sending them invoices.",
|
|
30
|
+
customersEmptyAction: "Add customer",
|
|
31
|
+
vendorsEmptyTitle: "Build your vendors list",
|
|
32
32
|
vendorsEmptyDescription: "Save the people and businesses you pay so you can send payments when bills come in.",
|
|
33
|
-
vendorsEmptyAction: "Add
|
|
33
|
+
vendorsEmptyAction: "Add vendor",
|
|
34
34
|
customersFilterEmptyTitle: "No customers found",
|
|
35
35
|
vendorsFilterEmptyTitle: "No vendors found",
|
|
36
36
|
filterEmptyDescription: "Try adjusting your search or filter criteria.",
|
|
37
37
|
filterEmptyAction: "Clear filters",
|
|
38
|
-
customersErrorTitle: "
|
|
39
|
-
customersErrorDescription: "
|
|
40
|
-
vendorsErrorTitle: "
|
|
41
|
-
vendorsErrorDescription: "
|
|
42
|
-
errorRetry: "
|
|
43
|
-
accessRestrictedTitle: "Access
|
|
44
|
-
accessRestrictedDescription: "
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
38
|
+
customersErrorTitle: "Couldn't load customers",
|
|
39
|
+
customersErrorDescription: "Check your connection, then try again.",
|
|
40
|
+
vendorsErrorTitle: "Couldn't load vendors",
|
|
41
|
+
vendorsErrorDescription: "Check your connection, then try again.",
|
|
42
|
+
errorRetry: "Try again",
|
|
43
|
+
accessRestrictedTitle: "Access restricted",
|
|
44
|
+
accessRestrictedDescription: "Ask a company admin for access.",
|
|
45
|
+
amountsUnavailable: "Couldn't load amounts.",
|
|
46
|
+
amountsRetry: "Try again"
|
|
47
|
+
}, i = {
|
|
48
|
+
loadingTitle: "Loading details",
|
|
49
|
+
notFoundCustomerTitle: "Couldn't load customer",
|
|
50
|
+
notFoundVendorTitle: "Couldn't load vendor",
|
|
51
|
+
notFoundCustomerDescription: "It may have been deleted. Close this panel and try again.",
|
|
52
|
+
notFoundVendorDescription: "It may have been deleted. Close this panel and try again.",
|
|
53
|
+
reloadFailed: "Couldn't load the latest details. Close this form and try again.",
|
|
54
|
+
openActionsMenu: "More actions",
|
|
53
55
|
closeAction: "Close",
|
|
54
56
|
deleteCustomerAction: "Delete customer",
|
|
55
57
|
deleteVendorAction: "Delete vendor",
|
|
56
58
|
summaryAmountDue: "Amount due",
|
|
57
59
|
summaryBalanceDue: "Balance due",
|
|
58
60
|
summaryBilled: "Billed",
|
|
61
|
+
summaryInvoiced: "Invoiced",
|
|
59
62
|
summaryReceived: "Received",
|
|
60
63
|
summaryPaid: "Paid",
|
|
61
64
|
summaryRejected: "Rejected",
|
|
62
65
|
overdueTag: "Overdue",
|
|
63
|
-
sendPaymentAction: "
|
|
66
|
+
sendPaymentAction: "Add a bill",
|
|
64
67
|
issueInvoiceAction: "Issue an invoice",
|
|
65
68
|
recentCustomerDocumentsHeading: "Recent invoices",
|
|
66
69
|
recentVendorDocumentsHeading: "Recent bills",
|
|
67
|
-
recentCustomerDocumentsDescription: "
|
|
68
|
-
recentVendorDocumentsDescription: "
|
|
70
|
+
recentCustomerDocumentsDescription: "Most recent",
|
|
71
|
+
recentVendorDocumentsDescription: "Most recent",
|
|
69
72
|
viewAllDocumentsAction: "View all",
|
|
70
73
|
subtitleTemplate: "{type} · Added {date}",
|
|
71
74
|
customerSubtitleLabel: "Customer",
|
|
@@ -84,49 +87,25 @@ var i = {
|
|
|
84
87
|
rowPhone: "Phone",
|
|
85
88
|
rowTaxIdSsn: "Tax ID / SSN",
|
|
86
89
|
rowTaxIdEin: "Tax ID / EIN",
|
|
87
|
-
showTaxId: "Show",
|
|
88
|
-
hideTaxId: "Hide",
|
|
90
|
+
showTaxId: "Show tax ID",
|
|
91
|
+
hideTaxId: "Hide tax ID",
|
|
89
92
|
customerTaxIdHelp: "Required only if you'll issue a 1099 IRS form at year-end.",
|
|
90
93
|
vendorTaxIdHelp: "Required only if you'll file a 1099 IRS form for this vendor at year-end.",
|
|
91
94
|
addressHeading: "Address",
|
|
92
|
-
|
|
93
|
-
addAddressAction: "Add address",
|
|
94
|
-
editAddressAction: "Edit address",
|
|
95
|
-
noAddress: "No address on file.",
|
|
95
|
+
noAddress: "No address on file",
|
|
96
96
|
paymentMethodsHeading: "Accepted payment methods",
|
|
97
97
|
paymentMethodsDescription: "ACH bank transfer details for this vendor.",
|
|
98
98
|
addPaymentMethodAction: "Add payment method",
|
|
99
99
|
editPaymentMethodAction: "Edit payment method",
|
|
100
|
-
|
|
100
|
+
paymentMethodActionsMenu: "More payment method actions",
|
|
101
|
+
deletePaymentMethodAction: "Remove payment method",
|
|
101
102
|
incompletePaymentMethod: "Incomplete",
|
|
102
103
|
accountHolderLabel: "Account holder",
|
|
103
104
|
accountNumberLabel: "Account number",
|
|
104
105
|
routingNumberLabel: "Routing number",
|
|
105
106
|
noPaymentMethods: "No payment methods yet.",
|
|
106
107
|
editButton: "Edit",
|
|
107
|
-
billStatusBadge:
|
|
108
|
-
invoiceStatusBadge:
|
|
109
|
-
optionalSuffix: "(optional)",
|
|
110
|
-
editingCustomerDetailsHeading: "Editing customer details",
|
|
111
|
-
editingVendorDetailsHeading: "Editing vendor details",
|
|
112
|
-
firstNameLabel: "First name",
|
|
113
|
-
lastNameLabel: "Last name",
|
|
114
|
-
businessNameLabel: "Business name",
|
|
115
|
-
remindersCheckboxLabel: "Payment reminders",
|
|
116
|
-
remindersCheckboxDescription: "Send automatic reminders for unpaid customer invoices.",
|
|
117
|
-
taxIdSsnPlaceholder: "e.g., 034-56-7890",
|
|
118
|
-
taxIdEinPlaceholder: "e.g., 12-3456789",
|
|
119
|
-
editingAddressHeading: "Editing address",
|
|
120
|
-
addingAddressHeading: "Adding address",
|
|
121
|
-
streetAddressLabel: "Address line 1",
|
|
122
|
-
addressLine2Label: "Address line 2",
|
|
123
|
-
cityLabel: "City",
|
|
124
|
-
stateLabel: "State",
|
|
125
|
-
statePlaceholder: "Select a state",
|
|
126
|
-
postalCodeLabel: "Postal code",
|
|
127
|
-
countryLabel: "Country",
|
|
128
|
-
countryUnitedStates: "United States",
|
|
129
|
-
cancelButton: "Cancel",
|
|
130
|
-
saveButton: "Save"
|
|
108
|
+
billStatusBadge: t,
|
|
109
|
+
invoiceStatusBadge: n
|
|
131
110
|
};
|
|
132
|
-
export {
|
|
111
|
+
export { r as COUNTERPARTS_SCREEN_LABELS_EN, i as COUNTERPART_DETAILS_SHEET_LABELS_EN };
|
|
@@ -1,113 +1,97 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { EmptyState as
|
|
3
|
-
import { ErrorState as
|
|
1
|
+
import { Alert as e, AlertDescription as t, Button as n, DataTable as r, DataTableSortableHeader as i, FilterTag as a, SearchInput as o, Select as s, SelectContent as c, SelectItem as l, SelectTrigger as u, SelectValue as d, Skeleton as f, TableToolbar as p } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { EmptyState as m } from "../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
|
|
3
|
+
import { ErrorState as h } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
4
|
+
import { NoAccessState as g } from "../../../shared/ui/dist/lib/StatePanel/NoAccessState.js";
|
|
4
5
|
import "../../../shared/ui/dist/index.js";
|
|
5
|
-
import { COUNTERPARTS_SCREEN_LABELS_EN as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import {
|
|
6
|
+
import { COUNTERPARTS_SCREEN_LABELS_EN as _ } from "./index2.js";
|
|
7
|
+
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
8
|
+
import { TriangleAlertIcon as x } from "lucide-react";
|
|
8
9
|
// ../../libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js
|
|
9
|
-
var
|
|
10
|
+
var S = [
|
|
10
11
|
10,
|
|
11
12
|
25,
|
|
12
13
|
50,
|
|
13
14
|
100
|
|
14
|
-
];
|
|
15
|
-
function
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
className: "ttw:
|
|
18
|
-
|
|
15
|
+
], C = "all";
|
|
16
|
+
function w({ labels: e, filters: t, disabled: r, action: i }) {
|
|
17
|
+
return /* @__PURE__ */ y(p, {
|
|
18
|
+
className: "ttw:px-4",
|
|
19
|
+
search: /* @__PURE__ */ y(o, {
|
|
19
20
|
value: t.searchValue,
|
|
20
21
|
onChange: (e) => t.onSearchChange(e.target.value),
|
|
21
22
|
placeholder: e.searchPlaceholder,
|
|
22
23
|
"aria-label": e.searchLabel,
|
|
23
|
-
disabled:
|
|
24
|
+
disabled: r,
|
|
24
25
|
className: "ttw:min-w-64"
|
|
25
26
|
}),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
children: /* @__PURE__ */
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}), /* @__PURE__ */ g(s, {
|
|
42
|
-
align: "start",
|
|
43
|
-
className: t.isTypePanelOpen ? "ttw:w-56 ttw:p-0" : "ttw:w-52 ttw:p-0",
|
|
44
|
-
children: [t.isMenuOpen && /* @__PURE__ */ h("div", {
|
|
45
|
-
className: "ttw:p-1",
|
|
46
|
-
children: /* @__PURE__ */ g("button", {
|
|
47
|
-
type: "button",
|
|
48
|
-
className: "ttw:flex ttw:w-full ttw:cursor-pointer ttw:items-center ttw:gap-2 ttw:rounded-md ttw:px-2 ttw:py-1.5 ttw:text-xs ttw:font-medium ttw:transition-colors ttw:hover:bg-accent",
|
|
49
|
-
onClick: t.onTypeFieldSelect,
|
|
50
|
-
children: [/* @__PURE__ */ h(b, {
|
|
51
|
-
className: "ttw:size-4 ttw:shrink-0 ttw:text-muted-foreground",
|
|
52
|
-
"aria-hidden": !0
|
|
53
|
-
}), e.filterFieldType]
|
|
54
|
-
})
|
|
55
|
-
}), t.isTypePanelOpen && /* @__PURE__ */ h(a, {
|
|
56
|
-
options: [...t.typeOptions],
|
|
57
|
-
selectedValues: [...t.selectedTypes],
|
|
58
|
-
onSelectionChange: t.onTypeChange
|
|
59
|
-
})]
|
|
60
|
-
})]
|
|
27
|
+
filters: /* @__PURE__ */ b(s, {
|
|
28
|
+
value: t.selectedType || C,
|
|
29
|
+
onValueChange: (e) => t.onTypeChange(e === C ? "" : e),
|
|
30
|
+
disabled: r,
|
|
31
|
+
children: [/* @__PURE__ */ y(u, {
|
|
32
|
+
size: "sm",
|
|
33
|
+
"aria-label": e.entityFilterLabel,
|
|
34
|
+
children: /* @__PURE__ */ y(d, {})
|
|
35
|
+
}), /* @__PURE__ */ b(c, { children: [/* @__PURE__ */ y(l, {
|
|
36
|
+
value: C,
|
|
37
|
+
children: e.entityFilterAll
|
|
38
|
+
}), t.typeOptions.map((e) => /* @__PURE__ */ y(l, {
|
|
39
|
+
value: e.value,
|
|
40
|
+
children: e.label
|
|
41
|
+
}, e.value))] })]
|
|
61
42
|
}),
|
|
62
|
-
|
|
43
|
+
action: i,
|
|
44
|
+
tags: t.chips.length > 0 ? /* @__PURE__ */ b(v, { children: [t.chips.map((n) => /* @__PURE__ */ y(a, {
|
|
63
45
|
label: n.label,
|
|
64
|
-
variant: "default",
|
|
65
46
|
labels: { remove: e.filterChipRemove },
|
|
66
47
|
onDismiss: () => t.onRemoveChip(n.key)
|
|
67
|
-
}, n.key)),
|
|
48
|
+
}, n.key)), /* @__PURE__ */ y(n, {
|
|
68
49
|
type: "button",
|
|
69
|
-
|
|
50
|
+
variant: "link",
|
|
70
51
|
onClick: t.onClearAll,
|
|
71
52
|
children: e.clearAllFilters
|
|
72
|
-
})] })
|
|
53
|
+
})] }) : void 0
|
|
73
54
|
});
|
|
74
55
|
}
|
|
75
|
-
function
|
|
76
|
-
return /* @__PURE__ */
|
|
77
|
-
className: "ttw:flex ttw:justify-end",
|
|
78
|
-
children: t ? /* @__PURE__ */
|
|
79
|
-
className: n,
|
|
80
|
-
children: e
|
|
81
|
-
})
|
|
56
|
+
function T({ value: e, isLoading: t }) {
|
|
57
|
+
return /* @__PURE__ */ y("div", {
|
|
58
|
+
className: "ttw:flex ttw:justify-end ttw:tabular-nums",
|
|
59
|
+
children: t ? /* @__PURE__ */ y(f, { className: "ttw:h-4 ttw:w-20" }) : e
|
|
82
60
|
});
|
|
83
61
|
}
|
|
84
|
-
function
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
62
|
+
function E({ labels: r, onRetry: i }) {
|
|
63
|
+
return /* @__PURE__ */ b(e, {
|
|
64
|
+
variant: "warning",
|
|
65
|
+
children: [/* @__PURE__ */ y(x, {}), /* @__PURE__ */ y(t, { children: /* @__PURE__ */ b("div", {
|
|
66
|
+
className: "ttw:flex ttw:w-full ttw:flex-wrap ttw:items-center ttw:justify-between ttw:gap-2",
|
|
67
|
+
children: [/* @__PURE__ */ y("span", { children: r.amountsUnavailable }), i ? /* @__PURE__ */ y(n, {
|
|
68
|
+
type: "button",
|
|
69
|
+
variant: "link",
|
|
70
|
+
className: "ttw:h-auto ttw:p-0 ttw:text-current",
|
|
71
|
+
onClick: i,
|
|
72
|
+
children: r.amountsRetry
|
|
73
|
+
}) : null]
|
|
74
|
+
}) })]
|
|
75
|
+
});
|
|
76
|
+
}
|
|
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 = {
|
|
79
|
+
..._,
|
|
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 = [
|
|
89
82
|
{
|
|
90
83
|
accessorKey: "name",
|
|
91
84
|
enableSorting: !0,
|
|
92
|
-
header: ({ column:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
variant: "ghost",
|
|
98
|
-
size: "icon-sm",
|
|
99
|
-
"aria-label": R.sortByName,
|
|
100
|
-
onClick: () => t.toggleSorting(n === "asc"),
|
|
101
|
-
children: h(n === "asc" ? y : n === "desc" ? _ : v, { className: "ttw:size-4" })
|
|
102
|
-
})]
|
|
103
|
-
});
|
|
104
|
-
},
|
|
105
|
-
cell: ({ row: e }) => /* @__PURE__ */ g("div", {
|
|
85
|
+
header: ({ column: e }) => /* @__PURE__ */ y(i, {
|
|
86
|
+
column: e,
|
|
87
|
+
title: B.columnName
|
|
88
|
+
}),
|
|
89
|
+
cell: ({ row: e }) => /* @__PURE__ */ b("div", {
|
|
106
90
|
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
107
|
-
children: [/* @__PURE__ */
|
|
108
|
-
className: "ttw:font-
|
|
91
|
+
children: [/* @__PURE__ */ y("span", {
|
|
92
|
+
className: "ttw:font-medium",
|
|
109
93
|
children: e.original.name
|
|
110
|
-
}), e.original.locationLabel && /* @__PURE__ */
|
|
94
|
+
}), e.original.locationLabel && /* @__PURE__ */ y("span", {
|
|
111
95
|
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
112
96
|
children: e.original.locationLabel
|
|
113
97
|
})]
|
|
@@ -115,84 +99,123 @@ function w({ mode: n, counterparts: r, isLoading: i, isError: a, errorTitle: o,
|
|
|
115
99
|
},
|
|
116
100
|
{
|
|
117
101
|
accessorKey: "billedAmountLabel",
|
|
118
|
-
header: () => /* @__PURE__ */
|
|
102
|
+
header: () => /* @__PURE__ */ y("div", {
|
|
119
103
|
className: "ttw:text-right",
|
|
120
|
-
children:
|
|
104
|
+
children: H
|
|
121
105
|
}),
|
|
122
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
106
|
+
cell: ({ row: e }) => /* @__PURE__ */ y(T, {
|
|
123
107
|
value: e.original.billedAmountLabel,
|
|
124
108
|
isLoading: e.original.isBilledAmountLoading
|
|
125
109
|
})
|
|
126
110
|
},
|
|
127
111
|
{
|
|
128
112
|
accessorKey: "receivedOrPaidAmountLabel",
|
|
129
|
-
header: () => /* @__PURE__ */
|
|
113
|
+
header: () => /* @__PURE__ */ y("div", {
|
|
130
114
|
className: "ttw:text-right",
|
|
131
|
-
children:
|
|
115
|
+
children: U
|
|
132
116
|
}),
|
|
133
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
117
|
+
cell: ({ row: e }) => /* @__PURE__ */ y(T, {
|
|
134
118
|
value: e.original.receivedOrPaidAmountLabel,
|
|
135
|
-
isLoading: e.original.isReceivedOrPaidAmountLoading
|
|
136
|
-
colorClass: e.original.isReceivedOrPaidPositive ? "ttw:text-green-700" : void 0
|
|
119
|
+
isLoading: e.original.isReceivedOrPaidAmountLoading
|
|
137
120
|
})
|
|
138
121
|
},
|
|
139
122
|
{
|
|
140
123
|
accessorKey: "dueOrOwedAmountLabel",
|
|
141
|
-
header: () => /* @__PURE__ */
|
|
124
|
+
header: () => /* @__PURE__ */ y("div", {
|
|
142
125
|
className: "ttw:text-right",
|
|
143
|
-
children:
|
|
126
|
+
children: W
|
|
144
127
|
}),
|
|
145
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
128
|
+
cell: ({ row: e }) => /* @__PURE__ */ y(T, {
|
|
146
129
|
value: e.original.dueOrOwedAmountLabel,
|
|
147
130
|
isLoading: e.original.isDueOrOwedAmountLoading
|
|
148
131
|
})
|
|
149
132
|
}
|
|
150
|
-
],
|
|
151
|
-
|
|
133
|
+
], K = (e) => /* @__PURE__ */ b("div", {
|
|
134
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2",
|
|
135
|
+
children: [/* @__PURE__ */ b("div", {
|
|
136
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
137
|
+
children: [/* @__PURE__ */ y("span", {
|
|
138
|
+
className: "ttw:font-medium",
|
|
139
|
+
children: e.name
|
|
140
|
+
}), e.locationLabel && /* @__PURE__ */ y("span", {
|
|
141
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
142
|
+
children: e.locationLabel
|
|
143
|
+
})]
|
|
144
|
+
}), [
|
|
145
|
+
{
|
|
146
|
+
label: H,
|
|
147
|
+
value: e.billedAmountLabel,
|
|
148
|
+
isLoading: e.isBilledAmountLoading
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
label: U,
|
|
152
|
+
value: e.receivedOrPaidAmountLabel,
|
|
153
|
+
isLoading: e.isReceivedOrPaidAmountLoading
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
label: W,
|
|
157
|
+
value: e.dueOrOwedAmountLabel,
|
|
158
|
+
isLoading: e.isDueOrOwedAmountLoading
|
|
159
|
+
}
|
|
160
|
+
].map((e) => /* @__PURE__ */ b("div", {
|
|
161
|
+
className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-4 ttw:text-sm",
|
|
162
|
+
children: [/* @__PURE__ */ y("span", {
|
|
163
|
+
className: "ttw:text-muted-foreground",
|
|
164
|
+
children: e.label
|
|
165
|
+
}), /* @__PURE__ */ y(T, {
|
|
166
|
+
value: e.value,
|
|
167
|
+
isLoading: e.isLoading
|
|
168
|
+
})]
|
|
169
|
+
}, 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
|
|
175
|
+
}) : o ? /* @__PURE__ */ y(h, {
|
|
176
|
+
title: s,
|
|
177
|
+
description: c,
|
|
178
|
+
retryLabel: I ? B.errorRetry : void 0,
|
|
179
|
+
onRetry: I
|
|
180
|
+
}) : /* @__PURE__ */ b("div", {
|
|
152
181
|
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
153
|
-
children: [
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}) : /* @__PURE__ */ h(t, {
|
|
169
|
-
columns: H,
|
|
170
|
-
data: r,
|
|
171
|
-
isLoading: i,
|
|
172
|
-
sorting: c,
|
|
173
|
-
onSortingChange: l,
|
|
174
|
-
pageSize: u,
|
|
175
|
-
onPageSizeChange: m,
|
|
176
|
-
pageSizeOptions: b,
|
|
177
|
-
hasNextPage: w,
|
|
178
|
-
hasPrevPage: T,
|
|
179
|
-
onNextPage: E,
|
|
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,
|
|
180
197
|
onPrevPage: D,
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
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,
|
|
185
204
|
filters: O,
|
|
186
|
-
disabled:
|
|
205
|
+
disabled: Z,
|
|
206
|
+
action: te ? /* @__PURE__ */ y(n, {
|
|
207
|
+
onClick: P,
|
|
208
|
+
children: ne
|
|
209
|
+
}) : void 0
|
|
187
210
|
}),
|
|
188
|
-
children: /* @__PURE__ */
|
|
189
|
-
testId:
|
|
190
|
-
title: k ?
|
|
191
|
-
description: k ?
|
|
192
|
-
actionLabel: k ?
|
|
193
|
-
onAction: k ? O.onClearAll :
|
|
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
|
|
194
217
|
})
|
|
195
218
|
})]
|
|
196
219
|
});
|
|
197
220
|
}
|
|
198
|
-
export {
|
|
221
|
+
export { D as CounterpartsScreen, D as default };
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
// ../../libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
2
|
+
var e = {
|
|
3
|
+
neutral: { tone: "neutral" },
|
|
4
|
+
accent: { accent: "violet" },
|
|
5
|
+
info: { tone: "info" },
|
|
6
|
+
committed: { accent: "cyan" },
|
|
7
|
+
success: { tone: "success" },
|
|
8
|
+
settled: { tone: "success" },
|
|
9
|
+
warning: { tone: "warning" },
|
|
10
|
+
danger: { tone: "destructive" }
|
|
11
|
+
}, t = {
|
|
12
|
+
neutral: { tone: "neutral" },
|
|
13
|
+
cyan: { accent: "cyan" },
|
|
14
|
+
success: { tone: "success" },
|
|
15
|
+
purple: { accent: "violet" },
|
|
16
|
+
orange: { tone: "destructive" },
|
|
17
|
+
danger: { tone: "destructive" }
|
|
18
|
+
};
|
|
19
|
+
export { e as BILL_STATUS_BADGE_COLOR, t as INVOICE_STATUS_BADGE_COLOR };
|