@gusto/embedded-react-sdk 0.26.0 → 0.28.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 +103 -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/DataView/DataCards/DataCards.d.ts +4 -2
- package/dist/components/Common/DataView/DataCards/DataCards.js +52 -32
- package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
- package/dist/components/Common/DataView/DataTable/DataTable.d.ts +3 -2
- package/dist/components/Common/DataView/DataTable/DataTable.js +68 -53
- package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
- package/dist/components/Common/DataView/DataView.d.ts +4 -2
- package/dist/components/Common/DataView/DataView.js +28 -18
- package/dist/components/Common/DataView/DataView.js.map +1 -1
- package/dist/components/Common/DataView/useDataView.d.ts +6 -1
- package/dist/components/Common/DataView/useDataView.js +34 -19
- package/dist/components/Common/DataView/useDataView.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/Breadcrumbs/Breadcrumbs.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.d.ts +1 -1
- package/dist/components/Common/UI/Card/Card.js +10 -20
- package/dist/components/Common/UI/Card/Card.js.map +1 -1
- package/dist/components/Common/UI/Card/Card.module.scss.js +1 -1
- package/dist/components/Common/UI/Card/CardTypes.d.ts +4 -4
- 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.js +1 -1
- 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/ProgressBar/ProgressBar.js +4 -4
- 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 +41 -39
- 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 +18 -14
- 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 +52 -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
package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js
CHANGED
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
import { jsx as n, jsxs as a } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import {
|
|
4
|
-
import { InformationRequestStatus as
|
|
5
|
-
import { BaseComponent as
|
|
2
|
+
import { useTranslation as P } from "react-i18next";
|
|
3
|
+
import { useInformationRequestsGetInformationRequestsSuspense as w } from "@gusto/embedded-api/react-query/informationRequestsGetInformationRequests";
|
|
4
|
+
import { InformationRequestStatus as s, InformationRequestType as i } from "@gusto/embedded-api/models/components/informationrequest";
|
|
5
|
+
import { BaseComponent as x } from "../../Base/Base.js";
|
|
6
6
|
import "../../Base/useBase.js";
|
|
7
|
-
import { useComponentContext as
|
|
8
|
-
import { useComponentDictionary as
|
|
9
|
-
import { DataView as
|
|
10
|
-
import { useDataView as
|
|
11
|
-
import { FlexItem as
|
|
7
|
+
import { useComponentContext as S } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
|
+
import { useComponentDictionary as T, useI18n as D } from "../../../i18n/I18n.js";
|
|
9
|
+
import { DataView as k } from "../../Common/DataView/DataView.js";
|
|
10
|
+
import { useDataView as v } from "../../Common/DataView/useDataView.js";
|
|
11
|
+
import { FlexItem as E, Flex as u } from "../../Common/Flex/Flex.js";
|
|
12
|
+
import "classnames";
|
|
13
|
+
import { informationRequestEvents as C } from "../../../shared/constants.js";
|
|
14
|
+
import { EmptyData as L } from "../../Common/EmptyData/EmptyData.js";
|
|
12
15
|
import "react";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return /* @__PURE__ */ n(k, { ...s, children: /* @__PURE__ */ n(A, { ...s, children: s.children }) });
|
|
16
|
+
function X(r) {
|
|
17
|
+
return /* @__PURE__ */ n(x, { ...r, children: /* @__PURE__ */ n(A, { ...r, children: r.children }) });
|
|
16
18
|
}
|
|
17
19
|
function A({
|
|
18
|
-
companyId:
|
|
19
|
-
dictionary:
|
|
20
|
-
filterByPayrollBlocking:
|
|
21
|
-
onEvent:
|
|
20
|
+
companyId: r,
|
|
21
|
+
dictionary: f,
|
|
22
|
+
filterByPayrollBlocking: m = !1,
|
|
23
|
+
onEvent: y
|
|
22
24
|
}) {
|
|
23
|
-
|
|
24
|
-
const { t } =
|
|
25
|
-
companyUuid:
|
|
26
|
-
}),
|
|
27
|
-
const o = e.status !==
|
|
28
|
-
return
|
|
29
|
-
}),
|
|
25
|
+
T("InformationRequests.InformationRequestList", f), D("InformationRequests.InformationRequestList");
|
|
26
|
+
const { t } = P("InformationRequests.InformationRequestList"), { Heading: R, Text: l, Button: g, Badge: c } = S(), { data: h } = w({
|
|
27
|
+
companyUuid: r
|
|
28
|
+
}), p = (h.informationRequestList ?? []).filter((e) => {
|
|
29
|
+
const o = e.status !== s.Approved;
|
|
30
|
+
return m ? e.blockingPayroll && o : o;
|
|
31
|
+
}), I = (e) => {
|
|
30
32
|
switch (e) {
|
|
31
33
|
case i.CompanyOnboarding:
|
|
32
34
|
return t("types.companyOnboarding");
|
|
@@ -39,42 +41,42 @@ function A({
|
|
|
39
41
|
default:
|
|
40
42
|
return t("types.unknown");
|
|
41
43
|
}
|
|
42
|
-
},
|
|
44
|
+
}, q = (e) => {
|
|
43
45
|
switch (e) {
|
|
44
|
-
case
|
|
46
|
+
case s.PendingResponse:
|
|
45
47
|
return { label: t("status.incomplete"), badgeStatus: "info" };
|
|
46
|
-
case
|
|
48
|
+
case s.PendingReview:
|
|
47
49
|
return { label: t("status.underReview"), badgeStatus: "warning" };
|
|
48
50
|
default:
|
|
49
51
|
return null;
|
|
50
52
|
}
|
|
51
|
-
},
|
|
52
|
-
data:
|
|
53
|
-
|
|
53
|
+
}, b = v({
|
|
54
|
+
data: p,
|
|
55
|
+
emptyState: () => /* @__PURE__ */ n(L, { title: t("emptyTableTitle"), description: t("emptyTableDescription") }),
|
|
54
56
|
columns: [
|
|
55
57
|
{
|
|
56
58
|
key: "type",
|
|
57
59
|
title: t("columns.type"),
|
|
58
|
-
render: (e) => /* @__PURE__ */ n(
|
|
60
|
+
render: (e) => /* @__PURE__ */ n(E, { flexGrow: 1, children: /* @__PURE__ */ n(l, { weight: "medium", children: I(e.type) }) })
|
|
59
61
|
},
|
|
60
62
|
{
|
|
61
63
|
key: "status",
|
|
62
64
|
title: t("columns.status"),
|
|
63
65
|
render: (e) => {
|
|
64
|
-
const o =
|
|
65
|
-
return !o && !
|
|
66
|
-
o && /* @__PURE__ */ n(
|
|
67
|
-
|
|
66
|
+
const o = q(e.status), d = !m && e.blockingPayroll;
|
|
67
|
+
return !o && !d ? null : /* @__PURE__ */ a(u, { gap: 8, alignItems: "center", children: [
|
|
68
|
+
o && /* @__PURE__ */ n(c, { status: o.badgeStatus, children: o.label }),
|
|
69
|
+
d && /* @__PURE__ */ n(c, { status: "error", children: t("status.payrollBlocking") })
|
|
68
70
|
] });
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
],
|
|
72
|
-
itemMenu: (e) => e.status ===
|
|
74
|
+
itemMenu: (e) => e.status === s.PendingResponse ? /* @__PURE__ */ n(
|
|
73
75
|
g,
|
|
74
76
|
{
|
|
75
77
|
variant: "secondary",
|
|
76
78
|
onClick: () => {
|
|
77
|
-
|
|
79
|
+
y(C.INFORMATION_REQUEST_RESPOND, {
|
|
78
80
|
requestId: e.uuid
|
|
79
81
|
});
|
|
80
82
|
},
|
|
@@ -85,12 +87,12 @@ function A({
|
|
|
85
87
|
return /* @__PURE__ */ a(u, { flexDirection: "column", gap: 20, children: [
|
|
86
88
|
/* @__PURE__ */ a(u, { flexDirection: "column", gap: 2, children: [
|
|
87
89
|
/* @__PURE__ */ n(R, { as: "h2", styledAs: "h4", children: t("title") }),
|
|
88
|
-
/* @__PURE__ */ n(l, { children: t("description") })
|
|
90
|
+
p.length > 0 && /* @__PURE__ */ n(l, { children: t("description") })
|
|
89
91
|
] }),
|
|
90
|
-
/* @__PURE__ */ n(
|
|
92
|
+
/* @__PURE__ */ n(k, { ...b, label: t("title") })
|
|
91
93
|
] });
|
|
92
94
|
}
|
|
93
95
|
export {
|
|
94
|
-
|
|
96
|
+
X as InformationRequestList
|
|
95
97
|
};
|
|
96
98
|
//# sourceMappingURL=InformationRequestList.js.map
|
package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InformationRequestList.js","sources":["../../../../src/components/InformationRequests/InformationRequestList/InformationRequestList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport {
|
|
1
|
+
{"version":3,"file":"InformationRequestList.js","sources":["../../../../src/components/InformationRequests/InformationRequestList/InformationRequestList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useInformationRequestsGetInformationRequestsSuspense } from '@gusto/embedded-api/react-query/informationRequestsGetInformationRequests'\nimport type { InformationRequest } from '@gusto/embedded-api/models/components/informationrequest'\nimport {\n InformationRequestStatus,\n InformationRequestType,\n} from '@gusto/embedded-api/models/components/informationrequest'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { EmptyData, Flex, FlexItem } from '@/components/Common'\nimport { informationRequestEvents } from '@/shared/constants'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\n\ninterface InformationRequestListProps extends BaseComponentInterface<'InformationRequests.InformationRequestList'> {\n companyId: string\n filterByPayrollBlocking?: boolean\n onEvent: BaseComponentInterface['onEvent']\n}\n\nexport function InformationRequestList(props: InformationRequestListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\ntype StatusMapping = {\n label: string\n badgeStatus: BadgeProps['status']\n} | null\n\nfunction Root({\n companyId,\n dictionary,\n filterByPayrollBlocking = false,\n onEvent,\n}: InformationRequestListProps) {\n useComponentDictionary('InformationRequests.InformationRequestList', dictionary)\n useI18n('InformationRequests.InformationRequestList')\n const { t } = useTranslation('InformationRequests.InformationRequestList')\n const { Heading, Text, Button, Badge } = useComponentContext()\n\n const { data } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const informationRequests = data.informationRequestList ?? []\n\n const visibleRequests = informationRequests.filter(request => {\n const isNotApproved = request.status !== InformationRequestStatus.Approved\n\n if (filterByPayrollBlocking) {\n return request.blockingPayroll && isNotApproved\n }\n\n return isNotApproved\n })\n\n const getTypeLabel = (type: InformationRequest['type']): string => {\n switch (type) {\n case InformationRequestType.CompanyOnboarding:\n return t('types.companyOnboarding')\n case InformationRequestType.AccountProtection:\n return t('types.accountProtection')\n case InformationRequestType.PaymentRequest:\n return t('types.paymentRequest')\n case InformationRequestType.PaymentError:\n return t('types.paymentError')\n default:\n return t('types.unknown')\n }\n }\n\n const getStatusMapping = (status: InformationRequest['status']): StatusMapping => {\n switch (status) {\n case InformationRequestStatus.PendingResponse:\n return { label: t('status.incomplete'), badgeStatus: 'info' }\n case InformationRequestStatus.PendingReview:\n return { label: t('status.underReview'), badgeStatus: 'warning' }\n default:\n return null\n }\n }\n\n const dataViewProps = useDataView({\n data: visibleRequests,\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')} />\n ),\n columns: [\n {\n key: 'type',\n title: t('columns.type'),\n render: request => (\n <FlexItem flexGrow={1}>\n <Text weight=\"medium\">{getTypeLabel(request.type)}</Text>\n </FlexItem>\n ),\n },\n {\n key: 'status',\n title: t('columns.status'),\n render: request => {\n const statusMapping = getStatusMapping(request.status)\n const showPayrollBlockingBadge = !filterByPayrollBlocking && request.blockingPayroll\n\n if (!statusMapping && !showPayrollBlockingBadge) {\n return null\n }\n\n return (\n <Flex gap={8} alignItems=\"center\">\n {statusMapping && (\n <Badge status={statusMapping.badgeStatus}>{statusMapping.label}</Badge>\n )}\n {showPayrollBlockingBadge && (\n <Badge status=\"error\">{t('status.payrollBlocking')}</Badge>\n )}\n </Flex>\n )\n },\n },\n ],\n itemMenu: request => {\n const isPendingResponse = request.status === InformationRequestStatus.PendingResponse\n if (!isPendingResponse) {\n return null\n }\n return (\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(informationRequestEvents.INFORMATION_REQUEST_RESPOND, {\n requestId: request.uuid,\n })\n }}\n >\n {t('cta.respond')}\n </Button>\n )\n },\n })\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={2}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('title')}\n </Heading>\n {visibleRequests.length > 0 && <Text>{t('description')}</Text>}\n </Flex>\n\n <DataView {...dataViewProps} label={t('title')} />\n </Flex>\n )\n}\n"],"names":["InformationRequestList","props","jsx","BaseComponent","Root","companyId","dictionary","filterByPayrollBlocking","onEvent","useComponentDictionary","useI18n","useTranslation","Heading","Text","Button","Badge","useComponentContext","data","useInformationRequestsGetInformationRequestsSuspense","visibleRequests","request","isNotApproved","InformationRequestStatus","getTypeLabel","type","InformationRequestType","getStatusMapping","status","dataViewProps","useDataView","EmptyData","FlexItem","statusMapping","showPayrollBlockingBadge","jsxs","Flex","informationRequestEvents","DataView"],"mappings":";;;;;;;;;;;;;;;AAsBO,SAASA,EAAuBC,GAAoC;AACzE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAOA,SAASG,EAAK;AAAA,EACZ,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,yBAAAC,IAA0B;AAAA,EAC1B,SAAAC;AACF,GAAgC;AAC9B,EAAAC,EAAuB,8CAA8CH,CAAU,GAC/EI,EAAQ,4CAA4C;AACpD,QAAM,EAAE,EAAA,IAAMC,EAAe,4CAA4C,GACnE,EAAE,SAAAC,GAAS,MAAAC,GAAM,QAAAC,GAAQ,OAAAC,EAAA,IAAUC,EAAA,GAEnC,EAAE,MAAAC,EAAA,IAASC,EAAqD;AAAA,IACpE,aAAab;AAAA,EAAA,CACd,GAIKc,KAFsBF,EAAK,0BAA0B,CAAA,GAEf,OAAO,CAAAG,MAAW;AAC5D,UAAMC,IAAgBD,EAAQ,WAAWE,EAAyB;AAElE,WAAIf,IACKa,EAAQ,mBAAmBC,IAG7BA;AAAA,EACT,CAAC,GAEKE,IAAe,CAACC,MAA6C;AACjE,YAAQA,GAAA;AAAA,MACN,KAAKC,EAAuB;AAC1B,eAAO,EAAE,yBAAyB;AAAA,MACpC,KAAKA,EAAuB;AAC1B,eAAO,EAAE,yBAAyB;AAAA,MACpC,KAAKA,EAAuB;AAC1B,eAAO,EAAE,sBAAsB;AAAA,MACjC,KAAKA,EAAuB;AAC1B,eAAO,EAAE,oBAAoB;AAAA,MAC/B;AACE,eAAO,EAAE,eAAe;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AAyB,kBAKpE,gBAAApB;AAAA,MAACY;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAN,EAAQ4B,EAAyB,6BAA6B;AAAA,YAC5D,WAAWhB,EAAQ;AAAA,UAAA,CACpB;AAAA,QACH;AAAA,QAEC,YAAE,aAAa;AAAA,MAAA;AAAA,IAAA,IAXX;AAAA,EAcX,CACD;AAED,SACE,gBAAAc,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAAjC,EAACU,KAAQ,IAAG,MAAK,UAAS,MACvB,UAAA,EAAE,OAAO,GACZ;AAAA,MACCO,EAAgB,SAAS,uBAAMN,GAAA,EAAM,UAAA,EAAE,aAAa,EAAA,CAAE;AAAA,IAAA,GACzD;AAAA,sBAECwB,GAAA,EAAU,GAAGT,GAAe,OAAO,EAAE,OAAO,EAAA,CAAG;AAAA,EAAA,GAClD;AAEJ;"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { BaseComponentInterface } from '../Base';
|
|
2
|
-
export interface InformationRequestsFlowProps {
|
|
2
|
+
export interface InformationRequestsFlowProps extends Omit<BaseComponentInterface<'InformationRequests'>, 'onEvent'> {
|
|
3
3
|
companyId: string;
|
|
4
4
|
filterByPayrollBlocking?: boolean;
|
|
5
|
+
/**
|
|
6
|
+
* When true (default), the submission success alert is rendered at the top of this component.
|
|
7
|
+
* Set to false when embedding in a parent (e.g. PayrollBlockerList) that renders the alert elsewhere.
|
|
8
|
+
*/
|
|
9
|
+
withAlert?: boolean;
|
|
5
10
|
onEvent?: BaseComponentInterface['onEvent'];
|
|
6
11
|
}
|
|
7
|
-
export declare function InformationRequestsFlow({ companyId, filterByPayrollBlocking, onEvent, }: InformationRequestsFlowProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function InformationRequestsFlow({ companyId, dictionary, filterByPayrollBlocking, withAlert, onEvent, }: InformationRequestsFlowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,68 +1,101 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createMachine as
|
|
3
|
-
import { useMachine as
|
|
4
|
-
import { useState as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { jsx as t, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import { createMachine as L } from "robot3";
|
|
3
|
+
import { useMachine as b } from "react-robot";
|
|
4
|
+
import { useState as R, useCallback as p, useMemo as Q, Suspense as U } from "react";
|
|
5
|
+
import { useTranslation as P } from "react-i18next";
|
|
6
|
+
import { informationRequestsMachine as g } from "./informationRequestsStateMachine.js";
|
|
7
|
+
import { BaseBoundaries as j } from "../Base/Base.js";
|
|
7
8
|
import "../Base/useBase.js";
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import { informationRequestEvents as
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
import { Flex as k } from "../Common/Flex/Flex.js";
|
|
10
|
+
import "classnames";
|
|
11
|
+
import { informationRequestEvents as s } from "../../shared/constants.js";
|
|
12
|
+
import { useComponentContext as B } from "../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
+
import { FlowContext as $ } from "../Flow/useFlow.js";
|
|
14
|
+
import { useComponentDictionary as w, useI18n as z } from "../../i18n/I18n.js";
|
|
15
|
+
import { InformationRequestList as Y } from "./InformationRequestList/InformationRequestList.js";
|
|
16
|
+
const E = "informationRequestResponded";
|
|
17
|
+
function ie({
|
|
18
|
+
companyId: r,
|
|
19
|
+
dictionary: I,
|
|
20
|
+
filterByPayrollBlocking: O = !1,
|
|
21
|
+
withAlert: a = !0,
|
|
22
|
+
onEvent: M = () => {
|
|
16
23
|
}
|
|
17
24
|
}) {
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
w("InformationRequests", I), z("InformationRequests");
|
|
26
|
+
const { t: m } = P("InformationRequests"), { Modal: x, LoadingSpinner: c, Alert: h, Text: A } = B(), [C, i] = R(!1), [F, f] = R({
|
|
27
|
+
nextAlertId: 0,
|
|
28
|
+
alerts: []
|
|
29
|
+
}), N = p((e) => {
|
|
30
|
+
f((o) => ({
|
|
31
|
+
...o,
|
|
32
|
+
alerts: o.alerts.filter((D) => D.id !== e)
|
|
33
|
+
}));
|
|
34
|
+
}, []), T = p(() => {
|
|
35
|
+
f((e) => ({
|
|
36
|
+
nextAlertId: e.nextAlertId + 1,
|
|
37
|
+
alerts: [{ id: e.nextAlertId }, ...e.alerts]
|
|
38
|
+
}));
|
|
39
|
+
}, []), _ = Q(
|
|
40
|
+
() => L(
|
|
20
41
|
"list",
|
|
21
|
-
|
|
42
|
+
g,
|
|
22
43
|
() => ({
|
|
23
44
|
component: null,
|
|
24
|
-
companyId:
|
|
25
|
-
onEvent:
|
|
45
|
+
companyId: r,
|
|
46
|
+
onEvent: n
|
|
26
47
|
})
|
|
27
48
|
),
|
|
28
|
-
[
|
|
29
|
-
), [
|
|
30
|
-
function e
|
|
31
|
-
|
|
49
|
+
[r]
|
|
50
|
+
), [u, S] = b(_);
|
|
51
|
+
function n(e, o) {
|
|
52
|
+
S({ type: e, payload: o }), e === s.INFORMATION_REQUEST_RESPOND && i(!0), (e === s.INFORMATION_REQUEST_FORM_CANCEL || e === s.INFORMATION_REQUEST_FORM_DONE) && i(!1), e === s.INFORMATION_REQUEST_FORM_DONE && a && T(), M(e, o);
|
|
32
53
|
}
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
|
|
54
|
+
const q = () => {
|
|
55
|
+
i(!1);
|
|
56
|
+
}, l = u.context.component, d = l?.Footer || void 0;
|
|
57
|
+
return /* @__PURE__ */ t(
|
|
58
|
+
$.Provider,
|
|
38
59
|
{
|
|
39
60
|
value: {
|
|
40
|
-
...
|
|
41
|
-
onEvent:
|
|
61
|
+
...u.context,
|
|
62
|
+
onEvent: n
|
|
42
63
|
},
|
|
43
|
-
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
|
|
64
|
+
children: /* @__PURE__ */ v(k, { flexDirection: "column", gap: 32, children: [
|
|
65
|
+
a && F.alerts.map((e) => /* @__PURE__ */ t(
|
|
66
|
+
h,
|
|
46
67
|
{
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
68
|
+
status: "success",
|
|
69
|
+
label: m(`alerts.${E}.title`),
|
|
70
|
+
onDismiss: () => {
|
|
71
|
+
N(e.id);
|
|
72
|
+
},
|
|
73
|
+
children: /* @__PURE__ */ t(A, { children: m(`alerts.${E}.description`) })
|
|
74
|
+
},
|
|
75
|
+
e.id
|
|
76
|
+
)),
|
|
77
|
+
/* @__PURE__ */ t(U, { fallback: /* @__PURE__ */ t(c, {}), children: /* @__PURE__ */ t(
|
|
78
|
+
Y,
|
|
79
|
+
{
|
|
80
|
+
companyId: r,
|
|
81
|
+
filterByPayrollBlocking: O,
|
|
82
|
+
onEvent: n
|
|
50
83
|
}
|
|
51
|
-
),
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
|
|
84
|
+
) }),
|
|
85
|
+
/* @__PURE__ */ t(
|
|
86
|
+
x,
|
|
54
87
|
{
|
|
55
|
-
isOpen:
|
|
56
|
-
onClose:
|
|
57
|
-
footer:
|
|
58
|
-
children:
|
|
88
|
+
isOpen: C,
|
|
89
|
+
onClose: q,
|
|
90
|
+
footer: d && /* @__PURE__ */ t(j, { LoaderComponent: () => /* @__PURE__ */ t(c, { size: "sm" }), children: /* @__PURE__ */ t(d, { onEvent: n }) }),
|
|
91
|
+
children: l && /* @__PURE__ */ t(l, {})
|
|
59
92
|
}
|
|
60
93
|
)
|
|
61
|
-
]
|
|
94
|
+
] })
|
|
62
95
|
}
|
|
63
96
|
);
|
|
64
97
|
}
|
|
65
98
|
export {
|
|
66
|
-
|
|
99
|
+
ie as InformationRequestsFlow
|
|
67
100
|
};
|
|
68
101
|
//# sourceMappingURL=InformationRequests.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InformationRequests.js","sources":["../../../src/components/InformationRequests/InformationRequests.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { useMemo, useState } from 'react'\nimport { InformationRequestList } from './InformationRequestList'\nimport { informationRequestsMachine } from './informationRequestsStateMachine'\nimport { type InformationRequestsContextInterface } from './InformationRequestsComponents'\nimport { BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { informationRequestEvents, type EventType } from '@/shared/constants'\n\nexport interface InformationRequestsFlowProps {\n companyId: string\n filterByPayrollBlocking?: boolean\n onEvent?: BaseComponentInterface['onEvent']\n}\n\nexport function InformationRequestsFlow({\n companyId,\n filterByPayrollBlocking = false,\n onEvent = () => {},\n}: InformationRequestsFlowProps) {\n const { Modal, LoadingSpinner } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n\n const informationRequestsMachineInstance = useMemo(\n () =>\n createMachine(\n 'list',\n informationRequestsMachine,\n (): InformationRequestsContextInterface => ({\n component: null,\n companyId,\n onEvent: handleEvent,\n }),\n ),\n [companyId],\n )\n const [current, send] = useMachine(informationRequestsMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n send({ type, payload: data })\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_RESPOND) {\n setIsModalOpen(true)\n }\n\n if (\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL ||\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE\n ) {\n setIsModalOpen(false)\n }\n\n onEvent(type, data)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <InformationRequestList\n
|
|
1
|
+
{"version":3,"file":"InformationRequests.js","sources":["../../../src/components/InformationRequests/InformationRequests.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { Suspense, useCallback, useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { InformationRequestList } from './InformationRequestList'\nimport { informationRequestsMachine } from './informationRequestsStateMachine'\nimport { type InformationRequestsContextInterface } from './InformationRequestsComponents'\nimport { BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { informationRequestEvents, type EventType } from '@/shared/constants'\n\ninterface SubmissionAlert {\n id: number\n}\n\ninterface SubmissionAlertState {\n nextAlertId: number\n alerts: SubmissionAlert[]\n}\n\nexport interface InformationRequestsFlowProps extends Omit<\n BaseComponentInterface<'InformationRequests'>,\n 'onEvent'\n> {\n companyId: string\n filterByPayrollBlocking?: boolean\n /**\n * When true (default), the submission success alert is rendered at the top of this component.\n * Set to false when embedding in a parent (e.g. PayrollBlockerList) that renders the alert elsewhere.\n */\n withAlert?: boolean\n onEvent?: BaseComponentInterface['onEvent']\n}\n\nconst ALERT_TYPE = 'informationRequestResponded' as const\n\nexport function InformationRequestsFlow({\n companyId,\n dictionary,\n filterByPayrollBlocking = false,\n withAlert = true,\n onEvent = () => {},\n}: InformationRequestsFlowProps) {\n useComponentDictionary('InformationRequests', dictionary)\n useI18n('InformationRequests')\n const { t } = useTranslation('InformationRequests')\n const { Modal, LoadingSpinner, Alert, Text } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n const [alertState, setAlertState] = useState<SubmissionAlertState>({\n nextAlertId: 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 addSubmissionAlert = useCallback(() => {\n setAlertState(prev => ({\n nextAlertId: prev.nextAlertId + 1,\n alerts: [{ id: prev.nextAlertId }, ...prev.alerts],\n }))\n }, [])\n\n const informationRequestsMachineInstance = useMemo(\n () =>\n createMachine(\n 'list',\n informationRequestsMachine,\n (): InformationRequestsContextInterface => ({\n component: null,\n companyId,\n onEvent: handleEvent,\n }),\n ),\n [companyId],\n )\n const [current, send] = useMachine(informationRequestsMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n send({ type, payload: data })\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_RESPOND) {\n setIsModalOpen(true)\n }\n\n if (\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL ||\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE\n ) {\n setIsModalOpen(false)\n }\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE && withAlert) {\n addSubmissionAlert()\n }\n\n onEvent(type, data)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {withAlert &&\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 <Suspense fallback={<LoadingSpinner />}>\n <InformationRequestList\n companyId={companyId}\n filterByPayrollBlocking={filterByPayrollBlocking}\n onEvent={handleEvent}\n />\n </Suspense>\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n footer={\n Footer && (\n <BaseBoundaries LoaderComponent={() => <LoadingSpinner size=\"sm\" />}>\n <Footer onEvent={handleEvent} />\n </BaseBoundaries>\n )\n }\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </Flex>\n </FlowContext.Provider>\n )\n}\n"],"names":["ALERT_TYPE","InformationRequestsFlow","companyId","dictionary","filterByPayrollBlocking","withAlert","onEvent","useComponentDictionary","useI18n","t","useTranslation","Modal","LoadingSpinner","Alert","Text","useComponentContext","isModalOpen","setIsModalOpen","useState","alertState","setAlertState","handleDismissAlert","useCallback","alertId","prev","alert","addSubmissionAlert","informationRequestsMachineInstance","useMemo","createMachine","informationRequestsMachine","handleEvent","current","send","useMachine","type","data","informationRequestEvents","handleCloseModal","CurrentComponent","Footer","jsx","FlowContext","jsxs","Flex","Suspense","InformationRequestList","BaseBoundaries"],"mappings":";;;;;;;;;;;;;;;AAqCA,MAAMA,IAAa;AAEZ,SAASC,GAAwB;AAAA,EACtC,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,yBAAAC,IAA0B;AAAA,EAC1B,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU,MAAM;AAAA,EAAC;AACnB,GAAiC;AAC/B,EAAAC,EAAuB,uBAAuBJ,CAAU,GACxDK,EAAQ,qBAAqB;AAC7B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,OAAAC,GAAO,gBAAAC,GAAgB,OAAAC,GAAO,MAAAC,EAAA,IAASC,EAAA,GACzC,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAC9C,CAACC,GAAYC,CAAa,IAAIF,EAA+B;AAAA,IACjE,aAAa;AAAA,IACb,QAAQ,CAAA;AAAA,EAAC,CACV,GAEKG,IAAqBC,EAAY,CAACC,MAAoB;AAC1D,IAAAH,EAAc,CAAAI,OAAS;AAAA,MACrB,GAAGA;AAAA,MACH,QAAQA,EAAK,OAAO,OAAO,CAAAC,MAASA,EAAM,OAAOF,CAAO;AAAA,IAAA,EACxD;AAAA,EACJ,GAAG,CAAA,C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ACrC,WAAW,MAAM;AACf,cAAAqB,EAAmBI,EAAM,EAAE;AAAA,YAC7B;AAAA,YAEA,4BAACX,GAAA,EAAM,UAAAL,EAAE,UAAUT,CAAU,cAAc,EAAA,CAAE;AAAA,UAAA;AAAA,UAPxCyB,EAAM;AAAA,QAAA,CASd;AAAA,QAEH,gBAAAgB,EAACI,GAAA,EAAS,UAAU,gBAAAJ,EAAC7B,KAAe,GAClC,UAAA,gBAAA6B;AAAA,UAACK;AAAA,UAAA;AAAA,YACC,WAAA5C;AAAA,YACA,yBAAAE;AAAA,YACA,SAAS2B;AAAA,UAAA;AAAA,QAAA,GAEb;AAAA,QACA,gBAAAU;AAAA,UAAC9B;AAAA,UAAA;AAAA,YACC,QAAQK;AAAA,YACR,SAASsB;AAAA,YACT,QACEE,KACE,gBAAAC,EAACM,GAAA,EAAe,iBAAiB,MAAM,gBAAAN,EAAC7B,GAAA,EAAe,MAAK,MAAK,GAC/D,UAAA,gBAAA6B,EAACD,GAAA,EAAO,SAAST,GAAa,GAChC;AAAA,YAIH,UAAAQ,uBAAqBA,GAAA,CAAA,CAAiB;AAAA,UAAA;AAAA,QAAA;AAAA,MACzC,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js
CHANGED
|
@@ -15,12 +15,13 @@ import { useComponentContext as S } from "../../../../contexts/ComponentAdapter/
|
|
|
15
15
|
import { useComponentDictionary as z, useI18n as g } from "../../../../i18n/I18n.js";
|
|
16
16
|
import { Flex as p, FlexItem as f } from "../../../Common/Flex/Flex.js";
|
|
17
17
|
import { payrollWireEvents as N } from "../../../../shared/constants.js";
|
|
18
|
-
import "
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
18
|
+
import "classnames";
|
|
19
|
+
import { TextInputField as V } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
20
|
+
import { DatePickerField as J } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
|
|
21
21
|
import { NumberInputField as Q } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
22
|
-
import
|
|
23
|
-
import {
|
|
22
|
+
import "react";
|
|
23
|
+
import { TextAreaField as X } from "../../../Common/Fields/TextAreaField/TextAreaField.js";
|
|
24
|
+
import { useDateFormatter as Z } from "../../../../hooks/useDateFormatter.js";
|
|
24
25
|
const $ = r.object({
|
|
25
26
|
amountSent: r.number().positive(),
|
|
26
27
|
dateSent: r.date(),
|
|
@@ -42,7 +43,7 @@ const oe = ({
|
|
|
42
43
|
modalContainerRef: y
|
|
43
44
|
}) => {
|
|
44
45
|
z("Payroll.ConfirmWireDetailsForm", i), g("Payroll.ConfirmWireDetailsForm");
|
|
45
|
-
const { onEvent: a, baseSubmitHandler: I } = Y(), { t } = F("Payroll.ConfirmWireDetailsForm"), { Heading: v, Text: b } = S(), R =
|
|
46
|
+
const { onEvent: a, baseSubmitHandler: I } = Y(), { t } = F("Payroll.ConfirmWireDetailsForm"), { Heading: v, Text: b } = S(), R = Z(), { data: P } = U({
|
|
46
47
|
wireInRequestUuid: o
|
|
47
48
|
}), W = P.wireInRequest, { data: q } = G({
|
|
48
49
|
companyId: n,
|
|
@@ -94,7 +95,7 @@ const oe = ({
|
|
|
94
95
|
}
|
|
95
96
|
),
|
|
96
97
|
/* @__PURE__ */ e(
|
|
97
|
-
|
|
98
|
+
J,
|
|
98
99
|
{
|
|
99
100
|
name: "dateSent",
|
|
100
101
|
label: t("dateLabel"),
|
|
@@ -104,7 +105,7 @@ const oe = ({
|
|
|
104
105
|
}
|
|
105
106
|
),
|
|
106
107
|
/* @__PURE__ */ e(
|
|
107
|
-
|
|
108
|
+
V,
|
|
108
109
|
{
|
|
109
110
|
name: "bankName",
|
|
110
111
|
label: t("bankNameLabel"),
|
|
@@ -114,7 +115,7 @@ const oe = ({
|
|
|
114
115
|
errorMessage: t("validations.bankName")
|
|
115
116
|
}
|
|
116
117
|
),
|
|
117
|
-
/* @__PURE__ */ e(
|
|
118
|
+
/* @__PURE__ */ e(X, { name: "additionalNotes", label: t("notesLabel"), rows: 3 })
|
|
118
119
|
] })
|
|
119
120
|
}
|
|
120
121
|
) })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmWireDetailsForm.js","sources":["../../../../../src/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport z from 'zod'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useIsMutating } from '@tanstack/react-query'\nimport {\n useWireInRequestsSubmitMutation,\n mutationKeyWireInRequestsSubmit,\n} from '@gusto/embedded-api/react-query/wireInRequestsSubmit'\nimport { useWireInRequestsGetSuspense } from '@gusto/embedded-api/react-query/wireInRequestsGet'\nimport type { PutWireInRequestsWireInRequestUuidRequest } from '@gusto/embedded-api/models/operations/putwireinrequestswireinrequestuuid'\nimport { usePayrollsListSuspense } from '@gusto/embedded-api/react-query/payrollsList'\nimport styles from './ConfirmWireDetailsForm.module.scss'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { Flex, FlexItem } from '@/components/Common/Flex/Flex'\nimport { payrollWireEvents, type EventType } from '@/shared/constants'\nimport { DatePickerField, NumberInputField, TextInputField } from '@/components/Common'\nimport { TextAreaField } from '@/components/Common/Fields/TextAreaField'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\ninterface ConfirmWireDetailsFormProps extends BaseComponentInterface<'Payroll.ConfirmWireDetailsForm'> {\n wireInId: string\n companyId: string\n modalContainerRef?: React.RefObject<HTMLDivElement | null>\n}\n\nexport const ConfirmWireDetailsFormSchema = z.object({\n amountSent: z.number().positive(),\n dateSent: z.date(),\n bankName: z.string().nonempty(),\n additionalNotes: z.string().optional(),\n})\n\nexport type ConfirmWireDetailsFormValues = z.infer<typeof ConfirmWireDetailsFormSchema>\n\nconst CONFIRM_WIRE_FORM_ID = 'confirm-wire-details-form'\n\nconst transformFormDataToPayload = (\n data: ConfirmWireDetailsFormValues,\n): PutWireInRequestsWireInRequestUuidRequest['requestBody'] => {\n return {\n amountSent: String(data.amountSent),\n dateSent: data.dateSent.toISOString().split('T')[0] || '',\n bankName: data.bankName,\n additionalNotes: data.additionalNotes || undefined,\n }\n}\n\nexport function ConfirmWireDetailsForm(props: ConfirmWireDetailsFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({\n wireInId,\n companyId,\n dictionary,\n modalContainerRef,\n}: ConfirmWireDetailsFormProps) => {\n useComponentDictionary('Payroll.ConfirmWireDetailsForm', dictionary)\n useI18n('Payroll.ConfirmWireDetailsForm')\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Payroll.ConfirmWireDetailsForm')\n const { Heading, Text } = useComponentContext()\n const dateFormatter = useDateFormatter()\n const { data } = useWireInRequestsGetSuspense({\n wireInRequestUuid: wireInId,\n })\n const wireInRequest = data.wireInRequest\n\n const { data: payrollsData } = usePayrollsListSuspense({\n companyId,\n processed: true,\n })\n\n const payrollData = payrollsData.payrollList?.find(\n payroll => payroll.payrollUuid === wireInRequest?.paymentUuid,\n )\n const payPeriod = payrollData?.payPeriod\n const payPeriodRange =\n payPeriod?.startDate && payPeriod.endDate\n ? dateFormatter.formatPayPeriodRange(payPeriod.startDate, payPeriod.endDate)\n : undefined\n\n const checkDate = payrollData\n ? dateFormatter.formatShortWithYear(payrollData.checkDate)\n : undefined\n\n const formHandlers = useForm<ConfirmWireDetailsFormValues>({\n resolver: zodResolver(ConfirmWireDetailsFormSchema),\n defaultValues: {\n bankName: '',\n },\n })\n\n const { mutateAsync: submitWireInRequest } = useWireInRequestsSubmitMutation()\n\n const onSubmit = async (data: ConfirmWireDetailsFormValues) => {\n await baseSubmitHandler(data, async innerData => {\n const payload = transformFormDataToPayload(innerData)\n const response = await submitWireInRequest({\n request: {\n wireInRequestUuid: wireInId,\n requestBody: payload,\n },\n })\n onEvent(payrollWireEvents.PAYROLL_WIRE_FORM_DONE, {\n wireInRequest: response.wireInRequest,\n confirmationAlert: {\n title: payPeriodRange\n ? t('confirmationAlert.title', { payrollRange: payPeriodRange })\n : t('confirmationAlert.emptyTitle'),\n content: checkDate ? (\n <Text>{t('confirmationAlert.content', { checkDate })}</Text>\n ) : undefined,\n },\n })\n })\n }\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <FlexItem>\n <Heading as=\"h2\">\n <Trans i18nKey=\"title\" t={t} values={{ payrollRange: payPeriodRange }} />\n </Heading>\n <Text>{t('description')}</Text>\n </FlexItem>\n\n <FormProvider {...formHandlers}>\n <HtmlForm\n id={CONFIRM_WIRE_FORM_ID}\n onSubmit={formHandlers.handleSubmit(onSubmit)}\n className={styles.form}\n >\n <Flex flexDirection=\"column\" gap={20}>\n <NumberInputField\n name=\"amountSent\"\n label={t('amountLabel')}\n isRequired\n format=\"currency\"\n errorMessage={t('validations.amount')}\n />\n <DatePickerField\n name=\"dateSent\"\n label={t('dateLabel')}\n isRequired\n errorMessage={t('validations.date')}\n portalContainer={modalContainerRef?.current || undefined}\n />\n <TextInputField\n name=\"bankName\"\n label={t('bankNameLabel')}\n isRequired\n description={t('bankNameDescription')}\n placeholder={t('bankNamePlaceholder')}\n errorMessage={t('validations.bankName')}\n />\n <TextAreaField name=\"additionalNotes\" label={t('notesLabel')} rows={3} />\n </Flex>\n </HtmlForm>\n </FormProvider>\n </Flex>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('Payroll.ConfirmWireDetailsForm')\n const { t } = useTranslation('Payroll.ConfirmWireDetailsForm')\n const { Button } = useComponentContext()\n const isMutating = useIsMutating({\n mutationKey: mutationKeyWireInRequestsSubmit(),\n })\n const isPending = isMutating > 0\n\n return (\n <Flex gap={12} justifyContent=\"space-evenly\">\n <FlexItem flexGrow={1}>\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL)\n }}\n isDisabled={isPending}\n className={styles.button}\n >\n {t('cancelCta')}\n </Button>\n </FlexItem>\n <FlexItem flexGrow={1}>\n <Button\n variant=\"primary\"\n type=\"submit\"\n form={CONFIRM_WIRE_FORM_ID}\n isLoading={isPending}\n className={styles.button}\n >\n {t('submitCta')}\n </Button>\n </FlexItem>\n </Flex>\n )\n}\nConfirmWireDetailsForm.Footer = Footer\n"],"names":["ConfirmWireDetailsFormSchema","z","CONFIRM_WIRE_FORM_ID","transformFormDataToPayload","data","ConfirmWireDetailsForm","props","jsx","BaseComponent","Root","wireInId","companyId","dictionary","modalContainerRef","useComponentDictionary","useI18n","onEvent","baseSubmitHandler","useBase","useTranslation","Heading","Text","useComponentContext","dateFormatter","useDateFormatter","useWireInRequestsGetSuspense","wireInRequest","payrollsData","usePayrollsListSuspense","payrollData","payroll","payPeriod","payPeriodRange","checkDate","formHandlers","useForm","zodResolver","submitWireInRequest","useWireInRequestsSubmitMutation","onSubmit","innerData","payload","response","payrollWireEvents","jsxs","Flex","FlexItem","Trans","FormProvider","HtmlForm","styles","NumberInputField","DatePickerField","TextInputField","TextAreaField","Footer","t","Button","isPending","useIsMutating","mutationKeyWireInRequestsSubmit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8BO,MAAMA,IAA+BC,EAAE,OAAO;AAAA,EACnD,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,UAAUA,EAAE,KAAA;AAAA,EACZ,UAAUA,EAAE,OAAA,EAAS,SAAA;AAAA,EACrB,iBAAiBA,EAAE,OAAA,EAAS,SAAA;AAC9B,CAAC,GAIKC,IAAuB,6BAEvBC,KAA6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,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAzC,EAAQ2B,EAAkB,wBAAwB;AAAA,QACpD;AAAA,QACA,YAAYe;AAAA,QACZ,WAAWR,EAAO;AAAA,QAEjB,YAAE,WAAW;AAAA,MAAA;AAAA,IAAA,GAElB;AAAA,IACA,gBAAA3C,EAACuC,GAAA,EAAS,UAAU,GAClB,UAAA,gBAAAvC;AAAA,MAACkD;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,MAAMvD;AAAA,QACN,WAAWwD;AAAA,QACX,WAAWR,EAAO;AAAA,QAEjB,YAAE,WAAW;AAAA,MAAA;AAAA,IAAA,EAChB,CACF;AAAA,EAAA,GACF;AAEJ;AACA7C,GAAuB,SAASkD;"}
|
|
1
|
+
{"version":3,"file":"ConfirmWireDetailsForm.js","sources":["../../../../../src/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport z from 'zod'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useIsMutating } from '@tanstack/react-query'\nimport {\n useWireInRequestsSubmitMutation,\n mutationKeyWireInRequestsSubmit,\n} from '@gusto/embedded-api/react-query/wireInRequestsSubmit'\nimport { useWireInRequestsGetSuspense } from '@gusto/embedded-api/react-query/wireInRequestsGet'\nimport type { PutWireInRequestsWireInRequestUuidRequest } from '@gusto/embedded-api/models/operations/putwireinrequestswireinrequestuuid'\nimport { usePayrollsListSuspense } from '@gusto/embedded-api/react-query/payrollsList'\nimport styles from './ConfirmWireDetailsForm.module.scss'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { Flex, FlexItem } from '@/components/Common/Flex/Flex'\nimport { payrollWireEvents, type EventType } from '@/shared/constants'\nimport { DatePickerField, NumberInputField, TextInputField } from '@/components/Common'\nimport { TextAreaField } from '@/components/Common/Fields/TextAreaField'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\ninterface ConfirmWireDetailsFormProps extends BaseComponentInterface<'Payroll.ConfirmWireDetailsForm'> {\n wireInId: string\n companyId: string\n modalContainerRef?: React.RefObject<HTMLDivElement | null>\n}\n\nexport const ConfirmWireDetailsFormSchema = z.object({\n amountSent: z.number().positive(),\n dateSent: z.date(),\n bankName: z.string().nonempty(),\n additionalNotes: z.string().optional(),\n})\n\nexport type ConfirmWireDetailsFormValues = z.infer<typeof ConfirmWireDetailsFormSchema>\n\nconst CONFIRM_WIRE_FORM_ID = 'confirm-wire-details-form'\n\nconst transformFormDataToPayload = (\n data: ConfirmWireDetailsFormValues,\n): PutWireInRequestsWireInRequestUuidRequest['requestBody'] => {\n return {\n amountSent: String(data.amountSent),\n dateSent: data.dateSent.toISOString().split('T')[0] || '',\n bankName: data.bankName,\n additionalNotes: data.additionalNotes || undefined,\n }\n}\n\nexport function ConfirmWireDetailsForm(props: ConfirmWireDetailsFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({\n wireInId,\n companyId,\n dictionary,\n modalContainerRef,\n}: ConfirmWireDetailsFormProps) => {\n useComponentDictionary('Payroll.ConfirmWireDetailsForm', dictionary)\n useI18n('Payroll.ConfirmWireDetailsForm')\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Payroll.ConfirmWireDetailsForm')\n const { Heading, Text } = useComponentContext()\n const dateFormatter = useDateFormatter()\n const { data } = useWireInRequestsGetSuspense({\n wireInRequestUuid: wireInId,\n })\n const wireInRequest = data.wireInRequest\n\n const { data: payrollsData } = usePayrollsListSuspense({\n companyId,\n processed: true,\n })\n\n const payrollData = payrollsData.payrollList?.find(\n payroll => payroll.payrollUuid === wireInRequest?.paymentUuid,\n )\n const payPeriod = payrollData?.payPeriod\n const payPeriodRange =\n payPeriod?.startDate && payPeriod.endDate\n ? dateFormatter.formatPayPeriodRange(payPeriod.startDate, payPeriod.endDate)\n : undefined\n\n const checkDate = payrollData\n ? dateFormatter.formatShortWithYear(payrollData.checkDate)\n : undefined\n\n const formHandlers = useForm<ConfirmWireDetailsFormValues>({\n resolver: zodResolver(ConfirmWireDetailsFormSchema),\n defaultValues: {\n bankName: '',\n },\n })\n\n const { mutateAsync: submitWireInRequest } = useWireInRequestsSubmitMutation()\n\n const onSubmit = async (data: ConfirmWireDetailsFormValues) => {\n await baseSubmitHandler(data, async innerData => {\n const payload = transformFormDataToPayload(innerData)\n const response = await submitWireInRequest({\n request: {\n wireInRequestUuid: wireInId,\n requestBody: payload,\n },\n })\n onEvent(payrollWireEvents.PAYROLL_WIRE_FORM_DONE, {\n wireInRequest: response.wireInRequest,\n confirmationAlert: {\n title: payPeriodRange\n ? t('confirmationAlert.title', { payrollRange: payPeriodRange })\n : t('confirmationAlert.emptyTitle'),\n content: checkDate ? (\n <Text>{t('confirmationAlert.content', { checkDate })}</Text>\n ) : undefined,\n },\n })\n })\n }\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <FlexItem>\n <Heading as=\"h2\">\n <Trans i18nKey=\"title\" t={t} values={{ payrollRange: payPeriodRange }} />\n </Heading>\n <Text>{t('description')}</Text>\n </FlexItem>\n\n <FormProvider {...formHandlers}>\n <HtmlForm\n id={CONFIRM_WIRE_FORM_ID}\n onSubmit={formHandlers.handleSubmit(onSubmit)}\n className={styles.form}\n >\n <Flex flexDirection=\"column\" gap={20}>\n <NumberInputField\n name=\"amountSent\"\n label={t('amountLabel')}\n isRequired\n format=\"currency\"\n errorMessage={t('validations.amount')}\n />\n <DatePickerField\n name=\"dateSent\"\n label={t('dateLabel')}\n isRequired\n errorMessage={t('validations.date')}\n portalContainer={modalContainerRef?.current || undefined}\n />\n <TextInputField\n name=\"bankName\"\n label={t('bankNameLabel')}\n isRequired\n description={t('bankNameDescription')}\n placeholder={t('bankNamePlaceholder')}\n errorMessage={t('validations.bankName')}\n />\n <TextAreaField name=\"additionalNotes\" label={t('notesLabel')} rows={3} />\n </Flex>\n </HtmlForm>\n </FormProvider>\n </Flex>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('Payroll.ConfirmWireDetailsForm')\n const { t } = useTranslation('Payroll.ConfirmWireDetailsForm')\n const { Button } = useComponentContext()\n const isMutating = useIsMutating({\n mutationKey: mutationKeyWireInRequestsSubmit(),\n })\n const isPending = isMutating > 0\n\n return (\n <Flex gap={12} justifyContent=\"space-evenly\">\n <FlexItem flexGrow={1}>\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL)\n }}\n isDisabled={isPending}\n className={styles.button}\n >\n {t('cancelCta')}\n </Button>\n </FlexItem>\n <FlexItem flexGrow={1}>\n <Button\n variant=\"primary\"\n type=\"submit\"\n form={CONFIRM_WIRE_FORM_ID}\n isLoading={isPending}\n className={styles.button}\n >\n {t('submitCta')}\n </Button>\n </FlexItem>\n </Flex>\n )\n}\nConfirmWireDetailsForm.Footer = Footer\n"],"names":["ConfirmWireDetailsFormSchema","z","CONFIRM_WIRE_FORM_ID","transformFormDataToPayload","data","ConfirmWireDetailsForm","props","jsx","BaseComponent","Root","wireInId","companyId","dictionary","modalContainerRef","useComponentDictionary","useI18n","onEvent","baseSubmitHandler","useBase","useTranslation","Heading","Text","useComponentContext","dateFormatter","useDateFormatter","useWireInRequestsGetSuspense","wireInRequest","payrollsData","usePayrollsListSuspense","payrollData","payroll","payPeriod","payPeriodRange","checkDate","formHandlers","useForm","zodResolver","submitWireInRequest","useWireInRequestsSubmitMutation","onSubmit","innerData","payload","response","payrollWireEvents","jsxs","Flex","FlexItem","Trans","FormProvider","HtmlForm","styles","NumberInputField","DatePickerField","TextInputField","TextAreaField","Footer","t","Button","isPending","useIsMutating","mutationKeyWireInRequestsSubmit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA8BO,MAAMA,IAA+BC,EAAE,OAAO;AAAA,EACnD,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,UAAUA,EAAE,KAAA;AAAA,EACZ,UAAUA,EAAE,OAAA,EAAS,SAAA;AAAA,EACrB,iBAAiBA,EAAE,OAAA,EAAS,SAAA;AAC9B,CAAC,GAIKC,IAAuB,6BAEvBC,KAA6B,CACjCC,OAEO;AAAA,EACL,YAAY,OAAOA,EAAK,UAAU;AAAA,EAClC,UAAUA,EAAK,SAAS,YAAA,EAAc,MAAM,GAAG,EAAE,CAAC,KAAK;AAAA,EACvD,UAAUA,EAAK;AAAA,EACf,iBAAiBA,EAAK,mBAAmB;AAAA;AAItC,SAASC,GAAuBC,GAAoC;AACzE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,MAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMG,KAAO,CAAC;AAAA,EACZ,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,mBAAAC;AACF,MAAmC;AACjC,EAAAC,EAAuB,kCAAkCF,CAAU,GACnEG,EAAQ,gCAAgC;AACxC,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GACjC,EAAE,EAAA,IAAMC,EAAe,gCAAgC,GACvD,EAAE,SAAAC,GAAS,MAAAC,EAAA,IAASC,EAAA,GACpBC,IAAgBC,EAAA,GAChB,EAAE,MAAApB,EAAA,IAASqB,EAA6B;AAAA,IAC5C,mBAAmBf;AAAA,EAAA,CACpB,GACKgB,IAAgBtB,EAAK,eAErB,EAAE,MAAMuB,EAAA,IAAiBC,EAAwB;AAAA,IACrD,WAAAjB;AAAA,IACA,WAAW;AAAA,EA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AACxC,QAAM,EAAE,GAAAyC,EAAA,IAAMrC,EAAe,gCAAgC,GACvD,EAAE,QAAAsC,EAAA,IAAWnC,EAAA,GAIboC,IAHaC,EAAc;AAAA,IAC/B,aAAaC,EAAA;AAAA,EAAgC,CAC9C,IAC8B;AAE/B,SACE,gBAAAhB,EAACC,GAAA,EAAK,KAAK,IAAI,gBAAe,gBAC5B,UAAA;AAAA,IAAA,gBAAAtC,EAACuC,GAAA,EAAS,UAAU,GAClB,UAAA,gBAAAvC;AAAA,MAACkD;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAzC,EAAQ2B,EAAkB,wBAAwB;AAAA,QACpD;AAAA,QACA,YAAYe;AAAA,QACZ,WAAWR,EAAO;AAAA,QAEjB,YAAE,WAAW;AAAA,MAAA;AAAA,IAAA,GAElB;AAAA,IACA,gBAAA3C,EAACuC,GAAA,EAAS,UAAU,GAClB,UAAA,gBAAAvC;AAAA,MAACkD;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,MAAMvD;AAAA,QACN,WAAWwD;AAAA,QACX,WAAWR,EAAO;AAAA,QAEjB,YAAE,WAAW;AAAA,MAAA;AAAA,IAAA,EAChB,CACF;AAAA,EAAA,GACF;AAEJ;AACA7C,GAAuB,SAASkD;"}
|
package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.module.scss.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
const e = "
|
|
1
|
+
const e = "_subtitle_jbusm_5", s = "_fieldLabel_jbusm_10", t = "_fieldValue_jbusm_17", r = "_requirementsCard_jbusm_23", u = "_requirementsList_jbusm_45", i = "_footer_jbusm_65", _ = {
|
|
2
2
|
subtitle: e,
|
|
3
|
-
fieldLabel:
|
|
4
|
-
fieldValue:
|
|
3
|
+
fieldLabel: s,
|
|
4
|
+
fieldValue: t,
|
|
5
5
|
requirementsCard: r,
|
|
6
|
-
requirementsList:
|
|
7
|
-
footer:
|
|
6
|
+
requirementsList: u,
|
|
7
|
+
footer: i
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
_ as default,
|
|
11
|
+
s as fieldLabel,
|
|
12
|
+
t as fieldValue,
|
|
13
|
+
i as footer,
|
|
14
14
|
r as requirementsCard,
|
|
15
|
-
|
|
15
|
+
u as requirementsList,
|
|
16
16
|
e as subtitle
|
|
17
17
|
};
|
|
18
18
|
//# sourceMappingURL=WireInstructions.module.scss.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as l } from "react";
|
|
3
|
+
import { OffCycleReasonSelectionPresentation as c } from "./OffCycleReasonSelectionPresentation.js";
|
|
4
|
+
import { OFF_CYCLE_REASON_DEFAULTS as f } from "./types.js";
|
|
5
|
+
import { BaseComponent as m } from "../../Base/Base.js";
|
|
6
|
+
import { useBase as i } from "../../Base/useBase.js";
|
|
7
|
+
import { useComponentDictionary as C, useI18n as R } from "../../../i18n/I18n.js";
|
|
8
|
+
import { componentEvents as p } from "../../../shared/constants.js";
|
|
9
|
+
function g(e) {
|
|
10
|
+
return /* @__PURE__ */ n(m, { ...e, children: /* @__PURE__ */ n(u, { ...e }) });
|
|
11
|
+
}
|
|
12
|
+
function u({ dictionary: e }) {
|
|
13
|
+
C("Payroll.OffCycleReasonSelection", e), R("Payroll.OffCycleReasonSelection");
|
|
14
|
+
const { onEvent: t } = i(), [r, s] = l(null);
|
|
15
|
+
return /* @__PURE__ */ n(
|
|
16
|
+
c,
|
|
17
|
+
{
|
|
18
|
+
selectedReason: r,
|
|
19
|
+
onReasonChange: (o) => {
|
|
20
|
+
s(o);
|
|
21
|
+
const a = f[o];
|
|
22
|
+
t(p.OFF_CYCLE_SELECT_REASON, {
|
|
23
|
+
reason: o,
|
|
24
|
+
defaults: a
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
g as OffCycleReasonSelection
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=OffCycleReasonSelection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OffCycleReasonSelection.js","sources":["../../../../src/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { OffCycleReasonSelectionPresentation } from './OffCycleReasonSelectionPresentation'\nimport {\n OFF_CYCLE_REASON_DEFAULTS,\n type OffCycleReason,\n type OffCycleReasonSelectionProps,\n} from './types'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\nexport function OffCycleReasonSelection(props: OffCycleReasonSelectionProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ dictionary }: OffCycleReasonSelectionProps) {\n useComponentDictionary('Payroll.OffCycleReasonSelection', dictionary)\n useI18n('Payroll.OffCycleReasonSelection')\n\n const { onEvent } = useBase()\n const [selectedReason, setSelectedReason] = useState<OffCycleReason | null>(null)\n\n const handleReasonChange = (reason: OffCycleReason) => {\n setSelectedReason(reason)\n const defaults = OFF_CYCLE_REASON_DEFAULTS[reason]\n onEvent(componentEvents.OFF_CYCLE_SELECT_REASON, {\n reason,\n defaults,\n })\n }\n\n return (\n <OffCycleReasonSelectionPresentation\n selectedReason={selectedReason}\n onReasonChange={handleReasonChange}\n />\n )\n}\n"],"names":["OffCycleReasonSelection","props","jsx","BaseComponent","Root","dictionary","useComponentDictionary","useI18n","onEvent","useBase","selectedReason","setSelectedReason","useState","OffCycleReasonSelectionPresentation","reason","defaults","OFF_CYCLE_REASON_DEFAULTS","componentEvents"],"mappings":";;;;;;;;AAYO,SAASA,EAAwBC,GAAqC;AAC3E,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,KAA4C;AAC1D,EAAAC,EAAuB,mCAAmCD,CAAU,GACpEE,EAAQ,iCAAiC;AAEzC,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACd,CAACC,GAAgBC,CAAiB,IAAIC,EAAgC,IAAI;AAWhF,SACE,gBAAAV;AAAA,IAACW;AAAA,IAAA;AAAA,MACC,gBAAAH;AAAA,MACA,gBAZuB,CAACI,MAA2B;AACrD,QAAAH,EAAkBG,CAAM;AACxB,cAAMC,IAAWC,EAA0BF,CAAM;AACjD,QAAAN,EAAQS,EAAgB,yBAAyB;AAAA,UAC/C,QAAAH;AAAA,UACA,UAAAC;AAAA,QAAA,CACD;AAAA,MACH;AAAA,IAKoB;AAAA,EAAA;AAGtB;"}
|
package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { OffCycleReason } from './types';
|
|
2
|
+
interface OffCycleReasonSelectionPresentationProps {
|
|
3
|
+
selectedReason: OffCycleReason | null;
|
|
4
|
+
onReasonChange: (reason: OffCycleReason) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function OffCycleReasonSelectionPresentation({ selectedReason, onReasonChange, }: OffCycleReasonSelectionPresentationProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|