@gusto/embedded-react-sdk 0.52.1 → 0.53.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 +52 -0
- package/dist/components/Base/Base.d.ts +2 -2
- package/dist/components/Base/Base.js.map +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 +3 -4
- 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 +3 -4
- 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 +5 -6
- 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 +3 -4
- 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 +3 -4
- 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 +5 -6
- 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 +6 -7
- 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 +3 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +9 -12
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +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 +3 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleForm.js +47 -51
- 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 +3 -4
- 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 +3 -4
- 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 +22 -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/applicableIf.test.d.ts +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/shared/rhfKey.test.d.ts +1 -0
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.d.ts +1 -1
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js +40 -20
- 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/Address.js +83 -76
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/ContractorList/management/ManagementContractorList.d.ts +39 -0
- package/dist/components/Contractor/ContractorList/management/ManagementContractorList.js +90 -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 +51 -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/Documents/DocumentSigner/stateMachine.d.ts +0 -1
- package/dist/components/Contractor/Documents/DocumentSigner/stateMachine.js +18 -20
- package/dist/components/Contractor/Documents/DocumentSigner/stateMachine.js.map +1 -1
- package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.js +2 -3
- package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.js.map +1 -1
- package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js +170 -123
- package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.module.scss.js +12 -0
- package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.module.scss.js.map +1 -0
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/fields.js +40 -39
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/fields.js.map +1 -1
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.js +91 -88
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.js.map +1 -1
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.d.ts +0 -33
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.js +77 -86
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.js.map +1 -1
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js +1 -1
- 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/PaymentMethod.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +162 -251
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.d.ts +2 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js +2 -2
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +45 -44
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.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/PaymentsList/PaymentsListPresentation.js +2 -3
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.d.ts +32 -0
- package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.js +107 -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/BusinessSelfOnboardingProfile.js +6 -7
- package/dist/components/Contractor/Profile/BusinessSelfOnboardingProfile.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfile.js +63 -57
- package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Profile/IndividualSelfOnboardingProfile.js +18 -19
- package/dist/components/Contractor/Profile/IndividualSelfOnboardingProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +118 -102
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Contractor/exports/contractorManagement.d.ts +1 -0
- package/dist/components/Contractor/exports/contractorManagement.js +12 -10
- package/dist/components/Contractor/exports/contractorManagement.js.map +1 -1
- package/dist/components/Contractor/exports/contractorOnboarding.d.ts +1 -1
- package/dist/components/Contractor/exports/contractorOnboarding.js +1 -1
- package/dist/components/Contractor/shared/useContractorHasSignedW9.d.ts +8 -0
- package/dist/components/Contractor/shared/useContractorHasSignedW9.js +10 -0
- package/dist/components/Contractor/shared/useContractorHasSignedW9.js.map +1 -0
- 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/shared/AddCompensationFormBody.js +2 -3
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js +6 -7
- package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.js +14 -15
- 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/DocumentsCard/DocumentsCard.js +6 -7
- package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.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 +3 -4
- 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/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/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.js +15 -16
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js +6 -7
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js +11 -12
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.js +7 -8
- package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +4 -4
- 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/onboarding/BankForm.js +26 -20
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.js +133 -99
- 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/shared/BankFormBody/BankFormBody.d.ts +1 -1
- package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js +19 -20
- package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.js +92 -86
- package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.js.map +1 -1
- package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js +65 -64
- package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js.map +1 -1
- package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js +7 -8
- package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js.map +1 -1
- package/dist/components/Employee/Profile/management/ProfileEditForm.js +7 -7
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js +6 -6
- package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js +6 -6
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.d.ts +1 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.d.ts +1 -0
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.js +11 -12
- package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js +9 -10
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js.map +1 -1
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js +6 -7
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.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/WorkAddressCard/WorkAddressCard.js +16 -17
- package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.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/InformationRequests/InformationRequestForm/InformationRequestForm.js +8 -9
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +7 -8
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.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 +7 -8
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- 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/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/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/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/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 +8 -9
- 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/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/components/index.d.ts +40 -0
- 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 +1 -0
- 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.Address.json.js +22 -20
- package/dist/i18n/en/Contractor.Address.json.js.map +1 -1
- 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.ManagementContractorList.json.js +60 -0
- package/dist/i18n/en/Contractor.ManagementContractorList.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Profile.json.js +13 -11
- package/dist/i18n/en/Contractor.Profile.json.js.map +1 -1
- 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.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.PayrollHistory.json.js +8 -8
- package/dist/i18n/en/Payroll.PayrollList.json.js +23 -23
- package/dist/i18n/types.d.ts +215 -17
- package/dist/index.d.ts +6 -3
- package/dist/index.js +15 -13
- 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 +12 -0
- package/dist/shared/constants.js +23 -17
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/Helpers.d.ts +1 -1
- package/docs/guides/endpoint-inventory.json +61 -27
- package/package.json +19 -17
- 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/ContractorList/index.js +0 -150
- 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/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/Employee/Compensation/management/ManagementCompensationFormBody.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManagementCompensationFormBody.js","sources":["../../../../../src/components/Employee/Compensation/management/ManagementCompensationFormBody.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport type { PaymentUnit } from '@gusto/embedded-api/models/components/compensation'\nimport type { FlsaStatusType } from '@gusto/embedded-api/models/components/flsastatustype'\nimport type { MinimumWage } from '@gusto/embedded-api/models/components/minimumwage'\nimport type { UseJobFormReady } from '../shared/useJobForm'\nimport type { UseCompensationFormReady } from '../shared/useCompensationForm'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FLSA_OVERTIME_SALARY_LIMIT } from '@/shared/constants'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\n\n/** @internal */\nexport interface ManagementCompensationFormBodyProps {\n jobForm: UseJobFormReady\n compensationForm: UseCompensationFormReady\n title: string\n submitCtaLabel: string\n isPending: boolean\n onCancel?: () => void\n}\n\n/**\n * Renders the shared field layout used by both `EditCompensation` (schedule a future comp\n * change for a present job) and `EditPendingCompensation` (update an existing future comp).\n * Field visibility is driven entirely by hook configuration — the hooks expose `undefined`\n * for fields that should not render — so this component renders the correct subset for each\n * use case without extra conditional props.\n *\n * @internal\n */\nexport function ManagementCompensationFormBody({\n jobForm,\n compensationForm,\n title,\n submitCtaLabel,\n isPending,\n onCancel,\n}: ManagementCompensationFormBodyProps) {\n const { t } = useTranslation('Employee.Management.Compensation')\n const Components = useComponentContext()\n const format = useNumberFormatter('currency')\n\n const JobFields = jobForm.form.Fields\n const CompFields = compensationForm.form.Fields\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h2\">{title}</Components.Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n <CompFields.Title\n label={t('jobTitleLabel')}\n validationMessages={{ REQUIRED: t('validations.jobTitleSentence') }}\n formHookResult={compensationForm}\n />\n\n {JobFields.HireDate && (\n <JobFields.HireDate\n label={t('hireDateLabel')}\n validationMessages={{\n REQUIRED: t('validations.hireDate'),\n }}\n formHookResult={jobForm}\n />\n )}\n\n {CompFields.FlsaStatus && (\n <>\n <CompFields.FlsaStatus\n label={t('employeeClassification')}\n placeholder={t('flsaStatusPlaceholder')}\n description={\n <Trans\n t={t}\n i18nKey=\"classificationLink\"\n components={{ ClassificationLink: <Components.Link /> }}\n />\n }\n validationMessages={{\n REQUIRED: t('validations.exemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n getOptionLabel={(status: FlsaStatusType) => t(`flsaStatusLabels.${status}`)}\n formHookResult={compensationForm}\n />\n {(compensationForm.status.showCommissionFederalMinimumPayAlert ||\n compensationForm.status.showCommissionMinimumWageAlert ||\n compensationForm.status.showOwnerSalaryAlert ||\n compensationForm.status.willDeleteSecondaryJobs) && (\n <Flex flexDirection=\"column\" gap={0}>\n {compensationForm.status.willDeleteSecondaryJobs && (\n <Components.Alert\n label={t('validations.classificationChangeNotification')}\n status=\"warning\"\n >\n {t('validations.classificationChangeRemovesSecondaryJobs')}\n </Components.Alert>\n )}\n {compensationForm.status.showCommissionFederalMinimumPayAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.federalMinimumPay.label')}\n disableScrollIntoView\n >\n {t('commissionAlerts.federalMinimumPay.body')}\n </Components.Alert>\n )}\n {compensationForm.status.showCommissionMinimumWageAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.minimumWage.label')}\n disableScrollIntoView\n >\n <Trans\n t={t}\n i18nKey=\"commissionAlerts.minimumWage.body\"\n components={{\n minimumWageLink: (\n <Components.Link\n href=\"https://support.gusto.com/article/112472520100000/manage-tip-wages-distributed-service-charges-and-tip-credits-in-gusto-for-admins\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n </Components.Alert>\n )}\n {compensationForm.status.showOwnerSalaryAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.ownerSalary.label')}\n disableScrollIntoView\n />\n )}\n </Flex>\n )}\n </>\n )}\n\n {CompFields.Rate && (\n <CompFields.Rate\n label={t('wageLabel')}\n validationMessages={{\n REQUIRED: t('validations.rate'),\n RATE_MINIMUM: t('validations.nonZeroRate'),\n RATE_EXEMPT_THRESHOLD: t('validations.rateExemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.PaymentUnit && (\n <CompFields.PaymentUnit\n label={t('wageFrequencyLabel')}\n placeholder={t('paymentUnitPlaceholder')}\n description={t('paymentUnitDescription')}\n validationMessages={{ REQUIRED: t('validations.paymentUnit') }}\n getOptionLabel={(unit: PaymentUnit) => t(`paymentUnitOptions.${unit}` as const)}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.EffectiveDate && (\n <CompFields.EffectiveDate\n label={t('effectiveDateLabel')}\n validationMessages={{\n REQUIRED: t('validations.effectiveDate'),\n EFFECTIVE_DATE_BEFORE_HIRE: t('validations.effectiveDateBeforeHire'),\n EFFECTIVE_DATE_BEFORE_MIN: t('validations.effectiveDateBeforeMin'),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.AdjustForMinimumWage && (\n <CompFields.AdjustForMinimumWage\n label={t('adjustForMinimumWage')}\n description={t('adjustForMinimumWageDescription')}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.MinimumWageId && (\n <CompFields.MinimumWageId\n label={t('minimumWageLabel')}\n placeholder={t('minimumWagePlaceholder')}\n description={t('minimumWageDescription')}\n validationMessages={{ REQUIRED: t('validations.minimumWage') }}\n getOptionLabel={(wage: MinimumWage) =>\n `${format(Number(wage.wage))} - ${wage.authority}: ${wage.notes ?? ''}`\n }\n formHookResult={compensationForm}\n />\n )}\n\n {JobFields.TwoPercentShareholder && (\n <JobFields.TwoPercentShareholder\n label={t('twoPercentShareholderLabel')}\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcCovered && (\n <JobFields.StateWcCovered\n label={t('stateWcCoveredLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"stateWcCoveredDescription\"\n components={{\n wcLink: (\n <Components.Link\n href=\"https://www.lni.wa.gov/insurance/rates-risk-classes/risk-classes-for-workers-compensation/risk-class-lookup#/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n getOptionLabel={(covered: boolean) =>\n covered ? t('stateWcCoveredOptions.yes') : t('stateWcCoveredOptions.no')\n }\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcClassCode && (\n <JobFields.StateWcClassCode\n label={t('stateWcClassCodeLabel')}\n description={t('stateWcClassCodeDescription')}\n placeholder={t('stateWcClassCodeLabel')}\n validationMessages={{ REQUIRED: t('validations.stateWcClassCode') }}\n formHookResult={jobForm}\n />\n )}\n </Flex>\n\n <ActionsLayout>\n {onCancel && (\n <Components.Button variant=\"secondary\" onClick={onCancel} isDisabled={isPending}>\n {t('cancelCta')}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isPending}>\n {submitCtaLabel}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["ManagementCompensationFormBody","jobForm","compensationForm","title","submitCtaLabel","isPending","onCancel","t","useTranslation","Components","useComponentContext","format","useNumberFormatter","JobFields","CompFields","jsxs","Flex","jsx","Fragment","Trans","FLSA_OVERTIME_SALARY_LIMIT","status","unit","wage","covered","ActionsLayout"],"mappings":";;;;;;;;AA8BO,SAASA,EAA+B;AAAA,EAC7C,SAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AACF,GAAwC;AACtC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kCAAkC,GACzDC,IAAaC,EAAA,GACbC,IAAS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R,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAAU,YAAYD,GACnE,UAAAE,EAAE,WAAW,EAAA,CAChB;AAAA,MAEF,gBAAAU,EAACR,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWJ,GACzC,UAAAD,EAAA,CACH;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"ManagementCompensationFormBody.js","sources":["../../../../../src/components/Employee/Compensation/management/ManagementCompensationFormBody.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport type { PaymentUnit } from '@gusto/embedded-api/models/components/compensation'\nimport type { FlsaStatusType } from '@gusto/embedded-api/models/components/flsastatustype'\nimport type { MinimumWage } from '@gusto/embedded-api/models/components/minimumwage'\nimport type { UseJobFormReady } from '../shared/useJobForm'\nimport type { UseCompensationFormReady } from '../shared/useCompensationForm'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FLSA_OVERTIME_SALARY_LIMIT } from '@/shared/constants'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\n\n/** @internal */\nexport interface ManagementCompensationFormBodyProps {\n jobForm: UseJobFormReady\n compensationForm: UseCompensationFormReady\n title: string\n submitCtaLabel: string\n isPending: boolean\n onCancel?: () => void\n}\n\n/**\n * Renders the shared field layout used by both `EditCompensation` (schedule a future comp\n * change for a present job) and `EditPendingCompensation` (update an existing future comp).\n * Field visibility is driven entirely by hook configuration — the hooks expose `undefined`\n * for fields that should not render — so this component renders the correct subset for each\n * use case without extra conditional props.\n *\n * @internal\n */\nexport function ManagementCompensationFormBody({\n jobForm,\n compensationForm,\n title,\n submitCtaLabel,\n isPending,\n onCancel,\n}: ManagementCompensationFormBodyProps) {\n const { t } = useTranslation('Employee.Management.Compensation')\n const Components = useComponentContext()\n const format = useNumberFormatter('currency')\n\n const JobFields = jobForm.form.Fields\n const CompFields = compensationForm.form.Fields\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h2\">{title}</Components.Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n <CompFields.Title\n label={t('jobTitleLabel')}\n validationMessages={{ REQUIRED: t('validations.jobTitleSentence') }}\n formHookResult={compensationForm}\n />\n\n {JobFields.HireDate && (\n <JobFields.HireDate\n label={t('hireDateLabel')}\n validationMessages={{\n REQUIRED: t('validations.hireDate'),\n }}\n formHookResult={jobForm}\n />\n )}\n\n {CompFields.FlsaStatus && (\n <>\n <CompFields.FlsaStatus\n label={t('employeeClassification')}\n placeholder={t('flsaStatusPlaceholder')}\n description={\n <Trans\n t={t}\n i18nKey=\"classificationLink\"\n components={{ ClassificationLink: <Components.Link /> }}\n />\n }\n validationMessages={{\n REQUIRED: t('validations.exemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n getOptionLabel={(status: FlsaStatusType) => t(`flsaStatusLabels.${status}`)}\n formHookResult={compensationForm}\n />\n {(compensationForm.status.showCommissionFederalMinimumPayAlert ||\n compensationForm.status.showCommissionMinimumWageAlert ||\n compensationForm.status.showOwnerSalaryAlert ||\n compensationForm.status.willDeleteSecondaryJobs) && (\n <Flex flexDirection=\"column\" gap={0}>\n {compensationForm.status.willDeleteSecondaryJobs && (\n <Components.Alert\n label={t('validations.classificationChangeNotification')}\n status=\"warning\"\n >\n {t('validations.classificationChangeRemovesSecondaryJobs')}\n </Components.Alert>\n )}\n {compensationForm.status.showCommissionFederalMinimumPayAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.federalMinimumPay.label')}\n disableScrollIntoView\n >\n {t('commissionAlerts.federalMinimumPay.body')}\n </Components.Alert>\n )}\n {compensationForm.status.showCommissionMinimumWageAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.minimumWage.label')}\n disableScrollIntoView\n >\n <Trans\n t={t}\n i18nKey=\"commissionAlerts.minimumWage.body\"\n components={{\n minimumWageLink: (\n <Components.Link\n href=\"https://support.gusto.com/article/112472520100000/manage-tip-wages-distributed-service-charges-and-tip-credits-in-gusto-for-admins\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n </Components.Alert>\n )}\n {compensationForm.status.showOwnerSalaryAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.ownerSalary.label')}\n disableScrollIntoView\n />\n )}\n </Flex>\n )}\n </>\n )}\n\n {CompFields.Rate && (\n <CompFields.Rate\n label={t('wageLabel')}\n validationMessages={{\n REQUIRED: t('validations.rate'),\n RATE_MINIMUM: t('validations.nonZeroRate'),\n RATE_EXEMPT_THRESHOLD: t('validations.rateExemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.PaymentUnit && (\n <CompFields.PaymentUnit\n label={t('wageFrequencyLabel')}\n placeholder={t('paymentUnitPlaceholder')}\n description={t('paymentUnitDescription')}\n validationMessages={{ REQUIRED: t('validations.paymentUnit') }}\n getOptionLabel={(unit: PaymentUnit) => t(`paymentUnitOptions.${unit}` as const)}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.EffectiveDate && (\n <CompFields.EffectiveDate\n label={t('effectiveDateLabel')}\n validationMessages={{\n REQUIRED: t('validations.effectiveDate'),\n EFFECTIVE_DATE_BEFORE_HIRE: t('validations.effectiveDateBeforeHire'),\n EFFECTIVE_DATE_BEFORE_MIN: t('validations.effectiveDateBeforeMin'),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.AdjustForMinimumWage && (\n <CompFields.AdjustForMinimumWage\n label={t('adjustForMinimumWage')}\n description={t('adjustForMinimumWageDescription')}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.MinimumWageId && (\n <CompFields.MinimumWageId\n label={t('minimumWageLabel')}\n placeholder={t('minimumWagePlaceholder')}\n description={t('minimumWageDescription')}\n validationMessages={{ REQUIRED: t('validations.minimumWage') }}\n getOptionLabel={(wage: MinimumWage) =>\n `${format(Number(wage.wage))} - ${wage.authority}: ${wage.notes ?? ''}`\n }\n formHookResult={compensationForm}\n />\n )}\n\n {JobFields.TwoPercentShareholder && (\n <JobFields.TwoPercentShareholder\n label={t('twoPercentShareholderLabel')}\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcCovered && (\n <JobFields.StateWcCovered\n label={t('stateWcCoveredLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"stateWcCoveredDescription\"\n components={{\n wcLink: (\n <Components.Link\n href=\"https://www.lni.wa.gov/insurance/rates-risk-classes/risk-classes-for-workers-compensation/risk-class-lookup#/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n getOptionLabel={(covered: boolean) =>\n covered ? t('stateWcCoveredOptions.yes') : t('stateWcCoveredOptions.no')\n }\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcClassCode && (\n <JobFields.StateWcClassCode\n label={t('stateWcClassCodeLabel')}\n description={t('stateWcClassCodeDescription')}\n placeholder={t('stateWcClassCodeLabel')}\n validationMessages={{ REQUIRED: t('validations.stateWcClassCode') }}\n formHookResult={jobForm}\n />\n )}\n </Flex>\n\n <ActionsLayout>\n {onCancel && (\n <Components.Button variant=\"secondary\" onClick={onCancel} isDisabled={isPending}>\n {t('cancelCta')}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isPending}>\n {submitCtaLabel}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["ManagementCompensationFormBody","jobForm","compensationForm","title","submitCtaLabel","isPending","onCancel","t","useTranslation","Components","useComponentContext","format","useNumberFormatter","JobFields","CompFields","jsxs","Flex","jsx","Fragment","Trans","FLSA_OVERTIME_SALARY_LIMIT","status","unit","wage","covered","ActionsLayout"],"mappings":";;;;;;;AA8BO,SAASA,EAA+B;AAAA,EAC7C,SAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,OAAAC;AAAA,EAC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8BAA8B,EAAA;AAAA,UAChE,gBAAgBN;AAAA,QAAA;AAAA,MAAA;AAAA,IAClB,GAEJ;AAAA,sBAECwB,GAAA,EACE,UAAA;AAAA,MAAAnB,KACC,gBAAAW,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAAU,YAAYD,GACnE,UAAAE,EAAE,WAAW,EAAA,CAChB;AAAA,MAEF,gBAAAU,EAACR,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWJ,GACzC,UAAAD,EAAA,CACH;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -3,11 +3,10 @@ import { useTranslation as R, Trans as d } from "react-i18next";
|
|
|
3
3
|
import { Flex as c } from "../../../Common/Flex/Flex.js";
|
|
4
4
|
import { ActionsLayout as v } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
5
5
|
import { useComponentContext as C } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
-
import "react";
|
|
7
6
|
import { FLSA_OVERTIME_SALARY_LIMIT as p } from "../../../../shared/constants.js";
|
|
8
7
|
import y from "../../../../hooks/useNumberFormatter.js";
|
|
9
8
|
import { useI18n as D, useComponentDictionary as M } from "../../../../i18n/I18n.js";
|
|
10
|
-
function
|
|
9
|
+
function H({
|
|
11
10
|
jobForm: n,
|
|
12
11
|
compensationForm: i,
|
|
13
12
|
title: g,
|
|
@@ -219,6 +218,6 @@ function U({
|
|
|
219
218
|
] });
|
|
220
219
|
}
|
|
221
220
|
export {
|
|
222
|
-
|
|
221
|
+
H as AddCompensationFormBody
|
|
223
222
|
};
|
|
224
223
|
//# sourceMappingURL=AddCompensationFormBody.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddCompensationFormBody.js","sources":["../../../../../src/components/Employee/Compensation/shared/AddCompensationFormBody.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport type { PaymentUnit } from '@gusto/embedded-api/models/components/compensation'\nimport type { FlsaStatusType } from '@gusto/embedded-api/models/components/flsastatustype'\nimport type { MinimumWage } from '@gusto/embedded-api/models/components/minimumwage'\nimport type { UseJobFormReady } from './useJobForm'\nimport type { UseCompensationFormReady } from './useCompensationForm'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FLSA_OVERTIME_SALARY_LIMIT } from '@/shared/constants'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport type { ResourceDictionary } from '@/types/Helpers'\n\n/**\n * Translation overrides for the shared add-compensation form body. The body\n * reads its copy from the onboarding `Employee.Compensation` namespace by\n * default; management surfaces resolve this dictionary from\n * `Employee.Management.Compensation` and pass it in so management copy renders\n * while the two surfaces stay isolated.\n *\n * @internal\n */\nexport type AddCompensationFormDictionary = ResourceDictionary<'Employee.Compensation'>\n\n/** @internal */\nexport interface AddCompensationFormBodyProps {\n jobForm: UseJobFormReady\n compensationForm: UseCompensationFormReady\n title: string\n submitCtaLabel: string\n isPending: boolean\n onCancel?: () => void\n /** Per-surface translation overrides resolved against the consumer's namespace. */\n dictionary?: AddCompensationFormDictionary\n}\n\n/**\n * Renders the shared field layout used by both `EditCompensation` (onboarding) and\n * `CompensationAddAnotherJobForm` (management). Field visibility is driven entirely by the hook\n * configuration — `JobFields.HireDate` is only defined when `withHireDateField: true`,\n * and `CompFields.EffectiveDate` is only defined when `withEffectiveDateField: true` —\n * so this component renders the correct subset for each use case with no extra props.\n *\n * Copy resolves from the onboarding `Employee.Compensation` namespace by default; management\n * consumers inject a `dictionary` mapped from `Employee.Management.Compensation` to keep\n * onboarding and management strings independently overridable.\n *\n * @internal\n */\nexport function AddCompensationFormBody({\n jobForm,\n compensationForm,\n title,\n submitCtaLabel,\n isPending,\n onCancel,\n dictionary,\n}: AddCompensationFormBodyProps) {\n useI18n('Employee.Compensation')\n useComponentDictionary('Employee.Compensation', dictionary)\n const { t } = useTranslation('Employee.Compensation')\n const Components = useComponentContext()\n const format = useNumberFormatter('currency')\n\n const JobFields = jobForm.form.Fields\n const CompFields = compensationForm.form.Fields\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h2\">{title}</Components.Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n {JobFields.Title && (\n <JobFields.Title\n label={t('jobTitle')}\n validationMessages={{ REQUIRED: t('validations.title') }}\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.HireDate && (\n <JobFields.HireDate\n label={t('hireDate')}\n validationMessages={{ REQUIRED: t('validations.hireDate') }}\n formHookResult={jobForm}\n />\n )}\n\n {CompFields.FlsaStatus && (\n <>\n <CompFields.FlsaStatus\n label={t('employeeClassification')}\n placeholder={t('flsaStatusPlaceholder')}\n description={\n <Trans\n t={t}\n i18nKey=\"classificationLink\"\n components={{ ClassificationLink: <Components.Link /> }}\n />\n }\n validationMessages={{\n REQUIRED: t('validations.exemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n getOptionLabel={(status: FlsaStatusType) => t(`flsaStatusLabels.${status}`)}\n formHookResult={compensationForm}\n />\n {(compensationForm.status.showCommissionFederalMinimumPayAlert ||\n compensationForm.status.showCommissionMinimumWageAlert ||\n compensationForm.status.showOwnerSalaryAlert ||\n compensationForm.status.willDeleteSecondaryJobs) && (\n <Flex flexDirection=\"column\" gap={0}>\n {compensationForm.status.willDeleteSecondaryJobs && (\n <Components.Alert\n label={t('validations.classificationChangeNotification')}\n status=\"warning\"\n >\n {t('validations.classificationChangeRemovesSecondaryJobs')}\n </Components.Alert>\n )}\n {compensationForm.status.showCommissionFederalMinimumPayAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.federalMinimumPay.label')}\n disableScrollIntoView\n >\n {t('commissionAlerts.federalMinimumPay.body')}\n </Components.Alert>\n )}\n {compensationForm.status.showCommissionMinimumWageAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.minimumWage.label')}\n disableScrollIntoView\n >\n <Trans\n t={t}\n i18nKey=\"commissionAlerts.minimumWage.body\"\n components={{\n minimumWageLink: (\n <Components.Link\n href=\"https://support.gusto.com/article/112472520100000/manage-tip-wages-distributed-service-charges-and-tip-credits-in-gusto-for-admins\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n </Components.Alert>\n )}\n {compensationForm.status.showOwnerSalaryAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.ownerSalary.label')}\n disableScrollIntoView\n />\n )}\n </Flex>\n )}\n </>\n )}\n\n {CompFields.Rate && (\n <CompFields.Rate\n label={t('wageLabel')}\n validationMessages={{\n REQUIRED: t('validations.rate'),\n RATE_MINIMUM: t('validations.nonZeroRate'),\n RATE_EXEMPT_THRESHOLD: t('validations.rateExemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.PaymentUnit && (\n <CompFields.PaymentUnit\n label={t('wageFrequencyLabel')}\n placeholder={t('paymentUnitPlaceholder')}\n description={t('paymentUnitDescription')}\n validationMessages={{ REQUIRED: t('validations.paymentUnit') }}\n getOptionLabel={(unit: PaymentUnit) => t(`paymentUnitOptions.${unit}`)}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.AdjustForMinimumWage && (\n <CompFields.AdjustForMinimumWage\n label={t('adjustForMinimumWage')}\n description={t('adjustForMinimumWageDescription')}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.MinimumWageId && (\n <CompFields.MinimumWageId\n label={t('minimumWageLabel')}\n placeholder={t('minimumWagePlaceholder')}\n description={t('minimumWageDescription')}\n validationMessages={{ REQUIRED: t('validations.minimumWage') }}\n getOptionLabel={(wage: MinimumWage) =>\n `${format(Number(wage.wage))} - ${wage.authority}: ${wage.notes ?? ''}`\n }\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.EffectiveDate && (\n <CompFields.EffectiveDate\n label={t('effectiveDate')}\n validationMessages={{\n REQUIRED: t('validations.effectiveDate'),\n EFFECTIVE_DATE_BEFORE_HIRE: t('validations.effectiveDateBeforeHire'),\n EFFECTIVE_DATE_BEFORE_MIN: t('validations.effectiveDateBeforeMin'),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {JobFields.TwoPercentShareholder && (\n <JobFields.TwoPercentShareholder\n label={t('twoPercentStakeholderLabel')}\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcCovered && (\n <JobFields.StateWcCovered\n label={t('stateWcCoveredLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"stateWcCoveredDescription\"\n components={{\n wcLink: (\n <Components.Link\n href=\"https://www.lni.wa.gov/insurance/rates-risk-classes/risk-classes-for-workers-compensation/risk-class-lookup#/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n getOptionLabel={(covered: boolean) =>\n covered ? t('stateWcCoveredOptions.yes') : t('stateWcCoveredOptions.no')\n }\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcClassCode && (\n <JobFields.StateWcClassCode\n label={t('stateWcClassCodeLabel')}\n description={t('stateWcClassCodeDescription')}\n placeholder={t('stateWcClassCodeLabel')}\n validationMessages={{ REQUIRED: t('validations.stateWcClassCode') }}\n formHookResult={jobForm}\n />\n )}\n </Flex>\n\n <ActionsLayout>\n {onCancel && (\n <Components.Button variant=\"secondary\" onClick={onCancel} isDisabled={isPending}>\n {t('cancelNewJobCta')}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isPending}>\n {submitCtaLabel}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["AddCompensationFormBody","jobForm","compensationForm","title","submitCtaLabel","isPending","onCancel","dictionary","useI18n","useComponentDictionary","t","useTranslation","Components","useComponentContext","format","useNumberFormatter","JobFields","CompFields","jsxs","Flex","jsx","Fragment","Trans","FLSA_OVERTIME_SALARY_LIMIT","status","unit","w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AAA,MAInBe,EAAU,oBACT,gBAAAI;AAAA,QAACJ,EAAU;AAAA,QAAV;AAAA,UACC,OAAON,EAAE,uBAAuB;AAAA,UAChC,aAAaA,EAAE,6BAA6B;AAAA,UAC5C,aAAaA,EAAE,uBAAuB;AAAA,UACtC,oBAAoB,EAAE,UAAUA,EAAE,8BAA8B,EAAA;AAAA,UAChE,gBAAgBT;AAAA,QAAA;AAAA,MAAA;AAAA,IAClB,GAEJ;AAAA,sBAEC2B,GAAA,EACE,UAAA;AAAA,MAAAtB,KACC,gBAAAc,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASN,GAAU,YAAYD,GACnE,UAAAK,EAAE,iBAAiB,EAAA,CACtB;AAAA,MAEF,gBAAAU,EAACR,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWP,GACzC,UAAAD,EAAA,CACH;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"AddCompensationFormBody.js","sources":["../../../../../src/components/Employee/Compensation/shared/AddCompensationFormBody.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport type { PaymentUnit } from '@gusto/embedded-api/models/components/compensation'\nimport type { FlsaStatusType } from '@gusto/embedded-api/models/components/flsastatustype'\nimport type { MinimumWage } from '@gusto/embedded-api/models/components/minimumwage'\nimport type { UseJobFormReady } from './useJobForm'\nimport type { UseCompensationFormReady } from './useCompensationForm'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FLSA_OVERTIME_SALARY_LIMIT } from '@/shared/constants'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport type { ResourceDictionary } from '@/types/Helpers'\n\n/**\n * Translation overrides for the shared add-compensation form body. The body\n * reads its copy from the onboarding `Employee.Compensation` namespace by\n * default; management surfaces resolve this dictionary from\n * `Employee.Management.Compensation` and pass it in so management copy renders\n * while the two surfaces stay isolated.\n *\n * @internal\n */\nexport type AddCompensationFormDictionary = ResourceDictionary<'Employee.Compensation'>\n\n/** @internal */\nexport interface AddCompensationFormBodyProps {\n jobForm: UseJobFormReady\n compensationForm: UseCompensationFormReady\n title: string\n submitCtaLabel: string\n isPending: boolean\n onCancel?: () => void\n /** Per-surface translation overrides resolved against the consumer's namespace. */\n dictionary?: AddCompensationFormDictionary\n}\n\n/**\n * Renders the shared field layout used by both `EditCompensation` (onboarding) and\n * `CompensationAddAnotherJobForm` (management). Field visibility is driven entirely by the hook\n * configuration — `JobFields.HireDate` is only defined when `withHireDateField: true`,\n * and `CompFields.EffectiveDate` is only defined when `withEffectiveDateField: true` —\n * so this component renders the correct subset for each use case with no extra props.\n *\n * Copy resolves from the onboarding `Employee.Compensation` namespace by default; management\n * consumers inject a `dictionary` mapped from `Employee.Management.Compensation` to keep\n * onboarding and management strings independently overridable.\n *\n * @internal\n */\nexport function AddCompensationFormBody({\n jobForm,\n compensationForm,\n title,\n submitCtaLabel,\n isPending,\n onCancel,\n dictionary,\n}: AddCompensationFormBodyProps) {\n useI18n('Employee.Compensation')\n useComponentDictionary('Employee.Compensation', dictionary)\n const { t } = useTranslation('Employee.Compensation')\n const Components = useComponentContext()\n const format = useNumberFormatter('currency')\n\n const JobFields = jobForm.form.Fields\n const CompFields = compensationForm.form.Fields\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h2\">{title}</Components.Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n {JobFields.Title && (\n <JobFields.Title\n label={t('jobTitle')}\n validationMessages={{ REQUIRED: t('validations.title') }}\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.HireDate && (\n <JobFields.HireDate\n label={t('hireDate')}\n validationMessages={{ REQUIRED: t('validations.hireDate') }}\n formHookResult={jobForm}\n />\n )}\n\n {CompFields.FlsaStatus && (\n <>\n <CompFields.FlsaStatus\n label={t('employeeClassification')}\n placeholder={t('flsaStatusPlaceholder')}\n description={\n <Trans\n t={t}\n i18nKey=\"classificationLink\"\n components={{ ClassificationLink: <Components.Link /> }}\n />\n }\n validationMessages={{\n REQUIRED: t('validations.exemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n getOptionLabel={(status: FlsaStatusType) => t(`flsaStatusLabels.${status}`)}\n formHookResult={compensationForm}\n />\n {(compensationForm.status.showCommissionFederalMinimumPayAlert ||\n compensationForm.status.showCommissionMinimumWageAlert ||\n compensationForm.status.showOwnerSalaryAlert ||\n compensationForm.status.willDeleteSecondaryJobs) && (\n <Flex flexDirection=\"column\" gap={0}>\n {compensationForm.status.willDeleteSecondaryJobs && (\n <Components.Alert\n label={t('validations.classificationChangeNotification')}\n status=\"warning\"\n >\n {t('validations.classificationChangeRemovesSecondaryJobs')}\n </Components.Alert>\n )}\n {compensationForm.status.showCommissionFederalMinimumPayAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.federalMinimumPay.label')}\n disableScrollIntoView\n >\n {t('commissionAlerts.federalMinimumPay.body')}\n </Components.Alert>\n )}\n {compensationForm.status.showCommissionMinimumWageAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.minimumWage.label')}\n disableScrollIntoView\n >\n <Trans\n t={t}\n i18nKey=\"commissionAlerts.minimumWage.body\"\n components={{\n minimumWageLink: (\n <Components.Link\n href=\"https://support.gusto.com/article/112472520100000/manage-tip-wages-distributed-service-charges-and-tip-credits-in-gusto-for-admins\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n </Components.Alert>\n )}\n {compensationForm.status.showOwnerSalaryAlert && (\n <Components.Alert\n status=\"info\"\n label={t('commissionAlerts.ownerSalary.label')}\n disableScrollIntoView\n />\n )}\n </Flex>\n )}\n </>\n )}\n\n {CompFields.Rate && (\n <CompFields.Rate\n label={t('wageLabel')}\n validationMessages={{\n REQUIRED: t('validations.rate'),\n RATE_MINIMUM: t('validations.nonZeroRate'),\n RATE_EXEMPT_THRESHOLD: t('validations.rateExemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.PaymentUnit && (\n <CompFields.PaymentUnit\n label={t('wageFrequencyLabel')}\n placeholder={t('paymentUnitPlaceholder')}\n description={t('paymentUnitDescription')}\n validationMessages={{ REQUIRED: t('validations.paymentUnit') }}\n getOptionLabel={(unit: PaymentUnit) => t(`paymentUnitOptions.${unit}`)}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.AdjustForMinimumWage && (\n <CompFields.AdjustForMinimumWage\n label={t('adjustForMinimumWage')}\n description={t('adjustForMinimumWageDescription')}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.MinimumWageId && (\n <CompFields.MinimumWageId\n label={t('minimumWageLabel')}\n placeholder={t('minimumWagePlaceholder')}\n description={t('minimumWageDescription')}\n validationMessages={{ REQUIRED: t('validations.minimumWage') }}\n getOptionLabel={(wage: MinimumWage) =>\n `${format(Number(wage.wage))} - ${wage.authority}: ${wage.notes ?? ''}`\n }\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.EffectiveDate && (\n <CompFields.EffectiveDate\n label={t('effectiveDate')}\n validationMessages={{\n REQUIRED: t('validations.effectiveDate'),\n EFFECTIVE_DATE_BEFORE_HIRE: t('validations.effectiveDateBeforeHire'),\n EFFECTIVE_DATE_BEFORE_MIN: t('validations.effectiveDateBeforeMin'),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {JobFields.TwoPercentShareholder && (\n <JobFields.TwoPercentShareholder\n label={t('twoPercentStakeholderLabel')}\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcCovered && (\n <JobFields.StateWcCovered\n label={t('stateWcCoveredLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"stateWcCoveredDescription\"\n components={{\n wcLink: (\n <Components.Link\n href=\"https://www.lni.wa.gov/insurance/rates-risk-classes/risk-classes-for-workers-compensation/risk-class-lookup#/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n getOptionLabel={(covered: boolean) =>\n covered ? t('stateWcCoveredOptions.yes') : t('stateWcCoveredOptions.no')\n }\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcClassCode && (\n <JobFields.StateWcClassCode\n label={t('stateWcClassCodeLabel')}\n description={t('stateWcClassCodeDescription')}\n placeholder={t('stateWcClassCodeLabel')}\n validationMessages={{ REQUIRED: t('validations.stateWcClassCode') }}\n formHookResult={jobForm}\n />\n )}\n </Flex>\n\n <ActionsLayout>\n {onCancel && (\n <Components.Button variant=\"secondary\" onClick={onCancel} isDisabled={isPending}>\n {t('cancelNewJobCta')}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isPending}>\n {submitCtaLabel}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["AddCompensationFormBody","jobForm","compensationForm","title","submitCtaLabel","isPending","onCancel","dictionary","useI18n","useComponentDictionary","t","useTranslation","Components","useComponentContext","format","useNumberFormatter","JobFields","CompFields","jsxs","Flex","jsx","Fragment","Trans","FLSA_OVERTIME_SALARY_LIMIT","status","unit","wage","covered","ActionsLayout"],"mappings":";;;;;;;;AAiDO,SAASA,EAAwB;AAAA,EACtC,SAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AACF,GAAiC;AAC/B,EAAAC,EAAQ,uBAAuB,GAC/BC,EAAuB,yBAAyBF,CAAU;AAC1D,QAAM,EAAE,GAAAG,EAAA,IAAMC,EAAe,uBAAuB,GAC9CC,IAAaC,EAAA,GACbC,IAASC,EAAmB,UAAU,GAEtCC,IAAYf,EAAQ,KAAK,QACzBgB,IAAaf,EAAiB,KAAK;AAEzC,SACE,gBAAAgB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAA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B,MAAK,UAAS,WAAWP,GACzC,UAAAD,EAAA,CACH;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -4,17 +4,16 @@ import { useChildSupportGarnishmentForm as b } from "../useChildSupportGarnishme
|
|
|
4
4
|
import { Form as g } from "../../../../Common/Form/Form.js";
|
|
5
5
|
import { Flex as d } from "../../../../Common/Flex/Flex.js";
|
|
6
6
|
import { ActionsLayout as R } from "../../../../Common/ActionsLayout/ActionsLayout.js";
|
|
7
|
-
import { useComponentContext as P } from "../../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
|
-
import "react";
|
|
9
7
|
import { BaseLayout as h } from "../../../../Base/Base.js";
|
|
10
|
-
import { SDKFormProvider as
|
|
11
|
-
|
|
8
|
+
import { SDKFormProvider as P } from "../../../../../partner-hook-utils/form/SDKFormProvider.js";
|
|
9
|
+
import { useComponentContext as f } from "../../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
|
+
function O({
|
|
12
11
|
employeeId: n,
|
|
13
12
|
deduction: a,
|
|
14
13
|
onSaved: s,
|
|
15
14
|
onCancel: p
|
|
16
15
|
}) {
|
|
17
|
-
const { t: e } = S("Employee.DeductionsForm"), c =
|
|
16
|
+
const { t: e } = S("Employee.DeductionsForm"), c = f(), t = b({
|
|
18
17
|
employeeId: n,
|
|
19
18
|
garnishmentId: a?.uuid
|
|
20
19
|
});
|
|
@@ -24,7 +23,7 @@ function F({
|
|
|
24
23
|
const o = await t.actions.onSubmit();
|
|
25
24
|
o && s(o.data, o.mode);
|
|
26
25
|
};
|
|
27
|
-
return /* @__PURE__ */ r(h, { error: t.errorHandling.errors, children: /* @__PURE__ */ r(
|
|
26
|
+
return /* @__PURE__ */ r(h, { error: t.errorHandling.errors, children: /* @__PURE__ */ r(P, { formHookResult: t, children: /* @__PURE__ */ r(g, { onSubmit: y, children: /* @__PURE__ */ l(d, { flexDirection: "column", gap: 32, children: [
|
|
28
27
|
/* @__PURE__ */ r(c.Heading, { as: "h3", children: e("types.childSupport") }),
|
|
29
28
|
/* @__PURE__ */ l(d, { flexDirection: "column", gap: 20, children: [
|
|
30
29
|
/* @__PURE__ */ r(
|
|
@@ -142,6 +141,6 @@ function E(n, a) {
|
|
|
142
141
|
}
|
|
143
142
|
}
|
|
144
143
|
export {
|
|
145
|
-
|
|
144
|
+
O as ChildSupportFormView
|
|
146
145
|
};
|
|
147
146
|
//# sourceMappingURL=ChildSupportFormView.js.map
|
package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChildSupportFormView.js","sources":["../../../../../../src/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport type { PaymentPeriod } from '@gusto/embedded-api/models/components/garnishmentchildsupport'\nimport { useChildSupportGarnishmentForm } from '../useChildSupportGarnishmentForm'\nimport type { StateFieldEntry, CountyEntry } from '../useChildSupportGarnishmentForm'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { BaseLayout } from '@/components/Base/Base'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface ChildSupportFormViewProps {\n employeeId: string\n deduction: Garnishment | null\n onSaved: (deduction: Garnishment, mode: 'create' | 'update') => void\n onCancel: () => void\n}\n\n/** @internal */\nexport function ChildSupportFormView({\n employeeId,\n deduction,\n onSaved,\n onCancel,\n}: ChildSupportFormViewProps) {\n const { t } = useTranslation('Employee.DeductionsForm')\n const Components = useComponentContext()\n\n const form = useChildSupportGarnishmentForm({\n employeeId,\n garnishmentId: deduction?.uuid,\n })\n\n if (form.isLoading) {\n return <BaseLayout isLoading error={form.errorHandling.errors} />\n }\n\n const { Fields } = form.form\n const hasSelection = form.status.selectedAgency !== null\n\n const handleSubmit = async () => {\n const result = await form.actions.onSubmit()\n if (result) onSaved(result.data, result.mode)\n }\n\n return (\n <BaseLayout error={form.errorHandling.errors}>\n <SDKFormProvider formHookResult={form}>\n <Form onSubmit={handleSubmit}>\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h3\">{t('types.childSupport')}</Components.Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n <Fields.State\n label={t('childSupport.agencyLabel')}\n placeholder={t('childSupport.agencyPlaceholder')}\n description={t('childSupport.agencyDescription')}\n getOptionLabel={(entry: StateFieldEntry) => entry.name}\n validationMessages={{ REQUIRED: t('childSupport.agencyRequired') }}\n />\n\n {form.status.isManualPaymentRequired && (\n <Components.Alert\n status=\"warning\"\n label={t('childSupport.manualPaymentRequired')}\n />\n )}\n\n {hasSelection && (\n <Flex flexDirection=\"column\" gap={20}>\n {Fields.FipsCode && (\n <Fields.FipsCode\n label={t('childSupport.countyLabel')}\n placeholder={t('childSupport.countyPlaceholder')}\n description={t('childSupport.countyDescription')}\n getOptionLabel={(entry: CountyEntry) =>\n entry.county ?? t('childSupport.allCounties')\n }\n validationMessages={{ REQUIRED: t('childSupport.countyRequired') }}\n />\n )}\n {Fields.CaseNumber && (\n <Fields.CaseNumber\n label={requiredAttrLabel(form.status.selectedAgency, 'case_number')}\n description={t('childSupport.caseNumberDescription')}\n validationMessages={{ REQUIRED: t('childSupport.caseNumberRequired') }}\n />\n )}\n {Fields.OrderNumber && (\n <Fields.OrderNumber\n label={requiredAttrLabel(form.status.selectedAgency, 'order_number')}\n description={t('childSupport.orderNumberDescription')}\n validationMessages={{ REQUIRED: t('childSupport.orderNumberRequired') }}\n />\n )}\n {Fields.RemittanceNumber && (\n <Fields.RemittanceNumber\n label={requiredAttrLabel(form.status.selectedAgency, 'remittance_number')}\n description={t('childSupport.remittanceNumberDescription')}\n validationMessages={{\n REQUIRED: t('childSupport.remittanceNumberRequired'),\n }}\n />\n )}\n <Fields.PayPeriodMaximum\n label={t('childSupport.totalAmountWithheld')}\n description={t('childSupport.totalAmountWithheldDescription')}\n format=\"currency\"\n min={0}\n validationMessages={{\n REQUIRED: t('childSupport.payPeriodMaximumRequired'),\n NEGATIVE_AMOUNT: t('childSupport.amountNonNegative'),\n }}\n />\n <Fields.Amount\n label={t('childSupport.maxPaycheckPercentage')}\n description={t('childSupport.maxPaycheckPercentageDescription')}\n format=\"percent\"\n min={0}\n max={100}\n validationMessages={{\n REQUIRED: t('childSupport.amountRequired'),\n PERCENT_OUT_OF_RANGE: t('childSupport.percentOutOfRange'),\n }}\n />\n <Fields.PaymentPeriod\n label={t('childSupport.paymentPeriodLabel')}\n placeholder={t('childSupport.paymentPeriodPlaceholder')}\n description={t('childSupport.paymentPeriodDescription')}\n getOptionLabel={(value: PaymentPeriod) => paymentPeriodLabel(t, value)}\n validationMessages={{ REQUIRED: t('childSupport.paymentPeriodRequired') }}\n />\n </Flex>\n )}\n </Flex>\n <ActionsLayout>\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onCancel}>\n {t('actions.cancel')}\n </Components.Button>\n {hasSelection && (\n <Components.Button type=\"submit\" isLoading={form.status.isPending}>\n {t('actions.save')}\n </Components.Button>\n )}\n </ActionsLayout>\n </Flex>\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n )\n}\n\nfunction requiredAttrLabel(\n selectedAgency: { requiredAttributes?: Array<{ key?: string; label?: string }> } | null,\n key: 'case_number' | 'order_number' | 'remittance_number',\n): string {\n const match = selectedAgency?.requiredAttributes?.find(a => a.key === key)\n return match?.label ?? key\n}\n\nfunction paymentPeriodLabel(\n t: ReturnType<typeof useTranslation<'Employee.DeductionsForm'>>['t'],\n value: PaymentPeriod,\n): string {\n switch (value) {\n case 'Every week':\n return t('childSupport.paymentPeriod.everyWeek')\n case 'Every other week':\n return t('childSupport.paymentPeriod.everyOtherWeek')\n case 'Twice per month':\n return t('childSupport.paymentPeriod.twicePerMonth')\n case 'Monthly':\n return t('childSupport.paymentPeriod.monthly')\n }\n}\n"],"names":["ChildSupportFormView","employeeId","deduction","onSaved","onCancel","t","useTranslation","Components","useComponentContext","form","useChildSupportGarnishmentForm","BaseLayout","Fields","hasSelection","handleSubmit","result","SDKFormProvider","jsx","Form","jsxs","Flex","entry","requiredAttrLabel","value","paymentPeriodLabel","ActionsLayout","selectedAgency","key","a"],"mappings":";;;;;;;;;;AAoBO,SAASA,EAAqB;AAAA,EACnC,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AACF,GAA8B;AAC5B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAChDC,IAAaC,EAAA,GAEbC,IAAOC,EAA+B;AAAA,IAC1C,YAAAT;AAAA,IACA,eAAeC,GAAW;AAAA,EAAA,CAC3B;AAED,MAAIO,EAAK;AACP,6BAAQE,GAAA,EAAW,WAAS,IAAC,OAAOF,EAAK,cAAc,QAAQ;AAGjE,QAAM,EAAE,QAAAG,MAAWH,EAAK,MAClBI,IAAeJ,EAAK,OAAO,mBAAmB,MAE9CK,IAAe,YAAY;AAC/B,UAAMC,IAAS,MAAMN,EAAK,QAAQ,SAAA;AAClC,IAAIM,KAAQZ,EAAQY,EAAO,MAAMA,EAAO,IAAI;AAAA,EAC9C;AAEA,2BACGJ,GAAA,EAAW,OAAOF,EAAK,cAAc,QACpC,4BAACO,GAAA,EAAgB,gBAAgBP,GAC/B,UAAA,gBAAAQ,EAACC,GAAA,EAAK,UAAUJ,GACd,UAAA,gBAAAK,EAACC,KAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAH,EAACV,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAF,EAAE,oBAAoB,GAAE;AAAA,IAErD,gBAAAc,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,MAAA,gBAAAH;AAAA,QAACL,EAAO;AAAA,QAAP;AAAA,UAC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,SAASH,GAC3D,UAAAC,EAAE,gBAAgB,EAAA,CACrB;AAAA,MACCQ,KACC,gBAAAI,EAACV,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWE,EAAK,OAAO,WACrD,UAAAJ,EAAE,cAAc,EAAA,CACnB;AAAA,IAAA,EAAA,CAEJ;AAAA,EAAA,GACF,EAAA,CACF,GACF,GACF;AAEJ;AAEA,SAASiB,EACPI,GACAC,GACQ;AAER,SADcD,GAAgB,oBAAoB,KAAK,CAAAE,MAAKA,EAAE,QAAQD,CAAG,GAC3D,SAASA;AACzB;AAEA,SAASH,EACPnB,GACAkB,GACQ;AACR,UAAQA,GAAA;AAAA,IACN,KAAK;AACH,aAAOlB,EAAE,sCAAsC;AAAA,IACjD,KAAK;AACH,aAAOA,EAAE,2CAA2C;AAAA,IACtD,KAAK;AACH,aAAOA,EAAE,0CAA0C;AAAA,IACrD,KAAK;AACH,aAAOA,EAAE,oCAAoC;AAAA,EAAA;AAEnD;"}
|
|
1
|
+
{"version":3,"file":"ChildSupportFormView.js","sources":["../../../../../../src/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport type { PaymentPeriod } from '@gusto/embedded-api/models/components/garnishmentchildsupport'\nimport { useChildSupportGarnishmentForm } from '../useChildSupportGarnishmentForm'\nimport type { StateFieldEntry, CountyEntry } from '../useChildSupportGarnishmentForm'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { BaseLayout } from '@/components/Base/Base'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface ChildSupportFormViewProps {\n employeeId: string\n deduction: Garnishment | null\n onSaved: (deduction: Garnishment, mode: 'create' | 'update') => void\n onCancel: () => void\n}\n\n/** @internal */\nexport function ChildSupportFormView({\n employeeId,\n deduction,\n onSaved,\n onCancel,\n}: ChildSupportFormViewProps) {\n const { t } = useTranslation('Employee.DeductionsForm')\n const Components = useComponentContext()\n\n const form = useChildSupportGarnishmentForm({\n employeeId,\n garnishmentId: deduction?.uuid,\n })\n\n if (form.isLoading) {\n return <BaseLayout isLoading error={form.errorHandling.errors} />\n }\n\n const { Fields } = form.form\n const hasSelection = form.status.selectedAgency !== null\n\n const handleSubmit = async () => {\n const result = await form.actions.onSubmit()\n if (result) onSaved(result.data, result.mode)\n }\n\n return (\n <BaseLayout error={form.errorHandling.errors}>\n <SDKFormProvider formHookResult={form}>\n <Form onSubmit={handleSubmit}>\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h3\">{t('types.childSupport')}</Components.Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n <Fields.State\n label={t('childSupport.agencyLabel')}\n placeholder={t('childSupport.agencyPlaceholder')}\n description={t('childSupport.agencyDescription')}\n getOptionLabel={(entry: StateFieldEntry) => entry.name}\n validationMessages={{ REQUIRED: t('childSupport.agencyRequired') }}\n />\n\n {form.status.isManualPaymentRequired && (\n <Components.Alert\n status=\"warning\"\n label={t('childSupport.manualPaymentRequired')}\n />\n )}\n\n {hasSelection && (\n <Flex flexDirection=\"column\" gap={20}>\n {Fields.FipsCode && (\n <Fields.FipsCode\n label={t('childSupport.countyLabel')}\n placeholder={t('childSupport.countyPlaceholder')}\n description={t('childSupport.countyDescription')}\n getOptionLabel={(entry: CountyEntry) =>\n entry.county ?? t('childSupport.allCounties')\n }\n validationMessages={{ REQUIRED: t('childSupport.countyRequired') }}\n />\n )}\n {Fields.CaseNumber && (\n <Fields.CaseNumber\n label={requiredAttrLabel(form.status.selectedAgency, 'case_number')}\n description={t('childSupport.caseNumberDescription')}\n validationMessages={{ REQUIRED: t('childSupport.caseNumberRequired') }}\n />\n )}\n {Fields.OrderNumber && (\n <Fields.OrderNumber\n label={requiredAttrLabel(form.status.selectedAgency, 'order_number')}\n description={t('childSupport.orderNumberDescription')}\n validationMessages={{ REQUIRED: t('childSupport.orderNumberRequired') }}\n />\n )}\n {Fields.RemittanceNumber && (\n <Fields.RemittanceNumber\n label={requiredAttrLabel(form.status.selectedAgency, 'remittance_number')}\n description={t('childSupport.remittanceNumberDescription')}\n validationMessages={{\n REQUIRED: t('childSupport.remittanceNumberRequired'),\n }}\n />\n )}\n <Fields.PayPeriodMaximum\n label={t('childSupport.totalAmountWithheld')}\n description={t('childSupport.totalAmountWithheldDescription')}\n format=\"currency\"\n min={0}\n validationMessages={{\n REQUIRED: t('childSupport.payPeriodMaximumRequired'),\n NEGATIVE_AMOUNT: t('childSupport.amountNonNegative'),\n }}\n />\n <Fields.Amount\n label={t('childSupport.maxPaycheckPercentage')}\n description={t('childSupport.maxPaycheckPercentageDescription')}\n format=\"percent\"\n min={0}\n max={100}\n validationMessages={{\n REQUIRED: t('childSupport.amountRequired'),\n PERCENT_OUT_OF_RANGE: t('childSupport.percentOutOfRange'),\n }}\n />\n <Fields.PaymentPeriod\n label={t('childSupport.paymentPeriodLabel')}\n placeholder={t('childSupport.paymentPeriodPlaceholder')}\n description={t('childSupport.paymentPeriodDescription')}\n getOptionLabel={(value: PaymentPeriod) => paymentPeriodLabel(t, value)}\n validationMessages={{ REQUIRED: t('childSupport.paymentPeriodRequired') }}\n />\n </Flex>\n )}\n </Flex>\n <ActionsLayout>\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onCancel}>\n {t('actions.cancel')}\n </Components.Button>\n {hasSelection && (\n <Components.Button type=\"submit\" isLoading={form.status.isPending}>\n {t('actions.save')}\n </Components.Button>\n )}\n </ActionsLayout>\n </Flex>\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n )\n}\n\nfunction requiredAttrLabel(\n selectedAgency: { requiredAttributes?: Array<{ key?: string; label?: string }> } | null,\n key: 'case_number' | 'order_number' | 'remittance_number',\n): string {\n const match = selectedAgency?.requiredAttributes?.find(a => a.key === key)\n return match?.label ?? key\n}\n\nfunction paymentPeriodLabel(\n t: ReturnType<typeof useTranslation<'Employee.DeductionsForm'>>['t'],\n value: PaymentPeriod,\n): string {\n switch (value) {\n case 'Every week':\n return t('childSupport.paymentPeriod.everyWeek')\n case 'Every other week':\n return t('childSupport.paymentPeriod.everyOtherWeek')\n case 'Twice per month':\n return t('childSupport.paymentPeriod.twicePerMonth')\n case 'Monthly':\n return t('childSupport.paymentPeriod.monthly')\n }\n}\n"],"names":["ChildSupportFormView","employeeId","deduction","onSaved","onCancel","t","useTranslation","Components","useComponentContext","form","useChildSupportGarnishmentForm","BaseLayout","Fields","hasSelection","handleSubmit","result","SDKFormProvider","jsx","Form","jsxs","Flex","entry","requiredAttrLabel","value","paymentPeriodLabel","ActionsLayout","selectedAgency","key","a"],"mappings":";;;;;;;;;AAoBO,SAASA,EAAqB;AAAA,EACnC,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AACF,GAA8B;AAC5B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAChDC,IAAaC,EAAA,GAEbC,IAAOC,EAA+B;AAAA,IAC1C,YAAAT;AAAA,IACA,eAAeC,GAAW;AAAA,EAAA,CAC3B;AAED,MAAIO,EAAK;AACP,6BAAQE,GAAA,EAAW,WAAS,IAAC,OAAOF,EAAK,cAAc,QAAQ;AAGjE,QAAM,EAAE,QAAAG,MAAWH,EAAK,MAClBI,IAAeJ,EAAK,OAAO,mBAAmB,MAE9CK,IAAe,YAAY;AAC/B,UAAMC,IAAS,MAAMN,EAAK,QAAQ,SAAA;AAClC,IAAIM,KAAQZ,EAAQY,EAAO,MAAMA,EAAO,IAAI;AAAA,EAC9C;AAEA,2BACGJ,GAAA,EAAW,OAAOF,EAAK,cAAc,QACpC,4BAACO,GAAA,EAAgB,gBAAgBP,GAC/B,UAAA,gBAAAQ,EAACC,GAAA,EAAK,UAAUJ,GACd,UAAA,gBAAAK,EAACC,KAAK,eAAc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GAAGkB,CAAK;AAAA,YACrE,oBAAoB,EAAE,UAAUlB,EAAE,oCAAoC,EAAA;AAAA,UAAE;AAAA,QAAA;AAAA,MAC1E,EAAA,CACF;AAAA,IAAA,GAEJ;AAAA,sBACCoB,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAR,EAACV,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASH,GAC3D,UAAAC,EAAE,gBAAgB,EAAA,CACrB;AAAA,MACCQ,KACC,gBAAAI,EAACV,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWE,EAAK,OAAO,WACrD,UAAAJ,EAAE,cAAc,EAAA,CACnB;AAAA,IAAA,EAAA,CAEJ;AAAA,EAAA,GACF,EAAA,CACF,GACF,GACF;AAEJ;AAEA,SAASiB,EACPI,GACAC,GACQ;AAER,SADcD,GAAgB,oBAAoB,KAAK,CAAAE,MAAKA,EAAE,QAAQD,CAAG,GAC3D,SAASA;AACzB;AAEA,SAASH,EACPnB,GACAkB,GACQ;AACR,UAAQA,GAAA;AAAA,IACN,KAAK;AACH,aAAOlB,EAAE,sCAAsC;AAAA,IACjD,KAAK;AACH,aAAOA,EAAE,2CAA2C;AAAA,IACtD,KAAK;AACH,aAAOA,EAAE,0CAA0C;AAAA,IACrD,KAAK;AACH,aAAOA,EAAE,oCAAoC;AAAA,EAAA;AAEnD;"}
|
|
@@ -5,20 +5,19 @@ import { useDeductionForm as b } from "../useDeductionForm/useDeductionForm.js";
|
|
|
5
5
|
import { Form as h } from "../../../../Common/Form/Form.js";
|
|
6
6
|
import { Flex as u } from "../../../../Common/Flex/Flex.js";
|
|
7
7
|
import { ActionsLayout as y } from "../../../../Common/ActionsLayout/ActionsLayout.js";
|
|
8
|
-
import { useComponentContext as A } from "../../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
|
-
import "react";
|
|
10
8
|
import { BaseLayout as g } from "../../../../Base/Base.js";
|
|
11
|
-
import { SDKFormProvider as
|
|
12
|
-
|
|
9
|
+
import { SDKFormProvider as A } from "../../../../../partner-hook-utils/form/SDKFormProvider.js";
|
|
10
|
+
import { useComponentContext as R } from "../../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
|
+
function O({
|
|
13
12
|
employeeId: t,
|
|
14
13
|
deduction: a,
|
|
15
14
|
courtOrdered: o,
|
|
16
15
|
garnishmentType: n,
|
|
17
|
-
title:
|
|
18
|
-
onSaved:
|
|
16
|
+
title: l,
|
|
17
|
+
onSaved: m,
|
|
19
18
|
onCancel: p
|
|
20
19
|
}) {
|
|
21
|
-
const { t: s } = f("Employee.DeductionsForm"), c =
|
|
20
|
+
const { t: s } = f("Employee.DeductionsForm"), c = R(), i = b({
|
|
22
21
|
employeeId: t,
|
|
23
22
|
garnishmentId: a?.uuid,
|
|
24
23
|
courtOrdered: o,
|
|
@@ -34,8 +33,8 @@ function S({
|
|
|
34
33
|
Fields: r,
|
|
35
34
|
Components: c,
|
|
36
35
|
t: s,
|
|
37
|
-
title:
|
|
38
|
-
onSaved:
|
|
36
|
+
title: l,
|
|
37
|
+
onSaved: m,
|
|
39
38
|
onCancel: p
|
|
40
39
|
}
|
|
41
40
|
);
|
|
@@ -45,8 +44,8 @@ function x({
|
|
|
45
44
|
Fields: a,
|
|
46
45
|
Components: o,
|
|
47
46
|
t: n,
|
|
48
|
-
title:
|
|
49
|
-
onSaved:
|
|
47
|
+
title: l,
|
|
48
|
+
onSaved: m,
|
|
50
49
|
onCancel: p
|
|
51
50
|
}) {
|
|
52
51
|
const s = D({
|
|
@@ -54,10 +53,10 @@ function x({
|
|
|
54
53
|
name: "deductAsPercentage"
|
|
55
54
|
}), c = s === !0 || s === "true", i = async () => {
|
|
56
55
|
const r = await t.actions.onSubmit();
|
|
57
|
-
r &&
|
|
56
|
+
r && m(r.data, r.mode);
|
|
58
57
|
};
|
|
59
|
-
return /* @__PURE__ */ e(g, { error: t.errorHandling.errors, children: /* @__PURE__ */ e(
|
|
60
|
-
/* @__PURE__ */ e(o.Heading, { as: "h3", children:
|
|
58
|
+
return /* @__PURE__ */ e(g, { error: t.errorHandling.errors, children: /* @__PURE__ */ e(A, { formHookResult: t, children: /* @__PURE__ */ e(h, { onSubmit: i, children: /* @__PURE__ */ d(u, { flexDirection: "column", gap: 32, children: [
|
|
59
|
+
/* @__PURE__ */ e(o.Heading, { as: "h3", children: l }),
|
|
61
60
|
/* @__PURE__ */ d(u, { flexDirection: "column", gap: 20, children: [
|
|
62
61
|
/* @__PURE__ */ d(u, { flexDirection: "column", gap: 20, children: [
|
|
63
62
|
/* @__PURE__ */ e(
|
|
@@ -131,6 +130,6 @@ function x({
|
|
|
131
130
|
] }) }) }) });
|
|
132
131
|
}
|
|
133
132
|
export {
|
|
134
|
-
|
|
133
|
+
O as StandardDeductionForm
|
|
135
134
|
};
|
|
136
135
|
//# sourceMappingURL=StandardDeductionForm.js.map
|
package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandardDeductionForm.js","sources":["../../../../../../src/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useWatch } from 'react-hook-form'\nimport type {\n Garnishment,\n GarnishmentType,\n} from '@gusto/embedded-api/models/components/garnishment'\nimport type { Control } from 'react-hook-form'\nimport { useDeductionForm } from '../useDeductionForm'\nimport type { DeductionFormData } from '../useDeductionForm'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { BaseLayout } from '@/components/Base/Base'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface StandardDeductionFormProps {\n employeeId: string\n deduction: Garnishment | null\n /** Court-ordered garnishments require `garnishmentType`. Custom deductions don't. */\n courtOrdered: boolean\n /** Only meaningful when `courtOrdered: true`. Selects the garnishment type\n * on create. Ignored in edit mode (the existing type is preserved). */\n garnishmentType?: GarnishmentType\n /** Section heading shown above the form. The parent picker is responsible\n * for translating the garnishment-type label so this component doesn't\n * need to repeat the labels mapping. */\n title: string\n onSaved: (deduction: Garnishment, mode: 'create' | 'update') => void\n onCancel: () => void\n}\n\n/** @internal */\nexport function StandardDeductionForm({\n employeeId,\n deduction,\n courtOrdered,\n garnishmentType,\n title,\n onSaved,\n onCancel,\n}: StandardDeductionFormProps) {\n const { t } = useTranslation('Employee.DeductionsForm')\n const Components = useComponentContext()\n\n const form = useDeductionForm({\n employeeId,\n garnishmentId: deduction?.uuid,\n courtOrdered,\n defaultValues: courtOrdered && garnishmentType ? { garnishmentType } : undefined,\n })\n\n if (form.isLoading) {\n return <BaseLayout isLoading error={form.errorHandling.errors} />\n }\n\n const { Fields } = form.form\n return (\n <ReadyForm\n form={form}\n Fields={Fields}\n Components={Components}\n t={t}\n title={title}\n onSaved={onSaved}\n onCancel={onCancel}\n />\n )\n}\n\n// Split into a child component so we can call `useWatch` on the form's control\n// only once the hook is in its ready state (the control reference exists then).\nfunction ReadyForm({\n form,\n Fields,\n Components,\n t,\n title,\n onSaved,\n onCancel,\n}: {\n form: Extract<ReturnType<typeof useDeductionForm>, { isLoading: false }>\n Fields: Extract<ReturnType<typeof useDeductionForm>, { isLoading: false }>['form']['Fields']\n Components: ReturnType<typeof useComponentContext>\n t: ReturnType<typeof useTranslation<'Employee.DeductionsForm'>>['t']\n title: string\n onSaved: (deduction: Garnishment, mode: 'create' | 'update') => void\n onCancel: () => void\n}) {\n // useWatch subscribes to changes; getValues only reads once. We need the\n // subscription because `Fields.Amount`'s `format` and `description` props\n // need to re-render when the user toggles Percentage / Fixed amount.\n // The RadioGroup's options carry string values (`'true'`/`'false'`), which\n // round-trip into form state as strings — only `coerceStringBoolean` in the\n // zod preprocessor turns them into actual booleans at validation time. So\n // here we explicitly compare against both shapes; `Boolean('false')` would\n // be truthy and surface the wrong copy under the Amount field.\n const watchedDeductAsPercentageRaw = useWatch({\n control: form.form.hookFormInternals.formMethods.control as Control<DeductionFormData>,\n name: 'deductAsPercentage',\n }) as boolean | 'true' | 'false' | undefined\n const watchedDeductAsPercentage =\n watchedDeductAsPercentageRaw === true || watchedDeductAsPercentageRaw === 'true'\n\n const handleSubmit = async () => {\n const result = await form.actions.onSubmit()\n if (result) onSaved(result.data, result.mode)\n }\n\n return (\n <BaseLayout error={form.errorHandling.errors}>\n <SDKFormProvider formHookResult={form}>\n <Form onSubmit={handleSubmit}>\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h3\">{title}</Components.Heading>\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={20}>\n <Fields.Description\n label={t('standard.descriptionLabel')}\n validationMessages={{ REQUIRED: t('standard.descriptionRequired') }}\n />\n <Fields.Recurring\n label={t('standard.frequencyLabel')}\n getOptionLabel={(value: boolean) =>\n value ? t('standard.frequencyRecurring') : t('standard.frequencyOneTime')\n }\n validationMessages={{ REQUIRED: t('standard.frequencyRequired') }}\n />\n <Fields.DeductAsPercentage\n label={t('standard.typeLabel')}\n getOptionLabel={(value: boolean) =>\n value ? t('standard.typePercentage') : t('standard.typeFixed')\n }\n validationMessages={{ REQUIRED: t('standard.typeRequired') }}\n />\n <Fields.Amount\n label={t('standard.amountLabel')}\n format={watchedDeductAsPercentage ? 'percent' : 'currency'}\n description={\n watchedDeductAsPercentage\n ? t('standard.amountPercentDescription')\n : t('standard.amountFixedDescription')\n }\n min={0}\n validationMessages={{\n REQUIRED: t('standard.amountRequired'),\n NEGATIVE_AMOUNT: t('standard.amountNonNegative'),\n }}\n />\n </Flex>\n {Fields.TotalAmount && Fields.AnnualMaximum && (\n <Flex flexDirection=\"column\" gap={20}>\n <Fields.TotalAmount\n label={t('standard.totalAmountLabel')}\n description={t('standard.totalAmountDescription')}\n format=\"currency\"\n min={0}\n validationMessages={{\n NEGATIVE_AMOUNT: t('standard.amountNonNegative'),\n }}\n />\n <Fields.AnnualMaximum\n label={t('standard.annualMaxLabel')}\n description={t('standard.annualMaxDescription')}\n format=\"currency\"\n min={0}\n validationMessages={{\n NEGATIVE_AMOUNT: t('standard.amountNonNegative'),\n }}\n />\n </Flex>\n )}\n </Flex>\n <ActionsLayout>\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onCancel}>\n {t('actions.cancel')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={form.status.isPending}>\n {t('actions.save')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n )\n}\n"],"names":["StandardDeductionForm","employeeId","deduction","courtOrdered","garnishmentType","title","onSaved","onCancel","t","useTranslation","Components","useComponentContext","form","useDeductionForm","BaseLayout","Fields","jsx","ReadyForm","watchedDeductAsPercentageRaw","useWatch","watchedDeductAsPercentage","handleSubmit","result","SDKFormProvider","Form","jsxs","Flex","value","ActionsLayout"],"mappings":";;;;;;;;;;;AAiCO,SAASA,EAAsB;AAAA,EACpC,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AACF,GAA+B;AAC7B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAChDC,IAAaC,EAAA,GAEbC,IAAOC,EAAiB;AAAA,IAC5B,YAAAZ;AAAA,IACA,eAAeC,GAAW;AAAA,IAC1B,cAAAC;AAAA,IACA,eAAeA,KAAgBC,IAAkB,EAAE,iBAAAA,MAAoB;AAAA,EAAA,CACxE;AAED,MAAIQ,EAAK;AACP,6BAAQE,GAAA,EAAW,WAAS,IAAC,OAAOF,EAAK,cAAc,QAAQ;AAGjE,QAAM,EAAE,QAAAG,MAAWH,EAAK;AACxB,SACE,gBAAAI;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAL;AAAA,MACA,QAAAG;AAAA,MACA,YAAAL;AAAA,MACA,G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AA,IAAA,GAEJ;AAAA,sBACCoB,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAZ,EAACN,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASH,GAC3D,UAAAC,EAAE,gBAAgB,EAAA,CACrB;AAAA,MACA,gBAAAQ,EAACN,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWE,EAAK,OAAO,WACrD,UAAAJ,EAAE,cAAc,EAAA,CACnB;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"StandardDeductionForm.js","sources":["../../../../../../src/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useWatch } from 'react-hook-form'\nimport type {\n Garnishment,\n GarnishmentType,\n} from '@gusto/embedded-api/models/components/garnishment'\nimport type { Control } from 'react-hook-form'\nimport { useDeductionForm } from '../useDeductionForm'\nimport type { DeductionFormData } from '../useDeductionForm'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { BaseLayout } from '@/components/Base/Base'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface StandardDeductionFormProps {\n employeeId: string\n deduction: Garnishment | null\n /** Court-ordered garnishments require `garnishmentType`. Custom deductions don't. */\n courtOrdered: boolean\n /** Only meaningful when `courtOrdered: true`. Selects the garnishment type\n * on create. Ignored in edit mode (the existing type is preserved). */\n garnishmentType?: GarnishmentType\n /** Section heading shown above the form. The parent picker is responsible\n * for translating the garnishment-type label so this component doesn't\n * need to repeat the labels mapping. */\n title: string\n onSaved: (deduction: Garnishment, mode: 'create' | 'update') => void\n onCancel: () => void\n}\n\n/** @internal */\nexport function StandardDeductionForm({\n employeeId,\n deduction,\n courtOrdered,\n garnishmentType,\n title,\n onSaved,\n onCancel,\n}: StandardDeductionFormProps) {\n const { t } = useTranslation('Employee.DeductionsForm')\n const Components = useComponentContext()\n\n const form = useDeductionForm({\n employeeId,\n garnishmentId: deduction?.uuid,\n courtOrdered,\n defaultValues: courtOrdered && garnishmentType ? { garnishmentType } : undefined,\n })\n\n if (form.isLoading) {\n return <BaseLayout isLoading error={form.errorHandling.errors} />\n }\n\n const { Fields } = form.form\n return (\n <ReadyForm\n form={form}\n Fields={Fields}\n Components={Components}\n t={t}\n title={title}\n onSaved={onSaved}\n onCancel={onCancel}\n />\n )\n}\n\n// Split into a child component so we can call `useWatch` on the form's control\n// only once the hook is in its ready state (the control reference exists then).\nfunction ReadyForm({\n form,\n Fields,\n Components,\n t,\n title,\n onSaved,\n onCancel,\n}: {\n form: Extract<ReturnType<typeof useDeductionForm>, { isLoading: false }>\n Fields: Extract<ReturnType<typeof useDeductionForm>, { isLoading: false }>['form']['Fields']\n Components: ReturnType<typeof useComponentContext>\n t: ReturnType<typeof useTranslation<'Employee.DeductionsForm'>>['t']\n title: string\n onSaved: (deduction: Garnishment, mode: 'create' | 'update') => void\n onCancel: () => void\n}) {\n // useWatch subscribes to changes; getValues only reads once. We need the\n // subscription because `Fields.Amount`'s `format` and `description` props\n // need to re-render when the user toggles Percentage / Fixed amount.\n // The RadioGroup's options carry string values (`'true'`/`'false'`), which\n // round-trip into form state as strings — only `coerceStringBoolean` in the\n // zod preprocessor turns them into actual booleans at validation time. So\n // here we explicitly compare against both shapes; `Boolean('false')` would\n // be truthy and surface the wrong copy under the Amount field.\n const watchedDeductAsPercentageRaw = useWatch({\n control: form.form.hookFormInternals.formMethods.control as Control<DeductionFormData>,\n name: 'deductAsPercentage',\n }) as boolean | 'true' | 'false' | undefined\n const watchedDeductAsPercentage =\n watchedDeductAsPercentageRaw === true || watchedDeductAsPercentageRaw === 'true'\n\n const handleSubmit = async () => {\n const result = await form.actions.onSubmit()\n if (result) onSaved(result.data, result.mode)\n }\n\n return (\n <BaseLayout error={form.errorHandling.errors}>\n <SDKFormProvider formHookResult={form}>\n <Form onSubmit={handleSubmit}>\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h3\">{title}</Components.Heading>\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={20}>\n <Fields.Description\n label={t('standard.descriptionLabel')}\n validationMessages={{ REQUIRED: t('standard.descriptionRequired') }}\n />\n <Fields.Recurring\n label={t('standard.frequencyLabel')}\n getOptionLabel={(value: boolean) =>\n value ? t('standard.frequencyRecurring') : t('standard.frequencyOneTime')\n }\n validationMessages={{ REQUIRED: t('standard.frequencyRequired') }}\n />\n <Fields.DeductAsPercentage\n label={t('standard.typeLabel')}\n getOptionLabel={(value: boolean) =>\n value ? t('standard.typePercentage') : t('standard.typeFixed')\n }\n validationMessages={{ REQUIRED: t('standard.typeRequired') }}\n />\n <Fields.Amount\n label={t('standard.amountLabel')}\n format={watchedDeductAsPercentage ? 'percent' : 'currency'}\n description={\n watchedDeductAsPercentage\n ? t('standard.amountPercentDescription')\n : t('standard.amountFixedDescription')\n }\n min={0}\n validationMessages={{\n REQUIRED: t('standard.amountRequired'),\n NEGATIVE_AMOUNT: t('standard.amountNonNegative'),\n }}\n />\n </Flex>\n {Fields.TotalAmount && Fields.AnnualMaximum && (\n <Flex flexDirection=\"column\" gap={20}>\n <Fields.TotalAmount\n label={t('standard.totalAmountLabel')}\n description={t('standard.totalAmountDescription')}\n format=\"currency\"\n min={0}\n validationMessages={{\n NEGATIVE_AMOUNT: t('standard.amountNonNegative'),\n }}\n />\n <Fields.AnnualMaximum\n label={t('standard.annualMaxLabel')}\n description={t('standard.annualMaxDescription')}\n format=\"currency\"\n min={0}\n validationMessages={{\n NEGATIVE_AMOUNT: t('standard.amountNonNegative'),\n }}\n />\n </Flex>\n )}\n </Flex>\n <ActionsLayout>\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onCancel}>\n {t('actions.cancel')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={form.status.isPending}>\n {t('actions.save')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n )\n}\n"],"names":["StandardDeductionForm","employeeId","deduction","courtOrdered","garnishmentType","title","onSaved","onCancel","t","useTranslation","Components","useComponentContext","form","useDeductionForm","BaseLayout","Fields","jsx","ReadyForm","watchedDeductAsPercentageRaw","useWatch","watchedDeductAsPercentage","handleSubmit","result","SDKFormProvider","Form","jsxs","Flex","value","ActionsLayout"],"mappings":";;;;;;;;;;AAiCO,SAASA,EAAsB;AAAA,EACpC,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AACF,GAA+B;AAC7B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAChDC,IAAaC,EAAA,GAEbC,IAAOC,EAAiB;AAAA,IAC5B,YAAAZ;AAAA,IACA,eAAeC,GAAW;AAAA,IAC1B,cAAAC;AAAA,IACA,eAAeA,KAAgBC,IAAkB,EAAE,iBAAAA,MAAoB;AAAA,EAAA,CACxE;AAED,MAAIQ,EAAK;AACP,6BAAQE,GAAA,EAAW,WAAS,IAAC,OAAOF,EAAK,cAAc,QAAQ;AAGjE,QAAM,EAAE,QAAAG,MAAWH,EAAK;AACxB,SACE,gBAAAI;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAL;AAAA,MACA,QAAAG;AAAA,MACA,YAAAL;AAAA,MACA,GAAAF;AAAA,MACA,OAAAH;AAAA,MACA,SAAAC;AAAA,MACA,UAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;AAIA,SAASU,EAAU;AAAA,EACjB,MAAAL;AAAA,EACA,QAAAG;AAAA,EACA,YAAAL;AAAA,EACA,GAAAF;AAAA,EACA,OAAAH;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AACF,GAQG;AASD,QAA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J,EAAE,cAAc,EAAA,CACnB;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as s, Trans as
|
|
3
|
-
import { useEmployeeFormsGetSuspense as
|
|
2
|
+
import { useTranslation as s, Trans as u } from "react-i18next";
|
|
3
|
+
import { useEmployeeFormsGetSuspense as p } from "@gusto/embedded-api/react-query/employeeFormsGet";
|
|
4
4
|
import { useEmployeeFormsGetPdfSuspense as f } from "@gusto/embedded-api/react-query/employeeFormsGetPdf";
|
|
5
5
|
import { BaseComponent as d } from "../../../Base/Base.js";
|
|
6
6
|
import { useBase as C } from "../../../Base/useBase.js";
|
|
7
7
|
import { Flex as D } from "../../../Common/Flex/Flex.js";
|
|
8
8
|
import { ActionsLayout as y } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
9
9
|
import { useComponentContext as g } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
|
-
import "react";
|
|
11
10
|
import { useI18n as h } from "../../../../i18n/I18n.js";
|
|
12
11
|
import { componentEvents as E } from "../../../../shared/constants.js";
|
|
13
12
|
import { DocumentViewer as x } from "../../../Common/DocumentViewer/DocumentViewer.js";
|
|
14
|
-
function
|
|
13
|
+
function N(o) {
|
|
15
14
|
return h("Employee.DocumentManager"), /* @__PURE__ */ e(d, { ...o, componentName: "Employee.DocumentManager", children: /* @__PURE__ */ e(w, { employeeId: o.employeeId, formId: o.formId }) });
|
|
16
15
|
}
|
|
17
16
|
function w({
|
|
@@ -20,13 +19,13 @@ function w({
|
|
|
20
19
|
}) {
|
|
21
20
|
const { t: r } = s("Employee.DocumentManager"), t = g(), { onEvent: a } = C(), {
|
|
22
21
|
data: { form: n }
|
|
23
|
-
} =
|
|
22
|
+
} = p({ employeeId: o, formId: i }), {
|
|
24
23
|
data: { formPdf: c }
|
|
25
24
|
} = f({ employeeId: o, formId: i }), m = c?.documentUrl;
|
|
26
25
|
return n ? /* @__PURE__ */ l(D, { flexDirection: "column", gap: 16, children: [
|
|
27
26
|
n.title && /* @__PURE__ */ e(t.Heading, { as: "h2", children: n.title }),
|
|
28
27
|
m && /* @__PURE__ */ e(t.Text, { children: /* @__PURE__ */ e(
|
|
29
|
-
|
|
28
|
+
u,
|
|
30
29
|
{
|
|
31
30
|
t: r,
|
|
32
31
|
i18nKey: "downloadDocumentCta",
|
|
@@ -57,6 +56,6 @@ function w({
|
|
|
57
56
|
] }) : null;
|
|
58
57
|
}
|
|
59
58
|
export {
|
|
60
|
-
|
|
59
|
+
N as DocumentManager
|
|
61
60
|
};
|
|
62
61
|
//# sourceMappingURL=DocumentManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentManager.js","sources":["../../../../../src/components/Employee/Documents/management/DocumentManager.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { useEmployeeFormsGetSuspense } from '@gusto/embedded-api/react-query/employeeFormsGet'\nimport { useEmployeeFormsGetPdfSuspense } from '@gusto/embedded-api/react-query/employeeFormsGetPdf'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport type { BaseComponentKeys } from '@/components/Base/Base'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { DocumentViewer } from '@/components/Common/DocumentViewer'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\n/**\n * Props for {@link DocumentManager}.\n *\n * @public\n */\nexport interface DocumentManagerProps extends BaseComponentInterface<'Employee.DocumentManager'> {\n /** The associated employee identifier. */\n employeeId: string\n /** The identifier of the form to display. */\n formId: string\n}\n\n/**\n * Read-only document viewer for the admin-facing employee dashboard. Renders the\n * selected form's PDF — including unsigned forms, which are shown as-is.\n * Signing is intentionally not offered here; forms are signed by the employee\n * during onboarding, not by an admin viewing the dashboard.\n *\n * @remarks\n * Emits the following events:\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `CANCEL` | The back button is selected | — |\n *\n * @param props - See {@link DocumentManagerProps}.\n * @public\n */\nexport function DocumentManager(props: DocumentManagerProps) {\n useI18n('Employee.DocumentManager')\n return (\n <BaseComponent {...props} componentName=\"Employee.DocumentManager\">\n <DocumentManagerRoot employeeId={props.employeeId} formId={props.formId} />\n </BaseComponent>\n )\n}\n\nfunction DocumentManagerRoot({\n employeeId,\n formId,\n}: Omit<DocumentManagerProps, BaseComponentKeys>) {\n const { t } = useTranslation('Employee.DocumentManager')\n const Components = useComponentContext()\n const { onEvent } = useBase()\n\n const {\n data: { form },\n } = useEmployeeFormsGetSuspense({ employeeId, formId })\n const {\n data: { formPdf },\n } = useEmployeeFormsGetPdfSuspense({ employeeId, formId })\n\n const pdfUrl = formPdf?.documentUrl\n\n if (!form) return null\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {form.title && <Components.Heading as=\"h2\">{form.title}</Components.Heading>}\n {pdfUrl && (\n <Components.Text>\n <Trans\n t={t}\n i18nKey=\"downloadDocumentCta\"\n components={{\n downloadLink: (\n <Components.Link\n href={pdfUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n download={`${form.title || 'form'}.pdf`}\n />\n ),\n }}\n />\n </Components.Text>\n )}\n <DocumentViewer url={pdfUrl} title={form.title} viewDocumentLabel={t('viewDocumentCta')} />\n\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.CANCEL)\n }}\n >\n {t('backCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["DocumentManager","props","useI18n","jsx","BaseComponent","DocumentManagerRoot","employeeId","formId","t","useTranslation","Components","useComponentContext","onEvent","useBase","form","useEmployeeFormsGetSuspense","formPdf","useEmployeeFormsGetPdfSuspense","pdfUrl","jsxs","Flex","Trans","DocumentViewer","ActionsLayout","componentEvents"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DocumentManager.js","sources":["../../../../../src/components/Employee/Documents/management/DocumentManager.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { useEmployeeFormsGetSuspense } from '@gusto/embedded-api/react-query/employeeFormsGet'\nimport { useEmployeeFormsGetPdfSuspense } from '@gusto/embedded-api/react-query/employeeFormsGetPdf'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport type { BaseComponentKeys } from '@/components/Base/Base'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { DocumentViewer } from '@/components/Common/DocumentViewer'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\n/**\n * Props for {@link DocumentManager}.\n *\n * @public\n */\nexport interface DocumentManagerProps extends BaseComponentInterface<'Employee.DocumentManager'> {\n /** The associated employee identifier. */\n employeeId: string\n /** The identifier of the form to display. */\n formId: string\n}\n\n/**\n * Read-only document viewer for the admin-facing employee dashboard. Renders the\n * selected form's PDF — including unsigned forms, which are shown as-is.\n * Signing is intentionally not offered here; forms are signed by the employee\n * during onboarding, not by an admin viewing the dashboard.\n *\n * @remarks\n * Emits the following events:\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `CANCEL` | The back button is selected | — |\n *\n * @param props - See {@link DocumentManagerProps}.\n * @public\n */\nexport function DocumentManager(props: DocumentManagerProps) {\n useI18n('Employee.DocumentManager')\n return (\n <BaseComponent {...props} componentName=\"Employee.DocumentManager\">\n <DocumentManagerRoot employeeId={props.employeeId} formId={props.formId} />\n </BaseComponent>\n )\n}\n\nfunction DocumentManagerRoot({\n employeeId,\n formId,\n}: Omit<DocumentManagerProps, BaseComponentKeys>) {\n const { t } = useTranslation('Employee.DocumentManager')\n const Components = useComponentContext()\n const { onEvent } = useBase()\n\n const {\n data: { form },\n } = useEmployeeFormsGetSuspense({ employeeId, formId })\n const {\n data: { formPdf },\n } = useEmployeeFormsGetPdfSuspense({ employeeId, formId })\n\n const pdfUrl = formPdf?.documentUrl\n\n if (!form) return null\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {form.title && <Components.Heading as=\"h2\">{form.title}</Components.Heading>}\n {pdfUrl && (\n <Components.Text>\n <Trans\n t={t}\n i18nKey=\"downloadDocumentCta\"\n components={{\n downloadLink: (\n <Components.Link\n href={pdfUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n download={`${form.title || 'form'}.pdf`}\n />\n ),\n }}\n />\n </Components.Text>\n )}\n <DocumentViewer url={pdfUrl} title={form.title} viewDocumentLabel={t('viewDocumentCta')} />\n\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.CANCEL)\n }}\n >\n {t('backCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["DocumentManager","props","useI18n","jsx","BaseComponent","DocumentManagerRoot","employeeId","formId","t","useTranslation","Components","useComponentContext","onEvent","useBase","form","useEmployeeFormsGetSuspense","formPdf","useEmployeeFormsGetPdfSuspense","pdfUrl","jsxs","Flex","Trans","DocumentViewer","ActionsLayout","componentEvents"],"mappings":";;;;;;;;;;;;AAwCO,SAASA,EAAgBC,GAA6B;AAC3D,SAAAC,EAAQ,0BAA0B,GAEhC,gBAAAC,EAACC,GAAA,EAAe,GAAGH,GAAO,eAAc,4BACtC,UAAA,gBAAAE,EAACE,GAAA,EAAoB,YAAYJ,EAAM,YAAY,QAAQA,EAAM,QAAQ,GAC3E;AAEJ;AAEA,SAASI,EAAoB;AAAA,EAC3B,YAAAC;AAAA,EACA,QAAAC;AACF,GAAkD;AAChD,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,0BAA0B,GACjDC,IAAaC,EAAA,GACb,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEd;AAAA,IACJ,MAAM,EAAE,MAAAC,EAAA;AAAA,EAAK,IACXC,EAA4B,EAAE,YAAAT,GAAY,QAAAC,GAAQ,GAChD;AAAA,IACJ,MAAM,EAAE,SAAAS,EAAA;AAAA,EAAQ,IACdC,EAA+B,EAAE,YAAAX,GAAY,QAAAC,GAAQ,GAEnDW,IAASF,GAAS;AAExB,SAAKF,IAGH,gBAAAK,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAA;AAAA,IAAAN,EAAK,2BAAUJ,EAAW,SAAX,EAAmB,IAAG,MAAM,YAAK,MAAA,CAAM;AAAA,IACtDQ,KACC,gBAAAf,EAACO,EAAW,MAAX,EACC,UAAA,gBAAAP;AAAA,MAACkB;AAAA,MAAA;AAAA,QACC,GAAAb;AAAA,QACA,SAAQ;AAAA,QACR,YAAY;AAAA,UACV,cACE,gBAAAL;AAAA,YAACO,EAAW;AAAA,YAAX;AAAA,cACC,MAAMQ;AAAA,cACN,QAAO;AAAA,cACP,KAAI;AAAA,cACJ,UAAU,GAAGJ,EAAK,SAAS,MAAM;AAAA,YAAA;AAAA,UAAA;AAAA,QACnC;AAAA,MAEJ;AAAA,IAAA,GAEJ;AAAA,IAEF,gBAAAX,EAACmB,GAAA,EAAe,KAAKJ,GAAQ,OAAOJ,EAAK,OAAO,mBAAmBN,EAAE,iBAAiB,EAAA,CAAG;AAAA,sBAExFe,GAAA,EACC,UAAA,gBAAApB;AAAA,MAACO,EAAW;AAAA,MAAX;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAE,EAAQY,EAAgB,MAAM;AAAA,QAChC;AAAA,QAEC,YAAE,SAAS;AAAA,MAAA;AAAA,IAAA,EACd,CACF;AAAA,EAAA,GACF,IAnCgB;AAqCpB;"}
|
|
@@ -2,20 +2,19 @@ import { jsx as e } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTranslation as c } from "react-i18next";
|
|
3
3
|
import { Loading as d } from "../../../../Common/Loading/Loading.js";
|
|
4
4
|
import { EmptyData as l } from "../../../../Common/EmptyData/EmptyData.js";
|
|
5
|
-
import {
|
|
6
|
-
import "
|
|
7
|
-
import { BaseBoundaries as g, BaseLayout as f } from "../../../../Base/Base.js";
|
|
5
|
+
import { BaseBoundaries as g, BaseLayout as p } from "../../../../Base/Base.js";
|
|
6
|
+
import { useComponentContext as f } from "../../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
7
|
import { useI18n as y } from "../../../../../i18n/I18n.js";
|
|
9
8
|
import { componentEvents as E } from "../../../../../shared/constants.js";
|
|
10
9
|
import { useDocumentsList as D } from "../../shared/useDocumentsList/useDocumentsList.js";
|
|
11
10
|
import { useDataView as S } from "../../../../Common/DataView/useDataView.js";
|
|
12
11
|
import { DataView as C } from "../../../../Common/DataView/DataView.js";
|
|
13
|
-
function
|
|
12
|
+
function v(o) {
|
|
14
13
|
return /* @__PURE__ */ e(g, { componentName: "Employee.Management.Documents", children: /* @__PURE__ */ e(h, { ...o }) });
|
|
15
14
|
}
|
|
16
15
|
function h({ employeeId: o, onEvent: s }) {
|
|
17
16
|
y("Employee.Management.Documents");
|
|
18
|
-
const { t } = c("Employee.Management.Documents"), r =
|
|
17
|
+
const { t } = c("Employee.Management.Documents"), r = f(), i = D({ employeeId: o }), a = i.isLoading ? [] : i.data.forms, m = [
|
|
19
18
|
{
|
|
20
19
|
key: "title",
|
|
21
20
|
title: t("columns.title"),
|
|
@@ -54,9 +53,9 @@ function h({ employeeId: o, onEvent: s }) {
|
|
|
54
53
|
),
|
|
55
54
|
emptyState: () => /* @__PURE__ */ e(l, { title: t("emptyState.title"), description: t("emptyState.description") })
|
|
56
55
|
});
|
|
57
|
-
return /* @__PURE__ */ e(
|
|
56
|
+
return /* @__PURE__ */ e(p, { error: i.errorHandling.errors, children: /* @__PURE__ */ e(r.Box, { withPadding: !1, header: /* @__PURE__ */ e(r.BoxHeader, { title: t("title") }), children: i.isLoading ? /* @__PURE__ */ e(d, {}) : /* @__PURE__ */ e(C, { label: t("listLabel"), isWithinBox: !0, ...u }) }) });
|
|
58
57
|
}
|
|
59
58
|
export {
|
|
60
|
-
|
|
59
|
+
v as DocumentsCard
|
|
61
60
|
};
|
|
62
61
|
//# sourceMappingURL=DocumentsCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentsCard.js","sources":["../../../../../../src/components/Employee/Documents/management/DocumentsCard/DocumentsCard.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Form } from '@gusto/embedded-api/models/components/form'\nimport { useDocumentsList } from '../../shared/useDocumentsList'\nimport { DataView, useDataView, EmptyData, Loading } from '@/components/Common'\nimport { BaseBoundaries, BaseLayout } from '@/components/Base/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport type { OnEventType } from '@/components/Base/useBase'\n\n/**\n * Props for {@link DocumentsCard}.\n *\n * @public\n */\nexport interface DocumentsCardProps {\n /** The associated employee identifier. */\n employeeId: string\n /** Event handler fired when a row's View CTA is clicked. */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Standalone \"Documents\" (forms) card. Owns its own data fetch via\n * {@link useDocumentsList} and renders the employee's forms in a table with a\n * per-row \"View\" action. Emits\n * `employee/management/documents/card/viewRequested` with\n * `{ employeeId, formId }` when a row's View CTA is clicked. The card is\n * read-only — viewing or signing a form happens in the screen the parent\n * routes to — and renders no alerts: alert rendering is the parent's\n * responsibility.\n *\n * @param props - See {@link DocumentsCardProps}.\n * @returns The documents card.\n * @public\n */\nexport function DocumentsCard(props: DocumentsCardProps) {\n return (\n <BaseBoundaries componentName=\"Employee.Management.Documents\">\n <DocumentsCardContent {...props} />\n </BaseBoundaries>\n )\n}\n\nfunction DocumentsCardContent({ employeeId, onEvent }: DocumentsCardProps) {\n useI18n('Employee.Management.Documents')\n const { t } = useTranslation('Employee.Management.Documents')\n const Components = useComponentContext()\n\n const documentsList = useDocumentsList({ employeeId })\n\n const forms = documentsList.isLoading ? [] : documentsList.data.forms\n\n const formsColumns = [\n {\n key: 'title',\n title: t('columns.title'),\n render: (form: Form) => form.title || '-',\n },\n {\n key: 'year',\n title: t('columns.year'),\n render: (form: Form) => (form.year ? String(form.year) : '-'),\n },\n {\n key: 'status',\n title: t('columns.status'),\n render: (form: Form) => (form.draft ? t('status.draft') : t('status.final')),\n },\n {\n key: 'requiresSigning',\n title: t('columns.requiresSigning'),\n render: (form: Form) =>\n form.requiresSigning ? (\n <Components.Badge status=\"warning\">{t('signingStatus.notSigned')}</Components.Badge>\n ) : (\n <Components.Badge status=\"success\">{t('signingStatus.signed')}</Components.Badge>\n ),\n },\n ]\n\n const formsDataView = useDataView({\n data: forms,\n columns: formsColumns,\n itemMenu: (form: Form) => (\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.EMPLOYEE_MANAGEMENT_DOCUMENTS_CARD_VIEW_REQUESTED, {\n employeeId,\n formId: form.uuid,\n })\n }}\n >\n {t('viewCta')}\n </Components.Button>\n ),\n emptyState: () => (\n <EmptyData title={t('emptyState.title')} description={t('emptyState.description')} />\n ),\n })\n\n return (\n <BaseLayout error={documentsList.errorHandling.errors}>\n <Components.Box withPadding={false} header={<Components.BoxHeader title={t('title')} />}>\n {documentsList.isLoading ? (\n <Loading />\n ) : (\n <DataView label={t('listLabel')} isWithinBox {...formsDataView} />\n )}\n </Components.Box>\n </BaseLayout>\n )\n}\n"],"names":["DocumentsCard","props","jsx","BaseBoundaries","DocumentsCardContent","employeeId","onEvent","useI18n","useTranslation","Components","useComponentContext","documentsList","useDocumentsList","forms","formsColumns","form","formsDataView","useDataView","componentEvents","EmptyData","BaseLayout","Loading","DataView"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DocumentsCard.js","sources":["../../../../../../src/components/Employee/Documents/management/DocumentsCard/DocumentsCard.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Form } from '@gusto/embedded-api/models/components/form'\nimport { useDocumentsList } from '../../shared/useDocumentsList'\nimport { DataView, useDataView, EmptyData, Loading } from '@/components/Common'\nimport { BaseBoundaries, BaseLayout } from '@/components/Base/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport type { OnEventType } from '@/components/Base/useBase'\n\n/**\n * Props for {@link DocumentsCard}.\n *\n * @public\n */\nexport interface DocumentsCardProps {\n /** The associated employee identifier. */\n employeeId: string\n /** Event handler fired when a row's View CTA is clicked. */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Standalone \"Documents\" (forms) card. Owns its own data fetch via\n * {@link useDocumentsList} and renders the employee's forms in a table with a\n * per-row \"View\" action. Emits\n * `employee/management/documents/card/viewRequested` with\n * `{ employeeId, formId }` when a row's View CTA is clicked. The card is\n * read-only — viewing or signing a form happens in the screen the parent\n * routes to — and renders no alerts: alert rendering is the parent's\n * responsibility.\n *\n * @param props - See {@link DocumentsCardProps}.\n * @returns The documents card.\n * @public\n */\nexport function DocumentsCard(props: DocumentsCardProps) {\n return (\n <BaseBoundaries componentName=\"Employee.Management.Documents\">\n <DocumentsCardContent {...props} />\n </BaseBoundaries>\n )\n}\n\nfunction DocumentsCardContent({ employeeId, onEvent }: DocumentsCardProps) {\n useI18n('Employee.Management.Documents')\n const { t } = useTranslation('Employee.Management.Documents')\n const Components = useComponentContext()\n\n const documentsList = useDocumentsList({ employeeId })\n\n const forms = documentsList.isLoading ? [] : documentsList.data.forms\n\n const formsColumns = [\n {\n key: 'title',\n title: t('columns.title'),\n render: (form: Form) => form.title || '-',\n },\n {\n key: 'year',\n title: t('columns.year'),\n render: (form: Form) => (form.year ? String(form.year) : '-'),\n },\n {\n key: 'status',\n title: t('columns.status'),\n render: (form: Form) => (form.draft ? t('status.draft') : t('status.final')),\n },\n {\n key: 'requiresSigning',\n title: t('columns.requiresSigning'),\n render: (form: Form) =>\n form.requiresSigning ? (\n <Components.Badge status=\"warning\">{t('signingStatus.notSigned')}</Components.Badge>\n ) : (\n <Components.Badge status=\"success\">{t('signingStatus.signed')}</Components.Badge>\n ),\n },\n ]\n\n const formsDataView = useDataView({\n data: forms,\n columns: formsColumns,\n itemMenu: (form: Form) => (\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.EMPLOYEE_MANAGEMENT_DOCUMENTS_CARD_VIEW_REQUESTED, {\n employeeId,\n formId: form.uuid,\n })\n }}\n >\n {t('viewCta')}\n </Components.Button>\n ),\n emptyState: () => (\n <EmptyData title={t('emptyState.title')} description={t('emptyState.description')} />\n ),\n })\n\n return (\n <BaseLayout error={documentsList.errorHandling.errors}>\n <Components.Box withPadding={false} header={<Components.BoxHeader title={t('title')} />}>\n {documentsList.isLoading ? (\n <Loading />\n ) : (\n <DataView label={t('listLabel')} isWithinBox {...formsDataView} />\n )}\n </Components.Box>\n </BaseLayout>\n )\n}\n"],"names":["DocumentsCard","props","jsx","BaseBoundaries","DocumentsCardContent","employeeId","onEvent","useI18n","useTranslation","Components","useComponentContext","documentsList","useDocumentsList","forms","formsColumns","form","formsDataView","useDataView","componentEvents","EmptyData","BaseLayout","Loading","DataView"],"mappings":";;;;;;;;;;;AAoCO,SAASA,EAAcC,GAA2B;AACvD,SACE,gBAAAC,EAACC,KAAe,eAAc,iCAC5B,4BAACC,GAAA,EAAsB,GAAGH,GAAO,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAqB,EAAE,YAAAC,GAAY,SAAAC,KAA+B;AACzE,EAAAC,EAAQ,+BAA+B;AACvC,QAAM,EAAE,EAAA,IAAMC,EAAe,+BAA+B,GACtDC,IAAaC,EAAA,GAEbC,IAAgBC,EAAiB,EAAE,YAAAP,GAAY,GAE/CQ,IAAQF,EAAc,YAAY,CAAA,IAAKA,EAAc,KAAK,OAE1DG,IAAe;AAAA,IACnB;AAAA,MACE,KAAK;AAAA,MACL,OAAO,EAAE,eAAe;AAAA,MACxB,QAAQ,CAACC,MAAeA,EAAK,SAAS;AAAA,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,IAET,gBAAAnB,EAACoB,GAAA,EAAS,OAAO,EAAE,WAAW,GAAG,aAAW,IAAE,GAAGN,EAAA,CAAe,GAEpE,GACF;AAEJ;"}
|
package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js
CHANGED
|
@@ -3,12 +3,11 @@ import { useTranslation as r } from "react-i18next";
|
|
|
3
3
|
import { useDocumentList as s } from "./useDocumentList.js";
|
|
4
4
|
import { ActionsLayout as m } from "../../../../../Common/ActionsLayout/ActionsLayout.js";
|
|
5
5
|
import { useComponentContext as c } from "../../../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return /* @__PURE__ */ o(m, { children: /* @__PURE__ */ o(e.Button, { onClick: t, isLoading: !1, isDisabled: !i, children: n("continueCta") }) });
|
|
6
|
+
function d() {
|
|
7
|
+
const { t: n } = r("Employee.DocumentSigner"), { handleContinue: t, hasSignedAllForms: e } = s(), i = c();
|
|
8
|
+
return /* @__PURE__ */ o(m, { children: /* @__PURE__ */ o(i.Button, { onClick: t, isLoading: !1, isDisabled: !e, children: n("continueCta") }) });
|
|
10
9
|
}
|
|
11
10
|
export {
|
|
12
|
-
|
|
11
|
+
d as Actions
|
|
13
12
|
};
|
|
14
13
|
//# sourceMappingURL=Actions.js.map
|