@gusto/embedded-react-sdk 0.17.0 → 0.19.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 +58 -0
- package/dist/assets/icons/icon-error-outline.svg.js +10 -0
- package/dist/assets/icons/icon-error-outline.svg.js.map +1 -0
- package/dist/assets/icons/icon-info-outline.svg.js +10 -0
- package/dist/assets/icons/icon-info-outline.svg.js.map +1 -0
- package/dist/assets/icons/icon-zap-fast.svg.js +10 -0
- package/dist/assets/icons/icon-zap-fast.svg.js.map +1 -0
- package/dist/components/Base/Base.js +50 -65
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/useBase.d.ts +2 -5
- package/dist/components/Base/useBase.js.map +1 -1
- package/dist/components/Common/Fieldset/Fieldset.module.scss.js +1 -1
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +42 -36
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js.map +1 -1
- package/dist/components/Common/HamburgerMenu/HamburgerMenu.js +1 -1
- package/dist/components/Common/HamburgerMenu/HamburgerMenu.js.map +1 -1
- package/dist/components/Common/PaginationControl/PaginationControl.js +6 -6
- package/dist/components/Common/PaginationControl/PaginationControl.js.map +1 -1
- package/dist/components/Common/RequirementsList/RequirementsList.js +19 -13
- package/dist/components/Common/RequirementsList/RequirementsList.js.map +1 -1
- package/dist/components/Common/RequirementsList/RequirementsList.module.scss.js +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +4 -7
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +10 -13
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +10 -13
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/Badge/index.d.ts +2 -0
- package/dist/components/Common/UI/Banner/Banner.d.ts +3 -0
- package/dist/components/Common/UI/Banner/Banner.js +31 -0
- package/dist/components/Common/UI/Banner/Banner.js.map +1 -0
- package/dist/components/Common/UI/Banner/Banner.module.scss.js +14 -0
- package/dist/components/Common/UI/Banner/Banner.module.scss.js.map +1 -0
- package/dist/components/Common/UI/Banner/BannerTypes.d.ts +21 -0
- package/dist/components/Common/UI/Banner/BannerTypes.js +7 -0
- package/dist/components/Common/UI/Banner/BannerTypes.js.map +1 -0
- package/dist/components/Common/UI/Banner/index.d.ts +4 -0
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Common/UI/DatePicker/DatePicker.module.scss.js +8 -8
- package/dist/components/Common/UI/Dialog/Dialog.js +50 -76
- package/dist/components/Common/UI/Dialog/Dialog.js.map +1 -1
- package/dist/components/Common/UI/Dialog/Dialog.module.scss.js +8 -14
- package/dist/components/Common/UI/Dialog/Dialog.module.scss.js.map +1 -1
- package/dist/components/Common/UI/Link/LinkTypes.d.ts +7 -6
- package/dist/components/Common/UI/List/List.module.scss.js +2 -2
- package/dist/components/Common/UI/Modal/Modal.d.ts +2 -0
- package/dist/components/Common/UI/Modal/Modal.js +90 -0
- package/dist/components/Common/UI/Modal/Modal.js.map +1 -0
- package/dist/components/Common/UI/Modal/Modal.module.scss.js +26 -0
- package/dist/components/Common/UI/Modal/Modal.module.scss.js.map +1 -0
- package/dist/components/Common/UI/Modal/ModalTypes.d.ts +34 -0
- package/dist/components/Common/UI/Modal/ModalTypes.js +8 -0
- package/dist/components/Common/UI/Modal/ModalTypes.js.map +1 -0
- package/dist/components/Common/UI/Modal/index.d.ts +3 -0
- package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
- package/dist/components/Common/UI/Tabs/Tabs.d.ts +0 -5
- package/dist/components/Common/UI/Tabs/Tabs.js +45 -16
- package/dist/components/Common/UI/Tabs/Tabs.js.map +1 -1
- package/dist/components/Common/UI/Tabs/Tabs.module.scss.js +8 -4
- package/dist/components/Common/UI/Tabs/Tabs.module.scss.js.map +1 -1
- package/dist/components/Common/UI/Tabs/TabsTypes.d.ts +7 -0
- package/dist/components/Common/index.d.ts +0 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +6 -8
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -8
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -10
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +2 -3
- 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 +4 -6
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -8
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +5 -6
- 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 +4 -6
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +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/useAssignSignatory.js +6 -8
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +8 -9
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +9 -11
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -6
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +10 -12
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +11 -13
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -6
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -7
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +11 -13
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/ManageSignatories.js +13 -13
- package/dist/components/Company/DocumentSigner/DocumentList/ManageSignatories.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -6
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +6 -8
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -6
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +7 -9
- 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 +29 -31
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Head.js +5 -5
- package/dist/components/Company/FederalTaxes/Head.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +9 -11
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +5 -7
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +7 -9
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +10 -12
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +6 -8
- 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.js +10 -12
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -6
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +6 -8
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +6 -8
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +12 -14
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -6
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +12 -14
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +6 -8
- 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 +4 -6
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +40 -42
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +10 -12
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +35 -37
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +17 -19
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +13 -15
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -8
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +5 -7
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -6
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -8
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +5 -7
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -6
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +4 -6
- 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 +6 -8
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +54 -55
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +13 -14
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +4 -6
- 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/ContractorProfileForm.js +11 -11
- package/dist/components/Contractor/Profile/useContractorProfile.js +3 -4
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +9 -10
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Contractor/Submit/SubmitDone.js +8 -8
- package/dist/components/Contractor/Submit/SubmitDone.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +5 -6
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +23 -22
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +23 -25
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsComponents.js +1 -1
- package/dist/components/Employee/Deductions/DeductionsComponents.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +7 -7
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.d.ts +2 -2
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +3 -4
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +44 -40
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +3 -4
- package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/useDeductions.d.ts +2 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +6 -8
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +9 -11
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -6
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +11 -13
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -6
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +4 -6
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +3 -4
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +5 -7
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +37 -38
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -6
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Actions.js +6 -8
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +11 -13
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js +8 -8
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Head.js +7 -7
- package/dist/components/Employee/FederalTaxes/Head.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -6
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +22 -22
- 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 +7 -9
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +4 -5
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +10 -12
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +6 -7
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +3 -4
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -8
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/Actions.js +7 -9
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +38 -35
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.d.ts +52 -0
- package/dist/components/Employee/Profile/HomeAddress.js +64 -45
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +20 -21
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/Profile.js +150 -143
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.d.ts +1 -0
- package/dist/components/Employee/Profile/useProfile.js +4 -6
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/Actions.js +8 -10
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/StateTaxes.js +4 -4
- package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -6
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +8 -10
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +9 -11
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalHead.js +7 -7
- package/dist/components/Employee/Taxes/FederalHead.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.js +5 -5
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +4 -6
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Flow/Flow.js +16 -18
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.d.ts +6 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +57 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.d.ts +8 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js +79 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/index.d.ts +2 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.d.ts +7 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.js +25 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.js.map +1 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.d.ts +10 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +30 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/index.d.ts +2 -0
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.d.ts +10 -0
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +30 -0
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -0
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/index.d.ts +2 -0
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.d.ts +13 -0
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js +63 -0
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js.map +1 -0
- package/dist/components/Payroll/ConfirmWireDetails/index.d.ts +3 -0
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +9 -11
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +6 -7
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +1 -1
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +77 -76
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +133 -135
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js +5 -3
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +30 -29
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +145 -137
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +5 -7
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +3 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +22 -22
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +40 -27
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +50 -72
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +2 -4
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +42 -37
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js +20 -20
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +24 -21
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +3 -9
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +119 -131
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +6 -6
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +125 -94
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +6 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +243 -230
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.module.scss.js +8 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.d.ts +8 -0
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js +49 -0
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js.map +1 -0
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.d.ts +6 -0
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.js +18 -0
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.js.map +1 -0
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/index.d.ts +3 -0
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +2 -3
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +1 -0
- package/dist/components/Payroll/index.js +8 -6
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +8 -10
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +44 -40
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
- package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +2 -0
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +5 -0
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js +27 -25
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
- package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +4 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.js +3 -3
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +5 -8
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/ThemeProvider/theme.d.ts +1 -0
- package/dist/contexts/ThemeProvider/theme.js +5 -4
- package/dist/contexts/ThemeProvider/theme.js.map +1 -1
- package/dist/helpers/apiErrorToList.d.ts +7 -0
- package/dist/helpers/apiErrorToList.js +23 -0
- package/dist/helpers/apiErrorToList.js.map +1 -0
- package/dist/helpers/breadcrumbHelpers.js +30 -30
- package/dist/helpers/breadcrumbHelpers.js.map +1 -1
- package/dist/helpers/dateFormatting.d.ts +15 -7
- package/dist/helpers/dateFormatting.js +88 -35
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/helpers/formattedStrings.js +11 -12
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/hooks/useAsyncError.js.map +1 -0
- package/dist/hooks/useDateFormatter.d.ts +19 -0
- package/dist/hooks/useDateFormatter.js +24 -0
- package/dist/hooks/useDateFormatter.js.map +1 -0
- package/dist/hooks/useMenu.js.map +1 -0
- package/dist/{components/Common/hooks → hooks}/useNumberFormatter.js +1 -1
- package/dist/hooks/useNumberFormatter.js.map +1 -0
- package/dist/hooks/useOverflowDetection/index.d.ts +3 -0
- package/dist/hooks/useOverflowDetection/useOverflowDetection.d.ts +7 -0
- package/dist/hooks/useOverflowDetection/useOverflowDetection.js +28 -0
- package/dist/hooks/useOverflowDetection/useOverflowDetection.js.map +1 -0
- package/dist/i18n/I18n.js +1 -1
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.BankAccount.json.js +1 -1
- package/dist/i18n/en/Company.DocumentList.json.js +16 -16
- package/dist/i18n/en/Company.FederalTaxes.json.js +22 -22
- package/dist/i18n/en/Company.PaySchedule.json.js +9 -9
- package/dist/i18n/en/Contractor.ContractorList.json.js +8 -8
- package/dist/i18n/en/Contractor.Submit.json.js +6 -6
- package/dist/i18n/en/Employee.Compensation.json.js +20 -20
- package/dist/i18n/en/Employee.Deductions.json.js +135 -109
- package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
- package/dist/i18n/en/Employee.EmployeeList.json.js +6 -6
- package/dist/i18n/en/Employee.FederalTaxes.json.js +9 -9
- package/dist/i18n/en/Employee.HomeAddress.json.js +3 -3
- package/dist/i18n/en/Employee.OnboardingSummary.json.js +1 -1
- package/dist/i18n/en/Employee.PaymentMethod.json.js +11 -11
- package/dist/i18n/en/Employee.Taxes.json.js +27 -29
- package/dist/i18n/en/Employee.Taxes.json.js.map +1 -1
- package/dist/i18n/en/Payroll.ConfirmWireDetailsBanner.json.js +14 -0
- package/dist/i18n/en/Payroll.ConfirmWireDetailsBanner.json.js.map +1 -0
- package/dist/i18n/en/Payroll.ConfirmWireDetailsForm.json.js +10 -0
- package/dist/i18n/en/Payroll.ConfirmWireDetailsForm.json.js.map +1 -0
- package/dist/i18n/en/Payroll.PayrollBlocker.json.js +3 -3
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +1 -1
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +4 -4
- package/dist/i18n/en/Payroll.PayrollList.json.js +7 -7
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +37 -35
- package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollReceipts.json.js +7 -7
- package/dist/i18n/en/Payroll.WireInstructions.json.js +10 -0
- package/dist/i18n/en/Payroll.WireInstructions.json.js.map +1 -0
- package/dist/i18n/en/common.json.d.ts +3 -2
- package/dist/i18n/en/common.json.js +4 -4
- package/dist/shared/constants.d.ts +13 -0
- package/dist/shared/constants.js +56 -47
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +129 -99
- package/package.json +14 -15
- package/dist/components/Common/hooks/useAsyncError.js.map +0 -1
- package/dist/components/Common/hooks/useMenu.js.map +0 -1
- package/dist/components/Common/hooks/useNumberFormatter.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +0 -221
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js +0 -8
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +0 -132
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js +0 -14
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.js +0 -98
- package/dist/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.js.map +0 -1
- package/dist/i18n/en/Company.AddBank.json.js +0 -28
- package/dist/i18n/en/Company.AddBank.json.js.map +0 -1
- package/dist/i18n/en/Payroll.PayrollSchedule.json.js +0 -27
- package/dist/i18n/en/Payroll.PayrollSchedule.json.js.map +0 -1
- /package/dist/{components/Common/hooks → hooks}/useAsyncError.d.ts +0 -0
- /package/dist/{components/Common/hooks → hooks}/useAsyncError.js +0 -0
- /package/dist/{components/Common/hooks → hooks}/useMenu.d.ts +0 -0
- /package/dist/{components/Common/hooks → hooks}/useMenu.js +0 -0
- /package/dist/{components/Common/hooks → hooks}/useNumberFormatter.d.ts +0 -0
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { zodResolver as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useForm as
|
|
5
|
-
import { useLocationsGetSuspense as
|
|
6
|
-
import { useEmployeesCreateMutation as
|
|
7
|
-
import { useEmployeesGetSuspense as
|
|
8
|
-
import { useEmployeeAddressesGetSuspense as
|
|
9
|
-
import { useEmployeeAddressesCreateMutation as
|
|
10
|
-
import { useEmployeeAddressesUpdateMutation as
|
|
11
|
-
import { useEmployeeAddressesUpdateWorkAddressMutation as
|
|
12
|
-
import { useEmployeesUpdateMutation as
|
|
13
|
-
import { useEmployeeAddressesGetWorkAddressesSuspense as
|
|
14
|
-
import { useEmployeeAddressesCreateWorkAddressMutation as
|
|
15
|
-
import { RFCDate as
|
|
16
|
-
import { useEmployeesUpdateOnboardingStatusMutation as
|
|
17
|
-
import { AdminPersonalDetailsSchema as
|
|
18
|
-
import { SelfPersonalDetailsSchema as
|
|
19
|
-
import { Head as
|
|
20
|
-
import { Actions as
|
|
21
|
-
import { HomeAddressSchema as
|
|
22
|
-
import { WorkAddress as
|
|
23
|
-
import { ProfileProvider as
|
|
24
|
-
import { getEmployeeAddressForProfile as
|
|
25
|
-
import { Grid as
|
|
26
|
-
import { Form as
|
|
27
|
-
import { BaseComponent as
|
|
28
|
-
import { useBase as
|
|
29
|
-
import { useI18n as
|
|
30
|
-
import { EmployeeOnboardingStatus as
|
|
31
|
-
import { useFlow as
|
|
32
|
-
import { ensureRequired as
|
|
33
|
-
function
|
|
34
|
-
return /* @__PURE__ */ t(
|
|
1
|
+
import { jsx as t, jsxs as k, Fragment as Ee } from "react/jsx-runtime";
|
|
2
|
+
import { zodResolver as fe } from "@hookform/resolvers/zod";
|
|
3
|
+
import { useState as W, useRef as he, useEffect as Oe } from "react";
|
|
4
|
+
import { useForm as Se, useWatch as De, FormProvider as ge } from "react-hook-form";
|
|
5
|
+
import { useLocationsGetSuspense as Pe } from "@gusto/embedded-api/react-query/locationsGet";
|
|
6
|
+
import { useEmployeesCreateMutation as be } from "@gusto/embedded-api/react-query/employeesCreate";
|
|
7
|
+
import { useEmployeesGetSuspense as Ne } from "@gusto/embedded-api/react-query/employeesGet";
|
|
8
|
+
import { useEmployeeAddressesGetSuspense as _e } from "@gusto/embedded-api/react-query/employeeAddressesGet";
|
|
9
|
+
import { useEmployeeAddressesCreateMutation as Ie } from "@gusto/embedded-api/react-query/employeeAddressesCreate";
|
|
10
|
+
import { useEmployeeAddressesUpdateMutation as we } from "@gusto/embedded-api/react-query/employeeAddressesUpdate";
|
|
11
|
+
import { useEmployeeAddressesUpdateWorkAddressMutation as Me } from "@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress";
|
|
12
|
+
import { useEmployeesUpdateMutation as Be } from "@gusto/embedded-api/react-query/employeesUpdate";
|
|
13
|
+
import { useEmployeeAddressesGetWorkAddressesSuspense as Ce } from "@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses";
|
|
14
|
+
import { useEmployeeAddressesCreateWorkAddressMutation as Re } from "@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress";
|
|
15
|
+
import { RFCDate as v } from "@gusto/embedded-api/types/rfcdate";
|
|
16
|
+
import { useEmployeesUpdateOnboardingStatusMutation as Le } from "@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus";
|
|
17
|
+
import { AdminPersonalDetailsSchema as T, AdminSelfOnboardingPersonalDetailsSchema as ke, AdminPersonalDetails as We } from "./AdminPersonalDetails.js";
|
|
18
|
+
import { SelfPersonalDetailsSchema as ve, SelfPersonalDetails as Te } from "./SelfPersonalDetails.js";
|
|
19
|
+
import { Head as Ge } from "./Head.js";
|
|
20
|
+
import { Actions as Ue } from "./Actions.js";
|
|
21
|
+
import { HomeAddressSchema as G, HomeAddressSchemaWithCompletedOnboarding as qe, HomeAddress as He } from "./HomeAddress.js";
|
|
22
|
+
import { WorkAddress as Fe } from "./WorkAddress.js";
|
|
23
|
+
import { ProfileProvider as Ve } from "./useProfile.js";
|
|
24
|
+
import { getEmployeeAddressForProfile as Ye } from "./getEmployeeAddressForProfile.js";
|
|
25
|
+
import { Grid as ze } from "../../Common/Grid/Grid.js";
|
|
26
|
+
import { Form as xe } from "../../Common/Form/Form.js";
|
|
27
|
+
import { BaseComponent as je } from "../../Base/Base.js";
|
|
28
|
+
import { useBase as Ke } from "../../Base/useBase.js";
|
|
29
|
+
import { useI18n as U, useComponentDictionary as Je } from "../../../i18n/I18n.js";
|
|
30
|
+
import { EmployeeOnboardingStatus as i, EmployeeSelfOnboardingStatuses as Qe, componentEvents as d } from "../../../shared/constants.js";
|
|
31
|
+
import { useFlow as Xe } from "../../Flow/useFlow.js";
|
|
32
|
+
import { ensureRequired as Ze } from "../../../helpers/ensureRequired.js";
|
|
33
|
+
function $e(r) {
|
|
34
|
+
return /* @__PURE__ */ t(je, { ...r, children: r.employeeId ? /* @__PURE__ */ t(er, { ...r, employeeId: r.employeeId, children: r.children }) : /* @__PURE__ */ t(q, { ...r, children: r.children }) });
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function er({ employeeId: r, ...m }) {
|
|
37
37
|
const {
|
|
38
|
-
data: { employee:
|
|
39
|
-
} =
|
|
40
|
-
data: { employeeAddressList:
|
|
41
|
-
} =
|
|
42
|
-
data: { employeeWorkAddressesList:
|
|
43
|
-
} =
|
|
38
|
+
data: { employee: p }
|
|
39
|
+
} = Ne({ employeeId: r }), {
|
|
40
|
+
data: { employeeAddressList: y }
|
|
41
|
+
} = _e({ employeeId: r }), {
|
|
42
|
+
data: { employeeWorkAddressesList: l }
|
|
43
|
+
} = Ce({ employeeId: r });
|
|
44
44
|
return /* @__PURE__ */ t(
|
|
45
|
-
|
|
45
|
+
q,
|
|
46
46
|
{
|
|
47
|
-
...
|
|
48
|
-
employee:
|
|
49
|
-
homeAddresses:
|
|
50
|
-
workAddresses:
|
|
47
|
+
...m,
|
|
48
|
+
employee: p,
|
|
49
|
+
homeAddresses: y,
|
|
50
|
+
workAddresses: l
|
|
51
51
|
}
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
|
-
const
|
|
54
|
+
const g = (r) => r?.onboarded || r?.onboardingStatus === i.ONBOARDING_COMPLETED || r?.onboardingStatus === i.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW || r?.onboardingStatus === i.SELF_ONBOARDING_COMPLETED_BY_EMPLOYEE, q = ({
|
|
55
55
|
isAdmin: r = !1,
|
|
56
|
-
isSelfOnboardingEnabled:
|
|
57
|
-
dictionary:
|
|
58
|
-
...
|
|
56
|
+
isSelfOnboardingEnabled: m = !0,
|
|
57
|
+
dictionary: p,
|
|
58
|
+
...y
|
|
59
59
|
}) => {
|
|
60
|
-
|
|
60
|
+
U("Employee.Profile"), U("Employee.HomeAddress"), Je("Employee.Profile", p);
|
|
61
61
|
const {
|
|
62
|
-
companyId:
|
|
63
|
-
employee:
|
|
64
|
-
homeAddresses:
|
|
65
|
-
workAddresses:
|
|
66
|
-
children:
|
|
67
|
-
className:
|
|
62
|
+
companyId: l,
|
|
63
|
+
employee: u,
|
|
64
|
+
homeAddresses: H,
|
|
65
|
+
workAddresses: P,
|
|
66
|
+
children: b,
|
|
67
|
+
className: F = "",
|
|
68
68
|
defaultValues: s
|
|
69
|
-
} =
|
|
70
|
-
mutateAsync:
|
|
71
|
-
isPending:
|
|
72
|
-
} =
|
|
73
|
-
employee:
|
|
74
|
-
homeAddress:
|
|
75
|
-
workAddress:
|
|
76
|
-
}),
|
|
69
|
+
} = y, { onEvent: n, baseSubmitHandler: V } = Ke(), [Y, N] = W(T), [z, _] = W(G), { data: x } = Pe({ companyId: l }), j = x.locationList, { mutateAsync: K, isPending: J } = be(), { mutateAsync: Q, isPending: X } = Be(), { mutateAsync: Z, isPending: $ } = Re(), { mutateAsync: ee, isPending: re } = Me(), { mutateAsync: te, isPending: oe } = Ie(), { mutateAsync: se, isPending: ne } = we(), {
|
|
70
|
+
mutateAsync: de,
|
|
71
|
+
isPending: ie
|
|
72
|
+
} = Le(), I = { employee: u, workAddresses: P }, ae = Ye(H), me = I.workAddresses?.find((c) => c.active), e = he({
|
|
73
|
+
employee: I.employee,
|
|
74
|
+
homeAddress: ae,
|
|
75
|
+
workAddress: me
|
|
76
|
+
}), S = {
|
|
77
77
|
firstName: e.current.employee?.firstName ?? s?.employee?.firstName ?? "",
|
|
78
78
|
middleInitial: e.current.employee?.middleInitial ?? s?.employee?.middleInitial ?? "",
|
|
79
79
|
lastName: e.current.employee?.lastName ?? s?.employee?.lastName ?? "",
|
|
@@ -88,62 +88,65 @@ const C = ({
|
|
|
88
88
|
zip: e.current.homeAddress?.zip ?? s?.homeAddress?.zip ?? "",
|
|
89
89
|
state: e.current.homeAddress?.state ?? s?.homeAddress?.state ?? "",
|
|
90
90
|
courtesyWithholding: e.current.homeAddress?.courtesyWithholding ?? !1
|
|
91
|
-
},
|
|
92
|
-
...
|
|
93
|
-
selfOnboarding:
|
|
91
|
+
}, le = e.current.employee?.onboarded || e.current.employee?.onboardingStatus === i.ONBOARDING_COMPLETED || e.current.employee?.onboardingStatus !== void 0 && e.current.employee.onboardingStatus !== i.ADMIN_ONBOARDING_INCOMPLETE ? { ...S, enableSsn: !1, selfOnboarding: !0 } : {
|
|
92
|
+
...S,
|
|
93
|
+
selfOnboarding: m ? e.current.employee?.onboardingStatus ? (
|
|
94
94
|
// @ts-expect-error: onboarding_status during runtime can be one of self onboarding statuses
|
|
95
|
-
|
|
95
|
+
Qe.has(e.current.employee.onboarding_status)
|
|
96
96
|
) : s?.inviteEmployeeDefault ?? !1 : !1,
|
|
97
97
|
enableSsn: !e.current.employee?.hasSsn,
|
|
98
98
|
ssn: ""
|
|
99
|
-
},
|
|
100
|
-
...
|
|
99
|
+
}, ue = {
|
|
100
|
+
...S,
|
|
101
101
|
enableSsn: !e.current.employee?.hasSsn,
|
|
102
102
|
ssn: ""
|
|
103
|
-
},
|
|
103
|
+
}, D = Se({
|
|
104
104
|
// @ts-expect-error: Complex discriminated union schema causes type inference issues with zodResolver v5.2.1
|
|
105
|
-
resolver:
|
|
105
|
+
resolver: fe(
|
|
106
106
|
// @ts-expect-error: Zod discriminated union intersection incompatible with zodResolver v5.2.1
|
|
107
|
-
(r ?
|
|
107
|
+
(r ? Y : ve).and(z)
|
|
108
108
|
),
|
|
109
|
-
defaultValues: r ?
|
|
110
|
-
}), { handleSubmit:
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
109
|
+
defaultValues: r ? le : ue
|
|
110
|
+
}), { handleSubmit: ce } = D, A = De({ control: D.control, name: "selfOnboarding" });
|
|
111
|
+
Oe(() => {
|
|
112
|
+
if (r) {
|
|
113
|
+
const c = g(u);
|
|
114
|
+
N(A && !c ? ke : T), _(A && c ? qe : G);
|
|
115
|
+
}
|
|
116
|
+
}, [A, r, u?.onboardingStatus, u?.onboarded]);
|
|
117
|
+
const pe = async (c) => {
|
|
118
|
+
await V(c, async (a) => {
|
|
119
|
+
const { workAddress: w, startDate: Ae, selfOnboarding: h, ...O } = a;
|
|
117
120
|
if (e.current.employee) {
|
|
118
|
-
if (r && (
|
|
119
|
-
const { employeeOnboardingStatus:
|
|
121
|
+
if (r && (h && e.current.employee.onboardingStatus === i.ADMIN_ONBOARDING_INCOMPLETE || !h && e.current.employee.onboardingStatus === i.SELF_ONBOARDING_PENDING_INVITE)) {
|
|
122
|
+
const { employeeOnboardingStatus: E } = await de({
|
|
120
123
|
request: {
|
|
121
124
|
employeeId: e.current.employee.uuid,
|
|
122
125
|
requestBody: {
|
|
123
|
-
onboardingStatus:
|
|
126
|
+
onboardingStatus: h ? i.SELF_ONBOARDING_PENDING_INVITE : i.ADMIN_ONBOARDING_INCOMPLETE
|
|
124
127
|
}
|
|
125
128
|
}
|
|
126
129
|
});
|
|
127
130
|
e.current.employee = {
|
|
128
131
|
...e.current.employee,
|
|
129
|
-
onboardingStatus:
|
|
130
|
-
}, n(d.EMPLOYEE_ONBOARDING_STATUS_UPDATED,
|
|
132
|
+
onboardingStatus: E.onboardingStatus
|
|
133
|
+
}, n(d.EMPLOYEE_ONBOARDING_STATUS_UPDATED, E);
|
|
131
134
|
}
|
|
132
|
-
const { employee: o } = await
|
|
135
|
+
const { employee: o } = await Q({
|
|
133
136
|
request: {
|
|
134
137
|
employeeId: e.current.employee.uuid,
|
|
135
|
-
requestBody: { ...
|
|
138
|
+
requestBody: { ...O, version: e.current.employee.version }
|
|
136
139
|
}
|
|
137
140
|
});
|
|
138
141
|
e.current = { ...e.current, employee: o }, n(d.EMPLOYEE_UPDATED, o);
|
|
139
142
|
} else {
|
|
140
|
-
const { employee: o } = await
|
|
143
|
+
const { employee: o } = await K({
|
|
141
144
|
request: {
|
|
142
|
-
companyId:
|
|
145
|
+
companyId: l,
|
|
143
146
|
requestBody: {
|
|
144
|
-
...
|
|
145
|
-
selfOnboarding:
|
|
146
|
-
dateOfBirth:
|
|
147
|
+
...O,
|
|
148
|
+
selfOnboarding: h,
|
|
149
|
+
dateOfBirth: O.dateOfBirth ? new v(O.dateOfBirth) : void 0
|
|
147
150
|
}
|
|
148
151
|
}
|
|
149
152
|
});
|
|
@@ -151,60 +154,63 @@ const C = ({
|
|
|
151
154
|
}
|
|
152
155
|
if (typeof e.current.employee?.uuid != "string")
|
|
153
156
|
throw new Error("Employee id is not available");
|
|
154
|
-
|
|
155
|
-
|
|
157
|
+
const M = g(
|
|
158
|
+
e.current.employee
|
|
159
|
+
);
|
|
160
|
+
if ((!r || !A || M) && (!a.selfOnboarding || M) && "street1" in a && "city" in a && "state" in a && "zip" in a) {
|
|
161
|
+
const { street1: o, street2: E, city: B, state: C, zip: R, courtesyWithholding: L } = a;
|
|
156
162
|
if (e.current.homeAddress) {
|
|
157
|
-
const { employeeAddress:
|
|
163
|
+
const { employeeAddress: f } = await se({
|
|
158
164
|
request: {
|
|
159
165
|
homeAddressUuid: e.current.homeAddress.uuid,
|
|
160
166
|
requestBody: {
|
|
161
167
|
version: e.current.homeAddress.version,
|
|
162
168
|
street1: o,
|
|
163
|
-
street2:
|
|
164
|
-
city:
|
|
165
|
-
state:
|
|
166
|
-
zip:
|
|
167
|
-
courtesyWithholding:
|
|
169
|
+
street2: E,
|
|
170
|
+
city: B,
|
|
171
|
+
state: C,
|
|
172
|
+
zip: R,
|
|
173
|
+
courtesyWithholding: L
|
|
168
174
|
}
|
|
169
175
|
}
|
|
170
176
|
});
|
|
171
|
-
e.current = { ...e.current, homeAddress:
|
|
177
|
+
e.current = { ...e.current, homeAddress: f }, n(d.EMPLOYEE_HOME_ADDRESS_UPDATED, f);
|
|
172
178
|
} else {
|
|
173
|
-
const { employeeAddress:
|
|
179
|
+
const { employeeAddress: f } = await te({
|
|
174
180
|
request: {
|
|
175
181
|
employeeId: e.current.employee.uuid,
|
|
176
182
|
requestBody: {
|
|
177
183
|
street1: o,
|
|
178
|
-
street2:
|
|
179
|
-
city:
|
|
180
|
-
state:
|
|
181
|
-
zip:
|
|
182
|
-
courtesyWithholding:
|
|
184
|
+
street2: E,
|
|
185
|
+
city: B,
|
|
186
|
+
state: C,
|
|
187
|
+
zip: R,
|
|
188
|
+
courtesyWithholding: L
|
|
183
189
|
}
|
|
184
190
|
}
|
|
185
191
|
});
|
|
186
|
-
e.current = { ...e.current, homeAddress:
|
|
192
|
+
e.current = { ...e.current, homeAddress: f }, n(d.EMPLOYEE_HOME_ADDRESS_CREATED, f);
|
|
187
193
|
}
|
|
188
194
|
}
|
|
189
195
|
if (r)
|
|
190
196
|
if (e.current.workAddress) {
|
|
191
|
-
const { employeeWorkAddress: o } = await
|
|
197
|
+
const { employeeWorkAddress: o } = await ee({
|
|
192
198
|
request: {
|
|
193
199
|
workAddressUuid: e.current.workAddress.uuid,
|
|
194
200
|
requestBody: {
|
|
195
201
|
version: e.current.workAddress.version,
|
|
196
|
-
locationUuid:
|
|
202
|
+
locationUuid: w
|
|
197
203
|
}
|
|
198
204
|
}
|
|
199
205
|
});
|
|
200
206
|
e.current = { ...e.current, workAddress: o }, n(d.EMPLOYEE_WORK_ADDRESS_UPDATED, o);
|
|
201
207
|
} else {
|
|
202
|
-
const { employeeWorkAddress: o } = await
|
|
208
|
+
const { employeeWorkAddress: o } = await Z({
|
|
203
209
|
request: {
|
|
204
210
|
employeeId: e.current.employee?.uuid,
|
|
205
211
|
requestBody: {
|
|
206
|
-
locationUuid:
|
|
207
|
-
effectiveDate: new
|
|
212
|
+
locationUuid: w,
|
|
213
|
+
effectiveDate: new v(a.startDate || /* @__PURE__ */ new Date())
|
|
208
214
|
}
|
|
209
215
|
}
|
|
210
216
|
});
|
|
@@ -212,53 +218,54 @@ const C = ({
|
|
|
212
218
|
}
|
|
213
219
|
n(d.EMPLOYEE_PROFILE_DONE, {
|
|
214
220
|
...e.current.employee,
|
|
215
|
-
startDate:
|
|
221
|
+
startDate: Ae
|
|
216
222
|
});
|
|
217
223
|
});
|
|
218
|
-
},
|
|
224
|
+
}, ye = () => {
|
|
219
225
|
n(d.CANCEL);
|
|
220
226
|
};
|
|
221
|
-
return /* @__PURE__ */ t("section", { className:
|
|
222
|
-
|
|
227
|
+
return /* @__PURE__ */ t("section", { className: F, children: /* @__PURE__ */ t(
|
|
228
|
+
Ve,
|
|
223
229
|
{
|
|
224
230
|
value: {
|
|
225
|
-
companyLocations:
|
|
226
|
-
workAddresses:
|
|
231
|
+
companyLocations: j,
|
|
232
|
+
workAddresses: P,
|
|
227
233
|
employee: e.current.employee ?? void 0,
|
|
228
|
-
isSelfOnboardingIntended:
|
|
229
|
-
handleCancel:
|
|
234
|
+
isSelfOnboardingIntended: A,
|
|
235
|
+
handleCancel: ye,
|
|
230
236
|
isAdmin: r,
|
|
231
|
-
isSelfOnboardingEnabled:
|
|
232
|
-
|
|
237
|
+
isSelfOnboardingEnabled: m,
|
|
238
|
+
hasCompletedSelfOnboarding: g(e.current.employee),
|
|
239
|
+
isPending: X || re || oe || ne || J || $ || ie
|
|
233
240
|
},
|
|
234
|
-
children: /* @__PURE__ */ t(
|
|
235
|
-
/* @__PURE__ */
|
|
236
|
-
/* @__PURE__ */ t(
|
|
237
|
-
/* @__PURE__ */ t(ke, {}),
|
|
238
|
-
/* @__PURE__ */ t(Re, {}),
|
|
241
|
+
children: /* @__PURE__ */ t(ge, { ...D, children: /* @__PURE__ */ t(xe, { onSubmit: ce(pe), children: b || /* @__PURE__ */ k(Ee, { children: [
|
|
242
|
+
/* @__PURE__ */ k(ze, { gridTemplateColumns: "1fr", gap: 24, children: [
|
|
243
|
+
/* @__PURE__ */ t(Ge, {}),
|
|
239
244
|
/* @__PURE__ */ t(We, {}),
|
|
240
|
-
/* @__PURE__ */ t(
|
|
245
|
+
/* @__PURE__ */ t(Te, {}),
|
|
246
|
+
/* @__PURE__ */ t(He, {}),
|
|
247
|
+
/* @__PURE__ */ t(Fe, {})
|
|
241
248
|
] }),
|
|
242
|
-
/* @__PURE__ */ t(
|
|
249
|
+
/* @__PURE__ */ t(Ue, {})
|
|
243
250
|
] }) }) })
|
|
244
251
|
}
|
|
245
252
|
) });
|
|
246
|
-
},
|
|
247
|
-
const { companyId: r, employeeId:
|
|
253
|
+
}, Lr = () => {
|
|
254
|
+
const { companyId: r, employeeId: m, onEvent: p, isAdmin: y, defaultValues: l, isSelfOnboardingEnabled: u } = Xe();
|
|
248
255
|
return /* @__PURE__ */ t(
|
|
249
|
-
|
|
256
|
+
$e,
|
|
250
257
|
{
|
|
251
|
-
companyId:
|
|
252
|
-
employeeId:
|
|
253
|
-
onEvent:
|
|
254
|
-
isAdmin:
|
|
255
|
-
defaultValues:
|
|
256
|
-
isSelfOnboardingEnabled:
|
|
258
|
+
companyId: Ze(r),
|
|
259
|
+
employeeId: m,
|
|
260
|
+
onEvent: p,
|
|
261
|
+
isAdmin: y,
|
|
262
|
+
defaultValues: l?.profile,
|
|
263
|
+
isSelfOnboardingEnabled: u
|
|
257
264
|
}
|
|
258
265
|
);
|
|
259
266
|
};
|
|
260
267
|
export {
|
|
261
|
-
|
|
262
|
-
|
|
268
|
+
$e as Profile,
|
|
269
|
+
Lr as ProfileContextual
|
|
263
270
|
};
|
|
264
271
|
//# sourceMappingURL=Profile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Profile.js","sources":["../../../../src/components/Employee/Profile/Profile.tsx"],"sourcesContent":["import { zodResolver } from '@hookform/resolvers/zod'\nimport { useRef, useState, useEffect } from 'react'\nimport type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useLocationsGetSuspense } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useEmployeesCreateMutation } from '@gusto/embedded-api/react-query/employeesCreate'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { type Employee } from '@gusto/embedded-api/models/components/employee'\nimport { useEmployeeAddressesGetSuspense } from '@gusto/embedded-api/react-query/employeeAddressesGet'\nimport { type EmployeeAddress } from '@gusto/embedded-api/models/components/employeeaddress'\nimport { useEmployeeAddressesCreateMutation } from '@gusto/embedded-api/react-query/employeeAddressesCreate'\nimport { useEmployeeAddressesUpdateMutation } from '@gusto/embedded-api/react-query/employeeAddressesUpdate'\nimport { useEmployeeAddressesUpdateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress'\nimport { useEmployeesUpdateMutation } from '@gusto/embedded-api/react-query/employeesUpdate'\nimport { useEmployeeAddressesGetWorkAddressesSuspense } from '@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { useEmployeeAddressesCreateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport { useEmployeesUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlowComponents'\nimport {\n AdminPersonalDetails,\n AdminPersonalDetailsSchema,\n AdminSelfOnboardingPersonalDetailsSchema,\n} from './AdminPersonalDetails'\nimport { SelfPersonalDetails, SelfPersonalDetailsSchema } from './SelfPersonalDetails'\nimport { type PersonalDetailsPayload, type PersonalDetailsInputs } from './PersonalDetailsInputs'\nimport { Head } from './Head'\nimport { Actions } from './Actions'\nimport { HomeAddress, HomeAddressSchema, type HomeAddressInputs } from './HomeAddress'\nimport { WorkAddress } from './WorkAddress'\nimport { ProfileProvider } from './useProfile'\nimport { getEmployeeAddressForProfile } from './getEmployeeAddressForProfile'\nimport { Grid } from '@/components/Common/Grid/Grid'\nimport { Form } from '@/components/Common/Form'\nimport {\n useBase,\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport {\n componentEvents,\n EmployeeOnboardingStatus,\n EmployeeSelfOnboardingStatuses,\n} from '@/shared/constants'\nimport type { RequireAtLeastOne, WithRequired } from '@/types/Helpers'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport type ProfileDefaultValues = RequireAtLeastOne<{\n employee?: RequireAtLeastOne<{\n firstName?: string\n middleInitial?: string\n lastName?: string\n email?: string\n dateOfBirth?: string\n }>\n homeAddress?: RequireAtLeastOne<{\n street1?: string\n street2?: string\n city?: string\n state?: string\n zip?: string\n }>\n inviteEmployeeDefault?: boolean\n}>\ninterface ProfileProps extends CommonComponentInterface<'Employee.Profile'> {\n employeeId?: string\n companyId: string\n defaultValues?: ProfileDefaultValues\n isAdmin?: boolean\n isSelfOnboardingEnabled?: boolean\n}\n\ninterface ProfileConditionalProps {\n employee?: Employee\n homeAddresses?: EmployeeAddress[]\n workAddresses?: EmployeeWorkAddress[]\n}\n\nexport function Profile(props: ProfileProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n {props.employeeId ? (\n <RootWithEmployee {...props} employeeId={props.employeeId}>\n {props.children}\n </RootWithEmployee>\n ) : (\n <Root {...props}>{props.children}</Root>\n )}\n </BaseComponent>\n )\n}\n\n/**Accounting for conditional logic where employee data needs to be fetched only if employeeId is present */\nfunction RootWithEmployee({ employeeId, ...props }: WithRequired<ProfileProps, 'employeeId'>) {\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n const {\n data: { employeeAddressList },\n } = useEmployeeAddressesGetSuspense({ employeeId })\n const {\n data: { employeeWorkAddressesList },\n } = useEmployeeAddressesGetWorkAddressesSuspense({ employeeId })\n return (\n <Root\n {...props}\n employee={employee}\n homeAddresses={employeeAddressList}\n workAddresses={employeeWorkAddressesList}\n />\n )\n}\n\nconst Root = ({\n isAdmin = false,\n isSelfOnboardingEnabled = true,\n dictionary,\n ...props\n}: ProfileProps & ProfileConditionalProps) => {\n useI18n('Employee.Profile')\n useI18n('Employee.HomeAddress')\n useComponentDictionary('Employee.Profile', dictionary)\n const {\n companyId,\n employee,\n homeAddresses,\n workAddresses,\n children,\n className = '',\n defaultValues,\n } = props\n const { onEvent, baseSubmitHandler } = useBase()\n\n const [AdminSchema, setAdminSchema] = useState<\n typeof AdminPersonalDetailsSchema | typeof AdminSelfOnboardingPersonalDetailsSchema\n >(AdminPersonalDetailsSchema)\n\n const { data } = useLocationsGetSuspense({ companyId })\n const companyLocations = data.locationList!\n\n const { mutateAsync: createEmployee, isPending: isPendingCreateEmployee } =\n useEmployeesCreateMutation()\n const { mutateAsync: mutateEmployee, isPending: isPendingEmployeeUpdate } =\n useEmployeesUpdateMutation()\n\n const { mutateAsync: createEmployeeWorkAddress, isPending: isPendingCreateWA } =\n useEmployeeAddressesCreateWorkAddressMutation()\n const { mutateAsync: mutateEmployeeWorkAddress, isPending: isPendingWorkAddressUpdate } =\n useEmployeeAddressesUpdateWorkAddressMutation()\n\n const { mutateAsync: createEmployeeHomeAddress, isPending: isPendingAddHA } =\n useEmployeeAddressesCreateMutation()\n const { mutateAsync: mutateEmployeeHomeAddress, isPending: isPendingUpdateHA } =\n useEmployeeAddressesUpdateMutation()\n\n const {\n mutateAsync: updateEmployeeOnboardingStatus,\n isPending: isPendingUpdateOnboardingStatus,\n } = useEmployeesUpdateOnboardingStatusMutation()\n\n const existingData = { employee, workAddresses, homeAddresses }\n\n const currentHomeAddress = getEmployeeAddressForProfile(homeAddresses)\n\n const currentWorkAddress = existingData.workAddresses?.find(address => address.active)\n const mergedData = useRef({\n employee: existingData.employee,\n homeAddress: currentHomeAddress,\n workAddress: currentWorkAddress,\n })\n const initialValues = {\n firstName: mergedData.current.employee?.firstName ?? defaultValues?.employee?.firstName ?? '',\n middleInitial:\n mergedData.current.employee?.middleInitial ?? defaultValues?.employee?.middleInitial ?? '',\n lastName: mergedData.current.employee?.lastName ?? defaultValues?.employee?.lastName ?? '',\n workAddress: mergedData.current.workAddress?.locationUuid,\n startDate: mergedData.current.employee?.jobs?.[0]?.hireDate\n ? new Date(mergedData.current.employee.jobs[0].hireDate)\n : null, // By default employee response contains only current job - therefore jobs[0]\n email: mergedData.current.employee?.email ?? defaultValues?.employee?.email ?? '',\n dateOfBirth: mergedData.current.employee?.dateOfBirth\n ? new Date(mergedData.current.employee.dateOfBirth)\n : defaultValues?.employee?.dateOfBirth\n ? new Date(defaultValues.employee.dateOfBirth)\n : null,\n\n street1: mergedData.current.homeAddress?.street1 ?? defaultValues?.homeAddress?.street1 ?? '',\n street2: mergedData.current.homeAddress?.street2 ?? defaultValues?.homeAddress?.street2 ?? '',\n city: mergedData.current.homeAddress?.city ?? defaultValues?.homeAddress?.city ?? '',\n zip: mergedData.current.homeAddress?.zip ?? defaultValues?.homeAddress?.zip ?? '',\n state: mergedData.current.homeAddress?.state ?? defaultValues?.homeAddress?.state ?? '',\n courtesyWithholding: mergedData.current.homeAddress?.courtesyWithholding ?? false,\n }\n\n const adminDefaultValues =\n mergedData.current.employee?.onboarded ||\n mergedData.current.employee?.onboardingStatus ===\n EmployeeOnboardingStatus.ONBOARDING_COMPLETED ||\n (mergedData.current.employee?.onboardingStatus !== undefined &&\n mergedData.current.employee.onboardingStatus !==\n EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE)\n ? { ...initialValues, enableSsn: false, selfOnboarding: true }\n : {\n ...initialValues,\n selfOnboarding: isSelfOnboardingEnabled\n ? mergedData.current.employee?.onboardingStatus\n ? // @ts-expect-error: onboarding_status during runtime can be one of self onboarding statuses\n EmployeeSelfOnboardingStatuses.has(mergedData.current.employee.onboarding_status)\n : (defaultValues?.inviteEmployeeDefault ?? false)\n : false,\n enableSsn: !mergedData.current.employee?.hasSsn,\n ssn: '',\n } // In edit mode ssn is submitted only if it has been modified\n\n const selfDetaultValues = {\n ...initialValues,\n enableSsn: !mergedData.current.employee?.hasSsn,\n ssn: '',\n }\n\n const formMethods = useForm<\n PersonalDetailsInputs & HomeAddressInputs,\n unknown,\n PersonalDetailsPayload & HomeAddressInputs\n >({\n // @ts-expect-error: Complex discriminated union schema causes type inference issues with zodResolver v5.2.1\n resolver: zodResolver(\n // @ts-expect-error: Zod discriminated union intersection incompatible with zodResolver v5.2.1\n (isAdmin ? AdminSchema : SelfPersonalDetailsSchema).and(HomeAddressSchema),\n ),\n defaultValues: isAdmin ? adminDefaultValues : selfDetaultValues,\n })\n\n const { handleSubmit } = formMethods\n const watchedSelfOnboarding = useWatch({ control: formMethods.control, name: 'selfOnboarding' })\n\n useEffect(() => {\n if (isAdmin) {\n if (watchedSelfOnboarding) {\n setAdminSchema(AdminSelfOnboardingPersonalDetailsSchema)\n } else {\n setAdminSchema(AdminPersonalDetailsSchema)\n }\n }\n }, [watchedSelfOnboarding, isAdmin])\n\n const onSubmit: SubmitHandler<PersonalDetailsPayload & HomeAddressInputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n const { workAddress, startDate, selfOnboarding, ...body } = payload\n //create or update employee\n if (!mergedData.current.employee) {\n const { employee: employeeData } = await createEmployee({\n request: {\n companyId,\n requestBody: {\n ...body,\n selfOnboarding,\n dateOfBirth: body.dateOfBirth ? new RFCDate(body.dateOfBirth) : undefined,\n },\n },\n })\n mergedData.current = { ...mergedData.current, employee: employeeData }\n onEvent(componentEvents.EMPLOYEE_CREATED, employeeData)\n } else {\n // Updating self-onboarding status\n if (\n isAdmin &&\n ((selfOnboarding &&\n mergedData.current.employee.onboardingStatus ===\n EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE) ||\n (!selfOnboarding &&\n mergedData.current.employee.onboardingStatus ===\n EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE))\n ) {\n const { employeeOnboardingStatus } = await updateEmployeeOnboardingStatus({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: {\n onboardingStatus: selfOnboarding\n ? EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE\n : EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE,\n },\n },\n })\n mergedData.current.employee = {\n ...mergedData.current.employee,\n onboardingStatus: employeeOnboardingStatus!\n .onboardingStatus as (typeof EmployeeOnboardingStatus)[keyof typeof EmployeeOnboardingStatus],\n }\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_STATUS_UPDATED, employeeOnboardingStatus)\n }\n const { employee: employeeData } = await mutateEmployee({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: { ...body, version: mergedData.current.employee.version as string },\n },\n })\n mergedData.current = { ...mergedData.current, employee: employeeData }\n onEvent(componentEvents.EMPLOYEE_UPDATED, employeeData)\n }\n if (typeof mergedData.current.employee?.uuid !== 'string') {\n throw new Error('Employee id is not available')\n }\n //create or update home address - only if not intended for self onboarding\n if (!watchedSelfOnboarding || !isAdmin) {\n //typeguard: in this scenario payload will contain address information\n if (!payload.selfOnboarding) {\n const { street1, street2, city, state, zip, courtesyWithholding } = payload\n if (!mergedData.current.homeAddress) {\n // Creating home address - for new employee effective_date is the same as work start date\n const { employeeAddress } = await createEmployeeHomeAddress({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: {\n street1,\n street2,\n city,\n state,\n zip,\n courtesyWithholding,\n },\n },\n })\n mergedData.current = { ...mergedData.current, homeAddress: employeeAddress }\n onEvent(componentEvents.EMPLOYEE_HOME_ADDRESS_CREATED, employeeAddress)\n } else {\n const { employeeAddress } = await mutateEmployeeHomeAddress({\n request: {\n homeAddressUuid: mergedData.current.homeAddress.uuid,\n requestBody: {\n version: mergedData.current.homeAddress.version,\n street1,\n street2,\n city,\n state,\n zip,\n courtesyWithholding,\n },\n },\n })\n mergedData.current = { ...mergedData.current, homeAddress: employeeAddress }\n onEvent(componentEvents.EMPLOYEE_HOME_ADDRESS_UPDATED, employeeAddress)\n }\n }\n }\n\n if (isAdmin) {\n //create or update workaddress\n if (!mergedData.current.workAddress) {\n const { employeeWorkAddress } = await createEmployeeWorkAddress({\n request: {\n employeeId: mergedData.current.employee?.uuid as string,\n requestBody: {\n locationUuid: workAddress,\n effectiveDate: new RFCDate(payload.startDate || new Date()),\n },\n },\n })\n\n mergedData.current = { ...mergedData.current, workAddress: employeeWorkAddress }\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_CREATED, employeeWorkAddress)\n } else {\n //effective_date is excluded from update operation since it cannot be changed on initial work address\n const { employeeWorkAddress } = await mutateEmployeeWorkAddress({\n request: {\n workAddressUuid: mergedData.current.workAddress.uuid,\n requestBody: {\n version: mergedData.current.workAddress.version,\n locationUuid: workAddress,\n },\n },\n })\n mergedData.current = { ...mergedData.current, workAddress: employeeWorkAddress }\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_UPDATED, employeeWorkAddress)\n }\n }\n\n onEvent(componentEvents.EMPLOYEE_PROFILE_DONE, {\n ...mergedData.current.employee,\n startDate,\n })\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n return (\n <section className={className}>\n <ProfileProvider\n value={{\n companyLocations,\n workAddresses,\n employee: mergedData.current.employee ?? undefined,\n isSelfOnboardingIntended: watchedSelfOnboarding,\n handleCancel,\n isAdmin,\n isSelfOnboardingEnabled,\n isPending:\n isPendingEmployeeUpdate ||\n isPendingWorkAddressUpdate ||\n isPendingAddHA ||\n isPendingUpdateHA ||\n isPendingCreateEmployee ||\n isPendingCreateWA ||\n isPendingUpdateOnboardingStatus,\n }}\n >\n <FormProvider {...formMethods}>\n <Form onSubmit={handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <>\n <Grid gridTemplateColumns=\"1fr\" gap={24}>\n <Head />\n <AdminPersonalDetails />\n <SelfPersonalDetails />\n <HomeAddress />\n <WorkAddress />\n </Grid>\n <Actions />\n </>\n )}\n </Form>\n </FormProvider>\n </ProfileProvider>\n </section>\n )\n}\n\nexport const ProfileContextual = () => {\n const { companyId, employeeId, onEvent, isAdmin, defaultValues, isSelfOnboardingEnabled } =\n useFlow<OnboardingContextInterface>()\n\n return (\n <Profile\n companyId={ensureRequired(companyId)}\n employeeId={employeeId}\n onEvent={onEvent}\n isAdmin={isAdmin}\n defaultValues={defaultValues?.profile}\n isSelfOnboardingEnabled={isSelfOnboardingEnabled}\n />\n )\n}\n"],"names":["Profile","props","jsx","BaseComponent","RootWithEmployee","Root","employeeId","employee","useEmployeesGetSuspense","employeeAddressList","useEmployeeAddressesGetSuspense","employeeWorkAddressesList","useEmployeeAddressesGetWorkAddressesSuspense","isAdmin","isSelfOnboardingEnabled","dictionary","useI18n","useComponentDictionary","companyId","homeAddresses","workAddresses","children","className","defaultValues","onEvent","baseSubmitHandler","useBase","AdminSchema","setAdminSchema","useState","AdminPersonalDetailsSchema","data","useLocationsGetSuspense","companyLocations","createEmployee","isPendingCreateEmployee","useEmployeesCreateMutation","mutateEmployee","isPendingEmployeeUpdate","useEmployeesUpdateMutation","createEmployeeWorkAddress","isPendingCreateWA","useEmployeeAddressesCreateWorkAddressMutation","mutateEmployeeWorkAddress","isPendingWorkAddressUpdate","useEmployeeAddressesUpdateWorkAddressMutation","createEmployeeHomeAddress","isPendingAddHA","useEmployeeAddressesCreateMutation","mutateEmployeeHomeAddress","isPendingUpdateHA","useEmployeeAddressesUpdateMutation","updateEmployeeOnboardingStatus","isPendingUpdateOnboardingStatus","useEmployeesUpdateOnboardingStatusMutation","existingData","currentHomeAddress","getEmployeeAddressForProfile","currentWorkAddress","address","mergedData","useRef","initialValues","adminDefaultValues","EmployeeOnboardingStatus","EmployeeSelfOnboardingStatuses","selfDetaultValues","formMethods","useForm","zodResolver","SelfPersonalDetailsSchema","HomeAddressSchema","handleSubmit","watchedSelfOnboarding","useWatch","useEffect","AdminSelfOnboardingPersonalDetailsSchema","onSubmit","payload","workAddress","startDate","selfOnboarding","body","employeeOnboardingStatus","componentEvents","employeeData","RFCDate","street1","street2","city","state","zip","courtesyWithholding","employeeAddress","employeeWorkAddress","handleCancel","ProfileProvider","FormProvider","Form","jsxs","Fragment","Grid","Head","AdminPersonalDetails","SelfPersonalDetails","HomeAddress","WorkAddress","Actions","ProfileContextual","useFlow","ensureRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFO,SAASA,GAAQC,GAA8C;AACpE,SACE,gBAAAC,EAACC,MAAe,GAAGF,GAChB,YAAM,aACL,gBAAAC,EAACE,IAAA,EAAkB,GAAGH,GAAO,YAAYA,E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AAA/D;AAAA,QACA,eAAAb;AAAA,QACA,UAAUwC,EAAW,QAAQ,YAAY;AAAA,QACzC,0BAA0Ba;AAAA,QAC1B,cAAAsB;AAAA,QACA,SAAAlF;AAAA,QACA,yBAAAC;AAAA,QACA,WACEwB,KACAM,KACAG,KACAG,KACAf,KACAM,KACAY;AAAA,MAAA;AAAA,MAGJ,UAAA,gBAAAnD,EAAC+F,IAAA,EAAc,GAAG9B,GAChB,UAAA,gBAAAjE,EAACgG,IAAA,EAAK,UAAU1B,GAAaK,EAAQ,GAClC,UAAAxD,KAGC,gBAAA8E,EAAAC,IAAA,EACE,UAAA;AAAA,QAAA,gBAAAD,EAACE,IAAA,EAAK,qBAAoB,OAAM,KAAK,IACnC,UAAA;AAAA,UAAA,gBAAAnG,EAACoG,IAAA,EAAK;AAAA,4BACLC,IAAA,EAAqB;AAAA,4BACrBC,IAAA,EAAoB;AAAA,4BACpBC,IAAA,EAAY;AAAA,4BACZC,IAAA,CAAA,CAAY;AAAA,QAAA,GACf;AAAA,0BACCC,IAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,GAEJ,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ,GAEaC,KAAoB,MAAM;AACrC,QAAM,EAAE,WAAA1F,GAAW,YAAAZ,GAAY,SAAAkB,GAAS,SAAAX,GAAS,eAAAU,GAAe,yBAAAT,EAAA,IAC9D+F,GAAA;AAEF,SACE,gBAAA3G;AAAA,IAACF;AAAA,IAAA;AAAA,MACC,WAAW8G,GAAe5F,CAAS;AAAA,MACnC,YAAAZ;AAAA,MACA,SAAAkB;AAAA,MACA,SAAAX;AAAA,MACA,eAAeU,GAAe;AAAA,MAC9B,yBAAAT;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
1
|
+
{"version":3,"file":"Profile.js","sources":["../../../../src/components/Employee/Profile/Profile.tsx"],"sourcesContent":["import { zodResolver } from '@hookform/resolvers/zod'\nimport { useRef, useState, useEffect } from 'react'\nimport type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useLocationsGetSuspense } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useEmployeesCreateMutation } from '@gusto/embedded-api/react-query/employeesCreate'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { type Employee } from '@gusto/embedded-api/models/components/employee'\nimport { useEmployeeAddressesGetSuspense } from '@gusto/embedded-api/react-query/employeeAddressesGet'\nimport { type EmployeeAddress } from '@gusto/embedded-api/models/components/employeeaddress'\nimport { useEmployeeAddressesCreateMutation } from '@gusto/embedded-api/react-query/employeeAddressesCreate'\nimport { useEmployeeAddressesUpdateMutation } from '@gusto/embedded-api/react-query/employeeAddressesUpdate'\nimport { useEmployeeAddressesUpdateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress'\nimport { useEmployeesUpdateMutation } from '@gusto/embedded-api/react-query/employeesUpdate'\nimport { useEmployeeAddressesGetWorkAddressesSuspense } from '@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { useEmployeeAddressesCreateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport { useEmployeesUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlowComponents'\nimport {\n AdminPersonalDetails,\n AdminPersonalDetailsSchema,\n AdminSelfOnboardingPersonalDetailsSchema,\n} from './AdminPersonalDetails'\nimport { SelfPersonalDetails, SelfPersonalDetailsSchema } from './SelfPersonalDetails'\nimport { type PersonalDetailsPayload, type PersonalDetailsInputs } from './PersonalDetailsInputs'\nimport { Head } from './Head'\nimport { Actions } from './Actions'\nimport {\n HomeAddress,\n HomeAddressSchema,\n HomeAddressSchemaWithCompletedOnboarding,\n type HomeAddressInputs,\n} from './HomeAddress'\nimport { WorkAddress } from './WorkAddress'\nimport { ProfileProvider } from './useProfile'\nimport { getEmployeeAddressForProfile } from './getEmployeeAddressForProfile'\nimport { Grid } from '@/components/Common/Grid/Grid'\nimport { Form } from '@/components/Common/Form'\nimport {\n useBase,\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport {\n componentEvents,\n EmployeeOnboardingStatus,\n EmployeeSelfOnboardingStatuses,\n} from '@/shared/constants'\nimport type { RequireAtLeastOne, WithRequired } from '@/types/Helpers'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport type ProfileDefaultValues = RequireAtLeastOne<{\n employee?: RequireAtLeastOne<{\n firstName?: string\n middleInitial?: string\n lastName?: string\n email?: string\n dateOfBirth?: string\n }>\n homeAddress?: RequireAtLeastOne<{\n street1?: string\n street2?: string\n city?: string\n state?: string\n zip?: string\n }>\n inviteEmployeeDefault?: boolean\n}>\ninterface ProfileProps extends CommonComponentInterface<'Employee.Profile'> {\n employeeId?: string\n companyId: string\n defaultValues?: ProfileDefaultValues\n isAdmin?: boolean\n isSelfOnboardingEnabled?: boolean\n}\n\ninterface ProfileConditionalProps {\n employee?: Employee\n homeAddresses?: EmployeeAddress[]\n workAddresses?: EmployeeWorkAddress[]\n}\n\nexport function Profile(props: ProfileProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n {props.employeeId ? (\n <RootWithEmployee {...props} employeeId={props.employeeId}>\n {props.children}\n </RootWithEmployee>\n ) : (\n <Root {...props}>{props.children}</Root>\n )}\n </BaseComponent>\n )\n}\n\n/**Accounting for conditional logic where employee data needs to be fetched only if employeeId is present */\nfunction RootWithEmployee({ employeeId, ...props }: WithRequired<ProfileProps, 'employeeId'>) {\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n const {\n data: { employeeAddressList },\n } = useEmployeeAddressesGetSuspense({ employeeId })\n const {\n data: { employeeWorkAddressesList },\n } = useEmployeeAddressesGetWorkAddressesSuspense({ employeeId })\n return (\n <Root\n {...props}\n employee={employee}\n homeAddresses={employeeAddressList}\n workAddresses={employeeWorkAddressesList}\n />\n )\n}\n\nconst checkHasCompletedSelfOnboarding = (employee?: Employee) => {\n return (\n employee?.onboarded ||\n employee?.onboardingStatus === EmployeeOnboardingStatus.ONBOARDING_COMPLETED ||\n employee?.onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW ||\n employee?.onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_COMPLETED_BY_EMPLOYEE\n )\n}\n\nconst Root = ({\n isAdmin = false,\n isSelfOnboardingEnabled = true,\n dictionary,\n ...props\n}: ProfileProps & ProfileConditionalProps) => {\n useI18n('Employee.Profile')\n useI18n('Employee.HomeAddress')\n useComponentDictionary('Employee.Profile', dictionary)\n const {\n companyId,\n employee,\n homeAddresses,\n workAddresses,\n children,\n className = '',\n defaultValues,\n } = props\n const { onEvent, baseSubmitHandler } = useBase()\n\n const [AdminSchema, setAdminSchema] = useState<\n typeof AdminPersonalDetailsSchema | typeof AdminSelfOnboardingPersonalDetailsSchema\n >(AdminPersonalDetailsSchema)\n\n const [AddressSchema, setAddressSchema] = useState<\n typeof HomeAddressSchema | typeof HomeAddressSchemaWithCompletedOnboarding\n >(HomeAddressSchema)\n\n const { data } = useLocationsGetSuspense({ companyId })\n const companyLocations = data.locationList!\n\n const { mutateAsync: createEmployee, isPending: isPendingCreateEmployee } =\n useEmployeesCreateMutation()\n const { mutateAsync: mutateEmployee, isPending: isPendingEmployeeUpdate } =\n useEmployeesUpdateMutation()\n\n const { mutateAsync: createEmployeeWorkAddress, isPending: isPendingCreateWA } =\n useEmployeeAddressesCreateWorkAddressMutation()\n const { mutateAsync: mutateEmployeeWorkAddress, isPending: isPendingWorkAddressUpdate } =\n useEmployeeAddressesUpdateWorkAddressMutation()\n\n const { mutateAsync: createEmployeeHomeAddress, isPending: isPendingAddHA } =\n useEmployeeAddressesCreateMutation()\n const { mutateAsync: mutateEmployeeHomeAddress, isPending: isPendingUpdateHA } =\n useEmployeeAddressesUpdateMutation()\n\n const {\n mutateAsync: updateEmployeeOnboardingStatus,\n isPending: isPendingUpdateOnboardingStatus,\n } = useEmployeesUpdateOnboardingStatusMutation()\n\n const existingData = { employee, workAddresses, homeAddresses }\n\n const currentHomeAddress = getEmployeeAddressForProfile(homeAddresses)\n\n const currentWorkAddress = existingData.workAddresses?.find(address => address.active)\n const mergedData = useRef({\n employee: existingData.employee,\n homeAddress: currentHomeAddress,\n workAddress: currentWorkAddress,\n })\n const initialValues = {\n firstName: mergedData.current.employee?.firstName ?? defaultValues?.employee?.firstName ?? '',\n middleInitial:\n mergedData.current.employee?.middleInitial ?? defaultValues?.employee?.middleInitial ?? '',\n lastName: mergedData.current.employee?.lastName ?? defaultValues?.employee?.lastName ?? '',\n workAddress: mergedData.current.workAddress?.locationUuid,\n startDate: mergedData.current.employee?.jobs?.[0]?.hireDate\n ? new Date(mergedData.current.employee.jobs[0].hireDate)\n : null, // By default employee response contains only current job - therefore jobs[0]\n email: mergedData.current.employee?.email ?? defaultValues?.employee?.email ?? '',\n dateOfBirth: mergedData.current.employee?.dateOfBirth\n ? new Date(mergedData.current.employee.dateOfBirth)\n : defaultValues?.employee?.dateOfBirth\n ? new Date(defaultValues.employee.dateOfBirth)\n : null,\n\n street1: mergedData.current.homeAddress?.street1 ?? defaultValues?.homeAddress?.street1 ?? '',\n street2: mergedData.current.homeAddress?.street2 ?? defaultValues?.homeAddress?.street2 ?? '',\n city: mergedData.current.homeAddress?.city ?? defaultValues?.homeAddress?.city ?? '',\n zip: mergedData.current.homeAddress?.zip ?? defaultValues?.homeAddress?.zip ?? '',\n state: mergedData.current.homeAddress?.state ?? defaultValues?.homeAddress?.state ?? '',\n courtesyWithholding: mergedData.current.homeAddress?.courtesyWithholding ?? false,\n }\n\n const adminDefaultValues =\n mergedData.current.employee?.onboarded ||\n mergedData.current.employee?.onboardingStatus ===\n EmployeeOnboardingStatus.ONBOARDING_COMPLETED ||\n (mergedData.current.employee?.onboardingStatus !== undefined &&\n mergedData.current.employee.onboardingStatus !==\n EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE)\n ? { ...initialValues, enableSsn: false, selfOnboarding: true }\n : {\n ...initialValues,\n selfOnboarding: isSelfOnboardingEnabled\n ? mergedData.current.employee?.onboardingStatus\n ? // @ts-expect-error: onboarding_status during runtime can be one of self onboarding statuses\n EmployeeSelfOnboardingStatuses.has(mergedData.current.employee.onboarding_status)\n : (defaultValues?.inviteEmployeeDefault ?? false)\n : false,\n enableSsn: !mergedData.current.employee?.hasSsn,\n ssn: '',\n } // In edit mode ssn is submitted only if it has been modified\n\n const selfDetaultValues = {\n ...initialValues,\n enableSsn: !mergedData.current.employee?.hasSsn,\n ssn: '',\n }\n\n const formMethods = useForm<\n PersonalDetailsInputs & HomeAddressInputs,\n unknown,\n PersonalDetailsPayload & HomeAddressInputs\n >({\n // @ts-expect-error: Complex discriminated union schema causes type inference issues with zodResolver v5.2.1\n resolver: zodResolver(\n // @ts-expect-error: Zod discriminated union intersection incompatible with zodResolver v5.2.1\n (isAdmin ? AdminSchema : SelfPersonalDetailsSchema).and(AddressSchema),\n ),\n defaultValues: isAdmin ? adminDefaultValues : selfDetaultValues,\n })\n\n const { handleSubmit } = formMethods\n const watchedSelfOnboarding = useWatch({ control: formMethods.control, name: 'selfOnboarding' })\n\n useEffect(() => {\n if (isAdmin) {\n const hasCompletedSelfOnboarding = checkHasCompletedSelfOnboarding(employee)\n\n if (watchedSelfOnboarding && !hasCompletedSelfOnboarding) {\n setAdminSchema(AdminSelfOnboardingPersonalDetailsSchema)\n } else {\n setAdminSchema(AdminPersonalDetailsSchema)\n }\n\n if (watchedSelfOnboarding && hasCompletedSelfOnboarding) {\n setAddressSchema(HomeAddressSchemaWithCompletedOnboarding)\n } else {\n setAddressSchema(HomeAddressSchema)\n }\n }\n }, [watchedSelfOnboarding, isAdmin, employee?.onboardingStatus, employee?.onboarded])\n\n const onSubmit: SubmitHandler<PersonalDetailsPayload & HomeAddressInputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n const { workAddress, startDate, selfOnboarding, ...body } = payload\n //create or update employee\n if (!mergedData.current.employee) {\n const { employee: employeeData } = await createEmployee({\n request: {\n companyId,\n requestBody: {\n ...body,\n selfOnboarding,\n dateOfBirth: body.dateOfBirth ? new RFCDate(body.dateOfBirth) : undefined,\n },\n },\n })\n mergedData.current = { ...mergedData.current, employee: employeeData }\n onEvent(componentEvents.EMPLOYEE_CREATED, employeeData)\n } else {\n // Updating self-onboarding status\n if (\n isAdmin &&\n ((selfOnboarding &&\n mergedData.current.employee.onboardingStatus ===\n EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE) ||\n (!selfOnboarding &&\n mergedData.current.employee.onboardingStatus ===\n EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE))\n ) {\n const { employeeOnboardingStatus } = await updateEmployeeOnboardingStatus({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: {\n onboardingStatus: selfOnboarding\n ? EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE\n : EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE,\n },\n },\n })\n mergedData.current.employee = {\n ...mergedData.current.employee,\n onboardingStatus: employeeOnboardingStatus!\n .onboardingStatus as (typeof EmployeeOnboardingStatus)[keyof typeof EmployeeOnboardingStatus],\n }\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_STATUS_UPDATED, employeeOnboardingStatus)\n }\n const { employee: employeeData } = await mutateEmployee({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: { ...body, version: mergedData.current.employee.version as string },\n },\n })\n mergedData.current = { ...mergedData.current, employee: employeeData }\n onEvent(componentEvents.EMPLOYEE_UPDATED, employeeData)\n }\n if (typeof mergedData.current.employee?.uuid !== 'string') {\n throw new Error('Employee id is not available')\n }\n\n const hasCompletedSelfOnboarding = checkHasCompletedSelfOnboarding(\n mergedData.current.employee,\n )\n\n //create or update home address - only if not intended for self onboarding or after self onboarding is completed\n if (!isAdmin || !watchedSelfOnboarding || hasCompletedSelfOnboarding) {\n //typeguard: in this scenario payload will contain address information\n if (!payload.selfOnboarding || hasCompletedSelfOnboarding) {\n if ('street1' in payload && 'city' in payload && 'state' in payload && 'zip' in payload) {\n const { street1, street2, city, state, zip, courtesyWithholding } = payload\n if (!mergedData.current.homeAddress) {\n // Creating home address - for new employee effective_date is the same as work start date\n const { employeeAddress } = await createEmployeeHomeAddress({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: {\n street1,\n street2,\n city,\n state,\n zip,\n courtesyWithholding,\n },\n },\n })\n mergedData.current = { ...mergedData.current, homeAddress: employeeAddress }\n onEvent(componentEvents.EMPLOYEE_HOME_ADDRESS_CREATED, employeeAddress)\n } else {\n const { employeeAddress } = await mutateEmployeeHomeAddress({\n request: {\n homeAddressUuid: mergedData.current.homeAddress.uuid,\n requestBody: {\n version: mergedData.current.homeAddress.version,\n street1,\n street2,\n city,\n state,\n zip,\n courtesyWithholding,\n },\n },\n })\n mergedData.current = { ...mergedData.current, homeAddress: employeeAddress }\n onEvent(componentEvents.EMPLOYEE_HOME_ADDRESS_UPDATED, employeeAddress)\n }\n }\n }\n }\n\n if (isAdmin) {\n //create or update workaddress\n if (!mergedData.current.workAddress) {\n const { employeeWorkAddress } = await createEmployeeWorkAddress({\n request: {\n employeeId: mergedData.current.employee?.uuid as string,\n requestBody: {\n locationUuid: workAddress,\n effectiveDate: new RFCDate(payload.startDate || new Date()),\n },\n },\n })\n\n mergedData.current = { ...mergedData.current, workAddress: employeeWorkAddress }\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_CREATED, employeeWorkAddress)\n } else {\n //effective_date is excluded from update operation since it cannot be changed on initial work address\n const { employeeWorkAddress } = await mutateEmployeeWorkAddress({\n request: {\n workAddressUuid: mergedData.current.workAddress.uuid,\n requestBody: {\n version: mergedData.current.workAddress.version,\n locationUuid: workAddress,\n },\n },\n })\n mergedData.current = { ...mergedData.current, workAddress: employeeWorkAddress }\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_UPDATED, employeeWorkAddress)\n }\n }\n\n onEvent(componentEvents.EMPLOYEE_PROFILE_DONE, {\n ...mergedData.current.employee,\n startDate,\n })\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n return (\n <section className={className}>\n <ProfileProvider\n value={{\n companyLocations,\n workAddresses,\n employee: mergedData.current.employee ?? undefined,\n isSelfOnboardingIntended: watchedSelfOnboarding,\n handleCancel,\n isAdmin,\n isSelfOnboardingEnabled,\n hasCompletedSelfOnboarding: checkHasCompletedSelfOnboarding(mergedData.current.employee),\n isPending:\n isPendingEmployeeUpdate ||\n isPendingWorkAddressUpdate ||\n isPendingAddHA ||\n isPendingUpdateHA ||\n isPendingCreateEmployee ||\n isPendingCreateWA ||\n isPendingUpdateOnboardingStatus,\n }}\n >\n <FormProvider {...formMethods}>\n <Form onSubmit={handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <>\n <Grid gridTemplateColumns=\"1fr\" gap={24}>\n <Head />\n <AdminPersonalDetails />\n <SelfPersonalDetails />\n <HomeAddress />\n <WorkAddress />\n </Grid>\n <Actions />\n </>\n )}\n </Form>\n </FormProvider>\n </ProfileProvider>\n </section>\n )\n}\n\nexport const ProfileContextual = () => {\n const { companyId, employeeId, onEvent, isAdmin, defaultValues, isSelfOnboardingEnabled } =\n useFlow<OnboardingContextInterface>()\n\n return (\n <Profile\n companyId={ensureRequired(companyId)}\n employeeId={employeeId}\n onEvent={onEvent}\n isAdmin={isAdmin}\n defaultValues={defaultValues?.profile}\n isSelfOnboardingEnabled={isSelfOnboardingEnabled}\n />\n )\n}\n"],"names":["Profile","props","jsx","BaseComponent","RootWithEmployee","Root","employeeId","employee","useEmployeesGetSuspense","employeeAddressList","useEmployeeAddressesGetSuspense","employeeWorkAddressesList","useEmployeeAddressesGetWorkAddressesSuspense","checkHasCompletedSelfOnboarding","EmployeeOnboardingStatus","isAdmin","isSelfOnboardingEnabled","dictionary","useI18n","useComponentDictionary","companyId","homeAddresses","workAddresses","children","className","defaultValues","onEvent","baseSubmitHandler","useBase","AdminSchema","setAdminSchema","useState","AdminPersonalDetailsSchema","AddressSchema","setAddressSchema","HomeAddressSchema","data","useLocationsGetSuspense","companyLocations","createEmployee","isPendingCreateEmployee","useEmployeesCreateMutation","mutateEmployee","isPendingEmployeeUpdate","useEmployeesUpdateMutation","createEmployeeWorkAddress","isPendingCreateWA","useEmployeeAddressesCreateWorkAddressMutation","mutateEmployeeWorkAddress","isPendingWorkAddressUpdate","useEmployeeAddressesUpdateWorkAddressMutation","createEmployeeHomeAddress","isPendingAddHA","useEmployeeAddressesCreateMutation","mutateEmployeeHomeAddress","isPendingUpdateHA","useEmployeeAddressesUpdateMutation","updateEmployeeOnboardingStatus","isPendingUpdateOnboardingStatus","useEmployeesUpdateOnboardingStatusMutation","existingData","currentHomeAddress","getEmployeeAddressForProfile","currentWorkAddress","address","mergedData","useRef","initialValues","adminDefaultValues","EmployeeSelfOnboardingStatuses","selfDetaultValues","formMethods","useForm","zodResolver","SelfPersonalDetailsSchema","handleSubmit","watchedSelfOnboarding","useWatch","useEffect","hasCompletedSelfOnboarding","AdminSelfOnboardingPersonalDetailsSchema","HomeAddressSchemaWithCompletedOnboarding","onSubmit","payload","workAddress","startDate","selfOnboarding","body","employeeOnboardingStatus","componentEvents","employeeData","RFCDate","street1","street2","city","state","zip","courtesyWithholding","employeeAddress","employeeWorkAddress","handleCancel","ProfileProvider","FormProvider","Form","jsxs","Fragment","Grid","Head","AdminPersonalDetails","SelfPersonalDetails","HomeAddress","WorkAddress","Actions","ProfileContextual","useFlow","ensureRequired"],"mappings":";;;;;;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BC,IAAA,EAAY;AAAA,4BACZC,IAAA,CAAA,CAAY;AAAA,QAAA,GACf;AAAA,0BACCC,IAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,GAEJ,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ,GAEaC,KAAoB,MAAM;AACrC,QAAM,EAAE,WAAA7F,GAAW,YAAAd,GAAY,SAAAoB,GAAS,SAAAX,GAAS,eAAAU,GAAe,yBAAAT,EAAA,IAC9DkG,GAAA;AAEF,SACE,gBAAAhH;AAAA,IAACF;AAAA,IAAA;AAAA,MACC,WAAWmH,GAAe/F,CAAS;AAAA,MACnC,YAAAd;AAAA,MACA,SAAAoB;AAAA,MACA,SAAAX;AAAA,MACA,eAAeU,GAAe;AAAA,MAC9B,yBAAAT;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -10,6 +10,7 @@ type ProfileContextType = {
|
|
|
10
10
|
isAdmin: boolean;
|
|
11
11
|
handleCancel: () => void;
|
|
12
12
|
isSelfOnboardingEnabled: boolean;
|
|
13
|
+
hasCompletedSelfOnboarding: boolean;
|
|
13
14
|
};
|
|
14
15
|
declare const useProfile: () => ProfileContextType, ProfileProvider: import('react').Provider<ProfileContextType | null>;
|
|
15
16
|
export { useProfile, ProfileProvider };
|
|
@@ -8,14 +8,12 @@ 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
|
-
import "dompurify";
|
|
13
|
-
import "../../../contexts/LocaleProvider/useLocale.js";
|
|
14
11
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
|
+
import "dompurify";
|
|
15
13
|
import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
14
|
+
const [d, s] = o("ProfileContext");
|
|
17
15
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
s as ProfileProvider,
|
|
17
|
+
d as useProfile
|
|
20
18
|
};
|
|
21
19
|
//# sourceMappingURL=useProfile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProfile.js","sources":["../../../../src/components/Employee/Profile/useProfile.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\n\n//Interface for context passed down to component slots\ntype ProfileContextType = {\n companyLocations: Location[]\n workAddresses?: EmployeeWorkAddress[]\n employee?: Employee\n isSelfOnboardingIntended?: boolean\n isPending: boolean\n isAdmin: boolean\n handleCancel: () => void\n isSelfOnboardingEnabled: boolean\n}\n\nconst [useProfile, ProfileProvider] = createCompoundContext<ProfileContextType>('ProfileContext')\nexport { useProfile, ProfileProvider }\n"],"names":["useProfile","ProfileProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useProfile.js","sources":["../../../../src/components/Employee/Profile/useProfile.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\n\n//Interface for context passed down to component slots\ntype ProfileContextType = {\n companyLocations: Location[]\n workAddresses?: EmployeeWorkAddress[]\n employee?: Employee\n isSelfOnboardingIntended?: boolean\n isPending: boolean\n isAdmin: boolean\n handleCancel: () => void\n isSelfOnboardingEnabled: boolean\n hasCompletedSelfOnboarding: boolean\n}\n\nconst [useProfile, ProfileProvider] = createCompoundContext<ProfileContextType>('ProfileContext')\nexport { useProfile, ProfileProvider }\n"],"names":["useProfile","ProfileProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAkBA,MAAM,CAACA,GAAYC,CAAe,IAAIC,EAA0C,gBAAgB;"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { useStateTaxes as
|
|
4
|
-
import "
|
|
5
|
-
import "../../../
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const { t: o } = e("Employee.StateTaxes"), { isPending: n } = r(), i = s();
|
|
10
|
-
return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(i.Button, { type: "submit", isLoading: n, children: o("submitCta") }) });
|
|
2
|
+
import { useTranslation as i } from "react-i18next";
|
|
3
|
+
import { useStateTaxes as s } from "./useStateTaxes.js";
|
|
4
|
+
import { ActionsLayout as r } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
5
|
+
import { useComponentContext as m } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
+
function x() {
|
|
7
|
+
const { t: o } = i("Employee.StateTaxes"), { isPending: n } = s(), e = m();
|
|
8
|
+
return /* @__PURE__ */ t(r, { children: /* @__PURE__ */ t(e.Button, { type: "submit", isLoading: n, children: o("submitCta") }) });
|
|
11
9
|
}
|
|
12
10
|
export {
|
|
13
|
-
|
|
11
|
+
x as Actions
|
|
14
12
|
};
|
|
15
13
|
//# sourceMappingURL=Actions.js.map
|