@gusto/embedded-react-sdk 0.27.0 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +58 -0
- package/dist/components/Common/DataView/DataCards/DataCards.d.ts +4 -2
- package/dist/components/Common/DataView/DataCards/DataCards.js +52 -32
- package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
- package/dist/components/Common/DataView/DataTable/DataTable.d.ts +3 -2
- package/dist/components/Common/DataView/DataTable/DataTable.js +68 -53
- package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
- package/dist/components/Common/DataView/DataView.d.ts +4 -2
- package/dist/components/Common/DataView/DataView.js +28 -18
- package/dist/components/Common/DataView/DataView.js.map +1 -1
- package/dist/components/Common/DataView/useDataView.d.ts +6 -1
- package/dist/components/Common/DataView/useDataView.js +34 -19
- package/dist/components/Common/DataView/useDataView.js.map +1 -1
- package/dist/components/Common/Fields/PercentageField/PercentageField.d.ts +8 -0
- package/dist/components/Common/Fields/PercentageField/PercentageField.js +58 -0
- package/dist/components/Common/Fields/PercentageField/PercentageField.js.map +1 -0
- package/dist/components/Common/Fields/PercentageField/index.d.ts +2 -0
- package/dist/components/Common/SignatureForm/SignatureForm.js +11 -12
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +3 -4
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +7 -8
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/TaxInputs/TaxInputs.js +125 -98
- package/dist/components/Common/TaxInputs/TaxInputs.js.map +1 -1
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Common/UI/Card/Card.d.ts +1 -1
- package/dist/components/Common/UI/Card/Card.js +10 -20
- package/dist/components/Common/UI/Card/Card.js.map +1 -1
- package/dist/components/Common/UI/Card/CardTypes.d.ts +4 -4
- package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
- package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
- package/dist/components/Common/UI/Tabs/Tabs.module.scss.js +5 -5
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +3 -4
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +2 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +17 -16
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -5
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +2 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +6 -5
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -5
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -7
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +6 -6
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +5 -6
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -5
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +2 -3
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +6 -7
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -6
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +2 -3
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +2 -2
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -5
- 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 +3 -5
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +6 -7
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -2
- package/dist/components/Company/FederalTaxes/Form.js +3 -4
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -10
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +7 -8
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +6 -8
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +2 -3
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +6 -7
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +6 -5
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +2 -2
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -5
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +6 -7
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +39 -56
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -5
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +2 -3
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +2 -3
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -2
- package/dist/components/Company/OnboardingOverview/context.js +3 -5
- 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/Actions.js +2 -3
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +24 -23
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +8 -9
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +11 -12
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +5 -7
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +2 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +60 -67
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/index.d.ts +2 -0
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +2 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +2 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -5
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/index.d.ts +2 -0
- package/dist/components/Company/index.d.ts +2 -0
- package/dist/components/Company/index.js +21 -17
- package/dist/components/Company/index.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +2 -2
- package/dist/components/Contractor/Address/Form.js +11 -10
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +5 -7
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +17 -17
- package/dist/components/Contractor/ContractorList/useContractorList.d.ts +8 -8
- package/dist/components/Contractor/ContractorList/useContractorList.js +9 -25
- package/dist/components/Contractor/ContractorList/useContractorList.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +11 -12
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -2
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +2 -3
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +23 -22
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +7 -8
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +1 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +38 -24
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +1 -0
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +95 -60
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +2 -3
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +6 -7
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +2 -3
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +67 -42
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.d.ts +3 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +40 -36
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/types.d.ts +2 -0
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
- package/dist/components/Contractor/Profile/useContractorProfile.js +2 -3
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +1 -1
- package/dist/components/Employee/Compensation/Actions.js +1 -1
- package/dist/components/Employee/Compensation/Edit.js +14 -14
- package/dist/components/Employee/Compensation/List.js +22 -23
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +10 -12
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +11 -13
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +11 -13
- 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 +3 -2
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +2 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -5
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -5
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +6 -7
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +77 -95
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +2 -3
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +12 -12
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +3 -5
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Actions.js +5 -6
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +11 -12
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +3 -5
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +8 -8
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +3 -3
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +6 -6
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +2 -2
- package/dist/components/Employee/PaymentMethod/Split.js +9 -9
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +5 -7
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/Actions.js +5 -6
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +5 -6
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +10 -9
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +3 -3
- package/dist/components/Employee/Profile/useProfile.js +3 -5
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/Actions.js +5 -6
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +3 -5
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +6 -7
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +13 -14
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +3 -5
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Flow/Flow.js +2 -3
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +16 -16
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +20 -20
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +9 -9
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.js +11 -12
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +2 -3
- 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/PayrollConfigurationPresentation.js +3 -2
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +50 -68
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +39 -38
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +17 -18
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +2 -3
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +2 -3
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +3 -2
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +2 -3
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +2 -3
- 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 +2 -3
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +5 -7
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +2 -4
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/helpers/formattedStrings.js +11 -12
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/helpers/percentageConversion.d.ts +3 -0
- package/dist/helpers/percentageConversion.js +27 -0
- package/dist/helpers/percentageConversion.js.map +1 -0
- package/dist/helpers/percentageConversion.test.d.ts +1 -0
- package/dist/hooks/usePagination/usePagination.d.ts +15 -0
- package/dist/hooks/usePagination/usePagination.js +37 -0
- package/dist/hooks/usePagination/usePagination.js.map +1 -0
- package/dist/hooks/usePagination/usePagination.test.d.ts +1 -0
- package/dist/i18n/en/Company.StateTaxes.json.js +1 -1
- package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js +28 -28
- package/dist/i18n/en/InformationRequests.InformationRequestList.json.js +18 -16
- package/dist/i18n/en/InformationRequests.InformationRequestList.json.js.map +1 -1
- package/dist/i18n/en/common.json.d.ts +3 -1
- package/dist/i18n/en/common.json.js +1 -1
- package/dist/shared/constants.d.ts +2 -0
- package/dist/shared/constants.js +11 -10
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +8 -0
- package/package.json +9 -9
|
@@ -6,22 +6,21 @@ import { z as n } from "zod";
|
|
|
6
6
|
import { AdminInputsSchema as y, SocialSecurityNumberSchema as D, DateOfBirthSchema as c, NameInputsSchema as x, NameInputs as A, AdminInputs as I, SocialSecurityNumberInput as F, DateOfBirthInput as N } from "./PersonalDetailsInputs.js";
|
|
7
7
|
import P from "./AdminPersonalDetails.module.scss.js";
|
|
8
8
|
import { useProfile as C } from "./useProfile.js";
|
|
9
|
-
import "../../../shared/constants.js";
|
|
10
9
|
import "classnames";
|
|
11
|
-
import { SwitchField as w } from "../../Common/Fields/SwitchField/SwitchField.js";
|
|
12
10
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
|
+
import { SwitchField as w } from "../../Common/Fields/SwitchField/SwitchField.js";
|
|
13
12
|
const d = y.merge(
|
|
14
13
|
x
|
|
15
14
|
).extend({
|
|
16
15
|
selfOnboarding: n.boolean()
|
|
17
|
-
}),
|
|
16
|
+
}), G = n.discriminatedUnion("enableSsn", [
|
|
18
17
|
d.merge(D).merge(c).extend({
|
|
19
18
|
enableSsn: n.literal(!0)
|
|
20
19
|
}),
|
|
21
20
|
d.merge(c).extend({
|
|
22
21
|
enableSsn: n.literal(!1)
|
|
23
22
|
})
|
|
24
|
-
]),
|
|
23
|
+
]), H = () => {
|
|
25
24
|
const {
|
|
26
25
|
companyLocations: f,
|
|
27
26
|
employee: i,
|
|
@@ -49,8 +48,8 @@ const d = y.merge(
|
|
|
49
48
|
] }) : null;
|
|
50
49
|
};
|
|
51
50
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
H as AdminPersonalDetails,
|
|
52
|
+
G as AdminPersonalDetailsSchema,
|
|
54
53
|
d as AdminSelfOnboardingPersonalDetailsSchema
|
|
55
54
|
};
|
|
56
55
|
//# sourceMappingURL=AdminPersonalDetails.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminPersonalDetails.js","sources":["../../../../src/components/Employee/Profile/AdminPersonalDetails.tsx"],"sourcesContent":["import { useEffect } from 'react'\nimport { useFormContext } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport {\n AdminInputs,\n AdminInputsSchema,\n NameInputs,\n NameInputsSchema,\n SocialSecurityNumberInput,\n SocialSecurityNumberSchema,\n DateOfBirthInput,\n DateOfBirthSchema,\n type PersonalDetailsInputs,\n} from './PersonalDetailsInputs'\nimport styles from './AdminPersonalDetails.module.scss'\nimport { useProfile } from './useProfile'\nimport { SwitchField } from '@/components/Common'\n\nexport const AdminSelfOnboardingPersonalDetailsSchema = AdminInputsSchema.merge(\n NameInputsSchema,\n).extend({\n selfOnboarding: z.boolean(),\n})\n\nexport const AdminPersonalDetailsSchema = z.discriminatedUnion('enableSsn', [\n AdminSelfOnboardingPersonalDetailsSchema.merge(SocialSecurityNumberSchema)\n .merge(DateOfBirthSchema)\n .extend({\n enableSsn: z.literal(true),\n }),\n AdminSelfOnboardingPersonalDetailsSchema.merge(DateOfBirthSchema).extend({\n enableSsn: z.literal(false),\n }),\n])\n\nexport const AdminPersonalDetails = () => {\n const {\n companyLocations,\n employee,\n isAdmin,\n isSelfOnboardingEnabled,\n hasCompletedSelfOnboarding,\n } = useProfile()\n const { t } = useTranslation('Employee.Profile')\n const { watch, setValue, getFieldState } = useFormContext<PersonalDetailsInputs>()\n const isSelfOnboardingChecked = watch('selfOnboarding')\n const { isDirty: isSsnDirty } = getFieldState('ssn')\n\n useEffect(() => {\n if (isSelfOnboardingChecked) {\n setValue('enableSsn', false)\n } else {\n setValue('enableSsn', isSsnDirty ? true : !employee?.hasSsn)\n }\n }, [isSelfOnboardingChecked, employee?.hasSsn, isSsnDirty, setValue])\n\n if (!isAdmin) {\n return null\n }\n\n return (\n <>\n {isSelfOnboardingEnabled && !hasCompletedSelfOnboarding && (\n <div className={styles.switchFieldContainer}>\n <SwitchField\n name=\"selfOnboarding\"\n description={t('selfOnboardingDescription')}\n label={t('selfOnboardingLabel')}\n />\n </div>\n )}\n\n <NameInputs />\n <AdminInputs companyLocations={companyLocations} />\n\n {(!isSelfOnboardingChecked || hasCompletedSelfOnboarding) && (\n <>\n <SocialSecurityNumberInput employee={employee} />\n <DateOfBirthInput />\n </>\n )}\n </>\n )\n}\n"],"names":["AdminSelfOnboardingPersonalDetailsSchema","AdminInputsSchema","NameInputsSchema","z","AdminPersonalDetailsSchema","SocialSecurityNumberSchema","DateOfBirthSchema","AdminPersonalDetails","companyLocations","employee","isAdmin","isSelfOnboardingEnabled","hasCompletedSelfOnboarding","useProfile","t","useTranslation","watch","setValue","getFieldState","useFormContext","isSelfOnboardingChecked","isSsnDirty","useEffect","jsxs","Fragment","jsx","styles","SwitchField","NameInputs","AdminInputs","SocialSecurityNumberInput","DateOfBirthInput"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AdminPersonalDetails.js","sources":["../../../../src/components/Employee/Profile/AdminPersonalDetails.tsx"],"sourcesContent":["import { useEffect } from 'react'\nimport { useFormContext } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport {\n AdminInputs,\n AdminInputsSchema,\n NameInputs,\n NameInputsSchema,\n SocialSecurityNumberInput,\n SocialSecurityNumberSchema,\n DateOfBirthInput,\n DateOfBirthSchema,\n type PersonalDetailsInputs,\n} from './PersonalDetailsInputs'\nimport styles from './AdminPersonalDetails.module.scss'\nimport { useProfile } from './useProfile'\nimport { SwitchField } from '@/components/Common'\n\nexport const AdminSelfOnboardingPersonalDetailsSchema = AdminInputsSchema.merge(\n NameInputsSchema,\n).extend({\n selfOnboarding: z.boolean(),\n})\n\nexport const AdminPersonalDetailsSchema = z.discriminatedUnion('enableSsn', [\n AdminSelfOnboardingPersonalDetailsSchema.merge(SocialSecurityNumberSchema)\n .merge(DateOfBirthSchema)\n .extend({\n enableSsn: z.literal(true),\n }),\n AdminSelfOnboardingPersonalDetailsSchema.merge(DateOfBirthSchema).extend({\n enableSsn: z.literal(false),\n }),\n])\n\nexport const AdminPersonalDetails = () => {\n const {\n companyLocations,\n employee,\n isAdmin,\n isSelfOnboardingEnabled,\n hasCompletedSelfOnboarding,\n } = useProfile()\n const { t } = useTranslation('Employee.Profile')\n const { watch, setValue, getFieldState } = useFormContext<PersonalDetailsInputs>()\n const isSelfOnboardingChecked = watch('selfOnboarding')\n const { isDirty: isSsnDirty } = getFieldState('ssn')\n\n useEffect(() => {\n if (isSelfOnboardingChecked) {\n setValue('enableSsn', false)\n } else {\n setValue('enableSsn', isSsnDirty ? true : !employee?.hasSsn)\n }\n }, [isSelfOnboardingChecked, employee?.hasSsn, isSsnDirty, setValue])\n\n if (!isAdmin) {\n return null\n }\n\n return (\n <>\n {isSelfOnboardingEnabled && !hasCompletedSelfOnboarding && (\n <div className={styles.switchFieldContainer}>\n <SwitchField\n name=\"selfOnboarding\"\n description={t('selfOnboardingDescription')}\n label={t('selfOnboardingLabel')}\n />\n </div>\n )}\n\n <NameInputs />\n <AdminInputs companyLocations={companyLocations} />\n\n {(!isSelfOnboardingChecked || hasCompletedSelfOnboarding) && (\n <>\n <SocialSecurityNumberInput employee={employee} />\n <DateOfBirthInput />\n </>\n )}\n </>\n )\n}\n"],"names":["AdminSelfOnboardingPersonalDetailsSchema","AdminInputsSchema","NameInputsSchema","z","AdminPersonalDetailsSchema","SocialSecurityNumberSchema","DateOfBirthSchema","AdminPersonalDetails","companyLocations","employee","isAdmin","isSelfOnboardingEnabled","hasCompletedSelfOnboarding","useProfile","t","useTranslation","watch","setValue","getFieldState","useFormContext","isSelfOnboardingChecked","isSsnDirty","useEffect","jsxs","Fragment","jsx","styles","SwitchField","NameInputs","AdminInputs","SocialSecurityNumberInput","DateOfBirthInput"],"mappings":";;;;;;;;;;;AAmBO,MAAMA,IAA2CC,EAAkB;AAAA,EACxEC;AACF,EAAE,OAAO;AAAA,EACP,gBAAgBC,EAAE,QAAA;AACpB,CAAC,GAEYC,IAA6BD,EAAE,mBAAmB,aAAa;AAAA,EAC1EH,EAAyC,MAAMK,CAA0B,EACtE,MAAMC,CAAiB,EACvB,OAAO;AAAA,IACN,WAAWH,EAAE,QAAQ,EAAI;AAAA,EAAA,CAC1B;AAAA,EACHH,EAAyC,MAAMM,CAAiB,EAAE,OAAO;AAAA,IACvE,WAAWH,EAAE,QAAQ,EAAK;AAAA,EAAA,CAC3B;AACH,CAAC,GAEYI,IAAuB,MAAM;AACxC,QAAM;AAAA,IACJ,kBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,yBAAAC;AAAA,IACA,4BAAAC;AAAA,EAAA,IACEC,EAAA,GACE,EAAE,GAAAC,EAAA,IAAMC,EAAe,kBAAkB,GACzC,EAAE,OAAAC,GAAO,UAAAC,GAAU,eAAAC,EAAA,IAAkBC,EAAA,GACrCC,IAA0BJ,EAAM,gBAAgB,GAChD,EAAE,SAASK,MAAeH,EAAc,KAAK;AAUnD,SARAI,EAAU,MAAM;AACd,IAAIF,IACFH,EAAS,aAAa,EAAK,IAE3BA,EAAS,aAAaI,IAAa,KAAO,CAACZ,GAAU,MAAM;AAAA,EAE/D,GAAG,CAACW,GAAyBX,GAAU,QAAQY,GAAYJ,CAAQ,CAAC,GAE/DP,IAKH,gBAAAa,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAb,KAA2B,CAACC,KAC3B,gBAAAa,EAAC,OAAA,EAAI,WAAWC,EAAO,sBACrB,UAAA,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,aAAab,EAAE,2BAA2B;AAAA,QAC1C,OAAOA,EAAE,qBAAqB;AAAA,MAAA;AAAA,IAAA,GAElC;AAAA,sBAGDc,GAAA,EAAW;AAAA,IACZ,gBAAAH,EAACI,KAAY,kBAAArB,GAAoC;AAAA,KAE/C,CAACY,KAA2BR,MAC5B,gBAAAW,EAAAC,GAAA,EACE,UAAA;AAAA,MAAA,gBAAAC,EAACK,KAA0B,UAAArB,GAAoB;AAAA,wBAC9CsB,GAAA,CAAA,CAAiB;AAAA,IAAA,EAAA,CACpB;AAAA,EAAA,GAEJ,IAxBO;AA0BX;"}
|
|
@@ -5,9 +5,10 @@ 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 "classnames";
|
|
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";
|
|
11
12
|
import { SelectField as T } from "../../Common/Fields/SelectField/SelectField.js";
|
|
12
13
|
import { CheckboxField as A } from "../../Common/Fields/CheckboxField/CheckboxField.js";
|
|
13
14
|
const s = t.object({
|
|
@@ -17,7 +18,7 @@ const s = t.object({
|
|
|
17
18
|
state: t.string().min(1),
|
|
18
19
|
zip: t.string().refine((e) => /(^\d{5}$)|(^\d{5}-\d{4}$)/.test(e)),
|
|
19
20
|
courtesyWithholding: t.boolean()
|
|
20
|
-
}),
|
|
21
|
+
}), k = t.union([
|
|
21
22
|
// Case 1: selfOnboarding is false or undefined
|
|
22
23
|
s.extend({
|
|
23
24
|
selfOnboarding: t.union([t.literal(!1), t.undefined()])
|
|
@@ -26,7 +27,7 @@ const s = t.object({
|
|
|
26
27
|
t.object({
|
|
27
28
|
selfOnboarding: t.literal(!0)
|
|
28
29
|
})
|
|
29
|
-
]),
|
|
30
|
+
]), $ = t.union([
|
|
30
31
|
// Case 1: selfOnboarding is false or undefined
|
|
31
32
|
s.extend({
|
|
32
33
|
selfOnboarding: t.union([t.literal(!1), t.undefined()])
|
|
@@ -35,8 +36,8 @@ const s = t.object({
|
|
|
35
36
|
s.extend({
|
|
36
37
|
selfOnboarding: t.literal(!0)
|
|
37
38
|
})
|
|
38
|
-
]),
|
|
39
|
-
const { t: e } = f("Employee.HomeAddress"), r = C(), { isSelfOnboardingIntended: m, isAdmin: c, hasCompletedSelfOnboarding: h } = b(), { watch:
|
|
39
|
+
]), B = () => {
|
|
40
|
+
const { t: e } = f("Employee.HomeAddress"), r = C(), { isSelfOnboardingIntended: m, isAdmin: c, hasCompletedSelfOnboarding: h } = b(), { watch: p } = g(), u = p("courtesyWithholding");
|
|
40
41
|
return c && m && !h ? null : /* @__PURE__ */ n(a, { children: [
|
|
41
42
|
/* @__PURE__ */ n("div", { children: [
|
|
42
43
|
/* @__PURE__ */ i(r.Heading, { as: "h2", children: e("formTitle") }),
|
|
@@ -116,12 +117,12 @@ const s = t.object({
|
|
|
116
117
|
] })
|
|
117
118
|
}
|
|
118
119
|
),
|
|
119
|
-
|
|
120
|
+
u && /* @__PURE__ */ i(r.Alert, { label: e("withholdingTitle"), status: "warning", children: /* @__PURE__ */ i(d, { t: e, i18nKey: "withholdingNote" }) })
|
|
120
121
|
] });
|
|
121
122
|
};
|
|
122
123
|
export {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
B as HomeAddress,
|
|
125
|
+
k as HomeAddressSchema,
|
|
126
|
+
$ as HomeAddressSchemaWithCompletedOnboarding
|
|
126
127
|
};
|
|
127
128
|
//# 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;AA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IAAA;AAAA,IAEF,gBAAAa;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOnB,EAAE,0BAA0B;AAAA,QACnC,aACE,gBAAAW,EAAAC,GAAA,EACG,UAAA;AAAA,UAAAZ,EAAE,gCAAgC;AAAA,UACnC,gBAAAa;AAAA,YAACO;AAAA,YAAA;AAAA,cACC,GAAApB;AAAA,cACA,SAAQ;AAAA,cACR,YAAY;AAAA,gBACV,eAAe,gBAAAa,EAACX,EAAW,MAAX,CAAA,CAAgB;AAAA,cAAA;AAAA,YAClC;AAAA,UAAA;AAAA,QACF,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,IAGHQ,KACC,gBAAAG,EAACX,EAAW,OAAX,EAAiB,OAAOF,EAAE,kBAAkB,GAAG,QAAO,WACrD,UAAA,gBAAAa,EAACO,GAAA,EAAM,GAAApB,GAAM,SAAQ,mBAAkB,EAAA,CACzC;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -2,16 +2,16 @@ import { jsxs as l, Fragment as d, jsx as a } from "react/jsx-runtime";
|
|
|
2
2
|
import { z as t } from "zod";
|
|
3
3
|
import { useFormContext as c } from "react-hook-form";
|
|
4
4
|
import { useTranslation as s } from "react-i18next";
|
|
5
|
-
import "../../../shared/constants.js";
|
|
6
5
|
import { Grid as b } from "../../Common/Grid/Grid.js";
|
|
7
|
-
import
|
|
8
|
-
import { DatePickerField as p } from "../../Common/Fields/DatePickerField/DatePickerField.js";
|
|
6
|
+
import "classnames";
|
|
9
7
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
8
|
import "react";
|
|
11
9
|
import { removeNonDigits as S, addressInline as g } from "../../../helpers/formattedStrings.js";
|
|
12
10
|
import { usePlaceholderSSN as h, normalizeSSN as N } from "../../../helpers/ssn.js";
|
|
13
11
|
import { SSN_REGEX as D, nameValidation as m } from "../../../helpers/validations.js";
|
|
12
|
+
import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
14
13
|
import { SelectField as I } from "../../Common/Fields/SelectField/SelectField.js";
|
|
14
|
+
import { DatePickerField as p } from "../../Common/Fields/DatePickerField/DatePickerField.js";
|
|
15
15
|
const v = t.object({
|
|
16
16
|
firstName: m,
|
|
17
17
|
middleInitial: t.string().optional(),
|
|
@@ -9,13 +9,11 @@ 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";
|
|
13
12
|
import "dompurify";
|
|
14
|
-
import "../../../contexts/LocaleProvider/useLocale.js";
|
|
15
13
|
import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
14
|
+
const [d, s] = o("ProfileContext");
|
|
17
15
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
s as ProfileProvider,
|
|
17
|
+
d as useProfile
|
|
20
18
|
};
|
|
21
19
|
//# sourceMappingURL=useProfile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProfile.js","sources":["../../../../src/components/Employee/Profile/useProfile.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\n\n//Interface for context passed down to component slots\ntype ProfileContextType = {\n companyLocations: Location[]\n workAddresses?: EmployeeWorkAddress[]\n employee?: Employee\n isSelfOnboardingIntended?: boolean\n isPending: boolean\n isAdmin: boolean\n handleCancel: () => void\n isSelfOnboardingEnabled: boolean\n 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;"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { useStateTaxes as
|
|
4
|
-
import "../../../shared/constants.js";
|
|
2
|
+
import { useTranslation as e } from "react-i18next";
|
|
3
|
+
import { useStateTaxes as r } from "./useStateTaxes.js";
|
|
5
4
|
import "classnames";
|
|
6
5
|
import { ActionsLayout as m } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
7
6
|
import { useComponentContext as s } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
7
|
import "react";
|
|
9
|
-
function
|
|
10
|
-
const { t: o } =
|
|
8
|
+
function l() {
|
|
9
|
+
const { t: o } = e("Employee.StateTaxes"), { isPending: n } = r(), i = s();
|
|
11
10
|
return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(i.Button, { type: "submit", isLoading: n, children: o("submitCta") }) });
|
|
12
11
|
}
|
|
13
12
|
export {
|
|
14
|
-
|
|
13
|
+
l as Actions
|
|
15
14
|
};
|
|
16
15
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/StateTaxes/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxes } from './useStateTaxes'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Employee.StateTaxes')\n const { isPending } = useStateTaxes()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","isPending","useStateTaxes","Components","useComponentContext","jsx","ActionsLayout"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/StateTaxes/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxes } from './useStateTaxes'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Employee.StateTaxes')\n const { isPending } = useStateTaxes()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","isPending","useStateTaxes","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,WAAAC,EAAA,IAAcC,EAAA,GAChBC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAAF,EAAE,WAAW,GAChB,GACF;AAEJ;"}
|
|
@@ -9,13 +9,11 @@ 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";
|
|
13
12
|
import "dompurify";
|
|
14
|
-
import "../../../contexts/LocaleProvider/useLocale.js";
|
|
15
13
|
import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
14
|
+
const [c, d] = t("StateTaxesContext");
|
|
17
15
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
d as StateTaxesProvider,
|
|
17
|
+
c as useStateTaxes
|
|
20
18
|
};
|
|
21
19
|
//# sourceMappingURL=useStateTaxes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStateTaxes.js","sources":["../../../../src/components/Employee/StateTaxes/useStateTaxes.ts"],"sourcesContent":["import type { EmployeeStateTaxesList } from '@gusto/embedded-api/models/components/employeestatetaxeslist'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesContextType = {\n employeeStateTaxes: EmployeeStateTaxesList[]\n isPending: boolean\n isAdmin: boolean\n}\n\nconst [useStateTaxes, StateTaxesProvider] =\n createCompoundContext<StateTaxesContextType>('StateTaxesContext')\nexport { useStateTaxes, StateTaxesProvider }\n"],"names":["useStateTaxes","StateTaxesProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useStateTaxes.js","sources":["../../../../src/components/Employee/StateTaxes/useStateTaxes.ts"],"sourcesContent":["import type { EmployeeStateTaxesList } from '@gusto/embedded-api/models/components/employeestatetaxeslist'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesContextType = {\n employeeStateTaxes: EmployeeStateTaxesList[]\n isPending: boolean\n isAdmin: boolean\n}\n\nconst [useStateTaxes, StateTaxesProvider] =\n createCompoundContext<StateTaxesContextType>('StateTaxesContext')\nexport { useStateTaxes, StateTaxesProvider }\n"],"names":["useStateTaxes","StateTaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AASA,MAAM,CAACA,GAAeC,CAAkB,IACtCC,EAA6C,mBAAmB;"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as r } from "react-i18next";
|
|
3
|
-
import { useTaxes as
|
|
4
|
-
import "../../../shared/constants.js";
|
|
3
|
+
import { useTaxes as s } from "./useTaxes.js";
|
|
5
4
|
import "classnames";
|
|
6
|
-
import { ActionsLayout as
|
|
5
|
+
import { ActionsLayout as m } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
7
6
|
import { useComponentContext as e } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
7
|
import "react";
|
|
9
|
-
const
|
|
10
|
-
const { t } = r("Employee.Taxes"), { isPending: n } =
|
|
11
|
-
return /* @__PURE__ */ o(
|
|
8
|
+
const l = () => {
|
|
9
|
+
const { t } = r("Employee.Taxes"), { isPending: n } = s(), i = e();
|
|
10
|
+
return /* @__PURE__ */ o(m, { children: /* @__PURE__ */ o(i.Button, { type: "submit", isLoading: n, children: t("submitCta") }) });
|
|
12
11
|
};
|
|
13
12
|
export {
|
|
14
|
-
|
|
13
|
+
l as Actions
|
|
15
14
|
};
|
|
16
15
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/Taxes/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useTaxes } from './useTaxes'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Employee.Taxes')\n const { isPending } = useTaxes()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","useTaxes","Components","useComponentContext","jsx","ActionsLayout"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/Taxes/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useTaxes } from './useTaxes'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Employee.Taxes')\n const { isPending } = useTaxes()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","useTaxes","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,EAAA,IAAMC,EAAe,gBAAgB,GACvC,EAAE,WAAAC,EAAA,IAAcC,EAAA,GAChBC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAA,EAAE,WAAW,GAChB,GACF;AAEJ;"}
|
|
@@ -2,15 +2,14 @@ import { jsx as i, jsxs as n, Fragment as a } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTranslation as o, Trans as u } from "react-i18next";
|
|
3
3
|
import { useFormContext as m } from "react-hook-form";
|
|
4
4
|
import { z as t } from "zod";
|
|
5
|
-
import "../../../shared/constants.js";
|
|
6
5
|
import "classnames";
|
|
7
|
-
import {
|
|
8
|
-
import { TextInputField as g } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
9
|
-
import { NumberInputField as l } from "../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
10
|
-
import { useComponentContext as c } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
+
import { useComponentContext as f } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
7
|
import "react";
|
|
12
8
|
import { SelectField as s } from "../../Common/Fields/SelectField/SelectField.js";
|
|
13
|
-
|
|
9
|
+
import { RadioGroupField as g } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
10
|
+
import { NumberInputField as l } from "../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
11
|
+
import { TextInputField as c } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
12
|
+
const h = t.object({
|
|
14
13
|
w4DataType: t.literal("rev_2020_w4"),
|
|
15
14
|
filingStatus: t.string().min(1),
|
|
16
15
|
twoJobs: t.string().min(1),
|
|
@@ -18,18 +17,18 @@ const p = t.object({
|
|
|
18
17
|
otherIncome: t.number().transform(String),
|
|
19
18
|
deductions: t.number().transform(String),
|
|
20
19
|
extraWithholding: t.number().transform(String)
|
|
21
|
-
}),
|
|
20
|
+
}), p = t.object({
|
|
22
21
|
w4DataType: t.literal("pre_2020_w4"),
|
|
23
22
|
filingStatus: t.string().min(1),
|
|
24
23
|
federalWithholdingAllowance: t.number().int(),
|
|
25
24
|
additionalWithholding: t.string()
|
|
26
|
-
}),
|
|
27
|
-
function
|
|
25
|
+
}), D = t.discriminatedUnion("w4DataType", [h, p]);
|
|
26
|
+
function H() {
|
|
28
27
|
const { watch: e } = m();
|
|
29
28
|
return e("w4DataType") === "rev_2020_w4" ? /* @__PURE__ */ i(b, {}) : /* @__PURE__ */ i(S, {});
|
|
30
29
|
}
|
|
31
30
|
function b() {
|
|
32
|
-
const { t: e } = o("Employee.Taxes"), r =
|
|
31
|
+
const { t: e } = o("Employee.Taxes"), r = f(), d = [
|
|
33
32
|
{ value: "Single", label: e("filingStatusSingle") },
|
|
34
33
|
{ value: "Married", label: e("filingStatusMarried") },
|
|
35
34
|
{ value: "Head of Household", label: e("filingStatusHeadOfHousehold") },
|
|
@@ -48,7 +47,7 @@ function b() {
|
|
|
48
47
|
}
|
|
49
48
|
),
|
|
50
49
|
/* @__PURE__ */ i(
|
|
51
|
-
|
|
50
|
+
g,
|
|
52
51
|
{
|
|
53
52
|
name: "twoJobs",
|
|
54
53
|
isRequired: !0,
|
|
@@ -149,7 +148,7 @@ function S() {
|
|
|
149
148
|
}
|
|
150
149
|
),
|
|
151
150
|
/* @__PURE__ */ i(
|
|
152
|
-
|
|
151
|
+
c,
|
|
153
152
|
{
|
|
154
153
|
name: "additionalWithholding",
|
|
155
154
|
label: e("additionalWithholding"),
|
|
@@ -160,7 +159,7 @@ function S() {
|
|
|
160
159
|
] });
|
|
161
160
|
}
|
|
162
161
|
export {
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
H as FederalForm,
|
|
163
|
+
D as FederalFormSchema
|
|
165
164
|
};
|
|
166
165
|
//# sourceMappingURL=FederalForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FederalForm.js","sources":["../../../../src/components/Employee/Taxes/FederalForm.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { useFormContext } from 'react-hook-form'\nimport { z } from 'zod'\nimport { NumberInputField, RadioGroupField, SelectField, TextInputField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nconst Rev2020Schema = z.object({\n w4DataType: z.literal('rev_2020_w4'),\n filingStatus: z.string().min(1),\n twoJobs: z.string().min(1),\n dependentsAmount: z.number().transform(String),\n otherIncome: z.number().transform(String),\n deductions: z.number().transform(String),\n extraWithholding: z.number().transform(String),\n})\n\nconst Pre2020Schema = z.object({\n w4DataType: z.literal('pre_2020_w4'),\n filingStatus: z.string().min(1),\n federalWithholdingAllowance: z.number().int(),\n additionalWithholding: z.string(),\n})\n\nexport const FederalFormSchema = z.discriminatedUnion('w4DataType', [Rev2020Schema, Pre2020Schema])\n\nexport type FederalFormInputs = z.input<typeof FederalFormSchema>\nexport type FederalFormPayload = z.output<typeof FederalFormSchema>\n\nexport function FederalForm() {\n const { watch } = useFormContext<FederalFormInputs>()\n const w4DataType = watch('w4DataType')\n\n if (w4DataType === 'rev_2020_w4') {\n return <Rev2020Form />\n }\n\n return <Pre2020Form />\n}\n\nfunction Rev2020Form() {\n const { t } = useTranslation('Employee.Taxes')\n const Components = useComponentContext()\n\n const filingStatusOptions = [\n { value: 'Single', label: t('filingStatusSingle') },\n { value: 'Married', label: t('filingStatusMarried') },\n { value: 'Head of Household', label: t('filingStatusHeadOfHousehold') },\n { value: 'Exempt from withholding', label: t('filingStatusExemptFromWithholding') },\n ]\n\n return (\n <>\n <SelectField\n name=\"filingStatus\"\n label={t('federalFilingStatus1c')}\n placeholder={t('federalFilingStatusPlaceholder')}\n options={filingStatusOptions}\n isRequired\n errorMessage={t('validations.federalFilingStatus')}\n />\n <RadioGroupField\n name=\"twoJobs\"\n isRequired\n label={t('multipleJobs2c')}\n errorMessage={t('validations.federalTwoJobs')}\n description={\n <Components.Text>\n <Trans\n i18nKey={'includesSpouseExplanation'}\n t={t}\n components={{\n IrsLink: <Components.Link />,\n }}\n />\n </Components.Text>\n }\n options={[\n { value: 'true', label: t('twoJobYesLabel') },\n { value: 'false', label: t('twoJobNoLabel') },\n ]}\n />\n <NumberInputField\n name=\"dependentsAmount\"\n isRequired\n label={t('dependentsTotalIfApplicable')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n <NumberInputField\n name=\"otherIncome\"\n isRequired\n label={t('otherIncome')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n <NumberInputField\n name=\"deductions\"\n isRequired\n label={t('deductions')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n <NumberInputField\n name=\"extraWithholding\"\n isRequired\n label={t('extraWithholding')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n </>\n )\n}\n\nfunction Pre2020Form() {\n const { t } = useTranslation('Employee.Taxes')\n\n const filingStatusOptions = [\n { value: 'Single', label: t('filingStatusSingle') },\n { value: 'Married', label: t('filingStatusMarried') },\n { value: 'Head of Household', label: t('filingStatusHeadOfHousehold') },\n { value: 'Exempt from withholding', label: t('filingStatusExemptFromWithholding') },\n { value: 'Married, but withhold as Single', label: t('filingStatusMarriedWithholdAsSingle') },\n ]\n\n return (\n <>\n <NumberInputField\n name=\"federalWithholdingAllowance\"\n isRequired\n label={t('federalWithholdingAllowance')}\n min={0}\n maximumFractionDigits={0}\n errorMessage={t('fieldIsRequired')}\n />\n <SelectField\n name=\"filingStatus\"\n label={t('filingStatus')}\n placeholder={t('federalFilingStatusPlaceholder')}\n description={t('selectWithholdingDescription')}\n options={filingStatusOptions}\n isRequired\n errorMessage={t('validations.federalFilingStatus')}\n />\n <TextInputField\n name=\"additionalWithholding\"\n label={t('additionalWithholding')}\n type=\"number\"\n errorMessage={t('fieldIsRequired')}\n />\n </>\n )\n}\n"],"names":["Rev2020Schema","z","Pre2020Schema","FederalFormSchema","FederalForm","watch","useFormContext","Rev2020Form","Pre2020Form","t","useTranslation","Components","useComponentContext","filingStatusOptions","jsxs","Fragment","jsx","SelectField","RadioGroupField","Trans","NumberInputField","TextInputField"],"mappings":"
|
|
1
|
+
{"version":3,"file":"FederalForm.js","sources":["../../../../src/components/Employee/Taxes/FederalForm.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { useFormContext } from 'react-hook-form'\nimport { z } from 'zod'\nimport { NumberInputField, RadioGroupField, SelectField, TextInputField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nconst Rev2020Schema = z.object({\n w4DataType: z.literal('rev_2020_w4'),\n filingStatus: z.string().min(1),\n twoJobs: z.string().min(1),\n dependentsAmount: z.number().transform(String),\n otherIncome: z.number().transform(String),\n deductions: z.number().transform(String),\n extraWithholding: z.number().transform(String),\n})\n\nconst Pre2020Schema = z.object({\n w4DataType: z.literal('pre_2020_w4'),\n filingStatus: z.string().min(1),\n federalWithholdingAllowance: z.number().int(),\n additionalWithholding: z.string(),\n})\n\nexport const FederalFormSchema = z.discriminatedUnion('w4DataType', [Rev2020Schema, Pre2020Schema])\n\nexport type FederalFormInputs = z.input<typeof FederalFormSchema>\nexport type FederalFormPayload = z.output<typeof FederalFormSchema>\n\nexport function FederalForm() {\n const { watch } = useFormContext<FederalFormInputs>()\n const w4DataType = watch('w4DataType')\n\n if (w4DataType === 'rev_2020_w4') {\n return <Rev2020Form />\n }\n\n return <Pre2020Form />\n}\n\nfunction Rev2020Form() {\n const { t } = useTranslation('Employee.Taxes')\n const Components = useComponentContext()\n\n const filingStatusOptions = [\n { value: 'Single', label: t('filingStatusSingle') },\n { value: 'Married', label: t('filingStatusMarried') },\n { value: 'Head of Household', label: t('filingStatusHeadOfHousehold') },\n { value: 'Exempt from withholding', label: t('filingStatusExemptFromWithholding') },\n ]\n\n return (\n <>\n <SelectField\n name=\"filingStatus\"\n label={t('federalFilingStatus1c')}\n placeholder={t('federalFilingStatusPlaceholder')}\n options={filingStatusOptions}\n isRequired\n errorMessage={t('validations.federalFilingStatus')}\n />\n <RadioGroupField\n name=\"twoJobs\"\n isRequired\n label={t('multipleJobs2c')}\n errorMessage={t('validations.federalTwoJobs')}\n description={\n <Components.Text>\n <Trans\n i18nKey={'includesSpouseExplanation'}\n t={t}\n components={{\n IrsLink: <Components.Link />,\n }}\n />\n </Components.Text>\n }\n options={[\n { value: 'true', label: t('twoJobYesLabel') },\n { value: 'false', label: t('twoJobNoLabel') },\n ]}\n />\n <NumberInputField\n name=\"dependentsAmount\"\n isRequired\n label={t('dependentsTotalIfApplicable')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n <NumberInputField\n name=\"otherIncome\"\n isRequired\n label={t('otherIncome')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n <NumberInputField\n name=\"deductions\"\n isRequired\n label={t('deductions')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n <NumberInputField\n name=\"extraWithholding\"\n isRequired\n label={t('extraWithholding')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n </>\n )\n}\n\nfunction Pre2020Form() {\n const { t } = useTranslation('Employee.Taxes')\n\n const filingStatusOptions = [\n { value: 'Single', label: t('filingStatusSingle') },\n { value: 'Married', label: t('filingStatusMarried') },\n { value: 'Head of Household', label: t('filingStatusHeadOfHousehold') },\n { value: 'Exempt from withholding', label: t('filingStatusExemptFromWithholding') },\n { value: 'Married, but withhold as Single', label: t('filingStatusMarriedWithholdAsSingle') },\n ]\n\n return (\n <>\n <NumberInputField\n name=\"federalWithholdingAllowance\"\n isRequired\n label={t('federalWithholdingAllowance')}\n min={0}\n maximumFractionDigits={0}\n errorMessage={t('fieldIsRequired')}\n />\n <SelectField\n name=\"filingStatus\"\n label={t('filingStatus')}\n placeholder={t('federalFilingStatusPlaceholder')}\n description={t('selectWithholdingDescription')}\n options={filingStatusOptions}\n isRequired\n errorMessage={t('validations.federalFilingStatus')}\n />\n <TextInputField\n name=\"additionalWithholding\"\n label={t('additionalWithholding')}\n type=\"number\"\n errorMessage={t('fieldIsRequired')}\n />\n </>\n )\n}\n"],"names":["Rev2020Schema","z","Pre2020Schema","FederalFormSchema","FederalForm","watch","useFormContext","Rev2020Form","Pre2020Form","t","useTranslation","Components","useComponentContext","filingStatusOptions","jsxs","Fragment","jsx","SelectField","RadioGroupField","Trans","NumberInputField","TextInputField"],"mappings":";;;;;;;;;;;AAMA,MAAMA,IAAgBC,EAAE,OAAO;AAAA,EAC7B,YAAYA,EAAE,QAAQ,aAAa;AAAA,EACnC,cAAcA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC9B,SAASA,EAAE,SAAS,IAAI,CAAC;AAAA,EACzB,kBAAkBA,EAAE,SAAS,UAAU,MAAM;AAAA,EAC7C,aAAaA,EAAE,SAAS,UAAU,MAAM;AAAA,EACxC,YAAYA,EAAE,SAA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|
11
11
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
|
-
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
13
12
|
import "dompurify";
|
|
14
|
-
import "../../../contexts/LocaleProvider/useLocale.js";
|
|
15
13
|
import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
14
|
+
const [d, u] = o("TaxesContext");
|
|
17
15
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
u as TaxesProvider,
|
|
17
|
+
d as useTaxes
|
|
20
18
|
};
|
|
21
19
|
//# sourceMappingURL=useTaxes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTaxes.js","sources":["../../../../src/components/Employee/Taxes/useTaxes.ts"],"sourcesContent":["import type { EmployeeStateTaxesList } from '@gusto/embedded-api/models/components/employeestatetaxeslist'\nimport { createCompoundContext } from '@/components/Base'\n\ntype TaxesContextType = {\n employeeStateTaxes: EmployeeStateTaxesList[]\n isPending: boolean\n isAdmin: boolean\n}\n\nconst [useTaxes, TaxesProvider] = createCompoundContext<TaxesContextType>('TaxesContext')\nexport { useTaxes, TaxesProvider }\n"],"names":["useTaxes","TaxesProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTaxes.js","sources":["../../../../src/components/Employee/Taxes/useTaxes.ts"],"sourcesContent":["import type { EmployeeStateTaxesList } from '@gusto/embedded-api/models/components/employeestatetaxeslist'\nimport { createCompoundContext } from '@/components/Base'\n\ntype TaxesContextType = {\n employeeStateTaxes: EmployeeStateTaxesList[]\n isPending: boolean\n isAdmin: boolean\n}\n\nconst [useTaxes, TaxesProvider] = createCompoundContext<TaxesContextType>('TaxesContext')\nexport { useTaxes, TaxesProvider }\n"],"names":["useTaxes","TaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AASA,MAAM,CAACA,GAAUC,CAAa,IAAIC,EAAwC,cAAc;"}
|
|
@@ -4,11 +4,10 @@ import { useTranslation as w } from "react-i18next";
|
|
|
4
4
|
import { FlowBreadcrumbs as F } from "../Common/FlowBreadcrumbs/FlowBreadcrumbs.js";
|
|
5
5
|
import { Flex as s, FlexItem as d } from "../Common/Flex/Flex.js";
|
|
6
6
|
import "classnames";
|
|
7
|
-
import "../../shared/constants.js";
|
|
8
7
|
import { useComponentContext as j } from "../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
8
|
import "react";
|
|
10
9
|
import { FlowContext as E } from "./useFlow.js";
|
|
11
|
-
const
|
|
10
|
+
const k = ({
|
|
12
11
|
onEvent: x,
|
|
13
12
|
machine: f
|
|
14
13
|
}) => {
|
|
@@ -60,6 +59,6 @@ const q = ({
|
|
|
60
59
|
) });
|
|
61
60
|
};
|
|
62
61
|
export {
|
|
63
|
-
|
|
62
|
+
k as Flow
|
|
64
63
|
};
|
|
65
64
|
//# sourceMappingURL=Flow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flow.js","sources":["../../../src/components/Flow/Flow.tsx"],"sourcesContent":["import { useMachine } from 'react-robot'\nimport { type Machine, type SendFunction } from 'robot3'\nimport { useTranslation } from 'react-i18next'\nimport type { OnEventType } from '../Base/useBase'\nimport { FlowBreadcrumbs } from '../Common/FlowBreadcrumbs/FlowBreadcrumbs'\nimport { Flex } from '../Common/Flex'\nimport { FlexItem } from '../Common'\nimport type { FlowContextInterface } from './useFlow'\nimport { FlowContext } from './useFlow'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ntype FlowProps<M extends Machine> = {\n machine: M\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport const Flow = <M extends Machine<object, FlowContextInterface>>({\n onEvent,\n machine,\n}: FlowProps<M>) => {\n const Components = useComponentContext()\n const { t } = useTranslation()\n const [current, send, service] = useMachine(machine, {\n onEvent: handleEvent,\n component: null,\n progressBarCta: null,\n })\n\n const {\n progressBarType = null,\n totalSteps = null,\n currentStep = null,\n currentBreadcrumbId,\n breadcrumbs = {},\n } = current.context\n\n function handleEvent(type: EventType, data: unknown): void {\n const event = { type, payload: data }\n const sendFn = send as SendFunction<string>\n //When dealing with nested state machine, correct machine needs to recieve an event\n if (service.child) {\n ;(service.child.send as SendFunction<string>)(event)\n } else {\n sendFn(event)\n }\n // Pass event upstream - onEvent can be optional on Flow component\n onEvent(type, data)\n }\n\n return (\n <Flex>\n <FlowContext.Provider\n value={{\n ...current.context,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {progressBarType === 'progress' && currentStep && totalSteps && (\n <Components.ProgressBar\n totalSteps={totalSteps}\n currentStep={currentStep}\n label={t('progressBarLabel', { totalSteps, currentStep })}\n cta={current.context.progressBarCta}\n />\n )}\n {progressBarType === 'breadcrumbs' && (\n <Flex flexDirection=\"row\" justifyContent=\"space-between\" alignItems=\"center\">\n <FlexItem flexGrow={1}>\n <FlowBreadcrumbs\n breadcrumbs={currentBreadcrumbId ? (breadcrumbs[currentBreadcrumbId] ?? []) : []}\n currentBreadcrumbId={currentBreadcrumbId}\n onEvent={handleEvent}\n />\n </FlexItem>\n <FlexItem>\n {current.context.progressBarCta && <current.context.progressBarCta />}\n </FlexItem>\n </Flex>\n )}\n {current.context.component && <current.context.component />}\n </Flex>\n </FlowContext.Provider>\n </Flex>\n )\n}\n"],"names":["Flow","onEvent","machine","Components","useComponentContext","t","useTranslation","current","send","service","useMachine","handleEvent","progressBarType","totalSteps","currentStep","currentBreadcrumbId","breadcrumbs","type","data","event","sendFn","Flex","jsx","FlowContext","jsxs","FlexItem","FlowBreadcrumbs"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Flow.js","sources":["../../../src/components/Flow/Flow.tsx"],"sourcesContent":["import { useMachine } from 'react-robot'\nimport { type Machine, type SendFunction } from 'robot3'\nimport { useTranslation } from 'react-i18next'\nimport type { OnEventType } from '../Base/useBase'\nimport { FlowBreadcrumbs } from '../Common/FlowBreadcrumbs/FlowBreadcrumbs'\nimport { Flex } from '../Common/Flex'\nimport { FlexItem } from '../Common'\nimport type { FlowContextInterface } from './useFlow'\nimport { FlowContext } from './useFlow'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ntype FlowProps<M extends Machine> = {\n machine: M\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport const Flow = <M extends Machine<object, FlowContextInterface>>({\n onEvent,\n machine,\n}: FlowProps<M>) => {\n const Components = useComponentContext()\n const { t } = useTranslation()\n const [current, send, service] = useMachine(machine, {\n onEvent: handleEvent,\n component: null,\n progressBarCta: null,\n })\n\n const {\n progressBarType = null,\n totalSteps = null,\n currentStep = null,\n currentBreadcrumbId,\n breadcrumbs = {},\n } = current.context\n\n function handleEvent(type: EventType, data: unknown): void {\n const event = { type, payload: data }\n const sendFn = send as SendFunction<string>\n //When dealing with nested state machine, correct machine needs to recieve an event\n if (service.child) {\n ;(service.child.send as SendFunction<string>)(event)\n } else {\n sendFn(event)\n }\n // Pass event upstream - onEvent can be optional on Flow component\n onEvent(type, data)\n }\n\n return (\n <Flex>\n <FlowContext.Provider\n value={{\n ...current.context,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {progressBarType === 'progress' && currentStep && totalSteps && (\n <Components.ProgressBar\n totalSteps={totalSteps}\n currentStep={currentStep}\n label={t('progressBarLabel', { totalSteps, currentStep })}\n cta={current.context.progressBarCta}\n />\n )}\n {progressBarType === 'breadcrumbs' && (\n <Flex flexDirection=\"row\" justifyContent=\"space-between\" alignItems=\"center\">\n <FlexItem flexGrow={1}>\n <FlowBreadcrumbs\n breadcrumbs={currentBreadcrumbId ? (breadcrumbs[currentBreadcrumbId] ?? []) : []}\n currentBreadcrumbId={currentBreadcrumbId}\n onEvent={handleEvent}\n />\n </FlexItem>\n <FlexItem>\n {current.context.progressBarCta && <current.context.progressBarCta />}\n </FlexItem>\n </Flex>\n )}\n {current.context.component && <current.context.component />}\n </Flex>\n </FlowContext.Provider>\n </Flex>\n )\n}\n"],"names":["Flow","onEvent","machine","Components","useComponentContext","t","useTranslation","current","send","service","useMachine","handleEvent","progressBarType","totalSteps","currentStep","currentBreadcrumbId","breadcrumbs","type","data","event","sendFn","Flex","jsx","FlowContext","jsxs","FlexItem","FlowBreadcrumbs"],"mappings":";;;;;;;;;AAiBO,MAAMA,IAAO,CAAkD;AAAA,EACpE,SAAAC;AAAA,EACA,SAAAC;AACF,MAAoB;AAClB,QAAMC,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACR,CAACC,GAASC,GAAMC,CAAO,IAAIC,EAAWR,GAAS;AAAA,IACnD,SAASS;AAAA,IACT,WAAW;AAAA,IACX,gBAAgB;AAAA,EAAA,CACjB,GAEK;AAAA,IACJ,iBAAAC,IAAkB;AAAA,IAClB,YAAAC,IAAa;AAAA,IACb,aAAAC,IAAc;AAAA,IACd,qBAAAC;AAAA,IACA,aAAAC,IAAc,CAAA;AAAA,EAAC,IACbT,EAAQ;AAEZ,WAASI,EAAYM,GAAiBC,GAAqB;AACzD,UAAMC,IAAQ,EAAE,MAAAF,GAAM,SAASC,EAAA,GACzBE,IAASZ;AAEf,IAAIC,EAAQ,QACRA,EAAQ,MAAM,KAA8BU,CAAK,IAEnDC,EAAOD,CAAK,GAGdlB,EAAQgB,GAAMC,CAAI;AAAA,EACpB;AAEA,2BACGG,GAAA,EACC,UAAA,gBAAAC;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,GAAGhB,EAAQ;AAAA,MAAA;AAAA,MAGb,UAAA,gBAAAiB,EAACH,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAA;AAAA,QAAAT,MAAoB,cAAcE,KAAeD,KAChD,gBAAAS;AAAA,UAACnB,EAAW;AAAA,UAAX;AAAA,YACC,YAAAU;AAAA,YACA,aAAAC;AAAA,YACA,OAAOT,EAAE,oBAAoB,EAAE,YAAAQ,GAAY,aAAAC,GAAa;AAAA,YACxD,KAAKP,EAAQ,QAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,QAGxBK,MAAoB,iBACnB,gBAAAY,EAACH,GAAA,EAAK,eAAc,OAAM,gBAAe,iBAAgB,YAAW,UAClE,UAAA;AAAA,UAAA,gBAAAC,EAACG,GAAA,EAAS,UAAU,GAClB,UAAA,gBAAAH;AAAA,YAACI;AAAA,YAAA;AAAA,cACC,aAAaX,IAAuBC,EAAYD,CAAmB,KAAK,CAAA,IAAM,CAAA;AAAA,cAC9E,qBAAAA;AAAA,cACA,SAASJ;AAAA,YAAA;AAAA,UAAA,GAEb;AAAA,UACA,gBAAAW,EAACG,GAAA,EACE,UAAAlB,EAAQ,QAAQ,oCAAmBA,EAAQ,QAAQ,gBAAhB,CAAA,CAA+B,EAAA,CACrE;AAAA,QAAA,GACF;AAAA,QAEDA,EAAQ,QAAQ,+BAAcA,EAAQ,QAAQ,WAAhB,CAAA,CAA0B;AAAA,MAAA,EAAA,CAC3D;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js
CHANGED
|
@@ -13,14 +13,14 @@ import { BaseComponent as G } from "../../Base/Base.js";
|
|
|
13
13
|
import { useBase as $ } from "../../Base/useBase.js";
|
|
14
14
|
import { Flex as y } from "../../Common/Flex/Flex.js";
|
|
15
15
|
import "classnames";
|
|
16
|
-
import {
|
|
17
|
-
import { TextInputField as J } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
18
|
-
import { useComponentContext as w } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
16
|
+
import { useComponentContext as C } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
19
17
|
import "react";
|
|
20
|
-
import { FileInputField as
|
|
21
|
-
import { Form as
|
|
22
|
-
import { useComponentDictionary as
|
|
23
|
-
import {
|
|
18
|
+
import { FileInputField as J } from "../../Common/Fields/FileInputField/FileInputField.js";
|
|
19
|
+
import { Form as X } from "../../Common/Form/Form.js";
|
|
20
|
+
import { useComponentDictionary as Z, useI18n as w } from "../../../i18n/I18n.js";
|
|
21
|
+
import { informationRequestEvents as M } from "../../../shared/constants.js";
|
|
22
|
+
import { useFlow as ee } from "../../Flow/useFlow.js";
|
|
23
|
+
import { TextInputField as ne } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
24
24
|
const _ = "gusto-sdk-information-request-form", te = ["image/jpeg", "image/png", "application/pdf"], oe = f.record(
|
|
25
25
|
f.string(),
|
|
26
26
|
f.union([f.string().min(1), f.instanceof(File)])
|
|
@@ -43,8 +43,8 @@ function ae(o) {
|
|
|
43
43
|
return o.some((s) => s.responseType === u.Persona);
|
|
44
44
|
}
|
|
45
45
|
function ue({ companyId: o, requestId: s, dictionary: i }) {
|
|
46
|
-
|
|
47
|
-
const { t: n } = D("InformationRequests.InformationRequestForm"), { Alert: q, Heading: T, Text: c } =
|
|
46
|
+
Z("InformationRequests.InformationRequestForm", i), w("InformationRequests.InformationRequestForm");
|
|
47
|
+
const { t: n } = D("InformationRequests.InformationRequestForm"), { Alert: q, Heading: T, Text: c } = C(), { onEvent: I, baseSubmitHandler: g } = $(), { data: N } = P({
|
|
48
48
|
companyUuid: o
|
|
49
49
|
}), l = N.informationRequestList?.find((t) => t.uuid === s), a = l?.requiredQuestions ?? [], F = l?.blockingPayroll ?? !1, O = A(a), b = ae(a), { mutateAsync: Q } = W(), v = {}, U = [];
|
|
50
50
|
a.forEach((t) => {
|
|
@@ -83,7 +83,7 @@ function ue({ companyId: o, requestId: s, dictionary: i }) {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
|
-
I(
|
|
86
|
+
I(M.INFORMATION_REQUEST_FORM_DONE, x.informationRequest);
|
|
87
87
|
});
|
|
88
88
|
}, L = (t) => {
|
|
89
89
|
if (!t.questionUuid || !t.responseType) return null;
|
|
@@ -95,7 +95,7 @@ function ue({ companyId: o, requestId: s, dictionary: i }) {
|
|
|
95
95
|
] }),
|
|
96
96
|
/* @__PURE__ */ e("hr", { className: r.divider }),
|
|
97
97
|
x && /* @__PURE__ */ e("div", { className: r.textInputWrapper, children: /* @__PURE__ */ e(
|
|
98
|
-
|
|
98
|
+
ne,
|
|
99
99
|
{
|
|
100
100
|
name: R,
|
|
101
101
|
label: n("fields.textAnswer.label"),
|
|
@@ -105,7 +105,7 @@ function ue({ companyId: o, requestId: s, dictionary: i }) {
|
|
|
105
105
|
}
|
|
106
106
|
) }),
|
|
107
107
|
h && /* @__PURE__ */ e("div", { className: r.fileInputWrapper, children: /* @__PURE__ */ e(
|
|
108
|
-
|
|
108
|
+
J,
|
|
109
109
|
{
|
|
110
110
|
name: R,
|
|
111
111
|
label: n("fields.fileUpload.label"),
|
|
@@ -128,19 +128,19 @@ function ue({ companyId: o, requestId: s, dictionary: i }) {
|
|
|
128
128
|
return /* @__PURE__ */ e("div", { className: r.root, children: /* @__PURE__ */ m(y, { flexDirection: "column", gap: 16, children: [
|
|
129
129
|
/* @__PURE__ */ e(T, { as: "h2", children: n("title") }),
|
|
130
130
|
F && /* @__PURE__ */ e(q, { status: "error", label: n("blockingAlert.title"), disableScrollIntoView: !0, children: n("blockingAlert.description") }),
|
|
131
|
-
O ? j : /* @__PURE__ */ e(H, { ...E, children: /* @__PURE__ */ e(
|
|
131
|
+
O ? j : /* @__PURE__ */ e(H, { ...E, children: /* @__PURE__ */ e(X, { id: _, onSubmit: E.handleSubmit(k), children: /* @__PURE__ */ e(y, { flexDirection: "column", gap: 16, children: a.map(L) }) }) })
|
|
132
132
|
] }) });
|
|
133
133
|
}
|
|
134
134
|
const ce = ({ onEvent: o }) => {
|
|
135
|
-
|
|
136
|
-
const { t: s } = D("InformationRequests.InformationRequestForm"), { Button: i } =
|
|
135
|
+
w("InformationRequests.InformationRequestForm");
|
|
136
|
+
const { t: s } = D("InformationRequests.InformationRequestForm"), { Button: i } = C(), { companyId: n, selectedRequestId: q } = ee(), { data: T } = P({
|
|
137
137
|
companyUuid: n
|
|
138
138
|
}), I = T.informationRequestList?.find(
|
|
139
139
|
(F) => F.uuid === q
|
|
140
140
|
)?.requiredQuestions ?? [], g = A(I), l = V({
|
|
141
141
|
mutationKey: Y()
|
|
142
142
|
}) > 0, a = () => {
|
|
143
|
-
o(
|
|
143
|
+
o(M.INFORMATION_REQUEST_FORM_CANCEL);
|
|
144
144
|
};
|
|
145
145
|
return g ? /* @__PURE__ */ e(y, { justifyContent: "flex-end", gap: 12, children: /* @__PURE__ */ e(i, { variant: "secondary", onClick: a, children: s("cta.close") }) }) : /* @__PURE__ */ m(y, { justifyContent: "flex-end", gap: 12, children: [
|
|
146
146
|
/* @__PURE__ */ e(i, { variant: "secondary", onClick: a, isDisabled: l, children: s("cta.cancel") }),
|