@gusto/embedded-react-sdk 0.47.1 → 0.48.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 +128 -0
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +10 -7
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +8 -6
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +9 -8
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +9 -6
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +16 -15
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/Head.js +9 -8
- package/dist/components/Company/AssignSignatory/Head.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +7 -6
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +8 -5
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +21 -20
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +4 -2
- package/dist/components/Company/AssignSignatory/TitleSelect.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 +11 -9
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Head.js +3 -2
- package/dist/components/Company/BankAccount/BankAccountForm/Head.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +7 -6
- 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 +6 -4
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +6 -5
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +14 -11
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +8 -7
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +7 -6
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +10 -7
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +4 -4
- package/dist/components/Company/Industry/Actions.js +6 -5
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +12 -10
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Industry/IndustrySelect.js +8 -6
- package/dist/components/Company/Industry/IndustrySelect.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +3 -2
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +6 -4
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +17 -14
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +9 -9
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +12 -9
- package/dist/components/Company/Locations/LocationsList/LocationsList.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 +9 -8
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +5 -2
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleList.js +8 -8
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +6 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +7 -6
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +5 -2
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +4 -2
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/Head.js +5 -4
- package/dist/components/Contractor/Address/Head.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +4 -4
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +4 -2
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +4 -2
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +10 -10
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.d.ts +2 -2
- 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/PaymentHistory/PaymentHistoryPresentation.js +15 -15
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +4 -3
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.d.ts +6 -6
- package/dist/components/Contractor/Submit/Submit.js +3 -2
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Contractor/exports/contractorManagement.d.ts +6 -0
- package/dist/components/Contractor/exports/contractorManagement.js +15 -0
- package/dist/components/Contractor/exports/contractorManagement.js.map +1 -0
- package/dist/components/Employee/Compensation/management/Compensation.d.ts +35 -0
- package/dist/components/Employee/Compensation/management/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.d.ts +23 -3
- package/dist/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.d.ts +21 -10
- package/dist/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.d.ts +24 -7
- package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.js +18 -18
- package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationCard/index.d.ts +0 -1
- package/dist/components/Employee/Compensation/management/CompensationComponents.d.ts +7 -1
- package/dist/components/Employee/Compensation/management/CompensationComponents.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.d.ts +27 -15
- package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.d.ts +12 -0
- package/dist/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationEditPendingJobForm/CompensationEditPendingJobForm.d.ts +12 -0
- package/dist/components/Employee/Compensation/management/CompensationEditPendingJobForm/CompensationEditPendingJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.d.ts +3 -0
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js +3 -2
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js.map +1 -1
- package/dist/components/Employee/Compensation/management/compensationStateMachine.d.ts +1 -0
- package/dist/components/Employee/Compensation/management/compensationStateMachine.js.map +1 -1
- package/dist/components/Employee/Compensation/management/useManagementCompensationDictionary.d.ts +2 -0
- package/dist/components/Employee/Compensation/management/useManagementCompensationDictionary.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/Compensation.d.ts +61 -0
- package/dist/components/Employee/Compensation/onboarding/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/CompensationFlowComponents.d.ts +5 -0
- package/dist/components/Employee/Compensation/onboarding/CompensationFlowComponents.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.d.ts +32 -9
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/index.d.ts +1 -2
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.d.ts +3 -0
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.d.ts +9 -0
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.js +7 -7
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/JobsList/index.d.ts +1 -4
- package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.d.ts +1 -0
- package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.d.ts +5 -0
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js +3 -2
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/PendingChangesReviewModal.d.ts +2 -0
- package/dist/components/Employee/Compensation/shared/PendingChangesReviewModal.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.d.ts +2 -0
- package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/getPendingCompensationChanges.d.ts +4 -0
- package/dist/components/Employee/Compensation/shared/getPendingCompensationChanges.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +98 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.d.ts +168 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js +4 -4
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/index.d.ts +1 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.d.ts +153 -6
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationManagement/index.d.ts +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationManagement/useCompensationManagement.d.ts +19 -0
- package/dist/components/Employee/Compensation/shared/useCompensationManagement/useCompensationManagement.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/fields.d.ts +101 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/fields.js +10 -10
- package/dist/components/Employee/Compensation/shared/useJobForm/fields.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/index.d.ts +1 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.d.ts +75 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.d.ts +137 -8
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/usePendingChangeDetailRenderer.d.ts +2 -0
- package/dist/components/Employee/Compensation/shared/usePendingChangeDetailRenderer.js.map +1 -1
- package/dist/components/Employee/Dashboard/BasicDetailsView.d.ts +18 -4
- package/dist/components/Employee/Dashboard/BasicDetailsView.js.map +1 -1
- package/dist/components/Employee/Dashboard/Dashboard.d.ts +3 -0
- package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +21 -1
- package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -1
- package/dist/components/Employee/Dashboard/DashboardFlow.d.ts +116 -0
- package/dist/components/Employee/Dashboard/DashboardFlow.js.map +1 -1
- package/dist/components/Employee/Dashboard/JobAndPayView.d.ts +20 -0
- package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -1
- package/dist/components/Employee/Dashboard/TaxesView.d.ts +36 -3
- package/dist/components/Employee/Dashboard/TaxesView.js.map +1 -1
- package/dist/components/Employee/Dashboard/dashboardStateMachine.d.ts +1 -0
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
- package/dist/components/Employee/Dashboard/index.d.ts +0 -6
- package/dist/components/Employee/Deductions/management/Deductions.d.ts +30 -0
- package/dist/components/Employee/Deductions/management/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.d.ts +21 -8
- package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.js +15 -15
- package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.js.map +1 -1
- package/dist/components/Employee/Deductions/management/DeductionsComponents.d.ts +5 -1
- package/dist/components/Employee/Deductions/management/DeductionsComponents.js.map +1 -1
- package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.d.ts +21 -7
- package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.js.map +1 -1
- package/dist/components/Employee/Deductions/management/DeductionsEditForm/useFormDictionary.d.ts +2 -0
- package/dist/components/Employee/Deductions/management/DeductionsEditForm/useFormDictionary.js.map +1 -1
- package/dist/components/Employee/Deductions/management/deductionsStateMachine.d.ts +1 -0
- package/dist/components/Employee/Deductions/management/deductionsStateMachine.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/Deductions.d.ts +45 -0
- package/dist/components/Employee/Deductions/onboarding/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.d.ts +2 -0
- package/dist/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.js +12 -12
- package/dist/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/IncludeDeductions/IncludeDeductions.d.ts +2 -0
- package/dist/components/Employee/Deductions/onboarding/IncludeDeductions/IncludeDeductions.js +6 -5
- package/dist/components/Employee/Deductions/onboarding/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/deductionsContextualComponents.d.ts +5 -0
- package/dist/components/Employee/Deductions/onboarding/deductionsContextualComponents.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/stateMachine.d.ts +1 -0
- package/dist/components/Employee/Deductions/onboarding/stateMachine.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/useFormDictionary.d.ts +2 -0
- package/dist/components/Employee/Deductions/onboarding/useFormDictionary.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.d.ts +1 -0
- package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js +7 -6
- package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.d.ts +7 -0
- package/dist/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.d.ts +1 -0
- package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.js +15 -14
- package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/index.d.ts +1 -1
- package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.d.ts +2 -0
- package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/formatDeductionAmount.d.ts +2 -0
- package/dist/components/Employee/Deductions/shared/formatDeductionAmount.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.d.ts +38 -5
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.d.ts +207 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +8 -8
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/index.d.ts +3 -2
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.d.ts +129 -3
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.d.ts +29 -1
- package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.d.ts +158 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +4 -4
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useDeductionForm/index.d.ts +3 -2
- package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.d.ts +131 -4
- package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useDeductionsList.d.ts +6 -1
- package/dist/components/Employee/Deductions/shared/useDeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useDeleteDeduction.d.ts +2 -0
- package/dist/components/Employee/Deductions/shared/useDeleteDeduction.js.map +1 -1
- package/dist/components/Employee/Documents/management/DocumentManager.d.ts +3 -0
- package/dist/components/Employee/Documents/management/DocumentManager.js +7 -6
- package/dist/components/Employee/Documents/management/DocumentManager.js.map +1 -1
- package/dist/components/Employee/Documents/management/Documents.d.ts +24 -0
- package/dist/components/Employee/Documents/management/Documents.js.map +1 -1
- package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.d.ts +17 -7
- package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.js +7 -6
- package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.js.map +1 -1
- package/dist/components/Employee/Documents/management/DocumentsComponents.d.ts +3 -0
- package/dist/components/Employee/Documents/management/DocumentsComponents.js.map +1 -1
- package/dist/components/Employee/Documents/management/documentsStateMachine.d.ts +1 -0
- package/dist/components/Employee/Documents/management/documentsStateMachine.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.d.ts +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js +5 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.d.ts +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js +13 -10
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Head.d.ts +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Head.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.d.ts +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js +4 -2
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.d.ts +29 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.d.ts +23 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.d.ts +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +6 -6
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.d.ts +3 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/countries.d.ts +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/countries.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.d.ts +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js +4 -3
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/documentSignerStateMachine.d.ts +6 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/documentSignerStateMachine.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.d.ts +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.d.ts +27 -2
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.d.ts +3 -0
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.js +7 -6
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/index.d.ts +1 -1
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.d.ts +1 -0
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js +11 -10
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/Documents/shared/useDocumentsList/index.d.ts +0 -1
- package/dist/components/Employee/Documents/shared/useDocumentsList/useDocumentsList.d.ts +23 -6
- package/dist/components/Employee/Documents/shared/useDocumentsList/useDocumentsList.js.map +1 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.d.ts +326 -0
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js +1 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js.map +1 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/index.d.ts +2 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.d.ts +62 -0
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.js.map +1 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/useSignEmployeeForm.d.ts +130 -0
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/useSignEmployeeForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.d.ts +30 -3
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js +17 -21
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.d.ts +2 -0
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js +12 -12
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js.map +1 -1
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.d.ts +23 -2
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.js +38 -35
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.d.ts +2 -0
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.js +10 -10
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.js.map +1 -1
- package/dist/components/Employee/EmployeeList/shared/index.d.ts +1 -1
- package/dist/components/Employee/EmployeeList/shared/useEmployeeList.d.ts +86 -11
- package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js +50 -62
- package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.d.ts +34 -0
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js.map +1 -1
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.d.ts +11 -0
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js.map +1 -1
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.d.ts +1 -0
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/index.d.ts +2 -5
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.d.ts +27 -0
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.d.ts +9 -0
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.js +16 -15
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesComponents.d.ts +5 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesComponents.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.d.ts +24 -0
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js +7 -6
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/federalTaxesStateMachine.d.ts +1 -0
- package/dist/components/Employee/FederalTaxes/management/federalTaxesStateMachine.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/useViewDictionary.d.ts +2 -0
- package/dist/components/Employee/FederalTaxes/management/useViewDictionary.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.d.ts +24 -0
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js +12 -11
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/onboarding/useViewDictionary.d.ts +2 -0
- package/dist/components/Employee/FederalTaxes/onboarding/useViewDictionary.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.d.ts +4 -0
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/index.d.ts +1 -2
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/federalTaxesSchema.d.ts +46 -0
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/federalTaxesSchema.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.d.ts +112 -0
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js +4 -4
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/index.d.ts +1 -0
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/useFederalTaxesForm.d.ts +112 -0
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/useFederalTaxesForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesSummary/index.d.ts +0 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesSummary/useFederalTaxesSummary.d.ts +14 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesSummary/useFederalTaxesSummary.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddress.d.ts +21 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.d.ts +17 -5
- package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.js +8 -7
- package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressComponents.d.ts +3 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddressComponents.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressEditForm.d.ts +20 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddressEditForm.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.d.ts +2 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js +5 -5
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/getPendingFutureHomeAddress.d.ts +7 -1
- package/dist/components/Employee/HomeAddress/management/getPendingFutureHomeAddress.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/homeAddressStateMachine.d.ts +1 -0
- package/dist/components/Employee/HomeAddress/management/homeAddressStateMachine.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.d.ts +46 -7
- package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.js.map +1 -1
- package/dist/components/Employee/HomeAddress/shared/useHomeAddressSummary/index.d.ts +0 -1
- package/dist/components/Employee/HomeAddress/shared/useHomeAddressSummary/useHomeAddressSummary.d.ts +21 -6
- package/dist/components/Employee/HomeAddress/shared/useHomeAddressSummary/useHomeAddressSummary.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.d.ts +6 -0
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlow.d.ts +43 -0
- package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlow.js.map +1 -1
- package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlowComponents.d.ts +17 -0
- package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlowComponents.js.map +1 -1
- package/dist/components/Employee/OnboardingExecutionFlow/index.d.ts +2 -2
- package/dist/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.d.ts +7 -0
- package/dist/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.d.ts +59 -0
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.d.ts +2 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.d.ts +1 -0
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.d.ts +7 -0
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.d.ts +39 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.d.ts +23 -6
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodCard.d.ts +24 -7
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodCard.js +14 -14
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodCard.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.d.ts +5 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodSplitForm.d.ts +23 -6
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodSplitForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/useFormDictionary.d.ts +4 -0
- package/dist/components/Employee/PaymentMethod/management/useFormDictionary.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.d.ts +2 -0
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.js +15 -15
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.d.ts +43 -0
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.d.ts +4 -0
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/SplitView.d.ts +2 -0
- package/dist/components/Employee/PaymentMethod/onboarding/SplitView.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/useFormDictionary.d.ts +4 -0
- package/dist/components/Employee/PaymentMethod/onboarding/useFormDictionary.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.d.ts +4 -0
- package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js +8 -7
- package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/BankFormBody/index.d.ts +1 -1
- package/dist/components/Employee/PaymentMethod/shared/DeleteBankAccountDialog.d.ts +2 -0
- package/dist/components/Employee/PaymentMethod/shared/DeleteBankAccountDialog.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.d.ts +4 -0
- package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.js +10 -9
- package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/index.d.ts +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.d.ts +80 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/index.d.ts +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.d.ts +84 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.d.ts +45 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useDeleteBankAccount.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/shared/useDeleteBankAccount.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.d.ts +22 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/index.d.ts +2 -2
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.d.ts +84 -1
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.d.ts +45 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.d.ts +6 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/fields.d.ts +22 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/fields.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/index.d.ts +2 -2
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.d.ts +25 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.d.ts +124 -7
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.d.ts +52 -6
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.js +1 -2
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.js.map +1 -1
- package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.d.ts +9 -0
- package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js +6 -6
- package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js.map +1 -1
- package/dist/components/Employee/Paystubs/shared/usePaystubsList/index.d.ts +1 -1
- package/dist/components/Employee/Paystubs/shared/usePaystubsList/usePaystubsList.d.ts +25 -0
- package/dist/components/Employee/Paystubs/shared/usePaystubsList/usePaystubsList.js.map +1 -1
- package/dist/components/Employee/Profile/management/Profile.d.ts +25 -0
- package/dist/components/Employee/Profile/management/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.d.ts +22 -6
- package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js +8 -7
- package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js.map +1 -1
- package/dist/components/Employee/Profile/management/ProfileComponents.d.ts +5 -1
- package/dist/components/Employee/Profile/management/ProfileComponents.js.map +1 -1
- package/dist/components/Employee/Profile/management/ProfileEditForm.d.ts +25 -0
- package/dist/components/Employee/Profile/management/ProfileEditForm.js +7 -7
- package/dist/components/Employee/Profile/management/ProfileEditForm.js.map +1 -1
- package/dist/components/Employee/Profile/management/profileStateMachine.d.ts +1 -0
- package/dist/components/Employee/Profile/management/profileStateMachine.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/AdminProfile.d.ts +1 -0
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js +6 -6
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/EmployeeProfile.d.ts +1 -0
- package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js +6 -6
- package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/Profile.d.ts +61 -0
- package/dist/components/Employee/Profile/onboarding/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.d.ts +37 -0
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.d.ts +170 -0
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js +4 -4
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/index.d.ts +4 -2
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +140 -1
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeProfileSummary/index.d.ts +0 -1
- package/dist/components/Employee/Profile/shared/useEmployeeProfileSummary/useEmployeeProfileSummary.d.ts +37 -4
- package/dist/components/Employee/Profile/shared/useEmployeeProfileSummary/useEmployeeProfileSummary.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.d.ts +130 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +4 -4
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.d.ts +35 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/index.d.ts +2 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.d.ts +45 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.d.ts +77 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.d.ts +43 -0
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/index.d.ts +2 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.d.ts +42 -0
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.d.ts +85 -0
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/workAddressSchema.d.ts +35 -0
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/workAddressSchema.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.d.ts +16 -0
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.d.ts +31 -0
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.d.ts +1 -0
- package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js.map +1 -1
- package/dist/components/Employee/StateTaxes/index.d.ts +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxes.d.ts +24 -0
- package/dist/components/Employee/StateTaxes/management/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.d.ts +21 -6
- package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.js +12 -11
- package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxesComponents.d.ts +4 -0
- package/dist/components/Employee/StateTaxes/management/StateTaxesComponents.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.d.ts +20 -8
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js +10 -9
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/stateTaxesStateMachine.d.ts +1 -0
- package/dist/components/Employee/StateTaxes/management/stateTaxesStateMachine.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/useViewDictionary.d.ts +2 -0
- package/dist/components/Employee/StateTaxes/management/useViewDictionary.js.map +1 -1
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.d.ts +22 -0
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js +7 -6
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/onboarding/useViewDictionary.d.ts +2 -0
- package/dist/components/Employee/StateTaxes/onboarding/useViewDictionary.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.d.ts +4 -0
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/index.d.ts +1 -2
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/employeeStateTaxesSchema.d.ts +39 -16
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/employeeStateTaxesSchema.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.d.ts +6 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldMapping.d.ts +4 -9
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldMapping.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldMeta.d.ts +5 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldProps.d.ts +52 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fields.d.ts +26 -5
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fields.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.d.ts +106 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useStateTaxesSummary/index.d.ts +0 -1
- package/dist/components/Employee/StateTaxes/shared/useStateTaxesSummary/useStateTaxesSummary.d.ts +5 -8
- package/dist/components/Employee/StateTaxes/shared/useStateTaxesSummary/useStateTaxesSummary.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.d.ts +53 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.d.ts +1 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +7 -6
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.d.ts +47 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.d.ts +20 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +10 -9
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.d.ts +2 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.d.ts +48 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.d.ts +1 -0
- 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/Terminations/types.d.ts +16 -0
- package/dist/components/Employee/WorkAddress/management/WorkAddress.d.ts +21 -0
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.d.ts +17 -6
- package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.js +17 -16
- package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressComponents.d.ts +3 -0
- package/dist/components/Employee/WorkAddress/management/WorkAddressComponents.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressEditForm.d.ts +20 -0
- package/dist/components/Employee/WorkAddress/management/WorkAddressEditForm.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.d.ts +2 -0
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js +7 -7
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/getPendingFutureWorkAddress.d.ts +2 -0
- package/dist/components/Employee/WorkAddress/management/getPendingFutureWorkAddress.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.d.ts +46 -7
- package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/workAddressStateMachine.d.ts +1 -0
- package/dist/components/Employee/WorkAddress/management/workAddressStateMachine.js.map +1 -1
- package/dist/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/index.d.ts +0 -1
- package/dist/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/useEmployeeWorkAddressSummary.d.ts +21 -4
- package/dist/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/useEmployeeWorkAddressSummary.js.map +1 -1
- package/dist/components/Employee/exports/employeeManagement.d.ts +7 -2
- package/dist/components/Employee/exports/employeeManagement.js +58 -56
- package/dist/components/Employee/exports/employeeManagement.js.map +1 -1
- package/dist/components/Employee/exports/employeeOnboarding.d.ts +11 -10
- package/dist/components/Employee/exports/employeeOnboarding.js +24 -22
- package/dist/components/Employee/exports/employeeOnboarding.js.map +1 -1
- package/dist/components/Employee/index.d.ts +0 -1
- package/dist/components/Flow/FlowHeader.js +4 -3
- package/dist/components/Flow/FlowHeader.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +19 -18
- 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/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +5 -4
- 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/Dismissal/index.d.ts +2 -0
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +5 -5
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +10 -10
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +12 -10
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +1 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.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/PayrollConfiguration/PayrollConfigurationPresentation.js +18 -18
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +295 -289
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +18 -18
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +15 -15
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +4 -4
- 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/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 +2 -1
- 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/index.d.ts +2 -0
- package/dist/components/Payroll/index.js +24 -22
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js +14 -14
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js +3 -2
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js.map +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js +8 -8
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js +4 -4
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js +4 -4
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js +36 -34
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +4 -4
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js +16 -16
- package/dist/components/TimeOff/index.d.ts +6 -2
- package/dist/components/TimeOff/index.js +21 -17
- package/dist/components/TimeOff/index.js.map +1 -1
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js +25 -24
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js.map +1 -1
- package/dist/components/index.d.ts +1 -6
- package/dist/contexts/GustoProvider/GustoProvider.d.ts +0 -7
- package/dist/contexts/GustoProvider/GustoProvider.js +10 -11
- package/dist/contexts/GustoProvider/GustoProvider.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/GustoProvider/index.d.ts +1 -1
- package/dist/contexts/index.d.ts +0 -1
- package/dist/i18n/I18n.js +0 -1
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +56 -40
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
- package/dist/index.d.ts +18 -16
- package/dist/index.js +229 -163
- package/dist/index.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js +15 -12
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +19 -16
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js +16 -13
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SelectHookField.js +15 -12
- package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js +21 -18
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js +12 -9
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js.map +1 -1
- package/dist/shared/constants.d.ts +5 -3
- package/dist/shared/constants.js +0 -1
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +9 -32
- package/docs/reference/endpoint-inventory.json +291 -1070
- package/package.json +16 -14
- package/dist/components/Company/index.js +0 -37
- package/dist/components/Company/index.js.map +0 -1
- package/dist/components/Contractor/index.js +0 -29
- package/dist/components/Contractor/index.js.map +0 -1
- package/dist/components/Employee/Compensation/management/CompensationEditJobForm/index.d.ts +0 -3
- package/dist/components/Employee/Deductions/shared/index.d.ts +0 -8
- package/dist/components/Employee/Documents/shared/index.d.ts +0 -3
- package/dist/components/Employee/FederalTaxes/onboarding/index.d.ts +0 -2
- package/dist/components/Employee/HomeAddress/shared/index.d.ts +0 -3
- package/dist/components/Employee/Paystubs/shared/index.d.ts +0 -3
- package/dist/components/Employee/Taxes/Actions.d.ts +0 -1
- package/dist/components/Employee/Taxes/Actions.js +0 -13
- package/dist/components/Employee/Taxes/Actions.js.map +0 -1
- package/dist/components/Employee/Taxes/FederalForm.d.ts +0 -12
- package/dist/components/Employee/Taxes/FederalForm.js +0 -109
- package/dist/components/Employee/Taxes/FederalForm.js.map +0 -1
- package/dist/components/Employee/Taxes/FederalHead.d.ts +0 -1
- package/dist/components/Employee/Taxes/FederalHead.js +0 -25
- package/dist/components/Employee/Taxes/FederalHead.js.map +0 -1
- package/dist/components/Employee/Taxes/StateForm.d.ts +0 -6
- package/dist/components/Employee/Taxes/StateForm.js +0 -35
- package/dist/components/Employee/Taxes/StateForm.js.map +0 -1
- package/dist/components/Employee/Taxes/Taxes.d.ts +0 -13
- package/dist/components/Employee/Taxes/Taxes.js +0 -133
- package/dist/components/Employee/Taxes/Taxes.js.map +0 -1
- package/dist/components/Employee/Taxes/index.d.ts +0 -2
- package/dist/components/Employee/Taxes/useTaxes.d.ts +0 -8
- package/dist/components/Employee/Taxes/useTaxes.js +0 -21
- package/dist/components/Employee/Taxes/useTaxes.js.map +0 -1
- package/dist/components/Employee/Terminations/TerminationFlow/index.d.ts +0 -3
- package/dist/components/Employee/Terminations/TerminationsData.d.ts +0 -6
- package/dist/components/Employee/Terminations/index.d.ts +0 -8
- package/dist/components/Employee/WorkAddress/shared/index.d.ts +0 -3
- package/dist/components/Employee/index.js +0 -49
- package/dist/components/Employee/index.js.map +0 -1
- package/dist/contexts/GustoApiProvider/index.d.ts +0 -3
- package/dist/i18n/en/Employee.Taxes.json.js +0 -58
- package/dist/i18n/en/Employee.Taxes.json.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompensationFlowComponents.js","sources":["../../../../../src/components/Employee/Compensation/onboarding/CompensationFlowComponents.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Job } from '@gusto/embedded-api-v-2025-11-15/models/components/job'\nimport type { Compensation } from '@gusto/embedded-api-v-2025-11-15/models/components/compensation'\nimport type { CompensationDefaultValues } from './Compensation'\nimport { JobsList } from './JobsList'\nimport { EditCompensation } from './EditCompensation'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport { useI18n } from '@/i18n'\nimport { componentEvents, FlsaStatus, type EventType } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\nexport type EventPayloads = {\n [componentEvents.EMPLOYEE_JOB_ADD]: undefined\n [componentEvents.EMPLOYEE_JOB_EDIT]: { uuid: string }\n [componentEvents.EMPLOYEE_JOB_CREATED]: Job\n [componentEvents.EMPLOYEE_JOB_UPDATED]: Job\n [componentEvents.EMPLOYEE_JOB_DELETED]: undefined\n [componentEvents.EMPLOYEE_COMPENSATION_UPDATED]: Compensation\n [componentEvents.EMPLOYEE_COMPENSATION_RETURN_TO_LIST]: undefined\n [componentEvents.EMPLOYEE_COMPENSATION_CANCEL]: undefined\n [componentEvents.EMPLOYEE_COMPENSATION_DONE]: undefined\n}\n\nexport interface CompensationFlowContextInterface extends FlowContextInterface {\n employeeId: string\n startDate: string\n currentJobId?: string | null\n partnerDefaultValues?: CompensationDefaultValues\n}\n\nexport function JobsListContextual() {\n const { employeeId, onEvent } = useFlow<CompensationFlowContextInterface>()\n return <JobsList employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\nexport function InitialEditCompensationContextual() {\n const { employeeId, startDate, currentJobId, partnerDefaultValues, onEvent } =\n useFlow<CompensationFlowContextInterface>()\n useI18n('Employee.Compensation')\n const { t } = useTranslation('Employee.Compensation')\n\n const handleEvent: OnEventType<EventType, unknown> = (event, data) => {\n onEvent(event, data)\n if (event === componentEvents.EMPLOYEE_COMPENSATION_UPDATED) {\n const compensation = data as Compensation\n if (compensation.flsaStatus !== FlsaStatus.NONEXEMPT) {\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_DONE)\n } else {\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_RETURN_TO_LIST)\n }\n }\n }\n\n return (\n <EditCompensation\n employeeId={ensureRequired(employeeId)}\n startDate={ensureRequired(startDate)}\n currentJobId={currentJobId}\n title={t('title')}\n submitCtaLabel={t('submitCta')}\n partnerDefaultValues={partnerDefaultValues}\n onEvent={handleEvent}\n />\n )\n}\n\nexport function EditCompensationContextual() {\n const { employeeId, startDate, currentJobId, partnerDefaultValues, onEvent } =\n useFlow<CompensationFlowContextInterface>()\n useI18n('Employee.Compensation')\n const { t } = useTranslation('Employee.Compensation')\n\n const handleEvent: OnEventType<EventType, unknown> = (event, data) => {\n onEvent(event, data)\n if (event === componentEvents.EMPLOYEE_COMPENSATION_UPDATED) {\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_RETURN_TO_LIST)\n }\n }\n\n return (\n <EditCompensation\n employeeId={ensureRequired(employeeId)}\n startDate={ensureRequired(startDate)}\n currentJobId={currentJobId}\n title={currentJobId ? t('editTitle') : t('addTitle')}\n submitCtaLabel={t('saveNewJobCta')}\n onCancel={() => {\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_CANCEL)\n }}\n partnerDefaultValues={partnerDefaultValues}\n onEvent={handleEvent}\n />\n )\n}\n"],"names":["JobsListContextual","employeeId","onEvent","useFlow","JobsList","ensureRequired","InitialEditCompensationContextual","startDate","currentJobId","partnerDefaultValues","useI18n","t","useTranslation","handleEvent","event","data","componentEvents","FlsaStatus","jsx","EditCompensation","EditCompensationContextual"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"CompensationFlowComponents.js","sources":["../../../../../src/components/Employee/Compensation/onboarding/CompensationFlowComponents.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Job } from '@gusto/embedded-api-v-2025-11-15/models/components/job'\nimport type { Compensation } from '@gusto/embedded-api-v-2025-11-15/models/components/compensation'\nimport type { CompensationDefaultValues } from './Compensation'\nimport { JobsList } from './JobsList'\nimport { EditCompensation } from './EditCompensation'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport { useI18n } from '@/i18n'\nimport { componentEvents, FlsaStatus, type EventType } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\n/** @internal */\nexport type EventPayloads = {\n [componentEvents.EMPLOYEE_JOB_ADD]: undefined\n [componentEvents.EMPLOYEE_JOB_EDIT]: { uuid: string }\n [componentEvents.EMPLOYEE_JOB_CREATED]: Job\n [componentEvents.EMPLOYEE_JOB_UPDATED]: Job\n [componentEvents.EMPLOYEE_JOB_DELETED]: undefined\n [componentEvents.EMPLOYEE_COMPENSATION_UPDATED]: Compensation\n [componentEvents.EMPLOYEE_COMPENSATION_RETURN_TO_LIST]: undefined\n [componentEvents.EMPLOYEE_COMPENSATION_CANCEL]: undefined\n [componentEvents.EMPLOYEE_COMPENSATION_DONE]: undefined\n}\n\n/** @internal */\nexport interface CompensationFlowContextInterface extends FlowContextInterface {\n employeeId: string\n startDate: string\n currentJobId?: string | null\n partnerDefaultValues?: CompensationDefaultValues\n}\n\n/** @internal */\nexport function JobsListContextual() {\n const { employeeId, onEvent } = useFlow<CompensationFlowContextInterface>()\n return <JobsList employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\n/** @internal */\nexport function InitialEditCompensationContextual() {\n const { employeeId, startDate, currentJobId, partnerDefaultValues, onEvent } =\n useFlow<CompensationFlowContextInterface>()\n useI18n('Employee.Compensation')\n const { t } = useTranslation('Employee.Compensation')\n\n const handleEvent: OnEventType<EventType, unknown> = (event, data) => {\n onEvent(event, data)\n if (event === componentEvents.EMPLOYEE_COMPENSATION_UPDATED) {\n const compensation = data as Compensation\n if (compensation.flsaStatus !== FlsaStatus.NONEXEMPT) {\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_DONE)\n } else {\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_RETURN_TO_LIST)\n }\n }\n }\n\n return (\n <EditCompensation\n employeeId={ensureRequired(employeeId)}\n startDate={ensureRequired(startDate)}\n currentJobId={currentJobId}\n title={t('title')}\n submitCtaLabel={t('submitCta')}\n partnerDefaultValues={partnerDefaultValues}\n onEvent={handleEvent}\n />\n )\n}\n\n/** @internal */\nexport function EditCompensationContextual() {\n const { employeeId, startDate, currentJobId, partnerDefaultValues, onEvent } =\n useFlow<CompensationFlowContextInterface>()\n useI18n('Employee.Compensation')\n const { t } = useTranslation('Employee.Compensation')\n\n const handleEvent: OnEventType<EventType, unknown> = (event, data) => {\n onEvent(event, data)\n if (event === componentEvents.EMPLOYEE_COMPENSATION_UPDATED) {\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_RETURN_TO_LIST)\n }\n }\n\n return (\n <EditCompensation\n employeeId={ensureRequired(employeeId)}\n startDate={ensureRequired(startDate)}\n currentJobId={currentJobId}\n title={currentJobId ? t('editTitle') : t('addTitle')}\n submitCtaLabel={t('saveNewJobCta')}\n onCancel={() => {\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_CANCEL)\n }}\n partnerDefaultValues={partnerDefaultValues}\n onEvent={handleEvent}\n />\n )\n}\n"],"names":["JobsListContextual","employeeId","onEvent","useFlow","JobsList","ensureRequired","InitialEditCompensationContextual","startDate","currentJobId","partnerDefaultValues","useI18n","t","useTranslation","handleEvent","event","data","componentEvents","FlsaStatus","jsx","EditCompensation","EditCompensationContextual"],"mappings":";;;;;;;;AAkCO,SAASA,IAAqB;AACnC,QAAM,EAAE,YAAAC,GAAY,SAAAC,EAAA,IAAYC,EAAA;AAChC,2BAAQC,GAAA,EAAS,YAAYC,EAAeJ,CAAU,GAAG,SAAAC,GAAkB;AAC7E;AAGO,SAASI,IAAoC;AAClD,QAAM,EAAE,YAAAL,GAAY,WAAAM,GAAW,cAAAC,GAAc,sBAAAC,GAAsB,SAAAP,EAAA,IACjEC,EAAA;AACF,EAAAO,EAAQ,uBA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EditCompensation.d.ts
CHANGED
|
@@ -2,25 +2,48 @@ import { CompensationDefaultValues } from '../Compensation';
|
|
|
2
2
|
import { CommonComponentInterface } from '../../../../Base';
|
|
3
3
|
import { OnEventType } from '../../../../Base/useBase';
|
|
4
4
|
import { EventType } from '../../../../../shared/constants';
|
|
5
|
+
/**
|
|
6
|
+
* Props for {@link EditCompensation}.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
5
10
|
export interface EditCompensationProps extends CommonComponentInterface<'Employee.Compensation'> {
|
|
11
|
+
/** The associated employee identifier. */
|
|
6
12
|
employeeId: string;
|
|
7
13
|
/**
|
|
8
|
-
* When provided, the hire date is pre-filled from this value and the hire
|
|
9
|
-
* date field is
|
|
10
|
-
* date field is rendered so the user can set it explicitly.
|
|
14
|
+
* When provided, the hire date is pre-filled from this value and the hire date field is hidden.
|
|
15
|
+
* When absent, the hire date field is rendered so it can be set explicitly.
|
|
11
16
|
*/
|
|
12
17
|
startDate?: string;
|
|
18
|
+
/** Existing job to edit. When omitted, a new job is created on submit. */
|
|
13
19
|
currentJobId?: string | null;
|
|
20
|
+
/** Heading text shown above the form. */
|
|
14
21
|
title: string;
|
|
22
|
+
/** Label for the primary submit button. */
|
|
15
23
|
submitCtaLabel: string;
|
|
24
|
+
/** Optional handler invoked when the secondary cancel button is clicked. */
|
|
16
25
|
onCancel?: () => void;
|
|
26
|
+
/** Initial values for the job title and compensation fields. */
|
|
17
27
|
partnerDefaultValues?: CompensationDefaultValues;
|
|
18
|
-
/**
|
|
19
|
-
* Receives the broadcast events: `EMPLOYEE_JOB_CREATED` / `EMPLOYEE_JOB_UPDATED`
|
|
20
|
-
* (with the saved `Job`), then `EMPLOYEE_COMPENSATION_UPDATED` (with the saved
|
|
21
|
-
* `Compensation`) on a successful submit chain. Use `EMPLOYEE_COMPENSATION_UPDATED`
|
|
22
|
-
* for "save complete" branching.
|
|
23
|
-
*/
|
|
28
|
+
/** Event handler fired on flow state changes. See the events table on {@link EditCompensation}. */
|
|
24
29
|
onEvent: OnEventType<EventType, unknown>;
|
|
25
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Renders a form for creating or editing one of an employee's jobs together with its compensation.
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* The submit chain saves the job first, then the compensation. The `employee/job_created` or
|
|
36
|
+
* `employee/job_updated` event fires once the job is saved; `employee/compensation_updated`
|
|
37
|
+
* fires once the compensation is saved and signals the full save is complete.
|
|
38
|
+
*
|
|
39
|
+
* | Event | Description | Data |
|
|
40
|
+
* | ----- | ----------- | ---- |
|
|
41
|
+
* | `employee/job_created` | Fired when a new job is saved. | The saved {@link https://docs.gusto.com/embedded-payroll/reference/get-v1-jobs-job_id | Job}. |
|
|
42
|
+
* | `employee/job_updated` | Fired when an existing job is saved. | The saved {@link https://docs.gusto.com/embedded-payroll/reference/get-v1-jobs-job_id | Job}. |
|
|
43
|
+
* | `employee/compensation_updated` | Fired when the compensation is saved. Treat as the "save complete" signal. | The saved {@link https://docs.gusto.com/embedded-payroll/reference/get-v1-compensations-compensation_id | Compensation}. |
|
|
44
|
+
*
|
|
45
|
+
* @param props - See {@link EditCompensationProps}.
|
|
46
|
+
* @returns The rendered edit-compensation form.
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
26
49
|
export declare function EditCompensation({ dictionary, ...props }: EditCompensationProps): import("react").JSX.Element;
|
package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditCompensation.js","sources":["../../../../../../src/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.tsx"],"sourcesContent":["import { useState } from 'react'\nimport classNames from 'classnames'\nimport type { CompensationDefaultValues } from '../Compensation'\nimport { useJobForm } from '../../shared/useJobForm'\nimport { useCompensationForm } from '../../shared/useCompensationForm'\nimport { AddCompensationFormBody } from '../../shared/AddCompensationFormBody'\nimport styles from './EditCompensation.module.scss'\nimport { BaseBoundaries, BaseLayout, type CommonComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport { composeSubmitHandler } from '@/partner-hook-utils/form/composeSubmitHandler'\nimport { componentEvents, type EventType } from '@/shared/constants'\n\nexport interface EditCompensationProps extends CommonComponentInterface<'Employee.Compensation'> {\n employeeId: string\n /**\n * When provided, the hire date is pre-filled from this value and the hire\n * date field is hidden. When absent (add-job from empty state), the hire\n * date field is rendered so the user can set it explicitly.\n */\n startDate?: string\n currentJobId?: string | null\n title: string\n submitCtaLabel: string\n onCancel?: () => void\n partnerDefaultValues?: CompensationDefaultValues\n /**\n * Receives the broadcast events: `EMPLOYEE_JOB_CREATED` / `EMPLOYEE_JOB_UPDATED`\n * (with the saved `Job`), then `EMPLOYEE_COMPENSATION_UPDATED` (with the saved\n * `Compensation`) on a successful submit chain. Use `EMPLOYEE_COMPENSATION_UPDATED`\n * for \"save complete\" branching.\n */\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport function EditCompensation({ dictionary, ...props }: EditCompensationProps) {\n useComponentDictionary('Employee.Compensation', dictionary)\n return (\n <BaseBoundaries componentName=\"Employee.Compensation\">\n <Root {...props} />\n </BaseBoundaries>\n )\n}\n\nfunction Root({\n employeeId,\n startDate,\n currentJobId,\n title,\n submitCtaLabel,\n onCancel,\n partnerDefaultValues,\n className,\n onEvent,\n}: EditCompensationProps) {\n useI18n('Employee.Compensation')\n\n // When startDate is provided (onboarding), hide the hire date field and derive\n // it from the prop at submit time. When absent (add-job from dashboard empty\n // state), render the field so the user can set it explicitly.\n const withHireDateField = !startDate\n\n // Track jobId locally so a partial-failure submit chain (job POST succeeds,\n // comp PUT fails) doesn't re-POST and create a duplicate job on retry. We\n // initialize from the prop and only write back when the partner-supplied\n // `currentJobId` was nullish (i.e. add-job flow) — see the submit handler.\n const [resolvedJobId, setResolvedJobId] = useState<string | undefined>(currentJobId ?? undefined)\n\n const jobForm = useJobForm({\n employeeId,\n jobId: resolvedJobId,\n withHireDateField,\n defaultValues: {\n title: partnerDefaultValues?.title ?? '',\n },\n // The Compensation flow always shows a job title field, even when editing\n // an existing job. The hook's schema only requires `title` on create; we\n // require it on update too to preserve the existing UX.\n optionalFieldsToRequire: { update: ['title'] },\n shouldFocusError: false,\n })\n\n // Resolve the compensationId from the job we just loaded so the comp form can\n // seed from the existing comp on edit. While the job form is still loading we\n // pass undefined (compensation form starts in create mode); once the job\n // resolves the prop change re-renders the comp form into update mode with the\n // existing compensation as the seed.\n const resolvedCompensationId = jobForm.isLoading\n ? undefined\n : (jobForm.data.currentJob?.currentCompensationUuid ?? undefined)\n\n const compensationForm = useCompensationForm({\n employeeId,\n jobId: resolvedJobId,\n compensationId: resolvedCompensationId,\n // No effective-date field is surfaced, and no `effectiveDate` is\n // threaded into `actions.onSubmit` either: the server initializes\n // `effective_date` on the auto-stub created by the parent job POST,\n // and subsequent updates omit it from the PUT body so the existing\n // value is preserved (e.g. a deliberately-set future-dated comp\n // wouldn't be silently overwritten on an unrelated edit).\n withEffectiveDateField: false,\n // The Compensation flow always presents flsaStatus, rate, and paymentUnit\n // as required, even when editing an existing compensation. The hook's\n // schema marks them `'create'`-only by default; we promote them on update\n // here to preserve the existing UX (no \"(optional)\" labels).\n optionalFieldsToRequire: { update: ['flsaStatus', 'rate', 'paymentUnit'] },\n defaultValues: {\n flsaStatus: partnerDefaultValues?.flsaStatus,\n rate:\n typeof partnerDefaultValues?.rate === 'number'\n ? partnerDefaultValues.rate\n : partnerDefaultValues?.rate\n ? Number(partnerDefaultValues.rate)\n : undefined,\n paymentUnit: partnerDefaultValues?.paymentUnit,\n },\n shouldFocusError: false,\n })\n\n if (jobForm.isLoading || compensationForm.isLoading) {\n const loadingErrorHandling = composeErrorHandler([jobForm, compensationForm])\n return <BaseLayout isLoading error={loadingErrorHandling.errors} />\n }\n\n const submitResult = composeSubmitHandler([jobForm, compensationForm], async () => {\n const jobResult = await jobForm.actions.onSubmit({\n employeeId,\n hireDate: startDate ?? undefined,\n })\n if (!jobResult) return\n\n onEvent(\n jobResult.mode === 'create'\n ? componentEvents.EMPLOYEE_JOB_CREATED\n : componentEvents.EMPLOYEE_JOB_UPDATED,\n jobResult.data,\n )\n\n // Always thread through the freshly returned job's currentCompensationUuid +\n // its version so we PUT against the latest comp regardless of whether the job\n // POST just auto-created the stub or the job PUT bumped a version.\n const stubCompensation = jobResult.data.compensations?.find(\n c => c.uuid === jobResult.data.currentCompensationUuid,\n )\n\n const compensationResult = await compensationForm.actions.onSubmit({\n jobId: jobResult.data.uuid,\n compensationId: jobResult.data.currentCompensationUuid ?? undefined,\n compensationVersion: stubCompensation?.version ?? undefined,\n })\n if (!compensationResult) {\n if (!currentJobId) setResolvedJobId(jobResult.data.uuid)\n return\n }\n\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_UPDATED, compensationResult.data)\n })\n\n const errorHandling = composeErrorHandler([submitResult])\n\n const isPending = jobForm.status.isPending || compensationForm.status.isPending\n\n return (\n <section className={classNames(styles.container, className)}>\n <BaseLayout error={errorHandling.errors}>\n <Form onSubmit={submitResult.handleSubmit}>\n <AddCompensationFormBody\n jobForm={jobForm}\n compensationForm={compensationForm}\n title={title}\n submitCtaLabel={submitCtaLabel}\n isPending={isPending}\n onCancel={onCancel}\n />\n </Form>\n </BaseLayout>\n </section>\n )\n}\n"],"names":["EditCompensation","dictionary","props","useComponentDictionary","jsx","BaseBoundaries","Root","employeeId","startDate","currentJobId","title","submitCtaLabel","onCancel","partnerDefaultValues","className","onEvent","useI18n","withHireDateField","resolvedJobId","setResolvedJobId","useState","jobForm","useJobForm","resolvedCompensationId","compensationForm","useCompensationForm","loadingErrorHandling","composeErrorHandler","BaseLayout","submitResult","composeSubmitHandler","jobResult","componentEvents","stubCompensation","c","compensationResult","errorHandling","isPending","classNames","styles","Form","AddCompensationFormBody"],"m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;AAAA,MACC,SAAApB;AAAA,MACA,kBAAAG;AAAA,MACA,OAAAd;AAAA,MACA,gBAAAC;AAAA,MACA,WAAA0B;AAAA,MACA,UAAAzB;AAAA,IAAA;AAAA,EAAA,EACF,CACF,GACF,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"EditCompensation.js","sources":["../../../../../../src/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.tsx"],"sourcesContent":["import { useState } from 'react'\nimport classNames from 'classnames'\nimport type { CompensationDefaultValues } from '../Compensation'\nimport { useJobForm } from '../../shared/useJobForm'\nimport { useCompensationForm } from '../../shared/useCompensationForm'\nimport { AddCompensationFormBody } from '../../shared/AddCompensationFormBody'\nimport styles from './EditCompensation.module.scss'\nimport { BaseBoundaries, BaseLayout, type CommonComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport { composeSubmitHandler } from '@/partner-hook-utils/form/composeSubmitHandler'\nimport { componentEvents, type EventType } from '@/shared/constants'\n\n/**\n * Props for {@link EditCompensation}.\n *\n * @public\n */\nexport interface EditCompensationProps extends CommonComponentInterface<'Employee.Compensation'> {\n /** The associated employee identifier. */\n employeeId: string\n /**\n * When provided, the hire date is pre-filled from this value and the hire date field is hidden.\n * When absent, the hire date field is rendered so it can be set explicitly.\n */\n startDate?: string\n /** Existing job to edit. When omitted, a new job is created on submit. */\n currentJobId?: string | null\n /** Heading text shown above the form. */\n title: string\n /** Label for the primary submit button. */\n submitCtaLabel: string\n /** Optional handler invoked when the secondary cancel button is clicked. */\n onCancel?: () => void\n /** Initial values for the job title and compensation fields. */\n partnerDefaultValues?: CompensationDefaultValues\n /** Event handler fired on flow state changes. See the events table on {@link EditCompensation}. */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Renders a form for creating or editing one of an employee's jobs together with its compensation.\n *\n * @remarks\n * The submit chain saves the job first, then the compensation. The `employee/job_created` or\n * `employee/job_updated` event fires once the job is saved; `employee/compensation_updated`\n * fires once the compensation is saved and signals the full save is complete.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/job_created` | Fired when a new job is saved. | The saved {@link https://docs.gusto.com/embedded-payroll/reference/get-v1-jobs-job_id | Job}. |\n * | `employee/job_updated` | Fired when an existing job is saved. | The saved {@link https://docs.gusto.com/embedded-payroll/reference/get-v1-jobs-job_id | Job}. |\n * | `employee/compensation_updated` | Fired when the compensation is saved. Treat as the \"save complete\" signal. | The saved {@link https://docs.gusto.com/embedded-payroll/reference/get-v1-compensations-compensation_id | Compensation}. |\n *\n * @param props - See {@link EditCompensationProps}.\n * @returns The rendered edit-compensation form.\n * @public\n */\nexport function EditCompensation({ dictionary, ...props }: EditCompensationProps) {\n useComponentDictionary('Employee.Compensation', dictionary)\n return (\n <BaseBoundaries componentName=\"Employee.Compensation\">\n <Root {...props} />\n </BaseBoundaries>\n )\n}\n\nfunction Root({\n employeeId,\n startDate,\n currentJobId,\n title,\n submitCtaLabel,\n onCancel,\n partnerDefaultValues,\n className,\n onEvent,\n}: EditCompensationProps) {\n useI18n('Employee.Compensation')\n\n // When startDate is provided (onboarding), hide the hire date field and derive\n // it from the prop at submit time. When absent (add-job from dashboard empty\n // state), render the field so the user can set it explicitly.\n const withHireDateField = !startDate\n\n // Track jobId locally so a partial-failure submit chain (job POST succeeds,\n // comp PUT fails) doesn't re-POST and create a duplicate job on retry. We\n // initialize from the prop and only write back when the partner-supplied\n // `currentJobId` was nullish (i.e. add-job flow) — see the submit handler.\n const [resolvedJobId, setResolvedJobId] = useState<string | undefined>(currentJobId ?? undefined)\n\n const jobForm = useJobForm({\n employeeId,\n jobId: resolvedJobId,\n withHireDateField,\n defaultValues: {\n title: partnerDefaultValues?.title ?? '',\n },\n // The Compensation flow always shows a job title field, even when editing\n // an existing job. The hook's schema only requires `title` on create; we\n // require it on update too to preserve the existing UX.\n optionalFieldsToRequire: { update: ['title'] },\n shouldFocusError: false,\n })\n\n // Resolve the compensationId from the job we just loaded so the comp form can\n // seed from the existing comp on edit. While the job form is still loading we\n // pass undefined (compensation form starts in create mode); once the job\n // resolves the prop change re-renders the comp form into update mode with the\n // existing compensation as the seed.\n const resolvedCompensationId = jobForm.isLoading\n ? undefined\n : (jobForm.data.currentJob?.currentCompensationUuid ?? undefined)\n\n const compensationForm = useCompensationForm({\n employeeId,\n jobId: resolvedJobId,\n compensationId: resolvedCompensationId,\n // No effective-date field is surfaced, and no `effectiveDate` is\n // threaded into `actions.onSubmit` either: the server initializes\n // `effective_date` on the auto-stub created by the parent job POST,\n // and subsequent updates omit it from the PUT body so the existing\n // value is preserved (e.g. a deliberately-set future-dated comp\n // wouldn't be silently overwritten on an unrelated edit).\n withEffectiveDateField: false,\n // The Compensation flow always presents flsaStatus, rate, and paymentUnit\n // as required, even when editing an existing compensation. The hook's\n // schema marks them `'create'`-only by default; we promote them on update\n // here to preserve the existing UX (no \"(optional)\" labels).\n optionalFieldsToRequire: { update: ['flsaStatus', 'rate', 'paymentUnit'] },\n defaultValues: {\n flsaStatus: partnerDefaultValues?.flsaStatus,\n rate:\n typeof partnerDefaultValues?.rate === 'number'\n ? partnerDefaultValues.rate\n : partnerDefaultValues?.rate\n ? Number(partnerDefaultValues.rate)\n : undefined,\n paymentUnit: partnerDefaultValues?.paymentUnit,\n },\n shouldFocusError: false,\n })\n\n if (jobForm.isLoading || compensationForm.isLoading) {\n const loadingErrorHandling = composeErrorHandler([jobForm, compensationForm])\n return <BaseLayout isLoading error={loadingErrorHandling.errors} />\n }\n\n const submitResult = composeSubmitHandler([jobForm, compensationForm], async () => {\n const jobResult = await jobForm.actions.onSubmit({\n employeeId,\n hireDate: startDate ?? undefined,\n })\n if (!jobResult) return\n\n onEvent(\n jobResult.mode === 'create'\n ? componentEvents.EMPLOYEE_JOB_CREATED\n : componentEvents.EMPLOYEE_JOB_UPDATED,\n jobResult.data,\n )\n\n // Always thread through the freshly returned job's currentCompensationUuid +\n // its version so we PUT against the latest comp regardless of whether the job\n // POST just auto-created the stub or the job PUT bumped a version.\n const stubCompensation = jobResult.data.compensations?.find(\n c => c.uuid === jobResult.data.currentCompensationUuid,\n )\n\n const compensationResult = await compensationForm.actions.onSubmit({\n jobId: jobResult.data.uuid,\n compensationId: jobResult.data.currentCompensationUuid ?? undefined,\n compensationVersion: stubCompensation?.version ?? undefined,\n })\n if (!compensationResult) {\n if (!currentJobId) setResolvedJobId(jobResult.data.uuid)\n return\n }\n\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_UPDATED, compensationResult.data)\n })\n\n const errorHandling = composeErrorHandler([submitResult])\n\n const isPending = jobForm.status.isPending || compensationForm.status.isPending\n\n return (\n <section className={classNames(styles.container, className)}>\n <BaseLayout error={errorHandling.errors}>\n <Form onSubmit={submitResult.handleSubmit}>\n <AddCompensationFormBody\n jobForm={jobForm}\n compensationForm={compensationForm}\n title={title}\n submitCtaLabel={submitCtaLabel}\n isPending={isPending}\n onCancel={onCancel}\n />\n </Form>\n </BaseLayout>\n </section>\n )\n}\n"],"names":["EditCompensation","dictionary","props","useComponentDictionary","jsx","BaseBoundaries","Root","employeeId","startDate","currentJobId","title","submitCtaLabel","onCancel","partnerDefaultValues","className","onEvent","useI18n","withHireDateField","resolvedJobId","setResolvedJobId","useState","jobForm","useJobForm","resolvedCompensationId","compensationForm","useCompensationForm","loadingErrorHandling","composeErrorHandler","BaseLayout","submitResult","composeSubmitHandler","jobResult","componentEvents","stubCompensation","c","compensationResult","errorHandling","isPending","classNames","styles","Form","AddCompensationFormBody"],"mappings":";;;;;;;;;;;;;;AA4DO,SAASA,EAAiB,EAAE,YAAAC,GAAY,GAAGC,KAAgC;AAChF,SAAAC,EAAuB,yBAAyBF,CAAU,GAExD,gBAAAG,EAACC,KAAe,eAAc,yBAC5B,4BAACC,GAAA,EAAM,GAAGJ,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASI,E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terface, CommonComponentInterface } from '../../../../Base';
|
|
2
|
+
/** @public */
|
|
2
3
|
export interface JobsListProps extends CommonComponentInterface<'Employee.Compensation'> {
|
|
4
|
+
/** The associated employee identifier. */
|
|
3
5
|
employeeId: string;
|
|
4
6
|
}
|
|
7
|
+
/** @public */
|
|
5
8
|
export declare function JobsList(props: JobsListProps & BaseComponentInterface): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JobsList.js","sources":["../../../../../../src/components/Employee/Compensation/onboarding/JobsList/JobsList.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useJobsAndCompensationsGetJobsSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/jobsAndCompensationsGetJobs'\nimport { useJobsAndCompensationsDeleteMutation } from '@gusto/embedded-api-v-2025-11-15/react-query/jobsAndCompensationsDelete'\nimport { derivePrimaryFlsaStatus } from '../../shared/derivePrimaryFlsaStatus'\nimport { JobsListPresentation } from './JobsListPresentation'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n useBase,\n} from '@/components/Base'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\nexport interface JobsListProps extends CommonComponentInterface<'Employee.Compensation'> {\n employeeId: string\n}\n\nexport function JobsList(props: JobsListProps & BaseComponentInterface) {\n useComponentDictionary('Employee.Compensation', props.dictionary)\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, className }: JobsListProps) {\n useI18n('Employee.Compensation')\n const { onEvent } = useBase()\n\n const { data: jobsData } = useJobsAndCompensationsGetJobsSuspense({ employeeId })\n const employeeJobs = useMemo(() => jobsData.jobs ?? [], [jobsData.jobs])\n\n const { mutateAsync: deleteEmployeeJob, isPending: isDeleting } =\n useJobsAndCompensationsDeleteMutation()\n\n const primaryFlsaStatus = useMemo(() => derivePrimaryFlsaStatus(employeeJobs), [employeeJobs])\n\n const handleAdd = () => {\n onEvent(componentEvents.EMPLOYEE_JOB_ADD)\n }\n\n const handleEdit = (jobId: string) => {\n onEvent(componentEvents.EMPLOYEE_JOB_EDIT, { uuid: jobId })\n }\n\n const handleDelete = async (jobId: string) => {\n await deleteEmployeeJob({ request: { jobId } })\n onEvent(componentEvents.EMPLOYEE_JOB_DELETED)\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_DONE)\n }\n\n return (\n <section className={className}>\n <JobsListPresentation\n jobs={employeeJobs}\n primaryFlsaStatus={primaryFlsaStatus}\n isPending={isDeleting}\n onAdd={handleAdd}\n onEdit={handleEdit}\n onDelete={(jobId: string) => {\n void handleDelete(jobId)\n }}\n onContinue={handleContinue}\n />\n </section>\n )\n}\n"],"names":["JobsList","props","useComponentDictionary","jsx","BaseComponent","Root","employeeId","className","useI18n","onEvent","useBase","jobsData","useJobsAndCompensationsGetJobsSuspense","employeeJobs","useMemo","deleteEmployeeJob","isDeleting","useJobsAndCompensationsDeleteMutation","primaryFlsaStatus","derivePrimaryFlsaStatus","handleAdd","componentEvents","handleEdit","jobId","handleDelete","JobsListPresentation"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"JobsList.js","sources":["../../../../../../src/components/Employee/Compensation/onboarding/JobsList/JobsList.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useJobsAndCompensationsGetJobsSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/jobsAndCompensationsGetJobs'\nimport { useJobsAndCompensationsDeleteMutation } from '@gusto/embedded-api-v-2025-11-15/react-query/jobsAndCompensationsDelete'\nimport { derivePrimaryFlsaStatus } from '../../shared/derivePrimaryFlsaStatus'\nimport { JobsListPresentation } from './JobsListPresentation'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n useBase,\n} from '@/components/Base'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\n/** @public */\nexport interface JobsListProps extends CommonComponentInterface<'Employee.Compensation'> {\n /** The associated employee identifier. */\n employeeId: string\n}\n\n/** @public */\nexport function JobsList(props: JobsListProps & BaseComponentInterface) {\n useComponentDictionary('Employee.Compensation', props.dictionary)\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, className }: JobsListProps) {\n useI18n('Employee.Compensation')\n const { onEvent } = useBase()\n\n const { data: jobsData } = useJobsAndCompensationsGetJobsSuspense({ employeeId })\n const employeeJobs = useMemo(() => jobsData.jobs ?? [], [jobsData.jobs])\n\n const { mutateAsync: deleteEmployeeJob, isPending: isDeleting } =\n useJobsAndCompensationsDeleteMutation()\n\n const primaryFlsaStatus = useMemo(() => derivePrimaryFlsaStatus(employeeJobs), [employeeJobs])\n\n const handleAdd = () => {\n onEvent(componentEvents.EMPLOYEE_JOB_ADD)\n }\n\n const handleEdit = (jobId: string) => {\n onEvent(componentEvents.EMPLOYEE_JOB_EDIT, { uuid: jobId })\n }\n\n const handleDelete = async (jobId: string) => {\n await deleteEmployeeJob({ request: { jobId } })\n onEvent(componentEvents.EMPLOYEE_JOB_DELETED)\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_DONE)\n }\n\n return (\n <section className={className}>\n <JobsListPresentation\n jobs={employeeJobs}\n primaryFlsaStatus={primaryFlsaStatus}\n isPending={isDeleting}\n onAdd={handleAdd}\n onEdit={handleEdit}\n onDelete={(jobId: string) => {\n void handleDelete(jobId)\n }}\n onContinue={handleContinue}\n />\n </section>\n )\n}\n"],"names":["JobsList","props","useComponentDictionary","jsx","BaseComponent","Root","employeeId","className","useI18n","onEvent","useBase","jobsData","useJobsAndCompensationsGetJobsSuspense","employeeJobs","useMemo","deleteEmployeeJob","isDeleting","useJobsAndCompensationsDeleteMutation","primaryFlsaStatus","derivePrimaryFlsaStatus","handleAdd","componentEvents","handleEdit","jobId","handleDelete","JobsListPresentation"],"mappings":";;;;;;;;;;AAqBO,SAAS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|
import { Job } from '@gusto/embedded-api-v-2025-11-15/models/components/job';
|
|
2
|
+
/** @internal */
|
|
2
3
|
export interface JobsListPresentationProps {
|
|
4
|
+
/** @internal */
|
|
3
5
|
jobs: Job[];
|
|
6
|
+
/** @internal */
|
|
4
7
|
primaryFlsaStatus: string | undefined;
|
|
8
|
+
/** @internal */
|
|
5
9
|
isPending: boolean;
|
|
10
|
+
/** @internal */
|
|
6
11
|
onAdd: () => void;
|
|
12
|
+
/** @internal */
|
|
7
13
|
onEdit: (jobId: string) => void;
|
|
14
|
+
/** @internal */
|
|
8
15
|
onDelete: (jobId: string) => void;
|
|
16
|
+
/** @internal */
|
|
9
17
|
onContinue: () => void;
|
|
10
18
|
}
|
|
19
|
+
/** @internal */
|
|
11
20
|
export declare function JobsListPresentation({ jobs, primaryFlsaStatus, isPending, onAdd, onEdit, onDelete, onContinue, }: JobsListPresentationProps): import("react").JSX.Element;
|
|
@@ -4,10 +4,10 @@ import y from "../../../../../assets/icons/pencil.svg.js";
|
|
|
4
4
|
import b from "../../../../../assets/icons/trashcan.svg.js";
|
|
5
5
|
import { Flex as g } from "../../../../Common/Flex/Flex.js";
|
|
6
6
|
import { ActionsLayout as k } from "../../../../Common/ActionsLayout/ActionsLayout.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
7
|
+
import { HamburgerMenu as S } from "../../../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
8
|
+
import { useComponentContext as L } from "../../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
|
+
import { useI18n as x } from "../../../../../i18n/I18n.js";
|
|
10
|
+
import { FlsaStatus as v } from "../../../../../shared/constants.js";
|
|
11
11
|
import { useDataView as w } from "../../../../Common/DataView/useDataView.js";
|
|
12
12
|
import { DataView as A } from "../../../../Common/DataView/DataView.js";
|
|
13
13
|
function I({
|
|
@@ -19,8 +19,8 @@ function I({
|
|
|
19
19
|
onDelete: d,
|
|
20
20
|
onContinue: c
|
|
21
21
|
}) {
|
|
22
|
-
|
|
23
|
-
const { t: e } = h("Employee.Compensation"), i =
|
|
22
|
+
x("Employee.Compensation");
|
|
23
|
+
const { t: e } = h("Employee.Compensation"), i = L(), C = m === v.NONEXEMPT, f = w({
|
|
24
24
|
data: l,
|
|
25
25
|
columns: [
|
|
26
26
|
{
|
|
@@ -50,7 +50,7 @@ function I({
|
|
|
50
50
|
}
|
|
51
51
|
],
|
|
52
52
|
itemMenu: (t) => /* @__PURE__ */ o(
|
|
53
|
-
|
|
53
|
+
S,
|
|
54
54
|
{
|
|
55
55
|
triggerLabel: e("hamburgerTitle"),
|
|
56
56
|
items: [
|
package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JobsListPresentation.js","sources":["../../../../../../src/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type Job } from '@gusto/embedded-api-v-2025-11-15/models/components/job'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { ActionsLayout, DataView, Flex, useDataView } from '@/components/Common'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { FlsaStatus } from '@/shared/constants'\n\nexport interface JobsListPresentationProps {\n jobs: Job[]\n primaryFlsaStatus: string | undefined\n isPending: boolean\n onAdd: () => void\n onEdit: (jobId: string) => void\n onDelete: (jobId: string) => void\n onContinue: () => void\n}\n\nexport function JobsListPresentation({\n jobs,\n primaryFlsaStatus,\n isPending,\n onAdd,\n onEdit,\n onDelete,\n onContinue,\n}: JobsListPresentationProps) {\n useI18n('Employee.Compensation')\n const { t } = useTranslation('Employee.Compensation')\n const Components = useComponentContext()\n\n const showAddAnotherJob = primaryFlsaStatus === FlsaStatus.NONEXEMPT\n\n const dataViewProps = useDataView({\n data: jobs,\n columns: [\n {\n key: 'title',\n title: t('allCompensations.jobColumn'),\n render: (job: Job) => {\n const currentComp = job.compensations?.find(c => c.uuid === job.currentCompensationUuid)\n return currentComp?.title || ''\n },\n },\n {\n key: 'flsaStatus',\n title: t('allCompensations.typeColumn'),\n render: (job: Job) => {\n const flsaStatus = job.compensations?.find(\n comp => comp.uuid === job.currentCompensationUuid,\n )?.flsaStatus\n return flsaStatus !== undefined ? t(`flsaStatusLabels.${flsaStatus}`) : null\n },\n },\n {\n key: 'rate',\n title: t('allCompensations.amountColumn'),\n render: (job: Job) => job.rate?.toString() || '',\n },\n {\n key: 'paymentUnit',\n title: t('allCompensations.perColumn'),\n render: (job: Job) => job.paymentUnit || '',\n },\n ],\n itemMenu: (job: Job) => (\n <HamburgerMenu\n triggerLabel={t('hamburgerTitle')}\n items={[\n {\n label: t('allCompensations.editCta'),\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n onEdit(job.uuid)\n },\n },\n ...(!job.primary\n ? [\n {\n label: t('allCompensations.deleteCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n onDelete(job.uuid)\n },\n },\n ]\n : []),\n ]}\n isLoading={isPending}\n />\n ),\n })\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h2\">{t('title')}</Components.Heading>\n <DataView\n data-testid=\"data-view\"\n label={t('allCompensations.tableLabel')}\n {...dataViewProps}\n />\n <ActionsLayout>\n {showAddAnotherJob && (\n <Components.Button variant=\"secondary\" onClick={onAdd} isDisabled={isPending}>\n {t('addAnotherJobCta')}\n </Components.Button>\n )}\n <Components.Button onClick={onContinue} isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["JobsListPresentation","jobs","primaryFlsaStatus","isPending","onAdd","onEdit","onDelete","onContinue","useI18n","t","useTranslation","Components","useComponentContext","showAddAnotherJob","FlsaStatus","dataViewProps","useDataView","job","c","flsaStatus","comp","jsx","HamburgerMenu","PencilSvg","TrashCanSvg","jsxs","Flex","DataView","ActionsLayout"],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"JobsListPresentation.js","sources":["../../../../../../src/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type Job } from '@gusto/embedded-api-v-2025-11-15/models/components/job'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { ActionsLayout, DataView, Flex, useDataView } from '@/components/Common'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { FlsaStatus } from '@/shared/constants'\n\n/** @internal */\nexport interface JobsListPresentationProps {\n /** @internal */\n jobs: Job[]\n /** @internal */\n primaryFlsaStatus: string | undefined\n /** @internal */\n isPending: boolean\n /** @internal */\n onAdd: () => void\n /** @internal */\n onEdit: (jobId: string) => void\n /** @internal */\n onDelete: (jobId: string) => void\n /** @internal */\n onContinue: () => void\n}\n\n/** @internal */\nexport function JobsListPresentation({\n jobs,\n primaryFlsaStatus,\n isPending,\n onAdd,\n onEdit,\n onDelete,\n onContinue,\n}: JobsListPresentationProps) {\n useI18n('Employee.Compensation')\n const { t } = useTranslation('Employee.Compensation')\n const Components = useComponentContext()\n\n const showAddAnotherJob = primaryFlsaStatus === FlsaStatus.NONEXEMPT\n\n const dataViewProps = useDataView({\n data: jobs,\n columns: [\n {\n key: 'title',\n title: t('allCompensations.jobColumn'),\n render: (job: Job) => {\n const currentComp = job.compensations?.find(c => c.uuid === job.currentCompensationUuid)\n return currentComp?.title || ''\n },\n },\n {\n key: 'flsaStatus',\n title: t('allCompensations.typeColumn'),\n render: (job: Job) => {\n const flsaStatus = job.compensations?.find(\n comp => comp.uuid === job.currentCompensationUuid,\n )?.flsaStatus\n return flsaStatus !== undefined ? t(`flsaStatusLabels.${flsaStatus}`) : null\n },\n },\n {\n key: 'rate',\n title: t('allCompensations.amountColumn'),\n render: (job: Job) => job.rate?.toString() || '',\n },\n {\n key: 'paymentUnit',\n title: t('allCompensations.perColumn'),\n render: (job: Job) => job.paymentUnit || '',\n },\n ],\n itemMenu: (job: Job) => (\n <HamburgerMenu\n triggerLabel={t('hamburgerTitle')}\n items={[\n {\n label: t('allCompensations.editCta'),\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n onEdit(job.uuid)\n },\n },\n ...(!job.primary\n ? [\n {\n label: t('allCompensations.deleteCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n onDelete(job.uuid)\n },\n },\n ]\n : []),\n ]}\n isLoading={isPending}\n />\n ),\n })\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h2\">{t('title')}</Components.Heading>\n <DataView\n data-testid=\"data-view\"\n label={t('allCompensations.tableLabel')}\n {...dataViewProps}\n />\n <ActionsLayout>\n {showAddAnotherJob && (\n <Components.Button variant=\"secondary\" onClick={onAdd} isDisabled={isPending}>\n {t('addAnotherJobCta')}\n </Components.Button>\n )}\n <Components.Button onClick={onContinue} isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["JobsListPresentation","jobs","primaryFlsaStatus","isPending","onAdd","onEdit","onDelete","onContinue","useI18n","t","useTranslation","Components","useComponentContext","showAddAnotherJob","FlsaStatus","dataViewProps","useDataView","job","c","flsaStatus","comp","jsx","HamburgerMenu","PencilSvg","TrashCanSvg","jsxs","Flex","DataView","ActionsLayout"],"mappings":";;;;;;;;;;;;AA6BO,SAASA,EAAqB;AAAA,EACnC,MAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AACF,GAA8B;AA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IATA;AAAA,YACE;AAAA,cACE,OAAOR,EAAE,4BAA4B;AAAA,cACrC,MAAM,gBAAAY,EAACG,GAAA,EAAY,eAAW,GAAA,CAAC;AAAA,cAC/B,SAAS,MAAM;AACb,gBAAAlB,EAASW,EAAI,IAAI;AAAA,cACnB;AAAA,YAAA;AAAA,UACF;AAAA,QAED;AAAA,QAEP,WAAWd;AAAA,MAAA;AAAA,IAAA;AAAA,EACb,CAEH;AAED,SACE,gBAAAsB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAL,EAACV,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAF,EAAE,OAAO,GAAE;AAAA,IACxC,gBAAAY;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,eAAY;AAAA,QACZ,OAAOlB,EAAE,6BAA6B;AAAA,QACrC,GAAGM;AAAA,MAAA;AAAA,IAAA;AAAA,sBAELa,GAAA,EACE,UAAA;AAAA,MAAAf,KACC,gBAAAQ,EAACV,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASP,GAAO,YAAYD,GAChE,UAAAM,EAAE,kBAAkB,EAAA,CACvB;AAAA,MAEF,gBAAAY,EAACV,EAAW,QAAX,EAAkB,SAASJ,GAAY,WAAWJ,GAChD,UAAAM,EAAE,WAAW,EAAA,CAChB;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
import "./types/i18next.d.ts"
|
|
2
|
-
export { JobsList } from './JobsList';
|
|
3
|
-
export type { JobsListProps } from './JobsList';
|
|
4
|
-
export { JobsListPresentation } from './JobsListPresentation';
|
|
5
|
-
export type { JobsListPresentationProps } from './JobsListPresentation';
|
|
2
|
+
export { JobsList, type JobsListProps } from './JobsList';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compensationStateMachine.js","sources":["../../../../../src/components/Employee/Compensation/onboarding/compensationStateMachine.ts"],"sourcesContent":["import { reduce, state, state as final, transition } from 'robot3'\nimport {\n EditCompensationContextual,\n JobsListContextual,\n type CompensationFlowContextInterface,\n type EventPayloads,\n} from './CompensationFlowComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\nexport const compensationStateMachine = {\n initialEditJob: state<MachineTransition>(\n transition(componentEvents.EMPLOYEE_COMPENSATION_DONE, 'done'),\n transition(\n componentEvents.EMPLOYEE_COMPENSATION_RETURN_TO_LIST,\n 'viewJobs',\n reduce(\n (ctx: CompensationFlowContextInterface): CompensationFlowContextInterface => ({\n ...ctx,\n component: JobsListContextual,\n currentJobId: null,\n }),\n ),\n ),\n ),\n viewJobs: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_JOB_ADD,\n 'editJob',\n reduce(\n (ctx: CompensationFlowContextInterface): CompensationFlowContextInterface => ({\n ...ctx,\n component: EditCompensationContextual,\n currentJobId: null,\n }),\n ),\n ),\n transition(\n componentEvents.EMPLOYEE_JOB_EDIT,\n 'editJob',\n reduce(\n (\n ctx: CompensationFlowContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.EMPLOYEE_JOB_EDIT>,\n ): CompensationFlowContextInterface => ({\n ...ctx,\n component: EditCompensationContextual,\n currentJobId: ev.payload.uuid,\n }),\n ),\n ),\n transition(componentEvents.EMPLOYEE_COMPENSATION_DONE, 'done'),\n ),\n editJob: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_COMPENSATION_RETURN_TO_LIST,\n 'viewJobs',\n reduce(\n (ctx: CompensationFlowContextInterface): CompensationFlowContextInterface => ({\n ...ctx,\n component: JobsListContextual,\n currentJobId: null,\n }),\n ),\n ),\n transition(\n componentEvents.EMPLOYEE_COMPENSATION_CANCEL,\n 'viewJobs',\n reduce(\n (ctx: CompensationFlowContextInterface): CompensationFlowContextInterface => ({\n ...ctx,\n component: JobsListContextual,\n currentJobId: null,\n }),\n ),\n ),\n ),\n done: final(),\n}\n"],"names":["compensationStateMachine","state","transition","componentEvents","reduce","ctx","JobsListContextual","EditCompensationContextual","ev","final"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"compensationStateMachine.js","sources":["../../../../../src/components/Employee/Compensation/onboarding/compensationStateMachine.ts"],"sourcesContent":["import { reduce, state, state as final, transition } from 'robot3'\nimport {\n EditCompensationContextual,\n JobsListContextual,\n type CompensationFlowContextInterface,\n type EventPayloads,\n} from './CompensationFlowComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\n/** @internal */\nexport const compensationStateMachine = {\n initialEditJob: state<MachineTransition>(\n transition(componentEvents.EMPLOYEE_COMPENSATION_DONE, 'done'),\n transition(\n componentEvents.EMPLOYEE_COMPENSATION_RETURN_TO_LIST,\n 'viewJobs',\n reduce(\n (ctx: CompensationFlowContextInterface): CompensationFlowContextInterface => ({\n ...ctx,\n component: JobsListContextual,\n currentJobId: null,\n }),\n ),\n ),\n ),\n viewJobs: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_JOB_ADD,\n 'editJob',\n reduce(\n (ctx: CompensationFlowContextInterface): CompensationFlowContextInterface => ({\n ...ctx,\n component: EditCompensationContextual,\n currentJobId: null,\n }),\n ),\n ),\n transition(\n componentEvents.EMPLOYEE_JOB_EDIT,\n 'editJob',\n reduce(\n (\n ctx: CompensationFlowContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.EMPLOYEE_JOB_EDIT>,\n ): CompensationFlowContextInterface => ({\n ...ctx,\n component: EditCompensationContextual,\n currentJobId: ev.payload.uuid,\n }),\n ),\n ),\n transition(componentEvents.EMPLOYEE_COMPENSATION_DONE, 'done'),\n ),\n editJob: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_COMPENSATION_RETURN_TO_LIST,\n 'viewJobs',\n reduce(\n (ctx: CompensationFlowContextInterface): CompensationFlowContextInterface => ({\n ...ctx,\n component: JobsListContextual,\n currentJobId: null,\n }),\n ),\n ),\n transition(\n componentEvents.EMPLOYEE_COMPENSATION_CANCEL,\n 'viewJobs',\n reduce(\n (ctx: CompensationFlowContextInterface): CompensationFlowContextInterface => ({\n ...ctx,\n component: JobsListContextual,\n currentJobId: null,\n }),\n ),\n ),\n ),\n done: final(),\n}\n"],"names":["compensationStateMachine","state","transition","componentEvents","reduce","ctx","JobsListContextual","EditCompensationContextual","ev","final"],"mappings":";;;AAWO,MAAMA,IAA2B;AAAA,EACtC,gBAAgBC;AAAA,IACdC,EAAWC,EAAgB,4BAA4B,MAAM;AAAA,IAC7DD;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CAACC,OAA6E;AAAA,UAC5E,GAAGA;AAAA,UACH,WAAWC;AAAA,UACX,cAAc;AAAA,QAAA;AAAA,MAChB;AAAA,IACF;AAAA,EACF;AAAA,EAEF,UAAUL;AAAA,IACRC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CAACC,OAA6E;AAAA,UAC5E,GAAGA;AAAA,UACH,WAAWE;AAAA,UACX,cAAc;AAAA,QAAA;AAAA,MAChB;AAAA,IACF;AAAA,IAEFL;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CACEC,GACAG,OACsC;AAAA,UACtC,GAAGH;AAAA,UACH,WAAWE;AAAA,UACX,cAAcC,EAAG,QAAQ;AAAA,QAAA;AAAA,MAC3B;AAAA,IACF;AAAA,IAEFN,EAAWC,EAAgB,4BAA4B,MAAM;AAAA,EAAA;AAAA,EAE/D,SAASF;AAAA,IACPC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CAACC,OAA6E;AAAA,UAC5E,GAAGA;AAAA,UACH,WAAWC;AAAA,UACX,cAAc;AAAA,QAAA;AAAA,MAChB;AAAA,IACF;AAAA,IAEFJ;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CAACC,OAA6E;AAAA,UAC5E,GAAGA;AAAA,UACH,WAAWC;AAAA,UACX,cAAc;AAAA,QAAA;AAAA,MAChB;AAAA,IACF;AAAA,EACF;AAAA,EAEF,MAAMG,EAAA;AACR;"}
|
|
@@ -7,8 +7,11 @@ import { ResourceDictionary } from '../../../../types/Helpers';
|
|
|
7
7
|
* default; management surfaces resolve this dictionary from
|
|
8
8
|
* `Employee.Management.Compensation` and pass it in so management copy renders
|
|
9
9
|
* while the two surfaces stay isolated.
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
10
12
|
*/
|
|
11
13
|
export type AddCompensationFormDictionary = ResourceDictionary<'Employee.Compensation'>;
|
|
14
|
+
/** @internal */
|
|
12
15
|
export interface AddCompensationFormBodyProps {
|
|
13
16
|
jobForm: UseJobFormReady;
|
|
14
17
|
compensationForm: UseCompensationFormReady;
|
|
@@ -29,5 +32,7 @@ export interface AddCompensationFormBodyProps {
|
|
|
29
32
|
* Copy resolves from the onboarding `Employee.Compensation` namespace by default; management
|
|
30
33
|
* consumers inject a `dictionary` mapped from `Employee.Management.Compensation` to keep
|
|
31
34
|
* onboarding and management strings independently overridable.
|
|
35
|
+
*
|
|
36
|
+
* @internal
|
|
32
37
|
*/
|
|
33
38
|
export declare function AddCompensationFormBody({ jobForm, compensationForm, title, submitCtaLabel, isPending, onCancel, dictionary, }: AddCompensationFormBodyProps): import("react").JSX.Element;
|
|
@@ -3,10 +3,11 @@ import { useTranslation as h, Trans as d } from "react-i18next";
|
|
|
3
3
|
import { Flex as c } from "../../../Common/Flex/Flex.js";
|
|
4
4
|
import { ActionsLayout as v } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
5
5
|
import { useComponentContext as C } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
+
import "react";
|
|
6
7
|
import { FLSA_OVERTIME_SALARY_LIMIT as p } from "../../../../shared/constants.js";
|
|
7
8
|
import y from "../../../../hooks/useNumberFormatter.js";
|
|
8
9
|
import { useI18n as D, useComponentDictionary as M } from "../../../../i18n/I18n.js";
|
|
9
|
-
function
|
|
10
|
+
function U({
|
|
10
11
|
jobForm: n,
|
|
11
12
|
compensationForm: i,
|
|
12
13
|
title: b,
|
|
@@ -215,6 +216,6 @@ function H({
|
|
|
215
216
|
] });
|
|
216
217
|
}
|
|
217
218
|
export {
|
|
218
|
-
|
|
219
|
+
U as AddCompensationFormBody
|
|
219
220
|
};
|
|
220
221
|
//# sourceMappingURL=AddCompensationFormBody.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddCompensationFormBody.js","sources":["../../../../../src/components/Employee/Compensation/shared/AddCompensationFormBody.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport type { PaymentUnit } from '@gusto/embedded-api-v-2025-11-15/models/components/compensation'\nimport type { FlsaStatusType } from '@gusto/embedded-api-v-2025-11-15/models/components/flsastatustype'\nimport type { MinimumWage } from '@gusto/embedded-api-v-2025-11-15/models/components/minimumwage'\nimport type { UseJobFormReady } from './useJobForm'\nimport type { UseCompensationFormReady } from './useCompensationForm'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FLSA_OVERTIME_SALARY_LIMIT } from '@/shared/constants'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport type { ResourceDictionary } from '@/types/Helpers'\n\n/**\n * Translation overrides for the shared add-compensation form body. The body\n * reads its copy from the onboarding `Employee.Compensation` namespace by\n * default; management surfaces resolve this dictionary from\n * `Employee.Management.Compensation` and pass it in so management copy renders\n * while the two surfaces stay isolated.\n */\nexport type AddCompensationFormDictionary = ResourceDictionary<'Employee.Compensation'>\n\nexport interface AddCompensationFormBodyProps {\n jobForm: UseJobFormReady\n compensationForm: UseCompensationFormReady\n title: string\n submitCtaLabel: string\n isPending: boolean\n onCancel?: () => void\n /** Per-surface translation overrides resolved against the consumer's namespace. */\n dictionary?: AddCompensationFormDictionary\n}\n\n/**\n * Renders the shared field layout used by both `EditCompensation` (onboarding) and\n * `CompensationAddAnotherJobForm` (management). Field visibility is driven entirely by the hook\n * configuration — `JobFields.HireDate` is only defined when `withHireDateField: true`,\n * and `CompFields.EffectiveDate` is only defined when `withEffectiveDateField: true` —\n * so this component renders the correct subset for each use case with no extra props.\n *\n * Copy resolves from the onboarding `Employee.Compensation` namespace by default; management\n * consumers inject a `dictionary` mapped from `Employee.Management.Compensation` to keep\n * onboarding and management strings independently overridable.\n */\nexport function AddCompensationFormBody({\n jobForm,\n compensationForm,\n title,\n submitCtaLabel,\n isPending,\n onCancel,\n dictionary,\n}: AddCompensationFormBodyProps) {\n useI18n('Employee.Compensation')\n useComponentDictionary('Employee.Compensation', dictionary)\n const { t } = useTranslation('Employee.Compensation')\n const Components = useComponentContext()\n const format = useNumberFormatter('currency')\n\n const JobFields = jobForm.form.Fields\n const CompFields = compensationForm.form.Fields\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h2\">{title}</Components.Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n {JobFields.Title && (\n <JobFields.Title\n label={t('jobTitle')}\n validationMessages={{ REQUIRED: t('validations.title') }}\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.HireDate && (\n <JobFields.HireDate\n label={t('hireDate')}\n validationMessages={{ REQUIRED: t('validations.hireDate') }}\n formHookResult={jobForm}\n />\n )}\n\n {CompFields.FlsaStatus && (\n <>\n <CompFields.FlsaStatus\n label={t('employeeClassification')}\n description={\n <Trans\n t={t}\n i18nKey=\"classificationLink\"\n components={{ ClassificationLink: <Components.Link /> }}\n />\n }\n validationMessages={{\n REQUIRED: t('validations.exemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n getOptionLabel={(status: FlsaStatusType) => t(`flsaStatusLabels.${status}`)}\n formHookResult={compensationForm}\n />\n {(compensationForm.status.showCommissionFederalMinimumPayAlert ||\n compensationForm.status.showCommissionMinimumWageAlert ||\n compensationForm.status.showOwnerSalaryAlert ||\n compensationForm.status.willDeleteSecondaryJobs) && (\n <Flex flexDirection=\"column\" gap={0}>\n {compensationForm.status.willDeleteSecondaryJobs && (\n <Components.Alert\n label={t('validations.classificationChangeNotification')}\n status=\"warning\"\n >\n {t('validations.classificationChangeRemovesSecondaryJobs')}\n </Components.Alert>\n )}\n {compensationForm.status.showCommissionFederalMinimumPayAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.federalMinimumPay.label')}\n disableScrollIntoView\n >\n {t('commissionAlerts.federalMinimumPay.body')}\n </Components.Alert>\n )}\n {compensationForm.status.showCommissionMinimumWageAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.minimumWage.label')}\n disableScrollIntoView\n >\n <Trans\n t={t}\n i18nKey=\"commissionAlerts.minimumWage.body\"\n components={{\n minimumWageLink: (\n <Components.Link\n href=\"https://support.gusto.com/article/112472520100000/manage-tip-wages-distributed-service-charges-and-tip-credits-in-gusto-for-admins\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n </Components.Alert>\n )}\n {compensationForm.status.showOwnerSalaryAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.ownerSalary.label')}\n disableScrollIntoView\n />\n )}\n </Flex>\n )}\n </>\n )}\n\n {CompFields.Rate && (\n <CompFields.Rate\n label={t('wageLabel')}\n validationMessages={{\n REQUIRED: t('validations.rate'),\n RATE_MINIMUM: t('validations.nonZeroRate'),\n RATE_EXEMPT_THRESHOLD: t('validations.rateExemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.PaymentUnit && (\n <CompFields.PaymentUnit\n label={t('wageFrequencyLabel')}\n description={t('paymentUnitDescription')}\n validationMessages={{ REQUIRED: t('validations.paymentUnit') }}\n getOptionLabel={(unit: PaymentUnit) => t(`paymentUnitOptions.${unit}`)}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.AdjustForMinimumWage && (\n <CompFields.AdjustForMinimumWage\n label={t('adjustForMinimumWage')}\n description={t('adjustForMinimumWageDescription')}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.MinimumWageId && (\n <CompFields.MinimumWageId\n label={t('minimumWageLabel')}\n description={t('minimumWageDescription')}\n validationMessages={{ REQUIRED: t('validations.minimumWage') }}\n getOptionLabel={(wage: MinimumWage) =>\n `${format(Number(wage.wage))} - ${wage.authority}: ${wage.notes ?? ''}`\n }\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.EffectiveDate && (\n <CompFields.EffectiveDate\n label={t('effectiveDate')}\n validationMessages={{\n REQUIRED: t('validations.effectiveDate'),\n EFFECTIVE_DATE_BEFORE_HIRE: t('validations.effectiveDateBeforeHire'),\n EFFECTIVE_DATE_BEFORE_MIN: t('validations.effectiveDateBeforeMin'),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {JobFields.TwoPercentShareholder && (\n <JobFields.TwoPercentShareholder\n label={t('twoPercentStakeholderLabel')}\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcCovered && (\n <JobFields.StateWcCovered\n label={t('stateWcCoveredLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"stateWcCoveredDescription\"\n components={{\n wcLink: (\n <Components.Link\n href=\"https://www.lni.wa.gov/insurance/rates-risk-classes/risk-classes-for-workers-compensation/risk-class-lookup#/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n getOptionLabel={(covered: boolean) =>\n covered ? t('stateWcCoveredOptions.yes') : t('stateWcCoveredOptions.no')\n }\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcClassCode && (\n <JobFields.StateWcClassCode\n label={t('stateWcClassCodeLabel')}\n description={t('stateWcClassCodeDescription')}\n placeholder={t('stateWcClassCodeLabel')}\n validationMessages={{ REQUIRED: t('validations.stateWcClassCode') }}\n formHookResult={jobForm}\n />\n )}\n </Flex>\n\n <ActionsLayout>\n {onCancel && (\n <Components.Button variant=\"secondary\" onClick={onCancel} isDisabled={isPending}>\n {t('cancelNewJobCta')}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isPending}>\n {submitCtaLabel}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["AddCompensationFormBody","jobForm","compensationForm","title","submitCtaLabel","isPending","onCancel","dictionary","useI18n","useComponentDictionary","t","useTranslation","Components","useComponentContext","format","useNumberFormatter","JobFields","CompFields","jsxs","Flex","jsx","Fragment","Trans","FLSA_OVERTIME_SALARY_LIMIT","status","unit","wage","covered","ActionsLayout"],"mappings":";;;;;;;;AA4CO,SAASA,EAAwB;AAAA,EACtC,SAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AACF,GAAiC;AAC/B,EAAAC,EAAQ,uBAAuB,GAC/BC,EAAuB,yBAAyBF,CAAU;AAC1D,QAAM,EAAE,GAAAG,EAAA,IAAMC,EAAe,uBAAuB,GAC9CC,IAAaC,EAAA,GACbC,IAASC,EAAmB,UAAU,GAEtCC,IAAYf,EAAQ,KAAK,QACzBgB,IAAaf,EAAiB,KAAK;AAEzC,SACE,gBAAAgB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAC,EAACR,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAT,GAAM;AAAA,IAEnC,gBAAAe,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAA;AAAA,MAAAH,EAAU,SACT,gBAAAI;AAAA,QAACJ,EAAU;AAAA,QAAV;AAAA,UACC,OAAON,EAAE,UAAU;AAAA,UACnB,oBAAoB,EAAE,UAAUA,EAAE,mBAAmB,EAAA;AAAA,UACrD,gBAAgBT;AAAA,QAAA;AAAA,MAAA;AAAA,MAInBe,EA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,YAAY;AAAA,gBACV,QACE,gBAAAU;AAAA,kBAACR,EAAW;AAAA,kBAAX;AAAA,oBACC,MAAK;AAAA,oBACL,QAAO;AAAA,oBACP,KAAI;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACN;AAAA,YAEJ;AAAA,UAAA;AAAA,UAGJ,gBAAgB,CAACe,MACLjB,EAAViB,IAAY,8BAAiC,0BAAN;AAAA,UAEzC,gBAAgB1B;AAAA,QAAA;AAAA,MAAA;AAAA,MAInBe,EAAU,oBACT,gBAAAI;AAAA,QAACJ,EAAU;AAAA,QAAV;AAAA,UACC,OAAON,EAAE,uBAAuB;AAAA,UAChC,aAAaA,EAAE,6BAA6B;AAAA,UAC5C,aAAaA,EAAE,uBAAuB;AAAA,UACtC,oBAAoB,EAAE,UAAUA,EAAE,8BAA8B,EAAA;AAAA,UAChE,gBAAgBT;AAAA,QAAA;AAAA,MAAA;AAAA,IAClB,GAEJ;AAAA,sBAEC2B,GAAA,EACE,UAAA;AAAA,MAAAtB,KACC,gBAAAc,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASN,GAAU,YAAYD,GACnE,UAAAK,EAAE,iBAAiB,EAAA,CACtB;AAAA,MAEF,gBAAAU,EAACR,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWP,GACzC,UAAAD,EAAA,CACH;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"AddCompensationFormBody.js","sources":["../../../../../src/components/Employee/Compensation/shared/AddCompensationFormBody.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport type { PaymentUnit } from '@gusto/embedded-api-v-2025-11-15/models/components/compensation'\nimport type { FlsaStatusType } from '@gusto/embedded-api-v-2025-11-15/models/components/flsastatustype'\nimport type { MinimumWage } from '@gusto/embedded-api-v-2025-11-15/models/components/minimumwage'\nimport type { UseJobFormReady } from './useJobForm'\nimport type { UseCompensationFormReady } from './useCompensationForm'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FLSA_OVERTIME_SALARY_LIMIT } from '@/shared/constants'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport type { ResourceDictionary } from '@/types/Helpers'\n\n/**\n * Translation overrides for the shared add-compensation form body. The body\n * reads its copy from the onboarding `Employee.Compensation` namespace by\n * default; management surfaces resolve this dictionary from\n * `Employee.Management.Compensation` and pass it in so management copy renders\n * while the two surfaces stay isolated.\n *\n * @internal\n */\nexport type AddCompensationFormDictionary = ResourceDictionary<'Employee.Compensation'>\n\n/** @internal */\nexport interface AddCompensationFormBodyProps {\n jobForm: UseJobFormReady\n compensationForm: UseCompensationFormReady\n title: string\n submitCtaLabel: string\n isPending: boolean\n onCancel?: () => void\n /** Per-surface translation overrides resolved against the consumer's namespace. */\n dictionary?: AddCompensationFormDictionary\n}\n\n/**\n * Renders the shared field layout used by both `EditCompensation` (onboarding) and\n * `CompensationAddAnotherJobForm` (management). Field visibility is driven entirely by the hook\n * configuration — `JobFields.HireDate` is only defined when `withHireDateField: true`,\n * and `CompFields.EffectiveDate` is only defined when `withEffectiveDateField: true` —\n * so this component renders the correct subset for each use case with no extra props.\n *\n * Copy resolves from the onboarding `Employee.Compensation` namespace by default; management\n * consumers inject a `dictionary` mapped from `Employee.Management.Compensation` to keep\n * onboarding and management strings independently overridable.\n *\n * @internal\n */\nexport function AddCompensationFormBody({\n jobForm,\n compensationForm,\n title,\n submitCtaLabel,\n isPending,\n onCancel,\n dictionary,\n}: AddCompensationFormBodyProps) {\n useI18n('Employee.Compensation')\n useComponentDictionary('Employee.Compensation', dictionary)\n const { t } = useTranslation('Employee.Compensation')\n const Components = useComponentContext()\n const format = useNumberFormatter('currency')\n\n const JobFields = jobForm.form.Fields\n const CompFields = compensationForm.form.Fields\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h2\">{title}</Components.Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n {JobFields.Title && (\n <JobFields.Title\n label={t('jobTitle')}\n validationMessages={{ REQUIRED: t('validations.title') }}\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.HireDate && (\n <JobFields.HireDate\n label={t('hireDate')}\n validationMessages={{ REQUIRED: t('validations.hireDate') }}\n formHookResult={jobForm}\n />\n )}\n\n {CompFields.FlsaStatus && (\n <>\n <CompFields.FlsaStatus\n label={t('employeeClassification')}\n description={\n <Trans\n t={t}\n i18nKey=\"classificationLink\"\n components={{ ClassificationLink: <Components.Link /> }}\n />\n }\n validationMessages={{\n REQUIRED: t('validations.exemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n getOptionLabel={(status: FlsaStatusType) => t(`flsaStatusLabels.${status}`)}\n formHookResult={compensationForm}\n />\n {(compensationForm.status.showCommissionFederalMinimumPayAlert ||\n compensationForm.status.showCommissionMinimumWageAlert ||\n compensationForm.status.showOwnerSalaryAlert ||\n compensationForm.status.willDeleteSecondaryJobs) && (\n <Flex flexDirection=\"column\" gap={0}>\n {compensationForm.status.willDeleteSecondaryJobs && (\n <Components.Alert\n label={t('validations.classificationChangeNotification')}\n status=\"warning\"\n >\n {t('validations.classificationChangeRemovesSecondaryJobs')}\n </Components.Alert>\n )}\n {compensationForm.status.showCommissionFederalMinimumPayAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.federalMinimumPay.label')}\n disableScrollIntoView\n >\n {t('commissionAlerts.federalMinimumPay.body')}\n </Components.Alert>\n )}\n {compensationForm.status.showCommissionMinimumWageAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.minimumWage.label')}\n disableScrollIntoView\n >\n <Trans\n t={t}\n i18nKey=\"commissionAlerts.minimumWage.body\"\n components={{\n minimumWageLink: (\n <Components.Link\n href=\"https://support.gusto.com/article/112472520100000/manage-tip-wages-distributed-service-charges-and-tip-credits-in-gusto-for-admins\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n </Components.Alert>\n )}\n {compensationForm.status.showOwnerSalaryAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.ownerSalary.label')}\n disableScrollIntoView\n />\n )}\n </Flex>\n )}\n </>\n )}\n\n {CompFields.Rate && (\n <CompFields.Rate\n label={t('wageLabel')}\n validationMessages={{\n REQUIRED: t('validations.rate'),\n RATE_MINIMUM: t('validations.nonZeroRate'),\n RATE_EXEMPT_THRESHOLD: t('validations.rateExemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.PaymentUnit && (\n <CompFields.PaymentUnit\n label={t('wageFrequencyLabel')}\n description={t('paymentUnitDescription')}\n validationMessages={{ REQUIRED: t('validations.paymentUnit') }}\n getOptionLabel={(unit: PaymentUnit) => t(`paymentUnitOptions.${unit}`)}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.AdjustForMinimumWage && (\n <CompFields.AdjustForMinimumWage\n label={t('adjustForMinimumWage')}\n description={t('adjustForMinimumWageDescription')}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.MinimumWageId && (\n <CompFields.MinimumWageId\n label={t('minimumWageLabel')}\n description={t('minimumWageDescription')}\n validationMessages={{ REQUIRED: t('validations.minimumWage') }}\n getOptionLabel={(wage: MinimumWage) =>\n `${format(Number(wage.wage))} - ${wage.authority}: ${wage.notes ?? ''}`\n }\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.EffectiveDate && (\n <CompFields.EffectiveDate\n label={t('effectiveDate')}\n validationMessages={{\n REQUIRED: t('validations.effectiveDate'),\n EFFECTIVE_DATE_BEFORE_HIRE: t('validations.effectiveDateBeforeHire'),\n EFFECTIVE_DATE_BEFORE_MIN: t('validations.effectiveDateBeforeMin'),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {JobFields.TwoPercentShareholder && (\n <JobFields.TwoPercentShareholder\n label={t('twoPercentStakeholderLabel')}\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcCovered && (\n <JobFields.StateWcCovered\n label={t('stateWcCoveredLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"stateWcCoveredDescription\"\n components={{\n wcLink: (\n <Components.Link\n href=\"https://www.lni.wa.gov/insurance/rates-risk-classes/risk-classes-for-workers-compensation/risk-class-lookup#/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n getOptionLabel={(covered: boolean) =>\n covered ? t('stateWcCoveredOptions.yes') : t('stateWcCoveredOptions.no')\n }\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcClassCode && (\n <JobFields.StateWcClassCode\n label={t('stateWcClassCodeLabel')}\n description={t('stateWcClassCodeDescription')}\n placeholder={t('stateWcClassCodeLabel')}\n validationMessages={{ REQUIRED: t('validations.stateWcClassCode') }}\n formHookResult={jobForm}\n />\n )}\n </Flex>\n\n <ActionsLayout>\n {onCancel && (\n <Components.Button variant=\"secondary\" onClick={onCancel} isDisabled={isPending}>\n {t('cancelNewJobCta')}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isPending}>\n {submitCtaLabel}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["AddCompensationFormBody","jobForm","compensationForm","title","submitCtaLabel","isPending","onCancel","dictionary","useI18n","useComponentDictionary","t","useTranslation","Components","useComponentContext","format","useNumberFormatter","JobFields","CompFields","jsxs","Flex","jsx","Fragment","Trans","FLSA_OVERTIME_SALARY_LIMIT","status","unit","wage","covered","ActionsLayout"],"mappings":";;;;;;;;;AAiDO,SAASA,EAAwB;AAAA,EACtC,SAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AACF,GAAiC;AAC/B,EAAAC,EAAQ,uBAAuB,GAC/BC,EA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AAc,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASN,GAAU,YAAYD,GACnE,UAAAK,EAAE,iBAAiB,EAAA,CACtB;AAAA,MAEF,gBAAAU,EAACR,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWP,GACzC,UAAAD,EAAA,CACH;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PendingCompensationChange } from './getPendingCompensationChanges';
|
|
2
|
+
/** @internal */
|
|
2
3
|
export interface PendingChangesReviewModalProps {
|
|
3
4
|
isOpen: boolean;
|
|
4
5
|
pendingChanges: PendingCompensationChange[];
|
|
@@ -7,4 +8,5 @@ export interface PendingChangesReviewModalProps {
|
|
|
7
8
|
onClose: () => void;
|
|
8
9
|
onCancelChange: (pendingChange: PendingCompensationChange) => void;
|
|
9
10
|
}
|
|
11
|
+
/** @internal */
|
|
10
12
|
export declare function PendingChangesReviewModal({ isOpen, pendingChanges, employeeFirstName, cancellingCompensationUuid, onClose, onCancelChange, }: PendingChangesReviewModalProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PendingChangesReviewModal.js","sources":["../../../../../src/components/Employee/Compensation/shared/PendingChangesReviewModal.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { PendingCompensationChange } from './getPendingCompensationChanges'\nimport { usePendingChangeDetailRenderer } from './usePendingChangeDetailRenderer'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { formatDateLongWithYear } from '@/helpers/dateFormatting'\n\nexport interface PendingChangesReviewModalProps {\n isOpen: boolean\n pendingChanges: PendingCompensationChange[]\n employeeFirstName: string | null | undefined\n cancellingCompensationUuid: string | null\n onClose: () => void\n onCancelChange: (pendingChange: PendingCompensationChange) => void\n}\n\nexport function PendingChangesReviewModal({\n isOpen,\n pendingChanges,\n employeeFirstName,\n cancellingCompensationUuid,\n onClose,\n onCancelChange,\n}: PendingChangesReviewModalProps) {\n const { t } = useTranslation('Employee.Management.Compensation')\n const Components = useComponentContext()\n const renderDetail = usePendingChangeDetailRenderer(employeeFirstName)\n\n return (\n <Components.Modal\n isOpen={isOpen}\n onClose={onClose}\n shouldCloseOnBackdropClick\n footer={\n <Flex justifyContent=\"flex-end\" gap={8}>\n <Components.Button variant=\"secondary\" onClick={onClose}>\n {t('card.pendingChange.modal.closeCta')}\n </Components.Button>\n </Flex>\n }\n >\n <Flex flexDirection=\"column\" gap={32}>\n <Flex flexDirection=\"column\" gap={4}>\n <Components.Heading as=\"h3\" styledAs=\"h4\">\n {t('card.pendingChange.modal.title')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('card.pendingChange.modal.description')}\n </Components.Text>\n </Flex>\n <Flex flexDirection=\"column\" gap={16}>\n {pendingChanges.map(change => (\n <Components.Box\n key={change.compensationUuid}\n footer={\n <Components.Button\n variant=\"secondary\"\n isLoading={cancellingCompensationUuid === change.compensationUuid}\n onClick={() => {\n onCancelChange(change)\n }}\n >\n {t('card.pendingChange.cancelCta')}\n </Components.Button>\n }\n >\n <Flex flexDirection=\"column\" gap={16}>\n <Flex flexDirection=\"column\" gap={0}>\n {change.jobTitle && (\n <Components.Text weight=\"medium\">{change.jobTitle}</Components.Text>\n )}\n <Components.Text variant=\"supporting\" size=\"sm\">\n {formatDateLongWithYear(change.effectiveDate)}\n </Components.Text>\n </Flex>\n <Components.UnorderedList\n items={change.details.map(detail => renderDetail(detail))}\n />\n </Flex>\n </Components.Box>\n ))}\n </Flex>\n </Flex>\n </Components.Modal>\n )\n}\n"],"names":["PendingChangesReviewModal","isOpen","pendingChanges","employeeFirstName","cancellingCompensationUuid","onClose","onCancelChange","useTranslation","Components","useComponentContext","renderDetail","usePendingChangeDetailRenderer","jsx","Flex","jsxs","change","formatDateLongWithYear","detail"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"PendingChangesReviewModal.js","sources":["../../../../../src/components/Employee/Compensation/shared/PendingChangesReviewModal.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { PendingCompensationChange } from './getPendingCompensationChanges'\nimport { usePendingChangeDetailRenderer } from './usePendingChangeDetailRenderer'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { formatDateLongWithYear } from '@/helpers/dateFormatting'\n\n/** @internal */\nexport interface PendingChangesReviewModalProps {\n isOpen: boolean\n pendingChanges: PendingCompensationChange[]\n employeeFirstName: string | null | undefined\n cancellingCompensationUuid: string | null\n onClose: () => void\n onCancelChange: (pendingChange: PendingCompensationChange) => void\n}\n\n/** @internal */\nexport function PendingChangesReviewModal({\n isOpen,\n pendingChanges,\n employeeFirstName,\n cancellingCompensationUuid,\n onClose,\n onCancelChange,\n}: PendingChangesReviewModalProps) {\n const { t } = useTranslation('Employee.Management.Compensation')\n const Components = useComponentContext()\n const renderDetail = usePendingChangeDetailRenderer(employeeFirstName)\n\n return (\n <Components.Modal\n isOpen={isOpen}\n onClose={onClose}\n shouldCloseOnBackdropClick\n footer={\n <Flex justifyContent=\"flex-end\" gap={8}>\n <Components.Button variant=\"secondary\" onClick={onClose}>\n {t('card.pendingChange.modal.closeCta')}\n </Components.Button>\n </Flex>\n }\n >\n <Flex flexDirection=\"column\" gap={32}>\n <Flex flexDirection=\"column\" gap={4}>\n <Components.Heading as=\"h3\" styledAs=\"h4\">\n {t('card.pendingChange.modal.title')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('card.pendingChange.modal.description')}\n </Components.Text>\n </Flex>\n <Flex flexDirection=\"column\" gap={16}>\n {pendingChanges.map(change => (\n <Components.Box\n key={change.compensationUuid}\n footer={\n <Components.Button\n variant=\"secondary\"\n isLoading={cancellingCompensationUuid === change.compensationUuid}\n onClick={() => {\n onCancelChange(change)\n }}\n >\n {t('card.pendingChange.cancelCta')}\n </Components.Button>\n }\n >\n <Flex flexDirection=\"column\" gap={16}>\n <Flex flexDirection=\"column\" gap={0}>\n {change.jobTitle && (\n <Components.Text weight=\"medium\">{change.jobTitle}</Components.Text>\n )}\n <Components.Text variant=\"supporting\" size=\"sm\">\n {formatDateLongWithYear(change.effectiveDate)}\n </Components.Text>\n </Flex>\n <Components.UnorderedList\n items={change.details.map(detail => renderDetail(detail))}\n />\n </Flex>\n </Components.Box>\n ))}\n </Flex>\n </Flex>\n </Components.Modal>\n )\n}\n"],"names":["PendingChangesReviewModal","isOpen","pendingChanges","employeeFirstName","cancellingCompensationUuid","onClose","onCancelChange","useTranslation","Components","useComponentContext","renderDetail","usePendingChangeDetailRenderer","jsx","Flex","jsxs","change","formatDateLongWithYear","detail"],"mappings":";;;;;;AAkBO,SAASA,EAA0B;AAAA,EACxC,QAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,4BAAAC;AAAA,EACA,SAAAC;AAAA,EACA,gBAAAC;AACF,GAAmC;AACjC,QAAM,EAAE,EAAA,IAAMC,EAAe,kCAAkC,GACzDC,IAAaC,EAAA,GACbC,IAAeC,EAA+BR,CAAiB;AAErE,SACE,gBAAAS;AAAA,IAACJ,EAAW;AAAA,IAAX;AAAA,MACC,QAAAP;AAAA,MACA,SAAAI;AAAA,MACA,4BAA0B;AAAA,MAC1B,QACE,gBAAAO,EAACC,GAAA,EAAK,gBAAe,YAAW,KAAK,GACnC,UAAA,gBAAAD,EAACJ,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAA,EAAE,mCAAmC,GACxC,GACF;AAAA,MAGF,UAAA,gBAAAS,EAACD,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,QAAA,gBAAAC,EAACD,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,UAAA,gBAAAD,EAACJ,EAAW,SAAX,EAAmB,IAAG,MAAK,UAAS,MAClC,UAAA,EAAE,gCAAgC,EAAA,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true`; "current compensation" is the
|
|
7
7
|
* entry in `job.compensations` whose `uuid` matches `job.currentCompensationUuid`.
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
8
10
|
*/
|
|
9
11
|
export declare function derivePrimaryFlsaStatus(jobs: Job[] | undefined): string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derivePrimaryFlsaStatus.js","sources":["../../../../../src/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.ts"],"sourcesContent":["import type { Job } from '@gusto/embedded-api-v-2025-11-15/models/components/job'\n\n/**\n * Returns the FLSA status of the employee's primary job's current compensation,\n * or `undefined` when there is no primary job or no resolvable current compensation.\n *\n * The primary job is the one with `primary === true`; \"current compensation\" is the\n * entry in `job.compensations` whose `uuid` matches `job.currentCompensationUuid`.\n */\nexport function derivePrimaryFlsaStatus(jobs: Job[] | undefined): string | undefined {\n return (jobs ?? []).reduce<string | undefined>((acc, job) => {\n const comp = job.compensations?.find(c => c.uuid === job.currentCompensationUuid)\n if (!job.primary || !comp) return acc\n return comp.flsaStatus ?? acc\n }, undefined)\n}\n"],"names":["derivePrimaryFlsaStatus","jobs","acc","job","comp","c"],"mappings":"
|
|
1
|
+
{"version":3,"file":"derivePrimaryFlsaStatus.js","sources":["../../../../../src/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.ts"],"sourcesContent":["import type { Job } from '@gusto/embedded-api-v-2025-11-15/models/components/job'\n\n/**\n * Returns the FLSA status of the employee's primary job's current compensation,\n * or `undefined` when there is no primary job or no resolvable current compensation.\n *\n * The primary job is the one with `primary === true`; \"current compensation\" is the\n * entry in `job.compensations` whose `uuid` matches `job.currentCompensationUuid`.\n *\n * @internal\n */\nexport function derivePrimaryFlsaStatus(jobs: Job[] | undefined): string | undefined {\n return (jobs ?? []).reduce<string | undefined>((acc, job) => {\n const comp = job.compensations?.find(c => c.uuid === job.currentCompensationUuid)\n if (!job.primary || !comp) return acc\n return comp.flsaStatus ?? acc\n }, undefined)\n}\n"],"names":["derivePrimaryFlsaStatus","jobs","acc","job","comp","c"],"mappings":"AAWO,SAASA,EAAwBC,GAA6C;AACnF,UAAQA,KAAQ,CAAA,GAAI,OAA2B,CAACC,GAAKC,MAAQ;AAC3D,UAAMC,IAAOD,EAAI,eAAe,KAAK,OAAKE,EAAE,SAASF,EAAI,uBAAuB;AAChF,WAAI,CAACA,EAAI,WAAW,CAACC,IAAaF,IAC3BE,EAAK,cAAcF;AAAA,EAC5B,GAAG,MAAS;AACd;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FlsaStatusType } from '@gusto/embedded-api-v-2025-11-15/models/components/flsastatustype';
|
|
2
2
|
import { Job } from '@gusto/embedded-api-v-2025-11-15/models/components/job';
|
|
3
|
+
/** @internal */
|
|
3
4
|
export type PendingChangeDetail = {
|
|
4
5
|
kind: 'titleChange';
|
|
5
6
|
title: string;
|
|
@@ -24,6 +25,7 @@ export type PendingChangeDetail = {
|
|
|
24
25
|
rate: number | null;
|
|
25
26
|
paymentUnit: string | null;
|
|
26
27
|
};
|
|
28
|
+
/** @internal */
|
|
27
29
|
export interface PendingCompensationChange {
|
|
28
30
|
compensationUuid: string;
|
|
29
31
|
jobUuid: string;
|
|
@@ -50,6 +52,8 @@ export interface PendingCompensationChange {
|
|
|
50
52
|
* The helper returns structured deltas (a discriminated union per detail) so
|
|
51
53
|
* the consuming UI is responsible for formatting them via i18n / pay-rate
|
|
52
54
|
* helpers. This keeps the helper pure and trivially unit-testable.
|
|
55
|
+
*
|
|
56
|
+
* @internal
|
|
53
57
|
*/
|
|
54
58
|
export declare function getPendingCompensationChanges(jobs: Job[] | undefined, options?: {
|
|
55
59
|
today?: Date;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPendingCompensationChanges.js","sources":["../../../../../src/components/Employee/Compensation/shared/getPendingCompensationChanges.ts"],"sourcesContent":["import type { Compensation } from '@gusto/embedded-api-v-2025-11-15/models/components/compensation'\nimport type { FlsaStatusType } from '@gusto/embedded-api-v-2025-11-15/models/components/flsastatustype'\nimport type { Job } from '@gusto/embedded-api-v-2025-11-15/models/components/job'\nimport { normalizeToDate } from '@/helpers/dateFormatting'\n\nexport type PendingChangeDetail =\n | { kind: 'titleChange'; title: string }\n | { kind: 'payChange'; rate: number; paymentUnit: string }\n | { kind: 'flsaChange'; flsaStatus: FlsaStatusType }\n | { kind: 'minWageEnabled'; wage: string | null }\n | { kind: 'minWageDisabled' }\n | { kind: 'minWageChanged'; wage: string | null }\n | {\n kind: 'newJob'\n title: string | null\n rate: number | null\n paymentUnit: string | null\n }\n\nexport interface PendingCompensationChange {\n compensationUuid: string\n jobUuid: string\n effectiveDate: string\n jobTitle: string | null\n details: PendingChangeDetail[]\n /**\n * True when the job has no current (on-or-before-today) compensation —\n * i.e., the job itself hasn't started yet. The UI renders a \"Pending\"\n * badge rather than a change alert in this case.\n */\n isNewJob: boolean\n}\n\nconst startOfLocalDay = (d: Date) => new Date(d.getFullYear(), d.getMonth(), d.getDate())\n\nconst isAfterToday = (effectiveDate: string | undefined, todayStart: Date): boolean => {\n if (!effectiveDate) return false\n const parsed = normalizeToDate(effectiveDate)\n if (!parsed) return false\n return startOfLocalDay(parsed) > todayStart\n}\n\nconst isOnOrBeforeToday = (effectiveDate: string | undefined, todayStart: Date): boolean => {\n if (!effectiveDate) return false\n const parsed = normalizeToDate(effectiveDate)\n if (!parsed) return false\n return startOfLocalDay(parsed) <= todayStart\n}\n\nconst numericRate = (rate: string | undefined): number | null => {\n if (rate === undefined || rate === '') return null\n const n = Number(rate)\n return Number.isFinite(n) ? n : null\n}\n\nfunction buildExistingJobDetails(\n baseline: Compensation,\n future: Compensation,\n): PendingChangeDetail[] {\n const details: PendingChangeDetail[] = []\n\n // Title diffs come straight from `compensation.title` — that's where the\n // value lives in the API. A future comp that doesn't carry a title (e.g.\n // a pay-only change) leaves `future.title` undefined; the `futureTitle &&`\n // guard prevents that case from emitting a spurious title change.\n const baseTitle = baseline.title ?? null\n const futureTitle = future.title ?? null\n if (futureTitle && baseTitle !== futureTitle) {\n details.push({ kind: 'titleChange', title: futureTitle })\n }\n\n const baseRate = numericRate(baseline.rate)\n const futureRate = numericRate(future.rate)\n const baseUnit = baseline.paymentUnit\n const futureUnit = future.paymentUnit\n const rateDiffers = futureRate !== null && futureRate !== baseRate\n const unitDiffers = futureUnit !== undefined && futureUnit !== baseUnit\n if ((rateDiffers || unitDiffers) && futureRate !== null && futureUnit) {\n details.push({ kind: 'payChange', rate: futureRate, paymentUnit: futureUnit })\n }\n\n if (future.flsaStatus && future.flsaStatus !== baseline.flsaStatus) {\n details.push({ kind: 'flsaChange', flsaStatus: future.flsaStatus })\n }\n\n const baseAdj = baseline.adjustForMinimumWage ?? false\n const futureAdj = future.adjustForMinimumWage ?? false\n const baseMw = baseline.minimumWages?.[0]\n const futureMw = future.minimumWages?.[0]\n\n if (!baseAdj && futureAdj) {\n details.push({ kind: 'minWageEnabled', wage: futureMw?.wage ?? null })\n } else if (baseAdj && !futureAdj) {\n details.push({ kind: 'minWageDisabled' })\n } else if (baseAdj && futureAdj) {\n if (baseMw?.uuid !== futureMw?.uuid || baseMw?.wage !== futureMw?.wage) {\n details.push({ kind: 'minWageChanged', wage: futureMw?.wage ?? null })\n }\n }\n\n return details\n}\n\nfunction buildNewJobDetails(future: Compensation): PendingChangeDetail[] {\n const rate = numericRate(future.rate)\n return [\n {\n kind: 'newJob',\n title: future.title ?? null,\n rate,\n paymentUnit: rate !== null && future.paymentUnit ? future.paymentUnit : null,\n },\n ]\n}\n\n/**\n * Returns the pending compensation changes for an employee, flattened across\n * all jobs and sorted globally by `effectiveDate` ascending.\n *\n * A pending change is any `Compensation` whose `effectiveDate` is strictly\n * after today (local midnight). When a single job has multiple future-dated\n * compensations stacked, each is returned in chronological order and the diff\n * details for the N+1th comp are computed against the Nth (rather than the\n * job's current compensation) so the bullets remain meaningful end-to-end.\n *\n * The helper returns structured deltas (a discriminated union per detail) so\n * the consuming UI is responsible for formatting them via i18n / pay-rate\n * helpers. This keeps the helper pure and trivially unit-testable.\n */\nexport function getPendingCompensationChanges(\n jobs: Job[] | undefined,\n options: { today?: Date } = {},\n): PendingCompensationChange[] {\n if (!jobs?.length) return []\n\n const now = options.today ?? new Date()\n const todayStart = startOfLocalDay(now)\n const results: PendingCompensationChange[] = []\n\n for (const job of jobs) {\n const comps = job.compensations ?? []\n\n const futureComps = comps\n .filter(c => isAfterToday(c.effectiveDate, todayStart))\n .slice()\n .sort((a, b) => (a.effectiveDate ?? '').localeCompare(b.effectiveDate ?? ''))\n\n if (futureComps.length === 0) continue\n\n const referencedCurrent = job.currentCompensationUuid\n ? comps.find(c => c.uuid === job.currentCompensationUuid)\n : undefined\n const currentComp =\n referencedCurrent && isOnOrBeforeToday(referencedCurrent.effectiveDate, todayStart)\n ? referencedCurrent\n : null\n\n // Title lives on compensation; `job.title` is a denormalized snapshot of\n // the primary comp's title and can lag behind comp-level edits on\n // secondaries (and on primaries until the server resyncs). For UI strings\n // that contextualize a change (\"Compensation for X will change on...\"),\n // use the title from the currently-in-effect comp; for a job that hasn't\n // started yet (`currentComp === null`), fall back to the first future\n // comp's title — that's the title the job is starting with.\n const displayTitle = currentComp?.title ?? futureComps[0]?.title ?? null\n\n for (let i = 0; i < futureComps.length; i++) {\n const future = futureComps[i]!\n const baseline = i === 0 ? currentComp : futureComps[i - 1]!\n\n const details = baseline\n ? buildExistingJobDetails(baseline, future)\n : buildNewJobDetails(future)\n\n results.push({\n compensationUuid: future.uuid,\n jobUuid: job.uuid,\n effectiveDate: future.effectiveDate!,\n jobTitle: displayTitle,\n details,\n isNewJob: baseline === null,\n })\n }\n }\n\n results.sort((a, b) => a.effectiveDate.localeCompare(b.effectiveDate))\n\n return results\n}\n"],"names":["startOfLocalDay","d","isAfterToday","effectiveDate","todayStart","parsed","normalizeToDate","isOnOrBeforeToday","numericRate","rate","n","buildExistingJobDetails","baseline","future","details","baseTitle","futureTitle","baseRate","futureRate","baseUnit","futureUnit","baseAdj","futureAdj","baseMw","futureMw","buildNewJobDetails","getPendingCompensationChanges","jobs","options","now","results","job","comps","futureComps","c","a","b","referencedCurrent","currentComp","displayTitle"],"mappings":";AAiCA,MAAMA,IAAkB,CAACC,MAAY,IAAI,KAAKA,EAAE,eAAeA,EAAE,SAAA,GAAYA,EAAE,SAAS,GAElFC,IAAe,CAACC,GAAmCC,MAA8B;AACrF,MAAI,CAACD,EAAe,QAAO;AAC3B,QAAME,IAASC,EAAgBH,CAAa;AAC5C,SAAKE,IACEL,EAAgBK,CAAM,IAAID,IADb;AAEtB,GAEMG,IAAoB,CAACJ,GAAmCC,MAA8B;AAC1F,MAAI,CAACD,EAAe,QAAO;AAC3B,QAAME,IAASC,EAAgBH,CAAa;AAC5C,SAAKE,IACEL,EAAgBK,CAAM,KAAKD,IADd;AAEtB,GAEMI,IAAc,CAACC,MAA4C;AAC/D,MAAIA,MAAS,UAAaA,MAAS,GAAI,QAAO;AAC9C,QAAMC,IAAI,OAAOD,CAAI;AACrB,SAAO,OAAO,SAASC,CAAC,IAAIA,IAAI;AAClC;AAEA,SAASC,EACPC,GACAC,GACuB;AACvB,QAAMC,IAAiC,CAAA,GAMjCC,IAAYH,EAAS,SAAS,MAC9BI,IAAcH,EAAO,SAAS;AACpC,EAAIG,KAAeD,MAAcC,KAC/BF,EAAQ,KAAK,EAAE,MAAM,eAAe,OAAOE,GAAa;AAG1D,QAAMC,IAAWT,EAAYI,EAAS,IAAI,GACpCM,IAAaV,EAAYK,EAAO,IAAI,GACpCM,IAAWP,EAAS,aACpBQ,IAAaP,EAAO;AAG1B,GAFoBK,MAAe,QAAQA,MAAeD,KACtCG,MAAe,UAAaA,MAAeD,MAC3BD,MAAe,QAAQE,KACzDN,EAAQ,KAAK,EAAE,MAAM,aAAa,MAAMI,GAAY,aAAaE,GAAY,GAG3EP,EAAO,cAAcA,EAAO,eAAeD,EAAS,cACtDE,EAAQ,KAAK,EAAE,MAAM,cAAc,YAAYD,EAAO,YAAY;AAGpE,QAAMQ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O,IACJD,KAAqB9B,EAAkB8B,EAAkB,eAAejC,CAAU,IAC9EiC,IACA,MASAE,IAAeD,GAAa,SAASL,EAAY,CAAC,GAAG,SAAS;AAEpE,aAAS,IAAI,GAAG,IAAIA,EAAY,QAAQ,KAAK;AAC3C,YAAMpB,IAASoB,EAAY,CAAC,GACtBrB,IAAW,MAAM,IAAI0B,IAAcL,EAAY,IAAI,CAAC,GAEpDnB,IAAUF,IACZD,EAAwBC,GAAUC,CAAM,IACxCY,EAAmBZ,CAAM;AAE7B,MAAAiB,EAAQ,KAAK;AAAA,QACX,kBAAkBjB,EAAO;AAAA,QACzB,SAASkB,EAAI;AAAA,QACb,eAAelB,EAAO;AAAA,QACtB,UAAU0B;AAAA,QACV,SAAAzB;AAAA,QACA,UAAUF,MAAa;AAAA,MAAA,CACxB;AAAA,IACH;AAAA,EACF;AAEA,SAAAkB,EAAQ,KAAK,CAACK,GAAGC,MAAMD,EAAE,cAAc,cAAcC,EAAE,aAAa,CAAC,GAE9DN;AACT;"}
|
|
1
|
+
{"version":3,"file":"getPendingCompensationChanges.js","sources":["../../../../../src/components/Employee/Compensation/shared/getPendingCompensationChanges.ts"],"sourcesContent":["import type { Compensation } from '@gusto/embedded-api-v-2025-11-15/models/components/compensation'\nimport type { FlsaStatusType } from '@gusto/embedded-api-v-2025-11-15/models/components/flsastatustype'\nimport type { Job } from '@gusto/embedded-api-v-2025-11-15/models/components/job'\nimport { normalizeToDate } from '@/helpers/dateFormatting'\n\n/** @internal */\nexport type PendingChangeDetail =\n | { kind: 'titleChange'; title: string }\n | { kind: 'payChange'; rate: number; paymentUnit: string }\n | { kind: 'flsaChange'; flsaStatus: FlsaStatusType }\n | { kind: 'minWageEnabled'; wage: string | null }\n | { kind: 'minWageDisabled' }\n | { kind: 'minWageChanged'; wage: string | null }\n | {\n kind: 'newJob'\n title: string | null\n rate: number | null\n paymentUnit: string | null\n }\n\n/** @internal */\nexport interface PendingCompensationChange {\n compensationUuid: string\n jobUuid: string\n effectiveDate: string\n jobTitle: string | null\n details: PendingChangeDetail[]\n /**\n * True when the job has no current (on-or-before-today) compensation —\n * i.e., the job itself hasn't started yet. The UI renders a \"Pending\"\n * badge rather than a change alert in this case.\n */\n isNewJob: boolean\n}\n\nconst startOfLocalDay = (d: Date) => new Date(d.getFullYear(), d.getMonth(), d.getDate())\n\nconst isAfterToday = (effectiveDate: string | undefined, todayStart: Date): boolean => {\n if (!effectiveDate) return false\n const parsed = normalizeToDate(effectiveDate)\n if (!parsed) return false\n return startOfLocalDay(parsed) > todayStart\n}\n\nconst isOnOrBeforeToday = (effectiveDate: string | undefined, todayStart: Date): boolean => {\n if (!effectiveDate) return false\n const parsed = normalizeToDate(effectiveDate)\n if (!parsed) return false\n return startOfLocalDay(parsed) <= todayStart\n}\n\nconst numericRate = (rate: string | undefined): number | null => {\n if (rate === undefined || rate === '') return null\n const n = Number(rate)\n return Number.isFinite(n) ? n : null\n}\n\nfunction buildExistingJobDetails(\n baseline: Compensation,\n future: Compensation,\n): PendingChangeDetail[] {\n const details: PendingChangeDetail[] = []\n\n // Title diffs come straight from `compensation.title` — that's where the\n // value lives in the API. A future comp that doesn't carry a title (e.g.\n // a pay-only change) leaves `future.title` undefined; the `futureTitle &&`\n // guard prevents that case from emitting a spurious title change.\n const baseTitle = baseline.title ?? null\n const futureTitle = future.title ?? null\n if (futureTitle && baseTitle !== futureTitle) {\n details.push({ kind: 'titleChange', title: futureTitle })\n }\n\n const baseRate = numericRate(baseline.rate)\n const futureRate = numericRate(future.rate)\n const baseUnit = baseline.paymentUnit\n const futureUnit = future.paymentUnit\n const rateDiffers = futureRate !== null && futureRate !== baseRate\n const unitDiffers = futureUnit !== undefined && futureUnit !== baseUnit\n if ((rateDiffers || unitDiffers) && futureRate !== null && futureUnit) {\n details.push({ kind: 'payChange', rate: futureRate, paymentUnit: futureUnit })\n }\n\n if (future.flsaStatus && future.flsaStatus !== baseline.flsaStatus) {\n details.push({ kind: 'flsaChange', flsaStatus: future.flsaStatus })\n }\n\n const baseAdj = baseline.adjustForMinimumWage ?? false\n const futureAdj = future.adjustForMinimumWage ?? false\n const baseMw = baseline.minimumWages?.[0]\n const futureMw = future.minimumWages?.[0]\n\n if (!baseAdj && futureAdj) {\n details.push({ kind: 'minWageEnabled', wage: futureMw?.wage ?? null })\n } else if (baseAdj && !futureAdj) {\n details.push({ kind: 'minWageDisabled' })\n } else if (baseAdj && futureAdj) {\n if (baseMw?.uuid !== futureMw?.uuid || baseMw?.wage !== futureMw?.wage) {\n details.push({ kind: 'minWageChanged', wage: futureMw?.wage ?? null })\n }\n }\n\n return details\n}\n\nfunction buildNewJobDetails(future: Compensation): PendingChangeDetail[] {\n const rate = numericRate(future.rate)\n return [\n {\n kind: 'newJob',\n title: future.title ?? null,\n rate,\n paymentUnit: rate !== null && future.paymentUnit ? future.paymentUnit : null,\n },\n ]\n}\n\n/**\n * Returns the pending compensation changes for an employee, flattened across\n * all jobs and sorted globally by `effectiveDate` ascending.\n *\n * A pending change is any `Compensation` whose `effectiveDate` is strictly\n * after today (local midnight). When a single job has multiple future-dated\n * compensations stacked, each is returned in chronological order and the diff\n * details for the N+1th comp are computed against the Nth (rather than the\n * job's current compensation) so the bullets remain meaningful end-to-end.\n *\n * The helper returns structured deltas (a discriminated union per detail) so\n * the consuming UI is responsible for formatting them via i18n / pay-rate\n * helpers. This keeps the helper pure and trivially unit-testable.\n *\n * @internal\n */\nexport function getPendingCompensationChanges(\n jobs: Job[] | undefined,\n options: { today?: Date } = {},\n): PendingCompensationChange[] {\n if (!jobs?.length) return []\n\n const now = options.today ?? new Date()\n const todayStart = startOfLocalDay(now)\n const results: PendingCompensationChange[] = []\n\n for (const job of jobs) {\n const comps = job.compensations ?? []\n\n const futureComps = comps\n .filter(c => isAfterToday(c.effectiveDate, todayStart))\n .slice()\n .sort((a, b) => (a.effectiveDate ?? '').localeCompare(b.effectiveDate ?? ''))\n\n if (futureComps.length === 0) continue\n\n const referencedCurrent = job.currentCompensationUuid\n ? comps.find(c => c.uuid === job.currentCompensationUuid)\n : undefined\n const currentComp =\n referencedCurrent && isOnOrBeforeToday(referencedCurrent.effectiveDate, todayStart)\n ? referencedCurrent\n : null\n\n // Title lives on compensation; `job.title` is a denormalized snapshot of\n // the primary comp's title and can lag behind comp-level edits on\n // secondaries (and on primaries until the server resyncs). For UI strings\n // that contextualize a change (\"Compensation for X will change on...\"),\n // use the title from the currently-in-effect comp; for a job that hasn't\n // started yet (`currentComp === null`), fall back to the first future\n // comp's title — that's the title the job is starting with.\n const displayTitle = currentComp?.title ?? futureComps[0]?.title ?? null\n\n for (let i = 0; i < futureComps.length; i++) {\n const future = futureComps[i]!\n const baseline = i === 0 ? currentComp : futureComps[i - 1]!\n\n const details = baseline\n ? buildExistingJobDetails(baseline, future)\n : buildNewJobDetails(future)\n\n results.push({\n compensationUuid: future.uuid,\n jobUuid: job.uuid,\n effectiveDate: future.effectiveDate!,\n jobTitle: displayTitle,\n details,\n isNewJob: baseline === null,\n })\n }\n }\n\n results.sort((a, b) => a.effectiveDate.localeCompare(b.effectiveDate))\n\n return results\n}\n"],"names":["startOfLocalDay","d","isAfterToday","effectiveDate","todayStart","parsed","normalizeToDate","isOnOrBeforeToday","numericRate","rate","n","buildExistingJobDetails","baseline","future","details","baseTitle","futureTitle","baseRate","futureRate","baseUnit","futureUnit","baseAdj","futureAdj","baseMw","futureMw","buildNewJobDetails","getPendingCompensationChanges","jobs","options","now","results","job","comps","futureComps","c","a","b","referencedCurrent","currentComp","displayTitle"],"mappings":";AAmCA,MAAMA,IAAkB,CAACC,MAAY,IAAI,KAAKA,EAAE,eAAeA,EAAE,SAAA,GAAYA,EAAE,SAAS,GAElFC,IAAe,CAACC,GAAmCC,MAA8B;AACrF,MAAI,CAACD,EAAe,QAAO;AAC3B,QAAME,IAASC,EAAgBH,CAAa;AAC5C,SAAKE,IACEL,EAAgBK,CAAM,IAAID,IADb;AAEtB,GAEMG,IAAoB,CAACJ,GAAmCC,MAA8B;AAC1F,MAAI,CAACD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