@gusto/embedded-react-sdk 0.57.3 → 0.58.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 +88 -0
- package/dist/components/Common/DataView/DataCards/DataCards.js +98 -66
- package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js +11 -9
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js.map +1 -1
- package/dist/components/Common/DataView/DataTable/DataTable.js +86 -75
- package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
- package/dist/components/Common/DataView/DataView.js.map +1 -1
- package/dist/components/Common/DataView/getSortControls.js +22 -0
- package/dist/components/Common/DataView/getSortControls.js.map +1 -0
- package/dist/components/Common/DataView/useDataView.js +30 -24
- package/dist/components/Common/DataView/useDataView.js.map +1 -1
- package/dist/components/Common/UI/Table/Table.js +65 -25
- package/dist/components/Common/UI/Table/Table.js.map +1 -1
- package/dist/components/Common/UI/Table/Table.module.scss.js +8 -4
- package/dist/components/Common/UI/Table/Table.module.scss.js.map +1 -1
- package/dist/components/Common/UI/Table/TableTypes.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +5 -6
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +6 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +3 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +30 -45
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleComponents.js +11 -12
- package/dist/components/Company/PaySchedule/PayScheduleComponents.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js +78 -83
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +3 -4
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
- package/dist/components/Contractor/Compensation/management/CompensationEditForm.js +45 -54
- package/dist/components/Contractor/Compensation/management/CompensationEditForm.js.map +1 -1
- package/dist/components/Contractor/Compensation/shared/useContractorPayForm/contractorPaySchema.js +17 -22
- package/dist/components/Contractor/Compensation/shared/useContractorPayForm/contractorPaySchema.js.map +1 -1
- package/dist/components/Contractor/ContractorList/management/ManagementContractorList.js +1 -0
- package/dist/components/Contractor/ContractorList/management/ManagementContractorList.js.map +1 -1
- package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js +122 -113
- package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js.map +1 -1
- package/dist/components/Contractor/ContractorList/shared/useContractorList.js +63 -54
- package/dist/components/Contractor/ContractorList/shared/useContractorList.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/onboarding/PaymentMethod.js +39 -48
- package/dist/components/Contractor/PaymentMethod/onboarding/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/Profile/onboarding/ContractorProfile.js +76 -69
- package/dist/components/Contractor/Profile/onboarding/ContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.js +27 -29
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.js.map +1 -1
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.js +14 -12
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.js.map +1 -1
- package/dist/components/Contractor/shared/hourlyRate.js +14 -0
- package/dist/components/Contractor/shared/hourlyRate.js.map +1 -0
- package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.js +63 -63
- package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.js +65 -74
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js +16 -16
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +2 -3
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +84 -82
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/getDefaultWithholdingPayPeriod.js +8 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/getDefaultWithholdingPayPeriod.js.map +1 -0
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +91 -88
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +16 -16
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +146 -134
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.module.scss.js +14 -12
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +34 -33
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/fields.js +49 -48
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/fields.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +0 -4
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +51 -38
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +121 -102
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +79 -74
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +92 -83
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +23 -27
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/PrintChecks/PrintChecksForm/PrintChecksForm.js +82 -75
- package/dist/components/Payroll/PrintChecks/PrintChecksForm/PrintChecksForm.js.map +1 -1
- package/dist/components/Payroll/RropPayrollEditEmployee/RropPayrollEditEmployee.js +416 -0
- package/dist/components/Payroll/RropPayrollEditEmployee/RropPayrollEditEmployee.js.map +1 -0
- package/dist/components/Payroll/{UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.module.scss.js → RropPayrollEditEmployee/RropPayrollEditEmployee.module.scss.js} +1 -1
- package/dist/components/Payroll/RropPayrollEditEmployee/RropPayrollEditEmployee.module.scss.js.map +1 -0
- package/dist/components/Payroll/TransitionConfiguration/TransitionConfiguration.js +97 -0
- package/dist/components/Payroll/TransitionConfiguration/TransitionConfiguration.js.map +1 -0
- package/dist/components/Payroll/TransitionConfiguration/TransitionConfigurationPresentation.js +106 -0
- package/dist/components/Payroll/TransitionConfiguration/TransitionConfigurationPresentation.js.map +1 -0
- package/dist/components/Payroll/{TransitionCreation/TransitionCreationPresentation.module.scss.js → TransitionConfiguration/TransitionConfigurationPresentation.module.scss.js} +1 -1
- package/dist/components/Payroll/TransitionConfiguration/TransitionConfigurationPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/TransitionConfiguration/TransitionConfigurationTypes.js +10 -0
- package/dist/components/Payroll/TransitionConfiguration/TransitionConfigurationTypes.js.map +1 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +86 -64
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js +126 -77
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.module.scss.js +8 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/index.js +16 -20
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +2 -3
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/Payroll/useUnprocessedTransitionPayPeriods.js +11 -14
- package/dist/components/Payroll/useUnprocessedTransitionPayPeriods.js.map +1 -1
- package/dist/contexts/ApiProvider/ApiProvider.js +18 -17
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
- package/dist/contexts/ApiProvider/payScheduleCustomNameHook.js +31 -0
- package/dist/contexts/ApiProvider/payScheduleCustomNameHook.js.map +1 -0
- package/dist/contexts/FeaturesProvider/FeaturesProvider.js +14 -0
- package/dist/contexts/FeaturesProvider/FeaturesProvider.js.map +1 -0
- package/dist/contexts/FeaturesProvider/useFeature.js +7 -0
- package/dist/contexts/FeaturesProvider/useFeature.js.map +1 -0
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +32 -30
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/UnstableFeaturesProvider/useUnstableFeature.js.map +1 -1
- package/dist/i18n/I18n.js +2 -3
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Contractor.Profile.json.js +1 -1
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +29 -23
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollLanding.json.js +1 -1
- package/dist/i18n/en/{Payroll.UNSTABLE_PayrollEditEmployee.json.js → Payroll.RropPayrollEditEmployee.json.js} +42 -38
- package/dist/i18n/en/Payroll.RropPayrollEditEmployee.json.js.map +1 -0
- package/dist/i18n/en/Payroll.TransitionConfiguration.json.js +28 -0
- package/dist/i18n/en/Payroll.TransitionConfiguration.json.js.map +1 -0
- package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js +16 -12
- package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js.map +1 -1
- package/dist/i18n/en/common.json.js +1 -1
- package/dist/package.json.js +1 -1
- package/dist/partner-hook-utils/form/composeSubmitHandler.js +55 -48
- package/dist/partner-hook-utils/form/composeSubmitHandler.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js +31 -29
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -1
- package/dist/shared/constants.js +2 -1
- package/dist/shared/constants.js.map +1 -1
- package/dist/src/components/Common/DataView/DataCards/DataCards.d.ts +3 -1
- package/dist/src/components/Common/DataView/DataTable/DataTable.d.ts +3 -1
- package/dist/src/components/Common/DataView/DataView.d.ts +2 -0
- package/dist/src/components/Common/DataView/getSortControls.d.ts +24 -0
- package/dist/src/components/Common/DataView/useDataView.d.ts +22 -1
- package/dist/src/components/Common/UI/Table/TableTypes.d.ts +71 -2
- package/dist/src/components/Company/PaySchedule/PaySchedule.d.ts +1 -9
- package/dist/src/components/Company/PaySchedule/PayScheduleComponents.d.ts +0 -1
- package/dist/src/components/Company/PaySchedule/shared/usePayScheduleForm/fields.d.ts +1 -1
- package/dist/src/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.d.ts +1 -1
- package/dist/src/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.d.ts +3 -14
- package/dist/src/components/Contractor/ContractorList/management/ManagementContractorListView.d.ts +2 -2
- package/dist/src/components/Contractor/ContractorList/shared/index.d.ts +1 -1
- package/dist/src/components/Contractor/ContractorList/shared/useContractorList.d.ts +38 -0
- package/dist/src/components/Contractor/shared/hourlyRate.d.ts +23 -0
- package/dist/src/components/Payroll/OffCycleTaxWithholdingTable/getDefaultWithholdingPayPeriod.d.ts +9 -0
- package/dist/src/components/Payroll/PayrollEditEmployee/TimeOffField.d.ts +3 -1
- package/dist/src/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/fields.d.ts +2 -0
- package/dist/src/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.d.ts +8 -6
- package/dist/src/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.d.ts +0 -8
- package/dist/src/components/Payroll/PayrollFlow/PayrollFlow.d.ts +5 -3
- package/dist/src/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +2 -3
- package/dist/src/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollLanding/PayrollLanding.d.ts +18 -5
- package/dist/src/components/Payroll/PayrollList/PayrollList.d.ts +11 -5
- package/dist/src/components/Payroll/{UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.d.ts → RropPayrollEditEmployee/RropPayrollEditEmployee.d.ts} +9 -5
- package/dist/src/components/Payroll/TransitionConfiguration/TransitionConfiguration.d.ts +55 -0
- package/dist/src/components/Payroll/TransitionConfiguration/TransitionConfigurationPresentation.d.ts +9 -0
- package/dist/src/components/Payroll/TransitionConfiguration/TransitionConfigurationTypes.d.ts +52 -0
- package/dist/src/components/Payroll/TransitionConfiguration/index.d.ts +2 -0
- package/dist/src/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +5 -2
- package/dist/src/components/Payroll/index.d.ts +2 -6
- package/dist/src/contexts/ApiProvider/payScheduleCustomNameHook.d.ts +14 -0
- package/dist/src/contexts/ApiProvider/payScheduleCustomNameHook.test.d.ts +1 -0
- package/dist/src/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -1
- package/dist/src/contexts/FeaturesProvider/FeaturesProvider.d.ts +21 -0
- package/dist/src/contexts/FeaturesProvider/useFeature.d.ts +53 -0
- package/dist/src/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +3 -0
- package/dist/src/contexts/UnstableFeaturesProvider/useUnstableFeature.d.ts +38 -10
- package/dist/src/contexts/index.d.ts +1 -0
- package/dist/src/i18n/en/common.json.d.ts +5 -1
- package/dist/src/i18n/types.d.ts +113 -66
- package/dist/src/partner-hook-utils/form/fields/RadioGroupHookField.d.ts +9 -7
- package/dist/src/shared/constants.d.ts +4 -2
- package/dist/src/test-utils/renderWithProviders.d.ts +2 -0
- package/dist/style.css +1 -1
- package/docs/guides/endpoint-inventory.json +24 -27
- package/package.json +15 -14
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js +0 -29
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js.map +0 -1
- package/dist/components/Payroll/Transition/TransitionFlow.js +0 -60
- package/dist/components/Payroll/Transition/TransitionFlow.js.map +0 -1
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js +0 -31
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +0 -1
- package/dist/components/Payroll/Transition/transitionStateMachine.js +0 -49
- package/dist/components/Payroll/Transition/transitionStateMachine.js.map +0 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js +0 -100
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +0 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +0 -110
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +0 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.module.scss.js.map +0 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js +0 -21
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js.map +0 -1
- package/dist/components/Payroll/TransitionPayroll/TransitionPayroll.js +0 -48
- package/dist/components/Payroll/TransitionPayroll/TransitionPayroll.js.map +0 -1
- package/dist/components/Payroll/TransitionPayroll/TransitionPayrollComponents.js +0 -35
- package/dist/components/Payroll/TransitionPayroll/TransitionPayrollComponents.js.map +0 -1
- package/dist/components/Payroll/TransitionPayroll/transitionPayrollStateMachine.js +0 -23
- package/dist/components/Payroll/TransitionPayroll/transitionPayrollStateMachine.js.map +0 -1
- package/dist/components/Payroll/TransitionPayroll/useResolveTransitionPayroll.js +0 -29
- package/dist/components/Payroll/TransitionPayroll/useResolveTransitionPayroll.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.js +0 -411
- package/dist/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.module.scss.js.map +0 -1
- package/dist/i18n/en/Payroll.Transition.json.js +0 -8
- package/dist/i18n/en/Payroll.Transition.json.js.map +0 -1
- package/dist/i18n/en/Payroll.TransitionCreation.json.js +0 -26
- package/dist/i18n/en/Payroll.TransitionCreation.json.js.map +0 -1
- package/dist/i18n/en/Payroll.UNSTABLE_PayrollEditEmployee.json.js.map +0 -1
- package/dist/src/components/Payroll/PayrollFlow/TransitionFlowContextual.d.ts +0 -7
- package/dist/src/components/Payroll/Transition/TransitionFlow.d.ts +0 -55
- package/dist/src/components/Payroll/Transition/TransitionFlowComponents.d.ts +0 -52
- package/dist/src/components/Payroll/Transition/index.d.ts +0 -2
- package/dist/src/components/Payroll/Transition/transitionStateMachine.d.ts +0 -29
- package/dist/src/components/Payroll/TransitionCreation/TransitionCreation.d.ts +0 -22
- package/dist/src/components/Payroll/TransitionCreation/TransitionCreationPresentation.d.ts +0 -9
- package/dist/src/components/Payroll/TransitionCreation/TransitionCreationTypes.d.ts +0 -57
- package/dist/src/components/Payroll/TransitionCreation/index.d.ts +0 -2
- package/dist/src/components/Payroll/TransitionPayroll/TransitionPayroll.d.ts +0 -55
- package/dist/src/components/Payroll/TransitionPayroll/TransitionPayrollComponents.d.ts +0 -24
- package/dist/src/components/Payroll/TransitionPayroll/TransitionPayrollTypes.d.ts +0 -23
- package/dist/src/components/Payroll/TransitionPayroll/index.d.ts +0 -2
- package/dist/src/components/Payroll/TransitionPayroll/transitionPayrollStateMachine.d.ts +0 -15
- package/dist/src/components/Payroll/TransitionPayroll/useResolveTransitionPayroll.d.ts +0 -28
- /package/dist/src/components/{Payroll/Transition/transitionStateMachine.test.d.ts → Common/DataView/getSortControls.test.d.ts} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransitionCreationPresentation.js","sources":["../../../../src/components/Payroll/TransitionCreation/TransitionCreationPresentation.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { OffCycleTaxWithholdingTable } from '../OffCycleTaxWithholdingTable'\nimport { OffCycleTaxWithholdingModal } from '../OffCycleTaxWithholdingModal'\nimport {\n WAGE_TYPE_CATEGORIES,\n type WageTypeGroup,\n} from '../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes'\nimport type { TransitionCreationPresentationProps } from './TransitionCreationTypes'\nimport styles from './TransitionCreationPresentation.module.scss'\nimport { useI18n } from '@/i18n'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex, DatePickerField, RadioGroupField } from '@/components/Common'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\n/**\n * Presentational layout for the transition payroll creation form.\n *\n * @param props - {@link TransitionCreationPresentationProps}.\n * @returns The transition payroll creation form layout.\n * @internal\n */\nexport function TransitionCreationPresentation({\n className,\n startDate,\n endDate,\n payScheduleName,\n isPending,\n taxWithholdingConfig,\n isTaxWithholdingModalOpen,\n onTaxWithholdingEditClick,\n onTaxWithholdingModalDone,\n onTaxWithholdingModalCancel,\n}: TransitionCreationPresentationProps) {\n useI18n('Payroll.TransitionCreation')\n useI18n('Payroll.OffCycleDeductionsSetting')\n useI18n('Payroll.OffCycleTaxWithholding')\n const { t } = useTranslation('Payroll.TransitionCreation')\n const { t: tDeductions } = useTranslation('Payroll.OffCycleDeductionsSetting')\n const { t: tWithholding } = useTranslation('Payroll.OffCycleTaxWithholding')\n const { Heading, Text, Alert, Button } = useComponentContext()\n const dateFormatter = useDateFormatter()\n\n const formattedStartDate = dateFormatter.formatShortWithYear(startDate)\n const formattedEndDate = dateFormatter.formatShortWithYear(endDate)\n\n const deductionsOptions = useMemo(\n () => [\n {\n value: false,\n label: tDeductions('options.include.label'),\n },\n {\n value: true,\n label: tDeductions('options.skip.label'),\n },\n ],\n [tDeductions],\n )\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 return (\n <Flex className={className} 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 <Alert status=\"info\" label={t('transitionExplanation')} />\n\n <hr className={styles.divider} />\n\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h3\">{t('detailsHeading')}</Heading>\n\n <Flex flexDirection=\"column\" gap={8}>\n <Flex justifyContent=\"space-between\">\n <Text weight=\"bold\">{t('payPeriodLabel')}</Text>\n <Text>\n {formattedStartDate} - {formattedEndDate}\n </Text>\n </Flex>\n\n {payScheduleName && (\n <Flex justifyContent=\"space-between\">\n <Text weight=\"bold\">{t('payScheduleLabel')}</Text>\n <Text>{payScheduleName}</Text>\n </Flex>\n )}\n </Flex>\n </Flex>\n\n <hr className={styles.divider} />\n\n <Flex flexDirection=\"column\" gap={20}>\n <DatePickerField name=\"checkDate\" label={t('checkDateLabel')} isRequired />\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":["TransitionCreationPresentation","className","startDate","endDate","payScheduleName","isPending","taxWithholdingConfig","isTaxWithholdingModalOpen","onTaxWithholdingEditClick","onTaxWithholdingModalDone","onTaxWithholdingModalCancel","useI18n","t","useTranslation","tDeductions","tWithholding","Heading","Text","Alert","Button","useComponentContext","dateFormatter","useDateFormatter","formattedStartDate","formattedEndDate","deductionsOptions","useMemo","wageTypeGroups","WAGE_TYPE_CATEGORIES","category","group","Flex","jsxs","jsx","styles","DatePickerField","RadioGroupField","value","OffCycleTaxWithholdingTable","OffCycleTaxWithholdingModal"],"mappings":";;;;;;;;;;;;;AAsBO,SAASA,EAA+B;AAAA,EAC7C,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,6BAAAC;AACF,GAAwC;AACtC,EAAAC,EAAQ,4BAA4B,GACpCA,EAAQ,mCAAmC,GAC3CA,EAAQ,gCAAgC;AACxC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,4BAA4B,GACnD,EAAE,GAAGC,MAAgBD,EAAe,mCAAmC,GACvE,EAAE,GAAGE,MAAiBF,EAAe,gCAAgC,GACrE,EAAE,SAAAG,GAAS,MAAAC,GAAM,OAAAC,GAAO,QAAAC,EAAA,IAAWC,EAAA,GACnCC,IAAgBC,EAAA,GAEhBC,IAAqBF,EAAc,oBAAoBnB,CAAS,GAChEsB,IAAmBH,EAAc,oBAAoBlB,CAAO,GAE5DsB,IAAoBC;AAAA,IACxB,MAAM;AAAA,MACJ;AAAA,QACE,OAAO;AAAA,QACP,OAAOZ,EAAY,uBAAuB;AAAA,MAAA;AAAA,MAE5C;AAAA,QACE,OAAO;AAAA,QACP,OAAOA,EAAY,oBAAoB;AAAA,MAAA;AAAA,IACzC;AAAA,IAEF,CAACA,CAAW;AAAA,EAAA,GAGRa,IAAkCD;AAAA,IACtC,MACEE,EAAqB,IAAI,CAAAC,MAAY;AACnC,YAAMC,IAAuB;AAAA,QAC3B,UAAAD;AAAA,QACA,OAAOd,EAAa,kBAAkBc,CAAQ,QAAQ;AAAA,MAAA;AAExD,cAAIA,MAAa,aAAaA,MAAa,oBACzCC,EAAM,cAAcf,EAAa,kBAAkBc,CAAQ,cAAc,IAEpEC;AAAA,IACT,CAAC;AAAA,IACH,CAACf,CAAY;AAAA,EAAA;AAGf,2BACGgB,GAAA,EAAK,WAAA9B,GAAsB,eAAc,UAAS,KAAK,IACtD,UAAA;AAAA,IAAA,gBAAA+B,EAACD,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAAE,EAACjB,GAAA,EAAQ,IAAG,MAAM,UAAAJ,EAAE,WAAW,GAAE;AAAA,wBAChCK,GAAA,EAAK,SAAQ,cAAc,UAAAL,EAAE,iBAAiB,EAAA,CAAE;AAAA,IAAA,GACnD;AAAA,sBAECM,GAAA,EAAM,QAAO,QAAO,OAAON,EAAE,uBAAuB,GAAG;AAAA,IAExD,gBAAAqB,EAAC,MAAA,EAAG,WAAWC,EAAO,QAAA,CAAS;AAAA,IAE/B,gBAAAF,EAACD,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,MAAA,gBAAAE,EAACjB,GAAA,EAAQ,IAAG,MAAM,UAAAJ,EAAE,gBAAgB,GAAE;AAAA,MAEtC,gBAAAoB,EAACD,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,QAAA,gBAAAC,EAACD,GAAA,EAAK,gBAAe,iBACnB,UAAA;AAAA,UAAA,gBAAAE,EAAChB,GAAA,EAAK,QAAO,QAAQ,UAAAL,EAAE,gBAAgB,GAAE;AAAA,4BACxCK,GAAA,EACE,UAAA;AAAA,YAAAM;AAAA,YAAmB;AAAA,YAAIC;AAAA,UAAA,EAAA,CAC1B;AAAA,QAAA,GACF;AAAA,QAECpB,KACC,gBAAA4B,EAACD,GAAA,EAAK,gBAAe,iBACnB,UAAA;AAAA,UAAA,gBAAAE,EAAChB,GAAA,EAAK,QAAO,QAAQ,UAAAL,EAAE,kBAAkB,GAAE;AAAA,UAC3C,gBAAAqB,EAAChB,KAAM,UAAAb,EAAA,CAAgB;AAAA,QAAA,EAAA,CACzB;AAAA,MAAA,EAAA,CAEJ;AAAA,IAAA,GACF;AAAA,IAEA,gBAAA6B,EAAC,MAAA,EAAG,WAAWC,EAAO,QAAA,CAAS;AAAA,sBAE9BH,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAE,EAACE,GAAA,EAAgB,MAAK,aAAY,OAAOvB,EAAE,gBAAgB,GAAG,YAAU,IAAC,GAC3E;AAAA,IAEA,gBAAAqB,EAAC,MAAA,EAAG,WAAWC,EAAO,QAAA,CAAS;AAAA,IAE/B,gBAAAD,EAACF,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAE;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOtB,EAAY,OAAO;AAAA,QAC1B,aAAaA,EAAY,aAAa;AAAA,QACtC,SAASW;AAAA,QACT,sBAAsB,CAAAY,MAAS,OAAOA,CAAK;AAAA,MAAA;AAAA,IAAA,GAE/C;AAAA,IAEA,gBAAAJ,EAAC,MAAA,EAAG,WAAWC,EAAO,QAAA,CAAS;AAAA,IAE/B,gBAAAD;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,gBAAAX;AAAA,QACA,QAAQrB;AAAA,QACR,aAAaE;AAAA,MAAA;AAAA,IAAA;AAAA,IAEdD,KACC,gBAAA0B;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,QAAM;AAAA,QACN,eAAejC;AAAA,QACf,QAAQG;AAAA,QACR,UAAUC;AAAA,MAAA;AAAA,IAAA;AAAA,sBAIbqB,GAAA,EAAK,gBAAe,YAAW,KAAK,IACnC,UAAA,gBAAAE,EAACd,GAAA,EAAO,MAAK,UAAS,WAAWd,GAAW,YAAYA,GACrD,UAAAO,EAAE,aAAa,GAClB,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.module.scss.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransitionCreationPresentation.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { z as r } from "zod";
|
|
2
|
-
function i(n, a, c) {
|
|
3
|
-
return r.object({
|
|
4
|
-
checkDate: r.date().nullable().refine((e) => e !== null, {
|
|
5
|
-
message: n("errors.checkDateRequired")
|
|
6
|
-
}).refine(
|
|
7
|
-
(e) => {
|
|
8
|
-
const t = new Date(e);
|
|
9
|
-
t.setHours(0, 0, 0, 0);
|
|
10
|
-
const o = new Date(a);
|
|
11
|
-
return o.setHours(0, 0, 0, 0), t >= o;
|
|
12
|
-
},
|
|
13
|
-
{ message: n("errors.checkDateAchLeadTime", { count: c ?? 2 }) }
|
|
14
|
-
),
|
|
15
|
-
skipRegularDeductions: r.boolean()
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
export {
|
|
19
|
-
i as createTransitionCreationSchema
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=TransitionCreationTypes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransitionCreationTypes.js","sources":["../../../../src/components/Payroll/TransitionCreation/TransitionCreationTypes.ts"],"sourcesContent":["import { z } from 'zod'\nimport type { OffCycleTaxWithholdingConfig } from '../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\n\n/**\n * Props for the {@link TransitionCreation} component.\n *\n * @public\n */\nexport interface TransitionCreationProps extends BaseComponentInterface<'Payroll.TransitionCreation'> {\n /** The associated company identifier. */\n companyId: string\n /** The start date of the transition pay period (YYYY-MM-DD). */\n startDate: string\n /** The end date of the transition pay period (YYYY-MM-DD). */\n endDate: string\n /** The UUID of the pay schedule this transition is associated with. */\n payScheduleUuid: string\n}\n\n/**\n * Form values collected by the {@link TransitionCreation} component.\n *\n * @public\n */\nexport interface TransitionCreationFormData {\n /** The date employees will be paid. Must be at least the company's ACH lead time from today. */\n checkDate: Date | null\n /** When `true`, regular deductions are skipped for this payroll. */\n skipRegularDeductions: boolean\n}\n\n/** @internal */\nexport function createTransitionCreationSchema(\n t: (key: string, options?: Record<string, unknown>) => string,\n minCheckDate: Date,\n paymentSpeedDays?: number,\n) {\n return z.object({\n checkDate: z\n .date()\n .nullable()\n .refine((val): val is Date => val !== null, {\n message: t('errors.checkDateRequired'),\n })\n .refine(\n val => {\n const normalized = new Date(val)\n normalized.setHours(0, 0, 0, 0)\n const min = new Date(minCheckDate)\n min.setHours(0, 0, 0, 0)\n return normalized >= min\n },\n { message: t('errors.checkDateAchLeadTime', { count: paymentSpeedDays ?? 2 }) },\n ),\n skipRegularDeductions: z.boolean(),\n })\n}\n\n/** @internal */\nexport interface TransitionCreationPresentationProps {\n /** CSS class name applied to the component's root element. */\n className?: string\n /** The start date of the transition pay period (YYYY-MM-DD). */\n startDate: string\n /** The end date of the transition pay period (YYYY-MM-DD). */\n endDate: string\n /** Display name of the associated pay schedule, or `null` when none is available. */\n payScheduleName: string | null\n /** Whether the create off-cycle mutation is in flight. */\n isPending?: boolean\n /** Current tax withholding configuration shown in the table. */\n taxWithholdingConfig: OffCycleTaxWithholdingConfig\n /** Whether the tax withholding edit modal is open. */\n isTaxWithholdingModalOpen: boolean\n /** Fires when the user clicks the edit affordance on the tax withholding table. */\n onTaxWithholdingEditClick: () => void\n /** Fires when the user confirms a new tax withholding configuration in the modal. */\n onTaxWithholdingModalDone: (config: OffCycleTaxWithholdingConfig) => void\n /** Fires when the user dismisses the tax withholding modal without saving. */\n onTaxWithholdingModalCancel: () => void\n}\n"],"names":["createTransitionCreationSchema","t","minCheckDate","paymentSpeedDays","z","val","normalized","min"],"mappings":";AAiCO,SAASA,EACdC,GACAC,GACAC,GACA;AACA,SAAOC,EAAE,OAAO;AAAA,IACd,WAAWA,EACR,KAAA,EACA,SAAA,EACA,OAAO,CAACC,MAAqBA,MAAQ,MAAM;AAAA,MAC1C,SAASJ,EAAE,0BAA0B;AAAA,IAAA,CACtC,EACA;AAAA,MACC,CAAAI,MAAO;AACL,cAAMC,IAAa,IAAI,KAAKD,CAAG;AAC/B,QAAAC,EAAW,SAAS,GAAG,GAAG,GAAG,CAAC;AAC9B,cAAMC,IAAM,IAAI,KAAKL,CAAY;AACjC,eAAAK,EAAI,SAAS,GAAG,GAAG,GAAG,CAAC,GAChBD,KAAcC;AAAA,MACvB;AAAA,MACA,EAAE,SAASN,EAAE,+BAA+B,EAAE,OAAOE,KAAoB,GAAG,EAAA;AAAA,IAAE;AAAA,IAElF,uBAAuBC,EAAE,QAAA;AAAA,EAAQ,CAClC;AACH;"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useState as p } from "react";
|
|
3
|
-
import { createMachine as P } from "robot3";
|
|
4
|
-
import { transitionPayrollMachine as x } from "./transitionPayrollStateMachine.js";
|
|
5
|
-
import { PayrollConfigurationContextual as y, TransitionCreationContextual as C } from "./TransitionPayrollComponents.js";
|
|
6
|
-
import { useResolveTransitionPayroll as h } from "./useResolveTransitionPayroll.js";
|
|
7
|
-
import { BaseComponent as g } from "../../Base/Base.js";
|
|
8
|
-
import { useBase as v } from "../../Base/useBase.js";
|
|
9
|
-
import { Flow as B } from "../../Flow/Flow.js";
|
|
10
|
-
function k(o) {
|
|
11
|
-
return /* @__PURE__ */ r(g, { ...o, children: /* @__PURE__ */ r(T, { ...o }) });
|
|
12
|
-
}
|
|
13
|
-
function T({
|
|
14
|
-
companyId: o,
|
|
15
|
-
startDate: n,
|
|
16
|
-
endDate: t,
|
|
17
|
-
payScheduleUuid: i,
|
|
18
|
-
payrollUuid: l,
|
|
19
|
-
withReimbursements: m = !0
|
|
20
|
-
}) {
|
|
21
|
-
const { onEvent: s } = v(), u = h({
|
|
22
|
-
companyId: o,
|
|
23
|
-
startDate: n,
|
|
24
|
-
endDate: t,
|
|
25
|
-
payScheduleUuid: i
|
|
26
|
-
}), e = l ?? u, [c] = p(() => {
|
|
27
|
-
const a = !!e;
|
|
28
|
-
return P(
|
|
29
|
-
a ? "configuration" : "creation",
|
|
30
|
-
x,
|
|
31
|
-
(f) => ({
|
|
32
|
-
...f,
|
|
33
|
-
component: a ? y : C,
|
|
34
|
-
companyId: o,
|
|
35
|
-
startDate: n,
|
|
36
|
-
endDate: t,
|
|
37
|
-
payScheduleUuid: i,
|
|
38
|
-
payrollUuid: e,
|
|
39
|
-
withReimbursements: m
|
|
40
|
-
})
|
|
41
|
-
);
|
|
42
|
-
});
|
|
43
|
-
return /* @__PURE__ */ r(B, { machine: c, onEvent: s });
|
|
44
|
-
}
|
|
45
|
-
export {
|
|
46
|
-
k as TransitionPayroll
|
|
47
|
-
};
|
|
48
|
-
//# sourceMappingURL=TransitionPayroll.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransitionPayroll.js","sources":["../../../../src/components/Payroll/TransitionPayroll/TransitionPayroll.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { createMachine } from 'robot3'\nimport { transitionPayrollMachine } from './transitionPayrollStateMachine'\nimport {\n TransitionCreationContextual,\n PayrollConfigurationContextual,\n type TransitionPayrollContextInterface,\n} from './TransitionPayrollComponents'\nimport { useResolveTransitionPayroll } from './useResolveTransitionPayroll'\nimport type { TransitionPayrollProps } from './TransitionPayrollTypes'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flow } from '@/components/Flow/Flow'\n\n/**\n * Resolves and runs a transition payroll for a pay-schedule change, picking up an existing\n * unprocessed transition payroll when one exists and creating one otherwise.\n *\n * @remarks\n * A transition payroll covers the gap that opens when a company changes its pay schedule. This\n * component looks up whether one already exists for the pay period and picks the starting screen:\n *\n * - If it exists, it starts on {@link PayrollConfiguration} for that payroll.\n * - Otherwise it starts on {@link TransitionCreation}, then advances to {@link PayrollConfiguration}\n * once the payroll is created.\n *\n * Configuration events (calculate, employee edit, blockers, etc.) are emitted through `onEvent` for\n * the host to route. Compose it inside {@link TransitionFlow} for the full run-payroll experience,\n * or handle the events yourself.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `transition/created` | The transition payroll has been created and the flow advances to configuration | `{ payrollUuid: string }` |\n *\n * Once configuration begins, all standard run-payroll events are emitted as well (e.g.\n * `runPayroll/calculated`, `runPayroll/employee/edit`, `runPayroll/blockers/viewAll`).\n *\n * @components\n * - {@link TransitionCreation}\n * - {@link PayrollConfiguration}\n *\n * @param props - See {@link TransitionPayrollProps}.\n * @returns The transition payroll component.\n * @public\n *\n * @example\n * ```tsx title=\"App.tsx\"\n * import { Payroll, type EventType } from '@gusto/embedded-react-sdk'\n *\n * function MyApp() {\n * return (\n * <Payroll.TransitionPayroll\n * companyId=\"a007e1ab-3595-43c2-ab4b-af7a5af2e365\"\n * startDate=\"2025-01-16\"\n * endDate=\"2025-01-31\"\n * payScheduleUuid=\"c75c1ef6-2ec0-4cca-94a5-8b4cf7e5ea21\"\n * onEvent={(eventType: EventType) => {\n * if (eventType === 'runPayroll/calculated') {\n * // Payroll calculated — navigate to your review screen\n * }\n * }}\n * />\n * )\n * }\n * ```\n */\nexport function TransitionPayroll(props: TransitionPayrollProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({\n companyId,\n startDate,\n endDate,\n payScheduleUuid,\n payrollUuid,\n withReimbursements = true,\n}: TransitionPayrollProps) {\n const { onEvent } = useBase()\n\n const resolvedPayrollUuid = useResolveTransitionPayroll({\n companyId,\n startDate,\n endDate,\n payScheduleUuid,\n })\n\n // A caller-supplied payrollUuid wins over the lookup, so a parent that already knows the payroll\n // can skip creation.\n const initialPayrollUuid = payrollUuid ?? resolvedPayrollUuid\n\n // Freeze the machine once. Creating a payroll refetches the resolve query, so recomputing this\n // would re-seat the machine mid-flow.\n const [machine] = useState(() => {\n const hasExisting = Boolean(initialPayrollUuid)\n return createMachine(\n hasExisting ? 'configuration' : 'creation',\n transitionPayrollMachine,\n (initialContext: TransitionPayrollContextInterface) => ({\n ...initialContext,\n component: hasExisting ? PayrollConfigurationContextual : TransitionCreationContextual,\n companyId,\n startDate,\n endDate,\n payScheduleUuid,\n payrollUuid: initialPayrollUuid,\n withReimbursements,\n }),\n )\n })\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n"],"names":["TransitionPayroll","props","jsx","BaseComponent","Root","companyId","startDate","endDate","payScheduleUuid","payrollUuid","withReimbursements","onEvent","useBase","resolvedPayrollUuid","useResolveTransitionPayroll","initialPayrollUuid","machine","useState","hasExisting","createMachine","transitionPayrollMachine","initialContext","PayrollConfigurationContextual","TransitionCreationContextual","Flow"],"mappings":";;;;;;;;;AAmEO,SAASA,EAAkBC,GAA+B;AAC/D,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK;AAAA,EACZ,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC,IAAqB;AACvB,GAA2B;AACzB,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEdC,IAAsBC,EAA4B;AAAA,IACtD,WAAAT;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,iBAAAC;AAAA,EAAA,CACD,GAIKO,IAAqBN,KAAeI,GAIpC,CAACG,CAAO,IAAIC,EAAS,MAAM;AAC/B,UAAMC,IAAc,EAAQH;AAC5B,WAAOI;AAAA,MACLD,IAAc,kBAAkB;AAAA,MAChCE;AAAA,MACA,CAACC,OAAuD;AAAA,QACtD,GAAGA;AAAA,QACH,WAAWH,IAAcI,IAAiCC;AAAA,QAC1D,WAAAlB;AAAA,QACA,WAAAC;AAAA,QACA,SAAAC;AAAA,QACA,iBAAAC;AAAA,QACA,aAAaO;AAAA,QACb,oBAAAL;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ,CAAC;AAED,SAAO,gBAAAR,EAACsB,GAAA,EAAK,SAAAR,GAAkB,SAAAL,EAAA,CAAkB;AACnD;"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { PayrollConfiguration as m } from "../PayrollConfiguration/PayrollConfiguration.js";
|
|
3
|
-
import { useFlow as i } from "../../Flow/useFlow.js";
|
|
4
|
-
import { ensureRequired as o } from "../../../helpers/ensureRequired.js";
|
|
5
|
-
import { TransitionCreation as p } from "../TransitionCreation/TransitionCreation.js";
|
|
6
|
-
function f() {
|
|
7
|
-
const { companyId: t, startDate: n, endDate: r, payScheduleUuid: e, onEvent: u } = i();
|
|
8
|
-
return /* @__PURE__ */ a(
|
|
9
|
-
p,
|
|
10
|
-
{
|
|
11
|
-
companyId: o(t),
|
|
12
|
-
startDate: o(n),
|
|
13
|
-
endDate: o(r),
|
|
14
|
-
payScheduleUuid: o(e),
|
|
15
|
-
onEvent: u
|
|
16
|
-
}
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
function C() {
|
|
20
|
-
const { companyId: t, payrollUuid: n, onEvent: r, withReimbursements: e } = i();
|
|
21
|
-
return /* @__PURE__ */ a(
|
|
22
|
-
m,
|
|
23
|
-
{
|
|
24
|
-
companyId: o(t),
|
|
25
|
-
payrollId: o(n),
|
|
26
|
-
onEvent: r,
|
|
27
|
-
withReimbursements: e
|
|
28
|
-
}
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
export {
|
|
32
|
-
C as PayrollConfigurationContextual,
|
|
33
|
-
f as TransitionCreationContextual
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=TransitionPayrollComponents.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransitionPayrollComponents.js","sources":["../../../../src/components/Payroll/TransitionPayroll/TransitionPayrollComponents.tsx"],"sourcesContent":["import { TransitionCreation } from '../TransitionCreation'\nimport { PayrollConfiguration } from '../PayrollConfiguration/PayrollConfiguration'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\n/**\n * Flow context shape carried through the {@link TransitionPayroll} state machine.\n *\n * @internal\n */\nexport interface TransitionPayrollContextInterface extends FlowContextInterface {\n /** Company the transition payroll belongs to. */\n companyId: string\n /** Start date of the transition pay period (YYYY-MM-DD). */\n startDate: string\n /** End date of the transition pay period (YYYY-MM-DD). */\n endDate: string\n /** UUID of the pay schedule the transition is associated with. */\n payScheduleUuid: string\n /** UUID of the transition payroll once it has been resolved or created. */\n payrollUuid?: string\n /** Whether reimbursement fields are shown on the configuration screen. Defaults to `true`. */\n withReimbursements?: boolean\n}\n\n/** @internal */\nexport function TransitionCreationContextual() {\n const { companyId, startDate, endDate, payScheduleUuid, onEvent } =\n useFlow<TransitionPayrollContextInterface>()\n return (\n <TransitionCreation\n companyId={ensureRequired(companyId)}\n startDate={ensureRequired(startDate)}\n endDate={ensureRequired(endDate)}\n payScheduleUuid={ensureRequired(payScheduleUuid)}\n onEvent={onEvent}\n />\n )\n}\n\n/** @internal */\nexport function PayrollConfigurationContextual() {\n const { companyId, payrollUuid, onEvent, withReimbursements } =\n useFlow<TransitionPayrollContextInterface>()\n return (\n <PayrollConfiguration\n companyId={ensureRequired(companyId)}\n payrollId={ensureRequired(payrollUuid)}\n onEvent={onEvent}\n withReimbursements={withReimbursements}\n />\n )\n}\n"],"names":["TransitionCreationContextual","companyId","startDate","endDate","payScheduleUuid","onEvent","useFlow","jsx","TransitionCreation","ensureRequired","PayrollConfigurationContextual","payrollUuid","withReimbursements","PayrollConfiguration"],"mappings":";;;;;AA0BO,SAASA,IAA+B;AAC7C,QAAM,EAAE,WAAAC,GAAW,WAAAC,GAAW,SAAAC,GAAS,iBAAAC,GAAiB,SAAAC,EAAA,IACtDC,EAAA;AACF,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAeR,CAAS;AAAA,MACnC,WAAWQ,EAAeP,CAAS;AAAA,MACnC,SAASO,EAAeN,CAAO;AAAA,MAC/B,iBAAiBM,EAAeL,CAAe;AAAA,MAC/C,SAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;AAGO,SAASK,IAAiC;AAC/C,QAAM,EAAE,WAAAT,GAAW,aAAAU,GAAa,SAAAN,GAAS,oBAAAO,EAAA,IACvCN,EAAA;AACF,SACE,gBAAAC;AAAA,IAACM;AAAA,IAAA;AAAA,MACC,WAAWJ,EAAeR,CAAS;AAAA,MACnC,WAAWQ,EAAeE,CAAW;AAAA,MACrC,SAAAN;AAAA,MACA,oBAAAO;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { state as o, transition as r, reduce as i } from "robot3";
|
|
2
|
-
import { PayrollConfigurationContextual as a } from "./TransitionPayrollComponents.js";
|
|
3
|
-
import { componentEvents as e } from "../../../shared/constants.js";
|
|
4
|
-
const m = {
|
|
5
|
-
creation: o(
|
|
6
|
-
r(
|
|
7
|
-
e.TRANSITION_CREATED,
|
|
8
|
-
"configuration",
|
|
9
|
-
i(
|
|
10
|
-
(t, n) => ({
|
|
11
|
-
...t,
|
|
12
|
-
payrollUuid: n.payload?.payrollUuid,
|
|
13
|
-
component: a
|
|
14
|
-
})
|
|
15
|
-
)
|
|
16
|
-
)
|
|
17
|
-
),
|
|
18
|
-
configuration: o()
|
|
19
|
-
};
|
|
20
|
-
export {
|
|
21
|
-
m as transitionPayrollMachine
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=transitionPayrollStateMachine.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transitionPayrollStateMachine.js","sources":["../../../../src/components/Payroll/TransitionPayroll/transitionPayrollStateMachine.ts"],"sourcesContent":["import { state, transition, reduce } from 'robot3'\nimport {\n PayrollConfigurationContextual,\n type TransitionPayrollContextInterface,\n} from './TransitionPayrollComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineTransition } from '@/types/Helpers'\n\n/**\n * State machine for {@link TransitionPayroll}.\n *\n * @remarks\n * `creation` shows {@link TransitionCreation}; `configuration` shows {@link PayrollConfiguration}.\n * The component freezes the initial state from the resolve lookup. `configuration` has no outgoing\n * transitions (a plain zero-transition state, not a robot3 final state per SDK-1169) so its events\n * bubble via `onEvent` and the screen keeps working if the host stays mounted past completion.\n *\n * @internal\n */\nexport const transitionPayrollMachine = {\n creation: state<MachineTransition>(\n transition(\n componentEvents.TRANSITION_CREATED,\n 'configuration',\n reduce(\n (\n ctx: TransitionPayrollContextInterface,\n ev: { payload?: { payrollUuid?: string } },\n ): TransitionPayrollContextInterface => ({\n ...ctx,\n payrollUuid: ev.payload?.payrollUuid,\n component: PayrollConfigurationContextual,\n }),\n ),\n ),\n ),\n\n configuration: state<MachineTransition>(),\n}\n"],"names":["transitionPayrollMachine","state","transition","componentEvents","reduce","ctx","ev","PayrollConfigurationContextual"],"mappings":";;;AAmBO,MAAMA,IAA2B;AAAA,EACtC,UAAUC;AAAA,IACRC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CACEC,GACAC,OACuC;AAAA,UACvC,GAAGD;AAAA,UACH,aAAaC,EAAG,SAAS;AAAA,UACzB,WAAWC;AAAA,QAAA;AAAA,MACb;AAAA,IACF;AAAA,EACF;AAAA,EAGF,eAAeN,EAAA;AACjB;"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { usePayrollsListSuspense as l } from "@gusto/embedded-api/react-query/payrollsList";
|
|
2
|
-
import { QueryParamPayrollTypes as a, ProcessingStatuses as u } from "@gusto/embedded-api/models/operations/getv1companiescompanyidpayrolls";
|
|
3
|
-
import { toRFCDate as c } from "../../../helpers/dateFormatting.js";
|
|
4
|
-
const p = 28, d = "Transition from old pay schedule";
|
|
5
|
-
function y() {
|
|
6
|
-
const e = /* @__PURE__ */ new Date();
|
|
7
|
-
return e.setDate(e.getDate() + p), c(e).toString();
|
|
8
|
-
}
|
|
9
|
-
function R({
|
|
10
|
-
companyId: e,
|
|
11
|
-
startDate: r,
|
|
12
|
-
endDate: s,
|
|
13
|
-
payScheduleUuid: n
|
|
14
|
-
}) {
|
|
15
|
-
const { data: i } = l({
|
|
16
|
-
companyId: e,
|
|
17
|
-
processingStatuses: [u.Unprocessed],
|
|
18
|
-
endDate: y(),
|
|
19
|
-
payrollTypes: [a.Regular, a.OffCycle]
|
|
20
|
-
});
|
|
21
|
-
return i.payrollList?.find((o) => {
|
|
22
|
-
const t = o.payPeriod;
|
|
23
|
-
return o.offCycleReason === d && t?.startDate === r && t.endDate === s && t.payScheduleUuid === n;
|
|
24
|
-
})?.payrollUuid;
|
|
25
|
-
}
|
|
26
|
-
export {
|
|
27
|
-
R as useResolveTransitionPayroll
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=useResolveTransitionPayroll.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useResolveTransitionPayroll.js","sources":["../../../../src/components/Payroll/TransitionPayroll/useResolveTransitionPayroll.ts"],"sourcesContent":["import { usePayrollsListSuspense } from '@gusto/embedded-api/react-query/payrollsList'\nimport {\n ProcessingStatuses,\n QueryParamPayrollTypes,\n} from '@gusto/embedded-api/models/operations/getv1companiescompanyidpayrolls'\nimport { toRFCDate } from '@/helpers/dateFormatting'\n\nconst FUTURE_LOOKAHEAD_DAYS = 28\n\nconst TRANSITION_OFF_CYCLE_REASON = 'Transition from old pay schedule'\n\nfunction getFutureEndDate(): string {\n const date = new Date()\n date.setDate(date.getDate() + FUTURE_LOOKAHEAD_DAYS)\n return toRFCDate(date).toString()\n}\n\n/**\n * Arguments describing the transition pay period to resolve.\n *\n * @internal\n */\nexport interface ResolveTransitionPayrollArgs {\n companyId: string\n startDate: string\n endDate: string\n payScheduleUuid: string\n}\n\n/**\n * Looks up an existing unprocessed transition payroll for the given pay period.\n *\n * @remarks\n * A transition payroll is an unprocessed off-cycle payroll whose `offCycleReason` is\n * `\"Transition from old pay schedule\"` and whose pay period matches the supplied\n * `startDate`, `endDate`, and `payScheduleUuid`. When the company changed its pay schedule\n * the platform creates exactly one such payroll for the coverage gap; this hook finds it so\n * the caller can resume it instead of creating a duplicate.\n *\n * Backed by a suspense query, so callers must render it under a suspense boundary.\n *\n * @param args - The pay period to match. See {@link ResolveTransitionPayrollArgs}.\n * @returns The matching payroll's UUID, or `undefined` when none exists yet.\n * @internal\n */\nexport function useResolveTransitionPayroll({\n companyId,\n startDate,\n endDate,\n payScheduleUuid,\n}: ResolveTransitionPayrollArgs): string | undefined {\n const { data: payrollsData } = usePayrollsListSuspense({\n companyId,\n processingStatuses: [ProcessingStatuses.Unprocessed],\n endDate: getFutureEndDate(),\n payrollTypes: [QueryParamPayrollTypes.Regular, QueryParamPayrollTypes.OffCycle],\n })\n\n const match = payrollsData.payrollList?.find(payroll => {\n const period = payroll.payPeriod\n return (\n payroll.offCycleReason === TRANSITION_OFF_CYCLE_REASON &&\n period?.startDate === startDate &&\n period.endDate === endDate &&\n period.payScheduleUuid === payScheduleUuid\n )\n })\n\n return match?.payrollUuid\n}\n"],"names":["FUTURE_LOOKAHEAD_DAYS","TRANSITION_OFF_CYCLE_REASON","getFutureEndDate","date","toRFCDate","useResolveTransitionPayroll","companyId","startDate","endDate","payScheduleUuid","payrollsData","usePayrollsListSuspense","ProcessingStatuses","QueryParamPayrollTypes","payroll","period"],"mappings":";;;AAOA,MAAMA,IAAwB,IAExBC,IAA8B;AAEpC,SAASC,IAA2B;AAClC,QAAMC,wBAAW,KAAA;AACjB,SAAAA,EAAK,QAAQA,EAAK,QAAA,IAAYH,CAAqB,GAC5CI,EAAUD,CAAI,EAAE,SAAA;AACzB;AA8BO,SAASE,EAA4B;AAAA,EAC1C,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,iBAAAC;AACF,GAAqD;AACnD,QAAM,EAAE,MAAMC,EAAA,IAAiBC,EAAwB;AAAA,IACrD,WAAAL;AAAA,IACA,oBAAoB,CAACM,EAAmB,WAAW;AAAA,IACnD,SAASV,EAAA;AAAA,IACT,cAAc,CAACW,EAAuB,SAASA,EAAuB,QAAQ;AAAA,EAAA,CAC/E;AAYD,SAVcH,EAAa,aAAa,KAAK,CAAAI,MAAW;AACtD,UAAMC,IAASD,EAAQ;AACvB,WACEA,EAAQ,mBAAmBb,KAC3Bc,GAAQ,cAAcR,KACtBQ,EAAO,YAAYP,KACnBO,EAAO,oBAAoBN;AAAA,EAE/B,CAAC,GAEa;AAChB;"}
|
package/dist/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.js
DELETED
|
@@ -1,411 +0,0 @@
|
|
|
1
|
-
import { jsx as t, jsxs as m, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as fe, useMemo as Ee, Fragment as ge } from "react";
|
|
3
|
-
import { useTranslation as re } from "react-i18next";
|
|
4
|
-
import ye from "classnames";
|
|
5
|
-
import { PayrollUpdatePaymentMethod as Ce } from "@gusto/embedded-api/models/components/payrollupdate";
|
|
6
|
-
import { isSplitByWorkweek as U } from "../PayrollEditEmployee/shared/usePayrollEditEmployeeForm/fields.js";
|
|
7
|
-
import { PayrollEditEmployeeErrorCodes as T } from "../PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeSchema.js";
|
|
8
|
-
import h from "./UNSTABLE_PayrollEditEmployee.module.scss.js";
|
|
9
|
-
import { componentEvents as ee, BREAKPOINTS as Ne, COMPENSATION_NAME_REIMBURSEMENT as ve, COMPENSATION_NAME_PAYCHECK_TIPS as Ae, COMPENSATION_NAME_CASH_TIPS as Oe, COMPENSATION_NAME_CORRECTION_PAYMENT as Te, COMPENSATION_NAME_COMMISSION as Me, COMPENSATION_NAME_BONUS as Pe, COMPENSATION_NAME_DOUBLE_OVERTIME as Se, COMPENSATION_NAME_OVERTIME as Re, COMPENSATION_NAME_REGULAR_HOURS as ke } from "../../../shared/constants.js";
|
|
10
|
-
import { BaseBoundaries as Le, BaseLayout as te } from "../../Base/Base.js";
|
|
11
|
-
import "../../Base/useBase.js";
|
|
12
|
-
import { useComponentDictionary as _e, useI18n as we } from "../../../i18n/I18n.js";
|
|
13
|
-
import { useComponentContext as ie } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
-
import { Flex as u } from "../../Common/Flex/Flex.js";
|
|
15
|
-
import { Grid as xe } from "../../Common/Grid/Grid.js";
|
|
16
|
-
import { EmptyData as De } from "../../Common/EmptyData/EmptyData.js";
|
|
17
|
-
import { SDKFormProvider as Ie } from "../../../partner-hook-utils/form/SDKFormProvider.js";
|
|
18
|
-
import { firstLastName as Be, formatNumberAsCurrency as Ue } from "../../../helpers/formattedStrings.js";
|
|
19
|
-
import { useDateFormatter as Fe } from "../../../hooks/useDateFormatter.js";
|
|
20
|
-
import He from "../../../hooks/useContainerBreakpoints/useContainerBreakpoints.js";
|
|
21
|
-
import ne from "../../../assets/icons/plus-circle.svg.js";
|
|
22
|
-
import Ve from "../../../assets/icons/trashcan.svg.js";
|
|
23
|
-
import { usePayrollEditEmployeeForm as je } from "../PayrollEditEmployee/shared/usePayrollEditEmployeeForm/usePayrollEditEmployeeForm.js";
|
|
24
|
-
import { DataView as M } from "../../Common/DataView/DataView.js";
|
|
25
|
-
import { useDataView as We } from "../../Common/DataView/useDataView.js";
|
|
26
|
-
function yt({
|
|
27
|
-
FallbackComponent: b,
|
|
28
|
-
LoaderComponent: f,
|
|
29
|
-
...N
|
|
30
|
-
}) {
|
|
31
|
-
return /* @__PURE__ */ t(
|
|
32
|
-
Le,
|
|
33
|
-
{
|
|
34
|
-
componentName: "Payroll.UNSTABLE_PayrollEditEmployee",
|
|
35
|
-
FallbackComponent: b,
|
|
36
|
-
LoaderComponent: f,
|
|
37
|
-
children: /* @__PURE__ */ t(Ye, { LoaderComponent: f, ...N })
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
const Ge = ({
|
|
42
|
-
rows: b,
|
|
43
|
-
isAdding: f,
|
|
44
|
-
draftFields: N,
|
|
45
|
-
onBeginAdd: P,
|
|
46
|
-
onSave: S,
|
|
47
|
-
onCancel: L,
|
|
48
|
-
onRemove: R
|
|
49
|
-
}) => {
|
|
50
|
-
const { t: e } = re("Payroll.UNSTABLE_PayrollEditEmployee"), { Button: g, ButtonIcon: k, Heading: y } = ie(), { Description: C, Amount: v } = N, A = We({
|
|
51
|
-
data: b,
|
|
52
|
-
columns: [
|
|
53
|
-
{
|
|
54
|
-
key: "description",
|
|
55
|
-
title: e("reimbursementDescriptionColumn"),
|
|
56
|
-
render: (d) => d.description.trim() || e("reimbursementUnnamedFallback")
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
key: "amount",
|
|
60
|
-
title: e("reimbursementAmountColumn"),
|
|
61
|
-
justify: "end",
|
|
62
|
-
render: (d) => Ue(parseFloat(d.amount || "0"))
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
key: "recurring",
|
|
66
|
-
title: e("reimbursementTypeColumn"),
|
|
67
|
-
render: (d) => d.recurring ? e("reimbursementTypeRecurring") : e("reimbursementTypeOneTime")
|
|
68
|
-
}
|
|
69
|
-
],
|
|
70
|
-
itemMenu: (d) => {
|
|
71
|
-
if (d.recurring) return null;
|
|
72
|
-
const O = d.description.trim() || e("reimbursementUnnamedFallback");
|
|
73
|
-
return /* @__PURE__ */ t(
|
|
74
|
-
k,
|
|
75
|
-
{
|
|
76
|
-
variant: "tertiary",
|
|
77
|
-
onClick: () => {
|
|
78
|
-
R(d.index);
|
|
79
|
-
},
|
|
80
|
-
"aria-label": e("removeReimbursementLabel", { description: O }),
|
|
81
|
-
children: /* @__PURE__ */ t(Ve, { "aria-hidden": !0 })
|
|
82
|
-
}
|
|
83
|
-
);
|
|
84
|
-
},
|
|
85
|
-
emptyState: () => /* @__PURE__ */ t(De, { title: e("reimbursementEmptyTitle"), children: /* @__PURE__ */ t(g, { variant: "secondary", onClick: P, icon: /* @__PURE__ */ t(ne, { "aria-hidden": !0 }), children: e("addReimbursementCta") }) })
|
|
86
|
-
});
|
|
87
|
-
return /* @__PURE__ */ m(u, { flexDirection: "column", gap: 12, children: [
|
|
88
|
-
/* @__PURE__ */ t(y, { as: "h3", styledAs: "h4", children: e("reimbursementTitle") }),
|
|
89
|
-
!(b.length === 0 && f) && /* @__PURE__ */ t(M, { label: e("reimbursementsTableLabel"), ...A }),
|
|
90
|
-
f ? /* @__PURE__ */ m(u, { flexDirection: "column", gap: 12, children: [
|
|
91
|
-
/* @__PURE__ */ m(xe, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: [
|
|
92
|
-
/* @__PURE__ */ t(
|
|
93
|
-
C,
|
|
94
|
-
{
|
|
95
|
-
label: e("reimbursementDescriptionLabel"),
|
|
96
|
-
placeholder: e("reimbursementDescriptionPlaceholder")
|
|
97
|
-
}
|
|
98
|
-
),
|
|
99
|
-
/* @__PURE__ */ t(v, { label: e("reimbursementAmountLabel"), adornmentStart: "$", isRequired: !0 })
|
|
100
|
-
] }),
|
|
101
|
-
/* @__PURE__ */ m(u, { gap: 12, children: [
|
|
102
|
-
/* @__PURE__ */ t(g, { onClick: S, title: e("saveReimbursementCta"), children: e("saveReimbursementCta") }),
|
|
103
|
-
/* @__PURE__ */ t(g, { variant: "secondary", onClick: L, title: e("cancelReimbursementCta"), children: e("cancelReimbursementCta") })
|
|
104
|
-
] })
|
|
105
|
-
] }) : b.length > 0 && /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
|
|
106
|
-
g,
|
|
107
|
-
{
|
|
108
|
-
variant: "secondary",
|
|
109
|
-
onClick: P,
|
|
110
|
-
title: e("addReimbursementLink"),
|
|
111
|
-
icon: /* @__PURE__ */ t(ne, { "aria-hidden": !0 }),
|
|
112
|
-
children: e("addReimbursementLink")
|
|
113
|
-
}
|
|
114
|
-
) })
|
|
115
|
-
] });
|
|
116
|
-
}, Ye = ({
|
|
117
|
-
employeeId: b,
|
|
118
|
-
companyId: f,
|
|
119
|
-
payrollId: N,
|
|
120
|
-
withReimbursements: P = !0,
|
|
121
|
-
onEvent: S,
|
|
122
|
-
dictionary: L,
|
|
123
|
-
LoaderComponent: R
|
|
124
|
-
}) => {
|
|
125
|
-
_e("Payroll.UNSTABLE_PayrollEditEmployee", L), we("Payroll.UNSTABLE_PayrollEditEmployee");
|
|
126
|
-
const { t: e } = re("Payroll.UNSTABLE_PayrollEditEmployee"), g = Fe(), { Alert: k, Box: y, BoxHeader: C, Button: v, Heading: A, Text: d } = ie(), O = fe(null), E = He({ ref: O }).includes("small"), ae = Ee(
|
|
127
|
-
() => ({
|
|
128
|
-
[T.NEGATIVE_AMOUNT]: e("validations.negativeAmount"),
|
|
129
|
-
[T.MAX_HOURS]: e("validations.maxHours"),
|
|
130
|
-
[T.REQUIRED_WORKWEEK]: e("validations.requiredWorkweek"),
|
|
131
|
-
[T.REIMBURSEMENT_AMOUNT]: e("validations.reimbursementAmount"),
|
|
132
|
-
[T.MAX_REIMBURSEMENT_AMOUNT]: e(
|
|
133
|
-
"validations.maxReimbursementAmount"
|
|
134
|
-
)
|
|
135
|
-
}),
|
|
136
|
-
[e]
|
|
137
|
-
), r = je({
|
|
138
|
-
employeeId: b,
|
|
139
|
-
companyId: f,
|
|
140
|
-
payrollId: N,
|
|
141
|
-
withReimbursements: P,
|
|
142
|
-
errorMessages: ae
|
|
143
|
-
});
|
|
144
|
-
if (r.isLoading)
|
|
145
|
-
return /* @__PURE__ */ t("div", { ref: O, className: h.container, children: /* @__PURE__ */ t(te, { isLoading: !0, error: r.errorHandling.errors, LoaderComponent: R }) });
|
|
146
|
-
const { employee: _ } = r.data, c = r.form.Fields, F = Be({
|
|
147
|
-
first_name: _.firstName,
|
|
148
|
-
last_name: _.lastName
|
|
149
|
-
}), le = (n) => {
|
|
150
|
-
switch (n) {
|
|
151
|
-
case ke:
|
|
152
|
-
return e("compensationNames.regularHours");
|
|
153
|
-
case Re:
|
|
154
|
-
return e("compensationNames.overtime");
|
|
155
|
-
case Se:
|
|
156
|
-
return e("compensationNames.doubleOvertime");
|
|
157
|
-
default:
|
|
158
|
-
return n;
|
|
159
|
-
}
|
|
160
|
-
}, w = (n) => {
|
|
161
|
-
switch (n) {
|
|
162
|
-
case Pe:
|
|
163
|
-
return e("fixedCompensationNames.bonus");
|
|
164
|
-
case Me:
|
|
165
|
-
return e("fixedCompensationNames.commission");
|
|
166
|
-
case Te:
|
|
167
|
-
return e("fixedCompensationNames.correctionPayment");
|
|
168
|
-
case Oe:
|
|
169
|
-
return e("fixedCompensationNames.cashTips");
|
|
170
|
-
case Ae:
|
|
171
|
-
return e("fixedCompensationNames.paycheckTips");
|
|
172
|
-
case ve:
|
|
173
|
-
return e("fixedCompensationNames.reimbursement");
|
|
174
|
-
default:
|
|
175
|
-
return n;
|
|
176
|
-
}
|
|
177
|
-
}, x = (n) => U(n) ? n[r.data.workweeks[0]?.startDate ?? ""] ?? [] : n, H = (n, i) => {
|
|
178
|
-
const { label: l, rowHeader: a, valueColumnLabel: o, labelFor: s, adornmentStart: ue, adornmentEnd: pe } = i, D = U(n), K = x(n), q = (p, I) => /* @__PURE__ */ t("div", { className: ye(h.inputContainer, D && h.workweekInputContainer), children: /* @__PURE__ */ t(
|
|
179
|
-
p.Field,
|
|
180
|
-
{
|
|
181
|
-
label: I,
|
|
182
|
-
shouldVisuallyHideLabel: !0,
|
|
183
|
-
adornmentStart: ue,
|
|
184
|
-
adornmentEnd: pe
|
|
185
|
-
}
|
|
186
|
-
) }), he = {
|
|
187
|
-
title: o,
|
|
188
|
-
justify: "end",
|
|
189
|
-
render: (p) => q(p, s(p.name))
|
|
190
|
-
}, be = r.data.workweeks.map(
|
|
191
|
-
({ startDate: p, endDate: I }) => {
|
|
192
|
-
const X = g.formatPayPeriodRange(p, I, {
|
|
193
|
-
useShortMonth: !0
|
|
194
|
-
});
|
|
195
|
-
return {
|
|
196
|
-
title: X,
|
|
197
|
-
justify: "end",
|
|
198
|
-
render: (B) => {
|
|
199
|
-
const J = n[p]?.find(
|
|
200
|
-
(Q) => Q.jobUuid === B.jobUuid && Q.name === B.name
|
|
201
|
-
);
|
|
202
|
-
return J ? q(J, `${s(B.name)} ${X}`) : null;
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
), z = [
|
|
207
|
-
{ title: a, render: (p) => s(p.name) },
|
|
208
|
-
...D ? be : [he]
|
|
209
|
-
];
|
|
210
|
-
return D ? /* @__PURE__ */ t("div", { className: h.workweekTableScroll, children: /* @__PURE__ */ t(
|
|
211
|
-
M,
|
|
212
|
-
{
|
|
213
|
-
label: l,
|
|
214
|
-
isWithinBox: !0,
|
|
215
|
-
columns: z,
|
|
216
|
-
data: K,
|
|
217
|
-
breakAt: Ne.SMALL
|
|
218
|
-
}
|
|
219
|
-
) }) : /* @__PURE__ */ t(M, { label: l, isWithinBox: !0, columns: z, data: K });
|
|
220
|
-
}, oe = (n, i) => {
|
|
221
|
-
const { title: l, footer: a, ...o } = i;
|
|
222
|
-
return x(n).length === 0 && !a ? null : /* @__PURE__ */ t(y, { header: /* @__PURE__ */ t(C, { title: l }), withPadding: !1, footer: a, children: H(n, o) });
|
|
223
|
-
}, V = (n, i) => {
|
|
224
|
-
if (n.length === 0) return null;
|
|
225
|
-
const { title: l, description: a } = i, o = [
|
|
226
|
-
{
|
|
227
|
-
title: e("typeColumn"),
|
|
228
|
-
render: (s) => s.name
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
title: e("hoursColumn"),
|
|
232
|
-
justify: "end",
|
|
233
|
-
render: (s) => /* @__PURE__ */ t("div", { className: h.inputContainer, children: /* @__PURE__ */ t(
|
|
234
|
-
s.Field,
|
|
235
|
-
{
|
|
236
|
-
label: s.name,
|
|
237
|
-
shouldVisuallyHideLabel: !0,
|
|
238
|
-
adornmentEnd: e("hoursUnit"),
|
|
239
|
-
description: s.remaining !== null ? e("timeOffBalance.remaining", { balance: s.remaining }) : void 0
|
|
240
|
-
}
|
|
241
|
-
) })
|
|
242
|
-
}
|
|
243
|
-
];
|
|
244
|
-
return /* @__PURE__ */ t(y, { header: /* @__PURE__ */ t(C, { title: l, description: a }), withPadding: !1, children: /* @__PURE__ */ t(M, { label: l, isWithinBox: !0, columns: o, data: n }) });
|
|
245
|
-
}, j = (n, i) => {
|
|
246
|
-
const l = [
|
|
247
|
-
{ title: e("typeColumn"), render: (a) => a.label },
|
|
248
|
-
{
|
|
249
|
-
title: e("amountColumn"),
|
|
250
|
-
justify: "end",
|
|
251
|
-
render: (a) => /* @__PURE__ */ t("div", { className: h.inputContainer, children: /* @__PURE__ */ t(a.Field, { label: a.label, shouldVisuallyHideLabel: !0, adornmentStart: "$" }) })
|
|
252
|
-
}
|
|
253
|
-
];
|
|
254
|
-
return /* @__PURE__ */ t(M, { label: i, isWithinBox: !0, columns: l, data: n });
|
|
255
|
-
}, W = (n) => /* @__PURE__ */ t("div", { className: h.earningsGroupLabel, children: /* @__PURE__ */ t(d, { size: "sm", weight: "semibold", children: n }) }), se = () => {
|
|
256
|
-
const n = c.overtimeIncludedEarnings, i = c.overtimeExcludedEarnings.map((o) => ({
|
|
257
|
-
label: w(o.id),
|
|
258
|
-
Field: o.Field
|
|
259
|
-
})), l = x(n).length > 0;
|
|
260
|
-
if (!l && i.length === 0) return null;
|
|
261
|
-
const a = H(n, {
|
|
262
|
-
label: e("additionalEarningsTitle"),
|
|
263
|
-
rowHeader: e("typeColumn"),
|
|
264
|
-
valueColumnLabel: e("amountColumn"),
|
|
265
|
-
labelFor: w,
|
|
266
|
-
adornmentStart: "$"
|
|
267
|
-
});
|
|
268
|
-
if (!U(n)) {
|
|
269
|
-
const o = [
|
|
270
|
-
...n.map((s) => ({ label: w(s.name), Field: s.Field })),
|
|
271
|
-
...i
|
|
272
|
-
];
|
|
273
|
-
return /* @__PURE__ */ t(y, { header: /* @__PURE__ */ t(C, { title: e("additionalEarningsTitle") }), withPadding: !1, children: j(o, e("additionalEarningsTitle")) });
|
|
274
|
-
}
|
|
275
|
-
return /* @__PURE__ */ m(y, { header: /* @__PURE__ */ t(C, { title: e("additionalEarningsTitle") }), withPadding: !1, children: [
|
|
276
|
-
l ? /* @__PURE__ */ m(Z, { children: [
|
|
277
|
-
/* @__PURE__ */ t("div", { className: h.earningsAlert, children: /* @__PURE__ */ t(
|
|
278
|
-
k,
|
|
279
|
-
{
|
|
280
|
-
status: "info",
|
|
281
|
-
label: e("overtimeMultiplierEarningsAlert"),
|
|
282
|
-
disableScrollIntoView: !0,
|
|
283
|
-
children: /* @__PURE__ */ t(d, { size: "sm", children: e("overtimeMultiplierEarningsAlertDescription") })
|
|
284
|
-
}
|
|
285
|
-
) }),
|
|
286
|
-
W(e("overtimeIncludedEarningsGroupLabel")),
|
|
287
|
-
a
|
|
288
|
-
] }) : null,
|
|
289
|
-
i.length > 0 ? /* @__PURE__ */ m(Z, { children: [
|
|
290
|
-
W(e("overtimeExcludedEarningsGroupLabel")),
|
|
291
|
-
j(i, e("overtimeExcludedEarningsGroupLabel"))
|
|
292
|
-
] }) : null
|
|
293
|
-
] });
|
|
294
|
-
}, G = c.paymentMethod, Y = c.reimbursementDraft, me = r.data.reimbursements, de = r.form.reimbursementDraft?.isAdding ?? !1, ce = async () => {
|
|
295
|
-
const n = await r.actions.onSubmit();
|
|
296
|
-
n && S(ee.RUN_PAYROLL_EMPLOYEE_SAVED, {
|
|
297
|
-
payrollPrepared: n.data,
|
|
298
|
-
employee: _
|
|
299
|
-
});
|
|
300
|
-
}, $ = /* @__PURE__ */ m(
|
|
301
|
-
u,
|
|
302
|
-
{
|
|
303
|
-
flexDirection: E ? "row" : "column",
|
|
304
|
-
justifyContent: E ? "flex-end" : "normal",
|
|
305
|
-
alignItems: E ? "flex-start" : "stretch",
|
|
306
|
-
gap: 12,
|
|
307
|
-
children: [
|
|
308
|
-
/* @__PURE__ */ t(v, { variant: "secondary", onClick: () => {
|
|
309
|
-
S(ee.RUN_PAYROLL_EMPLOYEE_CANCELLED);
|
|
310
|
-
}, title: e("cancelCta"), children: e("cancelCta") }),
|
|
311
|
-
/* @__PURE__ */ t(
|
|
312
|
-
v,
|
|
313
|
-
{
|
|
314
|
-
onClick: () => {
|
|
315
|
-
ce();
|
|
316
|
-
},
|
|
317
|
-
title: e("saveCta"),
|
|
318
|
-
isLoading: r.status.isPending,
|
|
319
|
-
children: e("saveCta")
|
|
320
|
-
}
|
|
321
|
-
)
|
|
322
|
-
]
|
|
323
|
-
}
|
|
324
|
-
);
|
|
325
|
-
return /* @__PURE__ */ t("div", { ref: O, className: h.container, children: /* @__PURE__ */ t(te, { error: r.errorHandling.errors, LoaderComponent: R, children: /* @__PURE__ */ t(Ie, { formHookResult: r, children: /* @__PURE__ */ m(u, { flexDirection: "column", gap: 24, children: [
|
|
326
|
-
/* @__PURE__ */ m(
|
|
327
|
-
u,
|
|
328
|
-
{
|
|
329
|
-
flexDirection: E ? "row" : "column",
|
|
330
|
-
justifyContent: "space-between",
|
|
331
|
-
alignItems: E ? "flex-start" : "stretch",
|
|
332
|
-
gap: 12,
|
|
333
|
-
children: [
|
|
334
|
-
/* @__PURE__ */ t(u, { flexDirection: "column", alignItems: "stretch", gap: 8, children: /* @__PURE__ */ t(A, { as: "h1", styledAs: "h2", children: e("pageTitle", { employeeName: F }) }) }),
|
|
335
|
-
E && $
|
|
336
|
-
]
|
|
337
|
-
}
|
|
338
|
-
),
|
|
339
|
-
!E && $,
|
|
340
|
-
(() => {
|
|
341
|
-
const n = c.jobs.length > 1, i = r.data.isOvertimeEligible ? e("regularHoursTitle") : e("regularHoursTitleWithoutOvertime"), l = !r.data.withOvertime && r.data.isOvertimeEligible, a = r.data.withOvertime && r.data.isOvertimeEligible;
|
|
342
|
-
return /* @__PURE__ */ m(u, { flexDirection: "column", gap: 16, children: [
|
|
343
|
-
n ? /* @__PURE__ */ t(A, { as: "h3", children: i }) : null,
|
|
344
|
-
a ? /* @__PURE__ */ t(
|
|
345
|
-
k,
|
|
346
|
-
{
|
|
347
|
-
status: "info",
|
|
348
|
-
label: e("overtimeWorkweekAlert", { employeeName: F }),
|
|
349
|
-
disableScrollIntoView: !0
|
|
350
|
-
}
|
|
351
|
-
) : null,
|
|
352
|
-
c.jobs.map((o) => /* @__PURE__ */ t(ge, { children: oe(o.hours, {
|
|
353
|
-
title: n ? o.title ?? i : i,
|
|
354
|
-
label: i,
|
|
355
|
-
rowHeader: e("hourTypeColumn"),
|
|
356
|
-
valueColumnLabel: e("hoursColumn"),
|
|
357
|
-
labelFor: le,
|
|
358
|
-
adornmentEnd: e("hoursUnit"),
|
|
359
|
-
footer: l ? /* @__PURE__ */ t(
|
|
360
|
-
v,
|
|
361
|
-
{
|
|
362
|
-
variant: "secondary",
|
|
363
|
-
onClick: () => {
|
|
364
|
-
r.actions.addOvertime();
|
|
365
|
-
},
|
|
366
|
-
title: e("addOvertimeCta"),
|
|
367
|
-
children: e("addOvertimeCta")
|
|
368
|
-
}
|
|
369
|
-
) : void 0
|
|
370
|
-
}) }, o.jobUuid))
|
|
371
|
-
] });
|
|
372
|
-
})(),
|
|
373
|
-
se(),
|
|
374
|
-
V(c.timeOff, {
|
|
375
|
-
title: c.finalPayout ? e("timeOffTitleDismissal") : e("timeOffTitle")
|
|
376
|
-
}),
|
|
377
|
-
c.finalPayout ? V(c.finalPayout, {
|
|
378
|
-
title: e("finalPayoutTitle"),
|
|
379
|
-
description: e("finalPayoutDescription")
|
|
380
|
-
}) : null,
|
|
381
|
-
G ? /* @__PURE__ */ m(u, { flexDirection: "column", gap: 24, children: [
|
|
382
|
-
Y ? /* @__PURE__ */ t(
|
|
383
|
-
Ge,
|
|
384
|
-
{
|
|
385
|
-
rows: me ?? [],
|
|
386
|
-
isAdding: de,
|
|
387
|
-
draftFields: Y,
|
|
388
|
-
onBeginAdd: () => r.actions.beginAddReimbursement?.(),
|
|
389
|
-
onSave: () => r.actions.saveReimbursement?.(),
|
|
390
|
-
onCancel: () => r.actions.cancelReimbursement?.(),
|
|
391
|
-
onRemove: (n) => r.actions.removeReimbursement?.(n)
|
|
392
|
-
}
|
|
393
|
-
) : null,
|
|
394
|
-
/* @__PURE__ */ m(u, { flexDirection: "column", gap: 12, children: [
|
|
395
|
-
/* @__PURE__ */ t(A, { as: "h3", styledAs: "h4", children: e("paymentMethodTitle") }),
|
|
396
|
-
/* @__PURE__ */ t(
|
|
397
|
-
G,
|
|
398
|
-
{
|
|
399
|
-
label: e("paymentMethodLabel"),
|
|
400
|
-
description: e("paymentMethodDescription"),
|
|
401
|
-
getOptionLabel: (n) => n === Ce.Check ? e("paymentMethodOptions.check") : e("paymentMethodOptions.directDeposit")
|
|
402
|
-
}
|
|
403
|
-
)
|
|
404
|
-
] })
|
|
405
|
-
] }) : null
|
|
406
|
-
] }) }) }) });
|
|
407
|
-
};
|
|
408
|
-
export {
|
|
409
|
-
yt as UNSTABLE_PayrollEditEmployee
|
|
410
|
-
};
|
|
411
|
-
//# sourceMappingURL=UNSTABLE_PayrollEditEmployee.js.map
|