@tesouro/embedded-components-react 0.11.65 → 0.11.66
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 +14 -14
- package/dist/index.css +6 -24
- package/dist/index.d.ts +27 -39
- package/dist/lib/CounterpartsWidget.d.ts +26 -39
- package/dist/lib/CounterpartsWidgetPublic.d.ts +26 -39
- package/dist/lib/CustomersWidget.d.ts +26 -39
- package/dist/lib/ReceivablesWidget.d.ts +14 -4
- 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
|
@@ -767,23 +767,33 @@ interface CounterpartMessageLabels {
|
|
|
767
767
|
accountNumberInvalid: string;
|
|
768
768
|
/** Shown for a non-field-specific submit failure. */
|
|
769
769
|
genericError: string;
|
|
770
|
-
/**
|
|
770
|
+
/** @deprecated Unused; the list labels its own warning. */
|
|
771
771
|
amountsUnavailable: string;
|
|
772
772
|
/** Delete confirmation title; `{name}` is replaced with the entity name. */
|
|
773
773
|
deleteTitle: string;
|
|
774
|
-
/** Delete confirmation title for a bank account; `{account}` is display-ready. */
|
|
775
774
|
deleteBankAccountTitle: string;
|
|
775
|
+
deleteBankAccountConfirm: string;
|
|
776
776
|
deleteCounterpartMessage: string;
|
|
777
777
|
deleteBankAccountMessage: string;
|
|
778
|
-
/**
|
|
778
|
+
/** @deprecated No longer shown. Use `customerAdded` / `vendorAdded`. */
|
|
779
779
|
createSucceeded: string;
|
|
780
|
-
/**
|
|
780
|
+
/** @deprecated No longer shown. Use `customerUpdated` / `vendorUpdated`. */
|
|
781
781
|
updateSucceeded: string;
|
|
782
|
+
customerAdded: string;
|
|
783
|
+
vendorAdded: string;
|
|
784
|
+
customerUpdated: string;
|
|
785
|
+
vendorUpdated: string;
|
|
782
786
|
addressAdded: string;
|
|
783
787
|
addressUpdated: string;
|
|
784
788
|
bankAccountAdded: string;
|
|
785
789
|
bankAccountUpdated: string;
|
|
790
|
+
/**
|
|
791
|
+
* @deprecated Used only when the delete controller gets no `counterpartType`;
|
|
792
|
+
* users never see the word "counterpart". Use `customerDeleted` / `vendorDeleted`.
|
|
793
|
+
*/
|
|
786
794
|
counterpartDeleted: string;
|
|
795
|
+
customerDeleted: string;
|
|
796
|
+
vendorDeleted: string;
|
|
787
797
|
bankAccountDeleted: string;
|
|
788
798
|
/** Error toast when a counterpart delete fails without an API message. */
|
|
789
799
|
deleteCounterpartFailed: string;
|
|
@@ -822,8 +832,8 @@ interface CounterpartsScreenLabels {
|
|
|
822
832
|
/** Vendor-mode create action. */
|
|
823
833
|
vendorsCreateButton: string;
|
|
824
834
|
columnName: string;
|
|
825
|
-
sortByName: string;
|
|
826
835
|
columnBilledAmount: string;
|
|
836
|
+
columnInvoicedAmount: string;
|
|
827
837
|
columnReceivedAmount: string;
|
|
828
838
|
columnAmountDue: string;
|
|
829
839
|
columnTotalPaidToDate: string;
|
|
@@ -838,15 +848,14 @@ interface CounterpartsScreenLabels {
|
|
|
838
848
|
unnamedCounterpart: string;
|
|
839
849
|
searchPlaceholder: string;
|
|
840
850
|
searchLabel: string;
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
851
|
+
entityFilterLabel: string;
|
|
852
|
+
entityFilterAll: string;
|
|
853
|
+
entityFilterOrganization: string;
|
|
854
|
+
entityFilterIndividual: string;
|
|
844
855
|
filterChipRemove: string;
|
|
845
856
|
typeChip: (value: string) => string;
|
|
846
857
|
searchChip: (value: string) => string;
|
|
847
858
|
clearAllFilters: string;
|
|
848
|
-
entityFilterOrganization: string;
|
|
849
|
-
entityFilterIndividual: string;
|
|
850
859
|
customersEmptyTitle: string;
|
|
851
860
|
customersEmptyDescription: string;
|
|
852
861
|
customersEmptyAction: string;
|
|
@@ -864,14 +873,16 @@ interface CounterpartsScreenLabels {
|
|
|
864
873
|
errorRetry: string;
|
|
865
874
|
accessRestrictedTitle: string;
|
|
866
875
|
accessRestrictedDescription: string;
|
|
876
|
+
amountsUnavailable: string;
|
|
877
|
+
amountsRetry: string;
|
|
867
878
|
}
|
|
868
879
|
interface CounterpartDetailsSheetLabels {
|
|
869
|
-
hiddenDescription: string;
|
|
870
880
|
loadingTitle: string;
|
|
871
881
|
notFoundCustomerTitle: string;
|
|
872
882
|
notFoundVendorTitle: string;
|
|
873
883
|
notFoundCustomerDescription: string;
|
|
874
884
|
notFoundVendorDescription: string;
|
|
885
|
+
reloadFailed: string;
|
|
875
886
|
openActionsMenu: string;
|
|
876
887
|
closeAction: string;
|
|
877
888
|
deleteCustomerAction: string;
|
|
@@ -879,10 +890,12 @@ interface CounterpartDetailsSheetLabels {
|
|
|
879
890
|
summaryAmountDue: string;
|
|
880
891
|
summaryBalanceDue: string;
|
|
881
892
|
summaryBilled: string;
|
|
893
|
+
summaryInvoiced: string;
|
|
882
894
|
summaryReceived: string;
|
|
883
895
|
summaryPaid: string;
|
|
884
896
|
summaryRejected: string;
|
|
885
897
|
overdueTag: string;
|
|
898
|
+
/** Vendor footer action ("Add a bill"); the key predates the copy. */
|
|
886
899
|
sendPaymentAction: string;
|
|
887
900
|
issueInvoiceAction: string;
|
|
888
901
|
recentCustomerDocumentsHeading: string;
|
|
@@ -913,15 +926,12 @@ interface CounterpartDetailsSheetLabels {
|
|
|
913
926
|
customerTaxIdHelp: string;
|
|
914
927
|
vendorTaxIdHelp: string;
|
|
915
928
|
addressHeading: string;
|
|
916
|
-
/** Customer mode's own section heading — vendor mode uses `addressHeading` as a `DetailLine` row label instead. */
|
|
917
|
-
customerAddressHeading: string;
|
|
918
|
-
addAddressAction: string;
|
|
919
|
-
editAddressAction: string;
|
|
920
929
|
noAddress: string;
|
|
921
930
|
paymentMethodsHeading: string;
|
|
922
931
|
paymentMethodsDescription: string;
|
|
923
932
|
addPaymentMethodAction: string;
|
|
924
933
|
editPaymentMethodAction: string;
|
|
934
|
+
paymentMethodActionsMenu: string;
|
|
925
935
|
deletePaymentMethodAction: string;
|
|
926
936
|
incompletePaymentMethod: string;
|
|
927
937
|
accountHolderLabel: string;
|
|
@@ -929,32 +939,8 @@ interface CounterpartDetailsSheetLabels {
|
|
|
929
939
|
routingNumberLabel: string;
|
|
930
940
|
noPaymentMethods: string;
|
|
931
941
|
editButton: string;
|
|
932
|
-
/** Overrides for the shared bill status badge in recent documents. */
|
|
933
942
|
billStatusBadge: Partial<BillStatusBadgeLabels>;
|
|
934
|
-
/** Overrides for the shared invoice status badge in recent documents. */
|
|
935
943
|
invoiceStatusBadge: Partial<ReceivableStatusBadgeLabels>;
|
|
936
|
-
optionalSuffix: string;
|
|
937
|
-
editingCustomerDetailsHeading: string;
|
|
938
|
-
editingVendorDetailsHeading: string;
|
|
939
|
-
firstNameLabel: string;
|
|
940
|
-
lastNameLabel: string;
|
|
941
|
-
businessNameLabel: string;
|
|
942
|
-
remindersCheckboxLabel: string;
|
|
943
|
-
remindersCheckboxDescription: string;
|
|
944
|
-
taxIdSsnPlaceholder: string;
|
|
945
|
-
taxIdEinPlaceholder: string;
|
|
946
|
-
editingAddressHeading: string;
|
|
947
|
-
addingAddressHeading: string;
|
|
948
|
-
streetAddressLabel: string;
|
|
949
|
-
addressLine2Label: string;
|
|
950
|
-
cityLabel: string;
|
|
951
|
-
stateLabel: string;
|
|
952
|
-
statePlaceholder: string;
|
|
953
|
-
postalCodeLabel: string;
|
|
954
|
-
countryLabel: string;
|
|
955
|
-
countryUnitedStates: string;
|
|
956
|
-
cancelButton: string;
|
|
957
|
-
saveButton: string;
|
|
958
944
|
}
|
|
959
945
|
|
|
960
946
|
/**
|
|
@@ -986,6 +972,7 @@ interface CustomersWidgetOwnProps {
|
|
|
986
972
|
screenLabels?: Partial<CounterpartsScreenLabels>;
|
|
987
973
|
formLabels?: PartialDeep<CounterpartFormSheetLabels>;
|
|
988
974
|
detailsLabels?: Partial<CounterpartDetailsSheetLabels>;
|
|
975
|
+
/** @deprecated Unused; relabel the address through `formLabels.address`. */
|
|
989
976
|
addressLabels?: PartialDeep<AddressFormSheetLabels>;
|
|
990
977
|
deleteLabels?: Partial<ConfirmDeleteDialogLabels>;
|
|
991
978
|
/** Overrides for validation / error / delete-prompt messages. */
|
|
@@ -838,23 +838,33 @@ interface CounterpartMessageLabels {
|
|
|
838
838
|
accountNumberInvalid: string;
|
|
839
839
|
/** Shown for a non-field-specific submit failure. */
|
|
840
840
|
genericError: string;
|
|
841
|
-
/**
|
|
841
|
+
/** @deprecated Unused; the list labels its own warning. */
|
|
842
842
|
amountsUnavailable: string;
|
|
843
843
|
/** Delete confirmation title; `{name}` is replaced with the entity name. */
|
|
844
844
|
deleteTitle: string;
|
|
845
|
-
/** Delete confirmation title for a bank account; `{account}` is display-ready. */
|
|
846
845
|
deleteBankAccountTitle: string;
|
|
846
|
+
deleteBankAccountConfirm: string;
|
|
847
847
|
deleteCounterpartMessage: string;
|
|
848
848
|
deleteBankAccountMessage: string;
|
|
849
|
-
/**
|
|
849
|
+
/** @deprecated No longer shown. Use `customerAdded` / `vendorAdded`. */
|
|
850
850
|
createSucceeded: string;
|
|
851
|
-
/**
|
|
851
|
+
/** @deprecated No longer shown. Use `customerUpdated` / `vendorUpdated`. */
|
|
852
852
|
updateSucceeded: string;
|
|
853
|
+
customerAdded: string;
|
|
854
|
+
vendorAdded: string;
|
|
855
|
+
customerUpdated: string;
|
|
856
|
+
vendorUpdated: string;
|
|
853
857
|
addressAdded: string;
|
|
854
858
|
addressUpdated: string;
|
|
855
859
|
bankAccountAdded: string;
|
|
856
860
|
bankAccountUpdated: string;
|
|
861
|
+
/**
|
|
862
|
+
* @deprecated Used only when the delete controller gets no `counterpartType`;
|
|
863
|
+
* users never see the word "counterpart". Use `customerDeleted` / `vendorDeleted`.
|
|
864
|
+
*/
|
|
857
865
|
counterpartDeleted: string;
|
|
866
|
+
customerDeleted: string;
|
|
867
|
+
vendorDeleted: string;
|
|
858
868
|
bankAccountDeleted: string;
|
|
859
869
|
/** Error toast when a counterpart delete fails without an API message. */
|
|
860
870
|
deleteCounterpartFailed: string;
|
|
@@ -38,17 +38,13 @@ function p({ counterpartId: p, counterpartType: m, onClose: h, onViewAllDocument
|
|
|
38
38
|
setView: D,
|
|
39
39
|
details: O,
|
|
40
40
|
messages: w
|
|
41
|
-
}), {
|
|
42
|
-
j(), M(),
|
|
43
|
-
}, [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
N
|
|
47
|
-
|
|
48
|
-
F !== p && (I(p), P());
|
|
49
|
-
let L = c(() => {
|
|
50
|
-
P(), h();
|
|
51
|
-
}, [P, h]);
|
|
41
|
+
}), { close: j } = A.bank.form, { close: M } = A.del, N = c(() => {
|
|
42
|
+
j(), M(), D("none");
|
|
43
|
+
}, [j, M]), [P, F] = u(p);
|
|
44
|
+
P !== p && (F(p), N());
|
|
45
|
+
let I = c(() => {
|
|
46
|
+
N(), h();
|
|
47
|
+
}, [N, h]);
|
|
52
48
|
return /* @__PURE__ */ d(a, {
|
|
53
49
|
counterpartType: m,
|
|
54
50
|
open: S.canRead && p !== void 0,
|
|
@@ -60,7 +56,7 @@ function p({ counterpartId: p, counterpartType: m, onClose: h, onViewAllDocument
|
|
|
60
56
|
stateOptions: T,
|
|
61
57
|
canEdit: S.canUpdate,
|
|
62
58
|
canDelete: !1,
|
|
63
|
-
onClose:
|
|
59
|
+
onClose: I,
|
|
64
60
|
onViewAllDocuments: g,
|
|
65
61
|
onCreateDocument: _,
|
|
66
62
|
detailsLabels: v,
|
|
@@ -2,135 +2,118 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { CounterpartFormSheet as e } from "../../../../../shared/counterpart-management/ui/dist/index10.js";
|
|
6
|
+
import { BankAccountFormSheet as t } from "../../../../../shared/counterpart-management/ui/dist/index11.js";
|
|
7
|
+
import { ConfirmDeleteDialog as n } from "../../../../../shared/counterpart-management/ui/dist/index13.js";
|
|
8
|
+
import { buildCounterpartFormTaxIdField as r } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
7
9
|
import "../../../../../shared/counterpart-management/feature/dist/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { CounterpartDetailsSheet as c } from "../../../../ui/dist/index7.js";
|
|
10
|
+
import { COUNTERPART_DETAILS_SHEET_LABELS_EN as i } from "../../../../ui/dist/index2.js";
|
|
11
|
+
import { CounterpartDetailsSheet as a } from "../../../../ui/dist/index5.js";
|
|
11
12
|
import "../../../../ui/dist/index.js";
|
|
12
|
-
import { useMemo as
|
|
13
|
-
import { Fragment as
|
|
13
|
+
import { useMemo as o } from "react";
|
|
14
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
14
15
|
// ../../libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsPanel.js
|
|
15
|
-
function
|
|
16
|
-
let { form:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
j.errors,
|
|
24
|
-
j.values,
|
|
25
|
-
V,
|
|
26
|
-
g
|
|
27
|
-
]), G = l(() => h && v ? {
|
|
28
|
-
id: h,
|
|
29
|
-
name: v.name
|
|
30
|
-
} : void 0, [v, h]);
|
|
31
|
-
return /* @__PURE__ */ f(u, { children: [
|
|
32
|
-
/* @__PURE__ */ d(c, {
|
|
33
|
-
open: m,
|
|
16
|
+
function u({ counterpartType: u, open: d, selectedId: f, view: p, details: m, detailsSheetView: h, actions: g, stateOptions: _, canEdit: v, canDelete: y, onClose: b, onViewAllDocuments: x, onCreateDocument: S, formLabels: C, detailsLabels: w, bankAccountLabels: T, deleteLabels: E }) {
|
|
17
|
+
let { form: D, bank: O, del: k } = g, A = !m.isAddressesLoading && !m.isAddressesFetching && !m.isAddressesError, j = !m.isLoading && !m.isFetching && !m.isError, M = A && j, N = !m.isBankAccountsLoading && !m.isBankAccountsFetching && !m.isBankAccountsError, P = p === "edit", F = w?.reloadFailed ?? i.reloadFailed, I = m.isError || m.isAddressesError, L = o(() => f && h ? {
|
|
18
|
+
id: f,
|
|
19
|
+
name: h.name
|
|
20
|
+
} : void 0, [h, f]);
|
|
21
|
+
return /* @__PURE__ */ l(s, { children: [
|
|
22
|
+
/* @__PURE__ */ c(a, {
|
|
23
|
+
open: d && !P,
|
|
34
24
|
onOpenChange: (e) => {
|
|
35
|
-
e ||
|
|
25
|
+
e || b();
|
|
36
26
|
},
|
|
37
|
-
privacyResetKey:
|
|
38
|
-
mode:
|
|
39
|
-
counterpart:
|
|
40
|
-
isLoading:
|
|
41
|
-
isError:
|
|
42
|
-
canEdit:
|
|
43
|
-
canEditProfile:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
onEditBankAccount: M.form.openEdit,
|
|
54
|
-
onViewAllDocuments: w && G ? () => w(G) : void 0,
|
|
55
|
-
onCreateDocument: T && G ? () => T(G) : void 0,
|
|
56
|
-
onDeleteBankAccount: (e) => P.requestDelete({
|
|
27
|
+
privacyResetKey: f,
|
|
28
|
+
mode: u,
|
|
29
|
+
counterpart: h,
|
|
30
|
+
isLoading: m.isLoading,
|
|
31
|
+
isError: m.isError,
|
|
32
|
+
canEdit: v,
|
|
33
|
+
canEditProfile: v && M,
|
|
34
|
+
canEditPaymentMethod: v && N,
|
|
35
|
+
canDelete: y,
|
|
36
|
+
onEdit: g.handleEditProfile,
|
|
37
|
+
onDelete: k.requestDeleteCounterpart,
|
|
38
|
+
onAddBankAccount: O.form.openCreate,
|
|
39
|
+
onEditBankAccount: O.form.openEdit,
|
|
40
|
+
onViewAllDocuments: x && L ? () => x(L) : void 0,
|
|
41
|
+
onCreateDocument: S && L ? () => S(L) : void 0,
|
|
42
|
+
onDeleteBankAccount: (e) => k.requestDelete({
|
|
57
43
|
kind: "bankAccount",
|
|
58
44
|
id: e,
|
|
59
|
-
label:
|
|
45
|
+
label: m.bankItems.find((t) => t.id === e)?.primary ?? ""
|
|
60
46
|
}),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
onFieldChange: (e, t) => j.setValues((r) => ({
|
|
68
|
-
...r,
|
|
69
|
-
[n[e]]: t
|
|
70
|
-
})),
|
|
71
|
-
onRemindersChange: (e) => j.setValues((t) => ({
|
|
72
|
-
...t,
|
|
73
|
-
remindersEnabled: e
|
|
74
|
-
})),
|
|
75
|
-
onAddressChange: (e) => j.setValues((t) => ({
|
|
76
|
-
...t,
|
|
77
|
-
address: {
|
|
78
|
-
...t.address,
|
|
79
|
-
...e
|
|
80
|
-
}
|
|
81
|
-
})),
|
|
82
|
-
onSubmit: j.submit,
|
|
83
|
-
onCancel: j.close
|
|
47
|
+
labels: w
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ c(e, {
|
|
50
|
+
open: d && P,
|
|
51
|
+
onOpenChange: (e) => {
|
|
52
|
+
e || D.close();
|
|
84
53
|
},
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
54
|
+
mode: "edit",
|
|
55
|
+
counterpartMode: u,
|
|
56
|
+
values: D.values,
|
|
57
|
+
errors: I ? {
|
|
58
|
+
...D.errors,
|
|
59
|
+
form: F
|
|
60
|
+
} : D.errors,
|
|
61
|
+
stateOptions: _,
|
|
62
|
+
taxIdField: r(D.values.entityType, u, C),
|
|
63
|
+
inProgress: D.isSubmitting,
|
|
64
|
+
onChange: (e) => D.setValues((t) => ({
|
|
65
|
+
...t,
|
|
66
|
+
...e
|
|
67
|
+
})),
|
|
68
|
+
onAddressChange: (e) => D.setValues((t) => ({
|
|
69
|
+
...t,
|
|
70
|
+
address: {
|
|
71
|
+
...t.address,
|
|
96
72
|
...e
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
73
|
+
}
|
|
74
|
+
})),
|
|
75
|
+
onSubmit: () => {
|
|
76
|
+
M && D.submit();
|
|
77
|
+
},
|
|
78
|
+
onCancel: D.close,
|
|
79
|
+
labels: C
|
|
102
80
|
}),
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
open:
|
|
81
|
+
/* @__PURE__ */ c(t, {
|
|
82
|
+
open: O.form.sheet.open,
|
|
105
83
|
onOpenChange: (e) => {
|
|
106
|
-
e ||
|
|
84
|
+
e || O.form.close();
|
|
107
85
|
},
|
|
108
|
-
mode:
|
|
109
|
-
values:
|
|
110
|
-
errors:
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
86
|
+
mode: O.form.sheet.mode,
|
|
87
|
+
values: O.form.values,
|
|
88
|
+
errors: m.isBankAccountsError ? {
|
|
89
|
+
...O.form.errors,
|
|
90
|
+
form: F
|
|
91
|
+
} : O.form.errors,
|
|
92
|
+
highlightedFields: O.highlightedFields,
|
|
93
|
+
inProgress: O.inProgress,
|
|
94
|
+
onChange: (e) => O.form.setValues((t) => ({
|
|
115
95
|
...t,
|
|
116
96
|
...e
|
|
117
97
|
})),
|
|
118
|
-
onSubmit:
|
|
119
|
-
|
|
120
|
-
|
|
98
|
+
onSubmit: () => {
|
|
99
|
+
N && g.submitBankAccount();
|
|
100
|
+
},
|
|
101
|
+
onCancel: O.form.close,
|
|
102
|
+
labels: T
|
|
121
103
|
}),
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
open:
|
|
104
|
+
/* @__PURE__ */ c(n, {
|
|
105
|
+
open: k.target !== null,
|
|
124
106
|
onOpenChange: (e) => {
|
|
125
|
-
e ||
|
|
107
|
+
e || k.close();
|
|
126
108
|
},
|
|
127
|
-
title:
|
|
128
|
-
message:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
109
|
+
title: k.dialogTitle,
|
|
110
|
+
message: k.dialogMessage,
|
|
111
|
+
confirmLabel: k.confirmLabel,
|
|
112
|
+
isDeleting: k.isDeleting,
|
|
113
|
+
onConfirm: k.confirm,
|
|
114
|
+
onCancel: k.close,
|
|
115
|
+
labels: E
|
|
133
116
|
})
|
|
134
117
|
] });
|
|
135
118
|
}
|
|
136
|
-
export {
|
|
119
|
+
export { u as CounterpartDetailsPanel };
|
|
@@ -19,101 +19,101 @@ 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,
|
|
23
|
-
let
|
|
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();
|
|
24
24
|
d(() => {
|
|
25
|
-
|
|
26
|
-
}, [
|
|
27
|
-
let { stateOptions:
|
|
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({
|
|
28
28
|
counterpartType: n,
|
|
29
29
|
pageSizeOptions: o,
|
|
30
30
|
detailsLabels: y,
|
|
31
|
-
messageLabels:
|
|
31
|
+
messageLabels: S,
|
|
32
32
|
screenLabels: _
|
|
33
|
-
}), { form:
|
|
33
|
+
}), { form: I } = N;
|
|
34
34
|
return /* @__PURE__ */ m(f, { children: [
|
|
35
35
|
/* @__PURE__ */ p(e, {}),
|
|
36
36
|
/* @__PURE__ */ p(s, {
|
|
37
37
|
mode: n,
|
|
38
|
-
counterparts:
|
|
39
|
-
isLoading:
|
|
40
|
-
isError:
|
|
41
|
-
errorTitle:
|
|
42
|
-
errorDescription:
|
|
43
|
-
sorting:
|
|
44
|
-
onSortingChange:
|
|
45
|
-
pageSize:
|
|
46
|
-
onPageSizeChange:
|
|
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,
|
|
47
47
|
pageSizeOptions: o,
|
|
48
|
-
hasNextPage:
|
|
49
|
-
hasPrevPage:
|
|
50
|
-
onNextPage:
|
|
51
|
-
onPrevPage:
|
|
52
|
-
filters:
|
|
53
|
-
isFiltering:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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,
|
|
59
61
|
labels: _,
|
|
60
62
|
emptyStateTestId: "counterparts-widget-empty-state",
|
|
61
63
|
accessRestrictedTestId: "counterparts-widget-access-restricted"
|
|
62
64
|
}),
|
|
63
65
|
/* @__PURE__ */ p(r, {
|
|
64
|
-
open:
|
|
66
|
+
open: E === "create",
|
|
65
67
|
onOpenChange: (e) => {
|
|
66
|
-
e ||
|
|
68
|
+
e || I.close();
|
|
67
69
|
},
|
|
68
70
|
mode: "create",
|
|
69
71
|
counterpartMode: n,
|
|
70
|
-
values:
|
|
71
|
-
errors:
|
|
72
|
-
stateOptions:
|
|
73
|
-
taxIdField: i(
|
|
74
|
-
inProgress:
|
|
75
|
-
|
|
76
|
-
onChange: (e) => L.setValues((t) => ({
|
|
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) => ({
|
|
77
78
|
...t,
|
|
78
79
|
...e
|
|
79
80
|
})),
|
|
80
|
-
onAddressChange: (e) =>
|
|
81
|
+
onAddressChange: (e) => I.setValues((t) => ({
|
|
81
82
|
...t,
|
|
82
83
|
address: {
|
|
83
84
|
...t.address,
|
|
84
85
|
...e
|
|
85
86
|
}
|
|
86
87
|
})),
|
|
87
|
-
onBankAccountChange: (e) =>
|
|
88
|
+
onBankAccountChange: (e) => I.setValues((t) => ({
|
|
88
89
|
...t,
|
|
89
90
|
bankAccount: {
|
|
90
91
|
...t.bankAccount,
|
|
91
92
|
...e
|
|
92
93
|
}
|
|
93
94
|
})),
|
|
94
|
-
onSubmit:
|
|
95
|
-
onCancel:
|
|
95
|
+
onSubmit: I.submit,
|
|
96
|
+
onCancel: I.close,
|
|
96
97
|
labels: v
|
|
97
98
|
}),
|
|
98
99
|
/* @__PURE__ */ p(c, {
|
|
99
100
|
counterpartType: n,
|
|
100
|
-
open:
|
|
101
|
-
selectedId:
|
|
102
|
-
view:
|
|
103
|
-
details:
|
|
104
|
-
detailsSheetView:
|
|
105
|
-
actions:
|
|
106
|
-
stateOptions:
|
|
107
|
-
canEdit:
|
|
108
|
-
canDelete:
|
|
109
|
-
onClose:
|
|
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,
|
|
110
111
|
onViewAllDocuments: h,
|
|
111
112
|
onCreateDocument: g,
|
|
112
113
|
formLabels: v,
|
|
113
114
|
detailsLabels: y,
|
|
114
115
|
bankAccountLabels: b,
|
|
115
|
-
|
|
116
|
-
deleteLabels: S
|
|
116
|
+
deleteLabels: x
|
|
117
117
|
})
|
|
118
118
|
] });
|
|
119
119
|
}
|