@gusto/embedded-react-sdk 0.30.0 → 0.31.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 +37 -0
- package/dist/components/Common/Fields/ComboBoxField/ComboBoxField.d.ts +2 -1
- package/dist/components/Common/Fields/ComboBoxField/ComboBoxField.js +48 -36
- package/dist/components/Common/Fields/ComboBoxField/ComboBoxField.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +12 -11
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +2 -2
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBox.d.ts +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBox.js +73 -66
- package/dist/components/Common/UI/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBoxTypes.d.ts +5 -0
- package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
- package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +16 -17
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +5 -6
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +6 -5
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +6 -5
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +2 -2
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +2 -2
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -2
- package/dist/components/Company/FederalTaxes/Form.js +4 -3
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +6 -5
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +7 -6
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Industry.js +1 -1
- package/dist/components/Company/Industry/Industry.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +5 -6
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +14 -14
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +31 -31
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +3 -2
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +3 -2
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -2
- package/dist/components/Company/OnboardingOverview/context.js +4 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +2 -2
- package/dist/components/Company/PaySchedule/_parts/Edit.js +23 -24
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +9 -8
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +12 -11
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +2 -2
- package/dist/components/Contractor/Address/Form.js +7 -8
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +6 -5
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +17 -17
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -2
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +102 -99
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +3 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +35 -31
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +22 -23
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +8 -7
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +51 -48
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +58 -66
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +7 -6
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +3 -2
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +3 -2
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
- package/dist/components/Contractor/Profile/useContractorProfile.js +3 -2
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +1 -1
- package/dist/components/Contractor/index.d.ts +5 -0
- package/dist/components/Contractor/index.js +21 -11
- package/dist/components/Contractor/index.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +14 -14
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +11 -10
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +12 -11
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +12 -11
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +2 -3
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +7 -7
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +24 -24
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +3 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.d.ts +0 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentSigner.d.ts +2 -1
- package/dist/components/Employee/DocumentSigner/DocumentSigner.js +42 -21
- package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibility.d.ts +5 -0
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js +65 -0
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +1 -0
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.d.ts +10 -0
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +120 -0
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -0
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.d.ts +43 -0
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js +51 -0
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +1 -0
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.test.d.ts +1 -0
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/countries.d.ts +4 -0
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/countries.js +199 -0
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/countries.js.map +1 -0
- package/dist/components/Employee/{EmploymentEligibility → DocumentSigner/EmploymentEligibility}/index.d.ts +0 -1
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.d.ts +107 -0
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +284 -0
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -0
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.module.scss.js +10 -0
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.module.scss.js.map +1 -0
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/documentSignerStateMachine.d.ts +6 -0
- package/dist/components/Employee/DocumentSigner/documentSignerStateMachine.js +33 -14
- package/dist/components/Employee/DocumentSigner/documentSignerStateMachine.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/stateMachine.d.ts +1 -0
- package/dist/components/Employee/DocumentSigner/stateMachine.js +41 -23
- package/dist/components/Employee/DocumentSigner/stateMachine.js.map +1 -1
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocuments.d.ts +10 -0
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocuments.js +55 -0
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocuments.js.map +1 -0
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.d.ts +18 -0
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +116 -0
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -0
- package/dist/components/Employee/EmployeeDocuments/index.d.ts +2 -0
- package/dist/components/Employee/EmployeeList/EmployeeList.js +4 -3
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +3 -2
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -3
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +7 -7
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -3
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +31 -26
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.d.ts +2 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js +23 -21
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.d.ts +1 -0
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.d.ts +1 -0
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js +68 -49
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +2 -2
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +8 -8
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +9 -10
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +10 -11
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/Profile.js +11 -11
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +4 -3
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.d.ts +3 -0
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js +43 -30
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.d.ts +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js +23 -17
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js +36 -46
- package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -3
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +7 -7
- package/dist/components/Employee/Taxes/useTaxes.js +4 -3
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Employee/index.d.ts +3 -0
- package/dist/components/Employee/index.js +20 -16
- package/dist/components/Employee/index.js.map +1 -1
- package/dist/components/Flow/Flow.js +3 -2
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +63 -52
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +4 -4
- package/dist/components/InformationRequests/InformationRequests.js +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +9 -9
- package/dist/components/Payroll/OffCycle/OffCycleFlow.d.ts +2 -0
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js +29 -0
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js.map +1 -0
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.d.ts +13 -0
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +45 -0
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -0
- package/dist/components/Payroll/OffCycle/index.d.ts +3 -0
- package/dist/components/Payroll/OffCycle/offCycleStateMachine.d.ts +6 -0
- package/dist/components/Payroll/OffCycle/offCycleStateMachine.js +58 -0
- package/dist/components/Payroll/OffCycle/offCycleStateMachine.js.map +1 -0
- package/dist/components/Payroll/OffCycle/offCycleStateMachine.test.d.ts +1 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.d.ts +2 -0
- package/dist/components/Payroll/{PayPeriodDateForm/PayPeriodDateFormTypes.d.ts → OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.d.ts} +5 -19
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/index.d.ts +2 -0
- package/dist/components/Payroll/{PayPeriodDateForm/usePayPeriodDateValidation.d.ts → OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.d.ts} +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +2 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +3 -2
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +12 -12
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +51 -49
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +2 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +93 -90
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +1 -0
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +26 -25
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +38 -39
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +18 -17
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +3 -2
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +3 -2
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +23 -21
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +3 -2
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +3 -2
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +6 -6
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +3 -2
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/helpers.d.ts +5 -0
- package/dist/components/Payroll/helpers.js +41 -40
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +3 -2
- package/dist/components/Payroll/index.js +16 -16
- package/dist/components/Payroll/usePreparedPayrollData.d.ts +2 -2
- package/dist/components/Payroll/usePreparedPayrollData.js +3 -2
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/ApiProvider/ApiProvider.js +6 -6
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
- package/dist/i18n/I18n.js +5 -5
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +1 -1
- package/dist/i18n/en/Employee.EmployeeDocuments.json.js +12 -0
- package/dist/i18n/en/Employee.EmployeeDocuments.json.js.map +1 -0
- package/dist/i18n/en/Employee.EmploymentEligibility.json.js +15 -19
- package/dist/i18n/en/Employee.EmploymentEligibility.json.js.map +1 -1
- package/dist/i18n/en/Employee.I9SignatureForm.json.js +78 -0
- package/dist/i18n/en/Employee.I9SignatureForm.json.js.map +1 -0
- package/dist/i18n/en/Payroll.OffCycle.json.js +8 -0
- package/dist/i18n/en/Payroll.OffCycle.json.js.map +1 -0
- package/dist/i18n/en/Payroll.OffCyclePayPeriodDateForm.json.js +18 -0
- package/dist/i18n/en/Payroll.OffCyclePayPeriodDateForm.json.js.map +1 -0
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +1 -1
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +1 -1
- package/dist/shared/constants.d.ts +9 -0
- package/dist/shared/constants.js +60 -53
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +110 -41
- package/package.json +14 -14
- package/dist/components/Employee/EmploymentEligibility/EmploymentEligibility.d.ts +0 -3
- package/dist/components/Employee/EmploymentEligibility/EmploymentEligibilityPresentation.d.ts +0 -37
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateForm.d.ts +0 -2
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateForm.js +0 -35
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateForm.js.map +0 -1
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.d.ts +0 -2
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.js +0 -65
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.js.map +0 -1
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.module.scss.js +0 -18
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.module.scss.js.map +0 -1
- package/dist/components/Payroll/PayPeriodDateForm/index.d.ts +0 -3
- package/dist/i18n/en/Payroll.PayPeriodDateForm.json.js +0 -32
- package/dist/i18n/en/Payroll.PayPeriodDateForm.json.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePaymentMethod.js","sources":["../../../../src/components/Employee/PaymentMethod/usePaymentMethod.ts"],"sourcesContent":["import type { EmployeeBankAccount } from '@gusto/embedded-api/models/components/employeebankaccount'\nimport type { EmployeePaymentMethod } from '@gusto/embedded-api/models/components/employeepaymentmethod'\nimport { z } from 'zod'\nimport { BankAccountSchema } from './BankAccount'\nimport { createCompoundContext } from '@/components/Base'\n\nexport const CombinedSchema = z.union([\n BankAccountSchema.extend({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(false),\n }),\n z.object({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(false),\n hasBankPayload: z.literal(false),\n }),\n z.object({\n type: z.literal('Check'),\n }),\n z.discriminatedUnion('splitBy', [\n z.object({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(true),\n hasBankPayload: z.literal(false),\n splitBy: z.literal('Percentage'),\n splitAmount: z.record(z.string(), z.number().max(100).min(0)).refine(\n input => Object.values(input).reduce((acc, curr) => acc + curr, 0) === 100,\n input => {\n const total = Object.values(input).reduce((acc, curr) => acc + curr, 0)\n return {\n message: `percentage_split_total_error:${total}`,\n }\n },\n ),\n priority: z.record(z.string(), z.number()),\n }),\n z.object({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(true),\n hasBankPayload: z.literal(false),\n splitBy: z.literal('Amount'),\n priority: z.record(z.string(), z.number()).refine(input => {\n const arr = Object.values(input)\n return arr.filter((item, index) => arr.indexOf(item) !== index).length === 0\n }),\n splitAmount: z.record(z.string(), z.number().min(0).nullable()),\n remainder: z.string(),\n }),\n ]),\n])\n\nexport type CombinedSchemaInputs = z.input<typeof CombinedSchema>\nexport type CombinedSchemaOutputs = z.output<typeof CombinedSchema>\n\ntype PaymentMethodContextType = {\n bankAccounts: EmployeeBankAccount[]\n isPending: boolean\n watchedType?: string\n mode: MODE\n paymentMethod: EmployeePaymentMethod\n handleAdd: () => void\n handleSplit: () => void\n handleCancel: () => void\n handleDelete: (uuid: string) => void\n isAdmin: boolean\n}\n\nexport type MODE = 'ADD' | 'LIST' | 'SPLIT' | 'INITIAL'\n\nconst [usePaymentMethod, PaymentMethodProvider] =\n createCompoundContext<PaymentMethodContextType>('PaymentMethodContext')\nexport { usePaymentMethod, PaymentMethodProvider }\n"],"names":["CombinedSchema","z","BankAccountSchema","input","acc","curr","arr","item","index","usePaymentMethod","PaymentMethodProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"usePaymentMethod.js","sources":["../../../../src/components/Employee/PaymentMethod/usePaymentMethod.ts"],"sourcesContent":["import type { EmployeeBankAccount } from '@gusto/embedded-api/models/components/employeebankaccount'\nimport type { EmployeePaymentMethod } from '@gusto/embedded-api/models/components/employeepaymentmethod'\nimport { z } from 'zod'\nimport { BankAccountSchema } from './BankAccount'\nimport { createCompoundContext } from '@/components/Base'\n\nexport const CombinedSchema = z.union([\n BankAccountSchema.extend({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(false),\n }),\n z.object({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(false),\n hasBankPayload: z.literal(false),\n }),\n z.object({\n type: z.literal('Check'),\n }),\n z.discriminatedUnion('splitBy', [\n z.object({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(true),\n hasBankPayload: z.literal(false),\n splitBy: z.literal('Percentage'),\n splitAmount: z.record(z.string(), z.number().max(100).min(0)).refine(\n input => Object.values(input).reduce((acc, curr) => acc + curr, 0) === 100,\n input => {\n const total = Object.values(input).reduce((acc, curr) => acc + curr, 0)\n return {\n message: `percentage_split_total_error:${total}`,\n }\n },\n ),\n priority: z.record(z.string(), z.number()),\n }),\n z.object({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(true),\n hasBankPayload: z.literal(false),\n splitBy: z.literal('Amount'),\n priority: z.record(z.string(), z.number()).refine(input => {\n const arr = Object.values(input)\n return arr.filter((item, index) => arr.indexOf(item) !== index).length === 0\n }),\n splitAmount: z.record(z.string(), z.number().min(0).nullable()),\n remainder: z.string(),\n }),\n ]),\n])\n\nexport type CombinedSchemaInputs = z.input<typeof CombinedSchema>\nexport type CombinedSchemaOutputs = z.output<typeof CombinedSchema>\n\ntype PaymentMethodContextType = {\n bankAccounts: EmployeeBankAccount[]\n isPending: boolean\n watchedType?: string\n mode: MODE\n paymentMethod: EmployeePaymentMethod\n handleAdd: () => void\n handleSplit: () => void\n handleCancel: () => void\n handleDelete: (uuid: string) => void\n isAdmin: boolean\n}\n\nexport type MODE = 'ADD' | 'LIST' | 'SPLIT' | 'INITIAL'\n\nconst [usePaymentMethod, PaymentMethodProvider] =\n createCompoundContext<PaymentMethodContextType>('PaymentMethodContext')\nexport { usePaymentMethod, PaymentMethodProvider }\n"],"names":["CombinedSchema","z","BankAccountSchema","input","acc","curr","arr","item","index","usePaymentMethod","PaymentMethodProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;;AAMO,MAAMA,IAAiBC,EAAE,MAAM;AAAA,EACpCC,EAAkB,OAAO;AAAA,IACvB,MAAMD,EAAE,QAAQ,gBAAgB;AAAA,IAChC,SAASA,EAAE,QAAQ,EAAK;AAAA,EAAA,CACzB;AAAA,EACDA,EAAE,OAAO;AAAA,IACP,MAAMA,EAAE,QAAQ,gBAAgB;AAAA,IAChC,SAASA,EAAE,QAAQ,EAAK;AAAA,IACxB,gBAAgBA,EAAE,QAAQ,EAAK;AAAA,EAAA,CAChC;AAAA,EACDA,EAAE,OAAO;AAAA,IACP,MAAMA,EAAE,QAAQ,OAAO;AAAA,EAAA,CACxB;AAAA,EACDA,EAAE,mBAAmB,WAAW;AAAA,IAC9BA,EAAE,OAAO;AAAA,MACP,MAAMA,EAAE,QAAQ,gBAAgB;AAAA,MAChC,SAASA,EAAE,QAAQ,EAAI;AAAA,MACvB,gBAAgBA,EAAE,QAAQ,EAAK;AAAA,MAC/B,SAASA,EAAE,QAAQ,YAAY;AAAA,MAC/B,aAAaA,EAAE,OAAOA,EAAE,UAAUA,EAAE,OAAA,EAAS,IAAI,GAAG,EAAE,IAAI,CAAC,CAAC,EAAE;AAAA,QAC5D,CAAAE,MAAS,OAAO,OAAOA,CAAK,EAAE,OAAO,CAACC,GAAKC,MAASD,IAAMC,GAAM,CAAC,MAAM;AAAA,QACvE,CAAAF,OAES;AAAA,UACL,SAAS,gCAFG,OAAO,OAAOA,CAAK,EAAE,OAAO,CAACC,GAAKC,MAASD,IAAMC,GAAM,CAAC,CAEtB;AAAA,QAAA;AAAA,MAElD;AAAA,MAEF,UAAUJ,EAAE,OAAOA,EAAE,UAAUA,EAAE,QAAQ;AAAA,IAAA,CAC1C;AAAA,IACDA,EAAE,OAAO;AAAA,MACP,MAAMA,EAAE,QAAQ,gBAAgB;AAAA,MAChC,SAASA,EAAE,QAAQ,EAAI;AAAA,MACvB,gBAAgBA,EAAE,QAAQ,EAAK;AAAA,MAC/B,SAASA,EAAE,QAAQ,QAAQ;AAAA,MAC3B,UAAUA,EAAE,OAAOA,EAAE,OAAA,GAAUA,EAAE,OAAA,CAAQ,EAAE,OAAO,CAAAE,MAAS;AACzD,cAAMG,IAAM,OAAO,OAAOH,CAAK;AAC/B,eAAOG,EAAI,OAAO,CAACC,GAAMC,MAAUF,EAAI,QAAQC,CAAI,MAAMC,CAAK,EAAE,WAAW;AAAA,MAC7E,CAAC;AAAA,MACD,aAAaP,EAAE,OAAOA,EAAE,OAAA,GAAUA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,UAAU;AAAA,MAC9D,WAAWA,EAAE,OAAA;AAAA,IAAO,CACrB;AAAA,EAAA,CACF;AACH,CAAC,GAoBK,CAACQ,GAAkBC,CAAqB,IAC5CC,EAAgD,sBAAsB;"}
|
|
@@ -8,8 +8,8 @@ import P from "./AdminPersonalDetails.module.scss.js";
|
|
|
8
8
|
import { useProfile as C } from "./useProfile.js";
|
|
9
9
|
import "../../../shared/constants.js";
|
|
10
10
|
import "classnames";
|
|
11
|
-
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
11
|
import { SwitchField as w } from "../../Common/Fields/SwitchField/SwitchField.js";
|
|
12
|
+
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
13
|
const d = y.merge(
|
|
14
14
|
x
|
|
15
15
|
).extend({
|
|
@@ -5,10 +5,9 @@ import { z as t } from "zod";
|
|
|
5
5
|
import { useProfile as b } from "./useProfile.js";
|
|
6
6
|
import { STATES_ABBR as y } from "../../../shared/constants.js";
|
|
7
7
|
import { Grid as x } from "../../Common/Grid/Grid.js";
|
|
8
|
-
import "
|
|
8
|
+
import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
9
9
|
import { useComponentContext as C } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
10
|
import "react";
|
|
11
|
-
import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
12
11
|
import { SelectField as T } from "../../Common/Fields/SelectField/SelectField.js";
|
|
13
12
|
import { CheckboxField as A } from "../../Common/Fields/CheckboxField/CheckboxField.js";
|
|
14
13
|
const s = t.object({
|
|
@@ -18,7 +17,7 @@ const s = t.object({
|
|
|
18
17
|
state: t.string().min(1),
|
|
19
18
|
zip: t.string().refine((e) => /(^\d{5}$)|(^\d{5}-\d{4}$)/.test(e)),
|
|
20
19
|
courtesyWithholding: t.boolean()
|
|
21
|
-
}),
|
|
20
|
+
}), L = t.union([
|
|
22
21
|
// Case 1: selfOnboarding is false or undefined
|
|
23
22
|
s.extend({
|
|
24
23
|
selfOnboarding: t.union([t.literal(!1), t.undefined()])
|
|
@@ -27,7 +26,7 @@ const s = t.object({
|
|
|
27
26
|
t.object({
|
|
28
27
|
selfOnboarding: t.literal(!0)
|
|
29
28
|
})
|
|
30
|
-
]),
|
|
29
|
+
]), k = t.union([
|
|
31
30
|
// Case 1: selfOnboarding is false or undefined
|
|
32
31
|
s.extend({
|
|
33
32
|
selfOnboarding: t.union([t.literal(!1), t.undefined()])
|
|
@@ -36,8 +35,8 @@ const s = t.object({
|
|
|
36
35
|
s.extend({
|
|
37
36
|
selfOnboarding: t.literal(!0)
|
|
38
37
|
})
|
|
39
|
-
]),
|
|
40
|
-
const { t: e } = f("Employee.HomeAddress"), r = C(), { isSelfOnboardingIntended: m, isAdmin: c, hasCompletedSelfOnboarding: h } = b(), { watch:
|
|
38
|
+
]), $ = () => {
|
|
39
|
+
const { t: e } = f("Employee.HomeAddress"), r = C(), { isSelfOnboardingIntended: m, isAdmin: c, hasCompletedSelfOnboarding: h } = b(), { watch: u } = g(), p = u("courtesyWithholding");
|
|
41
40
|
return c && m && !h ? null : /* @__PURE__ */ n(a, { children: [
|
|
42
41
|
/* @__PURE__ */ n("div", { children: [
|
|
43
42
|
/* @__PURE__ */ i(r.Heading, { as: "h2", children: e("formTitle") }),
|
|
@@ -117,12 +116,12 @@ const s = t.object({
|
|
|
117
116
|
] })
|
|
118
117
|
}
|
|
119
118
|
),
|
|
120
|
-
|
|
119
|
+
p && /* @__PURE__ */ i(r.Alert, { label: e("withholdingTitle"), status: "warning", children: /* @__PURE__ */ i(d, { t: e, i18nKey: "withholdingNote" }) })
|
|
121
120
|
] });
|
|
122
121
|
};
|
|
123
122
|
export {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
$ as HomeAddress,
|
|
124
|
+
L as HomeAddressSchema,
|
|
125
|
+
k as HomeAddressSchemaWithCompletedOnboarding
|
|
127
126
|
};
|
|
128
127
|
//# sourceMappingURL=HomeAddress.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HomeAddress.js","sources":["../../../../src/components/Employee/Profile/HomeAddress.tsx"],"sourcesContent":["import { useFormContext } from 'react-hook-form'\nimport { Trans, useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { useProfile } from './useProfile'\nimport { STATES_ABBR } from '@/shared/constants'\nimport { CheckboxField, Grid, SelectField, TextInputField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nconst HomeAddressFieldsSchema = z.object({\n street1: z.string().min(1),\n street2: z.string().optional(),\n city: z.string().min(1),\n state: z.string().min(1),\n zip: z.string().refine(zip => /(^\\d{5}$)|(^\\d{5}-\\d{4}$)/.test(zip)),\n courtesyWithholding: z.boolean(),\n})\n\nexport const HomeAddressSchema = z.union([\n // Case 1: selfOnboarding is false or undefined\n HomeAddressFieldsSchema.extend({\n selfOnboarding: z.union([z.literal(false), z.undefined()]),\n }),\n // Case 2: selfOnboarding is true\n z.object({\n selfOnboarding: z.literal(true),\n }),\n])\n\nexport const HomeAddressSchemaWithCompletedOnboarding = z.union([\n // Case 1: selfOnboarding is false or undefined\n HomeAddressFieldsSchema.extend({\n selfOnboarding: z.union([z.literal(false), z.undefined()]),\n }),\n // Case 2: selfOnboarding is true but admin can update completed onboarding\n HomeAddressFieldsSchema.extend({\n selfOnboarding: z.literal(true),\n }),\n])\n\nexport type HomeAddressInputs = z.infer<typeof HomeAddressSchema>\n\nexport const HomeAddress = () => {\n const { t } = useTranslation('Employee.HomeAddress')\n const Components = useComponentContext()\n const { isSelfOnboardingIntended, isAdmin, hasCompletedSelfOnboarding } = useProfile()\n\n const { watch } = useFormContext<HomeAddressInputs>()\n const watchedCourtesyWithholding = watch('courtesyWithholding')\n\n if (isAdmin && isSelfOnboardingIntended && !hasCompletedSelfOnboarding) {\n return null\n }\n\n return (\n <>\n <div>\n <Components.Heading as=\"h2\">{t('formTitle')}</Components.Heading>\n <Components.Text>{t('desc')}</Components.Text>\n </div>\n <Grid\n gridTemplateColumns={{\n base: '1fr',\n small: ['1fr', '1fr'],\n }}\n gap={20}\n >\n <TextInputField\n name=\"street1\"\n label={t('street1')}\n isRequired\n errorMessage={t('validations.street1')}\n />\n <TextInputField name=\"street2\" label={t('street2')} />\n <TextInputField\n name=\"city\"\n isRequired\n label={t('city')}\n errorMessage={t('validations.city')}\n />\n <SelectField\n name=\"state\"\n options={STATES_ABBR.map((stateAbbr: (typeof STATES_ABBR)[number]) => ({\n label: t(`statesHash.${stateAbbr}`, { ns: 'common' }),\n value: stateAbbr,\n }))}\n label={t('state')}\n placeholder={t('statePlaceholder')}\n errorMessage={t('validations.state')}\n isRequired\n />\n <TextInputField\n name=\"zip\"\n isRequired\n label={t('zip')}\n errorMessage={t('validations.zip')}\n />\n </Grid>\n <CheckboxField\n name=\"courtesyWithholding\"\n label={t('courtesyWithholdingLabel')}\n description={\n <>\n {t('courtesyWithholdingDescription')}\n <Trans\n t={t}\n i18nKey=\"learnMoreCta\"\n components={{\n LearnMoreLink: <Components.Link />,\n }}\n />\n </>\n }\n />\n {watchedCourtesyWithholding && (\n <Components.Alert label={t('withholdingTitle')} status=\"warning\">\n <Trans t={t} i18nKey=\"withholdingNote\" />\n </Components.Alert>\n )}\n </>\n )\n}\n"],"names":["HomeAddressFieldsSchema","z","zip","HomeAddressSchema","HomeAddressSchemaWithCompletedOnboarding","HomeAddress","t","useTranslation","Components","useComponentContext","isSelfOnboardingIntended","isAdmin","hasCompletedSelfOnboarding","useProfile","watch","useFormContext","watchedCourtesyWithholding","jsxs","Fragment","jsx","Grid","TextInputField","SelectField","STATES_ABBR","stateAbbr","CheckboxField","Trans"],"mappings":"
|
|
1
|
+
{"version":3,"file":"HomeAddress.js","sources":["../../../../src/components/Employee/Profile/HomeAddress.tsx"],"sourcesContent":["import { useFormContext } from 'react-hook-form'\nimport { Trans, useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { useProfile } from './useProfile'\nimport { STATES_ABBR } from '@/shared/constants'\nimport { CheckboxField, Grid, SelectField, TextInputField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nconst HomeAddressFieldsSchema = z.object({\n street1: z.string().min(1),\n street2: z.string().optional(),\n city: z.string().min(1),\n state: z.string().min(1),\n zip: z.string().refine(zip => /(^\\d{5}$)|(^\\d{5}-\\d{4}$)/.test(zip)),\n courtesyWithholding: z.boolean(),\n})\n\nexport const HomeAddressSchema = z.union([\n // Case 1: selfOnboarding is false or undefined\n HomeAddressFieldsSchema.extend({\n selfOnboarding: z.union([z.literal(false), z.undefined()]),\n }),\n // Case 2: selfOnboarding is true\n z.object({\n selfOnboarding: z.literal(true),\n }),\n])\n\nexport const HomeAddressSchemaWithCompletedOnboarding = z.union([\n // Case 1: selfOnboarding is false or undefined\n HomeAddressFieldsSchema.extend({\n selfOnboarding: z.union([z.literal(false), z.undefined()]),\n }),\n // Case 2: selfOnboarding is true but admin can update completed onboarding\n HomeAddressFieldsSchema.extend({\n selfOnboarding: z.literal(true),\n }),\n])\n\nexport type HomeAddressInputs = z.infer<typeof HomeAddressSchema>\n\nexport const HomeAddress = () => {\n const { t } = useTranslation('Employee.HomeAddress')\n const Components = useComponentContext()\n const { isSelfOnboardingIntended, isAdmin, hasCompletedSelfOnboarding } = useProfile()\n\n const { watch } = useFormContext<HomeAddressInputs>()\n const watchedCourtesyWithholding = watch('courtesyWithholding')\n\n if (isAdmin && isSelfOnboardingIntended && !hasCompletedSelfOnboarding) {\n return null\n }\n\n return (\n <>\n <div>\n <Components.Heading as=\"h2\">{t('formTitle')}</Components.Heading>\n <Components.Text>{t('desc')}</Components.Text>\n </div>\n <Grid\n gridTemplateColumns={{\n base: '1fr',\n small: ['1fr', '1fr'],\n }}\n gap={20}\n >\n <TextInputField\n name=\"street1\"\n label={t('street1')}\n isRequired\n errorMessage={t('validations.street1')}\n />\n <TextInputField name=\"street2\" label={t('street2')} />\n <TextInputField\n name=\"city\"\n isRequired\n label={t('city')}\n errorMessage={t('validations.city')}\n />\n <SelectField\n name=\"state\"\n options={STATES_ABBR.map((stateAbbr: (typeof STATES_ABBR)[number]) => ({\n label: t(`statesHash.${stateAbbr}`, { ns: 'common' }),\n value: stateAbbr,\n }))}\n label={t('state')}\n placeholder={t('statePlaceholder')}\n errorMessage={t('validations.state')}\n isRequired\n />\n <TextInputField\n name=\"zip\"\n isRequired\n label={t('zip')}\n errorMessage={t('validations.zip')}\n />\n </Grid>\n <CheckboxField\n name=\"courtesyWithholding\"\n label={t('courtesyWithholdingLabel')}\n description={\n <>\n {t('courtesyWithholdingDescription')}\n <Trans\n t={t}\n i18nKey=\"learnMoreCta\"\n components={{\n LearnMoreLink: <Components.Link />,\n }}\n />\n </>\n }\n />\n {watchedCourtesyWithholding && (\n <Components.Alert label={t('withholdingTitle')} status=\"warning\">\n <Trans t={t} i18nKey=\"withholdingNote\" />\n </Components.Alert>\n )}\n </>\n )\n}\n"],"names":["HomeAddressFieldsSchema","z","zip","HomeAddressSchema","HomeAddressSchemaWithCompletedOnboarding","HomeAddress","t","useTranslation","Components","useComponentContext","isSelfOnboardingIntended","isAdmin","hasCompletedSelfOnboarding","useProfile","watch","useFormContext","watchedCourtesyWithholding","jsxs","Fragment","jsx","Grid","TextInputField","SelectField","STATES_ABBR","stateAbbr","CheckboxField","Trans"],"mappings":";;;;;;;;;;;;AAQA,MAAMA,IAA0BC,EAAE,OAAO;AAAA,EACvC,SAASA,EAAE,SAAS,IAAI,CAAC;AAAA,EACzB,SAASA,EAAE,OAAA,EAAS,SAAA;AAAA,EACpB,MAAMA,EAAE,SAAS,IAAI,CAAC;AAAA,EACtB,OAAOA,EAAE,SAAS,IAAI,CAAC;AAAA,EACvB,KAAKA,EAAE,OAAA,EAAS,OAAO,CAAAC,MAAO,4BAA4B,KAAKA,CAAG,CAAC;AAAA,EACnE,qBAAqBD,EAAE,QAAA;AACzB,CAAC,GAEYE,IAAoBF,EAAE,MAAM;AAAA;AAAA,EAEvCD,EAAwB,OAAO;AAAA,IAC7B,gBAAgBC,EAAE,MAAM,CAACA,EAAE,QAAQ,EAAK,GAAGA,EAAE,WAAW,CAAC;AAAA,EAAA,CAC1D;AAAA;AAAA,EAEDA,EAAE,OAAO;AAAA,IACP,gBAAgBA,EAAE,QAAQ,EAAI;AAAA,EAAA,CAC/B;AACH,CAAC,GAEYG,IAA2CH,EAAE,MAAM;AAAA;AAAA,EAE9DD,EAAwB,OAAO;AAAA,IAC7B,gBAAgBC,EAAE,MAAM,CAACA,EAAE,QAAQ,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slation as s } from "react-i18next";
|
|
5
5
|
import "../../../shared/constants.js";
|
|
6
6
|
import { Grid as b } from "../../Common/Grid/Grid.js";
|
|
7
|
-
import "
|
|
7
|
+
import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
8
|
+
import { DatePickerField as p } from "../../Common/Fields/DatePickerField/DatePickerField.js";
|
|
8
9
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
10
|
import "react";
|
|
10
11
|
import { removeNonDigits as S, addressInline as g } from "../../../helpers/formattedStrings.js";
|
|
11
12
|
import { usePlaceholderSSN as h, normalizeSSN as N } from "../../../helpers/ssn.js";
|
|
12
13
|
import { SSN_REGEX as D, nameValidation as m } from "../../../helpers/validations.js";
|
|
13
|
-
import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
14
14
|
import { SelectField as I } from "../../Common/Fields/SelectField/SelectField.js";
|
|
15
|
-
import { DatePickerField as p } from "../../Common/Fields/DatePickerField/DatePickerField.js";
|
|
16
15
|
const v = t.object({
|
|
17
16
|
firstName: m,
|
|
18
17
|
middleInitial: t.string().optional(),
|
|
19
18
|
lastName: m
|
|
20
19
|
});
|
|
21
|
-
function
|
|
20
|
+
function z() {
|
|
22
21
|
const { t: e } = s("Employee.Profile");
|
|
23
22
|
return /* @__PURE__ */ l(d, { children: [
|
|
24
23
|
/* @__PURE__ */ l(b, { gap: { base: 20, small: 8 }, gridTemplateColumns: { base: "1fr", small: ["1fr", 200] }, children: [
|
|
@@ -49,7 +48,7 @@ const O = t.object({
|
|
|
49
48
|
startDate: t.date().transform((e) => e.toISOString().split("T")[0]),
|
|
50
49
|
email: t.string().email()
|
|
51
50
|
});
|
|
52
|
-
function
|
|
51
|
+
function G({ companyLocations: e }) {
|
|
53
52
|
const { t: r } = s("Employee.Profile"), {
|
|
54
53
|
formState: { errors: n }
|
|
55
54
|
} = c();
|
|
@@ -96,7 +95,7 @@ const R = t.object({
|
|
|
96
95
|
ssn: t.string().transform((e) => S(e)).refine((e) => D.test(e)),
|
|
97
96
|
enableSsn: t.boolean()
|
|
98
97
|
});
|
|
99
|
-
function
|
|
98
|
+
function V({ employee: e, onChange: r }) {
|
|
100
99
|
const { setValue: n } = c(), { t: i } = s("Employee.Profile"), u = h(e?.hasSsn);
|
|
101
100
|
return /* @__PURE__ */ a(
|
|
102
101
|
o,
|
|
@@ -116,7 +115,7 @@ function X({ employee: e, onChange: r }) {
|
|
|
116
115
|
const y = t.object({
|
|
117
116
|
dateOfBirth: t.date().transform((e) => e.toISOString().split("T")[0])
|
|
118
117
|
});
|
|
119
|
-
function
|
|
118
|
+
function X() {
|
|
120
119
|
const { t: e } = s("Employee.Profile");
|
|
121
120
|
return /* @__PURE__ */ a(
|
|
122
121
|
p,
|
|
@@ -133,13 +132,13 @@ v.merge(O).merge(R).merge(y).extend({
|
|
|
133
132
|
enableSsn: t.boolean()
|
|
134
133
|
});
|
|
135
134
|
export {
|
|
136
|
-
|
|
135
|
+
G as AdminInputs,
|
|
137
136
|
O as AdminInputsSchema,
|
|
138
|
-
|
|
137
|
+
X as DateOfBirthInput,
|
|
139
138
|
y as DateOfBirthSchema,
|
|
140
|
-
|
|
139
|
+
z as NameInputs,
|
|
141
140
|
v as NameInputsSchema,
|
|
142
|
-
|
|
141
|
+
V as SocialSecurityNumberInput,
|
|
143
142
|
R as SocialSecurityNumberSchema
|
|
144
143
|
};
|
|
145
144
|
//# sourceMappingURL=PersonalDetailsInputs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PersonalDetailsInputs.js","sources":["../../../../src/components/Employee/Profile/PersonalDetailsInputs.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useFormContext } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { type Employee } from '@gusto/embedded-api/models/components/employee'\nimport { SelectField, TextInputField, Grid, DatePickerField } from '@/components/Common'\nimport { addressInline, removeNonDigits } from '@/helpers/formattedStrings'\nimport { normalizeSSN, usePlaceholderSSN } from '@/helpers/ssn'\nimport { nameValidation, SSN_REGEX } from '@/helpers/validations'\n\nexport const NameInputsSchema = z.object({\n firstName: nameValidation,\n middleInitial: z.string().optional(),\n lastName: nameValidation,\n})\n\nexport function NameInputs() {\n const { t } = useTranslation('Employee.Profile')\n\n return (\n <>\n <Grid gap={{ base: 20, small: 8 }} gridTemplateColumns={{ base: '1fr', small: ['1fr', 200] }}>\n <TextInputField\n name=\"firstName\"\n isRequired\n label={t('firstName')}\n errorMessage={t('validations.firstName')}\n />\n <TextInputField name=\"middleInitial\" label={t('middleInitial')} />\n </Grid>\n <TextInputField\n name=\"lastName\"\n isRequired\n label={t('lastName')}\n errorMessage={t('validations.lastName')}\n />\n </>\n )\n}\n\nexport const AdminInputsSchema = z.object({\n workAddress: z.string().min(1),\n startDate: z.date().transform(date => date.toISOString().split('T')[0]),\n email: z.string().email(),\n})\n\ntype AdminInputsSchemaType = z.infer<typeof AdminInputsSchema>\n\ninterface AdminInputsProps {\n companyLocations: Location[]\n}\n\nexport function AdminInputs({ companyLocations }: AdminInputsProps) {\n const { t } = useTranslation('Employee.Profile')\n const {\n formState: { errors },\n } = useFormContext<AdminInputsSchemaType>()\n\n return (\n <>\n <SelectField\n name=\"workAddress\"\n options={companyLocations.map(location => ({\n value: location.uuid,\n label: addressInline(location),\n }))}\n label={t('workAddress')}\n description={t('workAddressDescription')}\n placeholder={t('workAddressPlaceholder')}\n errorMessage={t('validations.location', { ns: 'common' })}\n isRequired\n />\n <DatePickerField\n name=\"startDate\"\n label={t('startDateLabel')}\n description={t('startDateDescription')}\n isRequired\n errorMessage={\n errors.startDate?.type === 'custom'\n ? t('validations.startDateOutOfRange')\n : t('validations.startDate')\n }\n />\n <TextInputField\n name=\"email\"\n label={t('email')}\n description={t('emailDescription')}\n errorMessage={t('validations.email')}\n isRequired\n type=\"email\"\n />\n </>\n )\n}\n\nexport const SocialSecurityNumberSchema = z.object({\n ssn: z\n .string()\n .transform(input => removeNonDigits(input))\n .refine(input => SSN_REGEX.test(input)),\n enableSsn: z.boolean(),\n})\n\ntype SocialSecurityNumberSchemaType = z.infer<typeof SocialSecurityNumberSchema>\n\ninterface SocialSecurityNumberInputProps {\n employee?: Employee\n onChange?: (updatedValue: string) => void\n}\n\nexport function SocialSecurityNumberInput({ employee, onChange }: SocialSecurityNumberInputProps) {\n const { setValue } = useFormContext<SocialSecurityNumberSchemaType>()\n const { t } = useTranslation('Employee.Profile')\n const placeholderSSN = usePlaceholderSSN(employee?.hasSsn)\n return (\n <TextInputField\n isRequired\n name=\"ssn\"\n label={t('ssnLabel')}\n errorMessage={t('validations.ssn', { ns: 'common' })}\n placeholder={placeholderSSN}\n transform={normalizeSSN}\n onChange={updatedValue => {\n setValue('enableSsn', true)\n onChange?.(updatedValue)\n }}\n />\n )\n}\n\nexport const DateOfBirthSchema = z.object({\n dateOfBirth: z.date().transform(date => date.toISOString().split('T')[0]),\n})\n\nexport function DateOfBirthInput() {\n const { t } = useTranslation('Employee.Profile')\n return (\n <DatePickerField\n name=\"dateOfBirth\"\n label={t('dobLabel')}\n isRequired\n errorMessage={t('validations.dob', { ns: 'common' })}\n />\n )\n}\n\n// All possible inputs for PersonalDetails forms\nconst PersonalDetailsTotalSchema = NameInputsSchema.merge(AdminInputsSchema)\n .merge(SocialSecurityNumberSchema)\n .merge(DateOfBirthSchema)\n .extend({\n selfOnboarding: z.boolean(),\n enableSsn: z.boolean(),\n })\n\ntype NullableDatesMapper<Source> = {\n [Property in keyof Source]: Source[Property] extends Date\n ? Source[Property] | null\n : Source[Property]\n}\n\nexport type PersonalDetailsPayload = z.infer<typeof PersonalDetailsTotalSchema>\n\n//Typescript magic to mark date fields as nullable for correct defaultvalues\nexport type PersonalDetailsInputs = NullableDatesMapper<z.input<typeof PersonalDetailsTotalSchema>>\n"],"names":["NameInputsSchema","z","nameValidation","NameInputs","t","useTranslation","jsxs","Fragment","Grid","jsx","TextInputField","AdminInputsSchema","date","AdminInputs","companyLocations","errors","useFormContext","SelectField","location","addressInline","DatePickerField","SocialSecurityNumberSchema","input","removeNonDigits","SSN_REGEX","SocialSecurityNumberInput","employee","onChange","setValue","placeholderSSN","usePlaceholderSSN","normalizeSSN","updatedValue","DateOfBirthSchema","DateOfBirthInput"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PersonalDetailsInputs.js","sources":["../../../../src/components/Employee/Profile/PersonalDetailsInputs.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useFormContext } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { type Employee } from '@gusto/embedded-api/models/components/employee'\nimport { SelectField, TextInputField, Grid, DatePickerField } from '@/components/Common'\nimport { addressInline, removeNonDigits } from '@/helpers/formattedStrings'\nimport { normalizeSSN, usePlaceholderSSN } from '@/helpers/ssn'\nimport { nameValidation, SSN_REGEX } from '@/helpers/validations'\n\nexport const NameInputsSchema = z.object({\n firstName: nameValidation,\n middleInitial: z.string().optional(),\n lastName: nameValidation,\n})\n\nexport function NameInputs() {\n const { t } = useTranslation('Employee.Profile')\n\n return (\n <>\n <Grid gap={{ base: 20, small: 8 }} gridTemplateColumns={{ base: '1fr', small: ['1fr', 200] }}>\n <TextInputField\n name=\"firstName\"\n isRequired\n label={t('firstName')}\n errorMessage={t('validations.firstName')}\n />\n <TextInputField name=\"middleInitial\" label={t('middleInitial')} />\n </Grid>\n <TextInputField\n name=\"lastName\"\n isRequired\n label={t('lastName')}\n errorMessage={t('validations.lastName')}\n />\n </>\n )\n}\n\nexport const AdminInputsSchema = z.object({\n workAddress: z.string().min(1),\n startDate: z.date().transform(date => date.toISOString().split('T')[0]),\n email: z.string().email(),\n})\n\ntype AdminInputsSchemaType = z.infer<typeof AdminInputsSchema>\n\ninterface AdminInputsProps {\n companyLocations: Location[]\n}\n\nexport function AdminInputs({ companyLocations }: AdminInputsProps) {\n const { t } = useTranslation('Employee.Profile')\n const {\n formState: { errors },\n } = useFormContext<AdminInputsSchemaType>()\n\n return (\n <>\n <SelectField\n name=\"workAddress\"\n options={companyLocations.map(location => ({\n value: location.uuid,\n label: addressInline(location),\n }))}\n label={t('workAddress')}\n description={t('workAddressDescription')}\n placeholder={t('workAddressPlaceholder')}\n errorMessage={t('validations.location', { ns: 'common' })}\n isRequired\n />\n <DatePickerField\n name=\"startDate\"\n label={t('startDateLabel')}\n description={t('startDateDescription')}\n isRequired\n errorMessage={\n errors.startDate?.type === 'custom'\n ? t('validations.startDateOutOfRange')\n : t('validations.startDate')\n }\n />\n <TextInputField\n name=\"email\"\n label={t('email')}\n description={t('emailDescription')}\n errorMessage={t('validations.email')}\n isRequired\n type=\"email\"\n />\n </>\n )\n}\n\nexport const SocialSecurityNumberSchema = z.object({\n ssn: z\n .string()\n .transform(input => removeNonDigits(input))\n .refine(input => SSN_REGEX.test(input)),\n enableSsn: z.boolean(),\n})\n\ntype SocialSecurityNumberSchemaType = z.infer<typeof SocialSecurityNumberSchema>\n\ninterface SocialSecurityNumberInputProps {\n employee?: Employee\n onChange?: (updatedValue: string) => void\n}\n\nexport function SocialSecurityNumberInput({ employee, onChange }: SocialSecurityNumberInputProps) {\n const { setValue } = useFormContext<SocialSecurityNumberSchemaType>()\n const { t } = useTranslation('Employee.Profile')\n const placeholderSSN = usePlaceholderSSN(employee?.hasSsn)\n return (\n <TextInputField\n isRequired\n name=\"ssn\"\n label={t('ssnLabel')}\n errorMessage={t('validations.ssn', { ns: 'common' })}\n placeholder={placeholderSSN}\n transform={normalizeSSN}\n onChange={updatedValue => {\n setValue('enableSsn', true)\n onChange?.(updatedValue)\n }}\n />\n )\n}\n\nexport const DateOfBirthSchema = z.object({\n dateOfBirth: z.date().transform(date => date.toISOString().split('T')[0]),\n})\n\nexport function DateOfBirthInput() {\n const { t } = useTranslation('Employee.Profile')\n return (\n <DatePickerField\n name=\"dateOfBirth\"\n label={t('dobLabel')}\n isRequired\n errorMessage={t('validations.dob', { ns: 'common' })}\n />\n )\n}\n\n// All possible inputs for PersonalDetails forms\nconst PersonalDetailsTotalSchema = NameInputsSchema.merge(AdminInputsSchema)\n .merge(SocialSecurityNumberSchema)\n .merge(DateOfBirthSchema)\n .extend({\n selfOnboarding: z.boolean(),\n enableSsn: z.boolean(),\n })\n\ntype NullableDatesMapper<Source> = {\n [Property in keyof Source]: Source[Property] extends Date\n ? Source[Property] | null\n : Source[Property]\n}\n\nexport type PersonalDetailsPayload = z.infer<typeof PersonalDetailsTotalSchema>\n\n//Typescript magic to mark date fields as nullable for correct defaultvalues\nexport type PersonalDetailsInputs = NullableDatesMapper<z.input<typeof PersonalDetailsTotalSchema>>\n"],"names":["NameInputsSchema","z","nameValidation","NameInputs","t","useTranslation","jsxs","Fragment","Grid","jsx","TextInputField","AdminInputsSchema","date","AdminInputs","companyLocations","errors","useFormContext","SelectField","location","addressInline","DatePickerField","SocialSecurityNumberSchema","input","removeNonDigits","SSN_REGEX","SocialSecurityNumberInput","employee","onChange","setValue","placeholderSSN","usePlaceholderSSN","normalizeSSN","updatedValue","DateOfBirthSchema","DateOfBirthInput"],"mappings":";;;;;;;;;;;;;;AAUO,MAAMA,IAAmBC,EAAE,OAAO;AAAA,EACvC,WAAWC;AAAA,EACX,eAAeD,EAAE,OAAA,EAAS,SAAA;AAAA,EAC1B,UAAUC;AACZ,CAAC;AAEM,SAASC,IAAa;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kBAAkB;AAE/C,SACE,gBAAAC,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAD,EAACE,KAAK,KAAK,EAAE,MAAM,IAAI,OAAO,EAAA,GAAK,qBAAqB,EAAE,MAAM,OAAO,OAAO,CAAC,OAAO,GAAG,KACvF,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,YAAU;AAAA,UACV,OAAON,EAAE,WAAW;AAAA,UACpB,cAAcA,EAAE,uBAAuB;AAAA,QAAA;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EM,SAASsB,IAAmB;AACjC,QAAM,EAAE,GAAA9B,EAAA,IAAMC,EAAe,kBAAkB;AAC/C,SACE,gBAAAI;AAAA,IAACW;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,OAAOhB,EAAE,UAAU;AAAA,MACnB,YAAU;AAAA,MACV,cAAcA,EAAE,mBAAmB,EAAE,IAAI,UAAU;AAAA,IAAA;AAAA,EAAA;AAGzD;AAGmCJ,EAAiB,MAAMW,CAAiB,EACxE,MAAMU,CAA0B,EAChC,MAAMY,CAAiB,EACvB,OAAO;AAAA,EACN,gBAAgBhC,EAAE,QAAA;AAAA,EAClB,WAAWA,EAAE,QAAA;AACf,CAAC;"}
|
|
@@ -11,9 +11,9 @@ import { useEmployeeAddressesUpdateMutation as we } from "@gusto/embedded-api/re
|
|
|
11
11
|
import { useEmployeeAddressesUpdateWorkAddressMutation as Me } from "@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress";
|
|
12
12
|
import { useEmployeesUpdateMutation as Be } from "@gusto/embedded-api/react-query/employeesUpdate";
|
|
13
13
|
import { useEmployeeAddressesGetWorkAddressesSuspense as Ce } from "@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses";
|
|
14
|
-
import { useEmployeeAddressesCreateWorkAddressMutation as
|
|
14
|
+
import { useEmployeeAddressesCreateWorkAddressMutation as Le } from "@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress";
|
|
15
15
|
import { RFCDate as v } from "@gusto/embedded-api/types/rfcdate";
|
|
16
|
-
import { useEmployeesUpdateOnboardingStatusMutation as
|
|
16
|
+
import { useEmployeesUpdateOnboardingStatusMutation as Re } from "@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus";
|
|
17
17
|
import { AdminPersonalDetailsSchema as T, AdminSelfOnboardingPersonalDetailsSchema as ke, AdminPersonalDetails as We } from "./AdminPersonalDetails.js";
|
|
18
18
|
import { SelfPersonalDetailsSchema as ve, SelfPersonalDetails as Te } from "./SelfPersonalDetails.js";
|
|
19
19
|
import { Head as Ge } from "./Head.js";
|
|
@@ -66,10 +66,10 @@ const g = (r) => r?.onboarded || r?.onboardingStatus === i.ONBOARDING_COMPLETED
|
|
|
66
66
|
children: b,
|
|
67
67
|
className: F = "",
|
|
68
68
|
defaultValues: s
|
|
69
|
-
} = y, { onEvent: n, baseSubmitHandler: V } = Ke(), [Y, N] = W(T), [z, _] = W(G), { data: x } = Pe({ companyId: l }), j = x.
|
|
69
|
+
} = y, { onEvent: n, baseSubmitHandler: V } = Ke(), [Y, N] = W(T), [z, _] = W(G), { data: x } = Pe({ companyId: l }), j = x.companyLocationsList, { mutateAsync: K, isPending: J } = be(), { mutateAsync: Q, isPending: X } = Be(), { mutateAsync: Z, isPending: $ } = Le(), { mutateAsync: ee, isPending: re } = Me(), { mutateAsync: te, isPending: oe } = Ie(), { mutateAsync: se, isPending: ne } = we(), {
|
|
70
70
|
mutateAsync: de,
|
|
71
71
|
isPending: ie
|
|
72
|
-
} =
|
|
72
|
+
} = Re(), I = { employee: u, workAddresses: P }, ae = Ye(H), me = I.workAddresses?.find((c) => c.active), e = he({
|
|
73
73
|
employee: I.employee,
|
|
74
74
|
homeAddress: ae,
|
|
75
75
|
workAddress: me
|
|
@@ -158,7 +158,7 @@ const g = (r) => r?.onboarded || r?.onboardingStatus === i.ONBOARDING_COMPLETED
|
|
|
158
158
|
e.current.employee
|
|
159
159
|
);
|
|
160
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:
|
|
161
|
+
const { street1: o, street2: E, city: B, state: C, zip: L, courtesyWithholding: R } = a;
|
|
162
162
|
if (e.current.homeAddress) {
|
|
163
163
|
const { employeeAddress: f } = await se({
|
|
164
164
|
request: {
|
|
@@ -169,8 +169,8 @@ const g = (r) => r?.onboarded || r?.onboardingStatus === i.ONBOARDING_COMPLETED
|
|
|
169
169
|
street2: E,
|
|
170
170
|
city: B,
|
|
171
171
|
state: C,
|
|
172
|
-
zip:
|
|
173
|
-
courtesyWithholding:
|
|
172
|
+
zip: L,
|
|
173
|
+
courtesyWithholding: R
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
});
|
|
@@ -184,8 +184,8 @@ const g = (r) => r?.onboarded || r?.onboardingStatus === i.ONBOARDING_COMPLETED
|
|
|
184
184
|
street2: E,
|
|
185
185
|
city: B,
|
|
186
186
|
state: C,
|
|
187
|
-
zip:
|
|
188
|
-
courtesyWithholding:
|
|
187
|
+
zip: L,
|
|
188
|
+
courtesyWithholding: R
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
});
|
|
@@ -250,7 +250,7 @@ const g = (r) => r?.onboarded || r?.onboardingStatus === i.ONBOARDING_COMPLETED
|
|
|
250
250
|
] }) }) })
|
|
251
251
|
}
|
|
252
252
|
) });
|
|
253
|
-
},
|
|
253
|
+
}, Rr = () => {
|
|
254
254
|
const { companyId: r, employeeId: m, onEvent: p, isAdmin: y, defaultValues: l, isSelfOnboardingEnabled: u } = Xe();
|
|
255
255
|
return /* @__PURE__ */ t(
|
|
256
256
|
$e,
|
|
@@ -266,6 +266,6 @@ const g = (r) => r?.onboarded || r?.onboardingStatus === i.ONBOARDING_COMPLETED
|
|
|
266
266
|
};
|
|
267
267
|
export {
|
|
268
268
|
$e as Profile,
|
|
269
|
-
|
|
269
|
+
Rr as ProfileContextual
|
|
270
270
|
};
|
|
271
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 {\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwFO,SAASA,GAAQC,GAA8C;AACpE,SACE,gBAAAC,EAACC,MAAe,GAAGF,GAChB,YAAM,aACL,gBAAAC,EAACE,IAAA,EAAkB,GAA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AA;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;"}
|
|
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.companyLocationsList!\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwFO,SAASA,GAAQC,GAA8C;AACpE,SACE,gBAAAC,EAACC,MAAe,GAAGF,GAChB,YAAM,aACL,gBAAAC,EAACE,IAAA,EAAkB,GAAGH,GAAO,YAAYA,EAAM,YAC5C,UAAAA,EAAM,UACT,IAEA,gBAAAC,EAACG,KAAM,GAAGJ,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CAErC;AAEJ;AAGA,SAASG,GAAiB,EAAE,YAAAE,GAAY,GAAGL,KAAmD;AAC5F,QAAM;AAAA,IACJ,MAAM,EAAE,UAAAM,EAAA;AAAA,EAAS,IACfC,GAAwB,EAAE,YAAAF,GAAY,GACpC;AAAA,IACJ,MAAM,EAAE,qBAAAG,EAAA;AAAA,EAAoB,IAC1BC,GAAgC,EAAE,YAAAJ,GAAY,GAC5C;AAAA,IACJ,MAAM,EAAE,2BAAAK,EAAA;AAAA,EAA0B,IAChCC,GAA6C,EAAE,YAAAN,GAAY;AAC/D,SACE,gBAAAJ;AAAA,IAACG;AAAA,IAAA;AAAA,MACE,GAAGJ;AAAA,MACJ,UAAAM;AAAA,MACA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AA,QAC1B,cAAAwB;AAAA,QACA,SAAArF;AAAA,QACA,yBAAAC;AAAA,QACA,4BAA4BH,EAAgCoD,EAAW,QAAQ,QAAQ;AAAA,QACvF,WACEtB,KACAM,MACAG,MACAG,MACAf,KACAM,KACAY;AAAA,MAAA;AAAA,MAGJ,UAAA,gBAAAxD,EAACoG,IAAA,EAAc,GAAG/B,GAChB,UAAA,gBAAArE,EAACqG,IAAA,EAAK,UAAU5B,GAAaO,EAAQ,GAClC,UAAA3D,KAGC,gBAAAiF,EAAAC,IAAA,EACE,UAAA;AAAA,QAAA,gBAAAD,EAACE,IAAA,EAAK,qBAAoB,OAAM,KAAK,IACnC,UAAA;AAAA,UAAA,gBAAAxG,EAACyG,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,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;"}
|
|
@@ -9,12 +9,13 @@ import "../../Base/useBase.js";
|
|
|
9
9
|
import "../../../shared/constants.js";
|
|
10
10
|
import "classnames";
|
|
11
11
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
|
+
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
12
13
|
import "dompurify";
|
|
13
14
|
import "../../../contexts/LocaleProvider/useLocale.js";
|
|
14
15
|
import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
|
|
15
|
-
const [
|
|
16
|
+
const [u, a] = o("ProfileContext");
|
|
16
17
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
a as ProfileProvider,
|
|
19
|
+
u as useProfile
|
|
19
20
|
};
|
|
20
21
|
//# 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 hasCompletedSelfOnboarding: 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;"}
|
|
@@ -4,10 +4,12 @@ import { BaseComponentInterface } from '../../Base';
|
|
|
4
4
|
export interface SelfOnboardingFlowProps extends BaseComponentInterface {
|
|
5
5
|
companyId: string;
|
|
6
6
|
employeeId: string;
|
|
7
|
+
withEmployeeI9?: boolean;
|
|
7
8
|
}
|
|
8
9
|
export interface SelfOnboardingContextInterface extends FlowContextInterface {
|
|
9
10
|
companyId: string;
|
|
10
11
|
employeeId: string;
|
|
12
|
+
withEmployeeI9?: boolean;
|
|
11
13
|
paymentMethod?: PaymentMethodBankAccount;
|
|
12
14
|
}
|
|
13
15
|
export declare function Landing(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,3 +18,4 @@ export declare function FederalTaxes(): import("react/jsx-runtime").JSX.Element;
|
|
|
16
18
|
export declare function StateTaxes(): import("react/jsx-runtime").JSX.Element;
|
|
17
19
|
export declare function PaymentMethod(): import("react/jsx-runtime").JSX.Element;
|
|
18
20
|
export declare function OnboardingSummary(): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function DocumentSigner(): import("react/jsx-runtime").JSX.Element;
|