@gusto/embedded-react-sdk 0.36.0 → 0.37.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 +58 -0
- package/README.md +6 -0
- package/dist/UNSTABLE_Hooks.d.ts +1 -1
- package/dist/UNSTABLE_Hooks.js +50 -6
- package/dist/UNSTABLE_Hooks.js.map +1 -1
- package/dist/components/Base/Base.d.ts +8 -9
- package/dist/components/Base/Base.js +123 -101
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/index.d.ts +1 -1
- package/dist/components/Base/useBase.d.ts +3 -7
- package/dist/components/Base/useBase.js.map +1 -1
- package/dist/components/Base/useBaseSubmit.d.ts +3 -5
- package/dist/components/Base/useBaseSubmit.js +27 -50
- package/dist/components/Base/useBaseSubmit.js.map +1 -1
- package/dist/components/Common/Fields/CheckboxField/CheckboxField.d.ts +2 -0
- package/dist/components/Common/Fields/CheckboxField/CheckboxField.js +17 -16
- package/dist/components/Common/Fields/CheckboxField/CheckboxField.js.map +1 -1
- package/dist/components/Common/Fields/DatePickerField/DatePickerField.d.ts +5 -3
- package/dist/components/Common/Fields/DatePickerField/DatePickerField.js +46 -36
- package/dist/components/Common/Fields/DatePickerField/DatePickerField.js.map +1 -1
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.d.ts +2 -0
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.js +21 -20
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.js.map +1 -1
- package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.d.ts +3 -1
- package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js +20 -19
- package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js.map +1 -1
- package/dist/components/Common/Fields/SelectField/SelectField.d.ts +3 -1
- package/dist/components/Common/Fields/SelectField/SelectField.js +19 -18
- package/dist/components/Common/Fields/SelectField/SelectField.js.map +1 -1
- package/dist/components/Common/Fields/SwitchField/SwitchField.d.ts +2 -0
- package/dist/components/Common/Fields/SwitchField/SwitchField.js +19 -18
- package/dist/components/Common/Fields/SwitchField/SwitchField.js.map +1 -1
- package/dist/components/Common/Fields/TextInputField/TextInputField.d.ts +2 -0
- package/dist/components/Common/Fields/TextInputField/TextInputField.js +10 -9
- package/dist/components/Common/Fields/TextInputField/TextInputField.js.map +1 -1
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +2 -2
- package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
- package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +8 -7
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +8 -7
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +10 -9
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +8 -7
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +8 -7
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +8 -7
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +13 -12
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +11 -10
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +8 -7
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +8 -7
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +8 -7
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +60 -60
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +10 -9
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +8 -7
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +8 -7
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +10 -9
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
- package/dist/components/Contractor/Profile/useContractorProfile.js +41 -38
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +7 -6
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +14 -13
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +7 -6
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +8 -7
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +8 -7
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +8 -7
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js +42 -42
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +8 -7
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +10 -9
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.d.ts +3 -3
- package/dist/components/Employee/Profile/HomeAddress.js +38 -36
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/Profile.js +30 -29
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +8 -7
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/StateTaxes.js +50 -50
- package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +8 -7
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.js +53 -53
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +8 -7
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.d.ts +11 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +123 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.d.ts +11 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +92 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.d.ts +2 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js +30 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.d.ts +23 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +72 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/index.d.ts +3 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.d.ts +7 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js +165 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.test.d.ts +1 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.d.ts +9 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js +86 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.d.ts +20 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +103 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationsData.d.ts +6 -0
- package/dist/components/Employee/Terminations/index.d.ts +8 -0
- package/dist/components/Employee/Terminations/types.d.ts +1 -0
- package/dist/components/Employee/index.d.ts +7 -0
- package/dist/components/Employee/index.js +34 -28
- package/dist/components/Employee/index.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +31 -31
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +41 -41
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalFlow.d.ts +2 -0
- package/dist/components/Payroll/Dismissal/DismissalFlow.js +32 -0
- package/dist/components/Payroll/Dismissal/DismissalFlow.js.map +1 -0
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.d.ts +16 -0
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js +52 -0
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js.map +1 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.d.ts +6 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js +69 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.d.ts +9 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +53 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/index.d.ts +3 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.d.ts +6 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.js +51 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.js.map +1 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.test.d.ts +1 -0
- package/dist/components/Payroll/Dismissal/index.d.ts +3 -0
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +18 -15
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlow.d.ts +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js +19 -18
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.d.ts +3 -0
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +32 -24
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +45 -45
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +75 -66
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.module.scss.js +8 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +0 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.module.scss.js +4 -4
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js +2 -2
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.d.ts +1 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js +1 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +186 -159
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +3 -3
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +69 -69
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.d.ts +3 -2
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js +8 -8
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +5 -3
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +76 -70
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +47 -42
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +4 -2
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +235 -196
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js +12 -0
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js.map +1 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +3 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js +21 -0
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js.map +1 -0
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +95 -64
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +53 -47
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +8 -8
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +25 -23
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +40 -32
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +2 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +110 -93
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +12 -8
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlow.d.ts +2 -0
- package/dist/components/Payroll/Transition/TransitionFlow.js +38 -0
- package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -0
- package/dist/components/Payroll/Transition/TransitionFlowComponents.d.ts +19 -0
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js +54 -0
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -0
- package/dist/components/Payroll/Transition/index.d.ts +3 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.d.ts +6 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.js +58 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.js.map +1 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.test.d.ts +1 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.d.ts +2 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js +92 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.d.ts +2 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +111 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.module.scss.js +8 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.d.ts +28 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js +21 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js.map +1 -0
- package/dist/components/Payroll/TransitionCreation/index.d.ts +3 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.d.ts +8 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +83 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +16 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js +100 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -0
- package/dist/components/Payroll/TransitionPayrollAlert/index.d.ts +2 -0
- package/dist/components/Payroll/helpers.d.ts +2 -1
- package/dist/components/Payroll/helpers.js +98 -87
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +6 -0
- package/dist/components/Payroll/index.js +32 -26
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/payrollTypes.d.ts +21 -0
- package/dist/components/Payroll/payrollTypes.js +27 -0
- package/dist/components/Payroll/payrollTypes.js.map +1 -0
- package/dist/components/Payroll/usePreparedPayrollData.js +4 -4
- package/dist/components/UNSTABLE_Hooks/collectErrors.d.ts +6 -0
- package/dist/components/UNSTABLE_Hooks/collectErrors.js +9 -0
- package/dist/components/UNSTABLE_Hooks/collectErrors.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.d.ts +8 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js +13 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.d.ts +10 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js +13 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.d.ts +23 -0
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js +24 -0
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.d.ts +26 -0
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.js +24 -0
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.d.ts +53 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js +34 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.test.d.ts +1 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.d.ts +3 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js +14 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.test.d.ts +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js +34 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js +29 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.d.ts +12 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js +40 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.d.ts +10 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js +40 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.d.ts +10 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js +40 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js +34 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.d.ts +11 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js +38 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/index.d.ts +15 -0
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.d.ts +2 -0
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.js +8 -0
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.d.ts +18 -0
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.js +10 -0
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.test.d.ts +1 -0
- package/dist/components/UNSTABLE_Hooks/form/index.d.ts +14 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.d.ts +6 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.js +14 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/types.d.ts +27 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.d.ts +2 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js +17 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.d.ts +4 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js +9 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/withOptions.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/form/withOptions.js +7 -0
- package/dist/components/UNSTABLE_Hooks/form/withOptions.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js +151 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.d.ts +97 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js +121 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.d.ts +34 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.js +50 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/index.d.ts +7 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.d.ts +104 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js +259 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js +114 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.d.ts +39 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js +45 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.d.ts +23 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.js +46 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/index.d.ts +7 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +77 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js +153 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js +71 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.d.ts +10 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.js +14 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/index.d.ts +7 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.d.ts +68 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js +129 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.d.ts +25 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js +24 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/index.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/types.d.ts +49 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.js +12 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.test.d.ts +1 -0
- package/dist/contexts/ApiProvider/ApiProvider.js +11 -11
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +43 -47
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/ObservabilityProvider/index.d.ts +1 -1
- package/dist/contexts/ObservabilityProvider/sanitization.d.ts +0 -14
- package/dist/contexts/ObservabilityProvider/sanitization.js +51 -51
- package/dist/contexts/ObservabilityProvider/sanitization.js.map +1 -1
- package/dist/contexts/ObservabilityProvider/useSanitizedObservability.d.ts +0 -3
- package/dist/contexts/ObservabilityProvider/useSanitizedObservability.js.map +1 -1
- package/dist/helpers/requiredIf.d.ts +13 -0
- package/dist/helpers/requiredIf.js +8 -0
- package/dist/helpers/requiredIf.js.map +1 -0
- package/dist/i18n/I18n.js +13 -13
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Employee.Terminations.TerminateEmployee.json.js +18 -0
- package/dist/i18n/en/Employee.Terminations.TerminateEmployee.json.js.map +1 -0
- package/dist/i18n/en/Employee.Terminations.TerminationFlow.json.js +12 -0
- package/dist/i18n/en/Employee.Terminations.TerminationFlow.json.js.map +1 -0
- package/dist/i18n/en/Employee.Terminations.TerminationSummary.json.js +20 -0
- package/dist/i18n/en/Employee.Terminations.TerminationSummary.json.js.map +1 -0
- package/dist/i18n/en/Payroll.Dismissal.json.js +22 -0
- package/dist/i18n/en/Payroll.Dismissal.json.js.map +1 -0
- package/dist/i18n/en/Payroll.OffCycleCreation.json.js +15 -11
- package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -1
- package/dist/i18n/en/Payroll.OffCyclePayPeriodDateForm.json.js +1 -1
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +20 -18
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollList.json.js +20 -18
- package/dist/i18n/en/Payroll.PayrollList.json.js.map +1 -1
- package/dist/i18n/en/Payroll.Transition.json.js +8 -0
- package/dist/i18n/en/Payroll.Transition.json.js.map +1 -0
- package/dist/i18n/en/Payroll.TransitionCreation.json.js +26 -0
- package/dist/i18n/en/Payroll.TransitionCreation.json.js.map +1 -0
- package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js +18 -0
- package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.CompensationForm.json.js +58 -0
- package/dist/i18n/en/UNSTABLE.CompensationForm.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js +34 -0
- package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js +24 -0
- package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js.map +1 -0
- package/dist/i18n/en/common.json.d.ts +2 -1
- package/dist/i18n/en/common.json.js +9 -9
- package/dist/index.d.ts +3 -2
- package/dist/index.js +14 -13
- package/dist/models/WA_RISK_CODES.d.ts +5 -2866
- package/dist/models/WA_RISK_CODES.js.map +1 -1
- package/dist/shared/constants.d.ts +32 -0
- package/dist/shared/constants.js +83 -65
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +279 -1
- package/dist/types/observability.d.ts +31 -65
- package/dist/types/sdkError.d.ts +97 -0
- package/dist/types/sdkError.js +95 -0
- package/dist/types/sdkError.js.map +1 -0
- package/dist/types/sdkError.test.d.ts +1 -0
- package/docs/reference/endpoint-inventory.json +212 -14
- package/package.json +16 -16
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.d.ts +0 -6
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js +0 -70
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.d.ts +0 -7
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js +0 -6
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.d.ts +0 -9
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js +0 -40
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/index.d.ts +0 -5
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.d.ts +0 -2
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js +0 -12
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/index.d.ts +0 -2
- package/dist/contexts/ObservabilityProvider/observabilityUtils.d.ts +0 -5
- package/dist/contexts/ObservabilityProvider/observabilityUtils.js +0 -45
- package/dist/contexts/ObservabilityProvider/observabilityUtils.js.map +0 -1
|
@@ -1,64 +1,72 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { useFormContext as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { OffCyclePayPeriodDateFormPresentation as
|
|
6
|
-
import { WAGE_TYPE_CATEGORIES as
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as A, useCallback as F } from "react";
|
|
3
|
+
import { useFormContext as G } from "react-hook-form";
|
|
4
|
+
import { useTranslation as r } from "react-i18next";
|
|
5
|
+
import { OffCyclePayPeriodDateFormPresentation as w } from "../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js";
|
|
6
|
+
import { WAGE_TYPE_CATEGORIES as W } from "../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js";
|
|
7
|
+
import a from "./OffCycleCreationPresentation.module.scss.js";
|
|
8
|
+
import { useI18n as c } from "../../../i18n/I18n.js";
|
|
9
|
+
import { useComponentContext as k } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
|
+
import { Flex as o } from "../../Common/Flex/Flex.js";
|
|
10
11
|
import "classnames";
|
|
11
12
|
import "../../../shared/constants.js";
|
|
12
|
-
import { RadioGroupField as
|
|
13
|
+
import { RadioGroupField as N } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
13
14
|
import { SwitchField as R } from "../../Common/Fields/SwitchField/SwitchField.js";
|
|
14
15
|
import { OffCycleReasonSelectionPresentation as j } from "../OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js";
|
|
15
16
|
import { MultiSelectComboBoxField as I } from "../../Common/Fields/MultiSelectComboBoxField/MultiSelectComboBoxField.js";
|
|
16
|
-
import { OffCycleTaxWithholdingTable as
|
|
17
|
-
import { OffCycleTaxWithholdingModal as
|
|
18
|
-
function
|
|
19
|
-
employees:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
onTaxWithholdingModalCancel: T
|
|
17
|
+
import { OffCycleTaxWithholdingTable as L } from "../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js";
|
|
18
|
+
import { OffCycleTaxWithholdingModal as M } from "../OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js";
|
|
19
|
+
function te({
|
|
20
|
+
employees: g,
|
|
21
|
+
isPending: d,
|
|
22
|
+
taxWithholdingConfig: u,
|
|
23
|
+
isTaxWithholdingModalOpen: C,
|
|
24
|
+
onTaxWithholdingEditClick: x,
|
|
25
|
+
onTaxWithholdingModalDone: T,
|
|
26
|
+
onTaxWithholdingModalCancel: b
|
|
27
27
|
}) {
|
|
28
|
-
|
|
29
|
-
const { t: i } =
|
|
30
|
-
() =>
|
|
31
|
-
const
|
|
32
|
-
category:
|
|
33
|
-
label:
|
|
28
|
+
c("Payroll.OffCycleCreation"), c("Payroll.OffCycleDeductionsSetting"), c("Payroll.EmployeeSelection"), c("Payroll.OffCycleTaxWithholding");
|
|
29
|
+
const { t: i } = r("Payroll.OffCycleCreation"), { t: n } = r("Payroll.OffCycleDeductionsSetting"), { t: s } = r("Payroll.EmployeeSelection"), { t: p } = r("Payroll.OffCycleTaxWithholding"), { Heading: m, Text: f, Button: D } = k(), P = A(
|
|
30
|
+
() => W.map((l) => {
|
|
31
|
+
const y = {
|
|
32
|
+
category: l,
|
|
33
|
+
label: p(`wageTypeGroups.${l}.label`)
|
|
34
34
|
};
|
|
35
|
-
return (
|
|
35
|
+
return (l === "regular" || l === "supplemental") && (y.description = p(`wageTypeGroups.${l}.description`)), y;
|
|
36
36
|
}),
|
|
37
|
-
[
|
|
38
|
-
), { setValue:
|
|
39
|
-
(
|
|
40
|
-
|
|
37
|
+
[p]
|
|
38
|
+
), { setValue: h, watch: E } = G(), O = E("includeAllEmployees"), S = F(
|
|
39
|
+
(l) => {
|
|
40
|
+
l && h("selectedEmployeeUuids", []);
|
|
41
41
|
},
|
|
42
|
-
[
|
|
43
|
-
),
|
|
42
|
+
[h]
|
|
43
|
+
), v = [
|
|
44
44
|
{
|
|
45
45
|
value: !1,
|
|
46
|
-
label:
|
|
46
|
+
label: n("options.include.label")
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
value: !0,
|
|
50
|
-
label:
|
|
50
|
+
label: n("options.skip.label")
|
|
51
51
|
}
|
|
52
52
|
];
|
|
53
|
-
return /* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */ e(
|
|
56
|
-
/* @__PURE__ */ e(
|
|
53
|
+
return /* @__PURE__ */ t(o, { flexDirection: "column", gap: 32, children: [
|
|
54
|
+
/* @__PURE__ */ t(o, { flexDirection: "column", gap: 4, children: [
|
|
55
|
+
/* @__PURE__ */ e(m, { as: "h2", children: i("pageTitle") }),
|
|
56
|
+
/* @__PURE__ */ e(f, { variant: "supporting", children: i("pageDescription") })
|
|
57
57
|
] }),
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
/* @__PURE__ */ t(o, { flexDirection: "column", gap: 20, children: [
|
|
59
|
+
/* @__PURE__ */ t(o, { flexDirection: "column", gap: 4, children: [
|
|
60
|
+
/* @__PURE__ */ e(m, { as: "h3", children: i("payPeriodSectionTitle") }),
|
|
61
|
+
/* @__PURE__ */ e(f, { variant: "supporting", children: i("payPeriodSectionDescription") })
|
|
62
|
+
] }),
|
|
63
|
+
/* @__PURE__ */ e(w, {})
|
|
64
|
+
] }),
|
|
65
|
+
/* @__PURE__ */ e("hr", { className: a.divider }),
|
|
66
|
+
/* @__PURE__ */ e(o, { flexDirection: "column", gap: 20, children: /* @__PURE__ */ e(j, { name: "reason" }) }),
|
|
67
|
+
/* @__PURE__ */ e("hr", { className: a.divider }),
|
|
68
|
+
/* @__PURE__ */ t(o, { flexDirection: "column", gap: 12, children: [
|
|
69
|
+
/* @__PURE__ */ e(m, { as: "h3", children: s("sectionTitle") }),
|
|
62
70
|
/* @__PURE__ */ e(
|
|
63
71
|
R,
|
|
64
72
|
{
|
|
@@ -67,49 +75,50 @@ function ie({
|
|
|
67
75
|
onChange: S
|
|
68
76
|
}
|
|
69
77
|
),
|
|
70
|
-
!
|
|
78
|
+
!O && /* @__PURE__ */ e(
|
|
71
79
|
I,
|
|
72
80
|
{
|
|
73
81
|
name: "selectedEmployeeUuids",
|
|
74
|
-
label:
|
|
82
|
+
label: s("sectionTitle"),
|
|
75
83
|
shouldVisuallyHideLabel: !0,
|
|
76
|
-
placeholder:
|
|
77
|
-
options:
|
|
78
|
-
isLoading: h
|
|
84
|
+
placeholder: s("searchPlaceholder"),
|
|
85
|
+
options: g
|
|
79
86
|
}
|
|
80
87
|
)
|
|
81
88
|
] }),
|
|
82
|
-
/* @__PURE__ */ e(
|
|
83
|
-
|
|
89
|
+
/* @__PURE__ */ e("hr", { className: a.divider }),
|
|
90
|
+
/* @__PURE__ */ e(o, { flexDirection: "column", gap: 20, children: /* @__PURE__ */ e(
|
|
91
|
+
N,
|
|
84
92
|
{
|
|
85
93
|
name: "skipRegularDeductions",
|
|
86
|
-
label:
|
|
87
|
-
description:
|
|
88
|
-
options:
|
|
89
|
-
convertValueToString: (
|
|
94
|
+
label: n("title"),
|
|
95
|
+
description: n("description"),
|
|
96
|
+
options: v,
|
|
97
|
+
convertValueToString: (l) => String(l)
|
|
90
98
|
}
|
|
91
99
|
) }),
|
|
100
|
+
/* @__PURE__ */ e("hr", { className: a.divider }),
|
|
92
101
|
/* @__PURE__ */ e(
|
|
93
|
-
|
|
102
|
+
L,
|
|
94
103
|
{
|
|
95
|
-
wageTypeGroups:
|
|
96
|
-
config:
|
|
97
|
-
onEditClick:
|
|
104
|
+
wageTypeGroups: P,
|
|
105
|
+
config: u,
|
|
106
|
+
onEditClick: x
|
|
98
107
|
}
|
|
99
108
|
),
|
|
100
|
-
|
|
101
|
-
|
|
109
|
+
C && /* @__PURE__ */ e(
|
|
110
|
+
M,
|
|
102
111
|
{
|
|
103
112
|
isOpen: !0,
|
|
104
|
-
defaultConfig:
|
|
105
|
-
onDone:
|
|
106
|
-
onCancel:
|
|
113
|
+
defaultConfig: u,
|
|
114
|
+
onDone: T,
|
|
115
|
+
onCancel: b
|
|
107
116
|
}
|
|
108
117
|
),
|
|
109
|
-
/* @__PURE__ */ e(
|
|
118
|
+
/* @__PURE__ */ e(o, { justifyContent: "flex-end", gap: 12, children: /* @__PURE__ */ e(D, { type: "submit", isLoading: d, isDisabled: d, children: i("continueCta") }) })
|
|
110
119
|
] });
|
|
111
120
|
}
|
|
112
121
|
export {
|
|
113
|
-
|
|
122
|
+
te as OffCycleCreationPresentation
|
|
114
123
|
};
|
|
115
124
|
//# sourceMappingURL=OffCycleCreationPresentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OffCycleCreationPresentation.js","sources":["../../../../src/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.tsx"],"sourcesContent":["import { useCallback, useMemo } from 'react'\nimport { useFormContext } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { OffCycleReasonSelectionPresentation } from '../OffCycleReasonSelection'\nimport { OffCyclePayPeriodDateFormPresentation } from '../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation'\nimport { OffCycleTaxWithholdingTable } from '../OffCycleTaxWithholdingTable'\nimport { OffCycleTaxWithholdingModal } from '../OffCycleTaxWithholdingModal'\nimport {\n WAGE_TYPE_CATEGORIES,\n type WageTypeGroup,\n} from '../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes'\nimport type {\n OffCycleCreationFormData,\n OffCycleCreationPresentationProps,\n} from './OffCycleCreationTypes'\nimport { useI18n } from '@/i18n'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex, RadioGroupField, SwitchField, MultiSelectComboBoxField } from '@/components/Common'\n\nexport function OffCycleCreationPresentation({\n employees,\n
|
|
1
|
+
{"version":3,"file":"OffCycleCreationPresentation.js","sources":["../../../../src/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.tsx"],"sourcesContent":["import { useCallback, useMemo } from 'react'\nimport { useFormContext } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { OffCycleReasonSelectionPresentation } from '../OffCycleReasonSelection'\nimport { OffCyclePayPeriodDateFormPresentation } from '../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation'\nimport { OffCycleTaxWithholdingTable } from '../OffCycleTaxWithholdingTable'\nimport { OffCycleTaxWithholdingModal } from '../OffCycleTaxWithholdingModal'\nimport {\n WAGE_TYPE_CATEGORIES,\n type WageTypeGroup,\n} from '../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes'\nimport type {\n OffCycleCreationFormData,\n OffCycleCreationPresentationProps,\n} from './OffCycleCreationTypes'\nimport styles from './OffCycleCreationPresentation.module.scss'\nimport { useI18n } from '@/i18n'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex, RadioGroupField, SwitchField, MultiSelectComboBoxField } from '@/components/Common'\n\nexport function OffCycleCreationPresentation({\n employees,\n isPending,\n taxWithholdingConfig,\n isTaxWithholdingModalOpen,\n onTaxWithholdingEditClick,\n onTaxWithholdingModalDone,\n onTaxWithholdingModalCancel,\n}: OffCycleCreationPresentationProps) {\n useI18n('Payroll.OffCycleCreation')\n useI18n('Payroll.OffCycleDeductionsSetting')\n useI18n('Payroll.EmployeeSelection')\n useI18n('Payroll.OffCycleTaxWithholding')\n const { t } = useTranslation('Payroll.OffCycleCreation')\n const { t: tDeductions } = useTranslation('Payroll.OffCycleDeductionsSetting')\n const { t: tEmployees } = useTranslation('Payroll.EmployeeSelection')\n const { t: tWithholding } = useTranslation('Payroll.OffCycleTaxWithholding')\n const { Heading, Text, Button } = useComponentContext()\n\n const wageTypeGroups: WageTypeGroup[] = useMemo(\n () =>\n WAGE_TYPE_CATEGORIES.map(category => {\n const group: WageTypeGroup = {\n category,\n label: tWithholding(`wageTypeGroups.${category}.label`),\n }\n if (category === 'regular' || category === 'supplemental') {\n group.description = tWithholding(`wageTypeGroups.${category}.description`)\n }\n return group\n }),\n [tWithholding],\n )\n\n const { setValue, watch } = useFormContext<OffCycleCreationFormData>()\n const includeAllEmployees = watch('includeAllEmployees')\n\n const handleToggleIncludeAll = useCallback(\n (checked: boolean) => {\n if (checked) {\n setValue('selectedEmployeeUuids', [])\n }\n },\n [setValue],\n )\n\n const deductionsOptions = [\n {\n value: false,\n label: tDeductions('options.include.label'),\n },\n {\n value: true,\n label: tDeductions('options.skip.label'),\n },\n ]\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Flex flexDirection=\"column\" gap={4}>\n <Heading as=\"h2\">{t('pageTitle')}</Heading>\n <Text variant=\"supporting\">{t('pageDescription')}</Text>\n </Flex>\n\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={4}>\n <Heading as=\"h3\">{t('payPeriodSectionTitle')}</Heading>\n <Text variant=\"supporting\">{t('payPeriodSectionDescription')}</Text>\n </Flex>\n <OffCyclePayPeriodDateFormPresentation />\n </Flex>\n\n <hr className={styles.divider} />\n\n <Flex flexDirection=\"column\" gap={20}>\n <OffCycleReasonSelectionPresentation name=\"reason\" />\n </Flex>\n\n <hr className={styles.divider} />\n\n <Flex flexDirection=\"column\" gap={12}>\n <Heading as=\"h3\">{tEmployees('sectionTitle')}</Heading>\n <SwitchField\n name=\"includeAllEmployees\"\n label={t('includeAllEmployeesLabel')}\n onChange={handleToggleIncludeAll}\n />\n {!includeAllEmployees && (\n <MultiSelectComboBoxField\n name=\"selectedEmployeeUuids\"\n label={tEmployees('sectionTitle')}\n shouldVisuallyHideLabel\n placeholder={tEmployees('searchPlaceholder')}\n options={employees}\n />\n )}\n </Flex>\n\n <hr className={styles.divider} />\n\n <Flex flexDirection=\"column\" gap={20}>\n <RadioGroupField<boolean>\n name=\"skipRegularDeductions\"\n label={tDeductions('title')}\n description={tDeductions('description')}\n options={deductionsOptions}\n convertValueToString={value => String(value)}\n />\n </Flex>\n\n <hr className={styles.divider} />\n\n <OffCycleTaxWithholdingTable\n wageTypeGroups={wageTypeGroups}\n config={taxWithholdingConfig}\n onEditClick={onTaxWithholdingEditClick}\n />\n {isTaxWithholdingModalOpen && (\n <OffCycleTaxWithholdingModal\n isOpen\n defaultConfig={taxWithholdingConfig}\n onDone={onTaxWithholdingModalDone}\n onCancel={onTaxWithholdingModalCancel}\n />\n )}\n\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button type=\"submit\" isLoading={isPending} isDisabled={isPending}>\n {t('continueCta')}\n </Button>\n </Flex>\n </Flex>\n )\n}\n"],"names":["OffCycleCreationPresentation","employees","isPending","taxWithholdingConfig","isTaxWithholdingModalOpen","onTaxWithholdingEditClick","onTaxWithholdingModalDone","onTaxWithholdingModalCancel","useI18n","t","useTranslation","tDeductions","tEmployees","tWithholding","Heading","Text","Button","useComponentContext","wageTypeGroups","useMemo","WAGE_TYPE_CATEGORIES","category","group","setValue","watch","useFormContext","includeAllEmployees","handleToggleIncludeAll","useCallback","checked","deductionsOptions","jsxs","Flex","jsx","OffCyclePayPeriodDateFormPresentation","styles","OffCycleReasonSelectionPresentation","SwitchField","MultiSelectComboBoxField","RadioGroupField","value","OffCycleTaxWithholdingTable","OffCycleTaxWithholdingModal"],"mappings":"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"}
|
package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.module.scss.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OffCycleCreationPresentation.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -15,7 +15,6 @@ export interface OffCycleCreationFormData extends OffCyclePayPeriodDateFormData
|
|
|
15
15
|
}
|
|
16
16
|
export interface OffCycleCreationPresentationProps {
|
|
17
17
|
employees: MultiSelectComboBoxOption[];
|
|
18
|
-
isLoadingEmployees: boolean;
|
|
19
18
|
isPending?: boolean;
|
|
20
19
|
taxWithholdingConfig: OffCycleTaxWithholdingConfig;
|
|
21
20
|
isTaxWithholdingModalOpen: boolean;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const e = "
|
|
1
|
+
const e = "_root_1g8u9_1", t = "_dateFields_1g8u9_7", o = "_checkDateField_1g8u9_16", c = {
|
|
2
2
|
root: e,
|
|
3
3
|
dateFields: t,
|
|
4
|
-
checkDateField:
|
|
4
|
+
checkDateField: o
|
|
5
5
|
};
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
o as checkDateField,
|
|
8
8
|
t as dateFields,
|
|
9
|
-
|
|
9
|
+
c as default,
|
|
10
10
|
e as root
|
|
11
11
|
};
|
|
12
12
|
//# sourceMappingURL=OffCyclePayPeriodDateFormPresentation.module.scss.js.map
|
|
@@ -31,14 +31,14 @@ const r = (t, c, i) => s.object({
|
|
|
31
31
|
path: ["checkDate"],
|
|
32
32
|
message: t("validations.checkDateRequired")
|
|
33
33
|
});
|
|
34
|
-
else
|
|
34
|
+
else {
|
|
35
35
|
const o = new Date(e.checkDate);
|
|
36
36
|
o.setHours(0, 0, 0, 0);
|
|
37
37
|
const d = new Date(i);
|
|
38
38
|
d.setHours(0, 0, 0, 0), o < d && a.addIssue({
|
|
39
39
|
code: s.ZodIssueCode.custom,
|
|
40
40
|
path: ["checkDate"],
|
|
41
|
-
message: t("validations.checkDateAchLeadTime")
|
|
41
|
+
message: e.isCheckOnly ? t("validations.checkDateNotPast") : t("validations.checkDateAchLeadTime")
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
});
|
package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OffCyclePayPeriodDateFormTypes.js","sources":["../../../../src/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.ts"],"sourcesContent":["import { z } from 'zod'\n\nexport type OffCyclePayrollDateType = 'bonus' | 'correction'\n\nexport interface OffCyclePayPeriodDateFormData {\n isCheckOnly: boolean\n startDate: Date | null\n endDate: Date | null\n checkDate: Date | null\n}\n\nexport const createOffCyclePayPeriodDateFormSchema = (\n t: (key: string) => string,\n payrollType: OffCyclePayrollDateType,\n minCheckDate: Date,\n) => {\n return z\n .object({\n isCheckOnly: z.boolean(),\n startDate: z.date().nullable(),\n endDate: z.date().nullable(),\n checkDate: z.date().nullable(),\n })\n .superRefine((data, ctx) => {\n if (!data.isCheckOnly) {\n if (!data.startDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['startDate'],\n message: t('validations.startDateRequired'),\n })\n }\n\n if (!data.endDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['endDate'],\n message: t('validations.endDateRequired'),\n })\n }\n\n if (data.startDate && data.endDate && data.endDate < data.startDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['endDate'],\n message: t('validations.endDateAfterStart'),\n })\n }\n\n if (payrollType === 'correction' && data.startDate) {\n const today = new Date()\n today.setHours(0, 0, 0, 0)\n if (data.startDate > today) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['startDate'],\n message: t('validations.startDateNotFuture'),\n })\n }\n }\n }\n\n if (!data.checkDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['checkDate'],\n message: t('validations.checkDateRequired'),\n })\n } else
|
|
1
|
+
{"version":3,"file":"OffCyclePayPeriodDateFormTypes.js","sources":["../../../../src/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.ts"],"sourcesContent":["import { z } from 'zod'\n\nexport type OffCyclePayrollDateType = 'bonus' | 'correction'\n\nexport interface OffCyclePayPeriodDateFormData {\n isCheckOnly: boolean\n startDate: Date | null\n endDate: Date | null\n checkDate: Date | null\n}\n\nexport const createOffCyclePayPeriodDateFormSchema = (\n t: (key: string) => string,\n payrollType: OffCyclePayrollDateType,\n minCheckDate: Date,\n) => {\n return z\n .object({\n isCheckOnly: z.boolean(),\n startDate: z.date().nullable(),\n endDate: z.date().nullable(),\n checkDate: z.date().nullable(),\n })\n .superRefine((data, ctx) => {\n if (!data.isCheckOnly) {\n if (!data.startDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['startDate'],\n message: t('validations.startDateRequired'),\n })\n }\n\n if (!data.endDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['endDate'],\n message: t('validations.endDateRequired'),\n })\n }\n\n if (data.startDate && data.endDate && data.endDate < data.startDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['endDate'],\n message: t('validations.endDateAfterStart'),\n })\n }\n\n if (payrollType === 'correction' && data.startDate) {\n const today = new Date()\n today.setHours(0, 0, 0, 0)\n if (data.startDate > today) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['startDate'],\n message: t('validations.startDateNotFuture'),\n })\n }\n }\n }\n\n if (!data.checkDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['checkDate'],\n message: t('validations.checkDateRequired'),\n })\n } else {\n const checkDateNormalized = new Date(data.checkDate)\n checkDateNormalized.setHours(0, 0, 0, 0)\n const minCheckDateNormalized = new Date(minCheckDate)\n minCheckDateNormalized.setHours(0, 0, 0, 0)\n\n if (checkDateNormalized < minCheckDateNormalized) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['checkDate'],\n message: data.isCheckOnly\n ? t('validations.checkDateNotPast')\n : t('validations.checkDateAchLeadTime'),\n })\n }\n }\n })\n}\n\nexport type OffCyclePayPeriodDateFormSchema = ReturnType<\n typeof createOffCyclePayPeriodDateFormSchema\n>\n"],"names":["createOffCyclePayPeriodDateFormSchema","payrollType","minCheckDate","z","data","ctx","today","checkDateNormalized","minCheckDateNormalized"],"mappings":";AAWO,MAAMA,IAAwC,CACnD,GACAC,GACAC,MAEOC,EACJ,OAAO;AAAA,EACN,aAAaA,EAAE,QAAA;AAAA,EACf,WAAWA,EAAE,KAAA,EAAO,SAAA;AAAA,EACpB,SAASA,EAAE,KAAA,EAAO,SAAA;AAAA,EAClB,WAAWA,EAAE,KAAA,EAAO,SAAA;AAAS,CAC9B,EACA,YAAY,CAACC,GAAMC,MAAQ;AAC1B,MAAI,CAACD,EAAK,gBACHA,EAAK,aACRC,EAAI,SAAS;AAAA,IACX,MAAMF,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,WAAW;AAAA,IAClB,SAAS,EAAE,+BAA+B;AAAA,EAAA,CAC3C,GAGEC,EAAK,WACRC,EAAI,SAAS;AAAA,IACX,MAAMF,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,SAAS;AAAA,IAChB,SAAS,EAAE,6BAA6B;AAAA,EAAA,CACzC,GAGCC,EAAK,aAAaA,EAAK,WAAWA,EAAK,UAAUA,EAAK,aACxDC,EAAI,SAAS;AAAA,IACX,MAAMF,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,SAAS;AAAA,IAChB,SAAS,EAAE,+BAA+B;AAAA,EAAA,CAC3C,GAGCF,MAAgB,gBAAgBG,EAAK,YAAW;AAClD,UAAME,wBAAY,KAAA;AAClB,IAAAA,EAAM,SAAS,GAAG,GAAG,GAAG,CAAC,GACrBF,EAAK,YAAYE,KACnBD,EAAI,SAAS;AAAA,MACX,MAAMF,EAAE,aAAa;AAAA,MACrB,MAAM,CAAC,WAAW;AAAA,MAClB,SAAS,EAAE,gCAAgC;AAAA,IAAA,CAC5C;AAAA,EAEL;AAGF,MAAI,CAACC,EAAK;AACR,IAAAC,EAAI,SAAS;AAAA,MACX,MAAMF,EAAE,aAAa;AAAA,MACrB,MAAM,CAAC,WAAW;AAAA,MAClB,SAAS,EAAE,+BAA+B;AAAA,IAAA,CAC3C;AAAA,OACI;AACL,UAAMI,IAAsB,IAAI,KAAKH,EAAK,SAAS;AACnD,IAAAG,EAAoB,SAAS,GAAG,GAAG,GAAG,CAAC;AACvC,UAAMC,IAAyB,IAAI,KAAKN,CAAY;AACpD,IAAAM,EAAuB,SAAS,GAAG,GAAG,GAAG,CAAC,GAEtCD,IAAsBC,KACxBH,EAAI,SAAS;AAAA,MACX,MAAMF,EAAE,aAAa;AAAA,MACrB,MAAM,CAAC,WAAW;AAAA,MAClB,SAASC,EAAK,cACV,EAAE,8BAA8B,IAChC,EAAE,kCAAkC;AAAA,IAAA,CACzC;AAAA,EAEL;AACF,CAAC;"}
|
package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOffCyclePayPeriodDateValidation.js","sources":["../../../../src/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { addBusinessDays } from '@/helpers/dateFormatting'\n\
|
|
1
|
+
{"version":3,"file":"useOffCyclePayPeriodDateValidation.js","sources":["../../../../src/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { addBusinessDays } from '@/helpers/dateFormatting'\n\nexport const ACH_LEAD_TIME_BUSINESS_DAYS = 2\n\nexport function useOffCyclePayPeriodDateValidation() {\n const today = useMemo(() => {\n const now = new Date()\n now.setHours(0, 0, 0, 0)\n return now\n }, [])\n\n const minCheckDate = useMemo(() => {\n return addBusinessDays(today, ACH_LEAD_TIME_BUSINESS_DAYS)\n }, [today])\n\n return {\n today,\n minCheckDate,\n achLeadTimeBusinessDays: ACH_LEAD_TIME_BUSINESS_DAYS,\n }\n}\n"],"names":["ACH_LEAD_TIME_BUSINESS_DAYS","useOffCyclePayPeriodDateValidation","today","useMemo","now","minCheckDate","addBusinessDays"],"mappings":";;AAGO,MAAMA,IAA8B;AAEpC,SAASC,IAAqC;AACnD,QAAMC,IAAQC,EAAQ,MAAM;AAC1B,UAAMC,wBAAU,KAAA;AAChB,WAAAA,EAAI,SAAS,GAAG,GAAG,GAAG,CAAC,GAChBA;AAAA,EACT,GAAG,CAAA,CAAE,GAECC,IAAeF,EAAQ,MACpBG,EAAgBJ,GAAOF,CAA2B,GACxD,CAACE,CAAK,CAAC;AAEV,SAAO;AAAA,IACL,OAAAA;AAAA,IACA,cAAAG;AAAA,IACA,yBAAyBL;AAAA,EAAA;AAE7B;"}
|