@gusto/embedded-react-sdk 0.10.7 → 0.11.0-rc.1
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 +18 -19
- 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 +4 -6
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +10 -12
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +6 -8
- 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 +34 -39
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -7
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -9
- 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 -54
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +2 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -7
- 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 -43
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +9 -10
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +7 -8
- 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 +2 -3
- 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 +7 -8
- 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 +6 -7
- 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 +7 -8
- 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 +4 -5
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -6
- 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 -44
- 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 -47
- 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 +6 -7
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +15 -17
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +2 -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 +5 -6
- 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 +10 -11
- 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 +2 -3
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +4 -5
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.d.ts +0 -5
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +43 -48
- 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 +2 -3
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +2 -3
- 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 +32 -37
- 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 +5 -6
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +2 -3
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -4
- 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 +72 -78
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +10 -11
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +25 -26
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +2 -3
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +5 -6
- 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 +39 -22
- package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesComponents.d.ts +8 -6
- package/dist/components/Company/StateTaxes/StateTaxesComponents.js +16 -15
- package/dist/components/Company/StateTaxes/StateTaxesComponents.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +5 -6
- 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 +6 -7
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +5 -6
- 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/Company/StateTaxes/stateTaxesReducer.d.ts +20 -0
- package/dist/components/Company/StateTaxes/stateTaxesReducer.js +40 -0
- package/dist/components/Company/StateTaxes/stateTaxesReducer.js.map +1 -0
- package/dist/components/Contractor/Address/Address.d.ts +0 -5
- package/dist/components/Contractor/Address/Address.js +35 -40
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +2 -3
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +1 -1
- package/dist/components/Contractor/List/index.js +2 -3
- package/dist/components/Contractor/List/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +16 -17
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -3
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -3
- 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 +18 -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 +4 -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 +2 -3
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +5 -6
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/Actions.js +8 -9
- package/dist/components/Employee/Deductions/Actions.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionForm.js +2 -3
- package/dist/components/Employee/Deductions/DeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList.js +2 -3
- package/dist/components/Employee/Deductions/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +2 -3
- 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 +4 -5
- 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 +25 -30
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
- 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 +40 -46
- 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 +4 -5
- 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 +56 -61
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +2 -3
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +2 -3
- 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 +6 -7
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +2 -3
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +2 -3
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +2 -3
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +2 -3
- 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 +6 -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 +9 -10
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +4 -5
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +2 -2
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +8 -9
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- 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 +7 -8
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +4 -5
- 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 +2 -3
- 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 +3 -3
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.d.ts +0 -5
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js +0 -48
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js.map +0 -1
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { useForm as
|
|
3
|
-
import { zodResolver as
|
|
4
|
-
import { useTaxRequirementsUpdateStateMutation as
|
|
5
|
-
import { useTaxRequirementsGetSuspense as
|
|
1
|
+
import { jsx as a, jsxs as V, Fragment as O } from "react/jsx-runtime";
|
|
2
|
+
import { useForm as U, FormProvider as B } from "react-hook-form";
|
|
3
|
+
import { zodResolver as D } from "@hookform/resolvers/zod";
|
|
4
|
+
import { useTaxRequirementsUpdateStateMutation as K } from "@gusto/embedded-api/react-query/taxRequirementsUpdateState";
|
|
5
|
+
import { useTaxRequirementsGetSuspense as M } from "@gusto/embedded-api/react-query/taxRequirementsGet";
|
|
6
6
|
import { z as r } from "zod";
|
|
7
|
-
import { useMemo as
|
|
8
|
-
import { useTranslation as
|
|
9
|
-
import { Head as
|
|
10
|
-
import { StateTaxesFormProvider as
|
|
11
|
-
import { Form as
|
|
12
|
-
import { Actions as
|
|
13
|
-
import { BaseComponent as
|
|
14
|
-
import { useI18n as
|
|
15
|
-
import { Flex as
|
|
16
|
-
import { Form as
|
|
17
|
-
import { componentEvents as
|
|
18
|
-
import { useBase as
|
|
19
|
-
function
|
|
20
|
-
return /* @__PURE__ */ a(
|
|
7
|
+
import { useMemo as w } from "react";
|
|
8
|
+
import { useTranslation as z } from "react-i18next";
|
|
9
|
+
import { Head as H } from "./Head.js";
|
|
10
|
+
import { StateTaxesFormProvider as G } from "./context.js";
|
|
11
|
+
import { Form as L } from "./Form.js";
|
|
12
|
+
import { Actions as X } from "./Actions.js";
|
|
13
|
+
import { BaseComponent as Y } from "../../../Base/Base.js";
|
|
14
|
+
import { useI18n as $ } from "../../../../i18n/I18n.js";
|
|
15
|
+
import { Flex as I } from "../../../Common/Flex/Flex.js";
|
|
16
|
+
import { Form as J } from "../../../Common/Form/Form.js";
|
|
17
|
+
import { componentEvents as g } from "../../../../shared/constants.js";
|
|
18
|
+
import { useBase as Q } from "../../../Base/useBase.js";
|
|
19
|
+
function Se(i) {
|
|
20
|
+
return /* @__PURE__ */ a(Y, { ...i, children: /* @__PURE__ */ a(W, { ...i, children: i.children }) });
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
const { onEvent:
|
|
22
|
+
function W({ companyId: i, state: y, className: q, children: h }) {
|
|
23
|
+
$("Company.StateTaxes");
|
|
24
|
+
const { onEvent: x, baseSubmitHandler: k } = Q(), { t: o } = z("Company.StateTaxes", { keyPrefix: "form" }), { data: P } = M({ companyUuid: i, state: y }), l = P.taxRequirementsState, { mutateAsync: _, isPending: j } = K(), { dynamicSchema: A, defaultValues: C } = w(() => {
|
|
25
25
|
const f = {}, s = {};
|
|
26
26
|
return l.requirementSets?.forEach((t) => {
|
|
27
27
|
if (!t.key) return;
|
|
28
28
|
const m = t.key, c = {}, p = {};
|
|
29
29
|
t.requirements?.forEach((e) => {
|
|
30
30
|
if (!e.key) return;
|
|
31
|
-
const
|
|
32
|
-
p[
|
|
31
|
+
const b = e.key;
|
|
32
|
+
p[b] = e.metadata?.type === "radio" ? e.value ?? void 0 : e.value ? String(e.value) : "";
|
|
33
33
|
let v = r.string({
|
|
34
34
|
required_error: o("validations.required")
|
|
35
35
|
}).min(1, o("validations.required"));
|
|
@@ -51,18 +51,18 @@ function Z({ companyId: i, state: y, className: _, children: x }) {
|
|
|
51
51
|
}
|
|
52
52
|
e.metadata?.type === "radio" && (v = r.boolean({
|
|
53
53
|
required_error: o("validations.required")
|
|
54
|
-
})), c[
|
|
54
|
+
})), c[b] = v;
|
|
55
55
|
}), Object.keys(c).length > 0 && (f[m] = r.object(c), s[m] = p);
|
|
56
56
|
}), {
|
|
57
57
|
dynamicSchema: r.object(f),
|
|
58
58
|
defaultValues: s
|
|
59
59
|
};
|
|
60
|
-
}, [l, o]), { control:
|
|
61
|
-
resolver:
|
|
62
|
-
defaultValues:
|
|
63
|
-
}),
|
|
64
|
-
await
|
|
65
|
-
const
|
|
60
|
+
}, [l, o]), { control: E, ...F } = U({
|
|
61
|
+
resolver: D(A),
|
|
62
|
+
defaultValues: C
|
|
63
|
+
}), N = async (f) => {
|
|
64
|
+
await k(f, async (s) => {
|
|
65
|
+
const T = l.requirementSets?.filter((t) => t.key && s[t.key]).map((t) => {
|
|
66
66
|
const m = t.key, c = s[m];
|
|
67
67
|
return {
|
|
68
68
|
state: t.state,
|
|
@@ -74,33 +74,30 @@ function Z({ companyId: i, state: y, className: _, children: x }) {
|
|
|
74
74
|
}))
|
|
75
75
|
};
|
|
76
76
|
});
|
|
77
|
-
await
|
|
77
|
+
await _({
|
|
78
78
|
request: {
|
|
79
79
|
companyUuid: i,
|
|
80
|
-
requestBody: { requirementSets:
|
|
80
|
+
requestBody: { requirementSets: T },
|
|
81
81
|
state: y
|
|
82
82
|
}
|
|
83
|
-
}),
|
|
83
|
+
}), x(g.COMPANY_STATE_TAX_UPDATED);
|
|
84
84
|
});
|
|
85
|
-
},
|
|
86
|
-
|
|
85
|
+
}, R = () => {
|
|
86
|
+
x(g.CANCEL);
|
|
87
87
|
};
|
|
88
|
-
return /* @__PURE__ */ a("section", { className:
|
|
89
|
-
|
|
88
|
+
return /* @__PURE__ */ a("section", { className: q, children: /* @__PURE__ */ a(B, { ...F, control: E, children: /* @__PURE__ */ a(J, { onSubmit: F.handleSubmit(N), children: /* @__PURE__ */ a(
|
|
89
|
+
G,
|
|
90
90
|
{
|
|
91
|
-
value: { stateTaxRequirements: l, isPending:
|
|
92
|
-
children: /* @__PURE__ */ a(
|
|
93
|
-
/* @__PURE__ */ a(
|
|
94
|
-
/* @__PURE__ */ a(
|
|
95
|
-
/* @__PURE__ */ a(
|
|
91
|
+
value: { stateTaxRequirements: l, isPending: j, state: y, handleCancel: R },
|
|
92
|
+
children: /* @__PURE__ */ a(I, { flexDirection: "column", gap: 32, children: h || /* @__PURE__ */ V(O, { children: [
|
|
93
|
+
/* @__PURE__ */ a(H, {}),
|
|
94
|
+
/* @__PURE__ */ a(L, {}),
|
|
95
|
+
/* @__PURE__ */ a(X, {})
|
|
96
96
|
] }) })
|
|
97
97
|
}
|
|
98
98
|
) }) }) });
|
|
99
99
|
}
|
|
100
|
-
h.Head = k;
|
|
101
|
-
h.Form = A;
|
|
102
|
-
h.Actions = P;
|
|
103
100
|
export {
|
|
104
|
-
|
|
101
|
+
Se as StateTaxesForm
|
|
105
102
|
};
|
|
106
103
|
//# sourceMappingURL=StateTaxesForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateTaxesForm.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useTaxRequirementsUpdateStateMutation } from '@gusto/embedded-api/react-query/taxRequirementsUpdateState'\nimport { useTaxRequirementsGetSuspense } from '@gusto/embedded-api/react-query/taxRequirementsGet'\nimport { z } from 'zod'\nimport { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { Head } from './Head'\nimport { StateTaxesFormProvider } from './context'\nimport { Form } from './Form'\nimport { Actions } from './Actions'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useI18n } from '@/i18n/I18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { componentEvents } from '@/shared/constants'\nimport { useBase } from '@/components/Base'\n\ninterface StateTaxesFormProps extends CommonComponentInterface {\n companyId: string\n state: string\n}\n\nexport function StateTaxesForm(props: StateTaxesFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, state, className, children }: StateTaxesFormProps) {\n useI18n('Company.StateTaxes')\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { data } = useTaxRequirementsGetSuspense({ companyUuid: companyId, state })\n const stateTaxRequirements = data.taxRequirementsState!\n\n const { mutateAsync: updateStateTax, isPending: isPendingUpdate } =\n useTaxRequirementsUpdateStateMutation()\n\n // Schema and default value generation\n const { dynamicSchema, defaultValues } = useMemo(() => {\n const schemaShape: Record<string, z.ZodObject<Record<string, z.ZodTypeAny>>> = {}\n const values: Partial<Record<string, Record<string, string | boolean | number | undefined>>> =\n {}\n\n //Looping through each requirement set\n stateTaxRequirements.requirementSets?.forEach(requirementSet => {\n if (!requirementSet.key) return\n\n const requirementSetKey = requirementSet.key\n const requirementShape: Record<string, z.ZodTypeAny> = {}\n const requirementValues: Record<string, string | boolean | number | undefined> = {}\n\n requirementSet.requirements?.forEach(requirement => {\n if (!requirement.key) return\n\n const requirementKey = requirement.key\n\n // --- Default Value Logic ---\n requirementValues[requirementKey] =\n requirement.metadata?.type === 'radio'\n ? (requirement.value ?? undefined)\n : requirement.value\n ? String(requirement.value)\n : ''\n\n // --- Schema Logic ---\n // Start with a basic string schema\n let fieldSchema: z.ZodTypeAny = z\n .string({\n required_error: t('validations.required'),\n })\n .min(1, t('validations.required'))\n\n const validation = requirement.metadata?.validation\n // Not all requirements have validation\n if (validation) {\n if (requirement.metadata?.type === 'tax_rate') {\n if (validation.type === 'min_max') {\n const min = parseFloat(validation.min as string)\n const max = parseFloat(validation.max as string)\n\n if (!isNaN(min) && !isNaN(max)) {\n fieldSchema = z.preprocess(\n val => Number(val),\n z\n .number()\n .min(min, t('validations.minValue', { min }))\n .max(max, t('validations.maxValue', { max }))\n .transform(num => String(num)),\n )\n }\n } else {\n //Type is one_of\n const oneOfValues = validation.rates as string[]\n fieldSchema = z\n .string({\n required_error: t('validations.required'),\n })\n .min(1, t('validations.required'))\n .refine(val => oneOfValues.includes(val), {\n message: t('validations.oneOf', { values: oneOfValues.join(', ') }),\n })\n }\n }\n }\n if (requirement.metadata?.type === 'radio') {\n fieldSchema = z.boolean({\n required_error: t('validations.required'),\n })\n }\n requirementShape[requirementKey] = fieldSchema\n // --- End Schema Logic ---\n })\n\n if (Object.keys(requirementShape).length > 0) {\n schemaShape[requirementSetKey] = z.object(requirementShape)\n values[requirementSetKey] = requirementValues\n }\n })\n\n const finalSchema = z.object(schemaShape)\n\n // Return both the schema and the default values\n return {\n dynamicSchema: finalSchema,\n defaultValues: values as z.infer<typeof finalSchema>,\n }\n }, [stateTaxRequirements, t])\n\n // Infer the type from the schema\n type InferredFormInputs = z.infer<typeof dynamicSchema>\n\n const { control, ...methods } = useForm<InferredFormInputs>({\n resolver: zodResolver(dynamicSchema),\n defaultValues,\n })\n\n const onSubmit = async (formData: InferredFormInputs) => {\n await baseSubmitHandler(formData, async payload => {\n const requirementSets = stateTaxRequirements.requirementSets\n ?.filter(rs => rs.key && payload[rs.key])\n .map(requirementSet => {\n const requirementSetKey = requirementSet.key as string\n const payloadSet = payload[requirementSetKey] as Record<string, unknown>\n return {\n state: requirementSet.state,\n key: requirementSetKey,\n effectiveFrom: requirementSet.effectiveFrom,\n requirements: Object.entries(payloadSet).map(([key, value]) => ({\n key,\n value: String(value),\n })),\n }\n })\n await updateStateTax({\n request: {\n companyUuid: companyId,\n requestBody: { requirementSets },\n state,\n },\n })\n onEvent(componentEvents.COMPANY_STATE_TAX_UPDATED)\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <StateTaxesFormProvider\n value={{ stateTaxRequirements, isPending: isPendingUpdate, state, handleCancel }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </StateTaxesFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n\nStateTaxesForm.Head = Head\nStateTaxesForm.Form = Form\nStateTaxesForm.Actions = Actions\n"],"names":["StateTaxesForm","props","jsx","BaseComponent","Root","companyId","state","className","children","useI18n","onEvent","baseSubmitHandler","useBase","t","useTranslation","data","useTaxRequirementsGetSuspense","stateTaxRequirements","updateStateTax","isPendingUpdate","useTaxRequirementsUpdateStateMutation","dynamicSchema","defaultValues","useMemo","schemaShape","values","requirementSet","requirementSetKey","requirementShape","requirementValues","requirement","requirementKey","fieldSchema","z","validation","min","max","val","num","oneOfValues","control","methods","useForm","zodResolver","onSubmit","formData","payload","requirementSets","rs","payloadSet","key","value","componentEvents","handleCancel","FormProvider","HtmlForm","St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+C,EAAa;AAAA,MAE/E,UAAA,gBAAAnD,EAACuD,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAjD,KAIG,gBAAAkD,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAzD,EAAC0D,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,EAAA,CACX,EAEJ,CAAA;AAAA,IAAA;AAAA,EAAA,EAEJ,CAAA,EACF,CAAA,GACF;AAEJ;AAEA9D,EAAe,OAAO4D;AACtB5D,EAAe,OAAO6D;AACtB7D,EAAe,UAAU8D;"}
|
|
1
|
+
{"version":3,"file":"StateTaxesForm.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useTaxRequirementsUpdateStateMutation } from '@gusto/embedded-api/react-query/taxRequirementsUpdateState'\nimport { useTaxRequirementsGetSuspense } from '@gusto/embedded-api/react-query/taxRequirementsGet'\nimport { z } from 'zod'\nimport { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { Head } from './Head'\nimport { StateTaxesFormProvider } from './context'\nimport { Form } from './Form'\nimport { Actions } from './Actions'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useI18n } from '@/i18n/I18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { componentEvents } from '@/shared/constants'\nimport { useBase } from '@/components/Base'\n\ninterface StateTaxesFormProps extends CommonComponentInterface {\n companyId: string\n state: string\n}\n\nexport function StateTaxesForm(props: StateTaxesFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, state, className, children }: StateTaxesFormProps) {\n useI18n('Company.StateTaxes')\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { data } = useTaxRequirementsGetSuspense({ companyUuid: companyId, state })\n const stateTaxRequirements = data.taxRequirementsState!\n\n const { mutateAsync: updateStateTax, isPending: isPendingUpdate } =\n useTaxRequirementsUpdateStateMutation()\n\n // Schema and default value generation\n const { dynamicSchema, defaultValues } = useMemo(() => {\n const schemaShape: Record<string, z.ZodObject<Record<string, z.ZodTypeAny>>> = {}\n const values: Partial<Record<string, Record<string, string | boolean | number | undefined>>> =\n {}\n\n //Looping through each requirement set\n stateTaxRequirements.requirementSets?.forEach(requirementSet => {\n if (!requirementSet.key) return\n\n const requirementSetKey = requirementSet.key\n const requirementShape: Record<string, z.ZodTypeAny> = {}\n const requirementValues: Record<string, string | boolean | number | undefined> = {}\n\n requirementSet.requirements?.forEach(requirement => {\n if (!requirement.key) return\n\n const requirementKey = requirement.key\n\n // --- Default Value Logic ---\n requirementValues[requirementKey] =\n requirement.metadata?.type === 'radio'\n ? (requirement.value ?? undefined)\n : requirement.value\n ? String(requirement.value)\n : ''\n\n // --- Schema Logic ---\n // Start with a basic string schema\n let fieldSchema: z.ZodTypeAny = z\n .string({\n required_error: t('validations.required'),\n })\n .min(1, t('validations.required'))\n\n const validation = requirement.metadata?.validation\n // Not all requirements have validation\n if (validation) {\n if (requirement.metadata?.type === 'tax_rate') {\n if (validation.type === 'min_max') {\n const min = parseFloat(validation.min as string)\n const max = parseFloat(validation.max as string)\n\n if (!isNaN(min) && !isNaN(max)) {\n fieldSchema = z.preprocess(\n val => Number(val),\n z\n .number()\n .min(min, t('validations.minValue', { min }))\n .max(max, t('validations.maxValue', { max }))\n .transform(num => String(num)),\n )\n }\n } else {\n //Type is one_of\n const oneOfValues = validation.rates as string[]\n fieldSchema = z\n .string({\n required_error: t('validations.required'),\n })\n .min(1, t('validations.required'))\n .refine(val => oneOfValues.includes(val), {\n message: t('validations.oneOf', { values: oneOfValues.join(', ') }),\n })\n }\n }\n }\n if (requirement.metadata?.type === 'radio') {\n fieldSchema = z.boolean({\n required_error: t('validations.required'),\n })\n }\n requirementShape[requirementKey] = fieldSchema\n // --- End Schema Logic ---\n })\n\n if (Object.keys(requirementShape).length > 0) {\n schemaShape[requirementSetKey] = z.object(requirementShape)\n values[requirementSetKey] = requirementValues\n }\n })\n\n const finalSchema = z.object(schemaShape)\n\n // Return both the schema and the default values\n return {\n dynamicSchema: finalSchema,\n defaultValues: values as z.infer<typeof finalSchema>,\n }\n }, [stateTaxRequirements, t])\n\n // Infer the type from the schema\n type InferredFormInputs = z.infer<typeof dynamicSchema>\n\n const { control, ...methods } = useForm<InferredFormInputs>({\n resolver: zodResolver(dynamicSchema),\n defaultValues,\n })\n\n const onSubmit = async (formData: InferredFormInputs) => {\n await baseSubmitHandler(formData, async payload => {\n const requirementSets = stateTaxRequirements.requirementSets\n ?.filter(rs => rs.key && payload[rs.key])\n .map(requirementSet => {\n const requirementSetKey = requirementSet.key as string\n const payloadSet = payload[requirementSetKey] as Record<string, unknown>\n return {\n state: requirementSet.state,\n key: requirementSetKey,\n effectiveFrom: requirementSet.effectiveFrom,\n requirements: Object.entries(payloadSet).map(([key, value]) => ({\n key,\n value: String(value),\n })),\n }\n })\n await updateStateTax({\n request: {\n companyUuid: companyId,\n requestBody: { requirementSets },\n state,\n },\n })\n onEvent(componentEvents.COMPANY_STATE_TAX_UPDATED)\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <StateTaxesFormProvider\n value={{ stateTaxRequirements, isPending: isPendingUpdate, state, handleCancel }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </StateTaxesFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n"],"names":["StateTaxesForm","props","jsx","BaseComponent","Root","companyId","state","className","children","useI18n","onEvent","baseSubmitHandler","useBase","t","useTranslation","data","useTaxRequirementsGetSuspense","stateTaxRequirements","updateStateTax","isPendingUpdate","useTaxRequirementsUpdateStateMutation","dynamicSchema","defaultValues","useMemo","schemaShape","values","requirementSet","requirementSetKey","requirementShape","requirementValues","requirement","requirementKey","fieldSchema","z","validation","min","max","val","num","oneOfValues","control","methods","useForm","zodResolver","onSubmit","formData","payload","requirementSets","rs","payloadSet","key","value","componentEvents","handleCancel","FormProvider","HtmlForm","StateTaxesFormProvider","Flex","jsxs","Fragment","Head","Form","Actions"],"mappings":";;;;;;;;;;;;;;;;;;AAwBO,SAASA,GAAeC,GAAqD;AAEhF,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,OAAAC,GAAO,WAAAC,GAAW,UAAAC,KAAiC;AAC5E,EAAAC,EAAQ,oBAAoB;AAC5B,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GACzC,EAAE,GAAAC,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,MAAAC,MAASC,EAA8B,EAAE,aAAaX,GAAW,OAAAC,GAAO,GAC1EW,IAAuBF,EAAK,sBAE5B,EAAE,aAAaG,GAAgB,WAAWC,EAAA,IAC9CC,EAAsC,GAGlC,EAAE,eAAAC,GAAe,eAAAC,EAAc,IAAIC,EAAQ,MAAM;AACrD,UAAMC,IAAyE,CAAC,GAC1EC,IACJ,CAAC;AAGkB,WAAAR,EAAA,iBAAiB,QAAQ,CAAkBS,MAAA;AAC1D,UAAA,CAACA,EAAe,IAAK;AAEzB,YAAMC,IAAoBD,EAAe,KACnCE,IAAiD,CAAC,GAClDC,IAA2E,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A,EACH,GAEMC,IAAe,MAAM;AACzB,IAAA3C,EAAQ0C,EAAgB,MAAM;AAAA,EAChC;AAEA,SACG,gBAAAlD,EAAA,WAAA,EAAQ,WAAAK,GACP,UAAA,gBAAAL,EAACoD,KAAc,GAAGb,GAAS,SAAAD,GACzB,UAAA,gBAAAtC,EAACqD,GAAS,EAAA,UAAUd,EAAQ,aAAaG,CAAQ,GAC/C,UAAA,gBAAA1C;AAAA,IAACsD;AAAA,IAAA;AAAA,MACC,OAAO,EAAE,sBAAAvC,GAAsB,WAAWE,GAAiB,OAAAb,GAAO,cAAA+C,EAAa;AAAA,MAE/E,UAAA,gBAAAnD,EAACuD,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAjD,KAIG,gBAAAkD,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAzD,EAAC0D,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,EAAA,CACX,EAEJ,CAAA;AAAA,IAAA;AAAA,EAAA,EAEJ,CAAA,EACF,CAAA,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";
|
|
12
11
|
import "dompurify";
|
|
13
12
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
+
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
14
|
import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
|
|
15
15
|
const [c, d] = t("StateTaxesFormContext");
|
|
16
16
|
export {
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as i } from "react-i18next";
|
|
3
3
|
import { useStateTaxesList as e } from "./context.js";
|
|
4
|
-
import "
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(n.Button, { variant: "primary", onClick: r, children: o("list.continueCta") }) });
|
|
4
|
+
import { ActionsLayout as s } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
5
|
+
import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
+
function f() {
|
|
7
|
+
const { t: o } = i("Company.StateTaxes"), n = m(), { handleContinue: r } = e();
|
|
8
|
+
return /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(n.Button, { variant: "primary", onClick: r, children: o("list.continueCta") }) });
|
|
10
9
|
}
|
|
11
10
|
export {
|
|
12
|
-
|
|
11
|
+
f as Actions
|
|
13
12
|
};
|
|
14
13
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes')\n const Components = useComponentContext()\n const { handleContinue } = useStateTaxesList()\n return (\n <ActionsLayout>\n <Components.Button variant=\"primary\" onClick={handleContinue}>\n {t('list.continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","Components","useComponentContext","handleContinue","useStateTaxesList","jsx","ActionsLayout"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes')\n const Components = useComponentContext()\n const { handleContinue } = useStateTaxesList()\n return (\n <ActionsLayout>\n <Components.Button variant=\"primary\" onClick={handleContinue}>\n {t('list.continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","Components","useComponentContext","handleContinue","useStateTaxesList","jsx","ActionsLayout"],"mappings":";;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB,GAC3CC,IAAaC,EAAoB,GACjC,EAAE,gBAAAC,EAAe,IAAIC,EAAkB;AAC7C,SACG,gBAAAC,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAJ,EAAW,QAAX,EAAkB,SAAQ,WAAU,SAASE,GAC3C,UAAEJ,EAAA,kBAAkB,EACvB,CAAA,GACF;AAEJ;"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { jsx as s, Fragment as p } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as o } from "react-i18next";
|
|
3
3
|
import { useStateTaxesList as l } from "./context.js";
|
|
4
|
-
import "classnames";
|
|
5
4
|
import { EmptyData as c } from "../../../Common/EmptyData/EmptyData.js";
|
|
6
5
|
import { useComponentContext as u } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
7
6
|
import { useDataView as d } from "../../../Common/DataView/useDataView.js";
|
|
8
7
|
import { DataView as C } from "../../../Common/DataView/DataView.js";
|
|
9
|
-
const
|
|
10
|
-
const { stateTaxRequirements:
|
|
11
|
-
data:
|
|
8
|
+
const S = () => {
|
|
9
|
+
const { stateTaxRequirements: n, handleChange: r } = l(), a = u(), { t } = o("Company.StateTaxes", { keyPrefix: "list" }), { t: i } = o("common", { keyPrefix: "statesHash" }), { ...m } = d({
|
|
10
|
+
data: n,
|
|
12
11
|
columns: [
|
|
13
12
|
{
|
|
14
13
|
key: "state",
|
|
@@ -26,7 +25,7 @@ const k = () => {
|
|
|
26
25
|
{
|
|
27
26
|
variant: "secondary",
|
|
28
27
|
onClick: () => {
|
|
29
|
-
|
|
28
|
+
r(e.state);
|
|
30
29
|
},
|
|
31
30
|
children: e.setupComplete ? t("editStateTaxCta") : t("continueStateTaxSetupCta")
|
|
32
31
|
}
|
|
@@ -36,6 +35,6 @@ const k = () => {
|
|
|
36
35
|
return /* @__PURE__ */ s(C, { label: t("requirementsListLabel"), ...m });
|
|
37
36
|
};
|
|
38
37
|
export {
|
|
39
|
-
|
|
38
|
+
S as List
|
|
40
39
|
};
|
|
41
40
|
//# sourceMappingURL=List.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { DataView, EmptyData, useDataView } from '@/components/Common'\nimport type { STATES_ABBR } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const List = () => {\n const { stateTaxRequirements, handleChange } = useStateTaxesList()\n const Components = useComponentContext()\n\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'list' })\n const { t: statesHash } = useTranslation('common', { keyPrefix: 'statesHash' })\n\n const { ...dataViewProps } = useDataView({\n data: stateTaxRequirements,\n columns: [\n {\n key: 'state',\n title: t('requirementsListCol1'),\n render: requirement => {\n return <span>{statesHash(requirement.state as (typeof STATES_ABBR)[number])}</span>\n },\n },\n {\n key: 'status',\n title: t('requirementsListCol2'),\n render: requirement => {\n return (\n <>\n <Components.Badge status={requirement.setupComplete ? 'success' : 'warning'}>\n {requirement.setupComplete ? t('completeBadge') : t('incompleteBadge')}\n </Components.Badge>\n </>\n )\n },\n },\n ],\n itemMenu: requirement => {\n return (\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleChange(requirement.state)\n }}\n >\n {requirement.setupComplete ? t('editStateTaxCta') : t('continueStateTaxSetupCta')}\n </Components.Button>\n )\n },\n\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')} />\n ),\n })\n return <DataView label={t('requirementsListLabel')} {...dataViewProps} />\n}\n"],"names":["List","stateTaxRequirements","handleChange","useStateTaxesList","Components","useComponentContext","useTranslation","statesHash","dataViewProps","useDataView","requirement","jsx","EmptyData","DataView"],"mappings":"
|
|
1
|
+
{"version":3,"file":"List.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { DataView, EmptyData, useDataView } from '@/components/Common'\nimport type { STATES_ABBR } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const List = () => {\n const { stateTaxRequirements, handleChange } = useStateTaxesList()\n const Components = useComponentContext()\n\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'list' })\n const { t: statesHash } = useTranslation('common', { keyPrefix: 'statesHash' })\n\n const { ...dataViewProps } = useDataView({\n data: stateTaxRequirements,\n columns: [\n {\n key: 'state',\n title: t('requirementsListCol1'),\n render: requirement => {\n return <span>{statesHash(requirement.state as (typeof STATES_ABBR)[number])}</span>\n },\n },\n {\n key: 'status',\n title: t('requirementsListCol2'),\n render: requirement => {\n return (\n <>\n <Components.Badge status={requirement.setupComplete ? 'success' : 'warning'}>\n {requirement.setupComplete ? t('completeBadge') : t('incompleteBadge')}\n </Components.Badge>\n </>\n )\n },\n },\n ],\n itemMenu: requirement => {\n return (\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleChange(requirement.state)\n }}\n >\n {requirement.setupComplete ? t('editStateTaxCta') : t('continueStateTaxSetupCta')}\n </Components.Button>\n )\n },\n\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')} />\n ),\n })\n return <DataView label={t('requirementsListLabel')} {...dataViewProps} />\n}\n"],"names":["List","stateTaxRequirements","handleChange","useStateTaxesList","Components","useComponentContext","useTranslation","statesHash","dataViewProps","useDataView","requirement","jsx","EmptyData","DataView"],"mappings":";;;;;;;AAMO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,sBAAAC,GAAsB,cAAAC,EAAa,IAAIC,EAAkB,GAC3DC,IAAaC,EAAoB,GAEjC,EAAE,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,GAAGC,MAAeD,EAAe,UAAU,EAAE,WAAW,cAAc,GAExE,EAAE,GAAGE,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAMR;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,sBAAsB;AAAA,QAC/B,QAAQ,CAAeS,MACb,gBAAAC,EAAA,QAAA,EAAM,UAAWJ,EAAAG,EAAY,KAAqC,GAAE;AAAA,MAEhF;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,sBAAsB;AAAA,QAC/B,QAAQ,CAAeA,6BAGjB,UAAC,gBAAAC,EAAAP,EAAW,OAAX,EAAiB,QAAQM,EAAY,gBAAgB,YAAY,WAC/D,UAAAA,EAAY,gBAAgB,EAAE,eAAe,IAAI,EAAE,iBAAiB,EACvE,CAAA,GACF;AAAA,MAEJ;AAAA,IAEJ;AAAA,IACA,UAAU,CAAeA,MAErB,gBAAAC;AAAA,MAACP,EAAW;AAAA,MAAX;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAF,EAAaQ,EAAY,KAAK;AAAA,QAChC;AAAA,QAEC,YAAY,gBAAgB,EAAE,iBAAiB,IAAI,EAAE,0BAA0B;AAAA,MAAA;AAAA,IAClF;AAAA,IAIJ,YAAY,MACV,gBAAAC,EAACC,GAAU,EAAA,OAAO,EAAE,iBAAiB,GAAG,aAAa,EAAE,uBAAuB,EAAG,CAAA;AAAA,EAAA,CAEpF;AACD,2BAAQC,GAAS,EAAA,OAAO,EAAE,uBAAuB,GAAI,GAAGL,GAAe;AACzE;"}
|
|
@@ -3,9 +3,4 @@ interface StateTaxesListProps extends BaseComponentInterface {
|
|
|
3
3
|
companyId: string;
|
|
4
4
|
}
|
|
5
5
|
export declare function StateTaxesList(props: StateTaxesListProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export declare namespace StateTaxesList {
|
|
7
|
-
var Head: typeof import("./Head").Head;
|
|
8
|
-
var List: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
var Actions: typeof import("./Actions").Actions;
|
|
10
|
-
}
|
|
11
6
|
export {};
|
|
@@ -1,45 +1,42 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useTaxRequirementsGetAllSuspense as
|
|
3
|
-
import { Head as
|
|
4
|
-
import { StateTaxesListProvider as
|
|
5
|
-
import { Actions as
|
|
6
|
-
import { List as
|
|
7
|
-
import { BaseComponent as
|
|
8
|
-
import { useI18n as
|
|
9
|
-
import { Flex as
|
|
10
|
-
import { componentEvents as
|
|
11
|
-
import { useBase as
|
|
12
|
-
function
|
|
13
|
-
return /* @__PURE__ */ e(
|
|
1
|
+
import { jsx as e, jsxs as c, Fragment as l } from "react/jsx-runtime";
|
|
2
|
+
import { useTaxRequirementsGetAllSuspense as d } from "@gusto/embedded-api/react-query/taxRequirementsGetAll";
|
|
3
|
+
import { Head as f } from "./Head.js";
|
|
4
|
+
import { StateTaxesListProvider as p } from "./context.js";
|
|
5
|
+
import { Actions as u } from "./Actions.js";
|
|
6
|
+
import { List as h } from "./List.js";
|
|
7
|
+
import { BaseComponent as T } from "../../../Base/Base.js";
|
|
8
|
+
import { useI18n as x } from "../../../../i18n/I18n.js";
|
|
9
|
+
import { Flex as A } from "../../../Common/Flex/Flex.js";
|
|
10
|
+
import { componentEvents as r } from "../../../../shared/constants.js";
|
|
11
|
+
import { useBase as C } from "../../../Base/useBase.js";
|
|
12
|
+
function y(n) {
|
|
13
|
+
return /* @__PURE__ */ e(T, { ...n, children: /* @__PURE__ */ e(E, { ...n, children: n.children }) });
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
const { onEvent:
|
|
15
|
+
function E({ className: n, children: t, companyId: i }) {
|
|
16
|
+
x("Company.StateTaxes");
|
|
17
|
+
const { onEvent: o } = C(), { data: m } = d({ companyUuid: i }), s = m.responseBodies;
|
|
18
18
|
return /* @__PURE__ */ e("section", { className: n, children: /* @__PURE__ */ e(
|
|
19
|
-
|
|
19
|
+
p,
|
|
20
20
|
{
|
|
21
21
|
value: {
|
|
22
22
|
isPending: !1,
|
|
23
|
-
stateTaxRequirements:
|
|
23
|
+
stateTaxRequirements: s,
|
|
24
24
|
handleContinue: () => {
|
|
25
|
-
r
|
|
25
|
+
o(r.COMPANY_STATE_TAX_DONE);
|
|
26
26
|
},
|
|
27
|
-
handleChange: (
|
|
28
|
-
r
|
|
27
|
+
handleChange: (a) => {
|
|
28
|
+
o(r.COMPANY_STATE_TAX_EDIT, { state: a });
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
|
-
children: /* @__PURE__ */ e(
|
|
32
|
-
/* @__PURE__ */ e(
|
|
33
|
-
/* @__PURE__ */ e(
|
|
34
|
-
/* @__PURE__ */ e(
|
|
31
|
+
children: /* @__PURE__ */ e(A, { flexDirection: "column", gap: 32, children: t || /* @__PURE__ */ c(l, { children: [
|
|
32
|
+
/* @__PURE__ */ e(f, {}),
|
|
33
|
+
/* @__PURE__ */ e(h, {}),
|
|
34
|
+
/* @__PURE__ */ e(u, {})
|
|
35
35
|
] }) })
|
|
36
36
|
}
|
|
37
37
|
) });
|
|
38
38
|
}
|
|
39
|
-
t.Head = s;
|
|
40
|
-
t.List = a;
|
|
41
|
-
t.Actions = m;
|
|
42
39
|
export {
|
|
43
|
-
|
|
40
|
+
y as StateTaxesList
|
|
44
41
|
};
|
|
45
42
|
//# sourceMappingURL=StateTaxesList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateTaxesList.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/StateTaxesList.tsx"],"sourcesContent":["import { useTaxRequirementsGetAllSuspense } from '@gusto/embedded-api/react-query/taxRequirementsGetAll'\nimport { Head } from './Head'\nimport { StateTaxesListProvider } from './context'\nimport { Actions } from './Actions'\nimport { List } from './List'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useI18n } from '@/i18n/I18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { componentEvents } from '@/shared/constants'\nimport { useBase } from '@/components/Base'\n\ninterface StateTaxesListProps extends BaseComponentInterface {\n companyId: string\n}\n\nexport function StateTaxesList(props: StateTaxesListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, children, companyId }: StateTaxesListProps) {\n useI18n('Company.StateTaxes')\n const { onEvent } = useBase()\n const { data } = useTaxRequirementsGetAllSuspense({ companyUuid: companyId })\n const stateTaxRequirements = data.responseBodies!\n\n const handleContinue = () => {\n onEvent(componentEvents.COMPANY_STATE_TAX_DONE)\n }\n\n const handleChange = (state: string) => {\n onEvent(componentEvents.COMPANY_STATE_TAX_EDIT, { state })\n }\n\n return (\n <section className={className}>\n <StateTaxesListProvider\n value={{\n isPending: false,\n stateTaxRequirements,\n handleContinue,\n handleChange,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <List />\n <Actions />\n </>\n )}\n </Flex>\n </StateTaxesListProvider>\n </section>\n )\n}\n
|
|
1
|
+
{"version":3,"file":"StateTaxesList.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/StateTaxesList.tsx"],"sourcesContent":["import { useTaxRequirementsGetAllSuspense } from '@gusto/embedded-api/react-query/taxRequirementsGetAll'\nimport { Head } from './Head'\nimport { StateTaxesListProvider } from './context'\nimport { Actions } from './Actions'\nimport { List } from './List'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useI18n } from '@/i18n/I18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { componentEvents } from '@/shared/constants'\nimport { useBase } from '@/components/Base'\n\ninterface StateTaxesListProps extends BaseComponentInterface {\n companyId: string\n}\n\nexport function StateTaxesList(props: StateTaxesListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, children, companyId }: StateTaxesListProps) {\n useI18n('Company.StateTaxes')\n const { onEvent } = useBase()\n const { data } = useTaxRequirementsGetAllSuspense({ companyUuid: companyId })\n const stateTaxRequirements = data.responseBodies!\n\n const handleContinue = () => {\n onEvent(componentEvents.COMPANY_STATE_TAX_DONE)\n }\n\n const handleChange = (state: string) => {\n onEvent(componentEvents.COMPANY_STATE_TAX_EDIT, { state })\n }\n\n return (\n <section className={className}>\n <StateTaxesListProvider\n value={{\n isPending: false,\n stateTaxRequirements,\n handleContinue,\n handleChange,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <List />\n <Actions />\n </>\n )}\n </Flex>\n </StateTaxesListProvider>\n </section>\n )\n}\n"],"names":["StateTaxesList","props","jsx","BaseComponent","Root","className","children","companyId","useI18n","onEvent","useBase","data","useTaxRequirementsGetAllSuspense","stateTaxRequirements","StateTaxesListProvider","componentEvents","state","Flex","jsxs","Fragment","Head","List","Actions"],"mappings":";;;;;;;;;;;AAgBO,SAASA,EAAeC,GAA4B;AAEvD,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,UAAAC,GAAU,WAAAC,KAAkC;AACrE,EAAAC,EAAQ,oBAAoB;AACtB,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAQ,GACtB,EAAE,MAAAC,EAAK,IAAIC,EAAiC,EAAE,aAAaL,GAAW,GACtEM,IAAuBF,EAAK;AAWhC,SAAA,gBAAAT,EAAC,aAAQ,WAAAG,GACP,UAAA,gBAAAH;AAAA,IAACY;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,WAAW;AAAA,QACX,sBAAAD;AAAA,QACA,gBAde,MAAM;AAC3B,UAAAJ,EAAQM,EAAgB,sBAAsB;AAAA,QAChD;AAAA,QAaQ,cAXa,CAACC,MAAkB;AACtC,UAAAP,EAAQM,EAAgB,wBAAwB,EAAE,OAAAC,EAAA,CAAO;AAAA,QAC3D;AAAA,MAUM;AAAA,MAEA,UAAA,gBAAAd,EAACe,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAX,KAIG,gBAAAY,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAjB,EAACkB,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,EAAA,CACX,EAEJ,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;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";
|
|
12
11
|
import "dompurify";
|
|
13
12
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
+
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
14
|
import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
|
|
15
15
|
const [c, d] = t("StateTaxesListContext");
|
|
16
16
|
export {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { componentEvents } from '../../../shared/constants';
|
|
2
|
+
export type StateTaxesState = 'viewStateTaxes' | 'editStateTaxes' | 'done';
|
|
3
|
+
export interface StateTaxesStateData {
|
|
4
|
+
state: StateTaxesState;
|
|
5
|
+
selectedState?: string;
|
|
6
|
+
}
|
|
7
|
+
export type StateTaxesAction = {
|
|
8
|
+
type: typeof componentEvents.COMPANY_STATE_TAX_EDIT;
|
|
9
|
+
payload: {
|
|
10
|
+
state: string;
|
|
11
|
+
};
|
|
12
|
+
} | {
|
|
13
|
+
type: typeof componentEvents.COMPANY_STATE_TAX_UPDATED;
|
|
14
|
+
} | {
|
|
15
|
+
type: typeof componentEvents.COMPANY_STATE_TAX_DONE;
|
|
16
|
+
} | {
|
|
17
|
+
type: typeof componentEvents.CANCEL;
|
|
18
|
+
};
|
|
19
|
+
export declare const initialState: StateTaxesStateData;
|
|
20
|
+
export declare function stateTaxesReducer(state: StateTaxesStateData, action: StateTaxesAction): StateTaxesStateData;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { componentEvents as t } from "../../../shared/constants.js";
|
|
2
|
+
const T = {
|
|
3
|
+
state: "viewStateTaxes",
|
|
4
|
+
selectedState: void 0
|
|
5
|
+
};
|
|
6
|
+
function d(e, a) {
|
|
7
|
+
switch (a.type) {
|
|
8
|
+
case t.COMPANY_STATE_TAX_EDIT:
|
|
9
|
+
return {
|
|
10
|
+
...e,
|
|
11
|
+
state: "editStateTaxes",
|
|
12
|
+
selectedState: a.payload.state
|
|
13
|
+
};
|
|
14
|
+
case t.COMPANY_STATE_TAX_UPDATED:
|
|
15
|
+
return {
|
|
16
|
+
...e,
|
|
17
|
+
state: "viewStateTaxes",
|
|
18
|
+
selectedState: void 0
|
|
19
|
+
};
|
|
20
|
+
case t.CANCEL:
|
|
21
|
+
return {
|
|
22
|
+
...e,
|
|
23
|
+
state: "viewStateTaxes",
|
|
24
|
+
selectedState: void 0
|
|
25
|
+
};
|
|
26
|
+
case t.COMPANY_STATE_TAX_DONE:
|
|
27
|
+
return {
|
|
28
|
+
...e,
|
|
29
|
+
state: "done",
|
|
30
|
+
selectedState: void 0
|
|
31
|
+
};
|
|
32
|
+
default:
|
|
33
|
+
return e;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
T as initialState,
|
|
38
|
+
d as stateTaxesReducer
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=stateTaxesReducer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stateTaxesReducer.js","sources":["../../../../src/components/Company/StateTaxes/stateTaxesReducer.ts"],"sourcesContent":["import { componentEvents } from '@/shared/constants'\n\nexport type StateTaxesState = 'viewStateTaxes' | 'editStateTaxes' | 'done'\n\nexport interface StateTaxesStateData {\n state: StateTaxesState\n selectedState?: string\n}\n\nexport type StateTaxesAction =\n | { type: typeof componentEvents.COMPANY_STATE_TAX_EDIT; payload: { state: string } }\n | { type: typeof componentEvents.COMPANY_STATE_TAX_UPDATED }\n | { type: typeof componentEvents.COMPANY_STATE_TAX_DONE }\n | { type: typeof componentEvents.CANCEL }\n\nexport const initialState: StateTaxesStateData = {\n state: 'viewStateTaxes',\n selectedState: undefined,\n}\n\nexport function stateTaxesReducer(\n state: StateTaxesStateData,\n action: StateTaxesAction,\n): StateTaxesStateData {\n switch (action.type) {\n case componentEvents.COMPANY_STATE_TAX_EDIT:\n return {\n ...state,\n state: 'editStateTaxes',\n selectedState: action.payload.state,\n }\n\n case componentEvents.COMPANY_STATE_TAX_UPDATED:\n return {\n ...state,\n state: 'viewStateTaxes',\n selectedState: undefined,\n }\n\n case componentEvents.CANCEL:\n return {\n ...state,\n state: 'viewStateTaxes',\n selectedState: undefined,\n }\n\n case componentEvents.COMPANY_STATE_TAX_DONE:\n return {\n ...state,\n state: 'done',\n selectedState: undefined,\n }\n\n default:\n return state\n }\n}\n"],"names":["initialState","stateTaxesReducer","state","action","componentEvents"],"mappings":";AAeO,MAAMA,IAAoC;AAAA,EAC/C,OAAO;AAAA,EACP,eAAe;AACjB;AAEgB,SAAAC,EACdC,GACAC,GACqB;AACrB,UAAQA,EAAO,MAAM;AAAA,IACnB,KAAKC,EAAgB;AACZ,aAAA;AAAA,QACL,GAAGF;AAAA,QACH,OAAO;AAAA,QACP,eAAeC,EAAO,QAAQ;AAAA,MAChC;AAAA,IAEF,KAAKC,EAAgB;AACZ,aAAA;AAAA,QACL,GAAGF;AAAA,QACH,OAAO;AAAA,QACP,eAAe;AAAA,MACjB;AAAA,IAEF,KAAKE,EAAgB;AACZ,aAAA;AAAA,QACL,GAAGF;AAAA,QACH,OAAO;AAAA,QACP,eAAe;AAAA,MACjB;AAAA,IAEF,KAAKE,EAAgB;AACZ,aAAA;AAAA,QACL,GAAGF;AAAA,QACH,OAAO;AAAA,QACP,eAAe;AAAA,MACjB;AAAA,IAEF;AACS,aAAAA;AAAA,EAAA;AAEb;"}
|
|
@@ -8,9 +8,4 @@ export interface AddressProps extends BaseComponentInterface<'Contractor.Address
|
|
|
8
8
|
className?: string;
|
|
9
9
|
}
|
|
10
10
|
export declare function Address(props: AddressProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export declare namespace Address {
|
|
12
|
-
var Head: typeof import("./Head").Head;
|
|
13
|
-
var Form: typeof import("./Form").Form;
|
|
14
|
-
var Actions: typeof import("./Actions").Actions;
|
|
15
|
-
}
|
|
16
11
|
export default Address;
|
|
@@ -1,38 +1,36 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useContractorsGetSuspense as
|
|
3
|
-
import { useContractorsGetAddressSuspense as
|
|
4
|
-
import { useContractorsUpdateAddressMutation as
|
|
5
|
-
import { useForm as
|
|
6
|
-
import { zodResolver as
|
|
7
|
-
import { AddressFormSchema as
|
|
8
|
-
import { Head as
|
|
9
|
-
import { Form as
|
|
10
|
-
import { Actions as
|
|
1
|
+
import { jsx as t, jsxs as F, Fragment as R } from "react/jsx-runtime";
|
|
2
|
+
import { useContractorsGetSuspense as g } from "@gusto/embedded-api/react-query/contractorsGet";
|
|
3
|
+
import { useContractorsGetAddressSuspense as z } from "@gusto/embedded-api/react-query/contractorsGetAddress";
|
|
4
|
+
import { useContractorsUpdateAddressMutation as E } from "@gusto/embedded-api/react-query/contractorsUpdateAddress";
|
|
5
|
+
import { useForm as P, FormProvider as T } from "react-hook-form";
|
|
6
|
+
import { zodResolver as U } from "@hookform/resolvers/zod";
|
|
7
|
+
import { AddressFormSchema as b, AddressProvider as x } from "./useAddress.js";
|
|
8
|
+
import { Head as O } from "./Head.js";
|
|
9
|
+
import { Form as _ } from "./Form.js";
|
|
10
|
+
import { Actions as B } from "./Actions.js";
|
|
11
11
|
import { Form as N } from "../../Common/Form/Form.js";
|
|
12
12
|
import { useComponentDictionary as j, useI18n as q } from "../../../i18n/I18n.js";
|
|
13
13
|
import { Flex as w } from "../../Common/Flex/Flex.js";
|
|
14
|
-
import "react-i18next";
|
|
15
|
-
import "classnames";
|
|
16
14
|
import { BaseComponent as G } from "../../Base/Base.js";
|
|
17
|
-
import { useBase as
|
|
18
|
-
import { contractorEvents as
|
|
19
|
-
function
|
|
20
|
-
return /* @__PURE__ */ t(G, { ...r, children: /* @__PURE__ */ t(
|
|
15
|
+
import { useBase as H } from "../../Base/useBase.js";
|
|
16
|
+
import { contractorEvents as d } from "../../../shared/constants.js";
|
|
17
|
+
function st(r) {
|
|
18
|
+
return /* @__PURE__ */ t(G, { ...r, children: /* @__PURE__ */ t(M, { ...r, children: r.children }) });
|
|
21
19
|
}
|
|
22
|
-
function
|
|
23
|
-
j("Contractor.Address",
|
|
24
|
-
const { onEvent:
|
|
20
|
+
function M({ contractorId: r, defaultValues: e, children: n, className: a, dictionary: p }) {
|
|
21
|
+
j("Contractor.Address", p), q("Contractor.Address");
|
|
22
|
+
const { onEvent: i, baseSubmitHandler: u } = H(), { data: c } = g({ contractorUuid: r }), { data: f } = z({ contractorUuid: r }), { mutateAsync: A, isPending: D } = E(), h = c.contractor, C = c.contractor?.type, o = f.contractorAddress, S = {
|
|
25
23
|
street1: o?.street1 || e?.street1 || "",
|
|
26
24
|
street2: o?.street2 || e?.street2 || "",
|
|
27
25
|
city: o?.city || e?.city || "",
|
|
28
26
|
state: o?.state || e?.state || "",
|
|
29
27
|
zip: o?.zip || e?.zip || ""
|
|
30
|
-
},
|
|
31
|
-
resolver:
|
|
32
|
-
defaultValues:
|
|
33
|
-
}),
|
|
34
|
-
await
|
|
35
|
-
const { contractorAddress:
|
|
28
|
+
}, m = P({
|
|
29
|
+
resolver: U(b),
|
|
30
|
+
defaultValues: S
|
|
31
|
+
}), l = async (v) => {
|
|
32
|
+
await u(v, async (s) => {
|
|
33
|
+
const { contractorAddress: y } = await A({
|
|
36
34
|
request: {
|
|
37
35
|
contractorUuid: r,
|
|
38
36
|
requestBody: {
|
|
@@ -45,31 +43,28 @@ function $({ contractorId: r, defaultValues: e, children: i, className: A, dicti
|
|
|
45
43
|
}
|
|
46
44
|
}
|
|
47
45
|
});
|
|
48
|
-
|
|
46
|
+
i(d.CONTRACTOR_ADDRESS_UPDATED, y), i(d.CONTRACTOR_ADDRESS_DONE);
|
|
49
47
|
});
|
|
50
48
|
};
|
|
51
|
-
return /* @__PURE__ */ t("section", { className:
|
|
52
|
-
|
|
49
|
+
return /* @__PURE__ */ t("section", { className: a, children: /* @__PURE__ */ t(
|
|
50
|
+
x,
|
|
53
51
|
{
|
|
54
52
|
value: {
|
|
55
|
-
contractor:
|
|
56
|
-
contractorType:
|
|
53
|
+
contractor: h,
|
|
54
|
+
contractorType: C,
|
|
57
55
|
address: o,
|
|
58
|
-
isPending:
|
|
56
|
+
isPending: D
|
|
59
57
|
},
|
|
60
|
-
children: /* @__PURE__ */ t(
|
|
61
|
-
/* @__PURE__ */ t(
|
|
62
|
-
/* @__PURE__ */ t(
|
|
63
|
-
/* @__PURE__ */ t(
|
|
58
|
+
children: /* @__PURE__ */ t(T, { ...m, children: /* @__PURE__ */ t(N, { onSubmit: m.handleSubmit(l), children: /* @__PURE__ */ t(w, { flexDirection: "column", gap: 32, children: n || /* @__PURE__ */ F(R, { children: [
|
|
59
|
+
/* @__PURE__ */ t(O, {}),
|
|
60
|
+
/* @__PURE__ */ t(_, {}),
|
|
61
|
+
/* @__PURE__ */ t(B, {})
|
|
64
62
|
] }) }) }) })
|
|
65
63
|
}
|
|
66
64
|
) });
|
|
67
65
|
}
|
|
68
|
-
n.Head = p;
|
|
69
|
-
n.Form = u;
|
|
70
|
-
n.Actions = f;
|
|
71
66
|
export {
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
st as Address,
|
|
68
|
+
st as default
|
|
74
69
|
};
|
|
75
70
|
//# sourceMappingURL=Address.js.map
|