@gusto/embedded-react-sdk 0.10.7-rc.2 → 0.11.0
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/CHANGELOG.md +14 -0
- package/dist/components/Base/Base.js +19 -18
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/HamburgerMenu/HamburgerMenu.js +20 -19
- package/dist/components/Common/HamburgerMenu/HamburgerMenu.js.map +1 -1
- package/dist/components/Common/ReorderableList/ReorderableItem.js +1 -1
- package/dist/components/Common/ReorderableList/ReorderableItem.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +6 -4
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +12 -10
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +8 -6
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/Button/Button.d.ts +1 -1
- package/dist/components/Common/UI/Button/Button.js +4 -4
- package/dist/components/Common/UI/Button/Button.js.map +1 -1
- package/dist/components/Common/UI/Button/ButtonTypes.d.ts +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.d.ts +0 -5
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +40 -42
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +8 -6
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +10 -8
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.d.ts +0 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +51 -53
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +11 -11
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +8 -6
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.d.ts +0 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +40 -42
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +8 -7
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/index.d.ts +0 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +1 -1
- package/dist/components/Company/BankAccount/BankAccount.d.ts +0 -5
- package/dist/components/Company/BankAccount/BankAccount.js +17 -23
- package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.d.ts +0 -5
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +28 -31
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +11 -9
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +12 -10
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.d.ts +0 -5
- package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js +25 -28
- package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +13 -11
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.d.ts +0 -5
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js +33 -36
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +6 -4
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +7 -5
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.d.ts +0 -6
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +38 -41
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +1 -1
- package/dist/components/Company/DocumentSigner/DocumentSigner.d.ts +0 -4
- package/dist/components/Company/DocumentSigner/DocumentSigner.js +23 -26
- package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.d.ts +0 -6
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +41 -44
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +9 -7
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +7 -6
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +5 -3
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +1 -1
- package/dist/components/Company/Industry/Actions.js +7 -5
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +1 -1
- package/dist/components/Company/Industry/Edit.js +12 -10
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Industry/Industry.d.ts +0 -5
- package/dist/components/Company/Industry/Industry.js +23 -29
- package/dist/components/Company/Industry/Industry.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +8 -6
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.d.ts +0 -5
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +43 -45
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +1 -1
- package/dist/components/Company/Locations/Locations.d.ts +0 -4
- package/dist/components/Company/Locations/Locations.js +14 -18
- package/dist/components/Company/Locations/Locations.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +8 -6
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +4 -2
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.d.ts +0 -5
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +33 -35
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +14 -12
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +8 -6
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +3 -2
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.d.ts +1 -7
- package/dist/components/Company/PaySchedule/PaySchedule.js +68 -71
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +12 -10
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
- package/dist/components/Company/PaySchedule/_parts/Head.js +8 -6
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +15 -13
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +1 -1
- package/dist/components/Company/StateTaxes/StateTaxes.d.ts +0 -4
- package/dist/components/Company/StateTaxes/StateTaxes.js +16 -20
- package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +7 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.d.ts +0 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +44 -47
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +8 -6
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +7 -5
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +0 -5
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +26 -29
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +1 -1
- package/dist/components/Contractor/Address/Address.d.ts +0 -5
- package/dist/components/Contractor/Address/Address.js +36 -38
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +1 -1
- package/dist/components/Contractor/Address/useAddress.js +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +17 -16
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +7 -5
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -2
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfile.d.ts +11 -0
- package/dist/components/Contractor/Profile/ContractorProfile.js +24 -0
- package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -0
- package/dist/components/Contractor/Profile/ContractorProfileForm.d.ts +5 -0
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +140 -0
- package/dist/components/Contractor/Profile/ContractorProfileForm.js.map +1 -0
- package/dist/components/Contractor/Profile/index.d.ts +3 -0
- package/dist/components/Contractor/Profile/useContractorProfile.d.ts +254 -0
- package/dist/components/Contractor/Profile/useContractorProfile.js +223 -0
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -0
- package/dist/components/Contractor/Submit/ContractorSubmitWithApi.d.ts +6 -0
- package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js +27 -0
- package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js.map +1 -0
- package/dist/components/Contractor/Submit/SubmitDone.d.ts +5 -0
- package/dist/components/Contractor/Submit/SubmitDone.js +18 -0
- package/dist/components/Contractor/Submit/SubmitDone.js.map +1 -0
- package/dist/components/Contractor/Submit/index.d.ts +6 -0
- package/dist/components/Contractor/Submit/index.js +20 -0
- package/dist/components/Contractor/Submit/index.js.map +1 -0
- package/dist/components/Contractor/Submit/index.module.scss.js +8 -0
- package/dist/components/Contractor/Submit/index.module.scss.js.map +1 -0
- package/dist/components/Contractor/index.d.ts +2 -0
- package/dist/components/Contractor/index.js +10 -6
- package/dist/components/Contractor/index.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +6 -5
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Compensation.d.ts +0 -6
- package/dist/components/Employee/Compensation/Compensation.js +97 -102
- package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +15 -14
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +25 -23
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/Actions.js +12 -10
- package/dist/components/Employee/Deductions/Actions.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionForm.js +12 -10
- package/dist/components/Employee/Deductions/DeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList.js +7 -5
- package/dist/components/Employee/Deductions/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +12 -10
- package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/useDeductions.js +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +8 -6
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.d.ts +0 -5
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +26 -28
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +4 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentSigner.d.ts +1 -7
- package/dist/components/Employee/DocumentSigner/DocumentSigner.js +16 -20
- package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.d.ts +0 -7
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +41 -44
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +6 -4
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.d.ts +0 -5
- package/dist/components/Employee/EmployeeList/EmployeeList.js +57 -59
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +7 -5
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +15 -14
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +1 -1
- package/dist/components/Employee/Landing/Landing.js +13 -12
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/Actions.js +9 -7
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +4 -3
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +10 -8
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +3 -2
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +11 -10
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +1 -1
- package/dist/components/Employee/Profile/Actions.js +9 -7
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +3 -3
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +10 -9
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +2 -2
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
- package/dist/components/Employee/Profile/Profile.d.ts +0 -8
- package/dist/components/Employee/Profile/Profile.js +131 -138
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +1 -1
- package/dist/components/Employee/Taxes/Actions.js +10 -8
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +12 -10
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.d.ts +0 -6
- package/dist/components/Employee/Taxes/Taxes.js +76 -81
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +4 -2
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/i18n/I18n.js +1 -1
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Contractor.ContractorSubmit.json.js +22 -0
- package/dist/i18n/en/Contractor.ContractorSubmit.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Profile.json.js +73 -0
- package/dist/i18n/en/Contractor.Profile.json.js.map +1 -0
- package/dist/shared/constants.d.ts +14 -0
- package/dist/shared/constants.js +33 -26
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +77 -1
- package/package.json +2 -2
|
@@ -1,72 +1,70 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { useForm as
|
|
3
|
-
import { zodResolver as
|
|
4
|
-
import
|
|
5
|
-
import { useSignatoriesListSuspense as
|
|
6
|
-
import { useSignatoriesInviteMutation as
|
|
7
|
-
import { useSignatoriesDeleteMutation as
|
|
8
|
-
import { InviteSignatorySchema as
|
|
9
|
-
import { Actions as
|
|
10
|
-
import
|
|
11
|
-
import { InviteSignatoryProvider as
|
|
12
|
-
import { Form as
|
|
13
|
-
import { useI18n as
|
|
14
|
-
import { BaseComponent as
|
|
15
|
-
import { useBase as
|
|
16
|
-
import { Flex as
|
|
1
|
+
import { jsx as i, jsxs as N, Fragment as h } from "react/jsx-runtime";
|
|
2
|
+
import { useForm as I, FormProvider as A } from "react-hook-form";
|
|
3
|
+
import { zodResolver as E } from "@hookform/resolvers/zod";
|
|
4
|
+
import M from "classnames";
|
|
5
|
+
import { useSignatoriesListSuspense as D } from "@gusto/embedded-api/react-query/signatoriesList";
|
|
6
|
+
import { useSignatoriesInviteMutation as F } from "@gusto/embedded-api/react-query/signatoriesInvite";
|
|
7
|
+
import { useSignatoriesDeleteMutation as P } from "@gusto/embedded-api/react-query/signatoriesDelete";
|
|
8
|
+
import { InviteSignatorySchema as b, InviteSignatoryForm as x } from "./InviteSignatoryForm.js";
|
|
9
|
+
import { Actions as O } from "./Actions.js";
|
|
10
|
+
import R from "./InviteSignatory.module.scss.js";
|
|
11
|
+
import { InviteSignatoryProvider as _ } from "./useInviteSignatory.js";
|
|
12
|
+
import { Form as C } from "../../../Common/Form/Form.js";
|
|
13
|
+
import { useI18n as T } from "../../../../i18n/I18n.js";
|
|
14
|
+
import { BaseComponent as U } from "../../../Base/Base.js";
|
|
15
|
+
import { useBase as Y } from "../../../Base/useBase.js";
|
|
16
|
+
import { Flex as q } from "../../../Common/Flex/Flex.js";
|
|
17
17
|
import { companyEvents as a } from "../../../../shared/constants.js";
|
|
18
|
-
function
|
|
19
|
-
return /* @__PURE__ */ i(
|
|
18
|
+
function ni(t) {
|
|
19
|
+
return /* @__PURE__ */ i(U, { ...t, children: /* @__PURE__ */ i(w, { ...t, children: t.children }) });
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
const { onEvent: r, baseSubmitHandler:
|
|
24
|
-
data: { signatoryList:
|
|
25
|
-
} =
|
|
21
|
+
function w({ companyId: t, defaultValues: o, className: c, children: n }) {
|
|
22
|
+
T("Company.AssignSignatory");
|
|
23
|
+
const { onEvent: r, baseSubmitHandler: u } = Y(), {
|
|
24
|
+
data: { signatoryList: l }
|
|
25
|
+
} = D({
|
|
26
26
|
companyUuid: t
|
|
27
|
-
}), e =
|
|
27
|
+
}), e = l, m = F(), f = P(), g = {
|
|
28
28
|
firstName: o?.firstName ?? "",
|
|
29
29
|
lastName: o?.lastName ?? "",
|
|
30
30
|
email: o?.email,
|
|
31
31
|
confirmEmail: o?.confirmEmail,
|
|
32
32
|
title: o?.title ?? ""
|
|
33
|
-
}, s =
|
|
34
|
-
resolver:
|
|
35
|
-
defaultValues:
|
|
36
|
-
}),
|
|
37
|
-
await
|
|
38
|
-
const { confirmEmail:
|
|
39
|
-
e[0]?.uuid && await
|
|
33
|
+
}, s = I({
|
|
34
|
+
resolver: E(b),
|
|
35
|
+
defaultValues: g
|
|
36
|
+
}), y = async (p) => {
|
|
37
|
+
await u(p, async (d) => {
|
|
38
|
+
const { confirmEmail: B, ...S } = d;
|
|
39
|
+
e[0]?.uuid && await f.mutateAsync({
|
|
40
40
|
request: {
|
|
41
41
|
companyUuid: t,
|
|
42
42
|
signatoryUuid: e[0].uuid
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
|
-
const
|
|
45
|
+
const v = await m.mutateAsync({
|
|
46
46
|
request: {
|
|
47
47
|
companyUuid: t,
|
|
48
|
-
requestBody:
|
|
48
|
+
requestBody: S
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
|
-
r(a.COMPANY_SIGNATORY_INVITED,
|
|
51
|
+
r(a.COMPANY_SIGNATORY_INVITED, v.signatory), r(a.COMPANY_INVITE_SIGNATORY_DONE);
|
|
52
52
|
});
|
|
53
53
|
};
|
|
54
|
-
return /* @__PURE__ */ i("section", { className:
|
|
55
|
-
|
|
54
|
+
return /* @__PURE__ */ i("section", { className: M(R.container, c), children: /* @__PURE__ */ i(
|
|
55
|
+
_,
|
|
56
56
|
{
|
|
57
57
|
value: {
|
|
58
58
|
isPending: m.isPending
|
|
59
59
|
},
|
|
60
|
-
children: /* @__PURE__ */ i(
|
|
61
|
-
/* @__PURE__ */ i(
|
|
62
|
-
/* @__PURE__ */ i(
|
|
60
|
+
children: /* @__PURE__ */ i(A, { ...s, children: /* @__PURE__ */ i(C, { onSubmit: s.handleSubmit(y), children: /* @__PURE__ */ i(q, { flexDirection: "column", gap: 32, children: n || /* @__PURE__ */ N(h, { children: [
|
|
61
|
+
/* @__PURE__ */ i(x, {}),
|
|
62
|
+
/* @__PURE__ */ i(O, {})
|
|
63
63
|
] }) }) }) })
|
|
64
64
|
}
|
|
65
65
|
) });
|
|
66
66
|
}
|
|
67
|
-
l.Form = c;
|
|
68
|
-
l.Actions = u;
|
|
69
67
|
export {
|
|
70
|
-
|
|
68
|
+
ni as InviteSignatory
|
|
71
69
|
};
|
|
72
70
|
//# sourceMappingURL=InviteSignatory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InviteSignatory.js","sources":["../../../../../src/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport classNames from 'classnames'\nimport { useSignatoriesListSuspense } from '@gusto/embedded-api/react-query/signatoriesList'\nimport { useSignatoriesInviteMutation } from '@gusto/embedded-api/react-query/signatoriesInvite'\nimport { useSignatoriesDeleteMutation } from '@gusto/embedded-api/react-query/signatoriesDelete'\nimport { type InviteSignatoryInputs, InviteSignatorySchema } from './InviteSignatoryForm'\nimport { InviteSignatoryForm } from './InviteSignatoryForm'\nimport { Actions } from './Actions'\nimport styles from './InviteSignatory.module.scss'\nimport type { InviteSignatoryDefaultValues } from './useInviteSignatory'\nimport { InviteSignatoryProvider } from './useInviteSignatory'\nimport { Form } from '@/components/Common/Form'\nimport { useI18n } from '@/i18n'\nimport {\n useBase,\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\n\ninterface InviteSignatoryProps extends CommonComponentInterface {\n companyId: string\n defaultValues?: InviteSignatoryDefaultValues\n}\n\nexport function InviteSignatory(props: InviteSignatoryProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, defaultValues, className, children }: InviteSignatoryProps) {\n useI18n('Company.AssignSignatory')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const {\n data: { signatoryList },\n } = useSignatoriesListSuspense({\n companyUuid: companyId,\n })\n const signatories = signatoryList!\n\n const inviteSignatoryMutation = useSignatoriesInviteMutation()\n const deleteSignatoryMutation = useSignatoriesDeleteMutation()\n\n const inviteSignatoryDefaultValues = {\n firstName: defaultValues?.firstName ?? '',\n lastName: defaultValues?.lastName ?? '',\n email: defaultValues?.email,\n confirmEmail: defaultValues?.confirmEmail,\n title: defaultValues?.title ?? '',\n }\n\n const formMethods = useForm<InviteSignatoryInputs>({\n resolver: zodResolver(InviteSignatorySchema),\n defaultValues: inviteSignatoryDefaultValues,\n })\n\n const onSubmit = async (data: InviteSignatoryInputs) => {\n await baseSubmitHandler(data, async payload => {\n const { confirmEmail, ...signatoryData } = payload\n if (signatories[0]?.uuid) {\n await deleteSignatoryMutation.mutateAsync({\n request: {\n companyUuid: companyId,\n signatoryUuid: signatories[0].uuid,\n },\n })\n }\n\n const inviteSignatoryResponse = await inviteSignatoryMutation.mutateAsync({\n request: {\n companyUuid: companyId,\n requestBody: signatoryData,\n },\n })\n\n onEvent(companyEvents.COMPANY_SIGNATORY_INVITED, inviteSignatoryResponse.signatory)\n onEvent(companyEvents.COMPANY_INVITE_SIGNATORY_DONE)\n })\n }\n\n return (\n <section className={classNames(styles.container, className)}>\n <InviteSignatoryProvider\n value={{\n isPending: inviteSignatoryMutation.isPending,\n }}\n >\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <InviteSignatoryForm />\n <Actions />\n </>\n )}\n </Flex>\n </Form>\n </FormProvider>\n </InviteSignatoryProvider>\n </section>\n )\n}\n
|
|
1
|
+
{"version":3,"file":"InviteSignatory.js","sources":["../../../../../src/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport classNames from 'classnames'\nimport { useSignatoriesListSuspense } from '@gusto/embedded-api/react-query/signatoriesList'\nimport { useSignatoriesInviteMutation } from '@gusto/embedded-api/react-query/signatoriesInvite'\nimport { useSignatoriesDeleteMutation } from '@gusto/embedded-api/react-query/signatoriesDelete'\nimport { type InviteSignatoryInputs, InviteSignatorySchema } from './InviteSignatoryForm'\nimport { InviteSignatoryForm } from './InviteSignatoryForm'\nimport { Actions } from './Actions'\nimport styles from './InviteSignatory.module.scss'\nimport type { InviteSignatoryDefaultValues } from './useInviteSignatory'\nimport { InviteSignatoryProvider } from './useInviteSignatory'\nimport { Form } from '@/components/Common/Form'\nimport { useI18n } from '@/i18n'\nimport {\n useBase,\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\n\ninterface InviteSignatoryProps extends CommonComponentInterface {\n companyId: string\n defaultValues?: InviteSignatoryDefaultValues\n}\n\nexport function InviteSignatory(props: InviteSignatoryProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, defaultValues, className, children }: InviteSignatoryProps) {\n useI18n('Company.AssignSignatory')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const {\n data: { signatoryList },\n } = useSignatoriesListSuspense({\n companyUuid: companyId,\n })\n const signatories = signatoryList!\n\n const inviteSignatoryMutation = useSignatoriesInviteMutation()\n const deleteSignatoryMutation = useSignatoriesDeleteMutation()\n\n const inviteSignatoryDefaultValues = {\n firstName: defaultValues?.firstName ?? '',\n lastName: defaultValues?.lastName ?? '',\n email: defaultValues?.email,\n confirmEmail: defaultValues?.confirmEmail,\n title: defaultValues?.title ?? '',\n }\n\n const formMethods = useForm<InviteSignatoryInputs>({\n resolver: zodResolver(InviteSignatorySchema),\n defaultValues: inviteSignatoryDefaultValues,\n })\n\n const onSubmit = async (data: InviteSignatoryInputs) => {\n await baseSubmitHandler(data, async payload => {\n const { confirmEmail, ...signatoryData } = payload\n if (signatories[0]?.uuid) {\n await deleteSignatoryMutation.mutateAsync({\n request: {\n companyUuid: companyId,\n signatoryUuid: signatories[0].uuid,\n },\n })\n }\n\n const inviteSignatoryResponse = await inviteSignatoryMutation.mutateAsync({\n request: {\n companyUuid: companyId,\n requestBody: signatoryData,\n },\n })\n\n onEvent(companyEvents.COMPANY_SIGNATORY_INVITED, inviteSignatoryResponse.signatory)\n onEvent(companyEvents.COMPANY_INVITE_SIGNATORY_DONE)\n })\n }\n\n return (\n <section className={classNames(styles.container, className)}>\n <InviteSignatoryProvider\n value={{\n isPending: inviteSignatoryMutation.isPending,\n }}\n >\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <InviteSignatoryForm />\n <Actions />\n </>\n )}\n </Flex>\n </Form>\n </FormProvider>\n </InviteSignatoryProvider>\n </section>\n )\n}\n"],"names":["InviteSignatory","props","jsx","BaseComponent","Root","companyId","defaultValues","className","children","useI18n","onEvent","baseSubmitHandler","useBase","signatoryList","useSignatoriesListSuspense","signatories","inviteSignatoryMutation","useSignatoriesInviteMutation","deleteSignatoryMutation","useSignatoriesDeleteMutation","inviteSignatoryDefaultValues","formMethods","useForm","zodResolver","InviteSignatorySchema","onSubmit","data","payload","confirmEmail","signatoryData","inviteSignatoryResponse","companyEvents","classNames","styles","InviteSignatoryProvider","FormProvider","Form","Flex","jsxs","Fragment","InviteSignatoryForm","Actions"],"mappings":";;;;;;;;;;;;;;;;;AA4BO,SAASA,GAAgBC,GAAsD;AAElF,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,eAAAC,GAAe,WAAAC,GAAW,UAAAC,KAAkC;AACrF,EAAAC,EAAQ,yBAAyB;AACjC,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GAEzC;AAAA,IACJ,MAAM,EAAE,eAAAC,EAAc;AAAA,MACpBC,EAA2B;AAAA,IAC7B,aAAaT;AAAA,EAAA,CACd,GACKU,IAAcF,GAEdG,IAA0BC,EAA6B,GACvDC,IAA0BC,EAA6B,GAEvDC,IAA+B;AAAA,IACnC,WAAWd,GAAe,aAAa;AAAA,IACvC,UAAUA,GAAe,YAAY;AAAA,IACrC,OAAOA,GAAe;AAAA,IACtB,cAAcA,GAAe;AAAA,IAC7B,OAAOA,GAAe,SAAS;AAAA,EACjC,GAEMe,IAAcC,EAA+B;AAAA,IACjD,UAAUC,EAAYC,CAAqB;AAAA,IAC3C,eAAeJ;AAAA,EAAA,CAChB,GAEKK,IAAW,OAAOC,MAAgC;AAChD,UAAAf,EAAkBe,GAAM,OAAMC,MAAW;AAC7C,YAAM,EAAE,cAAAC,GAAc,GAAGC,EAAA,IAAkBF;AACvC,MAAAZ,EAAY,CAAC,GAAG,QAClB,MAAMG,EAAwB,YAAY;AAAA,QACxC,SAAS;AAAA,UACP,aAAab;AAAA,UACb,eAAeU,EAAY,CAAC,EAAE;AAAA,QAAA;AAAA,MAChC,CACD;AAGG,YAAAe,IAA0B,MAAMd,EAAwB,YAAY;AAAA,QACxE,SAAS;AAAA,UACP,aAAaX;AAAA,UACb,aAAawB;AAAA,QAAA;AAAA,MACf,CACD;AAEO,MAAAnB,EAAAqB,EAAc,2BAA2BD,EAAwB,SAAS,GAClFpB,EAAQqB,EAAc,6BAA6B;AAAA,IAAA,CACpD;AAAA,EACH;AAEA,2BACG,WAAQ,EAAA,WAAWC,EAAWC,EAAO,WAAW1B,CAAS,GACxD,UAAA,gBAAAL;AAAA,IAACgC;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,WAAWlB,EAAwB;AAAA,MACrC;AAAA,MAEA,4BAACmB,GAAc,EAAA,GAAGd,GAChB,UAAC,gBAAAnB,EAAAkC,GAAA,EAAK,UAAUf,EAAY,aAAaI,CAAQ,GAC/C,UAAA,gBAAAvB,EAACmC,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAA7B,KAIG,gBAAA8B,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAArC,EAACsC,GAAoB,EAAA;AAAA,0BACpBC,GAAQ,CAAA,CAAA;AAAA,MAAA,GACX,EAAA,CAEJ,GACF,EACF,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -4,10 +4,10 @@ import { useFormContext as u } from "react-hook-form";
|
|
|
4
4
|
import { useTranslation as E } from "react-i18next";
|
|
5
5
|
import { Flex as S } from "../../../Common/Flex/Flex.js";
|
|
6
6
|
import { Grid as v } from "../../../Common/Grid/Grid.js";
|
|
7
|
+
import { TextInputField as a } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
7
8
|
import { nameValidation as l } from "../../../../helpers/validations.js";
|
|
8
9
|
import { TitleSelect as y } from "../TitleSelect.js";
|
|
9
10
|
import { useComponentContext as x } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
|
-
import { TextInputField as a } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
11
11
|
const m = "email_mismatch", w = r.object({
|
|
12
12
|
firstName: l,
|
|
13
13
|
lastName: l,
|
|
@@ -8,9 +8,9 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
|
8
8
|
import "@tanstack/react-query";
|
|
9
9
|
import "../../../Base/useBase.js";
|
|
10
10
|
import "../../../../shared/constants.js";
|
|
11
|
+
import "classnames";
|
|
11
12
|
import "dompurify";
|
|
12
13
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
-
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
14
|
import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
|
|
15
15
|
const [S, c] = t("InviteSignatoryContext");
|
|
16
16
|
export {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useTranslation as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as l } from "react-i18next";
|
|
3
|
+
import "classnames";
|
|
3
4
|
import { SIGNATORY_TITLES as s } from "../../../shared/constants.js";
|
|
4
5
|
import { SelectField as a } from "../../Common/Fields/SelectField/SelectField.js";
|
|
5
|
-
const
|
|
6
|
-
const { t } =
|
|
6
|
+
const S = () => {
|
|
7
|
+
const { t } = l("Company.AssignSignatory"), e = Object.entries(s).map(([i, o]) => ({
|
|
7
8
|
value: i,
|
|
8
9
|
label: t(`signatoryTitles.${o}`, { ns: "common" })
|
|
9
10
|
}));
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ r(
|
|
11
12
|
a,
|
|
12
13
|
{
|
|
13
14
|
name: "title",
|
|
@@ -19,7 +20,7 @@ const u = () => {
|
|
|
19
20
|
);
|
|
20
21
|
};
|
|
21
22
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
S as TitleSelect,
|
|
24
|
+
S as default
|
|
24
25
|
};
|
|
25
26
|
//# sourceMappingURL=TitleSelect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleSelect.js","sources":["../../../../src/components/Company/AssignSignatory/TitleSelect.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { SelectField } from '@/components/Common'\nimport { SIGNATORY_TITLES } from '@/shared/constants'\n\nexport const TitleSelect = () => {\n const { t } = useTranslation('Company.AssignSignatory')\n\n const titleOptions = Object.entries(SIGNATORY_TITLES).map(([key, value]) => ({\n value: key,\n label: t(`signatoryTitles.${value}`, { ns: 'common' }),\n }))\n\n return (\n <SelectField\n name=\"title\"\n label={t('signatoryDetails.titleSelect.label')}\n isRequired\n options={titleOptions}\n errorMessage={t('validations.title')}\n />\n )\n}\n\nexport default TitleSelect\n"],"names":["TitleSelect","useTranslation","titleOptions","SIGNATORY_TITLES","key","value","jsx","SelectField"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TitleSelect.js","sources":["../../../../src/components/Company/AssignSignatory/TitleSelect.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { SelectField } from '@/components/Common'\nimport { SIGNATORY_TITLES } from '@/shared/constants'\n\nexport const TitleSelect = () => {\n const { t } = useTranslation('Company.AssignSignatory')\n\n const titleOptions = Object.entries(SIGNATORY_TITLES).map(([key, value]) => ({\n value: key,\n label: t(`signatoryTitles.${value}`, { ns: 'common' }),\n }))\n\n return (\n <SelectField\n name=\"title\"\n label={t('signatoryDetails.titleSelect.label')}\n isRequired\n options={titleOptions}\n errorMessage={t('validations.title')}\n />\n )\n}\n\nexport default TitleSelect\n"],"names":["TitleSelect","useTranslation","titleOptions","SIGNATORY_TITLES","key","value","jsx","SelectField"],"mappings":";;;;;AAIO,MAAMA,IAAc,MAAM;AAC/B,QAAM,EAAE,EAAA,IAAMC,EAAe,yBAAyB,GAEhDC,IAAe,OAAO,QAAQC,CAAgB,EAAE,IAAI,CAAC,CAACC,GAAKC,CAAK,OAAO;AAAA,IAC3E,OAAOD;AAAA,IACP,OAAO,EAAE,mBAAmBC,CAAK,IAAI,EAAE,IAAI,SAAU,CAAA;AAAA,EAAA,EACrD;AAGA,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,OAAO,EAAE,oCAAoC;AAAA,MAC7C,YAAU;AAAA,MACV,SAASL;AAAA,MACT,cAAc,EAAE,mBAAmB;AAAA,IAAA;AAAA,EACrC;AAEJ;"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import "./types/i18next.d.ts"
|
|
2
2
|
export { AssignSignatory } from './AssignSignatory';
|
|
3
3
|
export { SignatoryAssignmentMode } from './useAssignSignatory';
|
|
4
|
-
export { Head } from './Head';
|
|
5
4
|
export { AssignSignatorySelection } from './AssignSignatorySelection';
|
|
6
5
|
export { CreateSignatory } from './CreateSignatory';
|
|
7
6
|
export { InviteSignatory } from './InviteSignatory';
|
|
@@ -8,9 +8,9 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
|
8
8
|
import "@tanstack/react-query";
|
|
9
9
|
import "../../Base/useBase.js";
|
|
10
10
|
import "../../../shared/constants.js";
|
|
11
|
+
import "classnames";
|
|
11
12
|
import "dompurify";
|
|
12
13
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
-
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
14
|
import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
|
|
15
15
|
const d = {
|
|
16
16
|
createSignatory: "createSignatory",
|
|
@@ -3,8 +3,3 @@ export interface BankAccountProps extends BaseComponentInterface<'Company.BankAc
|
|
|
3
3
|
companyId: string;
|
|
4
4
|
}
|
|
5
5
|
export declare function BankAccount(props: BankAccountProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export declare namespace BankAccount {
|
|
7
|
-
var BankAccountList: typeof import("./BankAccountList/BankAccountList").BankAccountList;
|
|
8
|
-
var BankAccountForm: typeof import("./BankAccountForm/BankAccountForm").BankAccountForm;
|
|
9
|
-
var BankAccountVerify: typeof import("./BankAccountVerify/BankAccountVerify").BankAccountVerify;
|
|
10
|
-
}
|
|
@@ -1,37 +1,31 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { createMachine as
|
|
2
|
+
import { createMachine as u } from "robot3";
|
|
3
3
|
import { useBankAccountsGetSuspense as s } from "@gusto/embedded-api/react-query/bankAccountsGet";
|
|
4
|
-
import { BankAccountListContextual as
|
|
5
|
-
import { bankAccountStateMachine as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { BankAccountVerify as h } from "./BankAccountVerify/BankAccountVerify.js";
|
|
9
|
-
import { Flow as y } from "../../Flow/Flow.js";
|
|
10
|
-
import { BaseComponent as C } from "../../Base/Base.js";
|
|
4
|
+
import { BankAccountListContextual as p, BankAccountFormContextual as k } from "./BankAccountComponents.js";
|
|
5
|
+
import { bankAccountStateMachine as A } from "./stateMachine.js";
|
|
6
|
+
import { Flow as f } from "../../Flow/Flow.js";
|
|
7
|
+
import { BaseComponent as B } from "../../Base/Base.js";
|
|
11
8
|
import "../../Base/useBase.js";
|
|
12
|
-
import { useComponentDictionary as
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
const { data:
|
|
9
|
+
import { useComponentDictionary as l } from "../../../i18n/I18n.js";
|
|
10
|
+
function h({ companyId: n, onEvent: a, dictionary: e }) {
|
|
11
|
+
l("Company.BankAccount", e);
|
|
12
|
+
const { data: r } = s({ companyId: n }), c = r.companyBankAccountList, o = c.length > 0 ? c[0] : null, m = u(
|
|
16
13
|
o ? "viewBankAccount" : "addBankAccount",
|
|
17
|
-
|
|
18
|
-
(
|
|
19
|
-
...
|
|
20
|
-
component: o ?
|
|
14
|
+
A,
|
|
15
|
+
(i) => ({
|
|
16
|
+
...i,
|
|
17
|
+
component: o ? p : k,
|
|
21
18
|
companyId: n,
|
|
22
19
|
bankAccount: o,
|
|
23
20
|
showVerifiedMessage: !1
|
|
24
21
|
})
|
|
25
22
|
);
|
|
26
|
-
return /* @__PURE__ */ t(
|
|
23
|
+
return /* @__PURE__ */ t(f, { machine: m, onEvent: a });
|
|
27
24
|
}
|
|
28
|
-
function
|
|
29
|
-
return /* @__PURE__ */ t(
|
|
25
|
+
function b(n) {
|
|
26
|
+
return /* @__PURE__ */ t(B, { ...n, children: /* @__PURE__ */ t(h, { ...n }) });
|
|
30
27
|
}
|
|
31
|
-
c.BankAccountList = p;
|
|
32
|
-
c.BankAccountForm = l;
|
|
33
|
-
c.BankAccountVerify = h;
|
|
34
28
|
export {
|
|
35
|
-
|
|
29
|
+
b as BankAccount
|
|
36
30
|
};
|
|
37
31
|
//# sourceMappingURL=BankAccount.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BankAccount.js","sources":["../../../../src/components/Company/BankAccount/BankAccount.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useBankAccountsGetSuspense } from '@gusto/embedded-api/react-query/bankAccountsGet'\nimport {\n BankAccountFormContextual,\n type BankAccountContextInterface,\n} from './BankAccountComponents'\nimport { bankAccountStateMachine } from './stateMachine'\nimport { BankAccountListContextual } from './BankAccountComponents'\nimport {
|
|
1
|
+
{"version":3,"file":"BankAccount.js","sources":["../../../../src/components/Company/BankAccount/BankAccount.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useBankAccountsGetSuspense } from '@gusto/embedded-api/react-query/bankAccountsGet'\nimport {\n BankAccountFormContextual,\n type BankAccountContextInterface,\n} from './BankAccountComponents'\nimport { bankAccountStateMachine } from './stateMachine'\nimport { BankAccountListContextual } from './BankAccountComponents'\nimport { Flow } from '@/components/Flow/Flow'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport interface BankAccountProps extends BaseComponentInterface<'Company.BankAccount'> {\n companyId: string\n}\n\nfunction BankAccountFlow({ companyId, onEvent, dictionary }: BankAccountProps) {\n useComponentDictionary('Company.BankAccount', dictionary)\n const { data } = useBankAccountsGetSuspense({ companyId })\n const companyBankAccountList = data.companyBankAccountList!\n //Currently, we only support a single default bank account per company.\n const bankAccount = companyBankAccountList.length > 0 ? companyBankAccountList[0]! : null\n\n const manageBankAccount = createMachine(\n bankAccount ? 'viewBankAccount' : 'addBankAccount',\n bankAccountStateMachine,\n (initialContext: BankAccountContextInterface) => ({\n ...initialContext,\n component: bankAccount ? BankAccountListContextual : BankAccountFormContextual,\n companyId,\n bankAccount,\n showVerifiedMessage: false,\n }),\n )\n return <Flow machine={manageBankAccount} onEvent={onEvent} />\n}\n\nexport function BankAccount(props: BankAccountProps) {\n return (\n <BaseComponent {...props}>\n <BankAccountFlow {...props} />\n </BaseComponent>\n )\n}\n"],"names":["BankAccountFlow","companyId","onEvent","dictionary","useComponentDictionary","data","useBankAccountsGetSuspense","companyBankAccountList","bankAccount","manageBankAccount","createMachine","bankAccountStateMachine","initialContext","BankAccountListContextual","BankAccountFormContextual","jsx","Flow","BankAccount","props","BaseComponent"],"mappings":";;;;;;;;;AAgBA,SAASA,EAAgB,EAAE,WAAAC,GAAW,SAAAC,GAAS,YAAAC,KAAgC;AAC7E,EAAAC,EAAuB,uBAAuBD,CAAU;AACxD,QAAM,EAAE,MAAAE,EAAK,IAAIC,EAA2B,EAAE,WAAAL,GAAW,GACnDM,IAAyBF,EAAK,wBAE9BG,IAAcD,EAAuB,SAAS,IAAIA,EAAuB,CAAC,IAAK,MAE/EE,IAAoBC;AAAA,IACxBF,IAAc,oBAAoB;AAAA,IAClCG;AAAA,IACA,CAACC,OAAiD;AAAA,MAChD,GAAGA;AAAA,MACH,WAAWJ,IAAcK,IAA4BC;AAAA,MACrD,WAAAb;AAAA,MACA,aAAAO;AAAA,MACA,qBAAqB;AAAA,IACvB;AAAA,EACF;AACA,SAAQ,gBAAAO,EAAAC,GAAA,EAAK,SAASP,GAAmB,SAAAP,EAAkB,CAAA;AAC7D;AAEO,SAASe,EAAYC,GAAyB;AAEjD,SAAA,gBAAAH,EAACI,KAAe,GAAGD,GACjB,4BAAClB,GAAiB,EAAA,GAAGkB,GAAO,EAC9B,CAAA;AAEJ;"}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as s } from "react-i18next";
|
|
3
3
|
import { useBankAccountForm as m } from "./context.js";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
import "classnames";
|
|
5
|
+
import { componentEvents as a } from "../../../../shared/constants.js";
|
|
6
|
+
import { ActionsLayout as u } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
7
|
+
import { useComponentContext as p } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
|
+
function b() {
|
|
9
|
+
const { t } = s("Company.BankAccount"), { isPending: i, isEditing: r, onEvent: c } = m(), n = p();
|
|
10
|
+
return /* @__PURE__ */ e(u, { children: [
|
|
10
11
|
r && /* @__PURE__ */ o(
|
|
11
12
|
n.Button,
|
|
12
13
|
{
|
|
13
14
|
type: "button",
|
|
14
15
|
variant: "secondary",
|
|
15
16
|
onClick: () => {
|
|
16
|
-
c(
|
|
17
|
+
c(a.COMPANY_BANK_ACCOUNT_CANCEL);
|
|
17
18
|
},
|
|
18
19
|
children: t("cancelCta")
|
|
19
20
|
}
|
|
@@ -22,6 +23,6 @@ function B() {
|
|
|
22
23
|
] });
|
|
23
24
|
}
|
|
24
25
|
export {
|
|
25
|
-
|
|
26
|
+
b as Actions
|
|
26
27
|
};
|
|
27
28
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useBankAccountForm } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { componentEvents } from '@/shared/constants'\n\nexport function Actions() {\n const { t } = useTranslation('Company.BankAccount')\n const { isPending, isEditing, onEvent } = useBankAccountForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {isEditing && (\n <Components.Button\n type=\"button\"\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.COMPANY_BANK_ACCOUNT_CANCEL)\n }}\n >\n {t('cancelCta')}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isPending} data-testid=\"bank-account-submit\">\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","isEditing","onEvent","useBankAccountForm","Components","useComponentContext","ActionsLayout","jsx","componentEvents"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useBankAccountForm } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { componentEvents } from '@/shared/constants'\n\nexport function Actions() {\n const { t } = useTranslation('Company.BankAccount')\n const { isPending, isEditing, onEvent } = useBankAccountForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {isEditing && (\n <Components.Button\n type=\"button\"\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.COMPANY_BANK_ACCOUNT_CANCEL)\n }}\n >\n {t('cancelCta')}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isPending} data-testid=\"bank-account-submit\">\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","isEditing","onEvent","useBankAccountForm","Components","useComponentContext","ActionsLayout","jsx","componentEvents"],"mappings":";;;;;;;AAMO,SAASA,IAAU;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,WAAAC,GAAW,WAAAC,GAAW,SAAAC,EAAA,IAAYC,EAAmB,GACvDC,IAAaC,EAAoB;AAEvC,2BACGC,GACE,EAAA,UAAA;AAAA,IACCL,KAAA,gBAAAM;AAAA,MAACH,EAAW;AAAA,MAAX;AAAA,QACC,MAAK;AAAA,QACL,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAF,EAAQM,EAAgB,2BAA2B;AAAA,QACrD;AAAA,QAEC,YAAE,WAAW;AAAA,MAAA;AAAA,IAChB;AAAA,IAED,gBAAAD,EAAAH,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWJ,GAAW,eAAY,uBAChE,UAAE,EAAA,aAAa,EAClB,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -4,9 +4,4 @@ interface BankAccountFormProps extends CommonComponentInterface {
|
|
|
4
4
|
isEditing?: boolean;
|
|
5
5
|
}
|
|
6
6
|
export declare function BankAccountForm(props: BankAccountFormProps & BaseComponentInterface): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export declare namespace BankAccountForm {
|
|
8
|
-
var Head: typeof import("./Head").Head;
|
|
9
|
-
var Form: typeof import("./Form").Form;
|
|
10
|
-
var Actions: typeof import("./Actions").Actions;
|
|
11
|
-
}
|
|
12
7
|
export {};
|
|
@@ -1,44 +1,41 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { useBankAccountsCreateMutation as
|
|
3
|
-
import { useForm as
|
|
4
|
-
import { zodResolver as
|
|
5
|
-
import { Head as
|
|
6
|
-
import { BankAccountFormSchema as
|
|
7
|
-
import { Actions as
|
|
8
|
-
import { BankAccountFormProvider as
|
|
9
|
-
import { Form as
|
|
10
|
-
import { BaseComponent as
|
|
11
|
-
import { useBase as
|
|
12
|
-
import { useI18n as
|
|
1
|
+
import { jsx as o, jsxs as A, Fragment as h } from "react/jsx-runtime";
|
|
2
|
+
import { useBankAccountsCreateMutation as B } from "@gusto/embedded-api/react-query/bankAccountsCreate";
|
|
3
|
+
import { useForm as F, FormProvider as C } from "react-hook-form";
|
|
4
|
+
import { zodResolver as k } from "@hookform/resolvers/zod";
|
|
5
|
+
import { Head as b } from "./Head.js";
|
|
6
|
+
import { BankAccountFormSchema as g, Form as v } from "./Form.js";
|
|
7
|
+
import { Actions as y } from "./Actions.js";
|
|
8
|
+
import { BankAccountFormProvider as P } from "./context.js";
|
|
9
|
+
import { Form as x } from "../../../Common/Form/Form.js";
|
|
10
|
+
import { BaseComponent as N } from "../../../Base/Base.js";
|
|
11
|
+
import { useBase as S } from "../../../Base/useBase.js";
|
|
12
|
+
import { useI18n as E } from "../../../../i18n/I18n.js";
|
|
13
13
|
import { Flex as R } from "../../../Common/Flex/Flex.js";
|
|
14
14
|
import { componentEvents as T } from "../../../../shared/constants.js";
|
|
15
|
-
function
|
|
16
|
-
return /* @__PURE__ */ o(
|
|
15
|
+
function G(n) {
|
|
16
|
+
return /* @__PURE__ */ o(N, { ...n, children: /* @__PURE__ */ o(_, { ...n, children: n.children }) });
|
|
17
17
|
}
|
|
18
|
-
function _({ companyId: n, className:
|
|
19
|
-
|
|
20
|
-
const { onEvent:
|
|
21
|
-
resolver:
|
|
18
|
+
function _({ companyId: n, className: m, children: r, isEditing: c = !1 }) {
|
|
19
|
+
E("Company.BankAccount");
|
|
20
|
+
const { onEvent: t, baseSubmitHandler: i } = S(), { mutateAsync: a, isPending: u } = B(), { control: s, ...e } = F({
|
|
21
|
+
resolver: k(g),
|
|
22
22
|
defaultValues: { accountNumber: "", routingNumber: "" }
|
|
23
|
-
}),
|
|
24
|
-
await
|
|
25
|
-
const { companyBankAccount:
|
|
23
|
+
}), d = async (l) => {
|
|
24
|
+
await i(l, async (f) => {
|
|
25
|
+
const { companyBankAccount: p } = await a({
|
|
26
26
|
//Account type is always checking for company bank accounts
|
|
27
|
-
request: { companyId: n, requestBody: { ...
|
|
27
|
+
request: { companyId: n, requestBody: { ...f, accountType: "Checking" } }
|
|
28
28
|
});
|
|
29
|
-
|
|
29
|
+
t(T.COMPANY_BANK_ACCOUNT_CREATED, p);
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
|
-
return /* @__PURE__ */ o("section", { className:
|
|
33
|
-
/* @__PURE__ */ o(
|
|
34
|
-
/* @__PURE__ */ o(
|
|
35
|
-
/* @__PURE__ */ o(
|
|
32
|
+
return /* @__PURE__ */ o("section", { className: m, children: /* @__PURE__ */ o(C, { ...e, control: s, children: /* @__PURE__ */ o(x, { onSubmit: e.handleSubmit(d), children: /* @__PURE__ */ o(P, { value: { isPending: u, isEditing: c, onEvent: t }, children: /* @__PURE__ */ o(R, { flexDirection: "column", gap: 32, children: r || /* @__PURE__ */ A(h, { children: [
|
|
33
|
+
/* @__PURE__ */ o(b, {}),
|
|
34
|
+
/* @__PURE__ */ o(v, {}),
|
|
35
|
+
/* @__PURE__ */ o(y, {})
|
|
36
36
|
] }) }) }) }) }) });
|
|
37
37
|
}
|
|
38
|
-
r.Head = c;
|
|
39
|
-
r.Form = i;
|
|
40
|
-
r.Actions = a;
|
|
41
38
|
export {
|
|
42
|
-
|
|
39
|
+
G as BankAccountForm
|
|
43
40
|
};
|
|
44
41
|
//# sourceMappingURL=BankAccountForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BankAccountForm.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountForm/BankAccountForm.tsx"],"sourcesContent":["import { useBankAccountsCreateMutation } from '@gusto/embedded-api/react-query/bankAccountsCreate'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { Head } from './Head'\nimport type { BankAccountFormInputs } from './Form'\nimport { BankAccountFormSchema, Form } from './Form'\nimport { Actions } from './Actions'\nimport { BankAccountFormProvider } from './context'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n/I18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { componentEvents } from '@/shared/constants'\n\ninterface BankAccountFormProps extends CommonComponentInterface {\n companyId: string\n isEditing?: boolean\n}\n\nexport function BankAccountForm(props: BankAccountFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\nfunction Root({ companyId, className, children, isEditing = false }: BankAccountFormProps) {\n useI18n('Company.BankAccount')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { mutateAsync: createBankAccount, isPending: isPendingCreate } =\n useBankAccountsCreateMutation()\n\n const { control, ...methods } = useForm<BankAccountFormInputs>({\n resolver: zodResolver(BankAccountFormSchema),\n defaultValues: { accountNumber: '', routingNumber: '' },\n })\n\n const onSubmit = async (data: BankAccountFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n const { companyBankAccount } = await createBankAccount({\n //Account type is always checking for company bank accounts\n request: { companyId, requestBody: { ...payload, accountType: 'Checking' } },\n })\n\n onEvent(componentEvents.COMPANY_BANK_ACCOUNT_CREATED, companyBankAccount)\n })\n }\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <BankAccountFormProvider value={{ isPending: isPendingCreate, isEditing, onEvent }}>\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </BankAccountFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\
|
|
1
|
+
{"version":3,"file":"BankAccountForm.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountForm/BankAccountForm.tsx"],"sourcesContent":["import { useBankAccountsCreateMutation } from '@gusto/embedded-api/react-query/bankAccountsCreate'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { Head } from './Head'\nimport type { BankAccountFormInputs } from './Form'\nimport { BankAccountFormSchema, Form } from './Form'\nimport { Actions } from './Actions'\nimport { BankAccountFormProvider } from './context'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n/I18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { componentEvents } from '@/shared/constants'\n\ninterface BankAccountFormProps extends CommonComponentInterface {\n companyId: string\n isEditing?: boolean\n}\n\nexport function BankAccountForm(props: BankAccountFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\nfunction Root({ companyId, className, children, isEditing = false }: BankAccountFormProps) {\n useI18n('Company.BankAccount')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { mutateAsync: createBankAccount, isPending: isPendingCreate } =\n useBankAccountsCreateMutation()\n\n const { control, ...methods } = useForm<BankAccountFormInputs>({\n resolver: zodResolver(BankAccountFormSchema),\n defaultValues: { accountNumber: '', routingNumber: '' },\n })\n\n const onSubmit = async (data: BankAccountFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n const { companyBankAccount } = await createBankAccount({\n //Account type is always checking for company bank accounts\n request: { companyId, requestBody: { ...payload, accountType: 'Checking' } },\n })\n\n onEvent(componentEvents.COMPANY_BANK_ACCOUNT_CREATED, companyBankAccount)\n })\n }\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <BankAccountFormProvider value={{ isPending: isPendingCreate, isEditing, onEvent }}>\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </BankAccountFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n"],"names":["BankAccountForm","props","jsx","BaseComponent","Root","companyId","className","children","isEditing","useI18n","onEvent","baseSubmitHandler","useBase","createBankAccount","isPendingCreate","useBankAccountsCreateMutation","control","methods","useForm","zodResolver","BankAccountFormSchema","onSubmit","data","payload","companyBankAccount","componentEvents","FormProvider","HtmlForm","BankAccountFormProvider","Flex","jsxs","Fragment","Head","Form","Actions"],"mappings":";;;;;;;;;;;;;;AAqBO,SAASA,EAAgBC,GAAsD;AAElF,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AACA,SAASG,EAAK,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,GAAU,WAAAC,IAAY,MAA+B;AACzF,EAAAC,EAAQ,qBAAqB;AAC7B,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GAEzC,EAAE,aAAaC,GAAmB,WAAWC,EAAA,IACjDC,EAA8B,GAE1B,EAAE,SAAAC,GAAS,GAAGC,EAAA,IAAYC,EAA+B;AAAA,IAC7D,UAAUC,EAAYC,CAAqB;AAAA,IAC3C,eAAe,EAAE,eAAe,IAAI,eAAe,GAAG;AAAA,EAAA,CACvD,GAEKC,IAAW,OAAOC,MAAgC;AAChD,UAAAX,EAAkBW,GAAM,OAAMC,MAAW;AAC7C,YAAM,EAAE,oBAAAC,MAAuB,MAAMX,EAAkB;AAAA;AAAA,QAErD,SAAS,EAAE,WAAAR,GAAW,aAAa,EAAE,GAAGkB,GAAS,aAAa,WAAa,EAAA;AAAA,MAAA,CAC5E;AAEO,MAAAb,EAAAe,EAAgB,8BAA8BD,CAAkB;AAAA,IAAA,CACzE;AAAA,EACH;AACA,SACG,gBAAAtB,EAAA,WAAA,EAAQ,WAAAI,GACP,UAAA,gBAAAJ,EAACwB,KAAc,GAAGT,GAAS,SAAAD,GACzB,UAAA,gBAAAd,EAACyB,GAAS,EAAA,UAAUV,EAAQ,aAAaI,CAAQ,GAC/C,UAAA,gBAAAnB,EAAC0B,GAAwB,EAAA,OAAO,EAAE,WAAWd,GAAiB,WAAAN,GAAW,SAAAE,KACvE,UAAA,gBAAAR,EAAC2B,GAAK,EAAA,eAAc,UAAS,KAAK,IAC/B,UAAAtB,KAIG,gBAAAuB,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAA7B,EAAC8B,GAAK,EAAA;AAAA,sBACLC,GAAK,EAAA;AAAA,sBACLC,GAAQ,CAAA,CAAA;AAAA,EAAA,EAAA,CACX,EAEJ,CAAA,EAAA,CACF,EACF,CAAA,EAAA,CACF,EACF,CAAA;AAEJ;"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { jsxs as t, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { z as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { accountNumberValidation as
|
|
2
|
+
import { z as i } from "zod";
|
|
3
|
+
import { useTranslation as m } from "react-i18next";
|
|
4
|
+
import { accountNumberValidation as n, routingNumberValidation as u } from "../../../../helpers/validations.js";
|
|
5
5
|
import { Flex as a } from "../../../Common/Flex/Flex.js";
|
|
6
|
+
import "classnames";
|
|
7
|
+
import "../../../../shared/constants.js";
|
|
6
8
|
import { TextInputField as e } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
7
|
-
const
|
|
9
|
+
const g = i.object({
|
|
8
10
|
routingNumber: u,
|
|
9
|
-
accountNumber:
|
|
11
|
+
accountNumber: n
|
|
10
12
|
});
|
|
11
|
-
function
|
|
12
|
-
const { t: r } =
|
|
13
|
+
function x() {
|
|
14
|
+
const { t: r } = m("Company.BankAccount");
|
|
13
15
|
return /* @__PURE__ */ t(a, { flexDirection: "column", gap: 20, children: [
|
|
14
16
|
/* @__PURE__ */ o(
|
|
15
17
|
e,
|
|
@@ -33,7 +35,7 @@ function d() {
|
|
|
33
35
|
] });
|
|
34
36
|
}
|
|
35
37
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
g as BankAccountFormSchema,
|
|
39
|
+
x as Form
|
|
38
40
|
};
|
|
39
41
|
//# sourceMappingURL=Form.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountForm/Form.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { accountNumberValidation, routingNumberValidation } from '@/helpers/validations'\nimport { Flex, TextInputField } from '@/components/Common'\n\nexport const BankAccountFormSchema = z.object({\n routingNumber: routingNumberValidation,\n accountNumber: accountNumberValidation,\n})\n\nexport type BankAccountFormInputs = z.infer<typeof BankAccountFormSchema>\n\nexport function Form() {\n const { t } = useTranslation('Company.BankAccount')\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <TextInputField\n name=\"routingNumber\"\n isRequired\n label={t('form.routingNumberLabel')}\n description={t('form.routingNumberDescription')}\n errorMessage={t('validations.routingNumber')}\n />\n <TextInputField\n name=\"accountNumber\"\n label={t('form.accountNumberLabel')}\n isRequired\n errorMessage={t('validations.accountNumber')}\n />\n </Flex>\n )\n}\n"],"names":["BankAccountFormSchema","z","routingNumberValidation","accountNumberValidation","Form","t","useTranslation","jsxs","Flex","jsx","TextInputField"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Form.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountForm/Form.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { accountNumberValidation, routingNumberValidation } from '@/helpers/validations'\nimport { Flex, TextInputField } from '@/components/Common'\n\nexport const BankAccountFormSchema = z.object({\n routingNumber: routingNumberValidation,\n accountNumber: accountNumberValidation,\n})\n\nexport type BankAccountFormInputs = z.infer<typeof BankAccountFormSchema>\n\nexport function Form() {\n const { t } = useTranslation('Company.BankAccount')\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <TextInputField\n name=\"routingNumber\"\n isRequired\n label={t('form.routingNumberLabel')}\n description={t('form.routingNumberDescription')}\n errorMessage={t('validations.routingNumber')}\n />\n <TextInputField\n name=\"accountNumber\"\n label={t('form.accountNumberLabel')}\n isRequired\n errorMessage={t('validations.accountNumber')}\n />\n </Flex>\n )\n}\n"],"names":["BankAccountFormSchema","z","routingNumberValidation","accountNumberValidation","Form","t","useTranslation","jsxs","Flex","jsx","TextInputField"],"mappings":";;;;;;;;AAKa,MAAAA,IAAwBC,EAAE,OAAO;AAAA,EAC5C,eAAeC;AAAA,EACf,eAAeC;AACjB,CAAC;AAIM,SAASC,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB;AAElD,SACG,gBAAAC,EAAAC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,YAAU;AAAA,QACV,OAAOL,EAAE,yBAAyB;AAAA,QAClC,aAAaA,EAAE,+BAA+B;AAAA,QAC9C,cAAcA,EAAE,2BAA2B;AAAA,MAAA;AAAA,IAC7C;AAAA,IACA,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOL,EAAE,yBAAyB;AAAA,QAClC,YAAU;AAAA,QACV,cAAcA,EAAE,2BAA2B;AAAA,MAAA;AAAA,IAAA;AAAA,EAC7C,GACF;AAEJ;"}
|
|
@@ -8,9 +8,9 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
|
8
8
|
import "@tanstack/react-query";
|
|
9
9
|
import "../../../Base/useBase.js";
|
|
10
10
|
import "../../../../shared/constants.js";
|
|
11
|
+
import "classnames";
|
|
11
12
|
import "dompurify";
|
|
12
13
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
-
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
14
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
15
15
|
const [C, d] = o("BankAccountContext");
|
|
16
16
|
export {
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useTranslation as
|
|
1
|
+
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as e } from "react-i18next";
|
|
3
3
|
import { useBankAccount as a } from "./context.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
import "classnames";
|
|
5
|
+
import "../../../../shared/constants.js";
|
|
6
|
+
import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
7
|
+
import { useComponentContext as s } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
|
+
function k() {
|
|
9
|
+
const { handleContinue: r, handleChange: c } = a(), { t: n } = e("Company.BankAccount"), o = s();
|
|
10
|
+
return /* @__PURE__ */ i(m, { children: [
|
|
11
|
+
/* @__PURE__ */ t(o.Button, { variant: "secondary", onClick: c, children: n("changeBankAccountCta") }),
|
|
12
|
+
/* @__PURE__ */ t(o.Button, { onClick: r, children: n("continueCta") })
|
|
11
13
|
] });
|
|
12
14
|
}
|
|
13
15
|
export {
|
|
14
|
-
|
|
16
|
+
k as Actions
|
|
15
17
|
};
|
|
16
18
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useBankAccount } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { handleContinue, handleChange } = useBankAccount()\n const { t } = useTranslation('Company.BankAccount')\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleChange}>\n {t('changeBankAccountCta')}\n </Components.Button>\n <Components.Button onClick={handleContinue}>{t('continueCta')}</Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","handleContinue","handleChange","useBankAccount","t","useTranslation","Components","useComponentContext","ActionsLayout","jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useBankAccount } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { handleContinue, handleChange } = useBankAccount()\n const { t } = useTranslation('Company.BankAccount')\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleChange}>\n {t('changeBankAccountCta')}\n </Components.Button>\n <Components.Button onClick={handleContinue}>{t('continueCta')}</Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","handleContinue","handleChange","useBankAccount","t","useTranslation","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,gBAAAC,GAAgB,cAAAC,EAAa,IAAIC,EAAe,GAClD,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAoB;AAEvC,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASJ,GAC7C,UAAEE,EAAA,sBAAsB,EAC3B,CAAA;AAAA,IACA,gBAAAK,EAACH,EAAW,QAAX,EAAkB,SAASL,GAAiB,UAAAG,EAAE,aAAa,EAAE,CAAA;AAAA,EAAA,GAChE;AAEJ;"}
|
|
@@ -4,9 +4,4 @@ interface BankAccountListProps extends CommonComponentInterface {
|
|
|
4
4
|
showVerifiedMessage?: boolean;
|
|
5
5
|
}
|
|
6
6
|
export declare function BankAccountList(props: BankAccountListProps & BaseComponentInterface): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export declare namespace BankAccountList {
|
|
8
|
-
var Head: typeof import("./Head").Head;
|
|
9
|
-
var AccountView: typeof import("./AccountView").AccountView;
|
|
10
|
-
var Actions: typeof import("./Actions").Actions;
|
|
11
|
-
}
|
|
12
7
|
export {};
|