@gusto/embedded-react-sdk 0.31.0-rc.2 → 0.31.0-rc.3
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/dist/components/Base/Base.js +12 -13
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +10 -12
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +2 -3
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +6 -7
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +2 -3
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +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 +12 -12
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
- 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 +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +3 -4
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +8 -9
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +5 -7
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
- 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 -7
- 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 +8 -9
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +3 -4
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
- 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 +3 -4
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +3 -5
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +5 -6
- 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 -7
- 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 +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +3 -4
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
- 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 +3 -4
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +10 -12
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +6 -8
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +7 -8
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +3 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +3 -4
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- 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 +15 -15
- package/dist/components/Company/PaySchedule/_parts/Head.js +11 -13
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +13 -15
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +5 -6
- 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/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- 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 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +4 -5
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +1 -1
- package/dist/components/Contractor/Address/useAddress.js +5 -6
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +31 -32
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +13 -14
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +11 -12
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -4
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +2 -4
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +10 -10
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +7 -9
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +3 -4
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +2 -4
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +6 -8
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +2 -4
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +2 -4
- 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 +2 -3
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +20 -21
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +12 -13
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +16 -17
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- 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 -11
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +11 -12
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +11 -12
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +7 -8
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +5 -6
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +2 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentSigner.js +31 -28
- package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js +58 -42
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +24 -26
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +9 -10
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +2 -3
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +2 -4
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.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 +3 -4
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +5 -7
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +2 -3
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +3 -4
- 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 -4
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +14 -15
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +4 -5
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +2 -3
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +6 -7
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +10 -11
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +5 -6
- 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 +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
- package/dist/components/Employee/Profile/useProfile.js +3 -4
- 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 -4
- 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 -4
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Flow/Flow.js +7 -9
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +16 -17
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +6 -7
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +3 -4
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +9 -10
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +2 -4
- 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/PayrollEditEmployee/PayrollEditEmployeePresentation.js +36 -36
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +19 -21
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +15 -17
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +17 -19
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +2 -3
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +2 -4
- 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 +3 -4
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +11 -12
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +2 -4
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +2 -3
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +2 -3
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDocumentList.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n employeeForms: Form[]\n handleContinue: () => void\n handleRequestFormToSign: (form: Form) => void\n documentListError: Error | null\n formToSign?: Form\n}\n\nconst [useDocumentList, DocumentListProvider] =\n createCompoundContext<DocumentListContextType>('DocumentListContext')\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDocumentList.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n employeeForms: Form[]\n handleContinue: () => void\n handleRequestFormToSign: (form: Form) => void\n documentListError: Error | null\n formToSign?: Form\n}\n\nconst [useDocumentList, DocumentListProvider] =\n createCompoundContext<DocumentListContextType>('DocumentListContext')\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAWA,MAAM,CAACA,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
|
|
@@ -1,48 +1,51 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { createMachine as d } from "robot3";
|
|
3
|
-
import { useMemo as
|
|
3
|
+
import { useMemo as g } from "react";
|
|
4
4
|
import { useIsMutating as b } from "@tanstack/react-query";
|
|
5
|
+
import { APIError as y } from "@gusto/embedded-api/models/errors/apierror";
|
|
5
6
|
import { useI9VerificationGetAuthorization as D } from "@gusto/embedded-api/react-query/i9VerificationGetAuthorization";
|
|
6
|
-
import { mutationKeyI9VerificationUpdate as
|
|
7
|
+
import { mutationKeyI9VerificationUpdate as h } from "@gusto/embedded-api/react-query/i9VerificationUpdate";
|
|
7
8
|
import { useEmployeesGet as L } from "@gusto/embedded-api/react-query/employeesGet";
|
|
8
|
-
import { EmploymentEligibilityContextual as
|
|
9
|
+
import { EmploymentEligibilityContextual as M, DocumentListContextual as S } from "./documentSignerStateMachine.js";
|
|
9
10
|
import { documentSignerMachine as x } from "./stateMachine.js";
|
|
10
|
-
import { Flow as
|
|
11
|
-
import { BaseComponent as
|
|
12
|
-
import { useBase as
|
|
13
|
-
import { useComponentDictionary as
|
|
14
|
-
function
|
|
15
|
-
return /* @__PURE__ */ i(
|
|
11
|
+
import { Flow as A } from "../../Flow/Flow.js";
|
|
12
|
+
import { BaseComponent as C } from "../../Base/Base.js";
|
|
13
|
+
import { useBase as E } from "../../Base/useBase.js";
|
|
14
|
+
import { useComponentDictionary as F } from "../../../i18n/I18n.js";
|
|
15
|
+
function v(t) {
|
|
16
|
+
return /* @__PURE__ */ i(C, { ...t, children: /* @__PURE__ */ i(O, { ...t }) });
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
const { LoadingIndicator: s } =
|
|
20
|
-
{ employeeId:
|
|
21
|
-
{ enabled:
|
|
18
|
+
function O({ employeeId: t, onEvent: m, dictionary: a, withEmployeeI9: o = !1 }) {
|
|
19
|
+
F("Employee.DocumentSigner", a);
|
|
20
|
+
const { LoadingIndicator: s } = E(), { data: u, isLoading: c } = L(
|
|
21
|
+
{ employeeId: t },
|
|
22
|
+
{ enabled: o }
|
|
22
23
|
), r = u?.employee?.onboardingDocumentsConfig?.i9Document === !0, { data: f, isLoading: p } = D(
|
|
23
|
-
{ employeeId:
|
|
24
|
+
{ employeeId: t },
|
|
24
25
|
{
|
|
25
|
-
enabled:
|
|
26
|
+
enabled: o && r,
|
|
26
27
|
retry: !1,
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
refetchOnMount: !1,
|
|
29
|
+
refetchOnWindowFocus: !1,
|
|
30
|
+
staleTime: 1 / 0,
|
|
31
|
+
throwOnError: (n) => !(n instanceof y && n.httpMeta.response.status === 404)
|
|
29
32
|
}
|
|
30
|
-
),
|
|
33
|
+
), e = o && r && !f?.i9Authorization?.employeeSigned, l = g(
|
|
31
34
|
() => d(
|
|
32
|
-
|
|
35
|
+
e ? "employmentEligibility" : "index",
|
|
33
36
|
x,
|
|
34
|
-
(
|
|
35
|
-
...
|
|
36
|
-
component:
|
|
37
|
-
employeeId:
|
|
38
|
-
withEmployeeI9:
|
|
37
|
+
(n) => ({
|
|
38
|
+
...n,
|
|
39
|
+
component: e ? M : S,
|
|
40
|
+
employeeId: t,
|
|
41
|
+
withEmployeeI9: o
|
|
39
42
|
})
|
|
40
43
|
),
|
|
41
|
-
[
|
|
44
|
+
[t, e, o]
|
|
42
45
|
);
|
|
43
|
-
return !(b({ mutationKey:
|
|
46
|
+
return !(b({ mutationKey: h() }) > 0) && o && (c || p) ? /* @__PURE__ */ i(s, {}) : /* @__PURE__ */ i(A, { machine: l, onEvent: m });
|
|
44
47
|
}
|
|
45
48
|
export {
|
|
46
|
-
|
|
49
|
+
v as DocumentSigner
|
|
47
50
|
};
|
|
48
51
|
//# sourceMappingURL=DocumentSigner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentSigner.js","sources":["../../../../src/components/Employee/DocumentSigner/DocumentSigner.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { useIsMutating } from '@tanstack/react-query'\nimport
|
|
1
|
+
{"version":3,"file":"DocumentSigner.js","sources":["../../../../src/components/Employee/DocumentSigner/DocumentSigner.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { useIsMutating } from '@tanstack/react-query'\nimport { APIError } from '@gusto/embedded-api/models/errors/apierror'\nimport { useI9VerificationGetAuthorization } from '@gusto/embedded-api/react-query/i9VerificationGetAuthorization'\nimport { mutationKeyI9VerificationUpdate } from '@gusto/embedded-api/react-query/i9VerificationUpdate'\nimport { useEmployeesGet } from '@gusto/embedded-api/react-query/employeesGet'\nimport {\n DocumentListContextual,\n EmploymentEligibilityContextual,\n type DocumentSignerContextInterface,\n} from './documentSignerStateMachine'\nimport { documentSignerMachine } from './stateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useBase } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport interface DocumentSignerProps extends BaseComponentInterface<'Employee.DocumentSigner'> {\n employeeId: string\n withEmployeeI9?: boolean\n}\n\nexport function DocumentSigner(props: DocumentSignerProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, onEvent, dictionary, withEmployeeI9 = false }: DocumentSignerProps) {\n useComponentDictionary('Employee.DocumentSigner', dictionary)\n const { LoadingIndicator } = useBase()\n\n const { data: employeeData, isLoading: employeeLoading } = useEmployeesGet(\n { employeeId },\n { enabled: withEmployeeI9 },\n )\n\n const employeeHasI9Enabled =\n employeeData?.employee?.onboardingDocumentsConfig?.i9Document === true\n\n const { data: i9AuthData, isLoading: i9AuthLoading } = useI9VerificationGetAuthorization(\n { employeeId },\n {\n enabled: withEmployeeI9 && employeeHasI9Enabled,\n retry: false,\n refetchOnMount: false,\n refetchOnWindowFocus: false,\n staleTime: Infinity,\n throwOnError: (error: Error) => {\n return !(error instanceof APIError && error.httpMeta.response.status === 404)\n },\n },\n )\n\n const needsI9Form =\n withEmployeeI9 && employeeHasI9Enabled && !i9AuthData?.i9Authorization?.employeeSigned\n\n const machine = useMemo(\n () =>\n createMachine(\n needsI9Form ? 'employmentEligibility' : 'index',\n documentSignerMachine,\n (initialContext: DocumentSignerContextInterface) => ({\n ...initialContext,\n component: needsI9Form ? EmploymentEligibilityContextual : DocumentListContextual,\n employeeId,\n withEmployeeI9,\n }),\n ),\n [employeeId, needsI9Form, withEmployeeI9],\n )\n\n const isSubmittingI9 = useIsMutating({ mutationKey: mutationKeyI9VerificationUpdate() }) > 0\n\n if (!isSubmittingI9 && withEmployeeI9 && (employeeLoading || i9AuthLoading)) {\n return <LoadingIndicator />\n }\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n"],"names":["DocumentSigner","props","jsx","BaseComponent","Root","employeeId","onEvent","dictionary","withEmployeeI9","useComponentDictionary","LoadingIndicator","useBase","employeeData","employeeLoading","useEmployeesGet","employeeHasI9Enabled","i9AuthData","i9AuthLoading","useI9VerificationGetAuthorization","error","APIError","needsI9Form","machine","useMemo","createMachine","documentSignerMachine","initialContext","EmploymentEligibilityContextual","DocumentListContextual","useIsMutating","mutationKeyI9VerificationUpdate","Flow"],"mappings":";;;;;;;;;;;;;;AAuBO,SAASA,EAAeC,GAA4B;AACzD,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ocumentSigner/EmploymentEligibility/EmploymentEligibility.js
CHANGED
|
@@ -1,52 +1,68 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { APIError as I } from "@gusto/embedded-api/models/errors/apierror";
|
|
3
|
+
import { useI9VerificationGetAuthorization as A } from "@gusto/embedded-api/react-query/i9VerificationGetAuthorization";
|
|
4
|
+
import { useI9VerificationUpdateMutation as _ } from "@gusto/embedded-api/react-query/i9VerificationUpdate";
|
|
5
|
+
import { EmploymentEligibilityPresentation as v } from "./EmploymentEligibilityPresentation.js";
|
|
6
|
+
import { BaseComponent as x } from "../../../Base/Base.js";
|
|
7
|
+
import { useBase as z } from "../../../Base/useBase.js";
|
|
8
|
+
import { useComponentDictionary as T, useI18n as L } from "../../../../i18n/I18n.js";
|
|
9
|
+
import { componentEvents as M } from "../../../../shared/constants.js";
|
|
10
|
+
function G(i) {
|
|
11
|
+
return /* @__PURE__ */ r(x, { ...i, children: /* @__PURE__ */ r(O, { ...i }) });
|
|
10
12
|
}
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const { onEvent:
|
|
14
|
-
|
|
15
|
-
f,
|
|
13
|
+
const O = ({ employeeId: i, dictionary: s }) => {
|
|
14
|
+
T("Employee.EmploymentEligibility", s), L("Employee.EmploymentEligibility");
|
|
15
|
+
const { onEvent: m, baseSubmitHandler: c, LoadingIndicator: p } = z(), { data: l, isLoading: f } = A(
|
|
16
|
+
{ employeeId: i },
|
|
16
17
|
{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
18
|
+
retry: !1,
|
|
19
|
+
refetchOnMount: !1,
|
|
20
|
+
refetchOnWindowFocus: !1,
|
|
21
|
+
staleTime: 1 / 0,
|
|
22
|
+
throwOnError: (o) => !(o instanceof I && o.httpMeta.response.status === 404)
|
|
23
|
+
}
|
|
24
|
+
), t = l?.i9Authorization, { mutateAsync: y, isPending: u } = _(), d = async (o) => {
|
|
25
|
+
await c(o, async (h) => {
|
|
26
|
+
const { authorizationStatus: e, documentType: a, documentNumber: n, expirationDate: b, country: g } = h;
|
|
27
|
+
if (!e) return;
|
|
28
|
+
const D = await y({
|
|
29
|
+
request: {
|
|
30
|
+
employeeId: i,
|
|
31
|
+
requestBody: {
|
|
32
|
+
authorizationStatus: e,
|
|
33
|
+
version: t?.version,
|
|
34
|
+
...e === "permanent_resident" && n && {
|
|
35
|
+
documentType: "uscis_alien_registration_number",
|
|
36
|
+
documentNumber: n
|
|
37
|
+
},
|
|
38
|
+
...e === "alien" && {
|
|
39
|
+
...n && a && { documentType: a, documentNumber: n },
|
|
40
|
+
expirationDate: b,
|
|
41
|
+
...a === "foreign_passport" && { country: g }
|
|
37
42
|
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
m(M.EMPLOYEE_EMPLOYMENT_ELIGIBILITY_DONE, D.i9Authorization);
|
|
47
|
+
});
|
|
48
|
+
}, E = t ? {
|
|
49
|
+
authorizationStatus: t.authorizationStatus,
|
|
50
|
+
documentType: t.documentType ?? void 0,
|
|
51
|
+
expirationDate: t.expirationDate ? new Date(t.expirationDate) : void 0,
|
|
52
|
+
country: t.country ?? void 0
|
|
53
|
+
} : {};
|
|
54
|
+
return !u && f ? /* @__PURE__ */ r(p, {}) : /* @__PURE__ */ r(
|
|
55
|
+
v,
|
|
56
|
+
{
|
|
57
|
+
onSubmit: d,
|
|
58
|
+
defaultValues: E,
|
|
59
|
+
hasDocumentNumber: t?.hasDocumentNumber,
|
|
60
|
+
isPending: u
|
|
45
61
|
},
|
|
46
|
-
|
|
62
|
+
t?.uuid
|
|
47
63
|
);
|
|
48
64
|
};
|
|
49
65
|
export {
|
|
50
|
-
|
|
66
|
+
G as EmploymentEligibility
|
|
51
67
|
};
|
|
52
68
|
//# sourceMappingURL=EmploymentEligibility.js.map
|
package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmploymentEligibility.js","sources":["../../../../../src/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibility.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"EmploymentEligibility.js","sources":["../../../../../src/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibility.tsx"],"sourcesContent":["import { APIError } from '@gusto/embedded-api/models/errors/apierror'\nimport { useI9VerificationGetAuthorization } from '@gusto/embedded-api/react-query/i9VerificationGetAuthorization'\nimport { useI9VerificationUpdateMutation } from '@gusto/embedded-api/react-query/i9VerificationUpdate'\nimport { EmploymentEligibilityPresentation } from './EmploymentEligibilityPresentation'\nimport type {\n EmploymentEligibilityInputs,\n EmploymentEligibilityPayload,\n} from './EmploymentEligibilitySchema'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\nexport interface EmploymentEligibilityProps extends BaseComponentInterface<'Employee.EmploymentEligibility'> {\n employeeId: string\n}\n\nexport function EmploymentEligibility(props: EmploymentEligibilityProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nconst Root = ({ employeeId, dictionary }: EmploymentEligibilityProps) => {\n useComponentDictionary('Employee.EmploymentEligibility', dictionary)\n useI18n('Employee.EmploymentEligibility')\n const { onEvent, baseSubmitHandler, LoadingIndicator } = useBase()\n\n const { data: i9AuthData, isLoading } = useI9VerificationGetAuthorization(\n { employeeId },\n {\n retry: false,\n refetchOnMount: false,\n refetchOnWindowFocus: false,\n staleTime: Infinity,\n throwOnError: (error: Error) => {\n return !(error instanceof APIError && error.httpMeta.response.status === 404)\n },\n },\n )\n\n const existingAuth = i9AuthData?.i9Authorization\n\n const { mutateAsync: updateI9Authorization, isPending } = useI9VerificationUpdateMutation()\n\n const handleSubmit = async (data: EmploymentEligibilityPayload) => {\n await baseSubmitHandler(data, async payload => {\n const { authorizationStatus, documentType, documentNumber, expirationDate, country } = payload\n\n if (!authorizationStatus) return\n\n const result = await updateI9Authorization({\n request: {\n employeeId,\n requestBody: {\n authorizationStatus,\n version: existingAuth?.version,\n ...(authorizationStatus === 'permanent_resident' &&\n documentNumber && {\n documentType: 'uscis_alien_registration_number',\n documentNumber,\n }),\n ...(authorizationStatus === 'alien' && {\n ...(documentNumber && documentType && { documentType, documentNumber }),\n expirationDate,\n ...(documentType === 'foreign_passport' && { country }),\n }),\n },\n },\n })\n\n onEvent(componentEvents.EMPLOYEE_EMPLOYMENT_ELIGIBILITY_DONE, result.i9Authorization)\n })\n }\n\n const defaultValues: Partial<EmploymentEligibilityInputs> = existingAuth\n ? {\n authorizationStatus: existingAuth.authorizationStatus,\n documentType: existingAuth.documentType ?? undefined,\n expirationDate: existingAuth.expirationDate\n ? new Date(existingAuth.expirationDate)\n : undefined,\n country: existingAuth.country ?? undefined,\n }\n : {}\n\n if (!isPending && isLoading) return <LoadingIndicator />\n\n return (\n <EmploymentEligibilityPresentation\n key={existingAuth?.uuid}\n onSubmit={handleSubmit}\n defaultValues={defaultValues}\n hasDocumentNumber={existingAuth?.hasDocumentNumber}\n isPending={isPending}\n />\n )\n}\n"],"names":["EmploymentEligibility","props","jsx","BaseComponent","Root","employeeId","dictionary","useComponentDictionary","useI18n","onEvent","baseSubmitHandler","LoadingIndicator","useBase","i9AuthData","isLoading","useI9VerificationGetAuthorization","error","APIError","existingAuth","updateI9Authorization","isPending","useI9VerificationUpdateMutation","handleSubmit","data","payload","authorizationStatus","documentType","documentNumber","expirationDate","country","result","componentEvents","defaultValues","EmploymentEligibilityPresentation"],"mappings":";;;;;;;;;AAkBO,SAASA,EAAsBC,GAAmC;AACvE,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,MAAMG,IAAO,CAAC,EAAE,YAAAC,GAAY,YAAAC,QAA6C;AACvE,EAAAC,EAAuB,kCAAkCD,CAAU,GACnEE,EAAQ,gCAAgC;AACxC,QAAM,EAAE,SAAAC,GAAS,mBAAAC,GAAmB,kBAAAC,EAAA,IAAqBC,EAAA,GAEnD,EAAE,MAAMC,GAAY,WAAAC,EAAA,IAAcC;AAAA,IACtC,EAAE,YAAAV,EAAA;AAAA,IACF;AAAA,MACE,OAAO;AAAA,MACP,gBAAgB;AAAA,MAChB,sBAAsB;AAAA,MACtB,WAAW;AAAA,MACX,cAAc,CAACW,MACN,EAAEA,aAAiBC,KAAYD,EAAM,SAAS,SAAS,WAAW;AAAA,IAC3E;AAAA,EACF,GAGIE,IAAeL,GAAY,iBAE3B,EAAE,aAAaM,GAAuB,WAAAC,EAAA,IAAcC,EAAA,GAEpDC,IAAe,OAAOC,MAAuC;AACjE,UAAMb,EAAkBa,GAAM,OAAMC,MAAW;AAC7C,YAAM,EAAE,qBAAAC,GAAqB,cAAAC,GAAc,gBAAAC,GAAgB,gBAAAC,GAAgB,SAAAC,MAAYL;AAEvF,UAAI,CAACC,EAAqB;AAE1B,YAAMK,IAAS,MAAMX,EAAsB;AAAA,QACzC,SAAS;AAAA,UACP,YAAAd;AAAA,UACA,aAAa;AAAA,YACX,qBAAAoB;AAAA,YACA,SAASP,GAAc;AAAA,YACvB,GAAIO,MAAwB,wBAC1BE,KAAkB;AAAA,cAChB,cAAc;AAAA,cACd,gBAAAA;AAAA,YAAA;AAAA,YAEJ,GAAIF,MAAwB,WAAW;AAAA,cACrC,GAAIE,KAAkBD,KAAgB,EAAE,cAAAA,GAAc,gBAAAC,EAAA;AAAA,cACtD,gBAAAC;AAAA,cACA,GAAIF,MAAiB,sBAAsB,EAAE,SAAAG,EAAA;AAAA,YAAQ;AAAA,UACvD;AAAA,QACF;AAAA,MACF,CACD;AAED,MAAApB,EAAQsB,EAAgB,sCAAsCD,EAAO,eAAe;AAAA,IACtF,CAAC;AAAA,EACH,GAEME,IAAsDd,IACxD;AAAA,IACE,qBAAqBA,EAAa;AAAA,IAClC,cAAcA,EAAa,gBAAgB;AAAA,IAC3C,gBAAgBA,EAAa,iBACzB,IAAI,KAAKA,EAAa,cAAc,IACpC;AAAA,IACJ,SAASA,EAAa,WAAW;AAAA,EAAA,IAEnC,CAAA;AAEJ,SAAI,CAACE,KAAaN,sBAAmBH,GAAA,CAAA,CAAiB,IAGpD,gBAAAT;AAAA,IAAC+B;AAAA,IAAA;AAAA,MAEC,UAAUX;AAAA,MACV,eAAAU;AAAA,MACA,mBAAmBd,GAAc;AAAA,MACjC,WAAAE;AAAA,IAAA;AAAA,IAJKF,GAAc;AAAA,EAAA;AAOzB;"}
|
|
@@ -7,31 +7,29 @@ import { AuthorizationStatus as q, I9AuthorizationDocumentType as w } from "@gus
|
|
|
7
7
|
import { generateEmploymentEligibilitySchema as L } from "./EmploymentEligibilitySchema.js";
|
|
8
8
|
import { COUNTRIES as k } from "./countries.js";
|
|
9
9
|
import { Flex as b } from "../../../Common/Flex/Flex.js";
|
|
10
|
-
import "
|
|
11
|
-
import "../../../../
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { useI18n as U } from "../../../../i18n/I18n.js";
|
|
20
|
-
import { SelectField as W } from "../../../Common/Fields/SelectField/SelectField.js";
|
|
10
|
+
import { ActionsLayout as P } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
11
|
+
import { useComponentContext as V } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
|
+
import { ComboBoxField as B } from "../../../Common/Fields/ComboBoxField/ComboBoxField.js";
|
|
13
|
+
import { Form as H } from "../../../Common/Form/Form.js";
|
|
14
|
+
import { useI18n as K } from "../../../../i18n/I18n.js";
|
|
15
|
+
import { SelectField as G } from "../../../Common/Fields/SelectField/SelectField.js";
|
|
16
|
+
import { RadioGroupField as M } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
17
|
+
import { TextInputField as U } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
18
|
+
import { DatePickerField as W } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
|
|
21
19
|
const J = {
|
|
22
20
|
citizen: "statusDescriptions.citizen",
|
|
23
21
|
permanent_resident: "statusDescriptions.permanent_resident",
|
|
24
22
|
noncitizen: "statusDescriptions.noncitizen",
|
|
25
23
|
alien: "statusDescriptions.alien"
|
|
26
|
-
},
|
|
24
|
+
}, be = ({
|
|
27
25
|
onSubmit: h,
|
|
28
26
|
defaultValues: f,
|
|
29
27
|
hasDocumentNumber: y,
|
|
30
28
|
isPending: D
|
|
31
29
|
}) => {
|
|
32
|
-
|
|
33
|
-
const { Heading: g, Text: x, Alert: z, Button: E, Link: N } =
|
|
34
|
-
resolver: j(L(
|
|
30
|
+
K("Employee.EmploymentEligibility");
|
|
31
|
+
const { Heading: g, Text: x, Alert: z, Button: E, Link: N } = V(), { t: e } = I("Employee.EmploymentEligibility"), [a, m] = v(!!y), r = O({
|
|
32
|
+
resolver: j(L(a)),
|
|
35
33
|
defaultValues: f
|
|
36
34
|
}), { control: l, setValue: u, clearErrors: c } = r, o = d({ control: l, name: "authorizationStatus" }), s = d({ control: l, name: "documentType" }), S = Object.values(q).map((n) => ({
|
|
37
35
|
value: n,
|
|
@@ -40,11 +38,11 @@ const J = {
|
|
|
40
38
|
value: n,
|
|
41
39
|
label: e(`authorizationDocument.options.${n}`)
|
|
42
40
|
})), C = () => {
|
|
43
|
-
u("documentNumber", ""), c("documentNumber"),
|
|
41
|
+
u("documentNumber", ""), c("documentNumber"), m(!1);
|
|
44
42
|
}, F = () => {
|
|
45
|
-
u("documentNumber", ""), c("documentNumber"),
|
|
43
|
+
u("documentNumber", ""), c("documentNumber"), m(!1);
|
|
46
44
|
}, _ = o === "alien", R = o === "permanent_resident" || o === "alien" && !!s, i = o === "permanent_resident" ? "uscis_alien_registration_number" : s;
|
|
47
|
-
return /* @__PURE__ */ t($, { ...r, children: /* @__PURE__ */ t(
|
|
45
|
+
return /* @__PURE__ */ t($, { ...r, children: /* @__PURE__ */ t(H, { onSubmit: r.handleSubmit(h), children: /* @__PURE__ */ p(b, { flexDirection: "column", gap: 16, children: [
|
|
48
46
|
/* @__PURE__ */ p(b, { flexDirection: "column", gap: 2, children: [
|
|
49
47
|
/* @__PURE__ */ t(g, { as: "h2", children: e("title") }),
|
|
50
48
|
/* @__PURE__ */ t(x, { variant: "supporting", children: /* @__PURE__ */ t(
|
|
@@ -59,7 +57,7 @@ const J = {
|
|
|
59
57
|
) })
|
|
60
58
|
] }),
|
|
61
59
|
/* @__PURE__ */ t(
|
|
62
|
-
|
|
60
|
+
G,
|
|
63
61
|
{
|
|
64
62
|
name: "authorizationStatus",
|
|
65
63
|
label: e("select.label"),
|
|
@@ -78,9 +76,9 @@ const J = {
|
|
|
78
76
|
disableScrollIntoView: !0
|
|
79
77
|
}
|
|
80
78
|
),
|
|
81
|
-
o === "alien" && /* @__PURE__ */ t(
|
|
79
|
+
o === "alien" && /* @__PURE__ */ t(W, { name: "expirationDate", label: e("expirationDate.label") }),
|
|
82
80
|
_ && /* @__PURE__ */ t(
|
|
83
|
-
|
|
81
|
+
M,
|
|
84
82
|
{
|
|
85
83
|
name: "documentType",
|
|
86
84
|
label: e("authorizationDocument.label"),
|
|
@@ -90,17 +88,17 @@ const J = {
|
|
|
90
88
|
}
|
|
91
89
|
),
|
|
92
90
|
R && i && /* @__PURE__ */ t(
|
|
93
|
-
|
|
91
|
+
U,
|
|
94
92
|
{
|
|
95
93
|
name: "documentNumber",
|
|
96
94
|
label: e(`documentNumber.${i}.label`),
|
|
97
95
|
description: i !== "foreign_passport" ? e(`documentNumber.${i}.description`) : void 0,
|
|
98
|
-
placeholder:
|
|
96
|
+
placeholder: a ? e(`documentNumber.${i}.placeholder`) : void 0,
|
|
99
97
|
isRequired: !0
|
|
100
98
|
}
|
|
101
99
|
),
|
|
102
100
|
s === "foreign_passport" && o === "alien" && /* @__PURE__ */ t(
|
|
103
|
-
|
|
101
|
+
B,
|
|
104
102
|
{
|
|
105
103
|
name: "country",
|
|
106
104
|
label: e("country.label"),
|
|
@@ -111,10 +109,10 @@ const J = {
|
|
|
111
109
|
isRequired: !0
|
|
112
110
|
}
|
|
113
111
|
),
|
|
114
|
-
/* @__PURE__ */ t(
|
|
112
|
+
/* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(E, { type: "submit", isLoading: D, children: e("submit") }) })
|
|
115
113
|
] }) }) });
|
|
116
114
|
};
|
|
117
115
|
export {
|
|
118
|
-
|
|
116
|
+
be as EmploymentEligibilityPresentation
|
|
119
117
|
};
|
|
120
118
|
//# sourceMappingURL=EmploymentEligibilityPresentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmploymentEligibilityPresentation.js","sources":["../../../../../src/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { useTranslation, Trans } from 'react-i18next'\nimport { FormProvider, useForm, useWatch, type SubmitHandler } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n AuthorizationStatus,\n I9AuthorizationDocumentType,\n} from '@gusto/embedded-api/models/components/i9authorization'\nimport {\n generateEmploymentEligibilitySchema,\n type EmploymentEligibilityInputs,\n type EmploymentEligibilityPayload,\n} from './EmploymentEligibilitySchema'\nimport { COUNTRIES } from './countries'\nimport {\n Flex,\n SelectField,\n RadioGroupField,\n TextInputField,\n DatePickerField,\n ActionsLayout,\n} from '@/components/Common'\nimport { ComboBoxField } from '@/components/Common/Fields/ComboBoxField/ComboBoxField'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\ninterface EmploymentEligibilityPresentationProps {\n onSubmit: SubmitHandler<EmploymentEligibilityPayload>\n defaultValues?: Partial<EmploymentEligibilityInputs>\n hasDocumentNumber?: boolean | null\n isPending?: boolean\n}\n\nconst statusDescriptionKeys = {\n citizen: 'statusDescriptions.citizen',\n permanent_resident: 'statusDescriptions.permanent_resident',\n noncitizen: 'statusDescriptions.noncitizen',\n alien: 'statusDescriptions.alien',\n} as const satisfies Record<AuthorizationStatus, string>\n\nexport const EmploymentEligibilityPresentation = ({\n onSubmit,\n defaultValues,\n hasDocumentNumber,\n isPending,\n}: EmploymentEligibilityPresentationProps) => {\n useI18n('Employee.EmploymentEligibility')\n const { Heading, Text, Alert, Button, Link } = useComponentContext()\n const { t } = useTranslation('Employee.EmploymentEligibility')\n\n const [hasExistingDocumentNumber, setHasExistingDocumentNumber] = useState(!!hasDocumentNumber)\n\n const formMethods = useForm<EmploymentEligibilityInputs, unknown, EmploymentEligibilityPayload>({\n resolver: zodResolver(generateEmploymentEligibilitySchema(hasExistingDocumentNumber)),\n defaultValues,\n })\n\n const { control, setValue, clearErrors } = formMethods\n const authorizationStatus = useWatch({ control, name: 'authorizationStatus' })\n const documentType = useWatch({ control, name: 'documentType' })\n\n const statusOptions = Object.values(AuthorizationStatus).map(value => ({\n value,\n label: t(`select.options.${value}`),\n }))\n\n const authorizationDocumentOptions = Object.values(I9AuthorizationDocumentType).map(value => ({\n value,\n label: t(`authorizationDocument.options.${value}`),\n }))\n\n const handleAuthorizationStatusChange = () => {\n setValue('documentNumber', '')\n clearErrors('documentNumber')\n setHasExistingDocumentNumber(false)\n }\n\n const handleDocumentTypeChange = () => {\n setValue('documentNumber', '')\n clearErrors('documentNumber')\n setHasExistingDocumentNumber(false)\n }\n\n const showDocumentTypeRadio = authorizationStatus === 'alien'\n const showDocumentNumberInput =\n authorizationStatus === 'permanent_resident' ||\n (authorizationStatus === 'alien' && !!documentType)\n const activeDocumentType =\n authorizationStatus === 'permanent_resident' ? 'uscis_alien_registration_number' : documentType\n\n return (\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={16}>\n <Flex flexDirection=\"column\" gap={2}>\n <Heading as=\"h2\">{t('title')}</Heading>\n <Text variant=\"supporting\">\n <Trans\n i18nKey={'subtitle'}\n t={t}\n components={{\n formI9Link: <Link />,\n }}\n />\n </Text>\n </Flex>\n\n <SelectField\n name=\"authorizationStatus\"\n label={t('select.label')}\n description={t('select.description')}\n placeholder={t('select.placeholder')}\n options={statusOptions}\n isRequired\n onChange={handleAuthorizationStatusChange}\n />\n\n {authorizationStatus && (\n <Alert\n status=\"info\"\n label={t(statusDescriptionKeys[authorizationStatus])}\n disableScrollIntoView\n />\n )}\n\n {authorizationStatus === 'alien' && (\n <DatePickerField name=\"expirationDate\" label={t('expirationDate.label')} />\n )}\n\n {showDocumentTypeRadio && (\n <RadioGroupField\n name=\"documentType\"\n label={t('authorizationDocument.label')}\n options={authorizationDocumentOptions}\n isRequired\n onChange={handleDocumentTypeChange}\n />\n )}\n\n {showDocumentNumberInput && activeDocumentType && (\n <TextInputField\n name=\"documentNumber\"\n label={t(`documentNumber.${activeDocumentType}.label`)}\n description={\n activeDocumentType !== 'foreign_passport'\n ? t(`documentNumber.${activeDocumentType}.description`)\n : undefined\n }\n placeholder={\n hasExistingDocumentNumber\n ? t(`documentNumber.${activeDocumentType}.placeholder`)\n : undefined\n }\n isRequired\n />\n )}\n\n {documentType === 'foreign_passport' && authorizationStatus === 'alien' && (\n <ComboBoxField\n name=\"country\"\n label={t('country.label')}\n description={t('country.description')}\n options={COUNTRIES}\n placeholder={t('country.placeholder')}\n allowsCustomValue\n isRequired\n />\n )}\n\n <ActionsLayout>\n <Button type=\"submit\" isLoading={isPending}>\n {t('submit')}\n </Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </FormProvider>\n )\n}\n"],"names":["statusDescriptionKeys","EmploymentEligibilityPresentation","onSubmit","defaultValues","hasDocumentNumber","isPending","useI18n","Heading","Text","Alert","Button","Link","useComponentContext","t","useTranslation","hasExistingDocumentNumber","setHasExistingDocumentNumber","useState","formMethods","useForm","zodResolver","generateEmploymentEligibilitySchema","control","setValue","clearErrors","authorizationStatus","useWatch","documentType","statusOptions","AuthorizationStatus","value","authorizationDocumentOptions","I9AuthorizationDocumentType","handleAuthorizationStatusChange","handleDocumentTypeChange","showDocumentTypeRadio","showDocumentNumberInput","activeDocumentType","FormProvider","jsx","Form","jsxs","Flex","Trans","SelectField","DatePickerField","RadioGroupField","TextInputField","ComboBoxField","COUNTRIES","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkCA,MAAMA,IAAwB;AAAA,EAC5B,SAAS;AAAA,EACT,oBAAoB;AAAA,EACpB,YAAY;AAAA,EACZ,OAAO;AACT,GAEaC,KAAoC,CAAC;AAAA,EAChD,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,WAAAC;AACF,MAA8C;AAC5C,EAAAC,EAAQ,gCAAgC;AACxC,QAAM,EAAE,SAAAC,GAAS,MAAAC,GAAM,OAAAC,GAAO,QAAAC,GAAQ,MAAAC,EAAA,IAASC,EAAA,GACzC,EAAE,GAAAC,EAAA,IAAMC,EAAe,gCAAgC,GAEvD,CAACC,GAA2BC,CAA4B,IAAIC,EAAS,CAAC,CAACb,CAAiB,GAExFc,IAAcC,EAA4E;AAAA,IAC9F,UAAUC,EAAYC,EAAoCN,CAAyB,CAAC;AAAA,IACpF,eAA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,MAAK;AAAA,QACL,OAAOnC,EAAE,eAAe;AAAA,QACxB,aAAaA,EAAE,qBAAqB;AAAA,QACpC,SAASoC;AAAA,QACT,aAAapC,EAAE,qBAAqB;AAAA,QACpC,mBAAiB;AAAA,QACjB,YAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAId,gBAAA0B,EAACW,GAAA,EACC,UAAA,gBAAAX,EAAC7B,GAAA,EAAO,MAAK,UAAS,WAAWL,GAC9B,UAAAQ,EAAE,QAAQ,EAAA,CACb,EAAA,CACF;AAAA,EAAA,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"EmploymentEligibilityPresentation.js","sources":["../../../../../src/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { useTranslation, Trans } from 'react-i18next'\nimport { FormProvider, useForm, useWatch, type SubmitHandler } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n AuthorizationStatus,\n I9AuthorizationDocumentType,\n} from '@gusto/embedded-api/models/components/i9authorization'\nimport {\n generateEmploymentEligibilitySchema,\n type EmploymentEligibilityInputs,\n type EmploymentEligibilityPayload,\n} from './EmploymentEligibilitySchema'\nimport { COUNTRIES } from './countries'\nimport {\n Flex,\n SelectField,\n RadioGroupField,\n TextInputField,\n DatePickerField,\n ActionsLayout,\n} from '@/components/Common'\nimport { ComboBoxField } from '@/components/Common/Fields/ComboBoxField/ComboBoxField'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\ninterface EmploymentEligibilityPresentationProps {\n onSubmit: SubmitHandler<EmploymentEligibilityPayload>\n defaultValues?: Partial<EmploymentEligibilityInputs>\n hasDocumentNumber?: boolean | null\n isPending?: boolean\n}\n\nconst statusDescriptionKeys = {\n citizen: 'statusDescriptions.citizen',\n permanent_resident: 'statusDescriptions.permanent_resident',\n noncitizen: 'statusDescriptions.noncitizen',\n alien: 'statusDescriptions.alien',\n} as const satisfies Record<AuthorizationStatus, string>\n\nexport const EmploymentEligibilityPresentation = ({\n onSubmit,\n defaultValues,\n hasDocumentNumber,\n isPending,\n}: EmploymentEligibilityPresentationProps) => {\n useI18n('Employee.EmploymentEligibility')\n const { Heading, Text, Alert, Button, Link } = useComponentContext()\n const { t } = useTranslation('Employee.EmploymentEligibility')\n\n const [hasExistingDocumentNumber, setHasExistingDocumentNumber] = useState(!!hasDocumentNumber)\n\n const formMethods = useForm<EmploymentEligibilityInputs, unknown, EmploymentEligibilityPayload>({\n resolver: zodResolver(generateEmploymentEligibilitySchema(hasExistingDocumentNumber)),\n defaultValues,\n })\n\n const { control, setValue, clearErrors } = formMethods\n const authorizationStatus = useWatch({ control, name: 'authorizationStatus' })\n const documentType = useWatch({ control, name: 'documentType' })\n\n const statusOptions = Object.values(AuthorizationStatus).map(value => ({\n value,\n label: t(`select.options.${value}`),\n }))\n\n const authorizationDocumentOptions = Object.values(I9AuthorizationDocumentType).map(value => ({\n value,\n label: t(`authorizationDocument.options.${value}`),\n }))\n\n const handleAuthorizationStatusChange = () => {\n setValue('documentNumber', '')\n clearErrors('documentNumber')\n setHasExistingDocumentNumber(false)\n }\n\n const handleDocumentTypeChange = () => {\n setValue('documentNumber', '')\n clearErrors('documentNumber')\n setHasExistingDocumentNumber(false)\n }\n\n const showDocumentTypeRadio = authorizationStatus === 'alien'\n const showDocumentNumberInput =\n authorizationStatus === 'permanent_resident' ||\n (authorizationStatus === 'alien' && !!documentType)\n const activeDocumentType =\n authorizationStatus === 'permanent_resident' ? 'uscis_alien_registration_number' : documentType\n\n return (\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={16}>\n <Flex flexDirection=\"column\" gap={2}>\n <Heading as=\"h2\">{t('title')}</Heading>\n <Text variant=\"supporting\">\n <Trans\n i18nKey={'subtitle'}\n t={t}\n components={{\n formI9Link: <Link />,\n }}\n />\n </Text>\n </Flex>\n\n <SelectField\n name=\"authorizationStatus\"\n label={t('select.label')}\n description={t('select.description')}\n placeholder={t('select.placeholder')}\n options={statusOptions}\n isRequired\n onChange={handleAuthorizationStatusChange}\n />\n\n {authorizationStatus && (\n <Alert\n status=\"info\"\n label={t(statusDescriptionKeys[authorizationStatus])}\n disableScrollIntoView\n />\n )}\n\n {authorizationStatus === 'alien' && (\n <DatePickerField name=\"expirationDate\" label={t('expirationDate.label')} />\n )}\n\n {showDocumentTypeRadio && (\n <RadioGroupField\n name=\"documentType\"\n label={t('authorizationDocument.label')}\n options={authorizationDocumentOptions}\n isRequired\n onChange={handleDocumentTypeChange}\n />\n )}\n\n {showDocumentNumberInput && activeDocumentType && (\n <TextInputField\n name=\"documentNumber\"\n label={t(`documentNumber.${activeDocumentType}.label`)}\n description={\n activeDocumentType !== 'foreign_passport'\n ? t(`documentNumber.${activeDocumentType}.description`)\n : undefined\n }\n placeholder={\n hasExistingDocumentNumber\n ? t(`documentNumber.${activeDocumentType}.placeholder`)\n : undefined\n }\n isRequired\n />\n )}\n\n {documentType === 'foreign_passport' && authorizationStatus === 'alien' && (\n <ComboBoxField\n name=\"country\"\n label={t('country.label')}\n description={t('country.description')}\n options={COUNTRIES}\n placeholder={t('country.placeholder')}\n allowsCustomValue\n isRequired\n />\n )}\n\n <ActionsLayout>\n <Button type=\"submit\" isLoading={isPending}>\n {t('submit')}\n </Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </FormProvider>\n )\n}\n"],"names":["statusDescriptionKeys","EmploymentEligibilityPresentation","onSubmit","defaultValues","hasDocumentNumber","isPending","useI18n","Heading","Text","Alert","Button","Link","useComponentContext","t","useTranslation","hasExistingDocumentNumber","setHasExistingDocumentNumber","useState","formMethods","useForm","zodResolver","generateEmploymentEligibilitySchema","control","setValue","clearErrors","authorizationStatus","useWatch","documentType","statusOptions","AuthorizationStatus","value","authorizationDocumentOptions","I9AuthorizationDocumentType","handleAuthorizationStatusChange","handleDocumentTypeChange","showDocumentTypeRadio","showDocumentNumberInput","activeDocumentType","FormProvider","jsx","Form","jsxs","Flex","Trans","SelectField","DatePickerField","RadioGroupField","TextInputField","ComboBoxField","COUNTRIES","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;;AAkCA,MAAMA,IAAwB;AAAA,EAC5B,SAAS;AAAA,EACT,oBAAoB;AAAA,EACpB,YAAY;AAAA,EACZ,OAAO;AACT,GAEaC,KAAoC,CAAC;AAAA,EAChD,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,WAAAC;AACF,MAA8C;AAC5C,EAAAC,EAAQ,gCAAgC;AACxC,QAAM,EAAE,SAAAC,GAAS,MAAAC,GAAM,OAAAC,GAAO,QAAAC,GAAQ,MAAAC,EAAA,IAASC,EAAA,GACzC,EAAE,GAAAC,EAAA,IAAMC,EAAe,gCAAgC,GAEvD,CAACC,GAA2BC,CAA4B,IAAIC,EAAS,CAAC,CAACb,CAAiB,GAExFc,IAAcC,EAA4E;AAAA,IAC9F,UAAUC,EAAYC,EAAoCN,CAAyB,CAAC;AAAA,IACpF,eAAAZ;AAAA,EAAA,CACD,GAEK,EAAE,SAAAmB,GAAS,UAAAC,GAAU,aAAAC,EAAA,IAAgBN,GACrCO,IAAsBC,EAAS,EAAE,SAAAJ,GAAS,MAAM,uBAAuB,GACvEK,IAAeD,EAAS,EAAE,SAAAJ,GAAS,MAAM,gBAAgB,GAEzDM,IAAgB,OAAO,OAAOC,CAAmB,EAAE,IAAI,CAAAC,OAAU;AAAA,IACrE,OAAAA;AAAA,IACA,OAAOjB,EAAE,kBAAkBiB,CAAK,EAAE;AAAA,EAAA,EAClC,GAEIC,IAA+B,OAAO,OAAOC,CAA2B,EAAE,IAAI,CAAAF,OAAU;AAAA,IAC5F,OAAAA;AAAA,IACA,OAAOjB,EAAE,iCAAiCiB,CAAK,EAAE;AAAA,EAAA,EACjD,GAEIG,IAAkC,MAAM;AAC5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C;AAAA,QACnD,uBAAqB;AAAA,MAAA;AAAA,IAAA;AAAA,IAIxBA,MAAwB,WACvB,gBAAAc,EAACM,GAAA,EAAgB,MAAK,kBAAiB,OAAOhC,EAAE,sBAAsB,GAAG;AAAA,IAG1EsB,KACC,gBAAAI;AAAA,MAACO;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOjC,EAAE,6BAA6B;AAAA,QACtC,SAASkB;AAAA,QACT,YAAU;AAAA,QACV,UAAUG;AAAA,MAAA;AAAA,IAAA;AAAA,IAIbE,KAA2BC,KAC1B,gBAAAE;AAAA,MAACQ;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOlC,EAAE,kBAAkBwB,CAAkB,QAAQ;AAAA,QACrD,aACEA,MAAuB,qBACnBxB,EAAE,kBAAkBwB,CAAkB,cAAc,IACpD;AAAA,QAEN,aACEtB,IACIF,EAAE,kBAAkBwB,CAAkB,cAAc,IACpD;AAAA,QAEN,YAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAIbV,MAAiB,sBAAsBF,MAAwB,WAC9D,gBAAAc;AAAA,MAACS;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOnC,EAAE,eAAe;AAAA,QACxB,aAAaA,EAAE,qBAAqB;AAAA,QACpC,SAASoC;AAAA,QACT,aAAapC,EAAE,qBAAqB;AAAA,QACpC,mBAAiB;AAAA,QACjB,YAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAId,gBAAA0B,EAACW,GAAA,EACC,UAAA,gBAAAX,EAAC7B,GAAA,EAAO,MAAK,UAAS,WAAWL,GAC9B,UAAAQ,EAAE,QAAQ,EAAA,CACb,EAAA,CACF;AAAA,EAAA,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
@@ -12,14 +12,13 @@ import { useBase as j } from "../../../Base/useBase.js";
|
|
|
12
12
|
import { useI18n as G } from "../../../../i18n/I18n.js";
|
|
13
13
|
import { componentEvents as C, STATES_ABBR as H } from "../../../../shared/constants.js";
|
|
14
14
|
import { Flex as b } from "../../../Common/Flex/Flex.js";
|
|
15
|
-
import "
|
|
16
|
-
import { RadioGroupField as O } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
17
|
-
import { TextInputField as p } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
18
|
-
import { ActionsLayout as V } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
15
|
+
import { ActionsLayout as O } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
19
16
|
import { useComponentContext as E } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
20
17
|
import "react";
|
|
21
|
-
import { Form as
|
|
18
|
+
import { Form as V } from "../../../Common/Form/Form.js";
|
|
19
|
+
import { TextInputField as p } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
22
20
|
import { CheckboxField as R } from "../../../Common/Fields/CheckboxField/CheckboxField.js";
|
|
21
|
+
import { RadioGroupField as Z } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
23
22
|
import { SelectField as U } from "../../../Common/Fields/SelectField/SelectField.js";
|
|
24
23
|
import { DocumentViewer as Y } from "../../../Common/DocumentViewer/DocumentViewer.js";
|
|
25
24
|
const K = 4, Q = l.object({
|
|
@@ -38,7 +37,7 @@ const K = 4, Q = l.object({
|
|
|
38
37
|
usedPreparer: l.enum(["yes", "no"]),
|
|
39
38
|
preparers: l.array(Q)
|
|
40
39
|
});
|
|
41
|
-
function
|
|
40
|
+
function Re(n) {
|
|
42
41
|
return /* @__PURE__ */ e(_, { ...n, children: /* @__PURE__ */ e(J, { ...n }) });
|
|
43
42
|
}
|
|
44
43
|
function J({ employeeId: n, formId: i, className: s }) {
|
|
@@ -70,7 +69,7 @@ function J({ employeeId: n, formId: i, className: s }) {
|
|
|
70
69
|
o(C.EMPLOYEE_SIGN_FORM, M);
|
|
71
70
|
});
|
|
72
71
|
};
|
|
73
|
-
return /* @__PURE__ */ e("section", { className: s, children: /* @__PURE__ */ e(I, { ...F, children: /* @__PURE__ */ e(
|
|
72
|
+
return /* @__PURE__ */ e("section", { className: s, children: /* @__PURE__ */ e(I, { ...F, children: /* @__PURE__ */ e(V, { onSubmit: F.handleSubmit(N), children: /* @__PURE__ */ u(b, { flexDirection: "column", gap: 20, children: [
|
|
74
73
|
/* @__PURE__ */ u("section", { children: [
|
|
75
74
|
/* @__PURE__ */ e(m.Heading, { as: "h2", children: t("title") }),
|
|
76
75
|
/* @__PURE__ */ e(m.Text, { children: /* @__PURE__ */ e(
|
|
@@ -123,7 +122,7 @@ function J({ employeeId: n, formId: i, className: s }) {
|
|
|
123
122
|
)
|
|
124
123
|
] }),
|
|
125
124
|
/* @__PURE__ */ e(W, {}),
|
|
126
|
-
/* @__PURE__ */ u(
|
|
125
|
+
/* @__PURE__ */ u(O, { children: [
|
|
127
126
|
/* @__PURE__ */ e(m.Button, { variant: "secondary", type: "button", onClick: $, children: t("cancelCta") }),
|
|
128
127
|
/* @__PURE__ */ e(m.Button, { type: "submit", isLoading: c, children: t("signCta") })
|
|
129
128
|
] })
|
|
@@ -148,7 +147,7 @@ function W() {
|
|
|
148
147
|
};
|
|
149
148
|
return /* @__PURE__ */ u(b, { flexDirection: "column", gap: 20, children: [
|
|
150
149
|
/* @__PURE__ */ e(
|
|
151
|
-
|
|
150
|
+
Z,
|
|
152
151
|
{
|
|
153
152
|
name: "usedPreparer",
|
|
154
153
|
label: n("preparerQuestion"),
|
|
@@ -279,6 +278,6 @@ function re(n) {
|
|
|
279
278
|
}), i;
|
|
280
279
|
}
|
|
281
280
|
export {
|
|
282
|
-
|
|
281
|
+
Re as I9SignatureForm
|
|
283
282
|
};
|
|
284
283
|
//# sourceMappingURL=I9SignatureForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"I9SignatureForm.js","sources":["../../../../../src/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { FormProvider, useFieldArray, useForm, useFormContext } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useTranslation, Trans } from 'react-i18next'\nimport { useEmployeeFormsGetPdfSuspense } from '@gusto/embedded-api/react-query/employeeFormsGetPdf'\nimport { useEmployeeFormsSignMutation } from '@gusto/embedded-api/react-query/employeeFormsSign'\nimport { useEmployeeFormsGetSuspense } from '@gusto/embedded-api/react-query/employeeFormsGet'\nimport styles from './I9SignatureForm.module.scss'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents, STATES_ABBR } from '@/shared/constants'\nimport {\n ActionsLayout,\n CheckboxField,\n Flex,\n RadioGroupField,\n SelectField,\n TextInputField,\n} from '@/components/Common'\nimport { DocumentViewer } from '@/components/Common/DocumentViewer'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nconst MAX_PREPARERS = 4\n\nconst preparerSchema = z.object({\n firstName: z.string().min(1),\n lastName: z.string().min(1),\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().min(1),\n signature: z.string().min(1),\n agree: z.boolean().refine(val => val),\n})\n\nexport type PreparerInputs = z.infer<typeof preparerSchema>\n\nconst i9SignatureFormSchema = z.object({\n signature: z.string().min(1),\n agree: z.literal(true),\n usedPreparer: z.enum(['yes', 'no']),\n preparers: z.array(preparerSchema),\n})\n\nexport type I9SignatureFormInputs = z.infer<typeof i9SignatureFormSchema>\n\ninterface I9SignatureFormProps extends CommonComponentInterface {\n employeeId: string\n formId: string\n}\n\nexport function I9SignatureForm(props: I9SignatureFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, formId, className }: I9SignatureFormProps) {\n useI18n('Employee.I9SignatureForm')\n const { t } = useTranslation('Employee.I9SignatureForm')\n const { onEvent, baseSubmitHandler } = useBase()\n const Components = useComponentContext()\n\n const { data: formData } = useEmployeeFormsGetSuspense({ employeeId, formId })\n const form = formData.form!\n\n const {\n data: { formPdf },\n } = useEmployeeFormsGetPdfSuspense({ employeeId, formId: form.uuid })\n const pdfUrl = formPdf?.documentUrl\n\n const { mutateAsync: signForm, isPending } = useEmployeeFormsSignMutation()\n\n const methods = useForm<I9SignatureFormInputs>({\n resolver: zodResolver(i9SignatureFormSchema),\n defaultValues: {\n signature: '',\n usedPreparer: 'no',\n preparers: [],\n },\n })\n\n const handleBack = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n const handleSubmit = async (data: I9SignatureFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n const preparerPayload = buildPreparerPayload(payload)\n const { form: signFormResult } = await signForm({\n request: {\n employeeId,\n formId: form.uuid,\n requestBody: {\n signatureText: payload.signature,\n agree: payload.agree,\n ...preparerPayload,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_SIGN_FORM, signFormResult)\n })\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods}>\n <Form onSubmit={methods.handleSubmit(handleSubmit)}>\n <Flex flexDirection=\"column\" gap={20}>\n <section>\n <Components.Heading as=\"h2\">{t('title')}</Components.Heading>\n <Components.Text>\n <Trans\n i18nKey=\"description\"\n t={t}\n components={{\n viewFormLink: pdfUrl ? (\n <Components.Link\n href={pdfUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n download={`${form.title || 'form'}.pdf`}\n />\n ) : (\n <span />\n ),\n }}\n />\n </Components.Text>\n </section>\n\n <DocumentViewer\n url={pdfUrl}\n title={form.title}\n downloadInstructions={t('downloadInstructions')}\n viewDocumentLabel={t('viewDocumentCta')}\n />\n\n <Flex flexDirection=\"column\" gap={12}>\n <TextInputField\n name=\"signature\"\n label={t('signatureLabel')}\n description={t('signatureDescription')}\n errorMessage={t('signatureError')}\n isRequired\n />\n <CheckboxField\n name=\"agree\"\n isRequired\n label={t('confirmationLabel')}\n errorMessage={t('confirmationError')}\n />\n </Flex>\n\n <PreparerSection />\n\n <ActionsLayout>\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleBack}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('signCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </FormProvider>\n </section>\n )\n}\n\nconst emptyPreparer = {\n firstName: '',\n lastName: '',\n street1: '',\n street2: '',\n city: '',\n state: '',\n zip: '',\n signature: '',\n agree: false,\n}\n\nfunction PreparerSection() {\n const { t } = useTranslation('Employee.I9SignatureForm')\n const Components = useComponentContext()\n const { watch, control } = useFormContext<I9SignatureFormInputs>()\n const { fields, append, remove } = useFieldArray({ control, name: 'preparers' })\n\n const usedPreparer = watch('usedPreparer')\n const canAddPreparer = fields.length < MAX_PREPARERS\n\n const handlePreparerChange = (value: string) => {\n if (value === 'yes' && fields.length === 0) {\n append(emptyPreparer)\n }\n if (value === 'no' && fields.length > 0) {\n remove()\n }\n }\n\n const handleAddPreparer = () => {\n if (canAddPreparer) {\n append(emptyPreparer)\n }\n }\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <RadioGroupField\n name=\"usedPreparer\"\n label={t('preparerQuestion')}\n isRequired\n options={[\n { label: t('preparerNo'), value: 'no' },\n { label: t('preparerYes'), value: 'yes' },\n ]}\n onChange={handlePreparerChange}\n />\n\n {usedPreparer === 'yes' &&\n fields.map((field, index) => (\n <Flex flexDirection=\"column\" gap={0} key={field.id}>\n <div className={styles.preparerAlert}>\n <Components.Alert label={t('preparerNote')} status=\"info\" disableScrollIntoView />\n </div>\n <PreparerFields\n index={index}\n onRemove={() => {\n remove(index)\n }}\n showRemoveButton={index !== 0 && index === fields.length - 1}\n showAddButton={canAddPreparer && index === fields.length - 1}\n onAdd={handleAddPreparer}\n />\n </Flex>\n ))}\n </Flex>\n )\n}\n\ninterface PreparerFieldsProps {\n index: number\n onRemove: () => void\n showRemoveButton: boolean\n showAddButton: boolean\n onAdd: () => void\n}\n\nfunction PreparerFields({\n index,\n onRemove,\n showRemoveButton,\n showAddButton,\n onAdd,\n}: PreparerFieldsProps) {\n const { t } = useTranslation('Employee.I9SignatureForm')\n const Components = useComponentContext()\n\n const stateOptions = STATES_ABBR.map(abbr => ({ label: abbr, value: abbr }))\n const fieldId = `preparers.${index}`\n\n return (\n <Flex flexDirection=\"column\" gap={12}>\n <Components.Heading as=\"h3\">{t('preparerSectionTitle')}</Components.Heading>\n\n <TextInputField\n name={`${fieldId}.firstName`}\n label={t('preparerFirstNameLabel')}\n errorMessage={t('preparerFirstNameError')}\n isRequired\n />\n <TextInputField\n name={`${fieldId}.lastName`}\n label={t('preparerLastNameLabel')}\n errorMessage={t('preparerLastNameError')}\n isRequired\n />\n <TextInputField\n name={`${fieldId}.street1`}\n label={t('preparerStreet1Label')}\n errorMessage={t('preparerStreet1Error')}\n isRequired\n />\n <TextInputField name={`${fieldId}.street2`} label={t('preparerStreet2Label')} />\n <TextInputField\n name={`${fieldId}.city`}\n label={t('preparerCityLabel')}\n errorMessage={t('preparerCityError')}\n isRequired\n />\n <SelectField\n name={`${fieldId}.state`}\n label={t('preparerStateLabel')}\n errorMessage={t('preparerStateError')}\n isRequired\n options={stateOptions}\n placeholder=\"Select a state...\"\n />\n <TextInputField\n name={`${fieldId}.zip`}\n label={t('preparerZipLabel')}\n errorMessage={t('preparerZipError')}\n isRequired\n />\n <TextInputField\n name={`${fieldId}.signature`}\n label={t('preparerSignatureLabel')}\n description={t('preparerSignatureDescription')}\n errorMessage={t('preparerSignatureError')}\n isRequired\n />\n <CheckboxField\n name={`${fieldId}.agree`}\n isRequired\n label={t('preparerConfirmationLabel')}\n errorMessage={t('preparerConfirmationError')}\n />\n\n {(showAddButton || showRemoveButton) && (\n <div className={styles.preparerActions}>\n {showAddButton && (\n <Components.Button type=\"button\" variant=\"secondary\" onClick={onAdd}>\n {t('addPreparerCta')}\n </Components.Button>\n )}\n {showRemoveButton && (\n <Components.Button type=\"button\" variant=\"error\" onClick={onRemove}>\n {t('removePreparerCta')}\n </Components.Button>\n )}\n </div>\n )}\n </Flex>\n )\n}\n\nfunction buildPreparerPayload(payload: I9SignatureFormInputs) {\n if (payload.usedPreparer !== 'yes' || payload.preparers.length === 0) {\n return { preparer: false }\n }\n\n const result: Record<string, unknown> = { preparer: true }\n\n payload.preparers.forEach((preparer, index) => {\n const prefix = index === 0 ? 'preparer' : `preparer${index + 1}`\n if (index > 0) {\n result[`preparer${index + 1}`] = true\n }\n result[`${prefix}FirstName`] = preparer.firstName\n result[`${prefix}LastName`] = preparer.lastName\n result[`${prefix}Street1`] = preparer.street1\n if (preparer.street2) result[`${prefix}Street2`] = preparer.street2\n result[`${prefix}City`] = preparer.city\n result[`${prefix}State`] = preparer.state\n result[`${prefix}Zip`] = preparer.zip\n result[`${prefix}Agree`] = 'true'\n })\n\n return result\n}\n"],"names":["MAX_PREPARERS","preparerSchema","z","val","i9SignatureFormSchema","I9SignatureForm","props","jsx","BaseComponent","Root","employeeId","formId","className","useI18n","useTranslation","onEvent","baseSubmitHandler","useBase","Components","useComponentContext","formData","useEmployeeFormsGetSuspense","form","formPdf","useEmployeeFormsGetPdfSuspense","pdfUrl","signForm","isPending","useEmployeeFormsSignMutation","methods","useForm","zodResolver","handleBack","componentEvents","handleSubmit","data","payload","preparerPayload","buildPreparerPayload","signFormResult","FormProvider","Form","jsxs","Flex","Trans","DocumentViewer","TextInputField","CheckboxField","PreparerSection","ActionsLayout","emptyPreparer","t","watch","control","useFormContext","fields","append","remove","useFieldArray","usedPreparer","canAddPreparer","handlePreparerChange","value","handleAddPreparer","RadioGroupField","field","index","styles","PreparerFields","onRemove","showRemoveButton","showAddButton","onAdd","stateOptions","STATES_ABBR","abbr","fieldId","SelectField","result","preparer","prefix"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAMA,IAAgB,GAEhBC,IAAiBC,EAAE,OAAO;AAAA,E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ignatureForm/I9SignatureForm.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { FormProvider, useFieldArray, useForm, useFormContext } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useTranslation, Trans } from 'react-i18next'\nimport { useEmployeeFormsGetPdfSuspense } from '@gusto/embedded-api/react-query/employeeFormsGetPdf'\nimport { useEmployeeFormsSignMutation } from '@gusto/embedded-api/react-query/employeeFormsSign'\nimport { useEmployeeFormsGetSuspense } from '@gusto/embedded-api/react-query/employeeFormsGet'\nimport styles from './I9SignatureForm.module.scss'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents, STATES_ABBR } from '@/shared/constants'\nimport {\n ActionsLayout,\n CheckboxField,\n Flex,\n RadioGroupField,\n SelectField,\n TextInputField,\n} from '@/components/Common'\nimport { DocumentViewer } from '@/components/Common/DocumentViewer'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nconst MAX_PREPARERS = 4\n\nconst preparerSchema = z.object({\n firstName: z.string().min(1),\n lastName: z.string().min(1),\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().min(1),\n signature: z.string().min(1),\n agree: z.boolean().refine(val => val),\n})\n\nexport type PreparerInputs = z.infer<typeof preparerSchema>\n\nconst i9SignatureFormSchema = z.object({\n signature: z.string().min(1),\n agree: z.literal(true),\n usedPreparer: z.enum(['yes', 'no']),\n preparers: z.array(preparerSchema),\n})\n\nexport type I9SignatureFormInputs = z.infer<typeof i9SignatureFormSchema>\n\ninterface I9SignatureFormProps extends CommonComponentInterface {\n employeeId: string\n formId: string\n}\n\nexport function I9SignatureForm(props: I9SignatureFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, formId, className }: I9SignatureFormProps) {\n useI18n('Employee.I9SignatureForm')\n const { t } = useTranslation('Employee.I9SignatureForm')\n const { onEvent, baseSubmitHandler } = useBase()\n const Components = useComponentContext()\n\n const { data: formData } = useEmployeeFormsGetSuspense({ employeeId, formId })\n const form = formData.form!\n\n const {\n data: { formPdf },\n } = useEmployeeFormsGetPdfSuspense({ employeeId, formId: form.uuid })\n const pdfUrl = formPdf?.documentUrl\n\n const { mutateAsync: signForm, isPending } = useEmployeeFormsSignMutation()\n\n const methods = useForm<I9SignatureFormInputs>({\n resolver: zodResolver(i9SignatureFormSchema),\n defaultValues: {\n signature: '',\n usedPreparer: 'no',\n preparers: [],\n },\n })\n\n const handleBack = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n const handleSubmit = async (data: I9SignatureFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n const preparerPayload = buildPreparerPayload(payload)\n const { form: signFormResult } = await signForm({\n request: {\n employeeId,\n formId: form.uuid,\n requestBody: {\n signatureText: payload.signature,\n agree: payload.agree,\n ...preparerPayload,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_SIGN_FORM, signFormResult)\n })\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods}>\n <Form onSubmit={methods.handleSubmit(handleSubmit)}>\n <Flex flexDirection=\"column\" gap={20}>\n <section>\n <Components.Heading as=\"h2\">{t('title')}</Components.Heading>\n <Components.Text>\n <Trans\n i18nKey=\"description\"\n t={t}\n components={{\n viewFormLink: pdfUrl ? (\n <Components.Link\n href={pdfUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n download={`${form.title || 'form'}.pdf`}\n />\n ) : (\n <span />\n ),\n }}\n />\n </Components.Text>\n </section>\n\n <DocumentViewer\n url={pdfUrl}\n title={form.title}\n downloadInstructions={t('downloadInstructions')}\n viewDocumentLabel={t('viewDocumentCta')}\n />\n\n <Flex flexDirection=\"column\" gap={12}>\n <TextInputField\n name=\"signature\"\n label={t('signatureLabel')}\n description={t('signatureDescription')}\n errorMessage={t('signatureError')}\n isRequired\n />\n <CheckboxField\n name=\"agree\"\n isRequired\n label={t('confirmationLabel')}\n errorMessage={t('confirmationError')}\n />\n </Flex>\n\n <PreparerSection />\n\n <ActionsLayout>\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleBack}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('signCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </FormProvider>\n </section>\n )\n}\n\nconst emptyPreparer = {\n firstName: '',\n lastName: '',\n street1: '',\n street2: '',\n city: '',\n state: '',\n zip: '',\n signature: '',\n agree: false,\n}\n\nfunction PreparerSection() {\n const { t } = useTranslation('Employee.I9SignatureForm')\n const Components = useComponentContext()\n const { watch, control } = useFormContext<I9SignatureFormInputs>()\n const { fields, append, remove } = useFieldArray({ control, name: 'preparers' })\n\n const usedPreparer = watch('usedPreparer')\n const canAddPreparer = fields.length < MAX_PREPARERS\n\n const handlePreparerChange = (value: string) => {\n if (value === 'yes' && fields.length === 0) {\n append(emptyPreparer)\n }\n if (value === 'no' && fields.length > 0) {\n remove()\n }\n }\n\n const handleAddPreparer = () => {\n if (canAddPreparer) {\n append(emptyPreparer)\n }\n }\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <RadioGroupField\n name=\"usedPreparer\"\n label={t('preparerQuestion')}\n isRequired\n options={[\n { label: t('preparerNo'), value: 'no' },\n { label: t('preparerYes'), value: 'yes' },\n ]}\n onChange={handlePreparerChange}\n />\n\n {usedPreparer === 'yes' &&\n fields.map((field, index) => (\n <Flex flexDirection=\"column\" gap={0} key={field.id}>\n <div className={styles.preparerAlert}>\n <Components.Alert label={t('preparerNote')} status=\"info\" disableScrollIntoView />\n </div>\n <PreparerFields\n index={index}\n onRemove={() => {\n remove(index)\n }}\n showRemoveButton={index !== 0 && index === fields.length - 1}\n showAddButton={canAddPreparer && index === fields.length - 1}\n onAdd={handleAddPreparer}\n />\n </Flex>\n ))}\n </Flex>\n )\n}\n\ninterface PreparerFieldsProps {\n index: number\n onRemove: () => void\n showRemoveButton: boolean\n showAddButton: boolean\n onAdd: () => void\n}\n\nfunction PreparerFields({\n index,\n onRemove,\n showRemoveButton,\n showAddButton,\n onAdd,\n}: PreparerFieldsProps) {\n const { t } = useTranslation('Employee.I9SignatureForm')\n const Components = useComponentContext()\n\n const stateOptions = STATES_ABBR.map(abbr => ({ label: abbr, value: abbr }))\n const fieldId = `preparers.${index}`\n\n return (\n <Flex flexDirection=\"column\" gap={12}>\n <Components.Heading as=\"h3\">{t('preparerSectionTitle')}</Components.Heading>\n\n <TextInputField\n name={`${fieldId}.firstName`}\n label={t('preparerFirstNameLabel')}\n errorMessage={t('preparerFirstNameError')}\n isRequired\n />\n <TextInputField\n name={`${fieldId}.lastName`}\n label={t('preparerLastNameLabel')}\n errorMessage={t('preparerLastNameError')}\n isRequired\n />\n <TextInputField\n name={`${fieldId}.street1`}\n label={t('preparerStreet1Label')}\n errorMessage={t('preparerStreet1Error')}\n isRequired\n />\n <TextInputField name={`${fieldId}.street2`} label={t('preparerStreet2Label')} />\n <TextInputField\n name={`${fieldId}.city`}\n label={t('preparerCityLabel')}\n errorMessage={t('preparerCityError')}\n isRequired\n />\n <SelectField\n name={`${fieldId}.state`}\n label={t('preparerStateLabel')}\n errorMessage={t('preparerStateError')}\n isRequired\n options={stateOptions}\n placeholder=\"Select a state...\"\n />\n <TextInputField\n name={`${fieldId}.zip`}\n label={t('preparerZipLabel')}\n errorMessage={t('preparerZipError')}\n isRequired\n />\n <TextInputField\n name={`${fieldId}.signature`}\n label={t('preparerSignatureLabel')}\n description={t('preparerSignatureDescription')}\n errorMessage={t('preparerSignatureError')}\n isRequired\n />\n <CheckboxField\n name={`${fieldId}.agree`}\n isRequired\n label={t('preparerConfirmationLabel')}\n errorMessage={t('preparerConfirmationError')}\n />\n\n {(showAddButton || showRemoveButton) && (\n <div className={styles.preparerActions}>\n {showAddButton && (\n <Components.Button type=\"button\" variant=\"secondary\" onClick={onAdd}>\n {t('addPreparerCta')}\n </Components.Button>\n )}\n {showRemoveButton && (\n <Components.Button type=\"button\" variant=\"error\" onClick={onRemove}>\n {t('removePreparerCta')}\n </Components.Button>\n )}\n </div>\n )}\n </Flex>\n )\n}\n\nfunction buildPreparerPayload(payload: I9SignatureFormInputs) {\n if (payload.usedPreparer !== 'yes' || payload.preparers.length === 0) {\n return { preparer: false }\n }\n\n const result: Record<string, unknown> = { preparer: true }\n\n payload.preparers.forEach((preparer, index) => {\n const prefix = index === 0 ? 'preparer' : `preparer${index + 1}`\n if (index > 0) {\n result[`preparer${index + 1}`] = true\n }\n result[`${prefix}FirstName`] = preparer.firstName\n result[`${prefix}LastName`] = preparer.lastName\n result[`${prefix}Street1`] = preparer.street1\n if (preparer.street2) result[`${prefix}Street2`] = preparer.street2\n result[`${prefix}City`] = preparer.city\n result[`${prefix}State`] = preparer.state\n result[`${prefix}Zip`] = preparer.zip\n result[`${prefix}Agree`] = 'true'\n })\n\n return result\n}\n"],"names":["MAX_PREPARERS","preparerSchema","z","val","i9SignatureFormSchema","I9SignatureForm","props","jsx","BaseComponent","Root","employeeId","formId","className","useI18n","useTranslation","onEvent","baseSubmitHandler","useBase","Components","useComponentContext","formData","useEmployeeFormsGetSuspense","form","formPdf","useEmployeeFormsGetPdfSuspense","pdfUrl","signForm","isPending","useEmployeeFormsSignMutation","methods","useForm","zodResolver","handleBack","componentEvents","handleSubmit","data","payload","preparerPayload","buildPreparerPayload","signFormResult","FormProvider","Form","jsxs","Flex","Trans","DocumentViewer","TextInputField","CheckboxField","PreparerSection","ActionsLayout","emptyPreparer","t","watch","control","useFormContext","fields","append","remove","useFieldArray","usedPreparer","canAddPreparer","handlePreparerChange","value","handleAddPreparer","RadioGroupField","field","index","styles","PreparerFields","onRemove","showRemoveButton","showAddButton","onAdd","stateOptions","STATES_ABBR","abbr","fieldId","SelectField","result","preparer","prefix"],"mappings":";;;;;;;;;;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