@gusto/embedded-react-sdk 0.39.0 → 0.41.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 +127 -0
- package/dist/components/Base/Base.js +3 -2
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/Fields/hooks/useField.js.map +1 -1
- package/dist/components/Common/Form/Form.d.ts +1 -1
- package/dist/components/Common/Form/Form.js +15 -5
- package/dist/components/Common/Form/Form.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +6 -4
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +11 -9
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +12 -10
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/Alert/Alert.module.scss.js +12 -12
- package/dist/components/Common/UI/Box/Box.module.scss.js +4 -4
- package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +8 -6
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +3 -2
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +3 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +7 -6
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +14 -13
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +3 -2
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +6 -5
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +10 -9
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +3 -2
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +3 -2
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +8 -7
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +9 -8
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +8 -7
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -4
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +3 -2
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +10 -8
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +80 -61
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/{UNSTABLE_Hooks/hooks → Company/DocumentSigner/shared}/useSignCompanyForm/fields.d.ts +3 -3
- package/dist/components/{UNSTABLE_Hooks/hooks → Company/DocumentSigner/shared}/useSignCompanyForm/fields.js +2 -2
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Company/DocumentSigner/shared}/useSignCompanyForm/index.d.ts +1 -3
- package/dist/components/{UNSTABLE_Hooks/hooks → Company/DocumentSigner/shared}/useSignCompanyForm/signCompanyFormSchema.d.ts +2 -2
- package/dist/components/{UNSTABLE_Hooks/hooks → Company/DocumentSigner/shared}/useSignCompanyForm/signCompanyFormSchema.js +1 -1
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/signCompanyFormSchema.js.map +1 -0
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.d.ts +33 -0
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.js +106 -0
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.js.map +1 -0
- package/dist/components/Company/FederalTaxes/Actions.js +6 -5
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +9 -7
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +3 -2
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +6 -5
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +3 -2
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +7 -6
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +5 -4
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +7 -6
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +5 -4
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +4 -2
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +7 -6
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +7 -6
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +8 -6
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.d.ts +1 -1
- package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +6 -5
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +6 -5
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +4 -2
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +4 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.d.ts +6 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +31 -148
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleComponents.d.ts +10 -0
- package/dist/components/Company/PaySchedule/PayScheduleComponents.js +26 -0
- package/dist/components/Company/PaySchedule/PayScheduleComponents.js.map +1 -0
- package/dist/components/Company/PaySchedule/PayScheduleForm.d.ts +8 -0
- package/dist/components/Company/PaySchedule/PayScheduleForm.js +199 -0
- package/dist/components/Company/PaySchedule/PayScheduleForm.js.map +1 -0
- package/dist/components/Company/PaySchedule/PayScheduleList.d.ts +8 -0
- package/dist/components/Company/PaySchedule/PayScheduleList.js +103 -0
- package/dist/components/Company/PaySchedule/PayScheduleList.js.map +1 -0
- package/dist/components/Company/PaySchedule/{_parts/List.module.scss.js → PayScheduleList.module.scss.js} +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleList.module.scss.js.map +1 -0
- package/dist/components/Company/PaySchedule/payScheduleStateMachine.d.ts +6 -0
- package/dist/components/Company/PaySchedule/payScheduleStateMachine.js +49 -0
- package/dist/components/Company/PaySchedule/payScheduleStateMachine.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Company/PaySchedule/shared}/usePayScheduleForm/fields.d.ts +6 -6
- package/dist/components/{UNSTABLE_Hooks/hooks → Company/PaySchedule/shared}/usePayScheduleForm/fields.js +5 -5
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Company/PaySchedule/shared}/usePayScheduleForm/index.d.ts +0 -2
- package/dist/components/{UNSTABLE_Hooks/hooks → Company/PaySchedule/shared}/usePayScheduleForm/payScheduleSchema.d.ts +2 -2
- package/dist/components/{UNSTABLE_Hooks/hooks → Company/PaySchedule/shared}/usePayScheduleForm/payScheduleSchema.js +2 -2
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.js.map +1 -0
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.d.ts +33 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Company/PaySchedule/shared}/usePayScheduleForm/usePayScheduleForm.js +30 -26
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js.map +1 -0
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +6 -5
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/exports/companyOnboarding.d.ts +14 -0
- package/dist/components/Company/exports/companyOnboarding.js +31 -0
- package/dist/components/Company/exports/companyOnboarding.js.map +1 -0
- package/dist/components/Contractor/Address/Address.js +4 -2
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +3 -2
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +6 -5
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +3 -2
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +3 -2
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +5 -4
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -2
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +3 -2
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +3 -2
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +3 -2
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +3 -2
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +3 -2
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +14 -13
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +3 -2
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +3 -2
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
- package/dist/components/Contractor/Profile/useContractorProfile.js +3 -2
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +74 -50
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Contractor/exports/contractorOnboarding.d.ts +7 -0
- package/dist/components/Contractor/exports/contractorOnboarding.js +17 -0
- package/dist/components/Contractor/exports/contractorOnboarding.js.map +1 -0
- package/dist/components/Employee/Compensation/Actions.js +5 -4
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +23 -22
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +23 -22
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Compensation/shared}/useCompensationForm/compensationSchema.d.ts +2 -2
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Compensation/shared}/useCompensationForm/compensationSchema.js +4 -4
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Compensation/shared}/useCompensationForm/fields.d.ts +8 -8
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Compensation/shared}/useCompensationForm/fields.js +6 -6
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Compensation/shared}/useCompensationForm/index.d.ts +0 -2
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.d.ts +43 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Compensation/shared}/useCompensationForm/useCompensationForm.js +28 -24
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -0
- package/dist/components/Employee/Dashboard/Dashboard.js +79 -79
- package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Employee/Dashboard/DocumentsView.js +2 -5
- package/dist/components/Employee/Dashboard/DocumentsView.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.d.ts +8 -11
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js +8 -8
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +10 -12
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +11 -11
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.d.ts +6 -9
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js +10 -10
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.d.ts +7 -10
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js +8 -8
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +3 -2
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +3 -2
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +3 -2
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +7 -6
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +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 +7 -6
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +11 -9
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +3 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +23 -22
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +3 -2
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +13 -11
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/DocumentSigner/shared}/useSignEmployeeForm/fields.d.ts +5 -5
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/DocumentSigner/shared}/useSignEmployeeForm/fields.js +4 -4
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/fields.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/DocumentSigner/shared}/useSignEmployeeForm/index.d.ts +0 -4
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/DocumentSigner/shared}/useSignEmployeeForm/signEmployeeFormSchema.d.ts +1 -1
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/DocumentSigner/shared}/useSignEmployeeForm/signEmployeeFormSchema.js +1 -1
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/signEmployeeFormSchema.js.map +1 -0
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/useSignEmployeeForm.d.ts +47 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/DocumentSigner/shared}/useSignEmployeeForm/useSignEmployeeForm.js +66 -59
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/useSignEmployeeForm.js.map +1 -0
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +3 -2
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Actions.js +7 -6
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +5 -4
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -3
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +7 -6
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +5 -4
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -2
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +7 -6
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +3 -2
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/AdminProfile.d.ts +2 -0
- package/dist/components/Employee/Profile/AdminProfile.js +358 -0
- package/dist/components/Employee/Profile/AdminProfile.js.map +1 -0
- package/dist/components/Employee/Profile/AdminProfile.module.scss.js +10 -0
- package/dist/components/Employee/Profile/AdminProfile.module.scss.js.map +1 -0
- package/dist/components/Employee/Profile/EmployeeProfile.d.ts +2 -0
- package/dist/components/Employee/Profile/EmployeeProfile.js +211 -0
- package/dist/components/Employee/Profile/EmployeeProfile.js.map +1 -0
- package/dist/components/Employee/Profile/EmployeeProfile.module.scss.js +10 -0
- package/dist/components/Employee/Profile/EmployeeProfile.module.scss.js.map +1 -0
- package/dist/components/Employee/Profile/Profile.d.ts +3 -3
- package/dist/components/Employee/Profile/Profile.js +25 -261
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useEmployeeDetailsForm/employeeDetailsSchema.d.ts +2 -2
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useEmployeeDetailsForm/employeeDetailsSchema.js +2 -2
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useEmployeeDetailsForm/fields.d.ts +4 -4
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useEmployeeDetailsForm/fields.js +5 -5
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useEmployeeDetailsForm/index.d.ts +0 -2
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +15 -33
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useEmployeeDetailsForm/useEmployeeDetailsForm.js +31 -27
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.d.ts +22 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +36 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js.map +1 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.d.ts +41 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.js +32 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.js.map +1 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/index.d.ts +5 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.d.ts +44 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js +161 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useWorkAddressForm/fields.d.ts +3 -3
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useWorkAddressForm/fields.js +2 -2
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useWorkAddressForm/index.d.ts +0 -2
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useWorkAddressForm/useWorkAddressForm.d.ts +11 -32
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useWorkAddressForm/useWorkAddressForm.js +34 -30
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useWorkAddressForm/workAddressSchema.d.ts +3 -5
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useWorkAddressForm/workAddressSchema.js +7 -9
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/workAddressSchema.js.map +1 -0
- package/dist/components/Employee/StateTaxes/Actions.js +8 -7
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -3
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +9 -8
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +5 -4
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +4 -3
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +5 -5
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +13 -12
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +9 -8
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +3 -2
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -1
- package/dist/components/Employee/{EmployeeList → employee-list/management}/ManagementEmployeeList.d.ts +1 -1
- package/dist/components/Employee/{EmployeeList → employee-list/management}/ManagementEmployeeList.js +7 -7
- package/dist/components/Employee/employee-list/management/ManagementEmployeeList.js.map +1 -0
- package/dist/components/Employee/{EmployeeList → employee-list/management}/ManagementEmployeeListView.d.ts +1 -1
- package/dist/components/Employee/{EmployeeList → employee-list/management}/ManagementEmployeeListView.js +15 -14
- package/dist/components/Employee/employee-list/management/ManagementEmployeeListView.js.map +1 -0
- package/dist/components/Employee/{EmployeeList → employee-list/onboarding}/EmployeeList.d.ts +1 -1
- package/dist/components/Employee/{EmployeeList → employee-list/onboarding}/EmployeeList.js +7 -7
- package/dist/components/Employee/employee-list/onboarding/EmployeeList.js.map +1 -0
- package/dist/components/Employee/{EmployeeList → employee-list/onboarding}/EmployeeListView.d.ts +1 -1
- package/dist/components/Employee/employee-list/onboarding/EmployeeListView.js +131 -0
- package/dist/components/Employee/employee-list/onboarding/EmployeeListView.js.map +1 -0
- package/dist/components/Employee/employee-list/shared/index.d.ts +2 -0
- package/dist/components/Employee/{EmployeeList → employee-list/shared}/useEmployeeList.d.ts +8 -10
- package/dist/components/Employee/{EmployeeList → employee-list/shared}/useEmployeeList.js +32 -28
- package/dist/components/Employee/employee-list/shared/useEmployeeList.js.map +1 -0
- package/dist/components/Employee/exports/employeeManagement.d.ts +6 -0
- package/dist/components/Employee/exports/employeeManagement.js +15 -0
- package/dist/components/Employee/exports/employeeManagement.js.map +1 -0
- package/dist/components/Employee/exports/employeeOnboarding.d.ts +14 -0
- package/dist/components/Employee/exports/employeeOnboarding.js +31 -0
- package/dist/components/Employee/exports/employeeOnboarding.js.map +1 -0
- package/dist/components/Employee/index.d.ts +1 -2
- package/dist/components/Employee/index.js +35 -37
- package/dist/components/Employee/index.js.map +1 -1
- package/dist/components/Flow/Flow.js +12 -11
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +18 -17
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +8 -7
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +3 -2
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +11 -10
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +9 -8
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +3 -2
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +19 -18
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +2 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +7 -6
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +3 -2
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +8 -7
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +17 -17
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +3 -2
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +3 -2
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +5 -4
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +3 -2
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +13 -12
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +30 -29
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.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 +3 -2
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +106 -108
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +3 -2
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +3 -2
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +13 -12
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +10 -9
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js +13 -12
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyList.d.ts +1 -1
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyList.js +96 -62
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyList.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.d.ts +1 -1
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.js +48 -45
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListTypes.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettings.module.scss.js +18 -0
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettings.module.scss.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettingsPresentation.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettingsPresentation.js +166 -0
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettingsPresentation.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettingsTypes.d.ts +18 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js +3 -2
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js +24 -22
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +3 -2
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/index.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/index.js +24 -22
- package/dist/components/UNSTABLE_TimeOff/index.js.map +1 -1
- package/dist/components/index.d.ts +7 -0
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +11 -10
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/ObservabilityProvider/useObservability.js +6 -6
- package/dist/contexts/ObservabilityProvider/useObservability.js.map +1 -1
- package/dist/i18n/I18n.js +9 -9
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.PaySchedule.json.js +15 -13
- package/dist/i18n/en/Company.PaySchedule.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js +1 -1
- package/dist/i18n/en/Contractor.Submit.json.js +16 -12
- package/dist/i18n/en/Contractor.Submit.json.js.map +1 -1
- package/dist/i18n/en/common.json.d.ts +1 -0
- package/dist/i18n/en/common.json.js +1 -1
- package/dist/index.d.ts +16 -0
- package/dist/index.js +102 -26
- package/dist/index.js.map +1 -1
- package/dist/partner-hook-utils/collectErrors.js.map +1 -0
- package/dist/partner-hook-utils/composeErrorHandler.d.ts +24 -0
- package/dist/partner-hook-utils/composeErrorHandler.js +30 -0
- package/dist/partner-hook-utils/composeErrorHandler.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/FormFieldsMetadataContext.d.ts +2 -2
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/FormFieldsMetadataContext.js +3 -3
- package/dist/partner-hook-utils/form/FormFieldsMetadataContext.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/FormFieldsMetadataProvider.d.ts +2 -2
- package/dist/partner-hook-utils/form/FormFieldsMetadataProvider.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/SDKFormProvider.d.ts +2 -2
- package/dist/partner-hook-utils/form/SDKFormProvider.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/buildFormSchema.d.ts +1 -1
- package/dist/partner-hook-utils/form/buildFormSchema.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/composeSubmitHandler.d.ts +29 -3
- package/dist/partner-hook-utils/form/composeSubmitHandler.js +40 -0
- package/dist/partner-hook-utils/form/composeSubmitHandler.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/CheckboxHookField.d.ts +3 -3
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js +37 -0
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/DatePickerHookField.d.ts +3 -3
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/DatePickerHookField.js +1 -1
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/NumberInputHookField.d.ts +3 -3
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +43 -0
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/RadioGroupHookField.d.ts +3 -3
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js +43 -0
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/SelectHookField.d.ts +3 -3
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/SelectHookField.js +18 -16
- package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/SwitchHookField.d.ts +3 -3
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js +37 -0
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/TextInputHookField.d.ts +3 -3
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js +41 -0
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/index.d.ts +7 -7
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/getFieldWithOptions.d.ts +1 -1
- package/dist/partner-hook-utils/form/getFieldWithOptions.js.map +1 -0
- package/dist/partner-hook-utils/form/getFormSubmissionValues.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/index.d.ts +2 -2
- package/dist/partner-hook-utils/form/preprocessors.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/resolveFieldError.d.ts +2 -2
- package/dist/partner-hook-utils/form/resolveFieldError.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/useDeriveFieldsMetadata.d.ts +1 -1
- package/dist/partner-hook-utils/form/useDeriveFieldsMetadata.js +21 -0
- package/dist/partner-hook-utils/form/useDeriveFieldsMetadata.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/useFieldErrorMessage.d.ts +1 -1
- package/dist/partner-hook-utils/form/useFieldErrorMessage.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/useHookFieldResolution.d.ts +2 -2
- package/dist/partner-hook-utils/form/useHookFieldResolution.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/withOptions.d.ts +1 -1
- package/dist/partner-hook-utils/form/withOptions.js.map +1 -0
- package/dist/partner-hook-utils/index.d.ts +5 -0
- package/dist/{types/sdkHooks.d.ts → partner-hook-utils/types.d.ts} +37 -9
- package/dist/shared/constants.d.ts +1 -1
- package/dist/shared/constants.js +15 -16
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +24 -252
- package/dist/types/sdkError.js.map +1 -1
- package/docs/reference/endpoint-inventory.json +531 -170
- package/package.json +15 -19
- package/dist/UNSTABLE_Hooks.d.ts +0 -1
- package/dist/UNSTABLE_Hooks.js +0 -71
- package/dist/UNSTABLE_Hooks.js.map +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/Actions.d.ts +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/Actions.js +0 -20
- package/dist/components/Company/DocumentSigner/SignatureForm/Actions.js.map +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/Form.d.ts +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/Form.js +0 -20
- package/dist/components/Company/DocumentSigner/SignatureForm/Form.js.map +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/Head.d.ts +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/Head.js +0 -35
- package/dist/components/Company/DocumentSigner/SignatureForm/Head.js.map +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/Preview.d.ts +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/Preview.js +0 -20
- package/dist/components/Company/DocumentSigner/SignatureForm/Preview.js.map +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.d.ts +0 -9
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +0 -22
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +0 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.d.ts +0 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +0 -63
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +0 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.d.ts +0 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +0 -134
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +0 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.module.scss.js +0 -14
- package/dist/components/Company/PaySchedule/_parts/Edit.module.scss.js.map +0 -1
- package/dist/components/Company/PaySchedule/_parts/Head.d.ts +0 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +0 -47
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +0 -1
- package/dist/components/Company/PaySchedule/_parts/List.d.ts +0 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +0 -57
- package/dist/components/Company/PaySchedule/_parts/List.js.map +0 -1
- package/dist/components/Company/PaySchedule/_parts/List.module.scss.js.map +0 -1
- package/dist/components/Company/PaySchedule/_parts/index.d.ts +0 -5
- package/dist/components/Company/PaySchedule/usePaySchedule.d.ts +0 -39
- package/dist/components/Company/PaySchedule/usePaySchedule.js +0 -30
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +0 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +0 -1
- package/dist/components/Employee/EmployeeList/EmployeeListView.js +0 -130
- package/dist/components/Employee/EmployeeList/EmployeeListView.js.map +0 -1
- package/dist/components/Employee/EmployeeList/ManagementEmployeeList.js.map +0 -1
- package/dist/components/Employee/EmployeeList/ManagementEmployeeListView.js.map +0 -1
- package/dist/components/Employee/EmployeeList/index.d.ts +0 -3
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +0 -1
- package/dist/components/Employee/Profile/Actions.d.ts +0 -1
- package/dist/components/Employee/Profile/Actions.js +0 -14
- package/dist/components/Employee/Profile/Actions.js.map +0 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +0 -33
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +0 -59
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +0 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.module.scss.js +0 -8
- package/dist/components/Employee/Profile/AdminPersonalDetails.module.scss.js.map +0 -1
- package/dist/components/Employee/Profile/Head.d.ts +0 -1
- package/dist/components/Employee/Profile/Head.js +0 -14
- package/dist/components/Employee/Profile/Head.js.map +0 -1
- package/dist/components/Employee/Profile/HomeAddress.d.ts +0 -31
- package/dist/components/Employee/Profile/HomeAddress.js +0 -128
- package/dist/components/Employee/Profile/HomeAddress.js.map +0 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +0 -49
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +0 -146
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +0 -1
- package/dist/components/Employee/Profile/SelfPersonalDetails.d.ts +0 -16
- package/dist/components/Employee/Profile/SelfPersonalDetails.js +0 -29
- package/dist/components/Employee/Profile/SelfPersonalDetails.js.map +0 -1
- package/dist/components/Employee/Profile/WorkAddress.d.ts +0 -1
- package/dist/components/Employee/Profile/WorkAddress.js +0 -21
- package/dist/components/Employee/Profile/WorkAddress.js.map +0 -1
- package/dist/components/Employee/Profile/WorkAddress.module.scss.js +0 -8
- package/dist/components/Employee/Profile/WorkAddress.module.scss.js.map +0 -1
- package/dist/components/Employee/Profile/getEmployeeAddressForProfile.d.ts +0 -2
- package/dist/components/Employee/Profile/getEmployeeAddressForProfile.js +0 -8
- package/dist/components/Employee/Profile/getEmployeeAddressForProfile.js.map +0 -1
- package/dist/components/Employee/Profile/useProfile.d.ts +0 -16
- package/dist/components/Employee/Profile/useProfile.js +0 -20
- package/dist/components/Employee/Profile/useProfile.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/buildFormSchema.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js +0 -34
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js +0 -35
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js +0 -41
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js +0 -41
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js +0 -35
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js +0 -39
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/preprocessors.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/useDeriveFieldsMetadata.js +0 -21
- package/dist/components/UNSTABLE_Hooks/form/useDeriveFieldsMetadata.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/useHookFieldResolution.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/withOptions.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.d.ts +0 -5
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js +0 -149
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.d.ts +0 -102
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.d.ts +0 -5
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js +0 -112
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/PayScheduleForm.d.ts +0 -5
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/PayScheduleForm.js +0 -172
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/PayScheduleForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/fields.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/payScheduleSchema.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/usePayScheduleForm.d.ts +0 -69
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/usePayScheduleForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/SignCompanyForm.d.ts +0 -5
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/SignCompanyForm.js +0 -69
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/SignCompanyForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/fields.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/signCompanyFormSchema.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/useSignCompanyForm.d.ts +0 -57
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/useSignCompanyForm.js +0 -101
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/useSignCompanyForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeForm.d.ts +0 -5
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeForm.js +0 -71
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeI9Form.d.ts +0 -5
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeI9Form.js +0 -179
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeI9Form.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/fields.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/signEmployeeFormSchema.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/useSignEmployeeForm.d.ts +0 -151
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/useSignEmployeeForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.d.ts +0 -5
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js +0 -69
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/index.d.ts +0 -12
- package/dist/helpers/buildQueryErrorHandling.d.ts +0 -22
- package/dist/helpers/buildQueryErrorHandling.js +0 -11
- package/dist/helpers/buildQueryErrorHandling.js.map +0 -1
- package/dist/helpers/collectErrors.js.map +0 -1
- package/dist/hooks/useErrorHandling.d.ts +0 -9
- package/dist/hooks/useErrorHandling.js +0 -12
- package/dist/hooks/useErrorHandling.js.map +0 -1
- package/dist/hooks/useErrorHandling.test.d.ts +0 -1
- package/dist/i18n/en/UNSTABLE.CompensationForm.json.js +0 -58
- package/dist/i18n/en/UNSTABLE.CompensationForm.json.js.map +0 -1
- package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js +0 -34
- package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js.map +0 -1
- package/dist/i18n/en/UNSTABLE.PayScheduleForm.json.js +0 -24
- package/dist/i18n/en/UNSTABLE.PayScheduleForm.json.js.map +0 -1
- package/dist/i18n/en/UNSTABLE.SignCompanyForm.json.js +0 -20
- package/dist/i18n/en/UNSTABLE.SignCompanyForm.json.js.map +0 -1
- package/dist/i18n/en/UNSTABLE.SignEmployeeForm.json.js +0 -22
- package/dist/i18n/en/UNSTABLE.SignEmployeeForm.json.js.map +0 -1
- package/dist/i18n/en/UNSTABLE.SignEmployeeI9Form.json.js +0 -70
- package/dist/i18n/en/UNSTABLE.SignEmployeeI9Form.json.js.map +0 -1
- package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js +0 -24
- package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js.map +0 -1
- /package/dist/components/{UNSTABLE_Hooks/hooks/usePayScheduleForm → Company/PaySchedule}/PayScheduleForm.module.scss.js +0 -0
- /package/dist/components/{UNSTABLE_Hooks/hooks/usePayScheduleForm → Company/PaySchedule}/PayScheduleForm.module.scss.js.map +0 -0
- /package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Compensation/shared}/useCompensationForm/compensationSchemaParity.test.d.ts +0 -0
- /package/dist/{helpers → partner-hook-utils}/collectErrors.d.ts +0 -0
- /package/dist/{helpers → partner-hook-utils}/collectErrors.js +0 -0
- /package/dist/{components/Employee/Profile/getEmployeeAddressForProfile.test.d.ts → partner-hook-utils/composeErrorHandler.test.d.ts} +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/FormFieldsMetadataProvider.js +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/SDKFormProvider.js +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/buildFormSchema.js +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/buildFormSchema.test.d.ts +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/composeSubmitHandler.test.d.ts +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/getFieldWithOptions.js +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/getFormSubmissionValues.d.ts +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/getFormSubmissionValues.js +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/getFormSubmissionValues.test.d.ts +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/preprocessors.d.ts +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/preprocessors.js +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/resolveFieldError.js +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/useFieldErrorMessage.js +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/useHookFieldResolution.js +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/withOptions.js +0 -0
|
@@ -3,7 +3,7 @@ import { Location } from '@gusto/embedded-api/models/components/location';
|
|
|
3
3
|
import { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress';
|
|
4
4
|
import { WorkAddressOptionalFieldsToRequire, WorkAddressFormData } from './workAddressSchema';
|
|
5
5
|
import { LocationField, EffectiveDateField } from './fields';
|
|
6
|
-
import { HookSubmitResult } from '
|
|
6
|
+
import { BaseFormHookReady, FieldsMetadata, HookLoadingResult, HookSubmitResult } from '../../../../../partner-hook-utils/types';
|
|
7
7
|
export type { WorkAddressOptionalFieldsToRequire } from './workAddressSchema';
|
|
8
8
|
export interface WorkAddressSubmitCallbacks {
|
|
9
9
|
onWorkAddressCreated?: (workAddress: EmployeeWorkAddress) => void;
|
|
@@ -22,46 +22,25 @@ export interface UseWorkAddressFormProps {
|
|
|
22
22
|
validationMode?: UseFormProps['mode'];
|
|
23
23
|
shouldFocusError?: boolean;
|
|
24
24
|
}
|
|
25
|
-
export
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
actions?: undefined;
|
|
31
|
-
form?: undefined;
|
|
32
|
-
} | {
|
|
33
|
-
isLoading: false;
|
|
25
|
+
export interface WorkAddressFields {
|
|
26
|
+
Location: typeof LocationField;
|
|
27
|
+
EffectiveDate: typeof EffectiveDateField | undefined;
|
|
28
|
+
}
|
|
29
|
+
export interface UseWorkAddressFormReady extends BaseFormHookReady<FieldsMetadata, WorkAddressFormData, WorkAddressFields> {
|
|
34
30
|
data: {
|
|
35
31
|
workAddress: EmployeeWorkAddress | null;
|
|
36
32
|
workAddresses: EmployeeWorkAddress[] | undefined;
|
|
37
|
-
companyLocations: Location[];
|
|
33
|
+
companyLocations: Location[] | undefined;
|
|
38
34
|
};
|
|
39
35
|
status: {
|
|
40
36
|
isPending: boolean;
|
|
41
|
-
mode:
|
|
37
|
+
mode: 'create' | 'update';
|
|
42
38
|
};
|
|
43
39
|
actions: {
|
|
44
40
|
onSubmit: (callbacks?: WorkAddressSubmitCallbacks, options?: WorkAddressSubmitOptions) => Promise<HookSubmitResult<EmployeeWorkAddress> | undefined>;
|
|
45
41
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
Location: typeof LocationField;
|
|
50
|
-
EffectiveDate: typeof EffectiveDateField | undefined;
|
|
51
|
-
};
|
|
52
|
-
fieldsMetadata: {
|
|
53
|
-
locationUuid: import('../../../../types/sdkHooks').FieldMetadataWithOptions<Location>;
|
|
54
|
-
effectiveDate: import('../../../../types/sdkHooks').FieldMetadata;
|
|
55
|
-
};
|
|
56
|
-
hookFormInternals: {
|
|
57
|
-
formMethods: import('react-hook-form').UseFormReturn<WorkAddressFormData, unknown, WorkAddressFormData>;
|
|
58
|
-
};
|
|
59
|
-
getFormSubmissionValues: () => WorkAddressFormData | undefined;
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
export type UseWorkAddressFormResult = ReturnType<typeof useWorkAddressForm>;
|
|
63
|
-
export type UseWorkAddressFormReady = Extract<UseWorkAddressFormResult, {
|
|
64
|
-
data: object;
|
|
65
|
-
}>;
|
|
42
|
+
}
|
|
43
|
+
export declare function useWorkAddressForm({ companyId, employeeId, withEffectiveDateField, optionalFieldsToRequire, defaultValues: partnerDefaults, validationMode, shouldFocusError, }: UseWorkAddressFormProps): HookLoadingResult | UseWorkAddressFormReady;
|
|
44
|
+
export type UseWorkAddressFormResult = HookLoadingResult | UseWorkAddressFormReady;
|
|
66
45
|
export type WorkAddressFieldsMetadata = UseWorkAddressFormReady['form']['fieldsMetadata'];
|
|
67
46
|
export type WorkAddressFormFields = UseWorkAddressFormReady['form']['Fields'];
|
|
@@ -6,16 +6,16 @@ import { useEmployeeAddressesGetWorkAddresses as j } from "@gusto/embedded-api/r
|
|
|
6
6
|
import { useEmployeeAddressesCreateWorkAddressMutation as J } from "@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress";
|
|
7
7
|
import { useEmployeeAddressesUpdateWorkAddressMutation as N } from "@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress";
|
|
8
8
|
import { RFCDate as X } from "@gusto/embedded-api/types/rfcdate";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { useBaseSubmit as te } from "
|
|
16
|
-
import { SDKInternalError as l } from "
|
|
17
|
-
import { addressInline as se } from "
|
|
18
|
-
function
|
|
9
|
+
import { createWorkAddressSchema as Y } from "./workAddressSchema.js";
|
|
10
|
+
import { EffectiveDateField as Z, LocationField as _ } from "./fields.js";
|
|
11
|
+
import { useDeriveFieldsMetadata as $ } from "../../../../../partner-hook-utils/form/useDeriveFieldsMetadata.js";
|
|
12
|
+
import { createGetFormSubmissionValues as T } from "../../../../../partner-hook-utils/form/getFormSubmissionValues.js";
|
|
13
|
+
import { withOptions as ee } from "../../../../../partner-hook-utils/form/withOptions.js";
|
|
14
|
+
import { composeErrorHandler as oe } from "../../../../../partner-hook-utils/composeErrorHandler.js";
|
|
15
|
+
import { useBaseSubmit as te } from "../../../../Base/useBaseSubmit.js";
|
|
16
|
+
import { SDKInternalError as l } from "../../../../../types/sdkError.js";
|
|
17
|
+
import { addressInline as se } from "../../../../../helpers/formattedStrings.js";
|
|
18
|
+
function Le({
|
|
19
19
|
companyId: F,
|
|
20
20
|
employeeId: o,
|
|
21
21
|
withEffectiveDateField: i = !0,
|
|
@@ -28,45 +28,49 @@ function ge({
|
|
|
28
28
|
{ employeeId: o ?? "" },
|
|
29
29
|
{ enabled: !!o }
|
|
30
30
|
), d = a.data?.companyLocationsList, f = c.data?.employeeWorkAddressesList, t = f?.find((e) => e.active), n = !t, k = n ? "create" : "update", [v, C] = R(
|
|
31
|
-
() =>
|
|
31
|
+
() => Y({ mode: k, optionalFieldsToRequire: p, withEffectiveDateField: i }),
|
|
32
32
|
[k, p, i]
|
|
33
33
|
), W = {
|
|
34
34
|
locationUuid: t?.locationUuid ?? A?.locationUuid ?? "",
|
|
35
35
|
effectiveDate: t?.effectiveDate ?? A?.effectiveDate ?? ""
|
|
36
|
-
},
|
|
36
|
+
}, m = x({
|
|
37
37
|
resolver: z(v),
|
|
38
38
|
mode: h,
|
|
39
39
|
shouldFocusError: q,
|
|
40
40
|
defaultValues: W,
|
|
41
41
|
values: W,
|
|
42
42
|
resetOptions: { keepDirtyValues: !0 }
|
|
43
|
-
}), D = J(), y = N(), P = D.isPending || y.isPending, {
|
|
43
|
+
}), D = J(), y = N(), P = D.isPending || y.isPending, {
|
|
44
|
+
baseSubmitHandler: V,
|
|
45
|
+
error: B,
|
|
46
|
+
setError: G
|
|
47
|
+
} = te("WorkAddressForm"), w = oe(o ? [a, c] : [a], { submitError: B, setSubmitError: G }), H = (d ?? []).map((e) => ({
|
|
44
48
|
value: e.uuid,
|
|
45
49
|
label: se(e)
|
|
46
|
-
})), b =
|
|
47
|
-
locationUuid:
|
|
50
|
+
})), b = $(C, m.control), I = {
|
|
51
|
+
locationUuid: ee(
|
|
48
52
|
b.locationUuid,
|
|
49
53
|
H,
|
|
50
54
|
d ?? []
|
|
51
55
|
),
|
|
52
56
|
effectiveDate: b.effectiveDate
|
|
53
|
-
}, O = async (e,
|
|
54
|
-
let
|
|
57
|
+
}, O = async (e, L) => {
|
|
58
|
+
let g;
|
|
55
59
|
return await new Promise((U) => {
|
|
56
|
-
|
|
60
|
+
m.handleSubmit(
|
|
57
61
|
async (Q) => {
|
|
58
|
-
await V(Q, async (
|
|
59
|
-
const M =
|
|
62
|
+
await V(Q, async (u) => {
|
|
63
|
+
const M = L?.employeeId ?? o;
|
|
60
64
|
if (!M)
|
|
61
65
|
throw new l("employeeId is required to submit work address");
|
|
62
|
-
const S = i &&
|
|
66
|
+
const S = i && u.effectiveDate ? u.effectiveDate : L?.effectiveDate, E = S ? new X(new Date(S)) : void 0;
|
|
63
67
|
let s;
|
|
64
68
|
if (n) {
|
|
65
69
|
const r = await D.mutateAsync({
|
|
66
70
|
request: {
|
|
67
71
|
employeeId: M,
|
|
68
72
|
requestBody: {
|
|
69
|
-
locationUuid:
|
|
73
|
+
locationUuid: u.locationUuid,
|
|
70
74
|
effectiveDate: E
|
|
71
75
|
}
|
|
72
76
|
}
|
|
@@ -80,7 +84,7 @@ function ge({
|
|
|
80
84
|
workAddressUuid: t.uuid,
|
|
81
85
|
requestBody: {
|
|
82
86
|
version: t.version,
|
|
83
|
-
locationUuid:
|
|
87
|
+
locationUuid: u.locationUuid,
|
|
84
88
|
effectiveDate: E
|
|
85
89
|
}
|
|
86
90
|
}
|
|
@@ -89,7 +93,7 @@ function ge({
|
|
|
89
93
|
throw new l("Work address update failed");
|
|
90
94
|
s = r.employeeWorkAddress, e?.onWorkAddressUpdated?.(s);
|
|
91
95
|
}
|
|
92
|
-
|
|
96
|
+
g = {
|
|
93
97
|
mode: n ? "create" : "update",
|
|
94
98
|
data: s
|
|
95
99
|
};
|
|
@@ -99,7 +103,7 @@ function ge({
|
|
|
99
103
|
U();
|
|
100
104
|
}
|
|
101
105
|
)();
|
|
102
|
-
}),
|
|
106
|
+
}), g;
|
|
103
107
|
};
|
|
104
108
|
return a.isLoading || (o ? c.isLoading : !1) || !d || o && !f ? { isLoading: !0, errorHandling: w } : {
|
|
105
109
|
isLoading: !1,
|
|
@@ -116,16 +120,16 @@ function ge({
|
|
|
116
120
|
errorHandling: w,
|
|
117
121
|
form: {
|
|
118
122
|
Fields: {
|
|
119
|
-
Location:
|
|
120
|
-
EffectiveDate: i ?
|
|
123
|
+
Location: _,
|
|
124
|
+
EffectiveDate: i ? Z : void 0
|
|
121
125
|
},
|
|
122
126
|
fieldsMetadata: I,
|
|
123
|
-
hookFormInternals: { formMethods:
|
|
124
|
-
getFormSubmissionValues:
|
|
127
|
+
hookFormInternals: { formMethods: m },
|
|
128
|
+
getFormSubmissionValues: T(m, v)
|
|
125
129
|
}
|
|
126
130
|
};
|
|
127
131
|
}
|
|
128
132
|
export {
|
|
129
|
-
|
|
133
|
+
Le as useWorkAddressForm
|
|
130
134
|
};
|
|
131
135
|
//# sourceMappingURL=useWorkAddressForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWorkAddressForm.js","sources":["../../../../../../src/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useForm } from 'react-hook-form'\nimport type { UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport type { Location } from '@gusto/embedded-api/models/components/location'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { useLocationsGet } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useEmployeeAddressesGetWorkAddresses } from '@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses'\nimport { useEmployeeAddressesCreateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress'\nimport { useEmployeeAddressesUpdateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport {\n createWorkAddressSchema,\n type WorkAddressOptionalFieldsToRequire,\n type WorkAddressFormData,\n type WorkAddressFormOutputs,\n} from './workAddressSchema'\nimport { LocationField, EffectiveDateField } from './fields'\nimport { useDeriveFieldsMetadata } from '@/partner-hook-utils/form/useDeriveFieldsMetadata'\nimport { createGetFormSubmissionValues } from '@/partner-hook-utils/form/getFormSubmissionValues'\nimport { withOptions } from '@/partner-hook-utils/form/withOptions'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type {\n BaseFormHookReady,\n FieldsMetadata,\n HookLoadingResult,\n HookSubmitResult,\n} from '@/partner-hook-utils/types'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { SDKInternalError } from '@/types/sdkError'\nimport { addressInline } from '@/helpers/formattedStrings'\n\nexport type { WorkAddressOptionalFieldsToRequire } from './workAddressSchema'\n\nexport interface WorkAddressSubmitCallbacks {\n onWorkAddressCreated?: (workAddress: EmployeeWorkAddress) => void\n onWorkAddressUpdated?: (workAddress: EmployeeWorkAddress) => void\n}\n\nexport interface WorkAddressSubmitOptions {\n employeeId?: string\n effectiveDate?: string\n}\n\nexport interface UseWorkAddressFormProps {\n companyId: string\n employeeId?: string\n withEffectiveDateField?: boolean\n optionalFieldsToRequire?: WorkAddressOptionalFieldsToRequire\n defaultValues?: Partial<WorkAddressFormData>\n validationMode?: UseFormProps['mode']\n shouldFocusError?: boolean\n}\n\nexport interface WorkAddressFields {\n Location: typeof LocationField\n EffectiveDate: typeof EffectiveDateField | undefined\n}\n\nexport interface UseWorkAddressFormReady extends BaseFormHookReady<\n FieldsMetadata,\n WorkAddressFormData,\n WorkAddressFields\n> {\n data: {\n workAddress: EmployeeWorkAddress | null\n workAddresses: EmployeeWorkAddress[] | undefined\n companyLocations: Location[] | undefined\n }\n status: { isPending: boolean; mode: 'create' | 'update' }\n actions: {\n onSubmit: (\n callbacks?: WorkAddressSubmitCallbacks,\n options?: WorkAddressSubmitOptions,\n ) => Promise<HookSubmitResult<EmployeeWorkAddress> | undefined>\n }\n}\n\nexport function useWorkAddressForm({\n companyId,\n employeeId,\n withEffectiveDateField = true,\n optionalFieldsToRequire,\n defaultValues: partnerDefaults,\n validationMode = 'onSubmit',\n shouldFocusError = true,\n}: UseWorkAddressFormProps): HookLoadingResult | UseWorkAddressFormReady {\n const locationsQuery = useLocationsGet({ companyId })\n const workAddressesQuery = useEmployeeAddressesGetWorkAddresses(\n { employeeId: employeeId ?? '' },\n { enabled: !!employeeId },\n )\n\n const companyLocations = locationsQuery.data?.companyLocationsList\n const workAddresses = workAddressesQuery.data?.employeeWorkAddressesList\n const currentWorkAddress = workAddresses?.find(address => address.active)\n\n const isCreateMode = !currentWorkAddress\n const mode = isCreateMode ? 'create' : 'update'\n\n const [schema, metadataConfig] = useMemo(\n () => createWorkAddressSchema({ mode, optionalFieldsToRequire, withEffectiveDateField }),\n [mode, optionalFieldsToRequire, withEffectiveDateField],\n )\n\n const resolvedDefaults: WorkAddressFormData = {\n locationUuid: currentWorkAddress?.locationUuid ?? partnerDefaults?.locationUuid ?? '',\n effectiveDate: currentWorkAddress?.effectiveDate ?? partnerDefaults?.effectiveDate ?? '',\n }\n\n const formMethods = useForm<WorkAddressFormData, unknown, WorkAddressFormOutputs>({\n resolver: zodResolver(schema),\n mode: validationMode,\n shouldFocusError,\n defaultValues: resolvedDefaults,\n values: resolvedDefaults,\n resetOptions: { keepDirtyValues: true },\n })\n\n const createWorkAddressMutation = useEmployeeAddressesCreateWorkAddressMutation()\n const updateWorkAddressMutation = useEmployeeAddressesUpdateWorkAddressMutation()\n\n const isPending = createWorkAddressMutation.isPending || updateWorkAddressMutation.isPending\n\n const {\n baseSubmitHandler,\n error: submitError,\n setError: setSubmitError,\n } = useBaseSubmit('WorkAddressForm')\n\n const queries = employeeId ? [locationsQuery, workAddressesQuery] : [locationsQuery]\n const errorHandling = composeErrorHandler(queries, { submitError, setSubmitError })\n\n const locationOptions = (companyLocations ?? []).map(location => ({\n value: location.uuid,\n label: addressInline(location),\n }))\n\n const baseMetadata = useDeriveFieldsMetadata(metadataConfig, formMethods.control)\n const fieldsMetadata = {\n locationUuid: withOptions<Location>(\n baseMetadata.locationUuid,\n locationOptions,\n companyLocations ?? [],\n ),\n effectiveDate: baseMetadata.effectiveDate,\n }\n\n const onSubmit = async (\n callbacks?: WorkAddressSubmitCallbacks,\n options?: WorkAddressSubmitOptions,\n ): Promise<HookSubmitResult<EmployeeWorkAddress> | undefined> => {\n let submitResult: HookSubmitResult<EmployeeWorkAddress> | undefined\n\n await new Promise<void>(resolve => {\n void formMethods.handleSubmit(\n async (data: WorkAddressFormOutputs) => {\n await baseSubmitHandler(data, async payload => {\n const resolvedEmployeeId = options?.employeeId ?? employeeId\n\n if (!resolvedEmployeeId) {\n throw new SDKInternalError('employeeId is required to submit work address')\n }\n\n const resolvedEffectiveDate =\n withEffectiveDateField && payload.effectiveDate\n ? payload.effectiveDate\n : options?.effectiveDate\n\n const effectiveDateParam = resolvedEffectiveDate\n ? new RFCDate(new Date(resolvedEffectiveDate))\n : undefined\n\n let updatedWorkAddress: EmployeeWorkAddress\n\n if (isCreateMode) {\n const result = await createWorkAddressMutation.mutateAsync({\n request: {\n employeeId: resolvedEmployeeId,\n requestBody: {\n locationUuid: payload.locationUuid,\n effectiveDate: effectiveDateParam,\n },\n },\n })\n\n if (!result.employeeWorkAddress) {\n throw new SDKInternalError('Work address creation failed')\n }\n\n updatedWorkAddress = result.employeeWorkAddress\n callbacks?.onWorkAddressCreated?.(updatedWorkAddress)\n } else {\n const result = await updateWorkAddressMutation.mutateAsync({\n request: {\n workAddressUuid: currentWorkAddress.uuid,\n requestBody: {\n version: currentWorkAddress.version,\n locationUuid: payload.locationUuid,\n effectiveDate: effectiveDateParam,\n },\n },\n })\n\n if (!result.employeeWorkAddress) {\n throw new SDKInternalError('Work address update failed')\n }\n\n updatedWorkAddress = result.employeeWorkAddress\n callbacks?.onWorkAddressUpdated?.(updatedWorkAddress)\n }\n\n submitResult = {\n mode: isCreateMode ? 'create' : 'update',\n data: updatedWorkAddress,\n }\n })\n resolve()\n },\n () => {\n resolve()\n },\n )()\n })\n\n return submitResult\n }\n\n const isDataLoading =\n locationsQuery.isLoading || (employeeId ? workAddressesQuery.isLoading : false)\n\n if (isDataLoading || !companyLocations || (employeeId && !workAddresses)) {\n return { isLoading: true as const, errorHandling }\n }\n\n return {\n isLoading: false as const,\n data: {\n workAddress: currentWorkAddress ?? null,\n workAddresses,\n companyLocations,\n },\n status: {\n isPending,\n mode: isCreateMode ? ('create' as const) : ('update' as const),\n },\n actions: { onSubmit },\n errorHandling,\n form: {\n Fields: {\n Location: LocationField,\n EffectiveDate: withEffectiveDateField ? EffectiveDateField : undefined,\n },\n fieldsMetadata,\n hookFormInternals: { formMethods },\n getFormSubmissionValues: createGetFormSubmissionValues(formMethods, schema),\n },\n }\n}\n\nexport type UseWorkAddressFormResult = HookLoadingResult | UseWorkAddressFormReady\nexport type WorkAddressFieldsMetadata = UseWorkAddressFormReady['form']['fieldsMetadata']\nexport type WorkAddressFormFields = UseWorkAddressFormReady['form']['Fields']\n"],"names":["useWorkAddressForm","companyId","employeeId","withEffectiveDateField","optionalFieldsToRequire","partnerDefaults","validationMode","shouldFocusError","locationsQuery","useLocationsGet","workAddressesQuery","useEmployeeAddressesGetWorkAddresses","companyLocations","workAddresses","currentWorkAddress","address","isCreateMode","mode","schema","metadataConfig","useMemo","createWorkAddressSchema","resolvedDefaults","formMethods","useForm","zodResolver","createWorkAddressMutation","useEmployeeAddressesCreateWorkAddressMutation","updateWorkAddressMutation","useEmployeeAddressesUpdateWorkAddressMutation","isPending","baseSubmitHandler","submitError","setSubmitError","useBaseSubmit","errorHandling","composeErrorHandler","locationOptions","location","addressInline","baseMetadata","useDeriveFieldsMetadata","fieldsMetadata","withOptions","onSubmit","callbacks","options","submitResult","resolve","data","payload","resolvedEmployeeId","SDKInternalError","resolvedEffectiveDate","effectiveDateParam","RFCDate","updatedWorkAddress","result","LocationField","EffectiveDateField","createGetFormSubmissionValues"],"mappings":";;;;;;;;;;;;;;;;;AA8EO,SAASA,GAAmB;AAAA,EACjC,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,wBAAAC,IAAyB;AAAA,EACzB,yBAAAC;AAAA,EACA,eAAeC;AAAA,EACf,gBAAAC,IAAiB;AAAA,EACjB,kBAAAC,IAAmB;AACrB,GAAyE;AACvE,QAAMC,IAAiBC,EAAgB,EAAE,WAAAR,GAAW,GAC9CS,IAAqBC;AAAA,IACzB,EAAE,YAAYT,KAAc,GAAA;AAAA,IAC5B,EAAE,SAAS,CAAC,CAACA,EAAA;AAAA,EAAW,GAGpBU,IAAmBJ,EAAe,MAAM,sBACxCK,IAAgBH,EAAmB,MAAM,2BACzCI,IAAqBD,GAAe,KAAK,CAAAE,MAAWA,EAAQ,MAAM,GAElEC,IAAe,CAACF,GAChBG,IAAOD,IAAe,WAAW,UAEjC,CAACE,GAAQC,CAAc,IAAIC;AAAA,IAC/B,MAA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AY,OAEtD,CAACE,KAAqBV,KAAc,CAACW,IACjD,EAAE,WAAW,IAAe,eAAAsB,EAAA,IAG9B;AAAA,IACL,WAAW;AAAA,IACX,MAAM;AAAA,MACJ,aAAarB,KAAsB;AAAA,MACnC,eAAAD;AAAA,MACA,kBAAAD;AAAA,IAAA;AAAA,IAEF,QAAQ;AAAA,MACN,WAAAkB;AAAA,MACA,MAAMd,IAAgB,WAAsB;AAAA,IAAA;AAAA,IAE9C,SAAS,EAAE,UAAA4B,EAAA;AAAA,IACX,eAAAT;AAAA,IACA,MAAM;AAAA,MACJ,QAAQ;AAAA,QACN,UAAUuB;AAAA,QACV,eAAevD,IAAyBwD,IAAqB;AAAA,MAAA;AAAA,MAE/D,gBAAAjB;AAAA,MACA,mBAAmB,EAAE,aAAAnB,EAAA;AAAA,MACrB,yBAAyBqC,EAA8BrC,GAAaL,CAAM;AAAA,IAAA;AAAA,EAC5E;AAEJ;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { OptionalFieldsToRequire } from '
|
|
2
|
+
import { OptionalFieldsToRequire } from '../../../../../partner-hook-utils/form/buildFormSchema';
|
|
3
3
|
export declare const WorkAddressErrorCodes: {
|
|
4
4
|
readonly REQUIRED: "REQUIRED";
|
|
5
5
|
};
|
|
@@ -13,16 +13,14 @@ export type WorkAddressFormData = {
|
|
|
13
13
|
[K in keyof typeof fieldValidators]: z.infer<(typeof fieldValidators)[K]>;
|
|
14
14
|
};
|
|
15
15
|
export type WorkAddressFormOutputs = WorkAddressFormData;
|
|
16
|
-
declare const requiredFieldsConfig: {
|
|
17
|
-
effectiveDate: "never";
|
|
18
|
-
};
|
|
16
|
+
declare const requiredFieldsConfig: {};
|
|
19
17
|
export type WorkAddressOptionalFieldsToRequire = OptionalFieldsToRequire<typeof requiredFieldsConfig>;
|
|
20
18
|
interface WorkAddressSchemaOptions {
|
|
21
19
|
mode?: 'create' | 'update';
|
|
22
20
|
optionalFieldsToRequire?: WorkAddressOptionalFieldsToRequire;
|
|
23
21
|
withEffectiveDateField?: boolean;
|
|
24
22
|
}
|
|
25
|
-
export declare function createWorkAddressSchema(options?: WorkAddressSchemaOptions): import('
|
|
23
|
+
export declare function createWorkAddressSchema(options?: WorkAddressSchemaOptions): import('../../../../../partner-hook-utils/form/buildFormSchema').BuildFormSchemaResult<{
|
|
26
24
|
locationUuid: z.ZodString;
|
|
27
25
|
effectiveDate: z.ZodISODate;
|
|
28
26
|
}>;
|
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
import { z as r } from "zod";
|
|
2
|
-
import { buildFormSchema as s } from "
|
|
2
|
+
import { buildFormSchema as s } from "../../../../../partner-hook-utils/form/buildFormSchema.js";
|
|
3
3
|
const e = {
|
|
4
4
|
REQUIRED: "REQUIRED"
|
|
5
5
|
}, c = {
|
|
6
6
|
locationUuid: r.string().min(1, { message: e.REQUIRED }),
|
|
7
7
|
effectiveDate: r.iso.date({ error: () => e.REQUIRED })
|
|
8
|
-
}, a = {
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
function E(o = {}) {
|
|
12
|
-
const { mode: t = "create", optionalFieldsToRequire: i, withEffectiveDateField: d = !0 } = o;
|
|
8
|
+
}, a = {};
|
|
9
|
+
function f(o = {}) {
|
|
10
|
+
const { mode: i = "create", optionalFieldsToRequire: t, withEffectiveDateField: d = !0 } = o;
|
|
13
11
|
return s(c, {
|
|
14
12
|
requiredFieldsConfig: a,
|
|
15
13
|
requiredErrorCode: e.REQUIRED,
|
|
16
|
-
mode:
|
|
17
|
-
optionalFieldsToRequire:
|
|
14
|
+
mode: i,
|
|
15
|
+
optionalFieldsToRequire: t,
|
|
18
16
|
excludeFields: d ? [] : ["effectiveDate"]
|
|
19
17
|
});
|
|
20
18
|
}
|
|
21
19
|
export {
|
|
22
20
|
e as WorkAddressErrorCodes,
|
|
23
|
-
|
|
21
|
+
f as createWorkAddressSchema
|
|
24
22
|
};
|
|
25
23
|
//# sourceMappingURL=workAddressSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workAddressSchema.js","sources":["../../../../../../src/components/Employee/Profile/shared/useWorkAddressForm/workAddressSchema.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n buildFormSchema,\n type RequiredFieldConfig,\n type OptionalFieldsToRequire,\n} from '@/partner-hook-utils/form/buildFormSchema'\n\n// ── Error codes ────────────────────────────────────────────────────────\n\nexport const WorkAddressErrorCodes = {\n REQUIRED: 'REQUIRED',\n} as const\n\nexport type WorkAddressErrorCode =\n (typeof WorkAddressErrorCodes)[keyof typeof WorkAddressErrorCodes]\n\n// ── Field validators ───────────────────────────────────────────────────\n\nconst fieldValidators = {\n locationUuid: z.string().min(1, { message: WorkAddressErrorCodes.REQUIRED }),\n effectiveDate: z.iso.date({ error: () => WorkAddressErrorCodes.REQUIRED }),\n}\n\nexport type WorkAddressField = keyof typeof fieldValidators\n\nexport type WorkAddressFormData = {\n [K in keyof typeof fieldValidators]: z.infer<(typeof fieldValidators)[K]>\n}\nexport type WorkAddressFormOutputs = WorkAddressFormData\n\n// ── Required fields config ─────────────────────────────────────────────\n\nconst requiredFieldsConfig = {} satisfies RequiredFieldConfig<typeof fieldValidators>\n\n// ── Schema factory ─────────────────────────────────────────────────────\n\nexport type WorkAddressOptionalFieldsToRequire = OptionalFieldsToRequire<\n typeof requiredFieldsConfig\n>\n\ninterface WorkAddressSchemaOptions {\n mode?: 'create' | 'update'\n optionalFieldsToRequire?: WorkAddressOptionalFieldsToRequire\n withEffectiveDateField?: boolean\n}\n\nexport function createWorkAddressSchema(options: WorkAddressSchemaOptions = {}) {\n const { mode = 'create', optionalFieldsToRequire, withEffectiveDateField = true } = options\n\n return buildFormSchema(fieldValidators, {\n requiredFieldsConfig,\n requiredErrorCode: WorkAddressErrorCodes.REQUIRED,\n mode,\n optionalFieldsToRequire,\n excludeFields: withEffectiveDateField ? [] : ['effectiveDate'],\n })\n}\n"],"names":["WorkAddressErrorCodes","fieldValidators","z","requiredFieldsConfig","createWorkAddressSchema","options","mode","optionalFieldsToRequire","withEffectiveDateField","buildFormSchema"],"mappings":";;AASO,MAAMA,IAAwB;AAAA,EACnC,UAAU;AACZ,GAOMC,IAAkB;AAAA,EACtB,cAAcC,EAAE,OAAA,EAAS,IAAI,GAAG,EAAE,SAASF,EAAsB,UAAU;AAAA,EAC3E,eAAeE,EAAE,IAAI,KAAK,EAAE,OAAO,MAAMF,EAAsB,SAAA,CAAU;AAC3E,GAWMG,IAAuB,CAAA;AActB,SAASC,EAAwBC,IAAoC,IAAI;AAC9E,QAAM,EAAE,MAAAC,IAAO,UAAU,yBAAAC,GAAyB,wBAAAC,IAAyB,OAASH;AAEpF,SAAOI,EAAgBR,GAAiB;AAAA,IACtC,sBAAAE;AAAA,IACA,mBAAmBH,EAAsB;AAAA,IACzC,MAAAM;AAAA,IACA,yBAAAC;AAAA,IACA,eAAeC,IAAyB,CAAA,IAAK,CAAC,eAAe;AAAA,EAAA,CAC9D;AACH;"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as
|
|
2
|
+
import { useTranslation as e } from "react-i18next";
|
|
3
3
|
import { useStateTaxes as r } from "./useStateTaxes.js";
|
|
4
4
|
import "../../../shared/constants.js";
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import "classnames";
|
|
6
|
+
import { ActionsLayout as m } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
7
|
+
import { useComponentContext as s } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
|
+
function l() {
|
|
9
|
+
const { t: o } = e("Employee.StateTaxes"), { isPending: n } = r(), i = s();
|
|
10
|
+
return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(i.Button, { type: "submit", isLoading: n, children: o("submitCta") }) });
|
|
10
11
|
}
|
|
11
12
|
export {
|
|
12
|
-
|
|
13
|
+
l as Actions
|
|
13
14
|
};
|
|
14
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;"}
|
|
@@ -10,11 +10,12 @@ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
|
10
10
|
import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
11
11
|
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
12
12
|
import "../../../shared/constants.js";
|
|
13
|
+
import "classnames";
|
|
13
14
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
15
|
import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
|
|
15
|
-
const [
|
|
16
|
+
const [u, f] = t("StateTaxesContext");
|
|
16
17
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
f as StateTaxesProvider,
|
|
19
|
+
u as useStateTaxes
|
|
19
20
|
};
|
|
20
21
|
//# 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,14 +1,15 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { useTaxes as
|
|
2
|
+
import { useTranslation as r } from "react-i18next";
|
|
3
|
+
import { useTaxes as s } from "./useTaxes.js";
|
|
4
4
|
import "../../../shared/constants.js";
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import "classnames";
|
|
6
|
+
import { ActionsLayout as m } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
7
|
+
import { useComponentContext as e } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
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") }) });
|
|
10
11
|
};
|
|
11
12
|
export {
|
|
12
|
-
|
|
13
|
+
l as Actions
|
|
13
14
|
};
|
|
14
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,6 +2,7 @@ import { jsxs as l, Fragment as a, jsx as r } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTranslation as s, Trans as m } from "react-i18next";
|
|
3
3
|
import { z as t } from "zod";
|
|
4
4
|
import "../../../shared/constants.js";
|
|
5
|
+
import "classnames";
|
|
5
6
|
import { useComponentContext as u } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
7
|
import { SelectField as d } from "../../Common/Fields/SelectField/SelectField.js";
|
|
7
8
|
import { RadioGroupField as f } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
@@ -13,8 +14,8 @@ const c = t.object({
|
|
|
13
14
|
otherIncome: t.number().transform(String),
|
|
14
15
|
deductions: t.number().transform(String),
|
|
15
16
|
extraWithholding: t.number().transform(String)
|
|
16
|
-
}),
|
|
17
|
-
function
|
|
17
|
+
}), I = c;
|
|
18
|
+
function v() {
|
|
18
19
|
const { t: e } = s("Employee.Taxes"), o = u(), n = [
|
|
19
20
|
{ value: "Single", label: e("filingStatusSingle") },
|
|
20
21
|
{ value: "Married", label: e("filingStatusMarried") },
|
|
@@ -103,7 +104,7 @@ function I() {
|
|
|
103
104
|
] });
|
|
104
105
|
}
|
|
105
106
|
export {
|
|
106
|
-
|
|
107
|
-
|
|
107
|
+
v as FederalForm,
|
|
108
|
+
I as FederalFormSchema
|
|
108
109
|
};
|
|
109
110
|
//# 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 { z } from 'zod'\nimport { NumberInputField, RadioGroupField, SelectField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nconst Rev2020Schema = z.object({\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\nexport const FederalFormSchema = Rev2020Schema\n\nexport type FederalFormInputs = z.input<typeof FederalFormSchema>\nexport type FederalFormPayload = z.output<typeof FederalFormSchema>\n\nexport function FederalForm() {\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"],"names":["Rev2020Schema","z","FederalFormSchema","FederalForm","t","useTranslation","Components","useComponentContext","filingStatusOptions","jsxs","Fragment","jsx","SelectField","RadioGroupField","Trans","NumberInputField"],"mappings":"
|
|
1
|
+
{"version":3,"file":"FederalForm.js","sources":["../../../../src/components/Employee/Taxes/FederalForm.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { NumberInputField, RadioGroupField, SelectField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nconst Rev2020Schema = z.object({\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\nexport const FederalFormSchema = Rev2020Schema\n\nexport type FederalFormInputs = z.input<typeof FederalFormSchema>\nexport type FederalFormPayload = z.output<typeof FederalFormSchema>\n\nexport function FederalForm() {\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"],"names":["Rev2020Schema","z","FederalFormSchema","FederalForm","t","useTranslation","Components","useComponentContext","filingStatusOptions","jsxs","Fragment","jsx","SelectField","RadioGroupField","Trans","N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api/models/errors/unprocessableentityerrorobject";
|
|
11
11
|
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
12
12
|
import "../../../shared/constants.js";
|
|
13
|
+
import "classnames";
|
|
13
14
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
15
|
import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
|
|
15
|
-
const [
|
|
16
|
+
const [f, v] = o("TaxesContext");
|
|
16
17
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
v as TaxesProvider,
|
|
19
|
+
f as useTaxes
|
|
19
20
|
};
|
|
20
21
|
//# 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;"}
|
|
@@ -22,17 +22,17 @@ const K = ({ employeeId: e, companyId: f, dictionary: D }) => {
|
|
|
22
22
|
V("Employee.Terminations.TerminateEmployee", D), z("Employee.Terminations.TerminateEmployee");
|
|
23
23
|
const c = S(), { onEvent: i, baseSubmitHandler: C } = Q(), {
|
|
24
24
|
data: { employee: u }
|
|
25
|
-
} = Y({ employeeId: e }), { data: r } = q({ employeeId: e })
|
|
25
|
+
} = Y({ employeeId: e }), { data: r } = q({ employeeId: e }), { mutateAsync: O, isPending: A } = b(), { mutateAsync: L, isPending: h } = B(), { mutateAsync: N, isPending: M } = G(), { refetch: _ } = k(
|
|
26
|
+
{ companyId: f },
|
|
27
|
+
{ enabled: !1 }
|
|
28
|
+
);
|
|
26
29
|
if (u?.terminated && r.terminationList?.[0])
|
|
27
30
|
return i(n.EMPLOYEE_TERMINATION_VIEW_SUMMARY, {
|
|
28
31
|
employeeId: e,
|
|
29
32
|
effectiveDate: r.terminationList[0].effectiveDate,
|
|
30
33
|
termination: r.terminationList[0]
|
|
31
34
|
}), null;
|
|
32
|
-
const
|
|
33
|
-
{ companyId: f },
|
|
34
|
-
{ enabled: !1 }
|
|
35
|
-
), R = J({
|
|
35
|
+
const R = J({
|
|
36
36
|
first_name: u?.firstName,
|
|
37
37
|
last_name: u?.lastName
|
|
38
38
|
}), s = r.terminationList?.[0];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TerminateEmployee.js","sources":["../../../../../src/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.tsx"],"sourcesContent":["import { useQueryClient } from '@tanstack/react-query'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport {\n useEmployeeEmploymentsGetTerminationsSuspense,\n invalidateAllEmployeeEmploymentsGetTerminations,\n} from '@gusto/embedded-api/react-query/employeeEmploymentsGetTerminations'\nimport { useEmployeeEmploymentsCreateTerminationMutation } from '@gusto/embedded-api/react-query/employeeEmploymentsCreateTermination'\nimport { useEmployeeEmploymentsUpdateTerminationMutation } from '@gusto/embedded-api/react-query/employeeEmploymentsUpdateTermination'\nimport { usePayrollsCreateOffCycleMutation } from '@gusto/embedded-api/react-query/payrollsCreateOffCycle'\nimport {\n usePaySchedulesGetUnprocessedTerminationPeriods,\n invalidateAllPaySchedulesGetUnprocessedTerminationPeriods,\n} from '@gusto/embedded-api/react-query/paySchedulesGetUnprocessedTerminationPeriods'\nimport { invalidateAllPayrollsList } from '@gusto/embedded-api/react-query/payrollsList'\nimport { OffCycleReason } from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayrolls'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport type { PayrollOption } from '../types'\nimport { TerminateEmployeePresentation } from './TerminateEmployeePresentation'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { firstLastName } from '@/helpers/formattedStrings'\n\nexport interface TerminateEmployeeProps extends BaseComponentInterface<'Employee.Terminations.TerminateEmployee'> {\n employeeId: string\n companyId: string\n}\n\nexport interface TerminateEmployeeFormData {\n lastDayOfWork: Date\n payrollOption: PayrollOption\n}\n\nexport function TerminateEmployee(props: TerminateEmployeeProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ employeeId, companyId, dictionary }: TerminateEmployeeProps) => {\n useComponentDictionary('Employee.Terminations.TerminateEmployee', dictionary)\n useI18n('Employee.Terminations.TerminateEmployee')\n\n const queryClient = useQueryClient()\n const { onEvent, baseSubmitHandler } = useBase()\n\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n\n const { data: terminationsData } = useEmployeeEmploymentsGetTerminationsSuspense({ employeeId })\n\n // If employee is already terminated, redirect to summary with existing termination data\n // Don't pass payrollOption to avoid showing the success alert\n if (employee?.terminated && terminationsData.terminationList?.[0]) {\n onEvent(componentEvents.EMPLOYEE_TERMINATION_VIEW_SUMMARY, {\n employeeId,\n effectiveDate: terminationsData.terminationList[0].effectiveDate!,\n termination: terminationsData.terminationList[0],\n })\n return null\n }\n\n const { mutateAsync: createTermination, isPending: isCreatingTermination } =\n useEmployeeEmploymentsCreateTerminationMutation()\n\n const { mutateAsync: updateTermination, isPending: isUpdatingTermination } =\n useEmployeeEmploymentsUpdateTerminationMutation()\n\n const { mutateAsync: createOffCyclePayroll, isPending: isCreatingPayroll } =\n usePayrollsCreateOffCycleMutation()\n\n const { refetch: fetchTerminationPeriods } = usePaySchedulesGetUnprocessedTerminationPeriods(\n { companyId },\n { enabled: false },\n )\n\n const employeeName = firstLastName({\n first_name: employee?.firstName,\n last_name: employee?.lastName,\n })\n\n const existingTermination = terminationsData.terminationList?.[0]\n\n const handleSubmit = async (formData: TerminateEmployeeFormData) => {\n const { lastDayOfWork, payrollOption } = formData\n const effectiveDate = lastDayOfWork.toISOString().split('T')[0]!\n\n await baseSubmitHandler({ effectiveDate, payrollOption }, async () => {\n const runTerminationPayroll = payrollOption === 'dismissalPayroll'\n\n const result = existingTermination\n ? await updateTermination({\n request: {\n employeeId,\n requestBody: {\n version: existingTermination.version!,\n effectiveDate,\n runTerminationPayroll,\n },\n },\n })\n : await createTermination({\n request: {\n employeeId,\n requestBody: {\n effectiveDate,\n runTerminationPayroll,\n },\n },\n })\n\n await invalidateAllEmployeeEmploymentsGetTerminations(queryClient)\n\n let firstPayrollUuid: string | undefined\n\n if (runTerminationPayroll) {\n try {\n const { data: terminationPeriodsData } = await fetchTerminationPeriods()\n\n const employeePeriods =\n terminationPeriodsData?.unprocessedTerminationPayPeriodList?.filter(\n period => period.employeeUuid === employeeId,\n ) ?? []\n\n const createdPayrolls = []\n\n for (const terminationPeriod of employeePeriods) {\n if (terminationPeriod.startDate && terminationPeriod.endDate) {\n const payrollResult = await createOffCyclePayroll({\n request: {\n companyId,\n requestBody: {\n offCycle: true,\n offCycleReason: OffCycleReason.DismissedEmployee,\n startDate: new RFCDate(terminationPeriod.startDate),\n endDate: new RFCDate(terminationPeriod.endDate),\n employeeUuids: [employeeId],\n checkDate: terminationPeriod.checkDate\n ? new RFCDate(terminationPeriod.checkDate)\n : undefined,\n },\n },\n })\n\n if (payrollResult.payrollUnprocessed) {\n createdPayrolls.push(payrollResult.payrollUnprocessed)\n }\n }\n }\n\n if (createdPayrolls.length > 0) {\n firstPayrollUuid = createdPayrolls[0]?.payrollUuid ?? createdPayrolls[0]?.uuid\n\n await invalidateAllPayrollsList(queryClient)\n await invalidateAllPaySchedulesGetUnprocessedTerminationPeriods(queryClient)\n\n onEvent(componentEvents.EMPLOYEE_TERMINATION_PAYROLL_CREATED, {\n payrolls: createdPayrolls,\n })\n }\n } catch (payrollError) {\n onEvent(componentEvents.EMPLOYEE_TERMINATION_PAYROLL_FAILED, {\n error: payrollError,\n employeeId,\n })\n }\n }\n\n const eventType = existingTermination\n ? componentEvents.EMPLOYEE_TERMINATION_UPDATED\n : componentEvents.EMPLOYEE_TERMINATION_CREATED\n\n onEvent(eventType, {\n termination: result.termination,\n payrollOption,\n runTerminationPayroll,\n })\n\n onEvent(componentEvents.EMPLOYEE_TERMINATION_DONE, {\n employeeId,\n effectiveDate,\n payrollOption,\n payrollUuid: firstPayrollUuid,\n termination: result.termination,\n ...(payrollOption === 'anotherWay' && { manualHandling: true }),\n })\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n const isPending = isCreatingTermination || isUpdatingTermination || isCreatingPayroll\n\n return (\n <TerminateEmployeePresentation\n employeeName={employeeName}\n existingTermination={existingTermination}\n onSubmit={handleSubmit}\n onCancel={handleCancel}\n isLoading={isPending}\n />\n )\n}\n"],"names":["TerminateEmployee","props","jsx","BaseComponent","Root","employeeId","companyId","dictionary","useComponentDictionary","useI18n","queryClient","useQueryClient","onEvent","baseSubmitHandler","useBase","employee","useEmployeesGetSuspense","terminationsData","useEmployeeEmploymentsGetTerminationsSuspense","componentEvents","createTermination","isCreatingTermination","useEmployeeEmploymentsCreateTerminationMutation","updateTermination","isUpdatingTermination","useEmployeeEmploymentsUpdateTerminationMutation","createOffCyclePayroll","isCreatingPayroll","usePayrollsCreateOffCycleMutation","fetchTerminationPeriods","usePaySchedulesGetUnprocessedTerminationPeriods","employeeName","firstLastName","existingTermination","TerminateEmployeePresentation","formData","lastDayOfWork","payrollOption","effectiveDate","runTerminationPayroll","result","invalidateAllEmployeeEmploymentsGetTerminations","firstPayrollUuid","terminationPeriodsData","employeePeriods","period","createdPayrolls","terminationPeriod","payrollResult","OffCycleReason","RFCDate","invalidateAllPayrollsList","invalidateAllPaySchedulesGetUnprocessedTerminationPeriods","payrollError","eventType"],"mappings":";;;;;;;;;;;;;;;;;AAmCO,SAASA,GAAkBC,GAA+B;AAC/D,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMG,IAAO,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,YAAAC,QAAyC;AAC9E,EAAAC,EAAuB,2CAA2CD,CAAU,GAC5EE,EAAQ,yCAAyC;AAEjD,QAAMC,IAAcC,EAAA,GACd,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GAEjC;AAAA,IACJ,MAAM,EAAE,UAAAC,EAAA;AAAA,EAAS,IACfC,EAAwB,EAAE,YAAAX,GAAY,GAEpC,EAAE,MAAMY,EAAA,IAAqBC,EAA8C,EAAE,YAAAb,GAAY;AAI/F,MAAIU,GAAU,cAAcE,EAAiB,kBAAkB,CAAC;AAC9D,WAAAL,EAAQO,EAAgB,mCAAmC;AAAA,MACzD,YAAAd;AAAA,MACA,eAAeY,EAAiB,gBAAgB,CAAC,EAAE;AAAA,MACnD,aAAaA,EAAiB,gBAAgB,CAAC;AAAA,IAAA,CAChD,GACM;AAGT,QAAM,EAAE,aA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,EAAO;AAAA,YACpB,GAAIH,MAAkB,gBAAgB,EAAE,gBAAgB,GAAA;AAAA,UAAK,CAC9D;AAAA,QACH,CAAC;AAAA,MACH;AAAA,MAaI,UAXiB,MAAM;AACzB,QAAAzB,EAAQO,EAAgB,MAAM;AAAA,MAChC;AAAA,MAUI,WARcE,KAAyBG,KAAyBG;AAAA,IAQrD;AAAA,EAAA;AAGjB;"}
|
|
1
|
+
{"version":3,"file":"TerminateEmployee.js","sources":["../../../../../src/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.tsx"],"sourcesContent":["import { useQueryClient } from '@tanstack/react-query'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport {\n useEmployeeEmploymentsGetTerminationsSuspense,\n invalidateAllEmployeeEmploymentsGetTerminations,\n} from '@gusto/embedded-api/react-query/employeeEmploymentsGetTerminations'\nimport { useEmployeeEmploymentsCreateTerminationMutation } from '@gusto/embedded-api/react-query/employeeEmploymentsCreateTermination'\nimport { useEmployeeEmploymentsUpdateTerminationMutation } from '@gusto/embedded-api/react-query/employeeEmploymentsUpdateTermination'\nimport { usePayrollsCreateOffCycleMutation } from '@gusto/embedded-api/react-query/payrollsCreateOffCycle'\nimport {\n usePaySchedulesGetUnprocessedTerminationPeriods,\n invalidateAllPaySchedulesGetUnprocessedTerminationPeriods,\n} from '@gusto/embedded-api/react-query/paySchedulesGetUnprocessedTerminationPeriods'\nimport { invalidateAllPayrollsList } from '@gusto/embedded-api/react-query/payrollsList'\nimport { OffCycleReason } from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayrolls'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport type { PayrollOption } from '../types'\nimport { TerminateEmployeePresentation } from './TerminateEmployeePresentation'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { firstLastName } from '@/helpers/formattedStrings'\n\nexport interface TerminateEmployeeProps extends BaseComponentInterface<'Employee.Terminations.TerminateEmployee'> {\n employeeId: string\n companyId: string\n}\n\nexport interface TerminateEmployeeFormData {\n lastDayOfWork: Date\n payrollOption: PayrollOption\n}\n\nexport function TerminateEmployee(props: TerminateEmployeeProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ employeeId, companyId, dictionary }: TerminateEmployeeProps) => {\n useComponentDictionary('Employee.Terminations.TerminateEmployee', dictionary)\n useI18n('Employee.Terminations.TerminateEmployee')\n\n const queryClient = useQueryClient()\n const { onEvent, baseSubmitHandler } = useBase()\n\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n\n const { data: terminationsData } = useEmployeeEmploymentsGetTerminationsSuspense({ employeeId })\n\n const { mutateAsync: createTermination, isPending: isCreatingTermination } =\n useEmployeeEmploymentsCreateTerminationMutation()\n\n const { mutateAsync: updateTermination, isPending: isUpdatingTermination } =\n useEmployeeEmploymentsUpdateTerminationMutation()\n\n const { mutateAsync: createOffCyclePayroll, isPending: isCreatingPayroll } =\n usePayrollsCreateOffCycleMutation()\n\n const { refetch: fetchTerminationPeriods } = usePaySchedulesGetUnprocessedTerminationPeriods(\n { companyId },\n { enabled: false },\n )\n\n // If employee is already terminated, redirect to summary with existing termination data\n // Don't pass payrollOption to avoid showing the success alert\n if (employee?.terminated && terminationsData.terminationList?.[0]) {\n onEvent(componentEvents.EMPLOYEE_TERMINATION_VIEW_SUMMARY, {\n employeeId,\n effectiveDate: terminationsData.terminationList[0].effectiveDate!,\n termination: terminationsData.terminationList[0],\n })\n return null\n }\n\n const employeeName = firstLastName({\n first_name: employee?.firstName,\n last_name: employee?.lastName,\n })\n\n const existingTermination = terminationsData.terminationList?.[0]\n\n const handleSubmit = async (formData: TerminateEmployeeFormData) => {\n const { lastDayOfWork, payrollOption } = formData\n const effectiveDate = lastDayOfWork.toISOString().split('T')[0]!\n\n await baseSubmitHandler({ effectiveDate, payrollOption }, async () => {\n const runTerminationPayroll = payrollOption === 'dismissalPayroll'\n\n const result = existingTermination\n ? await updateTermination({\n request: {\n employeeId,\n requestBody: {\n version: existingTermination.version!,\n effectiveDate,\n runTerminationPayroll,\n },\n },\n })\n : await createTermination({\n request: {\n employeeId,\n requestBody: {\n effectiveDate,\n runTerminationPayroll,\n },\n },\n })\n\n await invalidateAllEmployeeEmploymentsGetTerminations(queryClient)\n\n let firstPayrollUuid: string | undefined\n\n if (runTerminationPayroll) {\n try {\n const { data: terminationPeriodsData } = await fetchTerminationPeriods()\n\n const employeePeriods =\n terminationPeriodsData?.unprocessedTerminationPayPeriodList?.filter(\n period => period.employeeUuid === employeeId,\n ) ?? []\n\n const createdPayrolls = []\n\n for (const terminationPeriod of employeePeriods) {\n if (terminationPeriod.startDate && terminationPeriod.endDate) {\n const payrollResult = await createOffCyclePayroll({\n request: {\n companyId,\n requestBody: {\n offCycle: true,\n offCycleReason: OffCycleReason.DismissedEmployee,\n startDate: new RFCDate(terminationPeriod.startDate),\n endDate: new RFCDate(terminationPeriod.endDate),\n employeeUuids: [employeeId],\n checkDate: terminationPeriod.checkDate\n ? new RFCDate(terminationPeriod.checkDate)\n : undefined,\n },\n },\n })\n\n if (payrollResult.payrollUnprocessed) {\n createdPayrolls.push(payrollResult.payrollUnprocessed)\n }\n }\n }\n\n if (createdPayrolls.length > 0) {\n firstPayrollUuid = createdPayrolls[0]?.payrollUuid ?? createdPayrolls[0]?.uuid\n\n await invalidateAllPayrollsList(queryClient)\n await invalidateAllPaySchedulesGetUnprocessedTerminationPeriods(queryClient)\n\n onEvent(componentEvents.EMPLOYEE_TERMINATION_PAYROLL_CREATED, {\n payrolls: createdPayrolls,\n })\n }\n } catch (payrollError) {\n onEvent(componentEvents.EMPLOYEE_TERMINATION_PAYROLL_FAILED, {\n error: payrollError,\n employeeId,\n })\n }\n }\n\n const eventType = existingTermination\n ? componentEvents.EMPLOYEE_TERMINATION_UPDATED\n : componentEvents.EMPLOYEE_TERMINATION_CREATED\n\n onEvent(eventType, {\n termination: result.termination,\n payrollOption,\n runTerminationPayroll,\n })\n\n onEvent(componentEvents.EMPLOYEE_TERMINATION_DONE, {\n employeeId,\n effectiveDate,\n payrollOption,\n payrollUuid: firstPayrollUuid,\n termination: result.termination,\n ...(payrollOption === 'anotherWay' && { manualHandling: true }),\n })\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n const isPending = isCreatingTermination || isUpdatingTermination || isCreatingPayroll\n\n return (\n <TerminateEmployeePresentation\n employeeName={employeeName}\n existingTermination={existingTermination}\n onSubmit={handleSubmit}\n onCancel={handleCancel}\n isLoading={isPending}\n />\n )\n}\n"],"names":["TerminateEmployee","props","jsx","BaseComponent","Root","employeeId","companyId","dictionary","useComponentDictionary","useI18n","queryClient","useQueryClient","onEvent","baseSubmitHandler","useBase","employee","useEmployeesGetSuspense","terminationsData","useEmployeeEmploymentsGetTerminationsSuspense","createTermination","isCreatingTermination","useEmployeeEmploymentsCreateTerminationMutation","updateTermination","isUpdatingTermination","useEmployeeEmploymentsUpdateTerminationMutation","createOffCyclePayroll","isCreatingPayroll","usePayrollsCreateOffCycleMutation","fetchTerminationPeriods","usePaySchedulesGetUnprocessedTerminationPeriods","componentEvents","employeeName","firstLastName","existingTermination","TerminateEmployeePresentation","formData","lastDayOfWork","payrollOption","effectiveDate","runTerminationPayroll","result","invalidateAllEmployeeEmploymentsGetTerminations","firstPayrollUuid","terminationPeriodsData","employeePeriods","period","createdPayrolls","terminationPeriod","payrollResult","OffCycleReason","RFCDate","invalidateAllPayrollsList","invalidateAllPaySchedulesGetUnprocessedTerminationPeriods","payrollError","eventType"],"mappings":";;;;;;;;;;;;;;;;;AAmCO,SAASA,GAAkBC,GAA+B;AAC/D,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ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