@gusto/embedded-react-sdk 0.26.0 → 0.27.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 +70 -0
- package/dist/assets/icons/plus-circle.svg.js +5 -5
- package/dist/assets/icons/plus-circle.svg.js.map +1 -1
- package/dist/components/Base/Base.js +13 -12
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/DocumentList/DocumentList.js +23 -23
- package/dist/components/Common/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Common/DocumentList/DocumentList.module.scss.js +6 -10
- package/dist/components/Common/DocumentList/DocumentList.module.scss.js.map +1 -1
- package/dist/components/Common/DocumentViewer/DocumentViewer.module.scss.js +12 -12
- package/dist/components/Common/InlineSpinner/InlineSpinner.module.scss.js +1 -1
- package/dist/components/Common/InternalError/InternalError.module.scss.js +4 -4
- package/dist/components/Common/ReorderableList/ReorderableList.module.scss.js +8 -8
- package/dist/components/Common/RequirementsList/RequirementsList.module.scss.js +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +12 -10
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +3 -2
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +7 -6
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/Alert/Alert.module.scss.js +9 -9
- package/dist/components/Common/UI/Banner/Banner.module.scss.js +1 -1
- package/dist/components/Common/UI/Button/Button.module.scss.js +1 -1
- package/dist/components/Common/UI/CalendarPreview/CalendarPreview.module.scss.js +4 -4
- package/dist/components/Common/UI/Card/Card.module.scss.js +1 -1
- package/dist/components/Common/UI/Checkbox/Checkbox.module.scss.js +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +3 -3
- package/dist/components/Common/UI/DatePicker/DatePicker.module.scss.js +4 -4
- package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +1 -1
- package/dist/components/Common/UI/Dialog/Dialog.module.scss.js +2 -2
- package/dist/components/Common/UI/FileInput/FileInput.module.scss.js +26 -26
- package/dist/components/Common/UI/Input/Input.module.scss.js +8 -8
- package/dist/components/Common/UI/Modal/Modal.module.scss.js +12 -12
- package/dist/components/Common/UI/Radio/Radio.module.scss.js +6 -6
- package/dist/components/Common/UI/Select/Select.module.scss.js +4 -4
- package/dist/components/Common/UI/Table/Table.js +1 -1
- package/dist/components/Common/UI/Table/Table.js.map +1 -1
- package/dist/components/Common/UI/Table/Table.module.scss.js +1 -1
- package/dist/components/Common/UI/Tabs/Tabs.module.scss.js +1 -1
- package/dist/components/Common/UI/Text/Text.module.scss.js +17 -15
- package/dist/components/Common/UI/Text/Text.module.scss.js.map +1 -1
- package/dist/components/Common/UI/TextArea/TextArea.module.scss.js +4 -4
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +3 -2
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +4 -3
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +3 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +12 -12
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +3 -2
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +4 -3
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +7 -5
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +3 -2
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -6
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +7 -5
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +3 -2
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +9 -8
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +4 -3
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +7 -6
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +4 -3
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +5 -3
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +6 -5
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +8 -7
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +7 -6
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +3 -2
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +7 -6
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +4 -3
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +7 -6
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +8 -7
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +12 -10
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +8 -6
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +8 -7
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +4 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +4 -3
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +3 -2
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
- package/dist/components/Company/PaySchedule/_parts/Head.js +13 -11
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +15 -13
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +5 -4
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +1 -1
- package/dist/components/Contractor/Address/useAddress.js +6 -5
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +32 -31
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +14 -13
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +12 -11
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +4 -3
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +4 -2
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +10 -10
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +9 -7
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +9 -8
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +11 -9
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +8 -6
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js +14 -14
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +4 -2
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +4 -2
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
- package/dist/components/Contractor/Profile/ContractorProfileForm.module.scss.js +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +3 -2
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +21 -20
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +13 -12
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +17 -16
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +23 -22
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.d.ts +3 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +145 -137
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +2 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +106 -101
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +90 -87
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.d.ts +2 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +110 -104
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +51 -45
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +31 -30
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js +4 -8
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +3 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +3 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +4 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +3 -2
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +7 -6
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +4 -3
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +7 -5
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +3 -2
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -3
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Actions.js +6 -5
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +12 -11
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -3
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +11 -10
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +5 -4
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -2
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +7 -6
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +11 -10
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/Actions.js +6 -5
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +6 -5
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.module.scss.js +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
- package/dist/components/Employee/Profile/useProfile.js +4 -3
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/Actions.js +6 -5
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -3
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +7 -6
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +14 -13
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +4 -3
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Flow/Flow.js +9 -7
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +17 -16
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js +4 -4
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +38 -36
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.d.ts +7 -2
- package/dist/components/InformationRequests/InformationRequests.js +78 -45
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +10 -9
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.module.scss.js +10 -10
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.d.ts +2 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js +33 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js.map +1 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.d.ts +7 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +39 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -0
- package/dist/components/Payroll/OffCycleReasonSelection/index.d.ts +5 -0
- package/dist/components/Payroll/OffCycleReasonSelection/types.d.ts +15 -0
- package/dist/components/Payroll/OffCycleReasonSelection/types.js +14 -0
- package/dist/components/Payroll/OffCycleReasonSelection/types.js.map +1 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateForm.d.ts +2 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateForm.js +35 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateForm.js.map +1 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.d.ts +2 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.js +65 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.js.map +1 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.module.scss.js +18 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormTypes.d.ts +53 -0
- package/dist/components/Payroll/PayPeriodDateForm/index.d.ts +3 -0
- package/dist/components/Payroll/PayPeriodDateForm/usePayPeriodDateValidation.d.ts +5 -0
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +4 -2
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +19 -18
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +36 -36
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.module.scss.js +5 -5
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +21 -19
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +17 -15
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +26 -24
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +30 -29
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +4 -2
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +3 -2
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js +18 -18
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.d.ts +4 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js +34 -28
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +29 -29
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +12 -11
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +4 -2
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +4 -0
- package/dist/components/Payroll/index.js +12 -8
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +3 -2
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/ThemeProvider/theme.d.ts +8 -3
- package/dist/contexts/ThemeProvider/theme.js +29 -24
- package/dist/contexts/ThemeProvider/theme.js.map +1 -1
- package/dist/helpers/dateFormatting.d.ts +3 -0
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/i18n/I18n.js +1 -1
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Employee.Deductions.json.js +157 -161
- package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
- package/dist/i18n/en/InformationRequests.InformationRequestList.json.js +12 -10
- package/dist/i18n/en/InformationRequests.InformationRequestList.json.js.map +1 -1
- package/dist/i18n/en/InformationRequests.json.js +8 -0
- package/dist/i18n/en/InformationRequests.json.js.map +1 -0
- package/dist/i18n/en/Payroll.OffCycleReasonSelection.json.js +12 -0
- package/dist/i18n/en/Payroll.OffCycleReasonSelection.json.js.map +1 -0
- package/dist/i18n/en/Payroll.PayPeriodDateForm.json.js +32 -0
- package/dist/i18n/en/Payroll.PayPeriodDateForm.json.js.map +1 -0
- package/dist/shared/constants.d.ts +4 -0
- package/dist/shared/constants.js +10 -8
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +51 -3
- package/package.json +11 -11
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js +0 -8
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js +0 -14
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js.map +0 -1
|
@@ -10,19 +10,19 @@ import { getBlockerTranslationKeys as G } from "../payrollHelpers.js";
|
|
|
10
10
|
import B from "./PayrollBlockerList.module.scss.js";
|
|
11
11
|
import { useComponentContext as M } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
12
|
import { FlexItem as j, Flex as a } from "../../../Common/Flex/Flex.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
13
|
+
import { recoveryCasesEvents as $, informationRequestEvents as H } from "../../../../shared/constants.js";
|
|
14
|
+
import { DataView as Q } from "../../../Common/DataView/DataView.js";
|
|
15
|
+
import { useDataView as Y } from "../../../Common/DataView/useDataView.js";
|
|
16
|
+
import { useComponentDictionary as z, useI18n as J } from "../../../../i18n/I18n.js";
|
|
17
|
+
import { RecoveryCases as W } from "../../RecoveryCases/RecoveryCases.js";
|
|
18
|
+
import { BaseComponent as X } from "../../../Base/Base.js";
|
|
18
19
|
import "../../../Base/useBase.js";
|
|
19
|
-
import { recoveryCasesEvents as W, informationRequestEvents as X } from "../../../../shared/constants.js";
|
|
20
20
|
import { InformationRequestsFlow as Z } from "../../../InformationRequests/InformationRequests.js";
|
|
21
21
|
function be(s) {
|
|
22
|
-
return /* @__PURE__ */ o(
|
|
22
|
+
return /* @__PURE__ */ o(X, { ...s, children: /* @__PURE__ */ o(ee, { ...s, children: s.children }) });
|
|
23
23
|
}
|
|
24
24
|
function ee({ className: s, companyId: n, dictionary: g, onEvent: u }) {
|
|
25
|
-
|
|
25
|
+
z("Payroll.PayrollBlocker", g), J("Payroll.PayrollBlocker");
|
|
26
26
|
const { t: r } = N("Payroll.PayrollBlocker"), { Button: v, Text: i, Heading: b, Alert: D } = M(), [x, f] = _({
|
|
27
27
|
id: 0,
|
|
28
28
|
alerts: []
|
|
@@ -38,16 +38,16 @@ function ee({ className: s, companyId: n, dictionary: g, onEvent: u }) {
|
|
|
38
38
|
}));
|
|
39
39
|
}, []), p = d(
|
|
40
40
|
(e, t) => {
|
|
41
|
-
e ===
|
|
41
|
+
e === $.RECOVERY_CASE_RESUBMIT_DONE && c("recoveryCaseResubmitted"), e === H.INFORMATION_REQUEST_FORM_DONE && c("informationRequestResponded"), u(e, t);
|
|
42
42
|
},
|
|
43
43
|
[u, c]
|
|
44
|
-
), { data:
|
|
44
|
+
), { data: A } = O({
|
|
45
45
|
companyUuid: n
|
|
46
|
-
}), { data:
|
|
46
|
+
}), { data: P } = V({
|
|
47
47
|
companyUuid: n
|
|
48
|
-
}), { data:
|
|
48
|
+
}), { data: S } = F({
|
|
49
49
|
companyUuid: n
|
|
50
|
-
}), y = (
|
|
50
|
+
}), y = (A.payrollBlockerList ?? []).map((e) => {
|
|
51
51
|
const t = e.key ?? "unknown", l = G(t), T = r(l.titleKey, {
|
|
52
52
|
defaultValue: t.replace(/_/g, " ").replace(/\b\w/g, (U) => U.toUpperCase())
|
|
53
53
|
}), I = r(l.descriptionKey, {
|
|
@@ -58,11 +58,11 @@ function ee({ className: s, companyId: n, dictionary: g, onEvent: u }) {
|
|
|
58
58
|
title: T,
|
|
59
59
|
description: I
|
|
60
60
|
};
|
|
61
|
-
}), q =
|
|
61
|
+
}), q = P.recoveryCaseList ?? [], w = S.informationRequestList ?? [], h = q.some(
|
|
62
62
|
(e) => e.status !== "recovered"
|
|
63
|
-
), k =
|
|
63
|
+
), k = w.some(
|
|
64
64
|
(e) => e.blockingPayroll && e.status !== K.Approved
|
|
65
|
-
),
|
|
65
|
+
), L = Y({
|
|
66
66
|
data: y,
|
|
67
67
|
columns: [
|
|
68
68
|
{
|
|
@@ -96,14 +96,15 @@ function ee({ className: s, companyId: n, dictionary: g, onEvent: u }) {
|
|
|
96
96
|
)),
|
|
97
97
|
C && /* @__PURE__ */ m(a, { flexDirection: "column", gap: 20, children: [
|
|
98
98
|
/* @__PURE__ */ o(b, { as: "h2", styledAs: "h4", children: r("blockersListTitle") }),
|
|
99
|
-
/* @__PURE__ */ o(
|
|
99
|
+
/* @__PURE__ */ o(Q, { ...L, label: r("blockersListTitle") })
|
|
100
100
|
] }),
|
|
101
|
-
h && /* @__PURE__ */ o(
|
|
101
|
+
h && /* @__PURE__ */ o(W, { companyId: n, onEvent: p }),
|
|
102
102
|
k && /* @__PURE__ */ o(
|
|
103
103
|
Z,
|
|
104
104
|
{
|
|
105
105
|
companyId: n,
|
|
106
106
|
filterByPayrollBlocking: !0,
|
|
107
|
+
withAlert: !1,
|
|
107
108
|
onEvent: p
|
|
108
109
|
}
|
|
109
110
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayrollBlockerList.js","sources":["../../../../../src/components/Payroll/PayrollBlocker/components/PayrollBlockerList.tsx"],"sourcesContent":["import { useState, useCallback } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport { usePayrollsGetBlockersSuspense } from '@gusto/embedded-api/react-query/payrollsGetBlockers'\nimport { useRecoveryCasesGetSuspense } from '@gusto/embedded-api/react-query/recoveryCasesGet'\nimport { useInformationRequestsGetInformationRequestsSuspense } from '@gusto/embedded-api/react-query/informationRequestsGetInformationRequests'\nimport { InformationRequestStatus } from '@gusto/embedded-api/models/components/informationrequest'\nimport { getBlockerTranslationKeys } from '../payrollHelpers'\nimport styles from './PayrollBlockerList.module.scss'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex, FlexItem } from '@/components/Common'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { RecoveryCases } from '@/components/Payroll/RecoveryCases'\nimport { InformationRequestsFlow } from '@/components/InformationRequests'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { informationRequestEvents, recoveryCasesEvents, type EventType } from '@/shared/constants'\n\ntype ResponseAlertType = 'recoveryCaseResubmitted' | 'informationRequestResponded'\n\ninterface ResponseAlert {\n id: number\n type: ResponseAlertType\n}\n\ninterface ResponseAlertState {\n id: number\n alerts: ResponseAlert[]\n}\n\ninterface PayrollBlocker {\n id: string\n title: string\n description: string\n action?: {\n label: string\n onClick: () => void\n }\n}\n\ninterface PayrollBlockerListProps extends BaseComponentInterface<'Payroll.PayrollBlocker'> {\n companyId: string\n}\n\n/**\n * PayrollBlockerList - DataView-based component displaying payroll blockers\n * Shows each blocker with individual resolution buttons\n * Also displays recovery cases and information requests sections when applicable\n */\nexport function PayrollBlockerList(props: PayrollBlockerListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, companyId, dictionary, onEvent }: PayrollBlockerListProps) {\n useComponentDictionary('Payroll.PayrollBlocker', dictionary)\n useI18n('Payroll.PayrollBlocker')\n const { t } = useTranslation('Payroll.PayrollBlocker')\n const { Button, Text, Heading, Alert } = useComponentContext()\n\n const [alertState, setAlertState] = useState<ResponseAlertState>({\n id: 0,\n alerts: [],\n })\n\n const handleDismissAlert = useCallback((alertId: number) => {\n setAlertState(prev => ({\n ...prev,\n alerts: prev.alerts.filter(alert => alert.id !== alertId),\n }))\n }, [])\n\n const addAlert = useCallback((alertType: ResponseAlertType) => {\n setAlertState(prev => ({\n id: prev.id + 1,\n alerts: [{ id: prev.id, type: alertType }, ...prev.alerts],\n }))\n }, [])\n\n const handleEvent = useCallback(\n (type: EventType, data?: unknown) => {\n if (type === recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_DONE) {\n addAlert('recoveryCaseResubmitted')\n }\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE) {\n addAlert('informationRequestResponded')\n }\n\n onEvent(type, data)\n },\n [onEvent, addAlert],\n )\n\n const { data: blockersData } = usePayrollsGetBlockersSuspense({\n companyUuid: companyId,\n })\n\n const { data: recoveryCasesData } = useRecoveryCasesGetSuspense({\n companyUuid: companyId,\n })\n\n const { data: informationRequestsData } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const payrollBlockerList = blockersData.payrollBlockerList ?? []\n const blockers: PayrollBlocker[] = payrollBlockerList.map(blocker => {\n const blockerKey = blocker.key ?? 'unknown'\n const translationKeys = getBlockerTranslationKeys(blockerKey)\n\n const title = t(translationKeys.titleKey, {\n defaultValue: blockerKey.replace(/_/g, ' ').replace(/\\b\\w/g, letter => letter.toUpperCase()),\n })\n\n const description = t(translationKeys.descriptionKey, {\n defaultValue: blocker.message || t('defaultBlockerDescription'),\n })\n\n return {\n id: blockerKey,\n title,\n description,\n }\n })\n\n const recoveryCases = recoveryCasesData.recoveryCaseList ?? []\n const informationRequests = informationRequestsData.informationRequestList ?? []\n\n const hasUnrecoveredCases = recoveryCases.some(\n recoveryCase => recoveryCase.status !== 'recovered',\n )\n\n const hasBlockingInformationRequests = informationRequests.some(\n request => request.blockingPayroll && request.status !== InformationRequestStatus.Approved,\n )\n\n const dataViewProps = useDataView({\n data: blockers,\n columns: [\n {\n title: t('blockerSectionLabel'),\n render: blocker => (\n <FlexItem flexGrow={1}>\n <Flex flexDirection=\"column\" gap={8}>\n <Text weight=\"semibold\">{blocker.title}</Text>\n <Text variant=\"supporting\">{blocker.description}</Text>\n </Flex>\n </FlexItem>\n ),\n },\n {\n title: '',\n render: blocker => {\n const action = blocker.action\n\n if (!action) {\n return null\n }\n\n return (\n <Flex justifyContent=\"flex-end\" alignItems=\"center\">\n <Button variant=\"secondary\" onClick={action.onClick} title={action.label}>\n {action.label}\n </Button>\n </Flex>\n )\n },\n },\n ],\n })\n\n const hasBlockers = blockers.length > 0\n const hasAnyContent = hasBlockers || hasUnrecoveredCases || hasBlockingInformationRequests\n\n if (!hasAnyContent) {\n return (\n <div className={classNames(styles.root, className)}>\n <Text>{t('noBlockersMessage')}</Text>\n </div>\n )\n }\n\n return (\n <div className={classNames(styles.root, className)}>\n <Flex flexDirection=\"column\" gap={32}>\n {alertState.alerts.map(alert => (\n <Alert\n key={alert.id}\n status=\"success\"\n label={t(`alerts.${alert.type}.title`)}\n onDismiss={() => {\n handleDismissAlert(alert.id)\n }}\n >\n <Text>{t(`alerts.${alert.type}.description`)}</Text>\n </Alert>\n ))}\n\n {hasBlockers && (\n <Flex flexDirection=\"column\" gap={20}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('blockersListTitle')}\n </Heading>\n <DataView {...dataViewProps} label={t('blockersListTitle')} />\n </Flex>\n )}\n\n {hasUnrecoveredCases && <RecoveryCases companyId={companyId} onEvent={handleEvent} />}\n\n {hasBlockingInformationRequests && (\n <InformationRequestsFlow\n companyId={companyId}\n filterByPayrollBlocking\n onEvent={handleEvent}\n />\n )}\n </Flex>\n </div>\n )\n}\n"],"names":["PayrollBlockerList","props","jsx","BaseComponent","Root","className","companyId","dictionary","onEvent","useComponentDictionary","useI18n","t","useTranslation","Button","Text","Heading","Alert","useComponentContext","alertState","setAlertState","useState","handleDismissAlert","useCallback","alertId","prev","alert","addAlert","alertType","handleEvent","type","data","recoveryCasesEvents","informationRequestEvents","blockersData","usePayrollsGetBlockersSuspense","recoveryCasesData","useRecoveryCasesGetSuspense","informationRequestsData","useInformationRequestsGetInformationRequestsSuspense","blockers","blocker","blockerKey","translationKeys","getBlockerTranslationKeys","title","letter","description","recoveryCases","informationRequests","hasUnrecoveredCases","recoveryCase","hasBlockingInformationRequests","request","InformationRequestStatus","dataViewProps","useDataView","FlexItem","jsxs","Flex","action","hasBlockers","classNames","styles","DataView","RecoveryCases","InformationRequestsFlow"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkDO,SAASA,GAAmBC,GAAgC;AACjE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,MAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,GAAK,EAAE,WAAAC,GAAW,WAAAC,GAAW,YAAAC,GAAY,SAAAC,KAAoC;AACpF,EAAAC,EAAuB,0BAA0BF,CAAU,GAC3DG,EAAQ,wBAAwB;AAChC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB,GAC/C,EAAE,QAAAC,GAAQ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gBAAAH,EAACY,GAAA,EAAM,UAAAH,EAAE,mBAAmB,GAAE,GAChC;AAyCN;"}
|
|
1
|
+
{"version":3,"file":"PayrollBlockerList.js","sources":["../../../../../src/components/Payroll/PayrollBlocker/components/PayrollBlockerList.tsx"],"sourcesContent":["import { useState, useCallback } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport { usePayrollsGetBlockersSuspense } from '@gusto/embedded-api/react-query/payrollsGetBlockers'\nimport { useRecoveryCasesGetSuspense } from '@gusto/embedded-api/react-query/recoveryCasesGet'\nimport { useInformationRequestsGetInformationRequestsSuspense } from '@gusto/embedded-api/react-query/informationRequestsGetInformationRequests'\nimport { InformationRequestStatus } from '@gusto/embedded-api/models/components/informationrequest'\nimport { getBlockerTranslationKeys } from '../payrollHelpers'\nimport styles from './PayrollBlockerList.module.scss'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex, FlexItem } from '@/components/Common'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { RecoveryCases } from '@/components/Payroll/RecoveryCases'\nimport { InformationRequestsFlow } from '@/components/InformationRequests'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { informationRequestEvents, recoveryCasesEvents, type EventType } from '@/shared/constants'\n\ntype ResponseAlertType = 'recoveryCaseResubmitted' | 'informationRequestResponded'\n\ninterface ResponseAlert {\n id: number\n type: ResponseAlertType\n}\n\ninterface ResponseAlertState {\n id: number\n alerts: ResponseAlert[]\n}\n\ninterface PayrollBlocker {\n id: string\n title: string\n description: string\n action?: {\n label: string\n onClick: () => void\n }\n}\n\ninterface PayrollBlockerListProps extends BaseComponentInterface<'Payroll.PayrollBlocker'> {\n companyId: string\n}\n\n/**\n * PayrollBlockerList - DataView-based component displaying payroll blockers\n * Shows each blocker with individual resolution buttons\n * Also displays recovery cases and information requests sections when applicable\n */\nexport function PayrollBlockerList(props: PayrollBlockerListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, companyId, dictionary, onEvent }: PayrollBlockerListProps) {\n useComponentDictionary('Payroll.PayrollBlocker', dictionary)\n useI18n('Payroll.PayrollBlocker')\n const { t } = useTranslation('Payroll.PayrollBlocker')\n const { Button, Text, Heading, Alert } = useComponentContext()\n\n const [alertState, setAlertState] = useState<ResponseAlertState>({\n id: 0,\n alerts: [],\n })\n\n const handleDismissAlert = useCallback((alertId: number) => {\n setAlertState(prev => ({\n ...prev,\n alerts: prev.alerts.filter(alert => alert.id !== alertId),\n }))\n }, [])\n\n const addAlert = useCallback((alertType: ResponseAlertType) => {\n setAlertState(prev => ({\n id: prev.id + 1,\n alerts: [{ id: prev.id, type: alertType }, ...prev.alerts],\n }))\n }, [])\n\n const handleEvent = useCallback(\n (type: EventType, data?: unknown) => {\n if (type === recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_DONE) {\n addAlert('recoveryCaseResubmitted')\n }\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE) {\n addAlert('informationRequestResponded')\n }\n\n onEvent(type, data)\n },\n [onEvent, addAlert],\n )\n\n const { data: blockersData } = usePayrollsGetBlockersSuspense({\n companyUuid: companyId,\n })\n\n const { data: recoveryCasesData } = useRecoveryCasesGetSuspense({\n companyUuid: companyId,\n })\n\n const { data: informationRequestsData } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const payrollBlockerList = blockersData.payrollBlockerList ?? []\n const blockers: PayrollBlocker[] = payrollBlockerList.map(blocker => {\n const blockerKey = blocker.key ?? 'unknown'\n const translationKeys = getBlockerTranslationKeys(blockerKey)\n\n const title = t(translationKeys.titleKey, {\n defaultValue: blockerKey.replace(/_/g, ' ').replace(/\\b\\w/g, letter => letter.toUpperCase()),\n })\n\n const description = t(translationKeys.descriptionKey, {\n defaultValue: blocker.message || t('defaultBlockerDescription'),\n })\n\n return {\n id: blockerKey,\n title,\n description,\n }\n })\n\n const recoveryCases = recoveryCasesData.recoveryCaseList ?? []\n const informationRequests = informationRequestsData.informationRequestList ?? []\n\n const hasUnrecoveredCases = recoveryCases.some(\n recoveryCase => recoveryCase.status !== 'recovered',\n )\n\n const hasBlockingInformationRequests = informationRequests.some(\n request => request.blockingPayroll && request.status !== InformationRequestStatus.Approved,\n )\n\n const dataViewProps = useDataView({\n data: blockers,\n columns: [\n {\n title: t('blockerSectionLabel'),\n render: blocker => (\n <FlexItem flexGrow={1}>\n <Flex flexDirection=\"column\" gap={8}>\n <Text weight=\"semibold\">{blocker.title}</Text>\n <Text variant=\"supporting\">{blocker.description}</Text>\n </Flex>\n </FlexItem>\n ),\n },\n {\n title: '',\n render: blocker => {\n const action = blocker.action\n\n if (!action) {\n return null\n }\n\n return (\n <Flex justifyContent=\"flex-end\" alignItems=\"center\">\n <Button variant=\"secondary\" onClick={action.onClick} title={action.label}>\n {action.label}\n </Button>\n </Flex>\n )\n },\n },\n ],\n })\n\n const hasBlockers = blockers.length > 0\n const hasAnyContent = hasBlockers || hasUnrecoveredCases || hasBlockingInformationRequests\n\n if (!hasAnyContent) {\n return (\n <div className={classNames(styles.root, className)}>\n <Text>{t('noBlockersMessage')}</Text>\n </div>\n )\n }\n\n return (\n <div className={classNames(styles.root, className)}>\n <Flex flexDirection=\"column\" gap={32}>\n {alertState.alerts.map(alert => (\n <Alert\n key={alert.id}\n status=\"success\"\n label={t(`alerts.${alert.type}.title`)}\n onDismiss={() => {\n handleDismissAlert(alert.id)\n }}\n >\n <Text>{t(`alerts.${alert.type}.description`)}</Text>\n </Alert>\n ))}\n\n {hasBlockers && (\n <Flex flexDirection=\"column\" gap={20}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('blockersListTitle')}\n </Heading>\n <DataView {...dataViewProps} label={t('blockersListTitle')} />\n </Flex>\n )}\n\n {hasUnrecoveredCases && <RecoveryCases companyId={companyId} onEvent={handleEvent} />}\n\n {hasBlockingInformationRequests && (\n <InformationRequestsFlow\n companyId={companyId}\n filterByPayrollBlocking\n withAlert={false}\n onEvent={handleEvent}\n />\n )}\n </Flex>\n </div>\n )\n}\n"],"names":["PayrollBlockerList","props","jsx","BaseComponent","Root","className","companyId","dictionary","onEvent","useComponentDictionary","useI18n","t","useTranslation","Button","Text","Heading","Alert","useComponentContext","alertState","setAlertState","useState","handleDismissAlert","useCallback","alertId","prev","alert","addAlert","alertType","handleEvent","type","data","recoveryCasesEvents","informationRequestEvents","blockersData","usePayrollsGetBlockersSuspense","recoveryCasesData","useRecoveryCasesGetSuspense","informationRequestsData","useInformationRequestsGetInformationRequestsSuspense","blockers","blocker","blockerKey","translationKeys","getBlockerTranslationKeys","title","letter","description","recoveryCases","informationRequests","hasUnrecoveredCases","recoveryCase","hasBlockingInformationRequests","request","InformationRequestStatus","dataViewProps","useDataView","FlexItem","jsxs","Flex","action","hasBlockers","classNames","styles","DataView","RecoveryCases","InformationRequestsFlow"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkDO,SAASA,GAAmBC,GAAgC;AACjE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,MAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,GAAK,EAAE,WAAAC,GAAW,WAAAC,GAAW,YAAAC,GAAY,SAAAC,KAAoC;AACpF,EAAAC,EAAuB,0BAA0BF,CAAU,GAC3DG,EAAQ,wBAAwB;AAChC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB,GAC/C,EAAE,QAAAC,GAAQ,MAAAC,GAAM,SAAAC,GAAS,OAAAC,EAAA,IAAUC,EAAA,GAEnC,CAACC,GAAYC,CAAa,IAAIC,EAA6B;AAAA,IAC/D,IAAI;AAAA,IACJ,QAAQ,CAAA;AAAA,EAAC,CACV,GAEKC,IAAqBC,EAAY,CAACC,MAAo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
|
|
10
10
|
import { Flex as x } from "../../Common/Flex/Flex.js";
|
|
11
11
|
import { Grid as P } from "../../Common/Grid/Grid.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
12
|
+
import { RadioGroupField as re } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
13
|
+
import { TextInputField as ie } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
14
|
+
import { NumberInputField as G } from "../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
15
|
+
import { useComponentContext as oe } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
16
|
+
import { useI18n as se } from "../../../i18n/I18n.js";
|
|
17
|
+
import { Form as ae } from "../../Common/Form/Form.js";
|
|
18
|
+
import { firstLastName as me, formatNumberAsCurrency as le } from "../../../helpers/formattedStrings.js";
|
|
19
|
+
import { getAdditionalEarningsCompensations as de, getReimbursementCompensation as ue, calculateGrossPay as k } from "../helpers.js";
|
|
20
|
+
import { HOURS_COMPENSATION_NAMES as w, EXCLUDED_ADDITIONAL_EARNINGS as ce, COMPENSATION_NAME_DOUBLE_OVERTIME as pe, COMPENSATION_NAME_OVERTIME as fe, COMPENSATION_NAME_REGULAR_HOURS as he, COMPENSATION_NAME_REIMBURSEMENT as Ce, COMPENSATION_NAME_CASH_TIPS as Ne, COMPENSATION_NAME_COMMISSION as Ee, COMPENSATION_NAME_CORRECTION_PAYMENT as ge, COMPENSATION_NAME_PAYCHECK_TIPS as be, COMPENSATION_NAME_BONUS as Me } from "../../../shared/constants.js";
|
|
21
|
+
import { useContainerBreakpoints as Oe } from "../../../hooks/useContainerBreakpoints/useContainerBreakpoints.js";
|
|
22
22
|
const Te = m.object({
|
|
23
23
|
hourlyCompensations: m.record(m.string(), m.record(m.string(), m.string().optional())),
|
|
24
24
|
timeOffCompensations: m.record(m.string(), m.string().optional()),
|
|
@@ -72,22 +72,22 @@ const Te = m.object({
|
|
|
72
72
|
withReimbursements: M = !0,
|
|
73
73
|
hasDirectDepositSetup: $ = !0
|
|
74
74
|
}) => {
|
|
75
|
-
const { Button: v, Heading: c, Text: B } =
|
|
76
|
-
|
|
77
|
-
const f = l.jobs?.find((e) => e.primary), O = f ? [f] : [], F = Z(null), p =
|
|
75
|
+
const { Button: v, Heading: c, Text: B } = oe(), { t } = ee("Payroll.PayrollEditEmployee");
|
|
76
|
+
se("Payroll.PayrollEditEmployee");
|
|
77
|
+
const f = l.jobs?.find((e) => e.primary), O = f ? [f] : [], F = Z(null), p = Oe({
|
|
78
78
|
ref: F
|
|
79
79
|
}).includes("small");
|
|
80
80
|
o?.hourlyCompensations?.forEach((e) => {
|
|
81
81
|
const n = l.jobs?.find((s) => s.uuid === e.jobUuid);
|
|
82
82
|
n && !O.find((s) => s.uuid === n.uuid) && O.push(n);
|
|
83
83
|
});
|
|
84
|
-
const A = (o?.paidTimeOff || []).filter((e) => e.name), _ =
|
|
84
|
+
const A = (o?.paidTimeOff || []).filter((e) => e.name), _ = de({
|
|
85
85
|
flsaStatus: f?.compensations?.[0]?.flsaStatus,
|
|
86
86
|
existingFixedCompensations: o?.fixedCompensations || [],
|
|
87
87
|
primaryJobUuid: f?.uuid,
|
|
88
88
|
fixedCompensationTypes: b,
|
|
89
|
-
excludedTypes:
|
|
90
|
-
}), N = M ?
|
|
89
|
+
excludedTypes: ce
|
|
90
|
+
}), N = M ? ue(
|
|
91
91
|
o?.fixedCompensations || [],
|
|
92
92
|
b,
|
|
93
93
|
f?.uuid
|
|
@@ -95,28 +95,28 @@ const Te = m.object({
|
|
|
95
95
|
(s) => s.jobUuid === e && s.name?.toLowerCase() === n.toLowerCase()
|
|
96
96
|
), q = (e) => {
|
|
97
97
|
switch (e) {
|
|
98
|
-
case
|
|
98
|
+
case he:
|
|
99
99
|
return t("compensationNames.regularHours");
|
|
100
|
-
case
|
|
100
|
+
case fe:
|
|
101
101
|
return t("compensationNames.overtime");
|
|
102
|
-
case
|
|
102
|
+
case pe:
|
|
103
103
|
return t("compensationNames.doubleOvertime");
|
|
104
104
|
default:
|
|
105
105
|
return e;
|
|
106
106
|
}
|
|
107
107
|
}, j = (e) => {
|
|
108
108
|
switch (e) {
|
|
109
|
-
case
|
|
109
|
+
case Me:
|
|
110
110
|
return t("fixedCompensationNames.bonus");
|
|
111
|
-
case
|
|
111
|
+
case be:
|
|
112
112
|
return t("fixedCompensationNames.paycheckTips");
|
|
113
|
-
case
|
|
113
|
+
case ge:
|
|
114
114
|
return t("fixedCompensationNames.correctionPayment");
|
|
115
|
-
case
|
|
115
|
+
case Ee:
|
|
116
116
|
return t("fixedCompensationNames.commission");
|
|
117
|
-
case
|
|
117
|
+
case Ne:
|
|
118
118
|
return t("fixedCompensationNames.cashTips");
|
|
119
|
-
case
|
|
119
|
+
case Ce:
|
|
120
120
|
return t("fixedCompensationNames.reimbursement");
|
|
121
121
|
default:
|
|
122
122
|
return e;
|
|
@@ -125,7 +125,7 @@ const Te = m.object({
|
|
|
125
125
|
hourlyCompensations: (() => {
|
|
126
126
|
const e = {};
|
|
127
127
|
return O.forEach((n) => {
|
|
128
|
-
|
|
128
|
+
w.forEach((s) => {
|
|
129
129
|
const h = R(n.uuid, s);
|
|
130
130
|
h && (e[n.uuid] || (e[n.uuid] = {}), e[n.uuid][h.name] = h.hours ? parseFloat(h.hours).toString() : "");
|
|
131
131
|
});
|
|
@@ -166,7 +166,7 @@ const Te = m.object({
|
|
|
166
166
|
(o?.paidTimeOff || []).filter((h) => h.name),
|
|
167
167
|
f?.uuid
|
|
168
168
|
);
|
|
169
|
-
return
|
|
169
|
+
return k(
|
|
170
170
|
s,
|
|
171
171
|
l,
|
|
172
172
|
i,
|
|
@@ -174,7 +174,7 @@ const Te = m.object({
|
|
|
174
174
|
C
|
|
175
175
|
);
|
|
176
176
|
} catch {
|
|
177
|
-
return o ?
|
|
177
|
+
return o ? k(
|
|
178
178
|
o,
|
|
179
179
|
l,
|
|
180
180
|
i,
|
|
@@ -190,7 +190,7 @@ const Te = m.object({
|
|
|
190
190
|
i,
|
|
191
191
|
d,
|
|
192
192
|
C
|
|
193
|
-
]), W =
|
|
193
|
+
]), W = me({
|
|
194
194
|
first_name: l.firstName,
|
|
195
195
|
last_name: l.lastName
|
|
196
196
|
}), Y = (e) => {
|
|
@@ -201,7 +201,7 @@ const Te = m.object({
|
|
|
201
201
|
f?.uuid
|
|
202
202
|
);
|
|
203
203
|
E(n);
|
|
204
|
-
}, L =
|
|
204
|
+
}, L = le(z || 0), U = /* @__PURE__ */ a(
|
|
205
205
|
x,
|
|
206
206
|
{
|
|
207
207
|
flexDirection: p ? "row" : "column",
|
|
@@ -240,19 +240,19 @@ const Te = m.object({
|
|
|
240
240
|
}
|
|
241
241
|
),
|
|
242
242
|
/* @__PURE__ */ a(Q, { ...I, children: [
|
|
243
|
-
/* @__PURE__ */ a(
|
|
243
|
+
/* @__PURE__ */ a(ae, { children: [
|
|
244
244
|
O.length > 0 && /* @__PURE__ */ a("div", { className: u.fieldGroup, children: [
|
|
245
245
|
/* @__PURE__ */ r(c, { as: "h3", children: t("regularHoursTitle") }),
|
|
246
246
|
O.map((e) => /* @__PURE__ */ a(x, { flexDirection: "column", gap: 8, children: [
|
|
247
247
|
O.length > 1 && /* @__PURE__ */ r(c, { as: "h4", children: e.title }),
|
|
248
|
-
/* @__PURE__ */ r(P, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children:
|
|
248
|
+
/* @__PURE__ */ r(P, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: w.map((n) => {
|
|
249
249
|
const s = R(
|
|
250
250
|
e.uuid,
|
|
251
251
|
n
|
|
252
252
|
);
|
|
253
253
|
if (s)
|
|
254
254
|
return /* @__PURE__ */ r(
|
|
255
|
-
|
|
255
|
+
ie,
|
|
256
256
|
{
|
|
257
257
|
type: "number",
|
|
258
258
|
min: 0,
|
|
@@ -285,7 +285,7 @@ const Te = m.object({
|
|
|
285
285
|
gridTemplateColumns: { base: "1fr", small: [320, 320], large: [320, 320, 320] },
|
|
286
286
|
gap: 20,
|
|
287
287
|
children: _.map((e) => /* @__PURE__ */ r(
|
|
288
|
-
|
|
288
|
+
G,
|
|
289
289
|
{
|
|
290
290
|
format: "currency",
|
|
291
291
|
min: 0,
|
|
@@ -301,7 +301,7 @@ const Te = m.object({
|
|
|
301
301
|
N && /* @__PURE__ */ a("div", { className: u.fieldGroup, children: [
|
|
302
302
|
/* @__PURE__ */ r(c, { as: "h4", children: t("reimbursementTitle") }),
|
|
303
303
|
/* @__PURE__ */ r(P, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: /* @__PURE__ */ r(
|
|
304
|
-
|
|
304
|
+
G,
|
|
305
305
|
{
|
|
306
306
|
format: "currency",
|
|
307
307
|
min: 0,
|
|
@@ -314,7 +314,7 @@ const Te = m.object({
|
|
|
314
314
|
$ && /* @__PURE__ */ a("div", { className: u.fieldGroup, children: [
|
|
315
315
|
/* @__PURE__ */ r(c, { as: "h4", children: t("paymentMethodTitle") }),
|
|
316
316
|
/* @__PURE__ */ r(
|
|
317
|
-
|
|
317
|
+
re,
|
|
318
318
|
{
|
|
319
319
|
name: "paymentMethod",
|
|
320
320
|
isRequired: !0,
|
package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.module.scss.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
const e = "
|
|
1
|
+
const e = "_container_1u64c_1", c = "_headerSection_1u64c_5", o = "_headerSectionSticky_1u64c_12", t = "_fieldGroup_1u64c_20", n = "_grossPayLabel_1u64c_32", a = {
|
|
2
2
|
container: e,
|
|
3
|
-
headerSection:
|
|
3
|
+
headerSection: c,
|
|
4
4
|
headerSectionSticky: o,
|
|
5
|
-
fieldGroup:
|
|
5
|
+
fieldGroup: t,
|
|
6
6
|
grossPayLabel: n
|
|
7
7
|
};
|
|
8
8
|
export {
|
|
9
9
|
e as container,
|
|
10
10
|
a as default,
|
|
11
|
-
|
|
11
|
+
t as fieldGroup,
|
|
12
12
|
n as grossPayLabel,
|
|
13
|
-
|
|
13
|
+
c as headerSection,
|
|
14
14
|
o as headerSectionSticky
|
|
15
15
|
};
|
|
16
16
|
//# sourceMappingURL=PayrollEditEmployeePresentation.module.scss.js.map
|
|
@@ -1,35 +1,37 @@
|
|
|
1
|
-
import { jsxs as u, jsx as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { useFormContext as
|
|
4
|
-
import { useTranslation as
|
|
1
|
+
import { jsxs as u, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useId as p } from "react";
|
|
3
|
+
import { useFormContext as d, useWatch as f } from "react-hook-form";
|
|
4
|
+
import { useTranslation as c } from "react-i18next";
|
|
5
5
|
import { Flex as y } from "../../Common/Flex/Flex.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { TextInputField as
|
|
6
|
+
import "classnames";
|
|
7
|
+
import "../../../shared/constants.js";
|
|
8
|
+
import { TextInputField as x } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
9
|
+
import { useComponentContext as h } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
|
+
import { useI18n as B } from "../../../i18n/I18n.js";
|
|
9
11
|
const P = ({
|
|
10
12
|
accrualBalance: e,
|
|
11
13
|
accrualMethod: o,
|
|
12
14
|
hoursUsed: r,
|
|
13
15
|
id: t
|
|
14
16
|
}) => {
|
|
15
|
-
const { Text: n } =
|
|
17
|
+
const { Text: n } = h(), { t: i } = c("Payroll.PayrollEditEmployee");
|
|
16
18
|
if (o === "unlimited")
|
|
17
19
|
return null;
|
|
18
20
|
const a = parseFloat(e) - r;
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
},
|
|
21
|
-
const { t: r } =
|
|
22
|
-
|
|
23
|
-
const { control: t } =
|
|
21
|
+
return /* @__PURE__ */ l(n, { size: "sm", variant: "supporting", "aria-live": "polite", "aria-atomic": !0, id: t, children: i("timeOffBalance.remaining", { balance: a.toFixed(1) }) });
|
|
22
|
+
}, U = ({ timeOff: e, employee: o }) => {
|
|
23
|
+
const { t: r } = c("Payroll.PayrollEditEmployee");
|
|
24
|
+
B("Payroll.PayrollEditEmployee");
|
|
25
|
+
const { control: t } = d(), n = p(), i = f({
|
|
24
26
|
control: t,
|
|
25
27
|
name: `timeOffCompensations.${e.name}`
|
|
26
28
|
});
|
|
27
29
|
if (!e.name)
|
|
28
30
|
return null;
|
|
29
|
-
const
|
|
31
|
+
const m = parseFloat(i || "0"), a = o.eligiblePaidTimeOff?.find((s) => s.name === e.name);
|
|
30
32
|
return /* @__PURE__ */ u(y, { flexDirection: "column", gap: 4, children: [
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
|
|
33
|
+
/* @__PURE__ */ l(
|
|
34
|
+
x,
|
|
33
35
|
{
|
|
34
36
|
name: `timeOffCompensations.${e.name}`,
|
|
35
37
|
type: "number",
|
|
@@ -41,18 +43,18 @@ const P = ({
|
|
|
41
43
|
},
|
|
42
44
|
e.name
|
|
43
45
|
),
|
|
44
|
-
a?.accrualBalance && /* @__PURE__ */
|
|
46
|
+
a?.accrualBalance && /* @__PURE__ */ l(
|
|
45
47
|
P,
|
|
46
48
|
{
|
|
47
49
|
accrualBalance: a.accrualBalance,
|
|
48
50
|
accrualMethod: a.accrualMethod ?? void 0,
|
|
49
|
-
hoursUsed:
|
|
51
|
+
hoursUsed: m,
|
|
50
52
|
id: n
|
|
51
53
|
}
|
|
52
54
|
)
|
|
53
55
|
] });
|
|
54
56
|
};
|
|
55
57
|
export {
|
|
56
|
-
|
|
58
|
+
U as TimeOffField
|
|
57
59
|
};
|
|
58
60
|
//# sourceMappingURL=TimeOffField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeOffField.js","sources":["../../../../src/components/Payroll/PayrollEditEmployee/TimeOffField.tsx"],"sourcesContent":["import { useId } from 'react'\nimport { useWatch, useFormContext } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { PayrollEmployeeCompensationsTypePaidTimeOff } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollEditEmployeeFormValues } from './PayrollEditEmployeePresentation'\nimport { Flex, TextInputField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nexport interface TimeOffFieldProps {\n timeOff: PayrollEmployeeCompensationsTypePaidTimeOff\n employee: Employee\n}\n\nconst TimeOffBalance = ({\n accrualBalance,\n accrualMethod,\n hoursUsed,\n id,\n}: {\n accrualBalance: string\n accrualMethod?: string\n hoursUsed: number\n id: string\n}) => {\n const { Text } = useComponentContext()\n const { t } = useTranslation('Payroll.PayrollEditEmployee')\n\n if (accrualMethod === 'unlimited') {\n return null\n }\n\n const currentBalance = parseFloat(accrualBalance)\n const remainingBalance = currentBalance - hoursUsed\n\n return (\n <Text size=\"sm\" variant=\"supporting\" aria-live=\"polite\" aria-atomic={true} id={id}>\n {t('timeOffBalance.remaining', { balance: remainingBalance.toFixed(1) })}\n </Text>\n )\n}\n\nexport const TimeOffField = ({ timeOff, employee }: TimeOffFieldProps) => {\n const { t } = useTranslation('Payroll.PayrollEditEmployee')\n useI18n('Payroll.PayrollEditEmployee')\n\n const { control } = useFormContext<PayrollEditEmployeeFormValues>()\n const id = useId()\n\n const watchedValue = useWatch({\n control,\n name: `timeOffCompensations.${timeOff.name}`,\n })\n\n if (!timeOff.name) {\n return null\n }\n\n const hoursUsed = parseFloat(watchedValue || '0')\n const eligiblePolicy = employee.eligiblePaidTimeOff?.find(policy => policy.name === timeOff.name)\n\n return (\n <Flex flexDirection=\"column\" gap={4}>\n <TextInputField\n key={timeOff.name}\n name={`timeOffCompensations.${timeOff.name}`}\n type=\"number\"\n min={0}\n adornmentEnd={t('hoursUnit')}\n isRequired\n label={timeOff.name}\n aria-describedby={id}\n />\n {eligiblePolicy?.accrualBalance && (\n <TimeOffBalance\n accrualBalance={eligiblePolicy.accrualBalance}\n accrualMethod={eligiblePolicy.accrualMethod ?? undefined}\n hoursUsed={hoursUsed}\n id={id}\n />\n )}\n </Flex>\n )\n}\n"],"names":["TimeOffBalance","accrualBalance","accrualMethod","hoursUsed","id","Text","useComponentContext","t","useTranslation","remainingBalance","jsx","TimeOffField","timeOff","employee","useI18n","control","useFormContext","useId","watchedValue","useWatch","eligiblePolicy","policy","jsxs","Flex","TextInputField"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TimeOffField.js","sources":["../../../../src/components/Payroll/PayrollEditEmployee/TimeOffField.tsx"],"sourcesContent":["import { useId } from 'react'\nimport { useWatch, useFormContext } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { PayrollEmployeeCompensationsTypePaidTimeOff } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollEditEmployeeFormValues } from './PayrollEditEmployeePresentation'\nimport { Flex, TextInputField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nexport interface TimeOffFieldProps {\n timeOff: PayrollEmployeeCompensationsTypePaidTimeOff\n employee: Employee\n}\n\nconst TimeOffBalance = ({\n accrualBalance,\n accrualMethod,\n hoursUsed,\n id,\n}: {\n accrualBalance: string\n accrualMethod?: string\n hoursUsed: number\n id: string\n}) => {\n const { Text } = useComponentContext()\n const { t } = useTranslation('Payroll.PayrollEditEmployee')\n\n if (accrualMethod === 'unlimited') {\n return null\n }\n\n const currentBalance = parseFloat(accrualBalance)\n const remainingBalance = currentBalance - hoursUsed\n\n return (\n <Text size=\"sm\" variant=\"supporting\" aria-live=\"polite\" aria-atomic={true} id={id}>\n {t('timeOffBalance.remaining', { balance: remainingBalance.toFixed(1) })}\n </Text>\n )\n}\n\nexport const TimeOffField = ({ timeOff, employee }: TimeOffFieldProps) => {\n const { t } = useTranslation('Payroll.PayrollEditEmployee')\n useI18n('Payroll.PayrollEditEmployee')\n\n const { control } = useFormContext<PayrollEditEmployeeFormValues>()\n const id = useId()\n\n const watchedValue = useWatch({\n control,\n name: `timeOffCompensations.${timeOff.name}`,\n })\n\n if (!timeOff.name) {\n return null\n }\n\n const hoursUsed = parseFloat(watchedValue || '0')\n const eligiblePolicy = employee.eligiblePaidTimeOff?.find(policy => policy.name === timeOff.name)\n\n return (\n <Flex flexDirection=\"column\" gap={4}>\n <TextInputField\n key={timeOff.name}\n name={`timeOffCompensations.${timeOff.name}`}\n type=\"number\"\n min={0}\n adornmentEnd={t('hoursUnit')}\n isRequired\n label={timeOff.name}\n aria-describedby={id}\n />\n {eligiblePolicy?.accrualBalance && (\n <TimeOffBalance\n accrualBalance={eligiblePolicy.accrualBalance}\n accrualMethod={eligiblePolicy.accrualMethod ?? undefined}\n hoursUsed={hoursUsed}\n id={id}\n />\n )}\n </Flex>\n )\n}\n"],"names":["TimeOffBalance","accrualBalance","accrualMethod","hoursUsed","id","Text","useComponentContext","t","useTranslation","remainingBalance","jsx","TimeOffField","timeOff","employee","useI18n","control","useFormContext","useId","watchedValue","useWatch","eligiblePolicy","policy","jsxs","Flex","TextInputField"],"mappings":";;;;;;;;;;AAeA,MAAMA,IAAiB,CAAC;AAAA,EACtB,gBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC;AAAA,EACA,IAAAC;AACF,MAKM;AACJ,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAA,GACX,EAAE,GAAAC,EAAA,IAAMC,EAAe,6BAA6B;AAE1D,MAAIN,MAAkB;AACpB,WAAO;AAIT,QAAMO,IADiB,WAAWR,CAAc,IACNE;AAE1C,SACE,gBAAAO,EAACL,KAAK,MAAK,MAAK,SAAQ,cAAa,aAAU,UAAS,eAAa,IAAM,IAAAD,GACxE,UAAAG,EAAE,4BAA4B,EAAE,SAASE,EAAiB,QAAQ,CAAC,EAAA,CAAG,GACzE;AAEJ,GAEaE,IAAe,CAAC,EAAE,SAAAC,GAAS,UAAAC,QAAkC;AACxE,QAAM,EAAE,GAAAN,EAAA,IAAMC,EAAe,6BAA6B;AAC1D,EAAAM,EAAQ,6BAA6B;AAErC,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACdZ,IAAKa,EAAA,GAELC,IAAeC,EAAS;AAAA,IAC5B,SAAAJ;AAAA,IACA,MAAM,wBAAwBH,EAAQ,IAAI;AAAA,EAAA,CAC3C;AAED,MAAI,CAACA,EAAQ;AACX,WAAO;AAGT,QAAMT,IAAY,WAAWe,KAAgB,GAAG,GAC1CE,IAAiBP,EAAS,qBAAqB,KAAK,OAAUQ,EAAO,SAAST,EAAQ,IAAI;AAEhG,SACE,gBAAAU,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,IAAA,gBAAAb;AAAA,MAACc;AAAA,MAAA;AAAA,QAEC,MAAM,wBAAwBZ,EAAQ,IAAI;AAAA,QAC1C,MAAK;AAAA,QACL,KAAK;AAAA,QACL,cAAcL,EAAE,WAAW;AAAA,QAC3B,YAAU;AAAA,QACV,OAAOK,EAAQ;AAAA,QACf,oBAAkBR;AAAA,MAAA;AAAA,MAPbQ,EAAQ;AAAA,IAAA;AAAA,IASdQ,GAAgB,kBACf,gBAAAV;AAAA,MAACV;AAAA,MAAA;AAAA,QACC,gBAAgBoB,EAAe;AAAA,QAC/B,eAAeA,EAAe,iBAAiB;AAAA,QAC/C,WAAAjB;AAAA,QACA,IAAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GAEJ;AAEJ;"}
|
|
@@ -3,6 +3,8 @@ import { useTranslation as U } from "react-i18next";
|
|
|
3
3
|
import { getPayrollType as L, calculateTotalPayroll as N, canCancelPayroll as O } from "../helpers.js";
|
|
4
4
|
import j from "./PayrollHistoryPresentation.module.scss.js";
|
|
5
5
|
import { Flex as n } from "../../Common/Flex/Flex.js";
|
|
6
|
+
import "classnames";
|
|
7
|
+
import "../../../shared/constants.js";
|
|
6
8
|
import { HamburgerMenu as M } from "../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
7
9
|
import { useComponentContext as V } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
10
|
import { formatNumberAsCurrency as q } from "../../../helpers/formattedStrings.js";
|
|
@@ -13,7 +15,7 @@ import $ from "../../../assets/icons/icon-file-outline.svg.js";
|
|
|
13
15
|
import B from "../../../assets/icons/icon-receipt-outline.svg.js";
|
|
14
16
|
import { PayrollStatusBadges as W } from "../PayrollStatusBadges/PayrollStatusBadges.js";
|
|
15
17
|
import { DataView as _ } from "../../Common/DataView/DataView.js";
|
|
16
|
-
const
|
|
18
|
+
const de = ({
|
|
17
19
|
payrollHistory: c,
|
|
18
20
|
wireInRequests: p,
|
|
19
21
|
selectedTimeFilter: y,
|
|
@@ -33,9 +35,9 @@ const me = ({
|
|
|
33
35
|
{ value: "6months", label: t("timeFilter.options.6months") },
|
|
34
36
|
{ value: "year", label: t("timeFilter.options.year") }
|
|
35
37
|
], w = (e) => {
|
|
36
|
-
const
|
|
37
|
-
if (!
|
|
38
|
-
const
|
|
38
|
+
const i = e.payrollDeadline;
|
|
39
|
+
if (!i) return "";
|
|
40
|
+
const a = new Date(i), u = "America/New_York", T = new Intl.DateTimeFormat("en-US", {
|
|
39
41
|
weekday: "short",
|
|
40
42
|
month: "short",
|
|
41
43
|
day: "numeric",
|
|
@@ -45,37 +47,37 @@ const me = ({
|
|
|
45
47
|
minute: "2-digit",
|
|
46
48
|
timeZoneName: "short",
|
|
47
49
|
timeZone: u
|
|
48
|
-
}), H = T.format(
|
|
49
|
-
return `${R.format(
|
|
50
|
+
}), H = T.format(a);
|
|
51
|
+
return `${R.format(a)} on ${H}`;
|
|
50
52
|
}, x = (e) => {
|
|
51
53
|
g(e);
|
|
52
54
|
}, k = () => {
|
|
53
55
|
o && D(o);
|
|
54
56
|
}, A = (e) => {
|
|
55
|
-
const
|
|
57
|
+
const i = e.payrollUuid || e.uuid, a = [
|
|
56
58
|
{
|
|
57
59
|
label: t("menu.viewSummary"),
|
|
58
60
|
icon: /* @__PURE__ */ r($, { "aria-hidden": !0 }),
|
|
59
61
|
onClick: () => {
|
|
60
|
-
f(
|
|
62
|
+
f(i, e.payPeriod?.startDate, e.payPeriod?.endDate);
|
|
61
63
|
}
|
|
62
64
|
},
|
|
63
65
|
{
|
|
64
66
|
label: t("menu.viewReceipt"),
|
|
65
67
|
icon: /* @__PURE__ */ r(B, { "aria-hidden": !0 }),
|
|
66
68
|
onClick: () => {
|
|
67
|
-
P(
|
|
69
|
+
P(i, e.payPeriod?.startDate, e.payPeriod?.endDate);
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
72
|
];
|
|
71
|
-
return O(e) &&
|
|
73
|
+
return O(e) && a.push({
|
|
72
74
|
label: t("menu.cancelPayroll"),
|
|
73
75
|
icon: /* @__PURE__ */ r(Z, { "aria-hidden": !0 }),
|
|
74
76
|
onClick: () => {
|
|
75
77
|
x(e);
|
|
76
78
|
},
|
|
77
79
|
"data-destructive": "true"
|
|
78
|
-
}),
|
|
80
|
+
}), a;
|
|
79
81
|
};
|
|
80
82
|
return c.length === 0 ? /* @__PURE__ */ l(n, { flexDirection: "column", alignItems: "center", gap: 24, children: [
|
|
81
83
|
/* @__PURE__ */ r(d, { as: "h3", children: t("emptyState.title") }),
|
|
@@ -129,10 +131,10 @@ const me = ({
|
|
|
129
131
|
{
|
|
130
132
|
title: t("columns.status"),
|
|
131
133
|
render: (e) => {
|
|
132
|
-
const
|
|
133
|
-
(
|
|
134
|
+
const i = p.find(
|
|
135
|
+
(a) => a.paymentUuid === e.payrollUuid
|
|
134
136
|
);
|
|
135
|
-
return /* @__PURE__ */ r(W, { payroll: e, wireInRequest:
|
|
137
|
+
return /* @__PURE__ */ r(W, { payroll: e, wireInRequest: i });
|
|
136
138
|
}
|
|
137
139
|
},
|
|
138
140
|
{
|
|
@@ -171,6 +173,6 @@ const me = ({
|
|
|
171
173
|
] });
|
|
172
174
|
};
|
|
173
175
|
export {
|
|
174
|
-
|
|
176
|
+
de as PayrollHistoryPresentation
|
|
175
177
|
};
|
|
176
178
|
//# sourceMappingURL=PayrollHistoryPresentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayrollHistoryPresentation.js","sources":["../../../../src/components/Payroll/PayrollHistory/PayrollHistoryPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Payroll } from '@gusto/embedded-api/models/components/payroll'\nimport type { WireInRequest } from '@gusto/embedded-api/models/components/wireinrequest'\nimport { PayrollStatusBadges } from '../PayrollStatusBadges'\nimport { getPayrollType, calculateTotalPayroll, canCancelPayroll } from '../helpers'\nimport type { TimeFilterOption } from './PayrollHistory'\nimport styles from './PayrollHistoryPresentation.module.scss'\nimport type { MenuItem } from '@/components/Common/UI/Menu/MenuTypes'\nimport { DataView, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\nimport { useI18n } from '@/i18n'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport TrashcanIcon from '@/assets/icons/trashcan.svg?react'\nimport FileIcon from '@/assets/icons/icon-file-outline.svg?react'\nimport ReceiptIcon from '@/assets/icons/icon-receipt-outline.svg?react'\n\ninterface PayrollHistoryPresentationProps {\n payrollHistory: Payroll[]\n wireInRequests: WireInRequest[]\n selectedTimeFilter: TimeFilterOption\n onTimeFilterChange: (value: TimeFilterOption) => void\n onViewSummary: (payrollId: string, startDate?: string, endDate?: string) => void\n onViewReceipt: (payrollId: string, startDate?: string, endDate?: string) => void\n onCancelPayroll: (item: Payroll) => void\n cancelDialogItem: Payroll | null\n onCancelDialogOpen: (item: Payroll) => void\n onCancelDialogClose: () => void\n isLoading?: boolean\n}\n\nexport const PayrollHistoryPresentation = ({\n payrollHistory,\n wireInRequests,\n selectedTimeFilter,\n onTimeFilterChange,\n onViewSummary,\n onViewReceipt,\n onCancelPayroll,\n cancelDialogItem,\n onCancelDialogOpen,\n onCancelDialogClose,\n isLoading = false,\n}: PayrollHistoryPresentationProps) => {\n const { Heading, Text, Select, Dialog } = useComponentContext()\n useI18n('Payroll.PayrollHistory')\n const { t } = useTranslation('Payroll.PayrollHistory')\n const dateFormatter = useDateFormatter()\n\n const timeFilterOptions = [\n { value: '3months', label: t('timeFilter.options.3months') },\n { value: '6months', label: t('timeFilter.options.6months') },\n { value: 'year', label: t('timeFilter.options.year') },\n ]\n\n const formatDeadlineForDialog = (item: Payroll): string => {\n const deadline = item.payrollDeadline\n if (!deadline) return ''\n\n const deadlineDate = new Date(deadline)\n const timeZone = 'America/New_York'\n\n const formatter = new Intl.DateTimeFormat('en-US', {\n weekday: 'short',\n month: 'short',\n day: 'numeric',\n timeZone,\n })\n\n const timeFormatter = new Intl.DateTimeFormat('en-US', {\n hour: 'numeric',\n minute: '2-digit',\n timeZoneName: 'short',\n timeZone,\n })\n\n const dateStr = formatter.format(deadlineDate)\n const timeStr = timeFormatter.format(deadlineDate)\n\n return `${timeStr} on ${dateStr}`\n }\n\n const handleCancelClick = (item: Payroll) => {\n onCancelDialogOpen(item)\n }\n\n const handleConfirmCancel = () => {\n if (cancelDialogItem) {\n onCancelPayroll(cancelDialogItem)\n }\n }\n\n const getMenuItems = (item: Payroll): MenuItem[] => {\n const payrollId = item.payrollUuid || item.uuid!\n const items: MenuItem[] = [\n {\n label: t('menu.viewSummary'),\n icon: <FileIcon aria-hidden />,\n onClick: () => {\n onViewSummary(payrollId, item.payPeriod?.startDate, item.payPeriod?.endDate)\n },\n },\n {\n label: t('menu.viewReceipt'),\n icon: <ReceiptIcon aria-hidden />,\n onClick: () => {\n onViewReceipt(payrollId, item.payPeriod?.startDate, item.payPeriod?.endDate)\n },\n },\n ]\n\n if (canCancelPayroll(item)) {\n items.push({\n label: t('menu.cancelPayroll'),\n icon: <TrashcanIcon aria-hidden />,\n onClick: () => {\n handleCancelClick(item)\n },\n 'data-destructive': 'true',\n })\n }\n\n return items\n }\n\n if (payrollHistory.length === 0) {\n return (\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={24}>\n <Heading as=\"h3\">{t('emptyState.title')}</Heading>\n <Text>{t('emptyState.description')}</Text>\n </Flex>\n )\n }\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n <Flex\n flexDirection={{ base: 'column', medium: 'row' }}\n justifyContent=\"space-between\"\n alignItems=\"flex-start\"\n gap={{ base: 12, medium: 24 }}\n >\n <Flex>\n <Heading as=\"h2\">{t('title')}</Heading>\n </Flex>\n <div className={styles.timeFilterContainer}>\n <Select\n value={selectedTimeFilter}\n onChange={(value: string) => {\n onTimeFilterChange(value as TimeFilterOption)\n }}\n options={timeFilterOptions}\n label={t('timeFilter.placeholder')}\n shouldVisuallyHideLabel\n isRequired\n />\n </div>\n </Flex>\n\n <DataView\n label={t('dataView.label')}\n columns={[\n {\n title: t('columns.payPeriod'),\n render: (item: Payroll) =>\n dateFormatter.formatPayPeriodRange(\n item.payPeriod?.startDate,\n item.payPeriod?.endDate,\n ),\n },\n {\n title: t('columns.type'),\n render: (item: Payroll) => getPayrollType(item),\n },\n {\n title: t('columns.payDate'),\n render: (item: Payroll) => dateFormatter.formatShortWithYear(item.checkDate),\n },\n {\n title: t('columns.status'),\n render: (item: Payroll) => {\n const wireInRequest = wireInRequests.find(\n wire => wire.paymentUuid === item.payrollUuid,\n )\n return <PayrollStatusBadges payroll={item} wireInRequest={wireInRequest} />\n },\n },\n {\n title: t('columns.totalPayroll'),\n render: (item: Payroll) => formatNumberAsCurrency(calculateTotalPayroll(item)),\n },\n ]}\n data={payrollHistory}\n itemMenu={(item: Payroll) => <HamburgerMenu items={getMenuItems(item)} />}\n />\n\n <Dialog\n isOpen={!!cancelDialogItem}\n onClose={onCancelDialogClose}\n onPrimaryActionClick={handleConfirmCancel}\n isDestructive\n isPrimaryActionLoading={isLoading}\n primaryActionLabel={t('cancelDialog.primaryAction')}\n closeActionLabel={t('cancelDialog.secondaryAction')}\n title={\n cancelDialogItem\n ? t('cancelDialog.title', {\n payPeriod: dateFormatter.formatPayPeriodRange(\n cancelDialogItem.payPeriod?.startDate,\n cancelDialogItem.payPeriod?.endDate,\n ),\n })\n : ''\n }\n >\n {cancelDialogItem && (\n <Flex flexDirection=\"column\" gap={16}>\n <Text>{t('cancelDialog.body')}</Text>\n {cancelDialogItem.payrollDeadline && (\n <Text>\n {t('cancelDialog.deadline', {\n deadline: formatDeadlineForDialog(cancelDialogItem),\n })}\n </Text>\n )}\n </Flex>\n )}\n </Dialog>\n </Flex>\n )\n}\n"],"names":["PayrollHistoryPresentation","payrollHistory","wireInRequests","selectedTimeFilter","onTimeFilterChange","onViewSummary","onViewReceipt","onCancelPayroll","cancelDialogItem","onCancelDialogOpen","onCancelDialogClose","isLoading","Heading","Text","Select","Dialog","useComponentContext","useI18n","useTranslation","dateFormatter","useDateFormatter","timeFilterOptions","formatDeadlineForDialog","item","deadline","deadlineDate","timeZone","formatter","timeFormatter","dateStr","handleCancelClick","handleConfirmCancel","getMenuItems","payrollId","items","jsx","FileIcon","ReceiptIcon","canCancelPayroll","TrashcanIcon","Flex","jsxs","styles","value","DataView","getPayrollType","wireInRequest","wire","PayrollStatusBadges","formatNumberAsCurrency","calculateTotalPayroll","HamburgerMenu"],"mappings":";;;;;;;;;;;;;;;AAgCO,MAAMA,KAA6B,CAAC;AAAA,EACzC,gBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,WAAAC,IAAY;AACd,MAAuC;AACrC,QAAM,EAAE,SAAAC,GAAS,MAAAC,GAAM,QAAAC,GAAQ,Q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AAc,OAAOnB,EAAaT,CAAI,EAAA,CAAG;AAAA,MAAA;AAAA,IAAA;AAAA,IAGzE,gBAAAY;AAAA,MAACpB;AAAA,MAAA;AAAA,QACC,QAAQ,CAAC,CAACP;AAAA,QACV,SAASE;AAAA,QACT,sBAAsBqB;AAAA,QACtB,eAAa;AAAA,QACb,wBAAwBpB;AAAA,QACxB,oBAAoB,EAAE,4BAA4B;AAAA,QAClD,kBAAkB,EAAE,8BAA8B;AAAA,QAClD,OACEH,IACI,EAAE,sBAAsB;AAAA,UACtB,WAAWW,EAAc;AAAA,YACvBX,EAAiB,WAAW;AAAA,YAC5BA,EAAiB,WAAW;AAAA,UAAA;AAAA,QAC9B,CACD,IACD;AAAA,QAGL,eACC,gBAAAiC,EAACD,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,UAAA,gBAAAL,EAACtB,GAAA,EAAM,UAAA,EAAE,mBAAmB,EAAA,CAAE;AAAA,UAC7BL,EAAiB,mBAChB,gBAAA2B,EAACtB,GAAA,EACE,YAAE,yBAAyB;AAAA,YAC1B,UAAUS,EAAwBd,CAAgB;AAAA,UAAA,CACnD,EAAA,CACH;AAAA,QAAA,EAAA,CAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAEJ,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"PayrollHistoryPresentation.js","sources":["../../../../src/components/Payroll/PayrollHistory/PayrollHistoryPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Payroll } from '@gusto/embedded-api/models/components/payroll'\nimport type { WireInRequest } from '@gusto/embedded-api/models/components/wireinrequest'\nimport { PayrollStatusBadges } from '../PayrollStatusBadges'\nimport { getPayrollType, calculateTotalPayroll, canCancelPayroll } from '../helpers'\nimport type { TimeFilterOption } from './PayrollHistory'\nimport styles from './PayrollHistoryPresentation.module.scss'\nimport type { MenuItem } from '@/components/Common/UI/Menu/MenuTypes'\nimport { DataView, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\nimport { useI18n } from '@/i18n'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport TrashcanIcon from '@/assets/icons/trashcan.svg?react'\nimport FileIcon from '@/assets/icons/icon-file-outline.svg?react'\nimport ReceiptIcon from '@/assets/icons/icon-receipt-outline.svg?react'\n\ninterface PayrollHistoryPresentationProps {\n payrollHistory: Payroll[]\n wireInRequests: WireInRequest[]\n selectedTimeFilter: TimeFilterOption\n onTimeFilterChange: (value: TimeFilterOption) => void\n onViewSummary: (payrollId: string, startDate?: string, endDate?: string) => void\n onViewReceipt: (payrollId: string, startDate?: string, endDate?: string) => void\n onCancelPayroll: (item: Payroll) => void\n cancelDialogItem: Payroll | null\n onCancelDialogOpen: (item: Payroll) => void\n onCancelDialogClose: () => void\n isLoading?: boolean\n}\n\nexport const PayrollHistoryPresentation = ({\n payrollHistory,\n wireInRequests,\n selectedTimeFilter,\n onTimeFilterChange,\n onViewSummary,\n onViewReceipt,\n onCancelPayroll,\n cancelDialogItem,\n onCancelDialogOpen,\n onCancelDialogClose,\n isLoading = false,\n}: PayrollHistoryPresentationProps) => {\n const { Heading, Text, Select, Dialog } = useComponentContext()\n useI18n('Payroll.PayrollHistory')\n const { t } = useTranslation('Payroll.PayrollHistory')\n const dateFormatter = useDateFormatter()\n\n const timeFilterOptions = [\n { value: '3months', label: t('timeFilter.options.3months') },\n { value: '6months', label: t('timeFilter.options.6months') },\n { value: 'year', label: t('timeFilter.options.year') },\n ]\n\n const formatDeadlineForDialog = (item: Payroll): string => {\n const deadline = item.payrollDeadline\n if (!deadline) return ''\n\n const deadlineDate = new Date(deadline)\n const timeZone = 'America/New_York'\n\n const formatter = new Intl.DateTimeFormat('en-US', {\n weekday: 'short',\n month: 'short',\n day: 'numeric',\n timeZone,\n })\n\n const timeFormatter = new Intl.DateTimeFormat('en-US', {\n hour: 'numeric',\n minute: '2-digit',\n timeZoneName: 'short',\n timeZone,\n })\n\n const dateStr = formatter.format(deadlineDate)\n const timeStr = timeFormatter.format(deadlineDate)\n\n return `${timeStr} on ${dateStr}`\n }\n\n const handleCancelClick = (item: Payroll) => {\n onCancelDialogOpen(item)\n }\n\n const handleConfirmCancel = () => {\n if (cancelDialogItem) {\n onCancelPayroll(cancelDialogItem)\n }\n }\n\n const getMenuItems = (item: Payroll): MenuItem[] => {\n const payrollId = item.payrollUuid || item.uuid!\n const items: MenuItem[] = [\n {\n label: t('menu.viewSummary'),\n icon: <FileIcon aria-hidden />,\n onClick: () => {\n onViewSummary(payrollId, item.payPeriod?.startDate, item.payPeriod?.endDate)\n },\n },\n {\n label: t('menu.viewReceipt'),\n icon: <ReceiptIcon aria-hidden />,\n onClick: () => {\n onViewReceipt(payrollId, item.payPeriod?.startDate, item.payPeriod?.endDate)\n },\n },\n ]\n\n if (canCancelPayroll(item)) {\n items.push({\n label: t('menu.cancelPayroll'),\n icon: <TrashcanIcon aria-hidden />,\n onClick: () => {\n handleCancelClick(item)\n },\n 'data-destructive': 'true',\n })\n }\n\n return items\n }\n\n if (payrollHistory.length === 0) {\n return (\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={24}>\n <Heading as=\"h3\">{t('emptyState.title')}</Heading>\n <Text>{t('emptyState.description')}</Text>\n </Flex>\n )\n }\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n <Flex\n flexDirection={{ base: 'column', medium: 'row' }}\n justifyContent=\"space-between\"\n alignItems=\"flex-start\"\n gap={{ base: 12, medium: 24 }}\n >\n <Flex>\n <Heading as=\"h2\">{t('title')}</Heading>\n </Flex>\n <div className={styles.timeFilterContainer}>\n <Select\n value={selectedTimeFilter}\n onChange={(value: string) => {\n onTimeFilterChange(value as TimeFilterOption)\n }}\n options={timeFilterOptions}\n label={t('timeFilter.placeholder')}\n shouldVisuallyHideLabel\n isRequired\n />\n </div>\n </Flex>\n\n <DataView\n label={t('dataView.label')}\n columns={[\n {\n title: t('columns.payPeriod'),\n render: (item: Payroll) =>\n dateFormatter.formatPayPeriodRange(\n item.payPeriod?.startDate,\n item.payPeriod?.endDate,\n ),\n },\n {\n title: t('columns.type'),\n render: (item: Payroll) => getPayrollType(item),\n },\n {\n title: t('columns.payDate'),\n render: (item: Payroll) => dateFormatter.formatShortWithYear(item.checkDate),\n },\n {\n title: t('columns.status'),\n render: (item: Payroll) => {\n const wireInRequest = wireInRequests.find(\n wire => wire.paymentUuid === item.payrollUuid,\n )\n return <PayrollStatusBadges payroll={item} wireInRequest={wireInRequest} />\n },\n },\n {\n title: t('columns.totalPayroll'),\n render: (item: Payroll) => formatNumberAsCurrency(calculateTotalPayroll(item)),\n },\n ]}\n data={payrollHistory}\n itemMenu={(item: Payroll) => <HamburgerMenu items={getMenuItems(item)} />}\n />\n\n <Dialog\n isOpen={!!cancelDialogItem}\n onClose={onCancelDialogClose}\n onPrimaryActionClick={handleConfirmCancel}\n isDestructive\n isPrimaryActionLoading={isLoading}\n primaryActionLabel={t('cancelDialog.primaryAction')}\n closeActionLabel={t('cancelDialog.secondaryAction')}\n title={\n cancelDialogItem\n ? t('cancelDialog.title', {\n payPeriod: dateFormatter.formatPayPeriodRange(\n cancelDialogItem.payPeriod?.startDate,\n cancelDialogItem.payPeriod?.endDate,\n ),\n })\n : ''\n }\n >\n {cancelDialogItem && (\n <Flex flexDirection=\"column\" gap={16}>\n <Text>{t('cancelDialog.body')}</Text>\n {cancelDialogItem.payrollDeadline && (\n <Text>\n {t('cancelDialog.deadline', {\n deadline: formatDeadlineForDialog(cancelDialogItem),\n })}\n </Text>\n )}\n </Flex>\n )}\n </Dialog>\n </Flex>\n )\n}\n"],"names":["PayrollHistoryPresentation","payrollHistory","wireInRequests","selectedTimeFilter","onTimeFilterChange","onViewSummary","onViewReceipt","onCancelPayroll","cancelDialogItem","onCancelDialogOpen","onCancelDialogClose","isLoading","Heading","Text","Select","Dialog","useComponentContext","useI18n","useTranslation","dateFormatter","useDateFormatter","timeFilterOptions","formatDeadlineForDialog","item","deadline","deadlineDate","timeZone","formatter","timeFormatter","dateStr","handleCancelClick","handleConfirmCancel","getMenuItems","payrollId","items","jsx","FileIcon","ReceiptIcon","canCancelPayroll","TrashcanIcon","Flex","jsxs","styles","value","DataView","getPayrollType","wireInRequest","wire","PayrollStatusBadges","formatNumberAsCurrency","calculateTotalPayroll","HamburgerMenu"],"mappings":";;;;;;;;;;;;;;;;;AAgCO,MAAMA,KAA6B,CAAC;AAAA,EACzC,gBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,WAAAC,IAAY;AACd,MAAuC;AACrC,QAAM,EAAE,SAAAC,GAAS,MAAAC,GAAM,QAAAC,GAAQ,QAAAC,EAAA,IAAWC,EAAA;AAC1C,EAAAC,EAAQ,wBAAwB;AAChC,QAAM,EAAE,EAAA,IAAMC,EAAe,wBAAwB,GAC/CC,IAAgBC,EAAA,GAEhBC,IAAoB;AAAA,IACxB,EAAE,OAAO,WAAW,OAAO,EAAE,4BAA4B,EAAA;AAAA,IACzD,EAAE,OAAO,WAAW,OAAO,EAAE,4BAA4B,EAAA;AAAA,IACzD,EAAE,OAAO,QAAQ,OAAO,EAAE,yBAAyB,EAAA;AAAA,EAAE,GAGjDC,IAA0B,CAACC,MAA0B;AACzD,UAAMC,IAAWD,EAAK;AACtB,QAAI,CAACC,EAAU,QAAO;AAEtB,UAAMC,IAAe,IAAI,KAAKD,CAAQ,GAChCE,IAAW,oBAEXC,IAAY,IAAI,KAAK,eAAe,SAAS;AAAA,MACjD,SAAS;AAAA,MACT,OAAO;AAAA,MACP,KAAK;AAAA,MACL,UAAAD;AAAA,IAAA,CACD,GAEKE,IAAgB,IAAI,KAAK,eAAe,SA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