@gusto/embedded-react-sdk 0.52.2 → 0.54.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 +61 -0
- package/DISCLAIMER.md +13 -0
- package/LICENSE +198 -4
- package/README.md +6 -0
- package/dist/components/Base/Base.d.ts +26 -5
- package/dist/components/Base/Base.js +89 -78
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/index.d.ts +1 -1
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.d.ts +1 -2
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.js +42 -43
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.js.map +1 -1
- package/dist/components/Common/Fields/PercentageField/PercentageField.js +44 -42
- package/dist/components/Common/Fields/PercentageField/PercentageField.js.map +1 -1
- package/dist/components/Common/UI/Box/Box.js +6 -6
- package/dist/components/Common/UI/Box/Box.js.map +1 -1
- package/dist/components/Common/UI/Box/Box.module.scss.js +8 -8
- package/dist/components/Common/UI/Box/BoxTypes.d.ts +1 -1
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Common/UI/CalendarPreview/CalendarPreview.js +16 -14
- package/dist/components/Common/UI/CalendarPreview/CalendarPreview.js.map +1 -1
- package/dist/components/Common/UI/Dialog/Dialog.js +29 -28
- package/dist/components/Common/UI/Dialog/Dialog.js.map +1 -1
- package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
- package/dist/components/Common/UI/FormBox/FormBox.d.ts +1 -1
- package/dist/components/Common/UI/FormBox/FormBox.js +9 -8
- package/dist/components/Common/UI/FormBox/FormBox.js.map +1 -1
- package/dist/components/Common/UI/FormBox/FormBox.module.scss.js +8 -6
- package/dist/components/Common/UI/FormBox/FormBox.module.scss.js.map +1 -1
- package/dist/components/Common/UI/FormBox/FormBoxTypes.d.ts +5 -1
- package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +7 -10
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -8
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -9
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +18 -21
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +11 -12
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/Head.js +8 -9
- package/dist/components/Company/AssignSignatory/Head.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -7
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +5 -8
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +20 -21
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +10 -12
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +2 -3
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +9 -11
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Head.js +2 -3
- package/dist/components/Company/BankAccount/BankAccountForm/Head.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -3
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +6 -7
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -8
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -6
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/stateMachine.d.ts +0 -1
- package/dist/components/Company/BankAccount/stateMachine.js +33 -35
- package/dist/components/Company/BankAccount/stateMachine.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -6
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +11 -14
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -3
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +7 -8
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/stateMachine.d.ts +0 -1
- package/dist/components/Company/DocumentSigner/stateMachine.js +27 -29
- package/dist/components/Company/DocumentSigner/stateMachine.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +6 -7
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +7 -10
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +4 -4
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +10 -8
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +5 -6
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +8 -6
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +10 -12
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Industry/IndustrySelect.js +6 -8
- package/dist/components/Company/Industry/IndustrySelect.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +6 -7
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +4 -6
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +11 -14
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +9 -12
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +5 -6
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +9 -10
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -5
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +5 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleForm.d.ts +4 -1
- package/dist/components/Company/PaySchedule/PayScheduleForm.js +66 -63
- package/dist/components/Company/PaySchedule/PayScheduleForm.js.map +1 -1
- package/dist/components/Company/PaySchedule/payScheduleStateMachine.d.ts +0 -1
- package/dist/components/Company/PaySchedule/payScheduleStateMachine.js +26 -28
- package/dist/components/Company/PaySchedule/payScheduleStateMachine.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxes.d.ts +2 -1
- package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesComponents.d.ts +2 -0
- package/dist/components/Company/StateTaxes/StateTaxesComponents.js +29 -16
- package/dist/components/Company/StateTaxes/StateTaxesComponents.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +2 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.d.ts +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js +21 -32
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +67 -75
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -7
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +62 -47
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +1 -0
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +26 -23
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.d.ts +1 -0
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/TaxRateManagement/AddRateAction.d.ts +12 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/AddRateAction.js +36 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/AddRateAction.js.map +1 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.d.ts +10 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.js +110 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.js.map +1 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateHistorySection.d.ts +18 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateHistorySection.js +55 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateHistorySection.js.map +1 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateManagement.d.ts +47 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateManagement.js +108 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateManagement.js.map +1 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.d.ts +25 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +23 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/index.d.ts +1 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.d.ts +29 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.js +34 -0
- package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.js.map +1 -0
- package/dist/components/Company/StateTaxes/shared/RequirementFields.d.ts +17 -0
- package/dist/components/Company/StateTaxes/shared/RequirementFields.js +24 -0
- package/dist/components/Company/StateTaxes/shared/RequirementFields.js.map +1 -0
- package/dist/components/Company/StateTaxes/{StateTaxesForm → shared}/applicableIf.d.ts +1 -1
- package/dist/components/Company/StateTaxes/shared/applicableIf.js.map +1 -0
- package/dist/components/Company/StateTaxes/shared/buildRequirementSchema.d.ts +19 -0
- package/dist/components/Company/StateTaxes/shared/buildRequirementSchema.js +38 -0
- package/dist/components/Company/StateTaxes/shared/buildRequirementSchema.js.map +1 -0
- package/dist/components/Company/StateTaxes/shared/requirementValue.d.ts +2 -0
- package/dist/components/Company/StateTaxes/shared/requirementValue.js +7 -0
- package/dist/components/Company/StateTaxes/shared/requirementValue.js.map +1 -0
- package/dist/components/Company/StateTaxes/shared/rhfKey.d.ts +23 -0
- package/dist/components/Company/StateTaxes/shared/rhfKey.js +13 -0
- package/dist/components/Company/StateTaxes/shared/rhfKey.js.map +1 -0
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.d.ts +1 -0
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js +33 -11
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js.map +1 -1
- package/dist/components/Company/exports/companyOnboarding.d.ts +1 -0
- package/dist/components/Company/exports/companyOnboarding.js +12 -10
- package/dist/components/Company/exports/companyOnboarding.js.map +1 -1
- package/dist/components/Contractor/Address/management/Address.d.ts +30 -0
- package/dist/components/Contractor/Address/management/Address.js +43 -0
- package/dist/components/Contractor/Address/management/Address.js.map +1 -0
- package/dist/components/Contractor/Address/management/AddressCard/AddressCard.d.ts +35 -0
- package/dist/components/Contractor/Address/management/AddressCard/AddressCard.js +45 -0
- package/dist/components/Contractor/Address/management/AddressCard/AddressCard.js.map +1 -0
- package/dist/components/Contractor/Address/management/AddressCard/index.d.ts +1 -0
- package/dist/components/Contractor/Address/management/AddressComponents.d.ts +12 -0
- package/dist/components/Contractor/Address/management/AddressComponents.js +48 -0
- package/dist/components/Contractor/Address/management/AddressComponents.js.map +1 -0
- package/dist/components/Contractor/Address/management/AddressEditForm.d.ts +29 -0
- package/dist/components/Contractor/Address/management/AddressEditForm.js +126 -0
- package/dist/components/Contractor/Address/management/AddressEditForm.js.map +1 -0
- package/dist/components/Contractor/Address/management/AddressEditForm.module.scss.js +8 -0
- package/dist/components/Contractor/Address/management/AddressEditForm.module.scss.js.map +1 -0
- package/dist/components/Contractor/Address/management/addressStateMachine.d.ts +5 -0
- package/dist/components/Contractor/Address/management/addressStateMachine.js +37 -0
- package/dist/components/Contractor/Address/management/addressStateMachine.js.map +1 -0
- package/dist/components/Contractor/Address/management/index.d.ts +3 -0
- package/dist/components/Contractor/Address/{Address.d.ts → onboarding/Address.d.ts} +7 -4
- package/dist/components/Contractor/Address/onboarding/Address.js +119 -0
- package/dist/components/Contractor/Address/onboarding/Address.js.map +1 -0
- package/dist/components/Contractor/Address/{types.d.ts → onboarding/types.d.ts} +2 -2
- package/dist/components/Contractor/Address/shared/useContractorAddressSummary/index.d.ts +1 -0
- package/dist/components/Contractor/Address/shared/useContractorAddressSummary/useContractorAddressSummary.d.ts +19 -0
- package/dist/components/Contractor/Address/shared/useContractorAddressSummary/useContractorAddressSummary.js +27 -0
- package/dist/components/Contractor/Address/shared/useContractorAddressSummary/useContractorAddressSummary.js.map +1 -0
- package/dist/components/Contractor/Compensation/management/Compensation.d.ts +30 -0
- package/dist/components/Contractor/Compensation/management/Compensation.js +43 -0
- package/dist/components/Contractor/Compensation/management/Compensation.js.map +1 -0
- package/dist/components/Contractor/Compensation/management/CompensationCard/CompensationCard.d.ts +35 -0
- package/dist/components/Contractor/Compensation/management/CompensationCard/CompensationCard.js +57 -0
- package/dist/components/Contractor/Compensation/management/CompensationCard/CompensationCard.js.map +1 -0
- package/dist/components/Contractor/Compensation/management/CompensationCard/index.d.ts +1 -0
- package/dist/components/Contractor/Compensation/management/CompensationComponents.d.ts +12 -0
- package/dist/components/Contractor/Compensation/management/CompensationComponents.js +48 -0
- package/dist/components/Contractor/Compensation/management/CompensationComponents.js.map +1 -0
- package/dist/components/Contractor/Compensation/management/CompensationEditForm.d.ts +29 -0
- package/dist/components/Contractor/Compensation/management/CompensationEditForm.js +94 -0
- package/dist/components/Contractor/Compensation/management/CompensationEditForm.js.map +1 -0
- package/dist/components/Contractor/Compensation/management/CompensationEditForm.module.scss.js +8 -0
- package/dist/components/Contractor/Compensation/management/CompensationEditForm.module.scss.js.map +1 -0
- package/dist/components/Contractor/Compensation/management/compensationStateMachine.d.ts +5 -0
- package/dist/components/Contractor/Compensation/management/compensationStateMachine.js +45 -0
- package/dist/components/Contractor/Compensation/management/compensationStateMachine.js.map +1 -0
- package/dist/components/Contractor/Compensation/management/index.d.ts +3 -0
- package/dist/components/Contractor/Compensation/shared/useContractorCompensationSummary/index.d.ts +1 -0
- package/dist/components/Contractor/Compensation/shared/useContractorCompensationSummary/useContractorCompensationSummary.d.ts +17 -0
- package/dist/components/Contractor/Compensation/shared/useContractorCompensationSummary/useContractorCompensationSummary.js +23 -0
- package/dist/components/Contractor/Compensation/shared/useContractorCompensationSummary/useContractorCompensationSummary.js.map +1 -0
- package/dist/components/Contractor/Compensation/shared/useContractorPayForm/contractorPaySchema.d.ts +50 -0
- package/dist/components/Contractor/Compensation/shared/useContractorPayForm/contractorPaySchema.js +32 -0
- package/dist/components/Contractor/Compensation/shared/useContractorPayForm/contractorPaySchema.js.map +1 -0
- package/dist/components/Contractor/Compensation/shared/useContractorPayForm/fields.d.ts +26 -0
- package/dist/components/Contractor/Compensation/shared/useContractorPayForm/fields.js +14 -0
- package/dist/components/Contractor/Compensation/shared/useContractorPayForm/fields.js.map +1 -0
- package/dist/components/Contractor/Compensation/shared/useContractorPayForm/index.d.ts +4 -0
- package/dist/components/Contractor/Compensation/shared/useContractorPayForm/useContractorPayForm.d.ts +111 -0
- package/dist/components/Contractor/Compensation/shared/useContractorPayForm/useContractorPayForm.js +95 -0
- package/dist/components/Contractor/Compensation/shared/useContractorPayForm/useContractorPayForm.js.map +1 -0
- package/dist/components/Contractor/ContractorList/management/ManagementContractorList.d.ts +39 -0
- package/dist/components/Contractor/ContractorList/management/ManagementContractorList.js +100 -0
- package/dist/components/Contractor/ContractorList/management/ManagementContractorList.js.map +1 -0
- package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.d.ts +22 -0
- package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js +247 -0
- package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js.map +1 -0
- package/dist/components/Contractor/ContractorList/{index.d.ts → onboarding/ContractorList.d.ts} +3 -3
- package/dist/components/Contractor/ContractorList/onboarding/ContractorList.js +71 -0
- package/dist/components/Contractor/ContractorList/onboarding/ContractorList.js.map +1 -0
- package/dist/components/Contractor/ContractorList/onboarding/ContractorListView.d.ts +16 -0
- package/dist/components/Contractor/ContractorList/onboarding/ContractorListView.js +113 -0
- package/dist/components/Contractor/ContractorList/onboarding/ContractorListView.js.map +1 -0
- package/dist/components/Contractor/ContractorList/shared/index.d.ts +1 -0
- package/dist/components/Contractor/ContractorList/shared/useContractorList.d.ts +87 -0
- package/dist/components/Contractor/ContractorList/shared/useContractorList.js +110 -0
- package/dist/components/Contractor/ContractorList/shared/useContractorList.js.map +1 -0
- package/dist/components/Contractor/Dashboard/Dashboard.d.ts +30 -0
- package/dist/components/Contractor/Dashboard/Dashboard.js +80 -0
- package/dist/components/Contractor/Dashboard/Dashboard.js.map +1 -0
- package/dist/components/Contractor/Dashboard/DashboardComponents.d.ts +25 -0
- package/dist/components/Contractor/Dashboard/DashboardComponents.js +67 -0
- package/dist/components/Contractor/Dashboard/DashboardComponents.js.map +1 -0
- package/dist/components/Contractor/Dashboard/DashboardFlow.d.ts +88 -0
- package/dist/components/Contractor/Dashboard/DashboardFlow.js +25 -0
- package/dist/components/Contractor/Dashboard/DashboardFlow.js.map +1 -0
- package/dist/components/Contractor/Dashboard/DetailsView.d.ts +26 -0
- package/dist/components/Contractor/Dashboard/DetailsView.js +14 -0
- package/dist/components/Contractor/Dashboard/DetailsView.js.map +1 -0
- package/dist/components/Contractor/Dashboard/PayView.d.ts +26 -0
- package/dist/components/Contractor/Dashboard/PayView.js +14 -0
- package/dist/components/Contractor/Dashboard/PayView.js.map +1 -0
- package/dist/components/Contractor/Dashboard/dashboardStateMachine.d.ts +8 -0
- package/dist/components/Contractor/Dashboard/dashboardStateMachine.js +138 -0
- package/dist/components/Contractor/Dashboard/dashboardStateMachine.js.map +1 -0
- package/dist/components/Contractor/Dashboard/index.d.ts +4 -0
- package/dist/components/Contractor/Documents/management/DocumentsCard/DocumentsCard.d.ts +36 -0
- package/dist/components/Contractor/Documents/management/DocumentsCard/DocumentsCard.js +93 -0
- package/dist/components/Contractor/Documents/management/DocumentsCard/DocumentsCard.js.map +1 -0
- package/dist/components/Contractor/Documents/management/DocumentsCard/index.d.ts +1 -0
- package/dist/components/Contractor/Documents/management/index.d.ts +2 -0
- package/dist/components/Contractor/Documents/{DocumentSigner → onboarding/DocumentSigner}/DocumentSigner.d.ts +1 -1
- package/dist/components/Contractor/Documents/{DocumentSigner → onboarding/DocumentSigner}/DocumentSigner.js +4 -4
- package/dist/components/Contractor/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -0
- package/dist/components/Contractor/Documents/{DocumentSigner → onboarding/DocumentSigner}/documentSignerStateMachine.d.ts +2 -2
- package/dist/components/Contractor/Documents/{DocumentSigner → onboarding/DocumentSigner}/documentSignerStateMachine.js +3 -3
- package/dist/components/Contractor/Documents/onboarding/DocumentSigner/documentSignerStateMachine.js.map +1 -0
- package/dist/components/Contractor/Documents/{DocumentSigner → onboarding/DocumentSigner}/stateMachine.d.ts +0 -1
- package/dist/components/Contractor/Documents/onboarding/DocumentSigner/stateMachine.js +42 -0
- package/dist/components/Contractor/Documents/onboarding/DocumentSigner/stateMachine.js.map +1 -0
- package/dist/components/Contractor/Documents/{DocumentsList → onboarding/DocumentsList}/DocumentsList.d.ts +1 -1
- package/dist/components/Contractor/Documents/onboarding/DocumentsList/DocumentsList.js +81 -0
- package/dist/components/Contractor/Documents/onboarding/DocumentsList/DocumentsList.js.map +1 -0
- package/dist/components/Contractor/Documents/onboarding/DocumentsList/index.d.ts +1 -0
- package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/SignatureForm.d.ts +1 -1
- package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/SignatureForm.js +112 -116
- package/dist/components/Contractor/Documents/shared/SignatureForm/SignatureForm.js.map +1 -0
- package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/useContractorSignatureForm/contractorSignatureFormSchema.d.ts +2 -2
- package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/useContractorSignatureForm/contractorSignatureFormSchema.js +3 -3
- package/dist/components/Contractor/Documents/shared/SignatureForm/useContractorSignatureForm/contractorSignatureFormSchema.js.map +1 -0
- package/dist/components/Contractor/Documents/shared/SignatureForm/useContractorSignatureForm/contractorSignatureFormSchema.test.d.ts +1 -0
- package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/useContractorSignatureForm/fields.d.ts +5 -5
- package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/useContractorSignatureForm/fields.js +6 -6
- package/dist/components/Contractor/Documents/shared/SignatureForm/useContractorSignatureForm/fields.js.map +1 -0
- package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/useContractorSignatureForm/useContractorSignatureForm.d.ts +2 -2
- package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/useContractorSignatureForm/useContractorSignatureForm.js +8 -8
- package/dist/components/Contractor/Documents/shared/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.js.map +1 -0
- package/dist/components/Contractor/Documents/shared/SignatureForm/useContractorSignatureForm/w9Fields.js.map +1 -0
- package/dist/components/Contractor/Documents/shared/SignatureForm/useContractorSignatureForm/w9Fields.test.d.ts +1 -0
- package/dist/components/Contractor/Documents/shared/documentSigningStatus.d.ts +15 -0
- package/dist/components/Contractor/Documents/shared/documentSigningStatus.js +7 -0
- package/dist/components/Contractor/Documents/shared/documentSigningStatus.js.map +1 -0
- package/dist/components/Contractor/Documents/shared/documentSigningStatus.test.d.ts +1 -0
- package/dist/components/Contractor/Documents/shared/useContractorDocumentsList/useContractorDocumentsList.js.map +1 -0
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.d.ts +1 -1
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js +17 -17
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Contractor/OnboardingSummary/OnboardingSummary.js +9 -10
- package/dist/components/Contractor/OnboardingSummary/OnboardingSummary.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/management/PaymentMethod.d.ts +32 -0
- package/dist/components/Contractor/PaymentMethod/management/PaymentMethod.js +43 -0
- package/dist/components/Contractor/PaymentMethod/management/PaymentMethod.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/management/PaymentMethodCard/PaymentMethodCard.d.ts +37 -0
- package/dist/components/Contractor/PaymentMethod/management/PaymentMethodCard/PaymentMethodCard.js +133 -0
- package/dist/components/Contractor/PaymentMethod/management/PaymentMethodCard/PaymentMethodCard.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/management/PaymentMethodCard/index.d.ts +1 -0
- package/dist/components/Contractor/PaymentMethod/management/PaymentMethodComponents.d.ts +12 -0
- package/dist/components/Contractor/PaymentMethod/management/PaymentMethodComponents.js +48 -0
- package/dist/components/Contractor/PaymentMethod/management/PaymentMethodComponents.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/management/PaymentMethodEditForm.d.ts +30 -0
- package/dist/components/Contractor/PaymentMethod/management/PaymentMethodEditForm.js +57 -0
- package/dist/components/Contractor/PaymentMethod/management/PaymentMethodEditForm.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/management/PaymentMethodEditForm.module.scss.js +8 -0
- package/dist/components/Contractor/PaymentMethod/management/PaymentMethodEditForm.module.scss.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/management/index.d.ts +3 -0
- package/dist/components/Contractor/PaymentMethod/management/paymentMethodStateMachine.d.ts +5 -0
- package/dist/components/Contractor/PaymentMethod/management/paymentMethodStateMachine.js +61 -0
- package/dist/components/Contractor/PaymentMethod/management/paymentMethodStateMachine.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/management/useFormDictionary.d.ts +11 -0
- package/dist/components/Contractor/PaymentMethod/management/useFormDictionary.js +33 -0
- package/dist/components/Contractor/PaymentMethod/management/useFormDictionary.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/{PaymentMethod.d.ts → onboarding/PaymentMethod.d.ts} +1 -1
- package/dist/components/Contractor/PaymentMethod/onboarding/PaymentMethod.js +87 -0
- package/dist/components/Contractor/PaymentMethod/onboarding/PaymentMethod.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/{types.d.ts → onboarding/types.d.ts} +1 -1
- package/dist/components/Contractor/PaymentMethod/onboarding/useFormDictionary.d.ts +12 -0
- package/dist/components/Contractor/PaymentMethod/onboarding/useFormDictionary.js +31 -0
- package/dist/components/Contractor/PaymentMethod/onboarding/useFormDictionary.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/shared/ContractorBankAccountFields/ContractorBankAccountFields.d.ts +29 -0
- package/dist/components/Contractor/PaymentMethod/shared/ContractorBankAccountFields/ContractorBankAccountFields.js +55 -0
- package/dist/components/Contractor/PaymentMethod/shared/ContractorBankAccountFields/ContractorBankAccountFields.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/shared/ContractorBankAccountFields/index.d.ts +1 -0
- package/dist/components/Contractor/PaymentMethod/shared/ContractorBankAccountFormBody/ContractorBankAccountFormBody.d.ts +30 -0
- package/dist/components/Contractor/PaymentMethod/shared/ContractorBankAccountFormBody/ContractorBankAccountFormBody.js +46 -0
- package/dist/components/Contractor/PaymentMethod/shared/ContractorBankAccountFormBody/ContractorBankAccountFormBody.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/shared/ContractorBankAccountFormBody/index.d.ts +1 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountForm.d.ts +12 -3
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountForm.js +71 -69
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodSummary/index.d.ts +1 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodSummary/useContractorPaymentMethodSummary.d.ts +24 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodSummary/useContractorPaymentMethodSummary.js +43 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodSummary/useContractorPaymentMethodSummary.js.map +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +129 -225
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +7 -3
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +58 -137
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +2 -3
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/useFormDictionary.d.ts +9 -0
- package/dist/components/Contractor/Payments/CreatePayment/useFormDictionary.js +53 -0
- package/dist/components/Contractor/Payments/CreatePayment/useFormDictionary.js.map +1 -0
- package/dist/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlow.d.ts +63 -0
- package/dist/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlow.js +46 -0
- package/dist/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlow.js.map +1 -0
- package/dist/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlowComponents.d.ts +22 -0
- package/dist/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlowComponents.js +26 -0
- package/dist/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlowComponents.js.map +1 -0
- package/dist/components/Contractor/Payments/CreatePaymentFlow/createPaymentMachine.d.ts +8 -0
- package/dist/components/Contractor/Payments/CreatePaymentFlow/createPaymentMachine.js +63 -0
- package/dist/components/Contractor/Payments/CreatePaymentFlow/createPaymentMachine.js.map +1 -0
- package/dist/components/Contractor/Payments/CreatePaymentFlow/createPaymentMachine.test.d.ts +1 -0
- package/dist/components/Contractor/Payments/CreatePaymentFlow/index.d.ts +2 -0
- package/dist/components/Contractor/Payments/HistoricalPaymentAmounts/HistoricalPaymentAmounts.d.ts +33 -0
- package/dist/components/Contractor/Payments/HistoricalPaymentAmounts/HistoricalPaymentAmounts.js +62 -0
- package/dist/components/Contractor/Payments/HistoricalPaymentAmounts/HistoricalPaymentAmounts.js.map +1 -0
- package/dist/components/Contractor/Payments/HistoricalPaymentAmounts/index.d.ts +1 -0
- package/dist/components/Contractor/Payments/HistoricalPaymentAmounts/useFormDictionary.d.ts +9 -0
- package/dist/components/Contractor/Payments/HistoricalPaymentAmounts/useFormDictionary.js +53 -0
- package/dist/components/Contractor/Payments/HistoricalPaymentAmounts/useFormDictionary.js.map +1 -0
- package/dist/components/Contractor/Payments/HistoricalPaymentContractors/HistoricalPaymentContractors.d.ts +27 -0
- package/dist/components/Contractor/Payments/HistoricalPaymentContractors/HistoricalPaymentContractors.js +56 -0
- package/dist/components/Contractor/Payments/HistoricalPaymentContractors/HistoricalPaymentContractors.js.map +1 -0
- package/dist/components/Contractor/Payments/HistoricalPaymentContractors/index.d.ts +1 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +2 -10
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +35 -44
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +22 -4
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +58 -152
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.test.d.ts +1 -0
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +2 -3
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlow.d.ts +63 -0
- package/dist/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlow.js +46 -0
- package/dist/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlow.js.map +1 -0
- package/dist/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlowComponents.d.ts +20 -0
- package/dist/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlowComponents.js +25 -0
- package/dist/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlowComponents.js.map +1 -0
- package/dist/components/Contractor/Payments/ViewPaymentFlow/index.d.ts +2 -0
- package/dist/components/Contractor/Payments/ViewPaymentFlow/viewPaymentMachine.d.ts +8 -0
- package/dist/components/Contractor/Payments/ViewPaymentFlow/viewPaymentMachine.js +51 -0
- package/dist/components/Contractor/Payments/ViewPaymentFlow/viewPaymentMachine.js.map +1 -0
- package/dist/components/Contractor/Payments/ViewPaymentFlow/viewPaymentMachine.test.d.ts +1 -0
- package/dist/components/Contractor/Payments/{CreatePayment → shared/SetPaymentAmounts}/EditContractorPaymentFormSchema.d.ts +2 -1
- package/dist/components/Contractor/Payments/{CreatePayment → shared/SetPaymentAmounts}/EditContractorPaymentFormSchema.js +2 -2
- package/dist/components/Contractor/Payments/shared/SetPaymentAmounts/EditContractorPaymentFormSchema.js.map +1 -0
- package/dist/components/Contractor/Payments/shared/SetPaymentAmounts/EditContractorPaymentPresentation.d.ts +44 -0
- package/dist/components/Contractor/Payments/shared/SetPaymentAmounts/EditContractorPaymentPresentation.js +128 -0
- package/dist/components/Contractor/Payments/shared/SetPaymentAmounts/EditContractorPaymentPresentation.js.map +1 -0
- package/dist/components/Contractor/Payments/shared/SetPaymentAmounts/SetPaymentAmounts.d.ts +52 -0
- package/dist/components/Contractor/Payments/shared/SetPaymentAmounts/SetPaymentAmounts.js +131 -0
- package/dist/components/Contractor/Payments/shared/SetPaymentAmounts/SetPaymentAmounts.js.map +1 -0
- package/dist/components/Contractor/Payments/shared/SetPaymentAmounts/index.d.ts +1 -0
- package/dist/components/Contractor/Payments/shared/historicalPaymentDateBounds.d.ts +19 -0
- package/dist/components/Contractor/Payments/shared/historicalPaymentDateBounds.js +13 -0
- package/dist/components/Contractor/Payments/shared/historicalPaymentDateBounds.js.map +1 -0
- package/dist/components/Contractor/Payments/shared/historicalPaymentDateBounds.test.d.ts +1 -0
- package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.d.ts +32 -0
- package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.js +116 -0
- package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.js.map +1 -0
- package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.test.d.ts +1 -0
- package/dist/components/Contractor/Profile/management/Profile.d.ts +30 -0
- package/dist/components/Contractor/Profile/management/Profile.js +43 -0
- package/dist/components/Contractor/Profile/management/Profile.js.map +1 -0
- package/dist/components/Contractor/Profile/management/ProfileCard/ProfileCard.d.ts +35 -0
- package/dist/components/Contractor/Profile/management/ProfileCard/ProfileCard.js +55 -0
- package/dist/components/Contractor/Profile/management/ProfileCard/ProfileCard.js.map +1 -0
- package/dist/components/Contractor/Profile/management/ProfileCard/index.d.ts +1 -0
- package/dist/components/Contractor/Profile/management/ProfileComponents.d.ts +12 -0
- package/dist/components/Contractor/Profile/management/ProfileComponents.js +48 -0
- package/dist/components/Contractor/Profile/management/ProfileComponents.js.map +1 -0
- package/dist/components/Contractor/Profile/management/ProfileEditForm.d.ts +32 -0
- package/dist/components/Contractor/Profile/management/ProfileEditForm.js +235 -0
- package/dist/components/Contractor/Profile/management/ProfileEditForm.js.map +1 -0
- package/dist/components/Contractor/Profile/management/ProfileEditForm.module.scss.js +16 -0
- package/dist/components/Contractor/Profile/management/ProfileEditForm.module.scss.js.map +1 -0
- package/dist/components/Contractor/Profile/management/index.d.ts +3 -0
- package/dist/components/Contractor/Profile/management/profileStateMachine.d.ts +5 -0
- package/dist/components/Contractor/Profile/management/profileStateMachine.js +37 -0
- package/dist/components/Contractor/Profile/management/profileStateMachine.js.map +1 -0
- package/dist/components/Contractor/Profile/{BusinessSelfOnboardingProfile.d.ts → onboarding/BusinessSelfOnboardingProfile.d.ts} +1 -1
- package/dist/components/Contractor/Profile/{BusinessSelfOnboardingProfile.js → onboarding/BusinessSelfOnboardingProfile.js} +30 -23
- package/dist/components/Contractor/Profile/onboarding/BusinessSelfOnboardingProfile.js.map +1 -0
- package/dist/components/Contractor/Profile/{ContractorProfile.d.ts → onboarding/ContractorProfile.d.ts} +2 -2
- package/dist/components/Contractor/Profile/{ContractorProfile.js → onboarding/ContractorProfile.js} +82 -63
- package/dist/components/Contractor/Profile/onboarding/ContractorProfile.js.map +1 -0
- package/dist/components/Contractor/Profile/{IndividualSelfOnboardingProfile.d.ts → onboarding/IndividualSelfOnboardingProfile.d.ts} +1 -1
- package/dist/components/Contractor/Profile/{IndividualSelfOnboardingProfile.js → onboarding/IndividualSelfOnboardingProfile.js} +32 -25
- package/dist/components/Contractor/Profile/onboarding/IndividualSelfOnboardingProfile.js.map +1 -0
- package/dist/components/Contractor/Profile/{SelfOnboardingContractorProfile.d.ts → onboarding/SelfOnboardingContractorProfile.d.ts} +6 -3
- package/dist/components/Contractor/Profile/onboarding/SelfOnboardingContractorProfile.js +43 -0
- package/dist/components/Contractor/Profile/onboarding/SelfOnboardingContractorProfile.js.map +1 -0
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.d.ts +13 -3
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.js +93 -92
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.js.map +1 -1
- package/dist/components/Contractor/Profile/shared/useContractorProfileSummary/index.d.ts +1 -0
- package/dist/components/Contractor/Profile/shared/useContractorProfileSummary/useContractorProfileSummary.d.ts +17 -0
- package/dist/components/Contractor/Profile/shared/useContractorProfileSummary/useContractorProfileSummary.js +23 -0
- package/dist/components/Contractor/Profile/shared/useContractorProfileSummary/useContractorProfileSummary.js.map +1 -0
- package/dist/components/Contractor/SelfOnboardingFlow/SelfOnboardingComponents.js +12 -12
- package/dist/components/Contractor/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +3 -4
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Contractor/exports/contractorManagement.d.ts +16 -0
- package/dist/components/Contractor/exports/contractorManagement.js +51 -11
- package/dist/components/Contractor/exports/contractorManagement.js.map +1 -1
- package/dist/components/Contractor/exports/contractorOnboarding.d.ts +9 -9
- package/dist/components/Contractor/exports/contractorOnboarding.js +14 -14
- package/dist/components/Contractor/shared/SelectContractors/SelectContractors.d.ts +19 -0
- package/dist/components/Contractor/shared/SelectContractors/SelectContractors.js +39 -0
- package/dist/components/Contractor/shared/SelectContractors/SelectContractors.js.map +1 -0
- package/dist/components/Contractor/shared/SelectContractors/SelectContractorsPresentation.d.ts +3 -0
- package/dist/components/Contractor/shared/SelectContractors/SelectContractorsPresentation.js +78 -0
- package/dist/components/Contractor/shared/SelectContractors/SelectContractorsPresentation.js.map +1 -0
- package/dist/components/Contractor/shared/SelectContractors/SelectContractorsPresentation.module.scss.js +10 -0
- package/dist/components/Contractor/shared/SelectContractors/SelectContractorsPresentation.module.scss.js.map +1 -0
- package/dist/components/Contractor/shared/SelectContractors/SelectContractorsPresentationTypes.d.ts +18 -0
- package/dist/components/Contractor/shared/SelectContractors/useSelectContractors.d.ts +58 -0
- package/dist/components/Contractor/shared/SelectContractors/useSelectContractors.js +82 -0
- package/dist/components/Contractor/shared/SelectContractors/useSelectContractors.js.map +1 -0
- package/dist/components/Contractor/shared/SelectContractors/useSelectContractors.test.d.ts +1 -0
- package/dist/components/Contractor/{Payments/CreatePayment → shared}/helpers.js +1 -1
- package/dist/components/Contractor/shared/helpers.js.map +1 -0
- package/dist/components/Contractor/shared/useContractorHasSignedW9.js +1 -1
- package/dist/components/Contractor/shared/useContractorHasSignedW9.js.map +1 -1
- package/dist/components/Employee/Compensation/management/Compensation.d.ts +1 -1
- package/dist/components/Employee/Compensation/management/Compensation.js +30 -23
- package/dist/components/Employee/Compensation/management/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.d.ts +4 -2
- package/dist/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.js +55 -46
- package/dist/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.d.ts +4 -2
- package/dist/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.js +37 -21
- package/dist/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.d.ts +4 -1
- package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.js +122 -102
- package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationComponents.js +44 -22
- package/dist/components/Employee/Compensation/management/CompensationComponents.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.d.ts +4 -2
- package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.js +29 -26
- package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.d.ts +4 -2
- package/dist/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.js +74 -46
- package/dist/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationEditPendingJobForm/CompensationEditPendingJobForm.d.ts +4 -2
- package/dist/components/Employee/Compensation/management/CompensationEditPendingJobForm/CompensationEditPendingJobForm.js +62 -53
- package/dist/components/Employee/Compensation/management/CompensationEditPendingJobForm/CompensationEditPendingJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js +32 -33
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.d.ts +4 -2
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js +46 -45
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.d.ts +12 -2
- package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.js +32 -35
- package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.test.d.ts +1 -0
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js +2 -3
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js +20 -20
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
- package/dist/components/Employee/Dashboard/Dashboard.d.ts +1 -1
- package/dist/components/Employee/Dashboard/Dashboard.js +50 -34
- package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Employee/Deductions/management/Deductions.d.ts +1 -1
- package/dist/components/Employee/Deductions/management/Deductions.js +30 -23
- package/dist/components/Employee/Deductions/management/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.d.ts +4 -1
- package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.js +61 -54
- package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.js.map +1 -1
- package/dist/components/Employee/Deductions/management/DeductionsComponents.js +27 -19
- package/dist/components/Employee/Deductions/management/DeductionsComponents.js.map +1 -1
- package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.d.ts +1 -1
- package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.js +40 -33
- package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/Deductions.d.ts +1 -1
- package/dist/components/Employee/Deductions/onboarding/Deductions.js +28 -19
- package/dist/components/Employee/Deductions/onboarding/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/deductionsContextualComponents.js +39 -38
- package/dist/components/Employee/Deductions/onboarding/deductionsContextualComponents.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/stateMachine.d.ts +12 -2
- package/dist/components/Employee/Deductions/onboarding/stateMachine.js +18 -20
- package/dist/components/Employee/Deductions/onboarding/stateMachine.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/stateMachine.test.d.ts +1 -0
- package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.d.ts +3 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js +17 -17
- package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.d.ts +4 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.js +48 -44
- package/dist/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.d.ts +3 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.js +34 -32
- package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.js.map +1 -1
- package/dist/components/Employee/Documents/management/DocumentManager.js +6 -7
- package/dist/components/Employee/Documents/management/DocumentManager.js.map +1 -1
- package/dist/components/Employee/Documents/management/Documents.d.ts +1 -1
- package/dist/components/Employee/Documents/management/Documents.js +25 -18
- package/dist/components/Employee/Documents/management/Documents.js.map +1 -1
- package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.d.ts +3 -0
- package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.js +24 -18
- package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.js.map +1 -1
- package/dist/components/Employee/Documents/management/DocumentsComponents.js +22 -14
- package/dist/components/Employee/Documents/management/DocumentsComponents.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js +4 -5
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js +10 -13
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js +5 -6
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.module.scss.js +8 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.module.scss.js.map +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +5 -3
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js +22 -21
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +6 -6
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js +5 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js +3 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.d.ts +12 -2
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.js +35 -37
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.test.d.ts +1 -0
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.js +6 -7
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js +11 -12
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.d.ts +3 -2
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js +53 -43
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js +1 -1
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js.map +1 -1
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.d.ts +1 -1
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.js +56 -40
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.d.ts +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js +28 -21
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.d.ts +3 -0
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.js +31 -25
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesComponents.js +27 -13
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesComponents.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.d.ts +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js +53 -40
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.d.ts +1 -1
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js +46 -30
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.d.ts +3 -1
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js +15 -14
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddress.d.ts +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js +27 -20
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.d.ts +3 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.js +28 -22
- package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressComponents.js +26 -12
- package/dist/components/Employee/HomeAddress/management/HomeAddressComponents.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressEditForm.d.ts +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressEditForm.js +39 -22
- package/dist/components/Employee/HomeAddress/management/HomeAddressEditForm.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +4 -4
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.d.ts +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js +37 -29
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.js +29 -23
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodCard.d.ts +4 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodCard.js +81 -68
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodCard.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.js +28 -21
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js +26 -20
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.d.ts +3 -1
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.js +134 -98
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.module.scss.js +8 -0
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.module.scss.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.d.ts +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js +54 -27
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.js +17 -9
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.d.ts +4 -2
- package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js +28 -21
- package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.d.ts +3 -1
- package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.js +105 -82
- package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.js.map +1 -1
- package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.d.ts +4 -1
- package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js +68 -65
- package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js.map +1 -1
- package/dist/components/Employee/Profile/management/Profile.d.ts +1 -1
- package/dist/components/Employee/Profile/management/Profile.js +31 -24
- package/dist/components/Employee/Profile/management/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.d.ts +4 -1
- package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js +25 -26
- package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js.map +1 -1
- package/dist/components/Employee/Profile/management/ProfileComponents.js +27 -13
- package/dist/components/Employee/Profile/management/ProfileComponents.js.map +1 -1
- package/dist/components/Employee/Profile/management/ProfileEditForm.d.ts +1 -1
- package/dist/components/Employee/Profile/management/ProfileEditForm.js +62 -44
- package/dist/components/Employee/Profile/management/ProfileEditForm.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/AdminProfile.d.ts +1 -1
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js +104 -101
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/EmployeeProfile.d.ts +1 -1
- package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js +45 -44
- package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/Profile.d.ts +1 -1
- package/dist/components/Employee/Profile/onboarding/Profile.js +37 -15
- package/dist/components/Employee/Profile/onboarding/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js +18 -15
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxes.d.ts +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxes.js +29 -22
- package/dist/components/Employee/StateTaxes/management/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.d.ts +4 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.js +33 -27
- package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxesComponents.js +33 -19
- package/dist/components/Employee/StateTaxes/management/StateTaxesComponents.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.d.ts +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js +46 -33
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js.map +1 -1
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.d.ts +1 -1
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js +47 -31
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.d.ts +3 -1
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js +19 -18
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.js +44 -45
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +23 -22
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +27 -27
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +9 -10
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +2 -3
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddress.d.ts +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js +27 -20
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.d.ts +3 -0
- package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.js +30 -24
- package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressComponents.js +26 -12
- package/dist/components/Employee/WorkAddress/management/WorkAddressComponents.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressEditForm.d.ts +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressEditForm.js +40 -23
- package/dist/components/Employee/WorkAddress/management/WorkAddressEditForm.js.map +1 -1
- package/dist/components/Flow/Flow.js +1 -1
- package/dist/components/Flow/FlowHeader.js +3 -4
- package/dist/components/Flow/FlowHeader.js.map +1 -1
- package/dist/components/Flow/useFlow.d.ts +7 -1
- package/dist/components/Flow/useFlow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +125 -102
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/index.d.ts +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +7 -8
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.d.ts +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +52 -50
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestsComponents.d.ts +3 -0
- package/dist/components/InformationRequests/InformationRequestsComponents.js +12 -10
- package/dist/components/InformationRequests/InformationRequestsComponents.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +37 -37
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +8 -9
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +5 -5
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +10 -12
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +0 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +7 -8
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +94 -92
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.d.ts +3 -3
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +54 -50
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +80 -69
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +15 -15
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +20 -18
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +138 -136
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +10 -12
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +103 -97
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +4 -4
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +2 -3
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.d.ts +1 -1
- package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js +1 -9
- package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +2 -3
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +1 -2
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +2 -3
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +10 -8
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js +2 -3
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js.map +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyList.d.ts +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyList.js +71 -70
- package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
- 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 +34 -36
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +4 -4
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js +24 -25
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +6 -0
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +29 -28
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/LocaleProvider/useLocale.d.ts +1 -9
- package/dist/contexts/LocaleProvider/useLocale.js +5 -15
- package/dist/contexts/LocaleProvider/useLocale.js.map +1 -1
- package/dist/contexts/NonceProvider/index.d.ts +1 -0
- package/dist/contexts/NonceProvider/useNonce.d.ts +37 -0
- package/dist/contexts/NonceProvider/useNonce.js +7 -0
- package/dist/contexts/NonceProvider/useNonce.js.map +1 -0
- package/dist/contexts/ThemeProvider/ThemeProvider.js +25 -24
- package/dist/contexts/ThemeProvider/ThemeProvider.js.map +1 -1
- package/dist/contexts/index.d.ts +1 -0
- package/dist/hooks/useDateRangeFilter/useDateRangeFilter.d.ts +12 -7
- package/dist/hooks/useDateRangeFilter/useDateRangeFilter.js +25 -21
- package/dist/hooks/useDateRangeFilter/useDateRangeFilter.js.map +1 -1
- package/dist/i18n/I18n.js +16 -5
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.StateTaxes.json.js +6 -4
- package/dist/i18n/en/Company.StateTaxes.json.js.map +1 -1
- package/dist/i18n/en/Contractor.BankAccountFields.json.js +26 -0
- package/dist/i18n/en/Contractor.BankAccountFields.json.js.map +1 -0
- package/dist/i18n/en/Contractor.ContractorList.json.js +14 -12
- package/dist/i18n/en/Contractor.ContractorList.json.js.map +1 -1
- package/dist/i18n/en/Contractor.Dashboard.json.js +14 -0
- package/dist/i18n/en/Contractor.Dashboard.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Management.Address.json.js +16 -0
- package/dist/i18n/en/Contractor.Management.Address.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Management.Compensation.json.js +26 -0
- package/dist/i18n/en/Contractor.Management.Compensation.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Management.Documents.json.js +24 -0
- package/dist/i18n/en/Contractor.Management.Documents.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Management.PaymentMethod.json.js +34 -0
- package/dist/i18n/en/Contractor.Management.PaymentMethod.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Management.Profile.json.js +26 -0
- package/dist/i18n/en/Contractor.Management.Profile.json.js.map +1 -0
- package/dist/i18n/en/Contractor.ManagementContractorList.json.js +60 -0
- package/dist/i18n/en/Contractor.ManagementContractorList.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Payments.HistoricalPaymentAmounts.json.js +36 -0
- package/dist/i18n/en/Contractor.Payments.HistoricalPaymentAmounts.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Payments.HistoricalPaymentContractors.json.js +18 -0
- package/dist/i18n/en/Contractor.Payments.HistoricalPaymentContractors.json.js.map +1 -0
- package/dist/i18n/en/Contractor.SelectContractors.json.js +20 -0
- package/dist/i18n/en/Contractor.SelectContractors.json.js.map +1 -0
- package/dist/i18n/en/Contractor.SignatureForm.json.js +5 -5
- package/dist/i18n/en/Employee.Management.PaymentMethodBankForm.json.js +18 -16
- package/dist/i18n/en/Employee.Management.PaymentMethodBankForm.json.js.map +1 -1
- package/dist/i18n/en/Employee.Management.PaymentMethodSplitForm.json.js +2 -2
- package/dist/i18n/en/Employee.ManagementEmployeeList.json.js +18 -20
- package/dist/i18n/en/Employee.ManagementEmployeeList.json.js.map +1 -1
- package/dist/i18n/en/Employee.PaymentMethod.json.js +74 -72
- package/dist/i18n/en/Employee.PaymentMethod.json.js.map +1 -1
- package/dist/i18n/en/Employee.SplitPaymentsFormBody.json.js +2 -2
- package/dist/i18n/en/Payroll.Common.json.js +1 -1
- package/dist/i18n/en/Payroll.PayrollHistory.json.js +8 -8
- package/dist/i18n/en/Payroll.PayrollList.json.js +23 -23
- package/dist/i18n/types.d.ts +669 -21
- package/dist/index.d.ts +7 -5
- package/dist/index.js +95 -88
- package/dist/index.js.map +1 -1
- package/dist/models/external.d.ts +4 -0
- package/dist/partner-hook-utils/form/SDKFormProvider.js +39 -24
- package/dist/partner-hook-utils/form/SDKFormProvider.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js +12 -15
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +16 -19
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js +13 -16
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SelectHookField.js +12 -15
- package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js +18 -21
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js +9 -12
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/preprocessors.d.ts +2 -2
- package/dist/partner-hook-utils/form/preprocessors.js +8 -7
- package/dist/partner-hook-utils/form/preprocessors.js.map +1 -1
- package/dist/partner-hook-utils/form/preprocessors.test.d.ts +1 -0
- package/dist/shared/constants.d.ts +72 -0
- package/dist/shared/constants.js +106 -73
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/docs/guides/endpoint-inventory.json +237 -4
- package/package.json +35 -31
- package/dist/components/Company/StateTaxes/StateTaxesForm/applicableIf.js.map +0 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/rhfKey.d.ts +0 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/rhfKey.js +0 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/rhfKey.js.map +0 -1
- package/dist/components/Contractor/Address/Address.js +0 -99
- package/dist/components/Contractor/Address/Address.js.map +0 -1
- package/dist/components/Contractor/Address/index.d.ts +0 -2
- package/dist/components/Contractor/ContractorList/index.js +0 -141
- package/dist/components/Contractor/ContractorList/index.js.map +0 -1
- package/dist/components/Contractor/ContractorList/useContractorList.d.ts +0 -18
- package/dist/components/Contractor/ContractorList/useContractorList.js +0 -15
- package/dist/components/Contractor/ContractorList/useContractorList.js.map +0 -1
- package/dist/components/Contractor/Documents/DocumentSigner/DocumentSigner.js.map +0 -1
- package/dist/components/Contractor/Documents/DocumentSigner/documentSignerStateMachine.js.map +0 -1
- package/dist/components/Contractor/Documents/DocumentSigner/stateMachine.js +0 -44
- package/dist/components/Contractor/Documents/DocumentSigner/stateMachine.js.map +0 -1
- package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.js +0 -84
- package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.js.map +0 -1
- package/dist/components/Contractor/Documents/DocumentsList/index.d.ts +0 -2
- package/dist/components/Contractor/Documents/DocumentsList/useContractorDocumentsList/useContractorDocumentsList.js.map +0 -1
- package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js.map +0 -1
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/contractorSignatureFormSchema.js.map +0 -1
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/fields.js.map +0 -1
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.js.map +0 -1
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.js.map +0 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +0 -115
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +0 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js.map +0 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.d.ts +0 -12
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +0 -123
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +0 -1
- package/dist/components/Contractor/Payments/CreatePayment/helpers.js.map +0 -1
- package/dist/components/Contractor/Profile/BusinessSelfOnboardingProfile.js.map +0 -1
- package/dist/components/Contractor/Profile/ContractorProfile.js.map +0 -1
- package/dist/components/Contractor/Profile/IndividualSelfOnboardingProfile.js.map +0 -1
- package/dist/components/Contractor/Profile/SelfOnboardingContractorProfile.js +0 -40
- package/dist/components/Contractor/Profile/SelfOnboardingContractorProfile.js.map +0 -1
- package/dist/components/Contractor/Profile/index.d.ts +0 -1
- /package/dist/components/Company/StateTaxes/{StateTaxesForm/applicableIf.test.d.ts → TaxRateManagement/toHistoryRows.test.d.ts} +0 -0
- /package/dist/components/Company/StateTaxes/{StateTaxesForm → shared}/applicableIf.js +0 -0
- /package/dist/components/{Contractor/Documents/SignatureForm/useContractorSignatureForm/contractorSignatureFormSchema.test.d.ts → Company/StateTaxes/shared/applicableIf.test.d.ts} +0 -0
- /package/dist/components/{Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.test.d.ts → Company/StateTaxes/shared/rhfKey.test.d.ts} +0 -0
- /package/dist/components/Contractor/Address/{Address.module.scss.js → onboarding/Address.module.scss.js} +0 -0
- /package/dist/components/Contractor/Address/{Address.module.scss.js.map → onboarding/Address.module.scss.js.map} +0 -0
- /package/dist/components/Contractor/Documents/{DocumentSigner → onboarding/DocumentSigner}/index.d.ts +0 -0
- /package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/SignatureForm.module.scss.js +0 -0
- /package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/SignatureForm.module.scss.js.map +0 -0
- /package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/index.d.ts +0 -0
- /package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/useContractorSignatureForm/index.d.ts +0 -0
- /package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/useContractorSignatureForm/w9Fields.d.ts +0 -0
- /package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/useContractorSignatureForm/w9Fields.js +0 -0
- /package/dist/components/Contractor/Documents/{DocumentsList → shared}/useContractorDocumentsList/index.d.ts +0 -0
- /package/dist/components/Contractor/Documents/{DocumentsList → shared}/useContractorDocumentsList/useContractorDocumentsList.d.ts +0 -0
- /package/dist/components/Contractor/Documents/{DocumentsList → shared}/useContractorDocumentsList/useContractorDocumentsList.js +0 -0
- /package/dist/components/Contractor/PaymentMethod/{PaymentMethod.module.scss.js → onboarding/PaymentMethod.module.scss.js} +0 -0
- /package/dist/components/Contractor/PaymentMethod/{PaymentMethod.module.scss.js.map → onboarding/PaymentMethod.module.scss.js.map} +0 -0
- /package/dist/components/Contractor/Profile/{ContractorProfile.module.scss.js → onboarding/ContractorProfile.module.scss.js} +0 -0
- /package/dist/components/Contractor/Profile/{ContractorProfile.module.scss.js.map → onboarding/ContractorProfile.module.scss.js.map} +0 -0
- /package/dist/components/Contractor/{Payments/CreatePayment → shared}/helpers.d.ts +0 -0
package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCompensationForm.js","sources":["../../../../../../src/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.tsx"],"sourcesContent":["import { useEffect, useMemo, useRef } from 'react'\nimport type { ComponentType } from 'react'\nimport { useForm, useWatch } from 'react-hook-form'\nimport type { UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport type { Compensation, PaymentUnit } from '@gusto/embedded-api/models/components/compensation'\nimport type { Job } from '@gusto/embedded-api/models/components/job'\nimport type { FlsaStatusType } from '@gusto/embedded-api/models/components/flsastatustype'\nimport type { MinimumWage } from '@gusto/embedded-api/models/components/minimumwage'\nimport { useJobsAndCompensationsGetJobs } from '@gusto/embedded-api/react-query/jobsAndCompensationsGetJobs'\nimport { GetV1EmployeesEmployeeIdJobsQueryParamInclude } from '@gusto/embedded-api/models/operations/getv1employeesemployeeidjobs'\nimport { useJobsAndCompensationsCreateCompensationMutation } from '@gusto/embedded-api/react-query/jobsAndCompensationsCreateCompensation'\nimport { useJobsAndCompensationsUpdateCompensationMutation } from '@gusto/embedded-api/react-query/jobsAndCompensationsUpdateCompensation'\nimport { useLocationsGetMinimumWages } from '@gusto/embedded-api/react-query/locationsGetMinimumWages'\nimport { useEmployeeAddressesGetWorkAddresses } from '@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses'\nimport { useEmployeesGet } from '@gusto/embedded-api/react-query/employeesGet'\nimport {\n createCompensationSchema,\n type CompensationOptionalFieldsToRequire,\n type CompensationFormData,\n type CompensationFormOutputs,\n} from './compensationSchema'\nimport {\n TitleField,\n FlsaStatusField,\n RateField,\n PaymentUnitField,\n AdjustForMinimumWageField,\n MinimumWageIdField,\n EffectiveDateField,\n} from './fields'\nimport type {\n TitleFieldProps,\n FlsaStatusFieldProps,\n RateFieldProps,\n PaymentUnitFieldProps,\n AdjustForMinimumWageFieldProps,\n MinimumWageIdFieldProps,\n EffectiveDateFieldProps,\n} from './fields'\nimport { withOptions } from '@/partner-hook-utils/form/withOptions'\nimport { withFlags } from '@/partner-hook-utils/form/withFlags'\nimport { createGetFormSubmissionValues } from '@/partner-hook-utils/form/getFormSubmissionValues'\nimport { useDeriveFieldsMetadata } from '@/partner-hook-utils/form/useDeriveFieldsMetadata'\nimport { useHookFormInternals } from '@/partner-hook-utils/form/useHookFormInternals'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type {\n BaseFormHookReady,\n FieldMetadata,\n FieldsMetadata,\n HookLoadingResult,\n HookSubmitResult,\n} from '@/partner-hook-utils/types'\nimport { FlsaStatus, PAY_PERIODS, TIP_CREDITS_UNSUPPORTED_STATES } from '@/shared/constants'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { SDKInternalError } from '@/types/sdkError'\nimport { addDays, formatDateToStringDate } from '@/helpers/dateFormatting'\n\n/**\n * Optional values supplied to {@link useCompensationForm}'s `actions.onSubmit` at submit time.\n *\n * @remarks\n * Use these to override hook-construction props when an ID isn't known at\n * mount — most commonly the **onboarding stub-fill** chain, where `useJobForm`\n * creates the parent job and returns the auto-created stub compensation, and\n * the IDs and version are threaded into this hook's `onSubmit` to PUT the\n * stub.\n *\n * @public\n */\nexport interface CompensationSubmitOptions {\n /** Override jobId — required when creating a compensation if not configured at hook construction (e.g. when the parent job was just created in the same submit chain). */\n jobId?: string\n /** Override compensationId — when present, forces update (PUT) routing regardless of hook construction. */\n compensationId?: string\n /**\n * Compensation version for optimistic locking on PUT. Required when forcing\n * update routing post-create (e.g. updating the auto-created stub returned\n * from `POST /v1/employees/:id/jobs`). When omitted, the hook reads the\n * version from its cached `currentCompensation`.\n */\n compensationVersion?: string\n /**\n * Supply `effectiveDate` at submit time. When `withEffectiveDateField`\n * is `true`, this overrides the form's value. When `withEffectiveDateField`\n * is `false`, this is the only way to put `effective_date` on the wire —\n * the form value is not read in that mode (matching the options-only\n * convention of `useWorkAddressForm` / `useHomeAddressForm` / `useJobForm`).\n */\n effectiveDate?: string\n}\n\n/**\n * Configuration options for {@link useCompensationForm}.\n *\n * @remarks\n * Presence or absence of `compensationId` selects the API verb — see the\n * `compensationId` field description. `employeeId` is optional so the hook\n * can be composed alongside an employee-creation step. `jobId` is optional in\n * update mode (derived from the loaded compensation) and required in create\n * mode (scopes the POST); supply it at submit time via\n * {@link CompensationSubmitOptions.jobId} when the parent job is created in\n * the same submit chain.\n *\n * @public\n */\nexport interface UseCompensationFormProps {\n /** UUID of the employee whose compensation is being created or edited. Drives data fetching for derived helpers (jobs list, work address, minimum wages). May be omitted when composing alongside an employee-creation step. */\n employeeId?: string\n /** The parent job's UUID. Required in create mode (scopes `POST /v1/jobs/:jobId/compensations`). Optional in update mode — the parent job is derived from the loaded compensation. */\n jobId?: string\n /** Present → update mode (PUT /v1/compensations/:id). Omitted → create mode (POST /v1/jobs/:jobId/compensations). */\n compensationId?: string\n /** Override fields that are optional on a given mode to be required. See {@link CompensationOptionalFieldsToRequire}. */\n optionalFieldsToRequire?: CompensationOptionalFieldsToRequire\n /** Pre-fill form values. Server data takes precedence on update mode. */\n defaultValues?: Partial<CompensationFormData>\n /** Passed through to react-hook-form. Defaults to `'onSubmit'`. */\n validationMode?: UseFormProps['mode']\n /** Auto-focus the first invalid field on submit. Set to `false` when using `composeSubmitHandler` so submit-time focus is coordinated across multiple forms. Defaults to `true`. */\n shouldFocusError?: boolean\n /**\n * When `false`, hides `Fields.EffectiveDate` (becomes `undefined`) and\n * removes `effectiveDate` from schema validation. In this mode the hook\n * does not read any form value at submit time — `effective_date` is\n * omitted from the request body unless explicitly supplied via\n * {@link CompensationSubmitOptions.effectiveDate}. This matches the\n * options-only convention of other form hooks, and means the\n * `willDeleteSecondaryJobs` carve-out's form-state side effects do not\n * leak onto the wire (there is no field to render them in anyway).\n * Defaults to `true`.\n */\n withEffectiveDateField?: boolean\n}\n\n/**\n * Pre-bound field components exposed on `useCompensationForm().form.Fields`.\n *\n * @remarks\n * Each property is either the field component or `undefined`. A field is\n * `undefined` when conditions for rendering it aren't met — see each member\n * for its visibility rule. Always null-check conditional fields (e.g.\n * `{Fields.FlsaStatus && <Fields.FlsaStatus ... />}`) before rendering.\n *\n * @public\n */\nexport interface CompensationFormFields {\n /** Bound to `title`. Title text input. Always available. Optional in both modes unless `optionalFieldsToRequire` requires it. */\n Title: ComponentType<TitleFieldProps>\n /** Bound to `flsaStatus`. FLSA classification select. `undefined` when the status is not user-editable (e.g. secondary jobs that must match the primary). */\n FlsaStatus: ComponentType<FlsaStatusFieldProps> | undefined\n /** Bound to `rate`. Compensation amount input. `undefined` for commission-only FLSA statuses, which don't accept a partner-supplied rate. */\n Rate: ComponentType<RateFieldProps> | undefined\n /** Bound to `paymentUnit`. Payment unit select. `undefined` for commission-only FLSA statuses (the hook forces `paymentUnit=Year`). */\n PaymentUnit: ComponentType<PaymentUnitFieldProps> | undefined\n /** Bound to `adjustForMinimumWage`. Minimum-wage adjustment checkbox. `undefined` unless `flsaStatus === Nonexempt`, the employee's work location has minimum wages, and the state supports tip credits. */\n AdjustForMinimumWage: ComponentType<AdjustForMinimumWageFieldProps> | undefined\n /** Bound to `minimumWageId`. Minimum-wage selection. `undefined` unless `Fields.AdjustForMinimumWage` is rendered and checked. */\n MinimumWageId: ComponentType<MinimumWageIdFieldProps> | undefined\n /** Bound to `effectiveDate`. Effective-date picker. `undefined` when `withEffectiveDateField: false`; supply the value via `CompensationSubmitOptions.effectiveDate` in that mode. */\n EffectiveDate: ComponentType<EffectiveDateFieldProps> | undefined\n}\n\n/**\n * Ready-state shape returned by {@link useCompensationForm} once data has loaded.\n *\n * @remarks\n * Discriminated by `isLoading: false`. Extends {@link BaseFormHookReady} with\n * the compensation-specific `data`, `status`, `actions`, and `form.Fields`\n * shape. Static, entity-derived values live under `data.*`; reactive values\n * that flip with form input live under `status.*`.\n *\n * @public\n */\nexport interface UseCompensationFormReady extends BaseFormHookReady<\n CompensationFieldsMetadata,\n CompensationFormData,\n CompensationFormFields\n> {\n /** Compensation-specific data payload: the loaded compensation, the parent job, available minimum wages, and effective-date bounds. */\n data: {\n /** The compensation row loaded for update; `null` in create mode. */\n compensation: Compensation | null\n /** The parent job. In update mode it's derived from the loaded compensation; in create mode it's looked up by `jobId`. `null` if neither resolves. */\n currentJob: Job | null\n /** Minimum wages available at the employee's active work location. Empty when no location is set or no minimums are defined. */\n minimumWages: MinimumWage[]\n /** Lower bound for `effectiveDate` (typically the parent job's hire date). */\n minimumEffectiveDate: string | null\n /** Upper bound for `effectiveDate` — the next scheduled future compensation's effective date, when one exists. */\n maximumEffectiveDate: string | null\n /** True when at least one future-dated compensation already exists for this job. */\n hasPendingFutureCompensation: boolean\n }\n /** Submission state and reactive flags derived from current form input. `isPending` is `true` while a create/update mutation is in flight; `mode` reflects whether the next submit will create or update; the `show*Alert` flags drive FLSA-specific inline warnings. */\n status: {\n /** `true` while a create or update mutation is in flight. */\n isPending: boolean\n /** Reflects whether the next submit will POST a new compensation or PUT an existing one. */\n mode: 'create' | 'update'\n /**\n * True when submitting the form right now would delete the employee's\n * secondary jobs server-side (the \"carve-out\" branch). Reactive:\n * derived from the current `flsaStatus` form value, the loaded\n * compensation, and the other-jobs count, so this flips as you change\n * inputs.\n *\n * Conditions: update mode, the loaded compensation is Nonexempt, the\n * form's `flsaStatus` has been changed to a non-Nonexempt value, and\n * the employee has at least one secondary job.\n *\n * While this flag is true the hook also takes the `effectiveDate`\n * field over: it forces the form value to today (so submits route\n * through a PUT that immediately deletes secondaries) and exposes\n * `fieldsMetadata.effectiveDate.isDisabled = true` so `Fields.EffectiveDate`\n * renders as disabled. On revert (FLSA back to Nonexempt) the prior\n * `effectiveDate` is restored. Render an inline warning keyed off\n * this flag — no separate confirmation step is needed.\n */\n willDeleteSecondaryJobs: boolean\n /**\n * True when the current `flsaStatus` is `COMMISSION_ONLY_EXEMPT`\n * (Commission Only/No Overtime). Render the federal-minimum-pay\n * warning alert when this flag is true. While this flag is true,\n * `Fields.Rate` and `Fields.PaymentUnit` are also `undefined` (the\n * hook forces `rate=0`, `paymentUnit=YEAR` on the form values).\n */\n showCommissionFederalMinimumPayAlert: boolean\n /**\n * True when the current `flsaStatus` is `COMMISSION_ONLY_NONEXEMPT`\n * (Commission Only/Eligible for overtime). Render the local-minimum-wage\n * warning alert when this flag is true. While this flag is true,\n * `Fields.Rate` and `Fields.PaymentUnit` are also `undefined` (the\n * hook forces `rate=0`, `paymentUnit=YEAR` on the form values).\n */\n showCommissionMinimumWageAlert: boolean\n /**\n * True when the current `flsaStatus` is `OWNER` (Owner's draw). Render\n * an informational alert noting that the IRS requires S-corp owners to\n * pay themselves a reasonable salary for similar work before taking\n * distributions.\n */\n showOwnerSalaryAlert: boolean\n }\n /** Submit actions exposed by the hook. */\n actions: {\n /** Validates the form, runs the appropriate create/update mutation, and resolves to a {@link HookSubmitResult} containing the saved compensation. Resolves to `undefined` on validation failure or mutation error. Accepts {@link CompensationSubmitOptions} for threading IDs/version into the onboarding stub-fill chain. */\n onSubmit: (\n options?: CompensationSubmitOptions,\n ) => Promise<HookSubmitResult<Compensation> | undefined>\n }\n}\n\nfunction resolveCompAndJob(\n jobs: Job[] | undefined,\n compensationId: string | undefined,\n jobId: string | undefined,\n): { compensation: Compensation | null; job: Job | null } {\n if (!jobs) return { compensation: null, job: null }\n if (compensationId) {\n for (const job of jobs) {\n const compensation = job.compensations?.find(c => c.uuid === compensationId)\n if (compensation) return { compensation, job }\n }\n // If the comp isn't in any job's compensations list, still try to resolve\n // the job by jobId so callers can check job metadata (e.g. job.primary).\n const fallbackJob = jobId ? (jobs.find(j => j.uuid === jobId) ?? null) : null\n return { compensation: null, job: fallbackJob }\n }\n if (jobId) return { compensation: null, job: jobs.find(j => j.uuid === jobId) ?? null }\n return { compensation: null, job: null }\n}\n\nfunction findPrimaryFlsaStatus(jobs: Job[] | undefined): FlsaStatusType | null {\n if (!jobs) return null\n for (const job of jobs) {\n if (!job.primary) continue\n const compensation = job.compensations?.find(c => c.uuid === job.currentCompensationUuid)\n if (compensation?.flsaStatus) return compensation.flsaStatus\n }\n return null\n}\n\nfunction findFutureCompensations(job: Job | null): Compensation[] {\n if (!job?.compensations) return []\n const today = todayISO()\n return job.compensations.filter(c => c.effectiveDate !== undefined && c.effectiveDate > today)\n}\n\nfunction earliestEffectiveDate(comps: Compensation[]): string | null {\n if (comps.length === 0) return null\n return comps.reduce<string | null>((min, c) => {\n const d = c.effectiveDate\n if (!d) return min\n if (!min || d < min) return d\n return min\n }, null)\n}\n\nconst flsaStatusEntries: FlsaStatusType[] = [\n FlsaStatus.EXEMPT,\n FlsaStatus.SALARIED_NONEXEMPT,\n FlsaStatus.NONEXEMPT,\n FlsaStatus.OWNER,\n FlsaStatus.COMMISSION_ONLY_EXEMPT,\n FlsaStatus.COMMISSION_ONLY_NONEXEMPT,\n]\n\nconst flsaOptions = flsaStatusEntries.map(status => ({ value: status, label: status }))\n\nconst paymentUnitEntries: PaymentUnit[] = [\n PAY_PERIODS.HOUR,\n PAY_PERIODS.WEEK,\n PAY_PERIODS.MONTH,\n PAY_PERIODS.YEAR,\n PAY_PERIODS.PAYCHECK,\n]\n\nconst paymentUnitOptions = paymentUnitEntries.map(unit => ({ value: unit, label: unit }))\n\nfunction todayISO(): string {\n return new Date().toISOString().split('T')[0]!\n}\n\n/** @internal */\nfunction buildCompensationFieldsMetadata(\n base: Record<keyof CompensationFormData, FieldMetadata>,\n {\n willDeleteSecondaryJobs,\n isCreateMode,\n isCommissionOnly,\n isOwner,\n isAdjustMinimumWageEnabled,\n effectiveDateMinDate,\n maximumEffectiveDate,\n minimumWageOptions,\n minimumWages,\n }: {\n willDeleteSecondaryJobs: boolean\n isCreateMode: boolean\n isCommissionOnly: boolean\n isOwner: boolean\n isAdjustMinimumWageEnabled: boolean\n effectiveDateMinDate: string | null\n maximumEffectiveDate: string | null\n minimumWageOptions: { value: string; label: string }[]\n minimumWages: MinimumWage[]\n },\n) {\n return {\n title: base.title,\n effectiveDate: withFlags(base.effectiveDate, {\n isDisabled: willDeleteSecondaryJobs && !isCreateMode,\n minDate: effectiveDateMinDate,\n maxDate: maximumEffectiveDate,\n }),\n flsaStatus: withOptions<FlsaStatusType>(base.flsaStatus, flsaOptions, flsaStatusEntries),\n rate: withFlags(base.rate, { isDisabled: isCommissionOnly }),\n paymentUnit: withOptions<PaymentUnit>(\n withFlags(base.paymentUnit, { isDisabled: isOwner || isCommissionOnly }),\n paymentUnitOptions,\n paymentUnitEntries,\n ),\n adjustForMinimumWage: withFlags(base.adjustForMinimumWage, {\n isDisabled: !isAdjustMinimumWageEnabled,\n }),\n minimumWageId: withOptions<MinimumWage>(base.minimumWageId, minimumWageOptions, minimumWages),\n } satisfies FieldsMetadata\n}\n\n/**\n * Headless hook for creating or updating a compensation row on a job — FLSA classification, pay rate, payment unit, effective date, and optional minimum-wage adjustment.\n *\n * @remarks\n * Companion hook to `useJobForm`. Jobs and their compensations are separate\n * entities in the Gusto API and this hook focuses exclusively on the\n * compensation side. Presence of `compensationId` selects the verb:\n *\n * | Hook config / submit options | Mode | API call |\n * | ---------------------------- | ---- | -------- |\n * | `{ jobId, compensationId }` | update | `PUT /v1/compensations/:compensationId` (with `version`) |\n * | `{ jobId }` (no `compensationId`) | create | `POST /v1/jobs/:jobId/compensations` |\n * | `{ employeeId }` + submit `{ jobId, compensationId, compensationVersion }` | update | `PUT /v1/compensations/:compensationId` (with the supplied `version`) |\n * | `{ employeeId }` + submit `{ jobId }` (no `compensationId`) | create | `POST /v1/jobs/:options.jobId/compensations` |\n *\n * Use the submit-options form for the **onboarding stub-fill** chain: after\n * `useJobForm.actions.onSubmit()` creates a job, capture the auto-created\n * compensation's UUID and version from the response, and pass them as\n * `{ jobId, compensationId, compensationVersion }` to this hook's `onSubmit`\n * to PUT the stub.\n *\n * The hook exposes several derived helpers for driving UX — static\n * entity-derived values under `data.*` (effective-date bounds, pending\n * future compensations) and reactive flags under `status.*` (the\n * `willDeleteSecondaryJobs` carve-out, plus FLSA-specific alerts for\n * commission-only and owner classifications). When\n * `willDeleteSecondaryJobs` is `true` in update mode, the hook also locks\n * the `effectiveDate` field (forces to today, renders disabled) until the\n * FLSA selection is reverted.\n *\n * @param input - {@link UseCompensationFormProps} — `employeeId`, `jobId`, `compensationId` (toggle create/update), required-field overrides, default values, and which fields the hook renders.\n * @returns A {@link HookLoadingResult} while data is loading, or a {@link UseCompensationFormReady} once ready.\n * @public\n *\n * @example\n * ```tsx\n * import { useCompensationForm, SDKFormProvider } from '@gusto/embedded-react-sdk'\n *\n * function CompensationForm({ employeeId, jobId }: { employeeId: string; jobId: string }) {\n * const comp = useCompensationForm({ employeeId, jobId })\n * if (comp.isLoading) return null\n *\n * const { Fields } = comp.form\n * return (\n * <form onSubmit={e => { e.preventDefault(); comp.actions.onSubmit() }}>\n * <SDKFormProvider formHookResult={comp}>\n * {Fields.FlsaStatus && <Fields.FlsaStatus label=\"Employee type\" />}\n * <Fields.Rate label=\"Compensation amount\" />\n * <Fields.PaymentUnit label=\"Payment unit\" />\n * {Fields.EffectiveDate && <Fields.EffectiveDate label=\"Effective date\" />}\n * </SDKFormProvider>\n * {comp.status.willDeleteSecondaryJobs && (\n * <p>Saving will remove this employee's secondary jobs.</p>\n * )}\n * <button type=\"submit\" disabled={comp.status.isPending}>Save</button>\n * </form>\n * )\n * }\n * ```\n */\nexport function useCompensationForm({\n employeeId,\n jobId,\n compensationId,\n optionalFieldsToRequire,\n defaultValues: partnerDefaults,\n validationMode = 'onSubmit',\n shouldFocusError = true,\n withEffectiveDateField = true,\n}: UseCompensationFormProps): HookLoadingResult | UseCompensationFormReady {\n const jobsQuery = useJobsAndCompensationsGetJobs(\n {\n employeeId: employeeId ?? '',\n // Fetch all effective-dated compensations when editing an existing one so\n // resolveCompAndJob can find the target comp (future-dated comps are\n // omitted from the default response, which only returns the current comp).\n include: compensationId\n ? GetV1EmployeesEmployeeIdJobsQueryParamInclude.AllCompensations\n : undefined,\n },\n { enabled: !!employeeId },\n )\n const addressesQuery = useEmployeeAddressesGetWorkAddresses(\n { employeeId: employeeId ?? '' },\n { enabled: !!employeeId },\n )\n const employeeQuery = useEmployeesGet({ employeeId: employeeId ?? '' }, { enabled: !!employeeId })\n\n const employeeJobs = jobsQuery.data?.jobs\n const workAddresses = addressesQuery.data?.employeeWorkAddressesList\n const currentWorkAddress = workAddresses?.find(address => address.active)\n const locationUuid = currentWorkAddress?.locationUuid\n const employee = employeeQuery.data?.employee\n\n const minWagesQuery = useLocationsGetMinimumWages(\n { locationUuid: locationUuid ?? '' },\n { enabled: !!locationUuid },\n )\n\n const minimumWages = minWagesQuery.data?.minimumWageList ?? []\n\n const { compensation: currentCompensation, job: currentJob } = resolveCompAndJob(\n employeeJobs,\n compensationId,\n jobId,\n )\n\n const otherJobsCount =\n employeeJobs && currentJob ? employeeJobs.filter(j => j.uuid !== currentJob.uuid).length : 0\n\n // Snapshot — written exactly once, on the first render where `employeeJobs`\n // is defined (i.e., the initial `getJobs` query has resolved) — capturing\n // whether the employee already had a primary job at that moment.\n //\n // Used to ignore the API-generated stub primary (FLSA Nonexempt, rate \"0.00\")\n // that briefly appears between the chained job POST and comp PUT during\n // onboarding: `getJobs` invalidates between the two mutations and\n // momentarily includes the stub, which would otherwise flip\n // `isAddingSecondaryJob` to true and hide `Fields.FlsaStatus` mid-submit.\n //\n // In steady-state flows (edit primary, edit secondary, add secondary), the\n // real primary already exists when the query first resolves, so the snapshot\n // is `true` and live `employeeJobs` continues to drive `primaryFlsaStatus`.\n // Recovery for the rare case where a partner mounts before any jobs exist\n // and a primary is created externally mid-form is to remount the hook\n // (e.g., via a `key` change).\n const hadPrimaryAtMountRef = useRef<boolean | null>(null)\n if (hadPrimaryAtMountRef.current === null && employeeJobs !== undefined) {\n hadPrimaryAtMountRef.current = employeeJobs.some(job => job.primary)\n }\n const hadPrimaryAtMount = hadPrimaryAtMountRef.current === true\n\n // FLSA status of the employee's primary job's current compensation, when one\n // exists. Used as a fallback default when adding a *secondary* job/comp so the\n // multi-job classification stays consistent with the primary by default — the\n // user can still override it (when allowed). Null when there was no primary\n // job at the moment the hook first observed `employeeJobs`, or when the\n // primary has no current compensation yet.\n const primaryFlsaStatus = hadPrimaryAtMount ? findPrimaryFlsaStatus(employeeJobs) : null\n\n const hireDate =\n currentJob?.hireDate ??\n // Secondary jobs being created (CompensationAddAnotherJobForm) have no hireDate until the\n // job POST completes. Fall back to the primary job's hireDate so the schema\n // can enforce EFFECTIVE_DATE_BEFORE_HIRE during that window.\n employeeJobs?.find(j => j.primary)?.hireDate ??\n null\n\n // In update mode, exclude the compensation being edited so it doesn't\n // bound `maximumEffectiveDate` to its own current date — that would prevent\n // the user from pushing the pending effective date further out.\n const futureCompensations = findFutureCompensations(currentJob).filter(\n c => c.uuid !== compensationId,\n )\n const hasPendingFutureCompensation = futureCompensations.length > 0\n const maximumEffectiveDate = earliestEffectiveDate(futureCompensations)\n\n const isCreateMode = !compensationId\n const mode = isCreateMode ? 'create' : 'update'\n // Adding a secondary job (the employee already has a primary). The Gusto API\n // only allows secondaries when the primary's current FLSA is Nonexempt, and\n // the secondary itself must match — so the FLSA field is not user-editable\n // in this branch. We force the form value to the primary's FLSA below and\n // hide `Fields.FlsaStatus`.\n // True when adding a brand-new secondary job (not when scheduling a future\n // comp for the primary). The distinction matters: for the primary's future\n // comp, FLSA should be editable; for a secondary, it must match the primary.\n const isAddingSecondaryJob =\n isCreateMode && primaryFlsaStatus === FlsaStatus.NONEXEMPT && currentJob?.primary !== true\n\n // Derive the effective-date floor internally so consumers don't need to wire\n // it up. Rules by mode and job type:\n // create (any job): tomorrow — new comp must be future-dated\n // update, primary: undefined — the carve-out (willDeleteSecondaryJobs) can\n // force effectiveDate to today on a disabled field; enforcing a floor here\n // would produce a spurious EFFECTIVE_DATE_BEFORE_MIN on submit.\n // update, secondary: tomorrow — must be in the future\n // The hire-date lower bound is handled separately in the schema via the\n // `hireDate` option (→ EFFECTIVE_DATE_BEFORE_HIRE), which fires alongside\n // this check so each violation gets its own error message.\n const internalMinEffectiveDate = useMemo(() => {\n if (!withEffectiveDateField) return undefined\n if (!isCreateMode && currentJob?.primary === true) return undefined\n\n return formatDateToStringDate(addDays(new Date(), 1)) ?? undefined\n }, [isCreateMode, currentJob?.primary, withEffectiveDateField])\n\n const [schema, metadataConfig] = useMemo(\n () =>\n createCompensationSchema({\n mode,\n optionalFieldsToRequire,\n hireDate,\n minEffectiveDate: internalMinEffectiveDate,\n withEffectiveDateField,\n }),\n [mode, optionalFieldsToRequire, hireDate, internalMinEffectiveDate, withEffectiveDateField],\n )\n\n const state = currentWorkAddress?.state\n\n // `flsaStatus` is intentionally allowed to be undefined so the field renders\n // an empty placeholder when nothing is provided — partners can choose to\n // seed it via `defaultValues.flsaStatus`. When a `compensation` is loaded we\n // seed from it; for a brand-new secondary job we inherit from the primary's\n // current compensation so multi-job classification stays consistent. The\n // schema enforces requiredness on submit in `create` mode (see\n // `requiredFieldsConfig` in compensationSchema.ts).\n //\n // `title` lives on compensation in the API — `job.title` is a denormalized\n // snapshot of the primary comp's title that can lag behind comp-level edits\n // on secondaries. Seed directly from the loaded compensation so editing in\n // place can't silently re-introduce a stale title from the job record.\n const resolvedDefaults: CompensationFormData = useMemo(\n () => ({\n title: currentCompensation?.title ?? partnerDefaults?.title ?? '',\n // When adding a secondary, the FLSA must match the primary's — force it\n // here (overriding any partner default) so the form submits the right\n // value even though `Fields.FlsaStatus` is hidden.\n flsaStatus: isAddingSecondaryJob\n ? primaryFlsaStatus\n : (currentCompensation?.flsaStatus ??\n partnerDefaults?.flsaStatus ??\n primaryFlsaStatus ??\n undefined),\n rate: Number(currentCompensation?.rate ?? partnerDefaults?.rate ?? 0),\n adjustForMinimumWage:\n currentCompensation?.adjustForMinimumWage ?? partnerDefaults?.adjustForMinimumWage ?? false,\n minimumWageId:\n currentCompensation?.minimumWages?.[0]?.uuid ?? partnerDefaults?.minimumWageId ?? '',\n paymentUnit:\n currentCompensation?.paymentUnit ?? partnerDefaults?.paymentUnit ?? PAY_PERIODS.HOUR,\n effectiveDate: currentCompensation?.effectiveDate ?? partnerDefaults?.effectiveDate ?? null,\n }),\n [currentCompensation, currentJob, partnerDefaults, primaryFlsaStatus, isAddingSecondaryJob],\n )\n\n const formMethods = useForm<CompensationFormData, unknown, CompensationFormOutputs>({\n resolver: zodResolver(schema),\n mode: validationMode,\n shouldFocusError,\n defaultValues: resolvedDefaults,\n values: resolvedDefaults,\n resetOptions: { keepDirtyValues: true },\n })\n\n const { control, getValues, setValue, clearErrors } = formMethods\n const watchedFlsaStatus = useWatch({ control, name: 'flsaStatus' })\n const watchedAdjustForMinimumWage = useWatch({\n control,\n name: 'adjustForMinimumWage',\n })\n\n // Validation rules for `paymentUnit` and `rate` are FLSA-driven, so any\n // prior error on those fields is stale once FLSA changes. RHF doesn't clear\n // them on its own (`setValue` without `shouldValidate` skips the resolver,\n // and reValidate is per-field) — clear eagerly and let the next blur/submit\n // re-establish the error if it still applies.\n useEffect(() => {\n clearErrors(['paymentUnit', 'rate'])\n if (watchedFlsaStatus === FlsaStatus.OWNER) {\n setValue('paymentUnit', PAY_PERIODS.PAYCHECK)\n } else if (\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n ) {\n setValue('paymentUnit', PAY_PERIODS.YEAR)\n setValue('rate', 0)\n } else {\n setValue('paymentUnit', resolvedDefaults.paymentUnit)\n }\n }, [watchedFlsaStatus, setValue, clearErrors, resolvedDefaults.paymentUnit])\n\n // The FLSA status that represents the employee's current classification.\n // In update mode this is the compensation being edited. In create mode\n // `currentCompensation` is null, so fall back to the job's active\n // compensation (identified by currentCompensationUuid) — this lets the\n // secondary-job warning fire even when scheduling a future-dated change.\n const currentJobActiveComp = currentJob\n ? currentJob.compensations?.find(c => c.uuid === currentJob.currentCompensationUuid)\n : undefined\n const effectiveBaseFlsaStatus =\n currentCompensation?.flsaStatus ?? currentJobActiveComp?.flsaStatus ?? null\n\n // True when the user is changing FLSA away from Nonexempt on a job that has\n // secondary jobs — those secondaries will be deleted by the API when the\n // new classification takes effect (immediately in update mode, at the chosen\n // effective date in create mode). Drives the warning and, in update mode\n // only, the effectiveDate-lock side effect below.\n const willDeleteSecondaryJobs =\n effectiveBaseFlsaStatus === FlsaStatus.NONEXEMPT &&\n watchedFlsaStatus !== undefined &&\n watchedFlsaStatus !== FlsaStatus.NONEXEMPT &&\n otherJobsCount > 0\n\n // Carve-out UX — update mode only: while willDeleteSecondaryJobs is active\n // the server deletes secondaries immediately on PUT. Mirror this by forcing\n // `effectiveDate` to today and disabling the field. In create mode the\n // deletion happens at the chosen future date, so we show the warning but\n // leave the date field editable.\n const carveOutActiveRef = useRef(false)\n const priorEffectiveDateRef = useRef<string | null>(null)\n useEffect(() => {\n if (!isCreateMode && willDeleteSecondaryJobs && !carveOutActiveRef.current) {\n priorEffectiveDateRef.current = getValues('effectiveDate') ?? null\n setValue('effectiveDate', todayISO(), { shouldDirty: true, shouldValidate: false })\n carveOutActiveRef.current = true\n } else if (!isCreateMode && !willDeleteSecondaryJobs && carveOutActiveRef.current) {\n setValue('effectiveDate', priorEffectiveDateRef.current ?? null, {\n shouldDirty: true,\n shouldValidate: false,\n })\n priorEffectiveDateRef.current = null\n carveOutActiveRef.current = false\n }\n }, [isCreateMode, willDeleteSecondaryJobs, getValues, setValue])\n\n const updateCompensationMutation = useJobsAndCompensationsUpdateCompensationMutation()\n const createCompensationMutation = useJobsAndCompensationsCreateCompensationMutation()\n\n const isPending = updateCompensationMutation.isPending || createCompensationMutation.isPending\n\n const {\n baseSubmitHandler,\n error: submitError,\n setError: setSubmitError,\n } = useBaseSubmit('CompensationForm')\n\n const queriesForErrors = employeeId\n ? [jobsQuery, addressesQuery, employeeQuery, minWagesQuery]\n : []\n const errorHandling = composeErrorHandler(queriesForErrors, { submitError, setSubmitError })\n\n const isCommissionOnly =\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n const isOwner = watchedFlsaStatus === FlsaStatus.OWNER\n\n // Hide `Fields.FlsaStatus` when the user has no meaningful choice:\n // - update mode editing a secondary whose comp is already Nonexempt\n // (must keep matching the primary), and\n // - create mode while adding a secondary (must inherit primary's FLSA).\n // The first job's create flow and primary-job edits keep the field exposed.\n const isFlsaSelectionEnabled =\n !isAddingSecondaryJob &&\n (watchedFlsaStatus !== FlsaStatus.NONEXEMPT || currentJob?.primary === true || isCreateMode)\n\n const isAdjustMinimumWageEnabled =\n watchedFlsaStatus === FlsaStatus.NONEXEMPT &&\n minimumWages.length > 0 &&\n state !== undefined &&\n !TIP_CREDITS_UNSUPPORTED_STATES.includes(state)\n\n // Min-wage adjustment is only valid for Nonexempt FLSA (and a state that\n // allows tip credit). When the gate flips off — typically because the user\n // changed FLSA away from Nonexempt — `Fields.AdjustForMinimumWage` and\n // `Fields.MinimumWageId` stop rendering, but the underlying form values\n // persist in react-hook-form state. That would leak an\n // `adjust_for_minimum_wage: true` + `minimum_wages: [...]` body on submit\n // (server rejects with \"Minimum wage adjustments only valid for\n // flsa_status: Nonexempt\"). Reset both values to safe defaults so the\n // submitted payload always matches what the user can actually see.\n useEffect(() => {\n if (isAdjustMinimumWageEnabled) return\n if (getValues('adjustForMinimumWage')) {\n setValue('adjustForMinimumWage', false, { shouldDirty: true, shouldValidate: false })\n }\n if (getValues('minimumWageId')) {\n setValue('minimumWageId', '', { shouldDirty: true, shouldValidate: false })\n }\n // Both fields stop rendering once the gate closes — clear errors so a\n // stale one doesn't silently fail the next submit with no visible UI to fix.\n clearErrors(['adjustForMinimumWage', 'minimumWageId'])\n }, [isAdjustMinimumWageEnabled, getValues, setValue, clearErrors])\n\n const minimumWageOptions = minimumWages.map(wage => ({\n value: wage.uuid,\n label: `${wage.wage} - ${wage.authority}: ${wage.notes ?? ''}`,\n }))\n\n const baseMetadata = useDeriveFieldsMetadata(metadataConfig, formMethods.control)\n const effectiveDateMinDate = useMemo(\n () =>\n [internalMinEffectiveDate, hireDate]\n .filter((d): d is string => !!d)\n .reduce<string | null>((max, d) => (!max || d > max ? d : max), null),\n [internalMinEffectiveDate, hireDate],\n )\n const fieldsMetadata = buildCompensationFieldsMetadata(baseMetadata, {\n willDeleteSecondaryJobs,\n isCreateMode,\n isCommissionOnly,\n isOwner,\n isAdjustMinimumWageEnabled,\n effectiveDateMinDate,\n maximumEffectiveDate,\n minimumWageOptions,\n minimumWages,\n })\n\n const onSubmit = async (\n options?: CompensationSubmitOptions,\n ): Promise<HookSubmitResult<Compensation> | undefined> => {\n let submitResult: HookSubmitResult<Compensation> | undefined\n\n await new Promise<void>(resolve => {\n void formMethods.handleSubmit(\n async (data: CompensationFormOutputs) => {\n await baseSubmitHandler(data, async payload => {\n const resolvedJobId = options?.jobId ?? jobId\n const resolvedCompensationId = options?.compensationId ?? compensationId\n const resolvedMode = resolvedCompensationId ? 'update' : 'create'\n\n // When the field is rendered, the validated payload value wins\n // unless an explicit submit-time override is supplied. When the\n // field is hidden (`withEffectiveDateField: false`) we are\n // strictly options-only — matching `useWorkAddressForm` and the\n // hidden-field behavior of `useHomeAddressForm` / `useJobForm`.\n // The carve-out's form-state side effect (force value to today)\n // is therefore inert in the hidden-field path; partners who\n // need a specific date there must supply it via\n // `CompensationSubmitOptions.effectiveDate`.\n const resolvedEffectiveDate = withEffectiveDateField\n ? (options?.effectiveDate ?? payload.effectiveDate ?? undefined)\n : (options?.effectiveDate ?? undefined)\n\n const requestBodyBase = {\n rate: String(payload.rate),\n paymentUnit: payload.paymentUnit,\n flsaStatus: payload.flsaStatus,\n effectiveDate: resolvedEffectiveDate,\n title: payload.title || undefined,\n adjustForMinimumWage: payload.adjustForMinimumWage,\n minimumWages: payload.adjustForMinimumWage ? [{ uuid: payload.minimumWageId }] : [],\n }\n\n let result: Compensation | undefined\n\n if (resolvedMode === 'create') {\n if (!resolvedJobId) {\n throw new SDKInternalError(\n 'jobId is required to create a compensation. Pass it as a hook prop or via submit options.',\n )\n }\n // Schema's `requiredFieldsConfig` guarantees `flsaStatus` is set\n // on create-mode submit; the runtime guard appeases the API\n // request-body type (which requires a non-undefined value on\n // POST, vs. the optional PUT body).\n if (!payload.flsaStatus) {\n throw new SDKInternalError('flsaStatus is required to create a compensation.')\n }\n const createResponse = await createCompensationMutation.mutateAsync({\n request: {\n jobId: resolvedJobId,\n compensationsRequestBody: { ...requestBodyBase, flsaStatus: payload.flsaStatus },\n },\n })\n result = createResponse.compensation\n if (!result) throw new SDKInternalError('Compensation creation failed')\n } else {\n if (!resolvedCompensationId) {\n throw new SDKInternalError(\n 'compensationId is required to update a compensation. Pass it as a hook prop or via submit options.',\n )\n }\n const resolvedVersion =\n options?.compensationVersion ?? (currentCompensation?.version as string | undefined)\n if (!resolvedVersion) {\n throw new SDKInternalError(\n 'compensation version is required to update a compensation. Pass it via submit options when threading post-create, or ensure the compensation is loaded.',\n )\n }\n const updateResponse = await updateCompensationMutation.mutateAsync({\n request: {\n compensationId: resolvedCompensationId,\n compensationsUpdateRequestBody: {\n version: resolvedVersion,\n ...requestBodyBase,\n },\n },\n })\n result = updateResponse.compensation\n if (!result) throw new SDKInternalError('Compensation update failed')\n }\n\n submitResult = { mode: resolvedMode, data: result }\n })\n resolve()\n },\n () => {\n resolve()\n },\n )()\n })\n\n return submitResult\n }\n\n const isDataLoading = employeeId\n ? jobsQuery.isLoading ||\n addressesQuery.isLoading ||\n employeeQuery.isLoading ||\n minWagesQuery.isLoading\n : false\n\n const hookFormInternals = useHookFormInternals(formMethods)\n\n if (isDataLoading || (employeeId && (!employeeJobs || !employee))) {\n return { isLoading: true as const, errorHandling }\n }\n\n return {\n isLoading: false as const,\n data: {\n compensation: currentCompensation,\n currentJob,\n minimumWages,\n minimumEffectiveDate: effectiveDateMinDate,\n maximumEffectiveDate,\n hasPendingFutureCompensation,\n },\n status: {\n isPending,\n mode,\n willDeleteSecondaryJobs,\n showCommissionFederalMinimumPayAlert: watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT,\n showCommissionMinimumWageAlert: watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT,\n showOwnerSalaryAlert: watchedFlsaStatus === FlsaStatus.OWNER,\n },\n actions: { onSubmit },\n errorHandling,\n form: {\n Fields: {\n Title: TitleField,\n FlsaStatus: isFlsaSelectionEnabled ? FlsaStatusField : undefined,\n Rate: isCommissionOnly ? undefined : RateField,\n PaymentUnit: isCommissionOnly ? undefined : PaymentUnitField,\n AdjustForMinimumWage: isAdjustMinimumWageEnabled ? AdjustForMinimumWageField : undefined,\n MinimumWageId:\n isAdjustMinimumWageEnabled && watchedAdjustForMinimumWage\n ? MinimumWageIdField\n : undefined,\n EffectiveDate: withEffectiveDateField ? EffectiveDateField : undefined,\n },\n fieldsMetadata,\n hookFormInternals,\n getFormSubmissionValues: createGetFormSubmissionValues(formMethods, schema),\n },\n }\n}\n\n/**\n * Discriminated union returned by {@link useCompensationForm} — either the loading state or the ready state.\n *\n * @remarks\n * Use this type when threading the hook result through helpers (e.g.\n * presentational components). Discriminate on `isLoading` to narrow to\n * {@link UseCompensationFormReady}.\n *\n * @public\n */\nexport type UseCompensationFormResult = HookLoadingResult | UseCompensationFormReady\n\n/**\n * Metadata for each {@link useCompensationForm} field, exposed on `form.fieldsMetadata`.\n *\n * @remarks\n * Includes per-field `isDisabled`, `isRequired`, and the dynamic option list\n * for select fields (`flsaStatus`, `paymentUnit`, `minimumWageId`).\n * `effectiveDate` additionally carries `minDate` / `maxDate` derived from\n * the parent job's hire date and any pending future compensation.\n *\n * @public\n */\nexport type CompensationFieldsMetadata = ReturnType<typeof buildCompensationFieldsMetadata>\n"],"names":["resolveCompAndJob","jobs","compensationId","jobId","job","compensation","c","j","findPrimaryFlsaStatus","findFutureCompensations","today","todayISO","earliestEffectiveDate","comps","min","d","flsaStatusEntries","FlsaStatus","flsaOptions","status","paymentUnitEntries","PAY_PERIODS","paymentUnitOptions","unit","buildCompensationFieldsMetadata","base","willDeleteSecondaryJobs","isCreateMode","isCommissionOnly","isOwner","isAdjustMinimumWageEnabled","effectiveDateMinDate","maximumEffectiveDate","minimumWageOptions","minimumWages","withFlags","withOptions","useCompensationForm","employeeId","optionalFieldsToRequire","partnerDefaults","validationMode","shouldFocusError","withEffectiveDateField","jobsQuery","useJobsAndCompensationsGetJobs","GetV1EmployeesEmployeeIdJobsQueryParamInclude","addressesQuery","useEmployeeAddressesGetWorkAddresses","employeeQuery","useEmployeesGet","employeeJobs","currentWorkAddress","address","locationUuid","employee","minWagesQuery","useLocationsGetMinimumWages","currentCompensation","currentJob","otherJobsCount","hadPrimaryAtMountRef","useRef","primaryFlsaStatus","hireDate","futureCompensations","hasPendingFutureCompensation","mode","isAddingSecondaryJob","internalMinEffectiveDate","useMemo","formatDateToStringDate","addDays","schema","metadataConfig","createCompensationSchema","state","resolvedDefaults","formMethods","useForm","zodResolver","control","getValues","setValue","clearErrors","watchedFlsaStatus","useWatch","watchedAdjustForMinimumWage","useEffect","currentJobActiveComp","carveOutActiveRef","priorEffectiveDateRef","updateCompensationMutation","useJobsAndCompensationsUpdateCompensationMutation","createCompensationMutation","useJobsAndCompensationsCreateCompensationMutation","isPending","baseSubmitHandler","submitError","setSubmitError","useBaseSubmit","errorHandling","composeErrorHandler","isFlsaSelectionEnabled","TIP_CREDITS_UNSUPPORTED_STATES","wage","baseMetadata","useDeriveFieldsMetadata","max","fieldsMetadata","onSubmit","options","submitResult","resolve","data","payload","resolvedJobId","resolvedCompensationId","resolvedMode","resolvedEffectiveDate","requestBodyBase","result","SDKInternalError","resolvedVersion","isDataLoading","hookFormInternals","useHookFormInternals","TitleField","FlsaStatusField","RateField","PaymentUnitField","AdjustForMinimumWageField","MinimumWageIdField","EffectiveDateField","createGetFormSubmissionValues"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA6PA,SAASA,GACPC,GACAC,GACAC,GACwD;AACxD,MAAI,CAACF,EAAM,QAAO,EAAE,cAAc,MAAM,KAAK,KAAA;AAC7C,MAAIC,GAAgB;AAClB,eAAWE,KAAOH,GAAM;AACtB,YAAMI,IAAeD,EAAI,eAAe,KAAK,CAAAE,MAAKA,EAAE,SAASJ,CAAc;AAC3E,UAAIG,EAAc,QAAO,EAAE,cAAAA,GAAc,KAAAD,EAAA;AAAA,IAC3C;AAIA,WAAO,EAAE,cAAc,MAAM,KADTD,IAASF,EAAK,KAAK,OAAKM,EAAE,SAASJ,CAAK,KAAK,OAAQ,KACvC;AAAA,EACpC;AACA,SAAIA,IAAc,EAAE,cAAc,MAAM,KAAKF,EAAK,KAAK,CAAAM,MAAKA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MAAsBpE,EAAW;AAAA,MACjE,sBAAsBoE,MAAsBpE,EAAW;AAAA,IAAA;AAAA,IAEzD,SAAS,EAAE,UAAA6F,GAAA;AAAA,IACX,eAAAT;AAAA,IACA,MAAM;AAAA,MACJ,QAAQ;AAAA,QACN,OAAO0B;AAAA,QACP,YAAYxB,KAAyByB,KAAkB;AAAA,QACvD,MAAMpG,IAAmB,SAAYqG;AAAA,QACrC,aAAarG,IAAmB,SAAYsG;AAAA,QAC5C,sBAAsBpG,IAA6BqG,KAA4B;AAAA,QAC/E,eACErG,KAA8ByD,KAC1B6C,KACA;AAAA,QACN,eAAezF,IAAyB0F,KAAqB;AAAA,MAAA;AAAA,MAE/D,gBAAAxB;AAAA,MACA,mBAAAgB;AAAA,MACA,yBAAyBS,GAA8BxD,GAAaL,CAAM;AAAA,IAAA;AAAA,EAC5E;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"useCompensationForm.js","sources":["../../../../../../src/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.tsx"],"sourcesContent":["import { useEffect, useMemo, useRef } from 'react'\nimport type { ComponentType } from 'react'\nimport { useForm, useWatch } from 'react-hook-form'\nimport type { UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport type { Compensation, PaymentUnit } from '@gusto/embedded-api/models/components/compensation'\nimport type { Job } from '@gusto/embedded-api/models/components/job'\nimport type { FlsaStatusType } from '@gusto/embedded-api/models/components/flsastatustype'\nimport type { MinimumWage } from '@gusto/embedded-api/models/components/minimumwage'\nimport { useJobsAndCompensationsGetJobs } from '@gusto/embedded-api/react-query/jobsAndCompensationsGetJobs'\nimport { GetV1EmployeesEmployeeIdJobsQueryParamInclude } from '@gusto/embedded-api/models/operations/getv1employeesemployeeidjobs'\nimport { useJobsAndCompensationsCreateCompensationMutation } from '@gusto/embedded-api/react-query/jobsAndCompensationsCreateCompensation'\nimport { useJobsAndCompensationsUpdateCompensationMutation } from '@gusto/embedded-api/react-query/jobsAndCompensationsUpdateCompensation'\nimport { useLocationsGetMinimumWages } from '@gusto/embedded-api/react-query/locationsGetMinimumWages'\nimport { useEmployeeAddressesGetWorkAddresses } from '@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses'\nimport { useEmployeesGet } from '@gusto/embedded-api/react-query/employeesGet'\nimport {\n createCompensationSchema,\n type CompensationOptionalFieldsToRequire,\n type CompensationFormData,\n type CompensationFormOutputs,\n} from './compensationSchema'\nimport {\n TitleField,\n FlsaStatusField,\n RateField,\n PaymentUnitField,\n AdjustForMinimumWageField,\n MinimumWageIdField,\n EffectiveDateField,\n} from './fields'\nimport type {\n TitleFieldProps,\n FlsaStatusFieldProps,\n RateFieldProps,\n PaymentUnitFieldProps,\n AdjustForMinimumWageFieldProps,\n MinimumWageIdFieldProps,\n EffectiveDateFieldProps,\n} from './fields'\nimport { withOptions } from '@/partner-hook-utils/form/withOptions'\nimport { withFlags } from '@/partner-hook-utils/form/withFlags'\nimport { createGetFormSubmissionValues } from '@/partner-hook-utils/form/getFormSubmissionValues'\nimport { useDeriveFieldsMetadata } from '@/partner-hook-utils/form/useDeriveFieldsMetadata'\nimport { useHookFormInternals } from '@/partner-hook-utils/form/useHookFormInternals'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type {\n BaseFormHookReady,\n FieldMetadata,\n FieldsMetadata,\n HookLoadingResult,\n HookSubmitResult,\n} from '@/partner-hook-utils/types'\nimport { FlsaStatus, PAY_PERIODS, TIP_CREDITS_UNSUPPORTED_STATES } from '@/shared/constants'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { SDKInternalError } from '@/types/sdkError'\nimport { addDays, formatDateToStringDate } from '@/helpers/dateFormatting'\n\n/**\n * Optional values supplied to {@link useCompensationForm}'s `actions.onSubmit` at submit time.\n *\n * @remarks\n * Use these to override hook-construction props when an ID isn't known at\n * mount — most commonly the **onboarding stub-fill** chain, where `useJobForm`\n * creates the parent job and returns the auto-created stub compensation, and\n * the IDs and version are threaded into this hook's `onSubmit` to PUT the\n * stub.\n *\n * @public\n */\nexport interface CompensationSubmitOptions {\n /** Override jobId — required when creating a compensation if not configured at hook construction (e.g. when the parent job was just created in the same submit chain). */\n jobId?: string\n /** Override compensationId — when present, forces update (PUT) routing regardless of hook construction. */\n compensationId?: string\n /**\n * Compensation version for optimistic locking on PUT. Required when forcing\n * update routing post-create (e.g. updating the auto-created stub returned\n * from `POST /v1/employees/:id/jobs`). When omitted, the hook reads the\n * version from its cached `currentCompensation`.\n */\n compensationVersion?: string\n /**\n * Supply `effectiveDate` at submit time. When `withEffectiveDateField`\n * is `true`, this overrides the form's value. When `withEffectiveDateField`\n * is `false`, this is the only way to put `effective_date` on the wire —\n * the form value is not read in that mode (matching the options-only\n * convention of `useWorkAddressForm` / `useHomeAddressForm` / `useJobForm`).\n */\n effectiveDate?: string\n}\n\n/**\n * Configuration options for {@link useCompensationForm}.\n *\n * @remarks\n * Presence or absence of `compensationId` selects the API verb — see the\n * `compensationId` field description. `employeeId` is optional so the hook\n * can be composed alongside an employee-creation step. `jobId` is optional in\n * update mode (derived from the loaded compensation) and required in create\n * mode (scopes the POST); supply it at submit time via\n * {@link CompensationSubmitOptions.jobId} when the parent job is created in\n * the same submit chain.\n *\n * @public\n */\nexport interface UseCompensationFormProps {\n /** UUID of the employee whose compensation is being created or edited. Drives data fetching for derived helpers (jobs list, work address, minimum wages). May be omitted when composing alongside an employee-creation step. */\n employeeId?: string\n /** The parent job's UUID. Required in create mode (scopes `POST /v1/jobs/:jobId/compensations`). Optional in update mode — the parent job is derived from the loaded compensation. */\n jobId?: string\n /** Present → update mode (PUT /v1/compensations/:id). Omitted → create mode (POST /v1/jobs/:jobId/compensations). */\n compensationId?: string\n /** Override fields that are optional on a given mode to be required. See {@link CompensationOptionalFieldsToRequire}. */\n optionalFieldsToRequire?: CompensationOptionalFieldsToRequire\n /** Pre-fill form values. Server data takes precedence on update mode. */\n defaultValues?: Partial<CompensationFormData>\n /** Passed through to react-hook-form. Defaults to `'onSubmit'`. */\n validationMode?: UseFormProps['mode']\n /** Auto-focus the first invalid field on submit. Set to `false` when using `composeSubmitHandler` so submit-time focus is coordinated across multiple forms. Defaults to `true`. */\n shouldFocusError?: boolean\n /**\n * When `false`, hides `Fields.EffectiveDate` (becomes `undefined`) and\n * removes `effectiveDate` from schema validation. In this mode the hook\n * does not read any form value at submit time — `effective_date` is\n * omitted from the request body unless explicitly supplied via\n * {@link CompensationSubmitOptions.effectiveDate}. This matches the\n * options-only convention of other form hooks, and means the\n * `willDeleteSecondaryJobs` carve-out's form-state side effects do not\n * leak onto the wire (there is no field to render them in anyway).\n * Defaults to `true`.\n */\n withEffectiveDateField?: boolean\n}\n\n/**\n * Pre-bound field components exposed on `useCompensationForm().form.Fields`.\n *\n * @remarks\n * Each property is either the field component or `undefined`. A field is\n * `undefined` when conditions for rendering it aren't met — see each member\n * for its visibility rule. Always null-check conditional fields (e.g.\n * `{Fields.FlsaStatus && <Fields.FlsaStatus ... />}`) before rendering.\n *\n * @public\n */\nexport interface CompensationFormFields {\n /** Bound to `title`. Title text input. Always available. Optional in both modes unless `optionalFieldsToRequire` requires it. */\n Title: ComponentType<TitleFieldProps>\n /** Bound to `flsaStatus`. FLSA classification select. `undefined` when the status is not user-editable (e.g. secondary jobs that must match the primary). */\n FlsaStatus: ComponentType<FlsaStatusFieldProps> | undefined\n /** Bound to `rate`. Compensation amount input. `undefined` for commission-only FLSA statuses, which don't accept a partner-supplied rate. */\n Rate: ComponentType<RateFieldProps> | undefined\n /** Bound to `paymentUnit`. Payment unit select. `undefined` for commission-only FLSA statuses (the hook forces `paymentUnit=Year`). */\n PaymentUnit: ComponentType<PaymentUnitFieldProps> | undefined\n /** Bound to `adjustForMinimumWage`. Minimum-wage adjustment checkbox. `undefined` unless `flsaStatus === Nonexempt`, the employee's work location has minimum wages, and the state supports tip credits. */\n AdjustForMinimumWage: ComponentType<AdjustForMinimumWageFieldProps> | undefined\n /** Bound to `minimumWageId`. Minimum-wage selection. `undefined` unless `Fields.AdjustForMinimumWage` is rendered and checked. */\n MinimumWageId: ComponentType<MinimumWageIdFieldProps> | undefined\n /** Bound to `effectiveDate`. Effective-date picker. `undefined` when `withEffectiveDateField: false`; supply the value via `CompensationSubmitOptions.effectiveDate` in that mode. */\n EffectiveDate: ComponentType<EffectiveDateFieldProps> | undefined\n}\n\n/**\n * Ready-state shape returned by {@link useCompensationForm} once data has loaded.\n *\n * @remarks\n * Discriminated by `isLoading: false`. Extends {@link BaseFormHookReady} with\n * the compensation-specific `data`, `status`, `actions`, and `form.Fields`\n * shape. Static, entity-derived values live under `data.*`; reactive values\n * that flip with form input live under `status.*`.\n *\n * @public\n */\nexport interface UseCompensationFormReady extends BaseFormHookReady<\n CompensationFieldsMetadata,\n CompensationFormData,\n CompensationFormFields\n> {\n /** Compensation-specific data payload: the loaded compensation, the parent job, available minimum wages, and effective-date bounds. */\n data: {\n /** The compensation row loaded for update; `null` in create mode. */\n compensation: Compensation | null\n /** The parent job. In update mode it's derived from the loaded compensation; in create mode it's looked up by `jobId`. `null` if neither resolves. */\n currentJob: Job | null\n /** Minimum wages available at the employee's active work location. Empty when no location is set or no minimums are defined. */\n minimumWages: MinimumWage[]\n /** Lower bound for `effectiveDate` (typically the parent job's hire date). */\n minimumEffectiveDate: string | null\n /** Upper bound for `effectiveDate` — the next scheduled future compensation's effective date, when one exists. */\n maximumEffectiveDate: string | null\n /** True when at least one future-dated compensation already exists for this job. */\n hasPendingFutureCompensation: boolean\n }\n /** Submission state and reactive flags derived from current form input. `isPending` is `true` while a create/update mutation is in flight; `mode` reflects whether the next submit will create or update; the `show*Alert` flags drive FLSA-specific inline warnings. */\n status: {\n /** `true` while a create or update mutation is in flight. */\n isPending: boolean\n /** Reflects whether the next submit will POST a new compensation or PUT an existing one. */\n mode: 'create' | 'update'\n /**\n * True when submitting the form right now would delete the employee's\n * secondary jobs server-side (the \"carve-out\" branch). Reactive:\n * derived from the current `flsaStatus` form value, the loaded\n * compensation, and the other-jobs count, so this flips as you change\n * inputs.\n *\n * Conditions: update mode, the loaded compensation is Nonexempt, the\n * form's `flsaStatus` has been changed to a non-Nonexempt value, and\n * the employee has at least one secondary job.\n *\n * While this flag is true the hook also takes the `effectiveDate`\n * field over: it forces the form value to today (so submits route\n * through a PUT that immediately deletes secondaries) and exposes\n * `fieldsMetadata.effectiveDate.isDisabled = true` so `Fields.EffectiveDate`\n * renders as disabled. On revert (FLSA back to Nonexempt) the prior\n * `effectiveDate` is restored. Render an inline warning keyed off\n * this flag — no separate confirmation step is needed.\n */\n willDeleteSecondaryJobs: boolean\n /**\n * True when the current `flsaStatus` is `COMMISSION_ONLY_EXEMPT`\n * (Commission Only/No Overtime). Render the federal-minimum-pay\n * warning alert when this flag is true. While this flag is true,\n * `Fields.Rate` and `Fields.PaymentUnit` are also `undefined` (the\n * hook forces `rate=0`, `paymentUnit=YEAR` on the form values).\n */\n showCommissionFederalMinimumPayAlert: boolean\n /**\n * True when the current `flsaStatus` is `COMMISSION_ONLY_NONEXEMPT`\n * (Commission Only/Eligible for overtime). Render the local-minimum-wage\n * warning alert when this flag is true. While this flag is true,\n * `Fields.Rate` and `Fields.PaymentUnit` are also `undefined` (the\n * hook forces `rate=0`, `paymentUnit=YEAR` on the form values).\n */\n showCommissionMinimumWageAlert: boolean\n /**\n * True when the current `flsaStatus` is `OWNER` (Owner's draw). Render\n * an informational alert noting that the IRS requires S-corp owners to\n * pay themselves a reasonable salary for similar work before taking\n * distributions.\n */\n showOwnerSalaryAlert: boolean\n }\n /** Submit actions exposed by the hook. */\n actions: {\n /** Validates the form, runs the appropriate create/update mutation, and resolves to a {@link HookSubmitResult} containing the saved compensation. Resolves to `undefined` on validation failure or mutation error. Accepts {@link CompensationSubmitOptions} for threading IDs/version into the onboarding stub-fill chain. */\n onSubmit: (\n options?: CompensationSubmitOptions,\n ) => Promise<HookSubmitResult<Compensation> | undefined>\n }\n}\n\nfunction resolveCompAndJob(\n jobs: Job[] | undefined,\n compensationId: string | undefined,\n jobId: string | undefined,\n): { compensation: Compensation | null; job: Job | null } {\n if (!jobs) return { compensation: null, job: null }\n if (compensationId) {\n for (const job of jobs) {\n const compensation = job.compensations?.find(c => c.uuid === compensationId)\n if (compensation) return { compensation, job }\n }\n // If the comp isn't in any job's compensations list, still try to resolve\n // the job by jobId so callers can check job metadata (e.g. job.primary).\n const fallbackJob = jobId ? (jobs.find(j => j.uuid === jobId) ?? null) : null\n return { compensation: null, job: fallbackJob }\n }\n if (jobId) return { compensation: null, job: jobs.find(j => j.uuid === jobId) ?? null }\n return { compensation: null, job: null }\n}\n\nfunction findPrimaryFlsaStatus(jobs: Job[] | undefined): FlsaStatusType | null {\n if (!jobs) return null\n for (const job of jobs) {\n if (!job.primary) continue\n const compensation = job.compensations?.find(c => c.uuid === job.currentCompensationUuid)\n if (compensation?.flsaStatus) return compensation.flsaStatus\n }\n return null\n}\n\nfunction findFutureCompensations(job: Job | null): Compensation[] {\n if (!job?.compensations) return []\n const today = todayISO()\n return job.compensations.filter(c => c.effectiveDate !== undefined && c.effectiveDate > today)\n}\n\nfunction earliestEffectiveDate(comps: Compensation[]): string | null {\n if (comps.length === 0) return null\n return comps.reduce<string | null>((min, c) => {\n const d = c.effectiveDate\n if (!d) return min\n if (!min || d < min) return d\n return min\n }, null)\n}\n\nconst flsaStatusEntries: FlsaStatusType[] = [\n FlsaStatus.EXEMPT,\n FlsaStatus.SALARIED_NONEXEMPT,\n FlsaStatus.NONEXEMPT,\n FlsaStatus.OWNER,\n FlsaStatus.COMMISSION_ONLY_EXEMPT,\n FlsaStatus.COMMISSION_ONLY_NONEXEMPT,\n]\n\nconst flsaOptions = flsaStatusEntries.map(status => ({ value: status, label: status }))\n\nconst paymentUnitEntries: PaymentUnit[] = [\n PAY_PERIODS.HOUR,\n PAY_PERIODS.WEEK,\n PAY_PERIODS.MONTH,\n PAY_PERIODS.YEAR,\n PAY_PERIODS.PAYCHECK,\n]\n\nconst paymentUnitOptions = paymentUnitEntries.map(unit => ({ value: unit, label: unit }))\n\nfunction todayISO(): string {\n return new Date().toISOString().split('T')[0]!\n}\n\n/** @internal */\nfunction buildCompensationFieldsMetadata(\n base: Record<keyof CompensationFormData, FieldMetadata>,\n {\n willDeleteSecondaryJobs,\n isCreateMode,\n isCommissionOnly,\n isOwner,\n isAdjustMinimumWageEnabled,\n effectiveDateMinDate,\n maximumEffectiveDate,\n minimumWageOptions,\n minimumWages,\n }: {\n willDeleteSecondaryJobs: boolean\n isCreateMode: boolean\n isCommissionOnly: boolean\n isOwner: boolean\n isAdjustMinimumWageEnabled: boolean\n effectiveDateMinDate: string | null\n maximumEffectiveDate: string | null\n minimumWageOptions: { value: string; label: string }[]\n minimumWages: MinimumWage[]\n },\n) {\n return {\n title: base.title,\n effectiveDate: withFlags(base.effectiveDate, {\n isDisabled: willDeleteSecondaryJobs && !isCreateMode,\n minDate: effectiveDateMinDate,\n maxDate: maximumEffectiveDate,\n }),\n flsaStatus: withOptions<FlsaStatusType>(base.flsaStatus, flsaOptions, flsaStatusEntries),\n rate: withFlags(base.rate, { isDisabled: isCommissionOnly }),\n paymentUnit: withOptions<PaymentUnit>(\n withFlags(base.paymentUnit, { isDisabled: isOwner || isCommissionOnly }),\n paymentUnitOptions,\n paymentUnitEntries,\n ),\n adjustForMinimumWage: withFlags(base.adjustForMinimumWage, {\n isDisabled: !isAdjustMinimumWageEnabled,\n }),\n minimumWageId: withOptions<MinimumWage>(base.minimumWageId, minimumWageOptions, minimumWages),\n } satisfies FieldsMetadata\n}\n\n/**\n * Headless hook for creating or updating a compensation row on a job — FLSA classification, pay rate, payment unit, effective date, and optional minimum-wage adjustment.\n *\n * @remarks\n * Companion hook to `useJobForm`. Jobs and their compensations are separate\n * entities in the Gusto API and this hook focuses exclusively on the\n * compensation side. Presence of `compensationId` selects the verb:\n *\n * | Hook config / submit options | Mode | API call |\n * | ---------------------------- | ---- | -------- |\n * | `{ jobId, compensationId }` | update | `PUT /v1/compensations/:compensationId` (with `version`) |\n * | `{ jobId }` (no `compensationId`) | create | `POST /v1/jobs/:jobId/compensations` |\n * | `{ employeeId }` + submit `{ jobId, compensationId, compensationVersion }` | update | `PUT /v1/compensations/:compensationId` (with the supplied `version`) |\n * | `{ employeeId }` + submit `{ jobId }` (no `compensationId`) | create | `POST /v1/jobs/:options.jobId/compensations` |\n *\n * Use the submit-options form for the **onboarding stub-fill** chain: after\n * `useJobForm.actions.onSubmit()` creates a job, capture the auto-created\n * compensation's UUID and version from the response, and pass them as\n * `{ jobId, compensationId, compensationVersion }` to this hook's `onSubmit`\n * to PUT the stub.\n *\n * The hook exposes several derived helpers for driving UX — static\n * entity-derived values under `data.*` (effective-date bounds, pending\n * future compensations) and reactive flags under `status.*` (the\n * `willDeleteSecondaryJobs` carve-out, plus FLSA-specific alerts for\n * commission-only and owner classifications). When\n * `willDeleteSecondaryJobs` is `true` in update mode, the hook also locks\n * the `effectiveDate` field (forces to today, renders disabled) until the\n * FLSA selection is reverted.\n *\n * @param input - {@link UseCompensationFormProps} — `employeeId`, `jobId`, `compensationId` (toggle create/update), required-field overrides, default values, and which fields the hook renders.\n * @returns A {@link HookLoadingResult} while data is loading, or a {@link UseCompensationFormReady} once ready.\n * @public\n *\n * @example\n * ```tsx\n * import { useCompensationForm, SDKFormProvider } from '@gusto/embedded-react-sdk'\n *\n * function CompensationForm({ employeeId, jobId }: { employeeId: string; jobId: string }) {\n * const comp = useCompensationForm({ employeeId, jobId })\n * if (comp.isLoading) return null\n *\n * const { Fields } = comp.form\n * return (\n * <form onSubmit={e => { e.preventDefault(); comp.actions.onSubmit() }}>\n * <SDKFormProvider formHookResult={comp}>\n * {Fields.FlsaStatus && <Fields.FlsaStatus label=\"Employee type\" />}\n * <Fields.Rate label=\"Compensation amount\" />\n * <Fields.PaymentUnit label=\"Payment unit\" />\n * {Fields.EffectiveDate && <Fields.EffectiveDate label=\"Effective date\" />}\n * </SDKFormProvider>\n * {comp.status.willDeleteSecondaryJobs && (\n * <p>Saving will remove this employee's secondary jobs.</p>\n * )}\n * <button type=\"submit\" disabled={comp.status.isPending}>Save</button>\n * </form>\n * )\n * }\n * ```\n */\nexport function useCompensationForm({\n employeeId,\n jobId,\n compensationId,\n optionalFieldsToRequire,\n defaultValues: partnerDefaults,\n validationMode = 'onSubmit',\n shouldFocusError = true,\n withEffectiveDateField = true,\n}: UseCompensationFormProps): HookLoadingResult | UseCompensationFormReady {\n const jobsQuery = useJobsAndCompensationsGetJobs(\n {\n employeeId: employeeId ?? '',\n // Fetch all effective-dated compensations when editing an existing one so\n // resolveCompAndJob can find the target comp (future-dated comps are\n // omitted from the default response, which only returns the current comp).\n include: compensationId\n ? GetV1EmployeesEmployeeIdJobsQueryParamInclude.AllCompensations\n : undefined,\n },\n { enabled: !!employeeId },\n )\n const addressesQuery = useEmployeeAddressesGetWorkAddresses(\n { employeeId: employeeId ?? '' },\n { enabled: !!employeeId },\n )\n const employeeQuery = useEmployeesGet({ employeeId: employeeId ?? '' }, { enabled: !!employeeId })\n\n const employeeJobs = jobsQuery.data?.jobs\n const workAddresses = addressesQuery.data?.employeeWorkAddressesList\n const currentWorkAddress = workAddresses?.find(address => address.active)\n const locationUuid = currentWorkAddress?.locationUuid\n const employee = employeeQuery.data?.employee\n\n const minWagesQuery = useLocationsGetMinimumWages(\n { locationUuid: locationUuid ?? '' },\n { enabled: !!locationUuid, staleTime: Infinity },\n )\n\n const minimumWages = minWagesQuery.data?.minimumWageList ?? []\n\n const { compensation: currentCompensation, job: currentJob } = resolveCompAndJob(\n employeeJobs,\n compensationId,\n jobId,\n )\n\n const otherJobsCount =\n employeeJobs && currentJob ? employeeJobs.filter(j => j.uuid !== currentJob.uuid).length : 0\n\n // Snapshot — written exactly once, on the first render where `employeeJobs`\n // is defined (i.e., the initial `getJobs` query has resolved) — capturing\n // whether the employee already had a primary job at that moment.\n //\n // Used to ignore the API-generated stub primary (FLSA Nonexempt, rate \"0.00\")\n // that briefly appears between the chained job POST and comp PUT during\n // onboarding: `getJobs` invalidates between the two mutations and\n // momentarily includes the stub, which would otherwise flip\n // `isAddingSecondaryJob` to true and hide `Fields.FlsaStatus` mid-submit.\n //\n // In steady-state flows (edit primary, edit secondary, add secondary), the\n // real primary already exists when the query first resolves, so the snapshot\n // is `true` and live `employeeJobs` continues to drive `primaryFlsaStatus`.\n // Recovery for the rare case where a partner mounts before any jobs exist\n // and a primary is created externally mid-form is to remount the hook\n // (e.g., via a `key` change).\n const hadPrimaryAtMountRef = useRef<boolean | null>(null)\n if (hadPrimaryAtMountRef.current === null && employeeJobs !== undefined) {\n hadPrimaryAtMountRef.current = employeeJobs.some(job => job.primary)\n }\n const hadPrimaryAtMount = hadPrimaryAtMountRef.current === true\n\n // FLSA status of the employee's primary job's current compensation, when one\n // exists. Used as a fallback default when adding a *secondary* job/comp so the\n // multi-job classification stays consistent with the primary by default — the\n // user can still override it (when allowed). Null when there was no primary\n // job at the moment the hook first observed `employeeJobs`, or when the\n // primary has no current compensation yet.\n const primaryFlsaStatus = hadPrimaryAtMount ? findPrimaryFlsaStatus(employeeJobs) : null\n\n const hireDate =\n currentJob?.hireDate ??\n // Secondary jobs being created (CompensationAddAnotherJobForm) have no hireDate until the\n // job POST completes. Fall back to the primary job's hireDate so the schema\n // can enforce EFFECTIVE_DATE_BEFORE_HIRE during that window.\n employeeJobs?.find(j => j.primary)?.hireDate ??\n null\n\n // In update mode, exclude the compensation being edited so it doesn't\n // bound `maximumEffectiveDate` to its own current date — that would prevent\n // the user from pushing the pending effective date further out.\n const futureCompensations = findFutureCompensations(currentJob).filter(\n c => c.uuid !== compensationId,\n )\n const hasPendingFutureCompensation = futureCompensations.length > 0\n const maximumEffectiveDate = earliestEffectiveDate(futureCompensations)\n\n const isCreateMode = !compensationId\n const mode = isCreateMode ? 'create' : 'update'\n // Adding a secondary job (the employee already has a primary). The Gusto API\n // only allows secondaries when the primary's current FLSA is Nonexempt, and\n // the secondary itself must match — so the FLSA field is not user-editable\n // in this branch. We force the form value to the primary's FLSA below and\n // hide `Fields.FlsaStatus`.\n // True when adding a brand-new secondary job (not when scheduling a future\n // comp for the primary). The distinction matters: for the primary's future\n // comp, FLSA should be editable; for a secondary, it must match the primary.\n const isAddingSecondaryJob =\n isCreateMode && primaryFlsaStatus === FlsaStatus.NONEXEMPT && currentJob?.primary !== true\n\n // Derive the effective-date floor internally so consumers don't need to wire\n // it up. Rules by mode and job type:\n // create (any job): tomorrow — new comp must be future-dated\n // update, primary: undefined — the carve-out (willDeleteSecondaryJobs) can\n // force effectiveDate to today on a disabled field; enforcing a floor here\n // would produce a spurious EFFECTIVE_DATE_BEFORE_MIN on submit.\n // update, secondary: tomorrow — must be in the future\n // The hire-date lower bound is handled separately in the schema via the\n // `hireDate` option (→ EFFECTIVE_DATE_BEFORE_HIRE), which fires alongside\n // this check so each violation gets its own error message.\n const internalMinEffectiveDate = useMemo(() => {\n if (!withEffectiveDateField) return undefined\n if (!isCreateMode && currentJob?.primary === true) return undefined\n\n return formatDateToStringDate(addDays(new Date(), 1)) ?? undefined\n }, [isCreateMode, currentJob?.primary, withEffectiveDateField])\n\n const [schema, metadataConfig] = useMemo(\n () =>\n createCompensationSchema({\n mode,\n optionalFieldsToRequire,\n hireDate,\n minEffectiveDate: internalMinEffectiveDate,\n withEffectiveDateField,\n }),\n [mode, optionalFieldsToRequire, hireDate, internalMinEffectiveDate, withEffectiveDateField],\n )\n\n const state = currentWorkAddress?.state\n\n // `flsaStatus` is intentionally allowed to be undefined so the field renders\n // an empty placeholder when nothing is provided — partners can choose to\n // seed it via `defaultValues.flsaStatus`. When a `compensation` is loaded we\n // seed from it; for a brand-new secondary job we inherit from the primary's\n // current compensation so multi-job classification stays consistent. The\n // schema enforces requiredness on submit in `create` mode (see\n // `requiredFieldsConfig` in compensationSchema.ts).\n //\n // `title` lives on compensation in the API — `job.title` is a denormalized\n // snapshot of the primary comp's title that can lag behind comp-level edits\n // on secondaries. Seed directly from the loaded compensation so editing in\n // place can't silently re-introduce a stale title from the job record.\n const resolvedDefaults: CompensationFormData = useMemo(\n () => ({\n title: currentCompensation?.title ?? partnerDefaults?.title ?? '',\n // When adding a secondary, the FLSA must match the primary's — force it\n // here (overriding any partner default) so the form submits the right\n // value even though `Fields.FlsaStatus` is hidden.\n flsaStatus: isAddingSecondaryJob\n ? primaryFlsaStatus\n : (currentCompensation?.flsaStatus ??\n partnerDefaults?.flsaStatus ??\n primaryFlsaStatus ??\n undefined),\n rate: Number(currentCompensation?.rate ?? partnerDefaults?.rate ?? 0),\n adjustForMinimumWage:\n currentCompensation?.adjustForMinimumWage ?? partnerDefaults?.adjustForMinimumWage ?? false,\n minimumWageId:\n currentCompensation?.minimumWages?.[0]?.uuid ?? partnerDefaults?.minimumWageId ?? '',\n paymentUnit:\n currentCompensation?.paymentUnit ?? partnerDefaults?.paymentUnit ?? PAY_PERIODS.HOUR,\n effectiveDate: currentCompensation?.effectiveDate ?? partnerDefaults?.effectiveDate ?? null,\n }),\n [currentCompensation, currentJob, partnerDefaults, primaryFlsaStatus, isAddingSecondaryJob],\n )\n\n const formMethods = useForm<CompensationFormData, unknown, CompensationFormOutputs>({\n resolver: zodResolver(schema),\n mode: validationMode,\n shouldFocusError,\n defaultValues: resolvedDefaults,\n values: resolvedDefaults,\n resetOptions: { keepDirtyValues: true },\n })\n\n const { control, getValues, setValue, clearErrors } = formMethods\n const watchedFlsaStatus = useWatch({ control, name: 'flsaStatus' })\n const watchedAdjustForMinimumWage = useWatch({\n control,\n name: 'adjustForMinimumWage',\n })\n\n // Validation rules for `paymentUnit` and `rate` are FLSA-driven, so any\n // prior error on those fields is stale once FLSA changes. RHF doesn't clear\n // them on its own (`setValue` without `shouldValidate` skips the resolver,\n // and reValidate is per-field) — clear eagerly and let the next blur/submit\n // re-establish the error if it still applies.\n useEffect(() => {\n clearErrors(['paymentUnit', 'rate'])\n if (watchedFlsaStatus === FlsaStatus.OWNER) {\n setValue('paymentUnit', PAY_PERIODS.PAYCHECK)\n } else if (\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n ) {\n setValue('paymentUnit', PAY_PERIODS.YEAR)\n setValue('rate', 0)\n } else {\n setValue('paymentUnit', resolvedDefaults.paymentUnit)\n }\n }, [watchedFlsaStatus, setValue, clearErrors, resolvedDefaults.paymentUnit])\n\n // The FLSA status that represents the employee's current classification.\n // In update mode this is the compensation being edited. In create mode\n // `currentCompensation` is null, so fall back to the job's active\n // compensation (identified by currentCompensationUuid) — this lets the\n // secondary-job warning fire even when scheduling a future-dated change.\n const currentJobActiveComp = currentJob\n ? currentJob.compensations?.find(c => c.uuid === currentJob.currentCompensationUuid)\n : undefined\n const effectiveBaseFlsaStatus =\n currentCompensation?.flsaStatus ?? currentJobActiveComp?.flsaStatus ?? null\n\n // True when the user is changing FLSA away from Nonexempt on a job that has\n // secondary jobs — those secondaries will be deleted by the API when the\n // new classification takes effect (immediately in update mode, at the chosen\n // effective date in create mode). Drives the warning and, in update mode\n // only, the effectiveDate-lock side effect below.\n const willDeleteSecondaryJobs =\n effectiveBaseFlsaStatus === FlsaStatus.NONEXEMPT &&\n watchedFlsaStatus !== undefined &&\n watchedFlsaStatus !== FlsaStatus.NONEXEMPT &&\n otherJobsCount > 0\n\n // Carve-out UX — update mode only: while willDeleteSecondaryJobs is active\n // the server deletes secondaries immediately on PUT. Mirror this by forcing\n // `effectiveDate` to today and disabling the field. In create mode the\n // deletion happens at the chosen future date, so we show the warning but\n // leave the date field editable.\n const carveOutActiveRef = useRef(false)\n const priorEffectiveDateRef = useRef<string | null>(null)\n useEffect(() => {\n if (!isCreateMode && willDeleteSecondaryJobs && !carveOutActiveRef.current) {\n priorEffectiveDateRef.current = getValues('effectiveDate') ?? null\n setValue('effectiveDate', todayISO(), { shouldDirty: true, shouldValidate: false })\n carveOutActiveRef.current = true\n } else if (!isCreateMode && !willDeleteSecondaryJobs && carveOutActiveRef.current) {\n setValue('effectiveDate', priorEffectiveDateRef.current ?? null, {\n shouldDirty: true,\n shouldValidate: false,\n })\n priorEffectiveDateRef.current = null\n carveOutActiveRef.current = false\n }\n }, [isCreateMode, willDeleteSecondaryJobs, getValues, setValue])\n\n const updateCompensationMutation = useJobsAndCompensationsUpdateCompensationMutation()\n const createCompensationMutation = useJobsAndCompensationsCreateCompensationMutation()\n\n const isPending = updateCompensationMutation.isPending || createCompensationMutation.isPending\n\n const {\n baseSubmitHandler,\n error: submitError,\n setError: setSubmitError,\n } = useBaseSubmit('CompensationForm')\n\n const queriesForErrors = employeeId\n ? [jobsQuery, addressesQuery, employeeQuery, minWagesQuery]\n : []\n const errorHandling = composeErrorHandler(queriesForErrors, { submitError, setSubmitError })\n\n const isCommissionOnly =\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n const isOwner = watchedFlsaStatus === FlsaStatus.OWNER\n\n // Hide `Fields.FlsaStatus` when the user has no meaningful choice:\n // - update mode editing a secondary whose comp is already Nonexempt\n // (must keep matching the primary), and\n // - create mode while adding a secondary (must inherit primary's FLSA).\n // The first job's create flow and primary-job edits keep the field exposed.\n const isFlsaSelectionEnabled =\n !isAddingSecondaryJob &&\n (watchedFlsaStatus !== FlsaStatus.NONEXEMPT || currentJob?.primary === true || isCreateMode)\n\n const isAdjustMinimumWageEnabled =\n watchedFlsaStatus === FlsaStatus.NONEXEMPT &&\n minimumWages.length > 0 &&\n state !== undefined &&\n !TIP_CREDITS_UNSUPPORTED_STATES.includes(state)\n\n // Min-wage adjustment is only valid for Nonexempt FLSA (and a state that\n // allows tip credit). When the gate flips off — typically because the user\n // changed FLSA away from Nonexempt — `Fields.AdjustForMinimumWage` and\n // `Fields.MinimumWageId` stop rendering, but the underlying form values\n // persist in react-hook-form state. That would leak an\n // `adjust_for_minimum_wage: true` + `minimum_wages: [...]` body on submit\n // (server rejects with \"Minimum wage adjustments only valid for\n // flsa_status: Nonexempt\"). Reset both values to safe defaults so the\n // submitted payload always matches what the user can actually see.\n useEffect(() => {\n if (isAdjustMinimumWageEnabled) return\n if (getValues('adjustForMinimumWage')) {\n setValue('adjustForMinimumWage', false, { shouldDirty: true, shouldValidate: false })\n }\n if (getValues('minimumWageId')) {\n setValue('minimumWageId', '', { shouldDirty: true, shouldValidate: false })\n }\n // Both fields stop rendering once the gate closes — clear errors so a\n // stale one doesn't silently fail the next submit with no visible UI to fix.\n clearErrors(['adjustForMinimumWage', 'minimumWageId'])\n }, [isAdjustMinimumWageEnabled, getValues, setValue, clearErrors])\n\n const minimumWageOptions = minimumWages.map(wage => ({\n value: wage.uuid,\n label: `${wage.wage} - ${wage.authority}: ${wage.notes ?? ''}`,\n }))\n\n const baseMetadata = useDeriveFieldsMetadata(metadataConfig, formMethods.control)\n const effectiveDateMinDate = useMemo(\n () =>\n [internalMinEffectiveDate, hireDate]\n .filter((d): d is string => !!d)\n .reduce<string | null>((max, d) => (!max || d > max ? d : max), null),\n [internalMinEffectiveDate, hireDate],\n )\n const fieldsMetadata = buildCompensationFieldsMetadata(baseMetadata, {\n willDeleteSecondaryJobs,\n isCreateMode,\n isCommissionOnly,\n isOwner,\n isAdjustMinimumWageEnabled,\n effectiveDateMinDate,\n maximumEffectiveDate,\n minimumWageOptions,\n minimumWages,\n })\n\n const onSubmit = async (\n options?: CompensationSubmitOptions,\n ): Promise<HookSubmitResult<Compensation> | undefined> => {\n let submitResult: HookSubmitResult<Compensation> | undefined\n\n await new Promise<void>(resolve => {\n void formMethods.handleSubmit(\n async (data: CompensationFormOutputs) => {\n await baseSubmitHandler(data, async payload => {\n const resolvedJobId = options?.jobId ?? jobId\n const resolvedCompensationId = options?.compensationId ?? compensationId\n const resolvedMode = resolvedCompensationId ? 'update' : 'create'\n\n // When the field is rendered, the validated payload value wins\n // unless an explicit submit-time override is supplied. When the\n // field is hidden (`withEffectiveDateField: false`) we are\n // strictly options-only — matching `useWorkAddressForm` and the\n // hidden-field behavior of `useHomeAddressForm` / `useJobForm`.\n // The carve-out's form-state side effect (force value to today)\n // is therefore inert in the hidden-field path; partners who\n // need a specific date there must supply it via\n // `CompensationSubmitOptions.effectiveDate`.\n const resolvedEffectiveDate = withEffectiveDateField\n ? (options?.effectiveDate ?? payload.effectiveDate ?? undefined)\n : (options?.effectiveDate ?? undefined)\n\n const requestBodyBase = {\n rate: String(payload.rate),\n paymentUnit: payload.paymentUnit,\n flsaStatus: payload.flsaStatus,\n effectiveDate: resolvedEffectiveDate,\n title: payload.title || undefined,\n adjustForMinimumWage: payload.adjustForMinimumWage,\n minimumWages: payload.adjustForMinimumWage ? [{ uuid: payload.minimumWageId }] : [],\n }\n\n let result: Compensation | undefined\n\n if (resolvedMode === 'create') {\n if (!resolvedJobId) {\n throw new SDKInternalError(\n 'jobId is required to create a compensation. Pass it as a hook prop or via submit options.',\n )\n }\n // Schema's `requiredFieldsConfig` guarantees `flsaStatus` is set\n // on create-mode submit; the runtime guard appeases the API\n // request-body type (which requires a non-undefined value on\n // POST, vs. the optional PUT body).\n if (!payload.flsaStatus) {\n throw new SDKInternalError('flsaStatus is required to create a compensation.')\n }\n const createResponse = await createCompensationMutation.mutateAsync({\n request: {\n jobId: resolvedJobId,\n compensationsRequestBody: { ...requestBodyBase, flsaStatus: payload.flsaStatus },\n },\n })\n result = createResponse.compensation\n if (!result) throw new SDKInternalError('Compensation creation failed')\n } else {\n if (!resolvedCompensationId) {\n throw new SDKInternalError(\n 'compensationId is required to update a compensation. Pass it as a hook prop or via submit options.',\n )\n }\n const resolvedVersion =\n options?.compensationVersion ?? (currentCompensation?.version as string | undefined)\n if (!resolvedVersion) {\n throw new SDKInternalError(\n 'compensation version is required to update a compensation. Pass it via submit options when threading post-create, or ensure the compensation is loaded.',\n )\n }\n const updateResponse = await updateCompensationMutation.mutateAsync({\n request: {\n compensationId: resolvedCompensationId,\n compensationsUpdateRequestBody: {\n version: resolvedVersion,\n ...requestBodyBase,\n },\n },\n })\n result = updateResponse.compensation\n if (!result) throw new SDKInternalError('Compensation update failed')\n }\n\n submitResult = { mode: resolvedMode, data: result }\n })\n resolve()\n },\n () => {\n resolve()\n },\n )()\n })\n\n return submitResult\n }\n\n const isDataLoading = employeeId\n ? jobsQuery.isLoading ||\n addressesQuery.isLoading ||\n employeeQuery.isLoading ||\n minWagesQuery.isLoading\n : false\n\n const hookFormInternals = useHookFormInternals(formMethods)\n\n if (isDataLoading || (employeeId && (!employeeJobs || !employee))) {\n return { isLoading: true as const, errorHandling }\n }\n\n return {\n isLoading: false as const,\n data: {\n compensation: currentCompensation,\n currentJob,\n minimumWages,\n minimumEffectiveDate: effectiveDateMinDate,\n maximumEffectiveDate,\n hasPendingFutureCompensation,\n },\n status: {\n isPending,\n mode,\n willDeleteSecondaryJobs,\n showCommissionFederalMinimumPayAlert: watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT,\n showCommissionMinimumWageAlert: watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT,\n showOwnerSalaryAlert: watchedFlsaStatus === FlsaStatus.OWNER,\n },\n actions: { onSubmit },\n errorHandling,\n form: {\n Fields: {\n Title: TitleField,\n FlsaStatus: isFlsaSelectionEnabled ? FlsaStatusField : undefined,\n Rate: isCommissionOnly ? undefined : RateField,\n PaymentUnit: isCommissionOnly ? undefined : PaymentUnitField,\n AdjustForMinimumWage: isAdjustMinimumWageEnabled ? AdjustForMinimumWageField : undefined,\n MinimumWageId:\n isAdjustMinimumWageEnabled && watchedAdjustForMinimumWage\n ? MinimumWageIdField\n : undefined,\n EffectiveDate: withEffectiveDateField ? EffectiveDateField : undefined,\n },\n fieldsMetadata,\n hookFormInternals,\n getFormSubmissionValues: createGetFormSubmissionValues(formMethods, schema),\n },\n }\n}\n\n/**\n * Discriminated union returned by {@link useCompensationForm} — either the loading state or the ready state.\n *\n * @remarks\n * Use this type when threading the hook result through helpers (e.g.\n * presentational components). Discriminate on `isLoading` to narrow to\n * {@link UseCompensationFormReady}.\n *\n * @public\n */\nexport type UseCompensationFormResult = HookLoadingResult | UseCompensationFormReady\n\n/**\n * Metadata for each {@link useCompensationForm} field, exposed on `form.fieldsMetadata`.\n *\n * @remarks\n * Includes per-field `isDisabled`, `isRequired`, and the dynamic option list\n * for select fields (`flsaStatus`, `paymentUnit`, `minimumWageId`).\n * `effectiveDate` additionally carries `minDate` / `maxDate` derived from\n * the parent job's hire date and any pending future compensation.\n *\n * @public\n */\nexport type CompensationFieldsMetadata = ReturnType<typeof buildCompensationFieldsMetadata>\n"],"names":["resolveCompAndJob","jobs","compensationId","jobId","job","compensation","c","j","findPrimaryFlsaStatus","findFutureCompensations","today","todayISO","earliestEffectiveDate","comps","min","d","flsaStatusEntries","FlsaStatus","flsaOptions","status","paymentUnitEntries","PAY_PERIODS","paymentUnitOptions","unit","buildCompensationFieldsMetadata","base","willDeleteSecondaryJobs","isCreateMode","isCommissionOnly","isOwner","isAdjustMinimumWageEnabled","effectiveDateMinDate","maximumEffectiveDate","minimumWageOptions","minimumWages","withFlags","withOptions","useCompensationForm","employeeId","optionalFieldsToRequire","partnerDefaults","validationMode","shouldFocusError","withEffectiveDateField","jobsQuery","useJobsAndCompensationsGetJobs","GetV1EmployeesEmployeeIdJobsQueryParamInclude","addressesQuery","useEmployeeAddressesGetWorkAddresses","employeeQuery","useEmployeesGet","employeeJobs","currentWorkAddress","address","locationUuid","employee","minWagesQuery","useLocationsGetMinimumWages","currentCompensation","currentJob","otherJobsCount","hadPrimaryAtMountRef","useRef","primaryFlsaStatus","hireDate","futureCompensations","hasPendingFutureCompensation","mode","isAddingSecondaryJob","internalMinEffectiveDate","useMemo","formatDateToStringDate","addDays","schema","metadataConfig","createCompensationSchema","state","resolvedDefaults","formMethods","useForm","zodResolver","control","getValues","setValue","clearErrors","watchedFlsaStatus","useWatch","watchedAdjustForMinimumWage","useEffect","currentJobActiveComp","carveOutActiveRef","priorEffectiveDateRef","updateCompensationMutation","useJobsAndCompensationsUpdateCompensationMutation","createCompensationMutation","useJobsAndCompensationsCreateCompensationMutation","isPending","baseSubmitHandler","submitError","setSubmitError","useBaseSubmit","errorHandling","composeErrorHandler","isFlsaSelectionEnabled","TIP_CREDITS_UNSUPPORTED_STATES","wage","baseMetadata","useDeriveFieldsMetadata","max","fieldsMetadata","onSubmit","options","submitResult","resolve","data","payload","resolvedJobId","resolvedCompensationId","resolvedMode","resolvedEffectiveDate","requestBodyBase","result","SDKInternalError","resolvedVersion","isDataLoading","hookFormInternals","useHookFormInternals","TitleField","FlsaStatusField","RateField","PaymentUnitField","AdjustForMinimumWageField","MinimumWageIdField","EffectiveDateField","createGetFormSubmissionValues"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA6PA,SAASA,GACPC,GACAC,GACAC,GACwD;AACxD,MAAI,CAACF,EAAM,QAAO,EAAE,cAAc,MAAM,KAAK,KAAA;AAC7C,MAAIC,GAAgB;AAClB,eAAWE,KAAOH,GAAM;AACtB,YAAMI,IAAeD,EAAI,eAAe,KAAK,CAAAE,MAAKA,EAAE,SAASJ,CAAc;AAC3E,UAAIG,EAAc,QAAO,EAAE,cAAAA,GAAc,KAAAD,EAAA;AAAA,IAC3C;AAIA,WAAO,EAAE,cAAc,MAAM,KADTD,IAASF,EAAK,KAAK,OAAKM,EAAE,SAASJ,CAAK,KAAK,OAAQ,KACvC;AAAA,EACpC;AACA,SAAIA,IAAc,EAAE,cAAc,MAAM,KAAKF,EAAK,KAAK,CAAAM,MAAKA,EAAE,SAASJ,CAAK,KAAK,KAAA,IAC1E,EAAE,cAAc,MAAM,KAAK,KAAA;AACpC;AAEA,SAASK,GAAsBP,GAAgD;AAC7E,MAAI,CAACA,EAAM,QAAO;AAClB,aAAWG,KAAOH,GAAM;AACtB,QAAI,CAACG,EAAI,QAAS;AAClB,UAAMC,IAAeD,EAAI,eAAe,KAAK,OAAKE,EAAE,SAASF,EAAI,uBAAuB;AACxF,QAAIC,GAAc,WAAY,QAAOA,EAAa;AAAA,EACpD;AACA,SAAO;AACT;AAEA,SAASI,GAAwBL,GAAiC;AAChE,MAAI,CAACA,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,KACA;AAAA,QACN,eAAezF,IAAyB0F,KAAqB;AAAA,MAAA;AAAA,MAE/D,gBAAAxB;AAAA,MACA,mBAAAgB;AAAA,MACA,yBAAyBS,GAA8BxD,GAAaL,CAAM;AAAA,IAAA;AAAA,EAC5E;AAEJ;"}
|
|
@@ -32,4 +32,4 @@ export interface DashboardProps extends BaseComponentInterface<'Employee.Dashboa
|
|
|
32
32
|
* @returns A React element rendering the employee dashboard.
|
|
33
33
|
* @public
|
|
34
34
|
*/
|
|
35
|
-
export declare function Dashboard({ FallbackComponent, ...props }: DashboardProps): import("react").JSX.Element;
|
|
35
|
+
export declare function Dashboard({ FallbackComponent, LoaderComponent, ...props }: DashboardProps): import("react").JSX.Element;
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as x, Suspense as y } from "react";
|
|
3
3
|
import { useTranslation as c } from "react-i18next";
|
|
4
|
-
import { useEmployeesGetSuspense as
|
|
5
|
-
import { BasicDetailsView as
|
|
6
|
-
import { JobAndPayView as
|
|
4
|
+
import { useEmployeesGetSuspense as T } from "@gusto/embedded-api/react-query/employeesGet";
|
|
5
|
+
import { BasicDetailsView as A } from "./BasicDetailsView.js";
|
|
6
|
+
import { JobAndPayView as g } from "./JobAndPayView.js";
|
|
7
7
|
import { TaxesViewWithData as C } from "./TaxesView.js";
|
|
8
8
|
import { Flex as l } from "../../Common/Flex/Flex.js";
|
|
9
9
|
import { useComponentContext as b } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
|
-
import { BaseBoundaries as
|
|
11
|
-
import { useI18n as
|
|
12
|
-
import { componentEvents as
|
|
13
|
-
import { firstLastName as
|
|
14
|
-
import { DocumentsCard as
|
|
15
|
-
function
|
|
16
|
-
employeeId:
|
|
17
|
-
dictionary:
|
|
18
|
-
onEvent:
|
|
19
|
-
selectedTab: r
|
|
10
|
+
import { BaseBoundaries as E } from "../../Base/Base.js";
|
|
11
|
+
import { useI18n as j, useComponentDictionary as B } from "../../../i18n/I18n.js";
|
|
12
|
+
import { componentEvents as N } from "../../../shared/constants.js";
|
|
13
|
+
import { firstLastName as P } from "../../../helpers/formattedStrings.js";
|
|
14
|
+
import { DocumentsCard as S } from "../Documents/management/DocumentsCard/DocumentsCard.js";
|
|
15
|
+
function _({
|
|
16
|
+
employeeId: a,
|
|
17
|
+
dictionary: o,
|
|
18
|
+
onEvent: t,
|
|
19
|
+
selectedTab: r,
|
|
20
|
+
LoaderComponent: p
|
|
20
21
|
}) {
|
|
21
|
-
|
|
22
|
-
const { t: n } = c("Employee.Dashboard"),
|
|
22
|
+
j("Employee.Dashboard"), B("Employee.Dashboard", o);
|
|
23
|
+
const { t: n } = c("Employee.Dashboard"), d = b(), [u, f] = x("basicDetails"), s = r ?? u, D = [
|
|
23
24
|
{
|
|
24
25
|
id: "basicDetails",
|
|
25
26
|
label: n("tabs.basicDetails"),
|
|
@@ -42,42 +43,57 @@ function S({
|
|
|
42
43
|
}
|
|
43
44
|
];
|
|
44
45
|
return /* @__PURE__ */ i(l, { flexDirection: "column", gap: 32, children: [
|
|
45
|
-
/* @__PURE__ */ e(
|
|
46
|
+
/* @__PURE__ */ e(y, { fallback: null, children: /* @__PURE__ */ e(H, { employeeId: a }) }),
|
|
46
47
|
/* @__PURE__ */ i(l, { flexDirection: "column", gap: 8, children: [
|
|
47
48
|
/* @__PURE__ */ e(
|
|
48
|
-
|
|
49
|
+
d.Tabs,
|
|
49
50
|
{
|
|
50
|
-
tabs:
|
|
51
|
+
tabs: D,
|
|
51
52
|
selectedId: s,
|
|
52
|
-
onSelectionChange: (
|
|
53
|
-
const m =
|
|
54
|
-
|
|
53
|
+
onSelectionChange: (h) => {
|
|
54
|
+
const m = h;
|
|
55
|
+
f(m), t(N.EMPLOYEE_DASHBOARD_TAB_CHANGE, { tab: m });
|
|
55
56
|
},
|
|
56
57
|
"aria-label": n("tabsLabel")
|
|
57
58
|
}
|
|
58
59
|
),
|
|
59
60
|
/* @__PURE__ */ i(l, { flexDirection: "column", gap: 24, children: [
|
|
60
|
-
s === "basicDetails" && /* @__PURE__ */ e(
|
|
61
|
-
s === "jobAndPay" && /* @__PURE__ */ e(
|
|
62
|
-
s === "taxes" && /* @__PURE__ */ e(C, { employeeId:
|
|
63
|
-
s === "documents" && /* @__PURE__ */ e(
|
|
61
|
+
s === "basicDetails" && /* @__PURE__ */ e(A, { employeeId: a, onEvent: t }),
|
|
62
|
+
s === "jobAndPay" && /* @__PURE__ */ e(g, { employeeId: a, onEvent: t }),
|
|
63
|
+
s === "taxes" && /* @__PURE__ */ e(C, { employeeId: a, onEvent: t }),
|
|
64
|
+
s === "documents" && /* @__PURE__ */ e(
|
|
65
|
+
S,
|
|
66
|
+
{
|
|
67
|
+
employeeId: a,
|
|
68
|
+
onEvent: t,
|
|
69
|
+
LoaderComponent: p
|
|
70
|
+
}
|
|
71
|
+
)
|
|
64
72
|
] })
|
|
65
73
|
] })
|
|
66
74
|
] });
|
|
67
75
|
}
|
|
68
|
-
function
|
|
69
|
-
const { t:
|
|
76
|
+
function H({ employeeId: a }) {
|
|
77
|
+
const { t: o } = c("Employee.Dashboard"), t = b(), {
|
|
70
78
|
data: { employee: r }
|
|
71
|
-
} =
|
|
79
|
+
} = T({ employeeId: a });
|
|
72
80
|
return /* @__PURE__ */ i(l, { flexDirection: "column", gap: 4, children: [
|
|
73
|
-
/* @__PURE__ */ e(
|
|
74
|
-
/* @__PURE__ */ e(
|
|
81
|
+
/* @__PURE__ */ e(t.Heading, { as: "h2", children: P({ first_name: r?.firstName, last_name: r?.lastName }) }),
|
|
82
|
+
/* @__PURE__ */ e(t.Text, { variant: "supporting", children: o("employeeRoleLabel") })
|
|
75
83
|
] });
|
|
76
84
|
}
|
|
77
|
-
function
|
|
78
|
-
return /* @__PURE__ */ e(
|
|
85
|
+
function K({ FallbackComponent: a, LoaderComponent: o, ...t }) {
|
|
86
|
+
return /* @__PURE__ */ e(
|
|
87
|
+
E,
|
|
88
|
+
{
|
|
89
|
+
componentName: "Employee.Dashboard",
|
|
90
|
+
FallbackComponent: a,
|
|
91
|
+
LoaderComponent: o,
|
|
92
|
+
children: /* @__PURE__ */ e(_, { ...t, LoaderComponent: o })
|
|
93
|
+
}
|
|
94
|
+
);
|
|
79
95
|
}
|
|
80
96
|
export {
|
|
81
|
-
|
|
97
|
+
K as Dashboard
|
|
82
98
|
};
|
|
83
99
|
//# sourceMappingURL=Dashboard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dashboard.js","sources":["../../../../src/components/Employee/Dashboard/Dashboard.tsx"],"sourcesContent":["import { Suspense, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { BasicDetailsView } from './BasicDetailsView'\nimport { JobAndPayView } from './JobAndPayView'\nimport { TaxesViewWithData } from './TaxesView'\nimport { DocumentsCard } from '@/components/Employee/Documents/management/DocumentsCard'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { BaseBoundaries, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { firstLastName } from '@/helpers/formattedStrings'\n\n/** @public */\nexport type DashboardTab = 'basicDetails' | 'jobAndPay' | 'taxes' | 'documents'\n\n/** @public */\nexport interface DashboardProps extends BaseComponentInterface<'Employee.Dashboard'> {\n /** The associated employee identifier. */\n employeeId: string\n /** The currently active tab. Defaults to `'basicDetails'` when uncontrolled. */\n selectedTab?: DashboardTab\n}\n\nfunction DashboardRoot({\n employeeId,\n dictionary,\n onEvent,\n selectedTab: controlledTab,\n}: DashboardProps) {\n useI18n('Employee.Dashboard')\n useComponentDictionary('Employee.Dashboard', dictionary)\n const { t } = useTranslation('Employee.Dashboard')\n const Components = useComponentContext()\n const [internalTab, setInternalTab] = useState<DashboardTab>('basicDetails')\n const selectedTab = controlledTab ?? internalTab\n\n const tabs = [\n {\n id: 'basicDetails' as const,\n label: t('tabs.basicDetails'),\n content: null,\n },\n {\n id: 'jobAndPay' as const,\n label: t('tabs.jobAndPay'),\n content: null,\n },\n {\n id: 'taxes' as const,\n label: t('tabs.taxes'),\n content: null,\n },\n {\n id: 'documents' as const,\n label: t('tabs.documents'),\n content: null,\n },\n ]\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Suspense fallback={null}>\n <DashboardHeader employeeId={employeeId} />\n </Suspense>\n\n <Flex flexDirection=\"column\" gap={8}>\n <Components.Tabs\n tabs={tabs}\n selectedId={selectedTab}\n onSelectionChange={id => {\n const next = id as DashboardTab\n setInternalTab(next)\n onEvent(componentEvents.EMPLOYEE_DASHBOARD_TAB_CHANGE, { tab: next })\n }}\n aria-label={t('tabsLabel')}\n />\n\n <Flex flexDirection=\"column\" gap={24}>\n {selectedTab === 'basicDetails' && (\n <BasicDetailsView employeeId={employeeId} onEvent={onEvent} />\n )}\n\n {selectedTab === 'jobAndPay' && (\n <JobAndPayView employeeId={employeeId} onEvent={onEvent} />\n )}\n\n {selectedTab === 'taxes' && (\n <TaxesViewWithData employeeId={employeeId} onEvent={onEvent} />\n )}\n\n {selectedTab === 'documents' && (\n <DocumentsCard
|
|
1
|
+
{"version":3,"file":"Dashboard.js","sources":["../../../../src/components/Employee/Dashboard/Dashboard.tsx"],"sourcesContent":["import { Suspense, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { BasicDetailsView } from './BasicDetailsView'\nimport { JobAndPayView } from './JobAndPayView'\nimport { TaxesViewWithData } from './TaxesView'\nimport { DocumentsCard } from '@/components/Employee/Documents/management/DocumentsCard'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { BaseBoundaries, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { firstLastName } from '@/helpers/formattedStrings'\n\n/** @public */\nexport type DashboardTab = 'basicDetails' | 'jobAndPay' | 'taxes' | 'documents'\n\n/** @public */\nexport interface DashboardProps extends BaseComponentInterface<'Employee.Dashboard'> {\n /** The associated employee identifier. */\n employeeId: string\n /** The currently active tab. Defaults to `'basicDetails'` when uncontrolled. */\n selectedTab?: DashboardTab\n}\n\nfunction DashboardRoot({\n employeeId,\n dictionary,\n onEvent,\n selectedTab: controlledTab,\n LoaderComponent,\n}: DashboardProps) {\n useI18n('Employee.Dashboard')\n useComponentDictionary('Employee.Dashboard', dictionary)\n const { t } = useTranslation('Employee.Dashboard')\n const Components = useComponentContext()\n const [internalTab, setInternalTab] = useState<DashboardTab>('basicDetails')\n const selectedTab = controlledTab ?? internalTab\n\n const tabs = [\n {\n id: 'basicDetails' as const,\n label: t('tabs.basicDetails'),\n content: null,\n },\n {\n id: 'jobAndPay' as const,\n label: t('tabs.jobAndPay'),\n content: null,\n },\n {\n id: 'taxes' as const,\n label: t('tabs.taxes'),\n content: null,\n },\n {\n id: 'documents' as const,\n label: t('tabs.documents'),\n content: null,\n },\n ]\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Suspense fallback={null}>\n <DashboardHeader employeeId={employeeId} />\n </Suspense>\n\n <Flex flexDirection=\"column\" gap={8}>\n <Components.Tabs\n tabs={tabs}\n selectedId={selectedTab}\n onSelectionChange={id => {\n const next = id as DashboardTab\n setInternalTab(next)\n onEvent(componentEvents.EMPLOYEE_DASHBOARD_TAB_CHANGE, { tab: next })\n }}\n aria-label={t('tabsLabel')}\n />\n\n <Flex flexDirection=\"column\" gap={24}>\n {selectedTab === 'basicDetails' && (\n <BasicDetailsView employeeId={employeeId} onEvent={onEvent} />\n )}\n\n {selectedTab === 'jobAndPay' && (\n <JobAndPayView employeeId={employeeId} onEvent={onEvent} />\n )}\n\n {selectedTab === 'taxes' && (\n <TaxesViewWithData employeeId={employeeId} onEvent={onEvent} />\n )}\n\n {selectedTab === 'documents' && (\n <DocumentsCard\n employeeId={employeeId}\n onEvent={onEvent}\n LoaderComponent={LoaderComponent}\n />\n )}\n </Flex>\n </Flex>\n </Flex>\n )\n}\n\nfunction DashboardHeader({ employeeId }: { employeeId: string }) {\n const { t } = useTranslation('Employee.Dashboard')\n const Components = useComponentContext()\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n\n return (\n <Flex flexDirection=\"column\" gap={4}>\n <Components.Heading as=\"h2\">\n {firstLastName({ first_name: employee?.firstName, last_name: employee?.lastName })}\n </Components.Heading>\n <Components.Text variant=\"supporting\">{t('employeeRoleLabel')}</Components.Text>\n </Flex>\n )\n}\n\n/**\n * Employee self-service dashboard summarizing a single employee's basic details, job and pay, taxes, and documents.\n *\n * @remarks\n * Renders a tabbed overview of the employee, wrapped in the SDK's standard error and suspense\n * boundaries. The active tab may be controlled via `selectedTab` or left uncontrolled, in which\n * case it defaults to basic details. Each tab composes the read-only section cards listed below.\n *\n * @components\n * - {@link ProfileCard}\n * - {@link HomeAddressCard}\n * - {@link WorkAddressCard}\n * - {@link CompensationCard}\n * - {@link PaymentMethodCard}\n * - {@link DeductionsCard}\n * - {@link PaystubsCard}\n * - {@link FederalTaxesCard}\n * - {@link StateTaxesCard}\n * - {@link DocumentsCard}\n *\n * @param props - Component props. See {@link DashboardProps}.\n * @returns A React element rendering the employee dashboard.\n * @public\n */\nexport function Dashboard({ FallbackComponent, LoaderComponent, ...props }: DashboardProps) {\n return (\n <BaseBoundaries\n componentName=\"Employee.Dashboard\"\n FallbackComponent={FallbackComponent}\n LoaderComponent={LoaderComponent}\n >\n <DashboardRoot {...props} LoaderComponent={LoaderComponent} />\n </BaseBoundaries>\n )\n}\n"],"names":["DashboardRoot","employeeId","dictionary","onEvent","controlledTab","LoaderComponent","useI18n","useComponentDictionary","t","useTranslation","Components","useComponentContext","internalTab","setInternalTab","useState","selectedTab","tabs","jsxs","Flex","jsx","Suspense","DashboardHeader","id","next","componentEvents","BasicDetailsView","JobAndPayView","TaxesViewWithData","DocumentsCard","employee","useEmployeesGetSuspense","firstLastName","Dashboard","FallbackComponent","props","BaseBoundaries"],"mappings":";;;;;;;;;;;;;;AAyBA,SAASA,EAAc;AAAA,EACrB,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAaC;AAAA,EACb,iBAAAC;AACF,GAAmB;AACjB,EAAAC,EAAQ,oBAAoB,GAC5BC,EAAuB,sBAAsBL,CAAU;AACvD,QAAM,EAAE,GAAAM,EAAA,IAAMC,EAAe,oBAAoB,GAC3CC,IAAaC,EAAA,GACb,CAACC,GAAaC,CAAc,IAAIC,EAAuB,cAAc,GACrEC,IAAcX,KAAiBQ,GAE/BI,IAAO;AAAA,IACX;AAAA,MACE,IAAI;AAAA,MACJ,OAAOR,EAAE,mBAAmB;AAAA,MAC5B,SAAS;AAAA,IAAA;AAAA,IAEX;AAAA,MACE,IAAI;AAAA,MACJ,OAAOA,EAAE,gBAAgB;AAAA,MACzB,SAAS;AAAA,IAAA;AAAA,IAEX;AAAA,MACE,IAAI;AAAA,MACJ,OAAOA,EAAE,YAAY;AAAA,MACrB,SAAS;AAAA,IAAA;AAAA,IAEX;AAAA,MACE,IAAI;AAAA,MACJ,OAAOA,EAAE,gBAAgB;AAAA,MACzB,SAAS;AAAA,IAAA;AAAA,EACX;AAGF,SACE,gBAAAS,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAC,EAACC,KAAS,UAAU,MAClB,UAAA,gBAAAD,EAACE,GAAA,EAAgB,YAAApB,GAAwB,GAC3C;AAAA,IAEA,gBAAAgB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACT,EAAW;AAAA,QAAX;AAAA,UACC,MAAAM;AAAA,UACA,YAAYD;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A,EAAA,GAChE;AAEJ;AA0BO,SAASwB,EAAU,EAAE,mBAAAC,GAAmB,iBAAA5B,GAAiB,GAAG6B,KAAyB;AAC1F,SACE,gBAAAf;AAAA,IAACgB;AAAA,IAAA;AAAA,MACC,eAAc;AAAA,MACd,mBAAAF;AAAA,MACA,iBAAA5B;AAAA,MAEA,UAAA,gBAAAc,EAACnB,GAAA,EAAe,GAAGkC,GAAO,iBAAA7B,EAAA,CAAkC;AAAA,IAAA;AAAA,EAAA;AAGlE;"}
|
|
@@ -32,4 +32,4 @@ export interface DeductionsProps extends BaseComponentInterface<'Employee.Manage
|
|
|
32
32
|
* @public
|
|
33
33
|
* @group Block components
|
|
34
34
|
*/
|
|
35
|
-
export declare function Deductions({ dictionary, FallbackComponent, ...props }: DeductionsProps): import("react").JSX.Element;
|
|
35
|
+
export declare function Deductions({ dictionary, FallbackComponent, LoaderComponent, ...props }: DeductionsProps): import("react").JSX.Element;
|
|
@@ -1,36 +1,43 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createMachine as
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { DeductionsCardContextual as
|
|
5
|
-
import { deductionsStateMachine as
|
|
6
|
-
import { Flow as
|
|
7
|
-
import { BaseBoundaries as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { createMachine as i } from "robot3";
|
|
3
|
+
import { useMemo as c } from "react";
|
|
4
|
+
import { DeductionsCardContextual as u } from "./DeductionsComponents.js";
|
|
5
|
+
import { deductionsStateMachine as s } from "./deductionsStateMachine.js";
|
|
6
|
+
import { Flow as a } from "../../../Flow/Flow.js";
|
|
7
|
+
import { BaseBoundaries as p } from "../../../Base/Base.js";
|
|
8
8
|
import "../../../Base/useBase.js";
|
|
9
|
-
import { useComponentDictionary as
|
|
10
|
-
function
|
|
9
|
+
import { useComponentDictionary as f, useI18n as d } from "../../../../i18n/I18n.js";
|
|
10
|
+
function l({ employeeId: e, onEvent: t, LoaderComponent: o }) {
|
|
11
11
|
d("Employee.Management.Deductions");
|
|
12
|
-
const n =
|
|
13
|
-
() =>
|
|
14
|
-
...
|
|
15
|
-
component:
|
|
16
|
-
employeeId:
|
|
17
|
-
successAlert: null
|
|
12
|
+
const n = c(
|
|
13
|
+
() => i("card", s, (m) => ({
|
|
14
|
+
...m,
|
|
15
|
+
component: u,
|
|
16
|
+
employeeId: e,
|
|
17
|
+
successAlert: null,
|
|
18
|
+
LoaderComponent: o
|
|
18
19
|
})),
|
|
19
|
-
[o]
|
|
20
|
+
[e, o]
|
|
20
21
|
);
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
+
return /* @__PURE__ */ r(a, { machine: n, onEvent: t });
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
function F({
|
|
25
|
+
dictionary: e,
|
|
26
|
+
FallbackComponent: t,
|
|
27
|
+
LoaderComponent: o,
|
|
28
|
+
...n
|
|
29
|
+
}) {
|
|
30
|
+
return f("Employee.Management.Deductions", e), /* @__PURE__ */ r(
|
|
31
|
+
p,
|
|
26
32
|
{
|
|
27
33
|
componentName: "Employee.Management.Deductions",
|
|
28
|
-
FallbackComponent:
|
|
29
|
-
|
|
34
|
+
FallbackComponent: t,
|
|
35
|
+
LoaderComponent: o,
|
|
36
|
+
children: /* @__PURE__ */ r(l, { LoaderComponent: o, ...n })
|
|
30
37
|
}
|
|
31
38
|
);
|
|
32
39
|
}
|
|
33
40
|
export {
|
|
34
|
-
|
|
41
|
+
F as Deductions
|
|
35
42
|
};
|
|
36
43
|
//# sourceMappingURL=Deductions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Deductions.js","sources":["../../../../../src/components/Employee/Deductions/management/Deductions.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { DeductionsCardContextual, type DeductionsContextInterface } from './DeductionsComponents'\nimport { deductionsStateMachine } from './deductionsStateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport { BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useI18n } from '@/i18n'\n\n/**\n * Props for {@link Deductions}.\n *\n * @public\n */\nexport interface DeductionsProps extends BaseComponentInterface<'Employee.Management.Deductions'> {\n /** The associated employee identifier. */\n employeeId: string\n}\n\nfunction DeductionsFlow({ employeeId, onEvent }: DeductionsProps) {\n useI18n('Employee.Management.Deductions')\n\n const machine = useMemo(\n () =>\n createMachine('card', deductionsStateMachine, (ctx: DeductionsContextInterface) => ({\n ...ctx,\n component: DeductionsCardContextual,\n employeeId,\n successAlert: null,\n })),\n [employeeId],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n\n/**\n * Self-contained block for viewing and managing an employee's post-tax deductions — the same experience the dashboard surfaces, but as a drop-in component that doesn't require the surrounding dashboard chrome.\n *\n * @remarks\n * Renders a card listing the employee's active deductions with affordances to add a new deduction, edit an existing one, or delete one via a confirm dialog. Choosing to add or edit swaps the card for the deduction form; a successful save returns to the card and emits the corresponding event, and cancelling returns without saving. Wraps everything in error and suspense boundaries.\n *\n * The card and form surfaces ({@link DeductionsCard}, {@link DeductionsEditForm}) are also exported individually for cases where that orchestration is the wrong fit — for example, when the form needs to render in a modal or drawer, or when the swap is driven by a router. Using them directly means owning the swap, the alert, and any cross-component state yourself.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/deductions/card/addRequested` | Fired when the \"Add deduction\" CTA is clicked from the card; the block opens the edit form in add mode | `{ employeeId: string }` |\n * | `employee/management/deductions/card/editRequested` | Fired when an \"Edit\" CTA is clicked for a deduction; the block opens the edit form pre-populated with that deduction | The matching `Garnishment` |\n * | `employee/management/deductions/card/deleted` | Fired after a deduction is deleted via the confirm dialog; the block stays on the card | The deleted `Garnishment` |\n * | `employee/management/deductions/editForm/created` | Fired after a new deduction is saved from the edit form; the block returns to the card view | The created `Garnishment` |\n * | `employee/management/deductions/editForm/updated` | Fired after an existing deduction is updated from the edit form; the block returns to the card view | The updated `Garnishment` |\n * | `employee/management/deductions/editForm/cancelled` | Fired when the user cancels the edit form; the block returns to the card view | — |\n * | `employee/management/deductions/alertDismissed` | Fired when the user dismisses a success alert above the card | `null` |\n *\n * @param props - See {@link DeductionsProps}.\n * @returns The rendered deductions block.\n * @public\n * @group Block components\n */\nexport function Deductions({
|
|
1
|
+
{"version":3,"file":"Deductions.js","sources":["../../../../../src/components/Employee/Deductions/management/Deductions.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { DeductionsCardContextual, type DeductionsContextInterface } from './DeductionsComponents'\nimport { deductionsStateMachine } from './deductionsStateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport { BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useI18n } from '@/i18n'\n\n/**\n * Props for {@link Deductions}.\n *\n * @public\n */\nexport interface DeductionsProps extends BaseComponentInterface<'Employee.Management.Deductions'> {\n /** The associated employee identifier. */\n employeeId: string\n}\n\nfunction DeductionsFlow({ employeeId, onEvent, LoaderComponent }: DeductionsProps) {\n useI18n('Employee.Management.Deductions')\n\n const machine = useMemo(\n () =>\n createMachine('card', deductionsStateMachine, (ctx: DeductionsContextInterface) => ({\n ...ctx,\n component: DeductionsCardContextual,\n employeeId,\n successAlert: null,\n LoaderComponent,\n })),\n [employeeId, LoaderComponent],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n\n/**\n * Self-contained block for viewing and managing an employee's post-tax deductions — the same experience the dashboard surfaces, but as a drop-in component that doesn't require the surrounding dashboard chrome.\n *\n * @remarks\n * Renders a card listing the employee's active deductions with affordances to add a new deduction, edit an existing one, or delete one via a confirm dialog. Choosing to add or edit swaps the card for the deduction form; a successful save returns to the card and emits the corresponding event, and cancelling returns without saving. Wraps everything in error and suspense boundaries.\n *\n * The card and form surfaces ({@link DeductionsCard}, {@link DeductionsEditForm}) are also exported individually for cases where that orchestration is the wrong fit — for example, when the form needs to render in a modal or drawer, or when the swap is driven by a router. Using them directly means owning the swap, the alert, and any cross-component state yourself.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/deductions/card/addRequested` | Fired when the \"Add deduction\" CTA is clicked from the card; the block opens the edit form in add mode | `{ employeeId: string }` |\n * | `employee/management/deductions/card/editRequested` | Fired when an \"Edit\" CTA is clicked for a deduction; the block opens the edit form pre-populated with that deduction | The matching `Garnishment` |\n * | `employee/management/deductions/card/deleted` | Fired after a deduction is deleted via the confirm dialog; the block stays on the card | The deleted `Garnishment` |\n * | `employee/management/deductions/editForm/created` | Fired after a new deduction is saved from the edit form; the block returns to the card view | The created `Garnishment` |\n * | `employee/management/deductions/editForm/updated` | Fired after an existing deduction is updated from the edit form; the block returns to the card view | The updated `Garnishment` |\n * | `employee/management/deductions/editForm/cancelled` | Fired when the user cancels the edit form; the block returns to the card view | — |\n * | `employee/management/deductions/alertDismissed` | Fired when the user dismisses a success alert above the card | `null` |\n *\n * @param props - See {@link DeductionsProps}.\n * @returns The rendered deductions block.\n * @public\n * @group Block components\n */\nexport function Deductions({\n dictionary,\n FallbackComponent,\n LoaderComponent,\n ...props\n}: DeductionsProps) {\n useComponentDictionary('Employee.Management.Deductions', dictionary)\n return (\n <BaseBoundaries\n componentName=\"Employee.Management.Deductions\"\n FallbackComponent={FallbackComponent}\n LoaderComponent={LoaderComponent}\n >\n <DeductionsFlow LoaderComponent={LoaderComponent} {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["DeductionsFlow","employeeId","onEvent","LoaderComponent","useI18n","machine","useMemo","createMachine","deductionsStateMachine","ctx","DeductionsCardContextual","jsx","Flow","Deductions","dictionary","FallbackComponent","props","useComponentDictionary","BaseBoundaries"],"mappings":";;;;;;;;;AAmBA,SAASA,EAAe,EAAE,YAAAC,GAAY,SAAAC,GAAS,iBAAAC,KAAoC;AACjF,EAAAC,EAAQ,gCAAgC;AAExC,QAAMC,IAAUC;AAAA,IACd,MACEC,EAAc,QAAQC,GAAwB,CAACC,OAAqC;AAAA,MAClF,GAAGA;AAAA,MACH,WAAWC;AAAA,MACX,YAAAT;AAAA,MACA,cAAc;AAAA,MACd,iBAAAE;AAAA,IAAA,EACA;AAAA,IACJ,CAACF,GAAYE,CAAe;AAAA,EAAA;AAG9B,SAAO,gBAAAQ,EAACC,GAAA,EAAK,SAAAP,GAAkB,SAAAH,EAAA,CAAkB;AACnD;AA0BO,SAASW,EAAW;AAAA,EACzB,YAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,iBAAAZ;AAAA,EACA,GAAGa;AACL,GAAoB;AAClB,SAAAC,EAAuB,kCAAkCH,CAAU,GAEjE,gBAAAH;AAAA,IAACO;AAAA,IAAA;AAAA,MACC,eAAc;AAAA,MACd,mBAAAH;AAAA,MACA,iBAAAZ;AAAA,MAEA,UAAA,gBAAAQ,EAACX,GAAA,EAAe,iBAAAG,GAAmC,GAAGa,EAAA,CAAO;AAAA,IAAA;AAAA,EAAA;AAGnE;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EventType } from '../../../../../shared/constants';
|
|
2
2
|
import { OnEventType } from '../../../../Base/useBase';
|
|
3
|
+
import { LoaderComponentType } from '../../../../Base';
|
|
3
4
|
/**
|
|
4
5
|
* Props for {@link DeductionsCard}.
|
|
5
6
|
*
|
|
@@ -10,6 +11,8 @@ export interface DeductionsCardProps {
|
|
|
10
11
|
employeeId: string;
|
|
11
12
|
/** Callback invoked when the card emits an event. See the events table on {@link DeductionsCard} for the available event types and payloads. */
|
|
12
13
|
onEvent: OnEventType<EventType, unknown>;
|
|
14
|
+
/** Custom loading indicator rendered while this component's async data is fetching. Overrides the indicator configured on `GustoProvider` for this instance only. */
|
|
15
|
+
LoaderComponent?: LoaderComponentType;
|
|
13
16
|
}
|
|
14
17
|
/**
|
|
15
18
|
* Standalone read-only card listing an employee's active deductions, with affordances to add, edit, or delete a deduction.
|
|
@@ -28,4 +31,4 @@ export interface DeductionsCardProps {
|
|
|
28
31
|
* @returns The rendered deductions card.
|
|
29
32
|
* @public
|
|
30
33
|
*/
|
|
31
|
-
export declare function DeductionsCard(props: DeductionsCardProps): import("react").JSX.Element;
|
|
34
|
+
export declare function DeductionsCard({ LoaderComponent, ...props }: DeductionsCardProps): import("react").JSX.Element;
|