@gusto/embedded-react-sdk 0.48.1 → 0.48.2
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 +23 -0
- package/dist/components/Common/DocumentList/DocumentList.js +12 -12
- package/dist/components/Common/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Common/DocumentList/DocumentList.module.scss.js +3 -5
- package/dist/components/Common/DocumentList/DocumentList.module.scss.js.map +1 -1
- package/dist/components/Common/HorizontalFieldLayout/HorizontalFieldLayoutTypes.d.ts +1 -0
- package/dist/components/Common/PaginationControl/PaginationControlTypes.d.ts +7 -3
- package/dist/components/Common/PayrollLoading/PayrollLoadingTypes.d.ts +1 -0
- package/dist/components/Common/UI/Alert/AlertTypes.d.ts +1 -0
- package/dist/components/Common/UI/Alert/AlertTypes.js.map +1 -1
- package/dist/components/Common/UI/Badge/BadgeTypes.d.ts +1 -0
- package/dist/components/Common/UI/Badge/BadgeTypes.js.map +1 -1
- package/dist/components/Common/UI/Banner/BannerTypes.d.ts +1 -0
- package/dist/components/Common/UI/Banner/BannerTypes.js.map +1 -1
- package/dist/components/Common/UI/Box/BoxTypes.d.ts +1 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeaderTypes.d.ts +1 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeaderTypes.js.map +1 -1
- package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.d.ts +2 -0
- package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.js.map +1 -1
- package/dist/components/Common/UI/Button/ButtonTypes.d.ts +4 -2
- package/dist/components/Common/UI/Button/ButtonTypes.js.map +1 -1
- package/dist/components/Common/UI/CalendarPreview/CalendarPreviewTypes.d.ts +3 -2
- package/dist/components/Common/UI/Card/CardTypes.d.ts +1 -0
- package/dist/components/Common/UI/Checkbox/CheckboxTypes.d.ts +1 -0
- package/dist/components/Common/UI/Checkbox/CheckboxTypes.js.map +1 -1
- package/dist/components/Common/UI/CheckboxGroup/CheckboxGroupTypes.d.ts +2 -0
- package/dist/components/Common/UI/CheckboxGroup/CheckboxGroupTypes.js.map +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBoxTypes.d.ts +2 -0
- package/dist/components/Common/UI/DatePicker/DatePickerTypes.d.ts +1 -0
- package/dist/components/Common/UI/DateRangePicker/DateRangePickerTypes.d.ts +2 -0
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.d.ts +2 -0
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js.map +1 -1
- package/dist/components/Common/UI/Dialog/DialogTypes.d.ts +1 -0
- package/dist/components/Common/UI/Dialog/DialogTypes.js.map +1 -1
- package/dist/components/Common/UI/FileInput/FileInputTypes.d.ts +1 -0
- package/dist/components/Common/UI/FileInput/FileInputTypes.js.map +1 -1
- package/dist/components/Common/UI/Heading/HeadingTypes.d.ts +1 -0
- package/dist/components/Common/UI/Link/LinkTypes.d.ts +4 -3
- package/dist/components/Common/UI/List/ListTypes.d.ts +13 -4
- package/dist/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes.d.ts +1 -0
- package/dist/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes.js.map +1 -1
- package/dist/components/Common/UI/Menu/MenuTypes.d.ts +2 -0
- package/dist/components/Common/UI/Menu/MenuTypes.js.map +1 -1
- package/dist/components/Common/UI/Modal/ModalTypes.d.ts +1 -0
- package/dist/components/Common/UI/Modal/ModalTypes.js.map +1 -1
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBoxTypes.d.ts +2 -0
- package/dist/components/Common/UI/NumberInput/NumberInputTypes.d.ts +1 -0
- package/dist/components/Common/UI/ProgressBar/ProgressBarTypes.d.ts +1 -0
- package/dist/components/Common/UI/Radio/RadioTypes.d.ts +1 -0
- package/dist/components/Common/UI/Radio/RadioTypes.js.map +1 -1
- package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.d.ts +2 -0
- package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.js.map +1 -1
- package/dist/components/Common/UI/Select/SelectTypes.d.ts +2 -0
- package/dist/components/Common/UI/Switch/SwitchTypes.d.ts +1 -0
- package/dist/components/Common/UI/Switch/SwitchTypes.js.map +1 -1
- package/dist/components/Common/UI/Table/TableTypes.d.ts +3 -0
- package/dist/components/Common/UI/Table/TableTypes.js.map +1 -1
- package/dist/components/Common/UI/Tabs/TabsTypes.d.ts +2 -0
- package/dist/components/Common/UI/Text/TextTypes.d.ts +1 -0
- package/dist/components/Common/UI/Text/TextTypes.js.map +1 -1
- package/dist/components/Common/UI/TextArea/TextAreaTypes.d.ts +1 -0
- package/dist/components/Common/UI/TextArea/TextAreaTypes.js.map +1 -1
- package/dist/components/Common/UI/TextInput/TextInputTypes.d.ts +1 -0
- package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +13 -13
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +18 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +18 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +20 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccount.js +7 -6
- package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +18 -3
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +18 -3
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentSigner.js +3 -2
- package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +27 -12
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +21 -6
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +18 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +18 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +19 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleForm.js +3 -2
- package/dist/components/Company/PaySchedule/PayScheduleForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +18 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +18 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +20 -5
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js +3 -2
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +3 -2
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +13 -13
- package/dist/components/Contractor/Profile/useContractorProfile.js +29 -21
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Employee/Compensation/management/Compensation.js +3 -2
- package/dist/components/Employee/Compensation/management/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.js +9 -8
- package/dist/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.js +3 -2
- package/dist/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.js +3 -2
- package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.js +3 -2
- package/dist/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationEditPendingJobForm/CompensationEditPendingJobForm.js +3 -2
- package/dist/components/Employee/Compensation/management/CompensationEditPendingJobForm/CompensationEditPendingJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/Compensation.js +3 -2
- package/dist/components/Employee/Compensation/onboarding/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js +3 -2
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -1
- package/dist/components/Employee/Deductions/management/Deductions.js +3 -2
- package/dist/components/Employee/Deductions/management/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.js +3 -2
- package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.js.map +1 -1
- package/dist/components/Employee/Documents/management/Documents.js +3 -2
- package/dist/components/Employee/Documents/management/Documents.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.d.ts +25 -5
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/index.d.ts +3 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +18 -3
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js +12 -11
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +16 -16
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.d.ts +28 -5
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/index.d.ts +3 -0
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.d.ts +26 -5
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/Documents/shared/SignatureForm/index.d.ts +3 -0
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js +10 -9
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js +3 -2
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js +9 -8
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js +14 -13
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js +3 -2
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js +7 -6
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js +7 -6
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/management/Profile.js +12 -11
- package/dist/components/Employee/Profile/management/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/management/ProfileEditForm.js +13 -12
- package/dist/components/Employee/Profile/management/ProfileEditForm.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js +11 -10
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js +3 -2
- package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/Profile.js +12 -11
- package/dist/components/Employee/Profile/onboarding/Profile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxes.js +10 -9
- package/dist/components/Employee/StateTaxes/management/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js +7 -6
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js.map +1 -1
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js +3 -2
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js +3 -2
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +10 -10
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js +7 -6
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js.map +1 -1
- package/dist/components/Employee/exports/employeeOnboarding.d.ts +3 -0
- package/dist/components/Employee/exports/employeeOnboarding.js +28 -22
- package/dist/components/Employee/exports/employeeOnboarding.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.d.ts +36 -2
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/index.d.ts +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.d.ts +22 -2
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +8 -7
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/index.d.ts +1 -1
- package/dist/components/InformationRequests/InformationRequests.d.ts +29 -2
- package/dist/components/InformationRequests/InformationRequests.js +8 -7
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestsComponents.d.ts +2 -0
- package/dist/components/InformationRequests/InformationRequestsComponents.js.map +1 -1
- package/dist/components/InformationRequests/index.d.ts +3 -3
- package/dist/components/InformationRequests/informationRequestsStateMachine.d.ts +2 -0
- package/dist/components/InformationRequests/informationRequestsStateMachine.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.d.ts +36 -3
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +22 -17
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.d.ts +1 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js +3 -2
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.d.ts +14 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.d.ts +1 -8
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +9 -10
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.d.ts +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.d.ts +11 -0
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/index.d.ts +1 -2
- package/dist/components/Payroll/ConfirmWireDetails/types.d.ts +23 -0
- package/dist/components/Payroll/Dismissal/DismissalFlow.d.ts +18 -0
- package/dist/components/Payroll/Dismissal/DismissalFlow.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.d.ts +15 -0
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.d.ts +24 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.d.ts +7 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.d.ts +2 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.js.map +1 -1
- package/dist/components/Payroll/Dismissal/index.d.ts +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.d.ts +1 -0
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +33 -25
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModalTypes.d.ts +5 -0
- package/dist/components/Payroll/GrossUpModal/index.d.ts +0 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlow.d.ts +31 -0
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.d.ts +20 -0
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
- package/dist/components/Payroll/OffCycle/offCycleStateMachine.d.ts +2 -0
- package/dist/components/Payroll/OffCycle/offCycleStateMachine.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.d.ts +20 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +24 -0
- package/dist/components/Payroll/OffCycleCreation/index.d.ts +1 -1
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.d.ts +16 -0
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js.map +1 -1
- package/dist/components/Payroll/OffCycleDeductionsSetting/types.d.ts +13 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.d.ts +1 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.d.ts +18 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.d.ts +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js +0 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.d.ts +15 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.d.ts +1 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/types.d.ts +43 -0
- package/dist/components/Payroll/OffCycleReasonSelection/types.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.d.ts +1 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModalTypes.d.ts +5 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/index.d.ts +0 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.d.ts +1 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts +14 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/index.d.ts +0 -2
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.d.ts +3 -0
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.d.ts +19 -5
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +3 -2
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/index.d.ts +0 -1
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.d.ts +17 -11
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +0 -2
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.d.ts +31 -3
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +1 -2
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +1 -0
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.d.ts +2 -0
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +2 -0
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.d.ts +42 -3
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +1 -2
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +3 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +0 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.d.ts +8 -6
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +0 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.d.ts +65 -0
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/index.d.ts +0 -1
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.d.ts +2 -0
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.d.ts +38 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +27 -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.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.d.ts +25 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +1 -2
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +1 -0
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.d.ts +33 -4
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +1 -2
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +19 -0
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.d.ts +2 -0
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.d.ts +32 -13
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +1 -0
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +65 -68
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/types.d.ts +1 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +39 -3
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +1 -2
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +1 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.d.ts +1 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.d.ts +1 -0
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.d.ts +1 -0
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.d.ts +26 -3
- package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js +8 -12
- package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.d.ts +1 -0
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.d.ts +1 -0
- package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.js.map +1 -1
- package/dist/components/Payroll/PayrollStatusBadges/index.d.ts +0 -2
- package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.d.ts +26 -0
- package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js.map +1 -1
- package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.d.ts +2 -0
- package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.d.ts +21 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js +7 -6
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.d.ts +5 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.d.ts +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +3 -2
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.d.ts +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/index.d.ts +0 -1
- package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.d.ts +5 -0
- package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.d.ts +5 -0
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlow.d.ts +21 -0
- package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlowComponents.d.ts +23 -0
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -1
- package/dist/components/Payroll/Transition/transitionStateMachine.d.ts +2 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.d.ts +20 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.d.ts +7 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +10 -10
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.d.ts +27 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js.map +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.d.ts +1 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +5 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -1
- package/dist/components/Payroll/helpers.d.ts +157 -26
- package/dist/components/Payroll/helpers.js +0 -1
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +11 -2
- package/dist/components/Payroll/payrollTypes.d.ts +24 -0
- package/dist/components/Payroll/payrollTypes.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.d.ts +12 -0
- package/dist/components/Payroll/usePreparedPayrollData.js +34 -22
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/Payroll/useUnprocessedTransitionPayPeriods.d.ts +7 -0
- package/dist/components/Payroll/useUnprocessedTransitionPayPeriods.js.map +1 -1
- package/dist/components/TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.d.ts +19 -0
- package/dist/components/TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.js +3 -2
- package/dist/components/TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.js.map +1 -1
- package/dist/components/TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.d.ts +44 -0
- package/dist/components/TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.js +3 -2
- package/dist/components/TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.d.ts +4 -0
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.d.ts +1 -0
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailTypes.d.ts +28 -2
- package/dist/components/TimeOff/HolidayPolicyDetail/index.d.ts +0 -2
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.d.ts +26 -0
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.js.map +1 -1
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.d.ts +1 -0
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js.map +1 -1
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormTypes.d.ts +10 -0
- package/dist/components/TimeOff/PolicyList/PolicyList.d.ts +25 -0
- package/dist/components/TimeOff/PolicyList/PolicyList.js +3 -2
- package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyListPresentation.d.ts +1 -0
- package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js.map +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyListTypes.d.ts +17 -0
- package/dist/components/TimeOff/PolicySettings/PolicySettings.d.ts +22 -0
- package/dist/components/TimeOff/PolicySettings/PolicySettings.js.map +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.d.ts +14 -0
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js.map +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettingsTypes.d.ts +31 -0
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelector.d.ts +23 -0
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelector.js.map +1 -1
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.d.ts +1 -0
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js.map +1 -1
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorTypes.d.ts +10 -0
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlow.d.ts +42 -0
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlow.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +26 -0
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/timeOffPolicyTypes.d.ts +15 -2
- package/dist/components/TimeOff/TimeOffFlow/timeOffPolicyTypes.js +1 -6
- package/dist/components/TimeOff/TimeOffFlow/timeOffPolicyTypes.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.d.ts +1 -0
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.d.ts +29 -0
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.d.ts +1 -0
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormTypes.d.ts +59 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/index.d.ts +0 -3
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.d.ts +1 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.d.ts +1 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js +43 -42
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentationTypes.d.ts +2 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.d.ts +1 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.d.ts +3 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.d.ts +9 -0
- package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.d.ts +25 -0
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.d.ts +14 -0
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailTypes.d.ts +97 -6
- package/dist/components/TimeOff/TimeOffPolicyDetail/index.d.ts +1 -5
- package/dist/components/TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.d.ts +23 -0
- package/dist/components/TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.js.map +1 -1
- package/dist/components/TimeOff/ViewHolidayPolicyDetails/ViewHolidayPolicyDetails.d.ts +22 -0
- package/dist/components/TimeOff/ViewHolidayPolicyDetails/ViewHolidayPolicyDetails.js.map +1 -1
- package/dist/components/TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.d.ts +22 -0
- package/dist/components/TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.js.map +1 -1
- package/dist/components/TimeOff/index.d.ts +8 -2
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.d.ts +1 -0
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js +48 -49
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js.map +1 -1
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTableTypes.d.ts +66 -0
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.d.ts +1 -0
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js.map +1 -1
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayoutTypes.d.ts +28 -0
- package/dist/components/TimeOff/shared/PolicyDetailLayout/index.d.ts +0 -1
- package/dist/components/TimeOff/shared/holidayHelpers.d.ts +5 -0
- package/dist/components/TimeOff/shared/holidayHelpers.js.map +1 -1
- package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +4 -4
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +39 -39
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
- package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +42 -42
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +206 -205
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.js +1 -1
- package/dist/shared/constants.d.ts +12 -1
- package/dist/shared/constants.js.map +1 -1
- package/docs/reference/endpoint-inventory.json +55 -0
- package/package.json +6 -5
- package/dist/assets/icons/feature-icon-check.svg.js +0 -10
- package/dist/assets/icons/feature-icon-check.svg.js.map +0 -1
- package/dist/components/Payroll/PayrollEditEmployee/index.d.ts +0 -4
- package/dist/components/Payroll/PayrollFlow/index.d.ts +0 -3
- package/dist/components/TimeOff/TimeOffFlow/index.d.ts +0 -3
- package/dist/components/TimeOff/shared/EmployeeTable/index.d.ts +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompensationEditForm.js","sources":["../../../../../../src/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.tsx"],"sourcesContent":["import { useJobsAndCompensationsGetJobs } from '@gusto/embedded-api-v-2025-11-15/react-query/jobsAndCompensationsGetJobs'\nimport { getPendingCompensationChanges } from '../../shared/getPendingCompensationChanges'\nimport { CompensationEditJobForm } from '../CompensationEditJobForm/CompensationEditJobForm'\nimport { CompensationEditPendingJobForm } from '../CompensationEditPendingJobForm/CompensationEditPendingJobForm'\nimport { BaseLayout, type CommonComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport { type EventType } from '@/shared/constants'\n\n/**\n * Props for {@link CompensationEditForm}.\n *\n * @public\n */\nexport interface CompensationEditFormProps extends CommonComponentInterface<'Employee.Management.Compensation'> {\n /** The associated employee identifier. */\n employeeId: string\n /**\n * The id of the job whose compensation is being edited (for example, the `jobId` from the\n * {@link CompensationCard} `employee/management/compensation/card/editRequested` payload).\n * The form inspects the job's compensations to decide whether to edit the current\n * compensation or an already-scheduled future-dated change.\n */\n jobId: string\n /** Callback invoked when the form emits an event. See the events table on {@link CompensationEditForm} for the available event types and payloads. */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Standalone form that edits the compensation for a single job, branching automatically between editing the current compensation and an already-scheduled future-dated change.\n *\n * @remarks\n * Pair with {@link CompensationCard} to route its `employee/management/compensation/card/editRequested` event to this form. {@link Compensation} bundles the card, the three form surfaces (edit, add job, add another job), and the swap and alert wiring as a single drop-in; reach for this form directly only when that orchestration is the wrong fit (for example, when the form needs to render in a modal or drawer, or when the swap is driven by a router).\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/compensation/editForm/submitted` | Fired after the compensation change is saved; use it to return to the card | The updated `Compensation` entity |\n * | `employee/management/compensation/editForm/cancelled` | Fired when the user clicks Cancel; use it to return to the card | — |\n *\n * @param props - See {@link CompensationEditFormProps}.\n * @returns The rendered compensation edit form.\n * @public\n * @group Block Components\n */\nexport function CompensationEditForm({\n employeeId,\n jobId,\n onEvent,\n dictionary,\n}: CompensationEditFormProps) {\n const jobsQuery = useJobsAndCompensationsGetJobs({ employeeId }, { enabled: !!employeeId })\n\n if (jobsQuery.isLoading || !jobsQuery.data) {\n const errorHandling = composeErrorHandler([jobsQuery])\n return <BaseLayout isLoading error={errorHandling.errors} />\n }\n\n const job = jobsQuery.data.jobs?.find(j => j.uuid === jobId)\n\n // The API does not guarantee ordering of job.compensations, so rely on the\n // same sorted helper that drives the card display (ascending by effectiveDate)\n // to find the nearest pending change.\n const nearestPending = getPendingCompensationChanges(job ? [job] : [])[0]\n\n if (nearestPending) {\n return (\n <CompensationEditPendingJobForm\n employeeId={employeeId}\n jobId={jobId}\n compensationId={nearestPending.compensationUuid}\n isNewJob={nearestPending.isNewJob}\n isPrimaryJob={job?.primary ?? false}\n onEvent={onEvent}\n dictionary={dictionary}\n />\n )\n }\n\n return (\n <CompensationEditJobForm\n employeeId={employeeId}\n jobId={jobId}\n onEvent={onEvent}\n dictionary={dictionary}\n />\n )\n}\n"],"names":["CompensationEditForm","employeeId","jobId","onEvent","dictionary","jobsQuery","useJobsAndCompensationsGetJobs","errorHandling","composeErrorHandler","BaseLayout","job","j","nearestPending","getPendingCompensationChanges","jsx","CompensationEditPendingJobForm","CompensationEditJobForm"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CompensationEditForm.js","sources":["../../../../../../src/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.tsx"],"sourcesContent":["import { useJobsAndCompensationsGetJobs } from '@gusto/embedded-api-v-2025-11-15/react-query/jobsAndCompensationsGetJobs'\nimport { getPendingCompensationChanges } from '../../shared/getPendingCompensationChanges'\nimport { CompensationEditJobForm } from '../CompensationEditJobForm/CompensationEditJobForm'\nimport { CompensationEditPendingJobForm } from '../CompensationEditPendingJobForm/CompensationEditPendingJobForm'\nimport { BaseLayout, type CommonComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport { type EventType } from '@/shared/constants'\n\n/**\n * Props for {@link CompensationEditForm}.\n *\n * @public\n */\nexport interface CompensationEditFormProps extends CommonComponentInterface<'Employee.Management.Compensation'> {\n /** The associated employee identifier. */\n employeeId: string\n /**\n * The id of the job whose compensation is being edited (for example, the `jobId` from the\n * {@link CompensationCard} `employee/management/compensation/card/editRequested` payload).\n * The form inspects the job's compensations to decide whether to edit the current\n * compensation or an already-scheduled future-dated change.\n */\n jobId: string\n /** Callback invoked when the form emits an event. See the events table on {@link CompensationEditForm} for the available event types and payloads. */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Standalone form that edits the compensation for a single job, branching automatically between editing the current compensation and an already-scheduled future-dated change.\n *\n * @remarks\n * Pair with {@link CompensationCard} to route its `employee/management/compensation/card/editRequested` event to this form. {@link Compensation} bundles the card, the three form surfaces (edit, add job, add another job), and the swap and alert wiring as a single drop-in; reach for this form directly only when that orchestration is the wrong fit (for example, when the form needs to render in a modal or drawer, or when the swap is driven by a router).\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/compensation/editForm/submitted` | Fired after the compensation change is saved; use it to return to the card | The updated `Compensation` entity |\n * | `employee/management/compensation/editForm/cancelled` | Fired when the user clicks Cancel; use it to return to the card | — |\n *\n * @param props - See {@link CompensationEditFormProps}.\n * @returns The rendered compensation edit form.\n * @public\n * @group Block Components\n */\nexport function CompensationEditForm({\n employeeId,\n jobId,\n onEvent,\n dictionary,\n}: CompensationEditFormProps) {\n const jobsQuery = useJobsAndCompensationsGetJobs({ employeeId }, { enabled: !!employeeId })\n\n if (jobsQuery.isLoading || !jobsQuery.data) {\n const errorHandling = composeErrorHandler([jobsQuery])\n return <BaseLayout isLoading error={errorHandling.errors} />\n }\n\n const job = jobsQuery.data.jobs?.find(j => j.uuid === jobId)\n\n // The API does not guarantee ordering of job.compensations, so rely on the\n // same sorted helper that drives the card display (ascending by effectiveDate)\n // to find the nearest pending change.\n const nearestPending = getPendingCompensationChanges(job ? [job] : [])[0]\n\n if (nearestPending) {\n return (\n <CompensationEditPendingJobForm\n employeeId={employeeId}\n jobId={jobId}\n compensationId={nearestPending.compensationUuid}\n isNewJob={nearestPending.isNewJob}\n isPrimaryJob={job?.primary ?? false}\n onEvent={onEvent}\n dictionary={dictionary}\n />\n )\n }\n\n return (\n <CompensationEditJobForm\n employeeId={employeeId}\n jobId={jobId}\n onEvent={onEvent}\n dictionary={dictionary}\n />\n )\n}\n"],"names":["CompensationEditForm","employeeId","jobId","onEvent","dictionary","jobsQuery","useJobsAndCompensationsGetJobs","errorHandling","composeErrorHandler","BaseLayout","job","j","nearestPending","getPendingCompensationChanges","jsx","CompensationEditPendingJobForm","CompensationEditJobForm"],"mappings":";;;;;;;;AA4CO,SAASA,EAAqB;AAAA,EACnC,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,YAAAC;AACF,GAA8B;AAC5B,QAAMC,IAAYC,EAA+B,EAAE,YAAAL,EAAA,GAAc,EAAE,SAAS,CAAC,CAACA,GAAY;AAE1F,MAAII,EAAU,aAAa,CAACA,EAAU,MAAM;AAC1C,UAAME,IAAgBC,EAAoB,CAACH,CAAS,CAAC;AACrD,6BAAQI,GAAA,EAAW,WAAS,IAAC,OAAOF,EAAc,QAAQ;AAAA,EAC5D;AAEA,QAAMG,IAAML,EAAU,KAAK,MAAM,KAAK,CAAAM,MAAKA,EAAE,SAAST,CAAK,GAKrDU,IAAiBC,EAA8BH,IAAM,CAACA,CAAG,IAAI,CAAA,CAAE,EAAE,CAAC;AAExE,SAAIE,IAEA,gBAAAE;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,YAAAd;AAAA,MACA,OAAAC;AAAA,MACA,gBAAgBU,EAAe;AAAA,MAC/B,UAAUA,EAAe;AAAA,MACzB,cAAcF,GAAK,WAAW;AAAA,MAC9B,SAAAP;AAAA,MACA,YAAAC;AAAA,IAAA;AAAA,EAAA,IAMJ,gBAAAU;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,YAAAf;AAAA,MACA,OAAAC;AAAA,MACA,SAAAC;AAAA,MACA,YAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -7,12 +7,13 @@ import { useCompensationForm as N } from "../../shared/useCompensationForm/useCo
|
|
|
7
7
|
import { ManagementCompensationFormBody as L } from "../ManagementCompensationFormBody.js";
|
|
8
8
|
import T from "./CompensationEditJobForm.module.scss.js";
|
|
9
9
|
import { BaseBoundaries as _, BaseLayout as u } from "../../../../Base/Base.js";
|
|
10
|
+
import "../../../../Base/useBase.js";
|
|
10
11
|
import { Form as h } from "../../../../Common/Form/Form.js";
|
|
11
12
|
import { useComponentDictionary as S, useI18n as y } from "../../../../../i18n/I18n.js";
|
|
12
13
|
import { composeErrorHandler as l } from "../../../../../partner-hook-utils/composeErrorHandler.js";
|
|
13
14
|
import { composeSubmitHandler as D } from "../../../../../partner-hook-utils/form/composeSubmitHandler.js";
|
|
14
15
|
import { componentEvents as f } from "../../../../../shared/constants.js";
|
|
15
|
-
function
|
|
16
|
+
function q({ dictionary: e, ...r }) {
|
|
16
17
|
return S("Employee.Management.Compensation", e), /* @__PURE__ */ t(_, { componentName: "Employee.Management.Compensation", children: /* @__PURE__ */ t(A, { ...r }) });
|
|
17
18
|
}
|
|
18
19
|
function A({
|
|
@@ -85,6 +86,6 @@ function O({ employeeId: e, jobId: r, defaultValues: d, className: m, onEvent: s
|
|
|
85
86
|
) }) }) });
|
|
86
87
|
}
|
|
87
88
|
export {
|
|
88
|
-
|
|
89
|
+
q as CompensationEditJobForm
|
|
89
90
|
};
|
|
90
91
|
//# sourceMappingURL=CompensationEditJobForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompensationEditJobForm.js","sources":["../../../../../../src/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport { useTranslation } from 'react-i18next'\nimport { useJobsAndCompensationsGetJobs } from '@gusto/embedded-api-v-2025-11-15/react-query/jobsAndCompensationsGetJobs'\nimport { useJobForm } from '../../shared/useJobForm'\nimport { useCompensationForm, type CompensationFormData } from '../../shared/useCompensationForm'\nimport { ManagementCompensationFormBody } from '../ManagementCompensationFormBody'\nimport styles from './CompensationEditJobForm.module.scss'\nimport { BaseBoundaries, BaseLayout, type CommonComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport { composeSubmitHandler } from '@/partner-hook-utils/form/composeSubmitHandler'\nimport { componentEvents, type EventType } from '@/shared/constants'\n\n/**\n * Props for {@link CompensationEditJobForm}.\n *\n * @public\n */\nexport interface CompensationEditJobFormProps extends CommonComponentInterface<'Employee.Management.Compensation'> {\n /** The associated employee identifier. */\n employeeId: string\n /** The job whose compensation is being edited. */\n jobId: string\n /** Fires `EMPLOYEE_MANAGEMENT_COMPENSATION_EDIT_FORM_SUBMITTED` (with the saved\n * `Compensation`) on a successful save, and\n * `EMPLOYEE_MANAGEMENT_COMPENSATION_EDIT_FORM_CANCELLED` when the user cancels. */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Schedules a future-dated compensation change for a job that's already in effect.\n *\n * @public\n */\nexport function CompensationEditJobForm({ dictionary, ...props }: CompensationEditJobFormProps) {\n useComponentDictionary('Employee.Management.Compensation', dictionary)\n return (\n <BaseBoundaries componentName=\"Employee.Management.Compensation\">\n <CompensationDefaultsLoader {...props} />\n </BaseBoundaries>\n )\n}\n\ntype LoaderProps = Omit<CompensationEditJobFormProps, 'dictionary'>\n\n// Fetches the current job's compensation data to pre-populate the form as\n// defaultValues before rendering Root. Uses the same non-suspense query that\n// useCompensationForm uses internally — React Query dedupes the request so no\n// extra network call is made once Root mounts.\n// defaultValues from CommonComponentInterface (unknown) is excluded from the\n// spread so it doesn't conflict with Root's typed defaultValues prop.\nfunction CompensationDefaultsLoader({\n employeeId,\n jobId,\n defaultValues: _baseDefaults,\n ...rest\n}: LoaderProps) {\n const jobsQuery = useJobsAndCompensationsGetJobs({ employeeId }, { enabled: !!employeeId })\n\n if (jobsQuery.isLoading || !jobsQuery.data) {\n const errorHandling = composeErrorHandler([jobsQuery])\n return <BaseLayout isLoading error={errorHandling.errors} />\n }\n\n const job = jobsQuery.data.jobs?.find(j => j.uuid === jobId)\n const currentComp = job?.compensations?.find(c => c.uuid === job.currentCompensationUuid)\n\n const defaultValues: Partial<CompensationFormData> | undefined = currentComp\n ? {\n // Title lives on compensation in the API — `job.title` can lag\n // behind comp-level edits on secondaries, so seed directly from\n // the comp.\n title: currentComp.title ?? undefined,\n flsaStatus: currentComp.flsaStatus ?? undefined,\n rate: Number(currentComp.rate),\n paymentUnit: currentComp.paymentUnit ?? undefined,\n adjustForMinimumWage: currentComp.adjustForMinimumWage ?? false,\n minimumWageId: currentComp.minimumWages?.[0]?.uuid ?? '',\n // effectiveDate intentionally omitted — user must choose a future date\n }\n : undefined\n\n return <Root employeeId={employeeId} jobId={jobId} defaultValues={defaultValues} {...rest} />\n}\n\ninterface RootProps extends LoaderProps {\n defaultValues?: Partial<CompensationFormData>\n}\n\nfunction Root({ employeeId, jobId, defaultValues, className, onEvent }: RootProps) {\n useI18n('Employee.Management.Compensation')\n const { t } = useTranslation('Employee.Management.Compensation')\n\n // Job form handles the non-effective-dated fields: 2% shareholder + WA WC.\n // Title is suppressed here because the compensation form owns title\n // (effective-dated alongside rate/unit/FLSA on the future-dated row).\n // Hire-date is suppressed because this surface never edits it.\n const jobForm = useJobForm({\n employeeId,\n jobId,\n withTitleField: false,\n withHireDateField: false,\n shouldFocusError: false,\n })\n\n // Compensation form runs in create mode (no compensationId) → POST\n // /v1/jobs/:jobId/compensations, creating a new future-dated compensation.\n // The form is pre-populated with the current comp's values via defaultValues\n // (fetched by CompensationDefaultsLoader) so the user can edit from the\n // current state, and picks a future effectiveDate to schedule the change.\n const compensationForm = useCompensationForm({\n employeeId,\n jobId,\n defaultValues,\n withEffectiveDateField: true,\n optionalFieldsToRequire: {\n create: ['title'],\n },\n shouldFocusError: false,\n })\n\n if (jobForm.isLoading || compensationForm.isLoading) {\n const loadingErrorHandling = composeErrorHandler([jobForm, compensationForm])\n return <BaseLayout isLoading error={loadingErrorHandling.errors} />\n }\n\n // PUT job first (immediate mutation of 2% shareholder / WC), then POST\n // the new compensation (the future-dated change). composeSubmitHandler\n // validates both forms in parallel and short-circuits before any network\n // I/O if either fails.\n const submitResult = composeSubmitHandler([jobForm, compensationForm], async () => {\n const jobResult = await jobForm.actions.onSubmit()\n if (!jobResult) return\n\n const compensationResult = await compensationForm.actions.onSubmit()\n if (!compensationResult) return\n\n onEvent(\n componentEvents.EMPLOYEE_MANAGEMENT_COMPENSATION_EDIT_FORM_SUBMITTED,\n compensationResult.data,\n )\n })\n\n const errorHandling = composeErrorHandler([submitResult])\n const isPending = jobForm.status.isPending || compensationForm.status.isPending\n\n return (\n <section className={classNames(styles.container, className)}>\n <BaseLayout error={errorHandling.errors}>\n <Form onSubmit={submitResult.handleSubmit}>\n <ManagementCompensationFormBody\n jobForm={jobForm}\n compensationForm={compensationForm}\n title={t('editCompensationTitle')}\n submitCtaLabel={t('saveCta')}\n isPending={isPending}\n onCancel={() => {\n onEvent(componentEvents.EMPLOYEE_MANAGEMENT_COMPENSATION_EDIT_FORM_CANCELLED)\n }}\n />\n </Form>\n </BaseLayout>\n </section>\n )\n}\n"],"names":["CompensationEditJobForm","dictionary","props","useComponentDictionary","jsx","BaseBoundaries","CompensationDefaultsLoader","employeeId","jobId","_baseDefaults","rest","jobsQuery","useJobsAndCompensationsGetJobs","errorHandling","composeErrorHandler","BaseLayout","job","j","currentComp","c","defaultValues","Root","className","onEvent","useI18n","t","useTranslation","jobForm","useJobForm","compensationForm","useCompensationForm","loadingErrorHandling","submitResult","composeSubmitHandler","compensationResult","componentEvents","isPending","classNames","styles","Form","ManagementCompensationFormBody"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"CompensationEditJobForm.js","sources":["../../../../../../src/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport { useTranslation } from 'react-i18next'\nimport { useJobsAndCompensationsGetJobs } from '@gusto/embedded-api-v-2025-11-15/react-query/jobsAndCompensationsGetJobs'\nimport { useJobForm } from '../../shared/useJobForm'\nimport { useCompensationForm, type CompensationFormData } from '../../shared/useCompensationForm'\nimport { ManagementCompensationFormBody } from '../ManagementCompensationFormBody'\nimport styles from './CompensationEditJobForm.module.scss'\nimport { BaseBoundaries, BaseLayout, type CommonComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport { composeSubmitHandler } from '@/partner-hook-utils/form/composeSubmitHandler'\nimport { componentEvents, type EventType } from '@/shared/constants'\n\n/**\n * Props for {@link CompensationEditJobForm}.\n *\n * @public\n */\nexport interface CompensationEditJobFormProps extends CommonComponentInterface<'Employee.Management.Compensation'> {\n /** The associated employee identifier. */\n employeeId: string\n /** The job whose compensation is being edited. */\n jobId: string\n /** Fires `EMPLOYEE_MANAGEMENT_COMPENSATION_EDIT_FORM_SUBMITTED` (with the saved\n * `Compensation`) on a successful save, and\n * `EMPLOYEE_MANAGEMENT_COMPENSATION_EDIT_FORM_CANCELLED` when the user cancels. */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Schedules a future-dated compensation change for a job that's already in effect.\n *\n * @public\n */\nexport function CompensationEditJobForm({ dictionary, ...props }: CompensationEditJobFormProps) {\n useComponentDictionary('Employee.Management.Compensation', dictionary)\n return (\n <BaseBoundaries componentName=\"Employee.Management.Compensation\">\n <CompensationDefaultsLoader {...props} />\n </BaseBoundaries>\n )\n}\n\ntype LoaderProps = Omit<CompensationEditJobFormProps, 'dictionary'>\n\n// Fetches the current job's compensation data to pre-populate the form as\n// defaultValues before rendering Root. Uses the same non-suspense query that\n// useCompensationForm uses internally — React Query dedupes the request so no\n// extra network call is made once Root mounts.\n// defaultValues from CommonComponentInterface (unknown) is excluded from the\n// spread so it doesn't conflict with Root's typed defaultValues prop.\nfunction CompensationDefaultsLoader({\n employeeId,\n jobId,\n defaultValues: _baseDefaults,\n ...rest\n}: LoaderProps) {\n const jobsQuery = useJobsAndCompensationsGetJobs({ employeeId }, { enabled: !!employeeId })\n\n if (jobsQuery.isLoading || !jobsQuery.data) {\n const errorHandling = composeErrorHandler([jobsQuery])\n return <BaseLayout isLoading error={errorHandling.errors} />\n }\n\n const job = jobsQuery.data.jobs?.find(j => j.uuid === jobId)\n const currentComp = job?.compensations?.find(c => c.uuid === job.currentCompensationUuid)\n\n const defaultValues: Partial<CompensationFormData> | undefined = currentComp\n ? {\n // Title lives on compensation in the API — `job.title` can lag\n // behind comp-level edits on secondaries, so seed directly from\n // the comp.\n title: currentComp.title ?? undefined,\n flsaStatus: currentComp.flsaStatus ?? undefined,\n rate: Number(currentComp.rate),\n paymentUnit: currentComp.paymentUnit ?? undefined,\n adjustForMinimumWage: currentComp.adjustForMinimumWage ?? false,\n minimumWageId: currentComp.minimumWages?.[0]?.uuid ?? '',\n // effectiveDate intentionally omitted — user must choose a future date\n }\n : undefined\n\n return <Root employeeId={employeeId} jobId={jobId} defaultValues={defaultValues} {...rest} />\n}\n\ninterface RootProps extends LoaderProps {\n defaultValues?: Partial<CompensationFormData>\n}\n\nfunction Root({ employeeId, jobId, defaultValues, className, onEvent }: RootProps) {\n useI18n('Employee.Management.Compensation')\n const { t } = useTranslation('Employee.Management.Compensation')\n\n // Job form handles the non-effective-dated fields: 2% shareholder + WA WC.\n // Title is suppressed here because the compensation form owns title\n // (effective-dated alongside rate/unit/FLSA on the future-dated row).\n // Hire-date is suppressed because this surface never edits it.\n const jobForm = useJobForm({\n employeeId,\n jobId,\n withTitleField: false,\n withHireDateField: false,\n shouldFocusError: false,\n })\n\n // Compensation form runs in create mode (no compensationId) → POST\n // /v1/jobs/:jobId/compensations, creating a new future-dated compensation.\n // The form is pre-populated with the current comp's values via defaultValues\n // (fetched by CompensationDefaultsLoader) so the user can edit from the\n // current state, and picks a future effectiveDate to schedule the change.\n const compensationForm = useCompensationForm({\n employeeId,\n jobId,\n defaultValues,\n withEffectiveDateField: true,\n optionalFieldsToRequire: {\n create: ['title'],\n },\n shouldFocusError: false,\n })\n\n if (jobForm.isLoading || compensationForm.isLoading) {\n const loadingErrorHandling = composeErrorHandler([jobForm, compensationForm])\n return <BaseLayout isLoading error={loadingErrorHandling.errors} />\n }\n\n // PUT job first (immediate mutation of 2% shareholder / WC), then POST\n // the new compensation (the future-dated change). composeSubmitHandler\n // validates both forms in parallel and short-circuits before any network\n // I/O if either fails.\n const submitResult = composeSubmitHandler([jobForm, compensationForm], async () => {\n const jobResult = await jobForm.actions.onSubmit()\n if (!jobResult) return\n\n const compensationResult = await compensationForm.actions.onSubmit()\n if (!compensationResult) return\n\n onEvent(\n componentEvents.EMPLOYEE_MANAGEMENT_COMPENSATION_EDIT_FORM_SUBMITTED,\n compensationResult.data,\n )\n })\n\n const errorHandling = composeErrorHandler([submitResult])\n const isPending = jobForm.status.isPending || compensationForm.status.isPending\n\n return (\n <section className={classNames(styles.container, className)}>\n <BaseLayout error={errorHandling.errors}>\n <Form onSubmit={submitResult.handleSubmit}>\n <ManagementCompensationFormBody\n jobForm={jobForm}\n compensationForm={compensationForm}\n title={t('editCompensationTitle')}\n submitCtaLabel={t('saveCta')}\n isPending={isPending}\n onCancel={() => {\n onEvent(componentEvents.EMPLOYEE_MANAGEMENT_COMPENSATION_EDIT_FORM_CANCELLED)\n }}\n />\n </Form>\n </BaseLayout>\n </section>\n )\n}\n"],"names":["CompensationEditJobForm","dictionary","props","useComponentDictionary","jsx","BaseBoundaries","CompensationDefaultsLoader","employeeId","jobId","_baseDefaults","rest","jobsQuery","useJobsAndCompensationsGetJobs","errorHandling","composeErrorHandler","BaseLayout","job","j","currentComp","c","defaultValues","Root","className","onEvent","useI18n","t","useTranslation","jobForm","useJobForm","compensationForm","useCompensationForm","loadingErrorHandling","submitResult","composeSubmitHandler","compensationResult","componentEvents","isPending","classNames","styles","Form","ManagementCompensationFormBody"],"mappings":"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"}
|
|
@@ -6,12 +6,13 @@ import { useCompensationForm as S } from "../../shared/useCompensationForm/useCo
|
|
|
6
6
|
import { ManagementCompensationFormBody as _ } from "../ManagementCompensationFormBody.js";
|
|
7
7
|
import v from "./CompensationEditPendingJobForm.module.scss.js";
|
|
8
8
|
import { BaseBoundaries as L, BaseLayout as d } from "../../../../Base/Base.js";
|
|
9
|
+
import "../../../../Base/useBase.js";
|
|
9
10
|
import { Form as O } from "../../../../Common/Form/Form.js";
|
|
10
11
|
import { useComponentDictionary as P, useI18n as R } from "../../../../../i18n/I18n.js";
|
|
11
12
|
import { composeErrorHandler as f } from "../../../../../partner-hook-utils/composeErrorHandler.js";
|
|
12
13
|
import { composeSubmitHandler as A } from "../../../../../partner-hook-utils/form/composeSubmitHandler.js";
|
|
13
14
|
import { componentEvents as E } from "../../../../../shared/constants.js";
|
|
14
|
-
function
|
|
15
|
+
function Q({
|
|
15
16
|
dictionary: i,
|
|
16
17
|
...r
|
|
17
18
|
}) {
|
|
@@ -79,6 +80,6 @@ function w({
|
|
|
79
80
|
) }) }) });
|
|
80
81
|
}
|
|
81
82
|
export {
|
|
82
|
-
|
|
83
|
+
Q as CompensationEditPendingJobForm
|
|
83
84
|
};
|
|
84
85
|
//# sourceMappingURL=CompensationEditPendingJobForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompensationEditPendingJobForm.js","sources":["../../../../../../src/components/Employee/Compensation/management/CompensationEditPendingJobForm/CompensationEditPendingJobForm.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport { useTranslation } from 'react-i18next'\nimport { useJobForm } from '../../shared/useJobForm'\nimport { useCompensationForm } from '../../shared/useCompensationForm'\nimport { ManagementCompensationFormBody } from '../ManagementCompensationFormBody'\nimport styles from './CompensationEditPendingJobForm.module.scss'\nimport { BaseBoundaries, BaseLayout, type CommonComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport { composeSubmitHandler } from '@/partner-hook-utils/form/composeSubmitHandler'\nimport { componentEvents, type EventType } from '@/shared/constants'\n\n/**\n * Props for {@link CompensationEditPendingJobForm}.\n *\n * @public\n */\nexport interface CompensationEditPendingJobFormProps extends CommonComponentInterface<'Employee.Management.Compensation'> {\n /** The associated employee identifier. */\n employeeId: string\n /** The job whose pending compensation is being edited. */\n jobId: string\n /** The UUID of the pending (future-dated) compensation to update. Always required — this\n * component only operates in update mode. */\n compensationId: string\n /**\n * True when the job has no current (on-or-before-today) compensation — i.e. it hasn't\n * started yet. Drives which date field is shown and how the submit syncs hire_date.\n */\n isNewJob: boolean\n /**\n * True when this is the employee's primary job. Combined with `isNewJob`, determines\n * whether to show a Hire date field (primary) or Effective date field (secondary/change).\n */\n isPrimaryJob: boolean\n /** Fires `EMPLOYEE_MANAGEMENT_COMPENSATION_EDIT_FORM_SUBMITTED` (with the saved\n * `Compensation`) on a successful save, and\n * `EMPLOYEE_MANAGEMENT_COMPENSATION_EDIT_FORM_CANCELLED` when the user cancels. */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Edits a pending (future-dated) compensation in place.\n *\n * @public\n */\nexport function CompensationEditPendingJobForm({\n dictionary,\n ...props\n}: CompensationEditPendingJobFormProps) {\n useComponentDictionary('Employee.Management.Compensation', dictionary)\n return (\n <BaseBoundaries componentName=\"Employee.Management.Compensation\">\n <Root {...props} />\n </BaseBoundaries>\n )\n}\n\ntype RootProps = Omit<CompensationEditPendingJobFormProps, 'dictionary'>\n\nfunction Root({\n employeeId,\n jobId,\n compensationId,\n isNewJob,\n isPrimaryJob,\n className,\n onEvent,\n}: RootProps) {\n useI18n('Employee.Management.Compensation')\n const { t } = useTranslation('Employee.Management.Compensation')\n\n // For a primary new job (hire date in the future, no current comp), the hire\n // date field is shown instead of the effective date field. This keeps\n // hire_date and comp effective_date in sync so the API doesn't auto-create a\n // second compensation when the initial comp moves off the hire date.\n const isPrimaryNewJob = isNewJob && isPrimaryJob\n\n // Title is owned by `useCompensationForm` here: title is stored on\n // compensation in the API (job.title is just a denormalized snapshot of\n // the primary comp's title), so writing it via PUT /v1/compensations is\n // the direct path. The dashboard row reads the title off the comp pointed\n // to by `currentCompensationUuid`, so the change surfaces immediately\n // whether the job is in effect today or still pending.\n const jobForm = useJobForm({\n employeeId,\n jobId,\n withTitleField: false,\n withHireDateField: isPrimaryNewJob,\n optionalFieldsToRequire: isPrimaryNewJob ? { update: ['hireDate'] } : undefined,\n shouldFocusError: false,\n })\n\n const compensationForm = useCompensationForm({\n employeeId,\n jobId,\n compensationId,\n // Primary new job: comp date is set via jobForm's hire date on submit —\n // hide it here to avoid showing two date fields.\n withEffectiveDateField: !isPrimaryNewJob,\n optionalFieldsToRequire: {\n update: isPrimaryNewJob\n ? ['title', 'flsaStatus', 'rate', 'paymentUnit']\n : ['title', 'flsaStatus', 'rate', 'paymentUnit', 'effectiveDate'],\n },\n shouldFocusError: false,\n })\n\n if (jobForm.isLoading || compensationForm.isLoading) {\n const loadingErrorHandling = composeErrorHandler([jobForm, compensationForm])\n return <BaseLayout isLoading error={loadingErrorHandling.errors} />\n }\n\n const submitResult = composeSubmitHandler([jobForm, compensationForm], async () => {\n // For a primary new job, the user edits the hire date field. We read it\n // back here and pass it to the comp submit so both the job's hire_date and\n // the comp's effective_date land on the same value — preventing the API\n // from auto-creating a second compensation to fill the gap at the old date.\n const hireDateOverride = isPrimaryNewJob\n ? (jobForm.form.hookFormInternals.formMethods.getValues('hireDate') ?? undefined)\n : undefined\n\n const jobResult = await jobForm.actions.onSubmit()\n if (!jobResult) return\n\n // When the hire date moves forward, the API auto-syncs the compensation's\n // effective_date to the new hire_date as part of the job PUT, which bumps\n // the compensation's version. Read it from the job response so the\n // subsequent compensation PUT doesn't send a stale version.\n const freshCompVersion = jobResult.data.compensations?.find(\n c => c.uuid === compensationId,\n )?.version\n\n const compensationResult = await compensationForm.actions.onSubmit({\n ...(hireDateOverride ? { effectiveDate: hireDateOverride } : {}),\n compensationVersion: freshCompVersion,\n })\n if (!compensationResult) return\n\n onEvent(\n componentEvents.EMPLOYEE_MANAGEMENT_COMPENSATION_EDIT_FORM_SUBMITTED,\n compensationResult.data,\n )\n })\n\n const errorHandling = composeErrorHandler([submitResult])\n const isPending = jobForm.status.isPending || compensationForm.status.isPending\n\n return (\n <section className={classNames(styles.container, className)}>\n <BaseLayout error={errorHandling.errors}>\n <Form onSubmit={submitResult.handleSubmit}>\n <ManagementCompensationFormBody\n jobForm={jobForm}\n compensationForm={compensationForm}\n title={t('editCompensationTitle')}\n submitCtaLabel={t('saveCta')}\n isPending={isPending}\n onCancel={() => {\n onEvent(componentEvents.EMPLOYEE_MANAGEMENT_COMPENSATION_EDIT_FORM_CANCELLED)\n }}\n />\n </Form>\n </BaseLayout>\n </section>\n )\n}\n"],"names":["CompensationEditPendingJobForm","dictionary","props","useComponentDictionary","jsx","BaseBoundaries","Root","employeeId","jobId","compensationId","isNewJob","isPrimaryJob","className","onEvent","useI18n","t","useTranslation","isPrimaryNewJob","jobForm","useJobForm","compensationForm","useCompensationForm","loadingErrorHandling","composeErrorHandler","BaseLayout","submitResult","composeSubmitHandler","hireDateOverride","jobResult","freshCompVersion","c","compensationResult","componentEvents","errorHandling","isPending","classNames","styles","Form","ManagementCompensationFormBody"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CompensationEditPendingJobForm.js","sources":["../../../../../../src/components/Employee/Compensation/management/CompensationEditPendingJobForm/CompensationEditPendingJobForm.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport { useTranslation } from 'react-i18next'\nimport { useJobForm } from '../../shared/useJobForm'\nimport { useCompensationForm } from '../../shared/useCompensationForm'\nimport { ManagementCompensationFormBody } from '../ManagementCompensationFormBody'\nimport styles from './CompensationEditPendingJobForm.module.scss'\nimport { BaseBoundaries, BaseLayout, type CommonComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport { composeSubmitHandler } from '@/partner-hook-utils/form/composeSubmitHandler'\nimport { componentEvents, type EventType } from '@/shared/constants'\n\n/**\n * Props for {@link CompensationEditPendingJobForm}.\n *\n * @public\n */\nexport interface CompensationEditPendingJobFormProps extends CommonComponentInterface<'Employee.Management.Compensation'> {\n /** The associated employee identifier. */\n employeeId: string\n /** The job whose pending compensation is being edited. */\n jobId: string\n /** The UUID of the pending (future-dated) compensation to update. Always required — this\n * component only operates in update mode. */\n compensationId: string\n /**\n * True when the job has no current (on-or-before-today) compensation — i.e. it hasn't\n * started yet. Drives which date field is shown and how the submit syncs hire_date.\n */\n isNewJob: boolean\n /**\n * True when this is the employee's primary job. Combined with `isNewJob`, determines\n * whether to show a Hire date field (primary) or Effective date field (secondary/change).\n */\n isPrimaryJob: boolean\n /** Fires `EMPLOYEE_MANAGEMENT_COMPENSATION_EDIT_FORM_SUBMITTED` (with the saved\n * `Compensation`) on a successful save, and\n * `EMPLOYEE_MANAGEMENT_COMPENSATION_EDIT_FORM_CANCELLED` when the user cancels. */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Edits a pending (future-dated) compensation in place.\n *\n * @public\n */\nexport function CompensationEditPendingJobForm({\n dictionary,\n ...props\n}: CompensationEditPendingJobFormProps) {\n useComponentDictionary('Employee.Management.Compensation', dictionary)\n return (\n <BaseBoundaries componentName=\"Employee.Management.Compensation\">\n <Root {...props} />\n </BaseBoundaries>\n )\n}\n\ntype RootProps = Omit<CompensationEditPendingJobFormProps, 'dictionary'>\n\nfunction Root({\n employeeId,\n jobId,\n compensationId,\n isNewJob,\n isPrimaryJob,\n className,\n onEvent,\n}: RootProps) {\n useI18n('Employee.Management.Compensation')\n const { t } = useTranslation('Employee.Management.Compensation')\n\n // For a primary new job (hire date in the future, no current comp), the hire\n // date field is shown instead of the effective date field. This keeps\n // hire_date and comp effective_date in sync so the API doesn't auto-create a\n // second compensation when the initial comp moves off the hire date.\n const isPrimaryNewJob = isNewJob && isPrimaryJob\n\n // Title is owned by `useCompensationForm` here: title is stored on\n // compensation in the API (job.title is just a denormalized snapshot of\n // the primary comp's title), so writing it via PUT /v1/compensations is\n // the direct path. The dashboard row reads the title off the comp pointed\n // to by `currentCompensationUuid`, so the change surfaces immediately\n // whether the job is in effect today or still pending.\n const jobForm = useJobForm({\n employeeId,\n jobId,\n withTitleField: false,\n withHireDateField: isPrimaryNewJob,\n optionalFieldsToRequire: isPrimaryNewJob ? { update: ['hireDate'] } : undefined,\n shouldFocusError: false,\n })\n\n const compensationForm = useCompensationForm({\n employeeId,\n jobId,\n compensationId,\n // Primary new job: comp date is set via jobForm's hire date on submit —\n // hide it here to avoid showing two date fields.\n withEffectiveDateField: !isPrimaryNewJob,\n optionalFieldsToRequire: {\n update: isPrimaryNewJob\n ? ['title', 'flsaStatus', 'rate', 'paymentUnit']\n : ['title', 'flsaStatus', 'rate', 'paymentUnit', 'effectiveDate'],\n },\n shouldFocusError: false,\n })\n\n if (jobForm.isLoading || compensationForm.isLoading) {\n const loadingErrorHandling = composeErrorHandler([jobForm, compensationForm])\n return <BaseLayout isLoading error={loadingErrorHandling.errors} />\n }\n\n const submitResult = composeSubmitHandler([jobForm, compensationForm], async () => {\n // For a primary new job, the user edits the hire date field. We read it\n // back here and pass it to the comp submit so both the job's hire_date and\n // the comp's effective_date land on the same value — preventing the API\n // from auto-creating a second compensation to fill the gap at the old date.\n const hireDateOverride = isPrimaryNewJob\n ? (jobForm.form.hookFormInternals.formMethods.getValues('hireDate') ?? undefined)\n : undefined\n\n const jobResult = await jobForm.actions.onSubmit()\n if (!jobResult) return\n\n // When the hire date moves forward, the API auto-syncs the compensation's\n // effective_date to the new hire_date as part of the job PUT, which bumps\n // the compensation's version. Read it from the job response so the\n // subsequent compensation PUT doesn't send a stale version.\n const freshCompVersion = jobResult.data.compensations?.find(\n c => c.uuid === compensationId,\n )?.version\n\n const compensationResult = await compensationForm.actions.onSubmit({\n ...(hireDateOverride ? { effectiveDate: hireDateOverride } : {}),\n compensationVersion: freshCompVersion,\n })\n if (!compensationResult) return\n\n onEvent(\n componentEvents.EMPLOYEE_MANAGEMENT_COMPENSATION_EDIT_FORM_SUBMITTED,\n compensationResult.data,\n )\n })\n\n const errorHandling = composeErrorHandler([submitResult])\n const isPending = jobForm.status.isPending || compensationForm.status.isPending\n\n return (\n <section className={classNames(styles.container, className)}>\n <BaseLayout error={errorHandling.errors}>\n <Form onSubmit={submitResult.handleSubmit}>\n <ManagementCompensationFormBody\n jobForm={jobForm}\n compensationForm={compensationForm}\n title={t('editCompensationTitle')}\n submitCtaLabel={t('saveCta')}\n isPending={isPending}\n onCancel={() => {\n onEvent(componentEvents.EMPLOYEE_MANAGEMENT_COMPENSATION_EDIT_FORM_CANCELLED)\n }}\n />\n </Form>\n </BaseLayout>\n </section>\n )\n}\n"],"names":["CompensationEditPendingJobForm","dictionary","props","useComponentDictionary","jsx","BaseBoundaries","Root","employeeId","jobId","compensationId","isNewJob","isPrimaryJob","className","onEvent","useI18n","t","useTranslation","isPrimaryNewJob","jobForm","useJobForm","compensationForm","useCompensationForm","loadingErrorHandling","composeErrorHandler","BaseLayout","submitResult","composeSubmitHandler","hireDateOverride","jobResult","freshCompVersion","c","compensationResult","componentEvents","errorHandling","isPending","classNames","styles","Form","ManagementCompensationFormBody"],"mappings":";;;;;;;;;;;;;;AAgDO,SAASA,EAA+B;AAAA,EAC7C,YAAAC;AAAA,EACA,GAAGC;AACL,GAAwC;AACtC,SAAAC,EAAuB,oCAAoCF,CAAU,GAEnE,gBAAAG,EAACC,KAAe,eAAc,oCAC5B,4BAACC,GAAA,EAAM,GAAGJ,GAAO,EAAA,CACnB;AAEJ;AAIA,SAASI,EAAK;AAAA,EACZ,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AACF,GAAc;AACZ,EAAAC,EAAQ,kCAAkC;AAC1C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kCAAkC,GAMzDC,IAAkBP,KAAYC,GAQ9BO,IAAUC,EAAW;AAAA,IACzB,YAAAZ;AAAA,IACA,OAAAC;AAAA,IACA,gBAAgB;AAAA,IAChB,mBAAmBS;AAAA,IACnB,yBAAyBA,IAAkB,EAAE,QAAQ,CAAC,UAAU,MAAM;AAAA,IACtE,kBAAkB;AAAA,EAAA,CACnB,GAEKG,IAAmBC,EAAoB;AAAA,IAC3C,YAAAd;AAAA,IACA,OAAAC;AAAA,IACA,gBAAAC;AAAA;AAAA;AAAA,IAGA,wBAAwB,CAACQ;AAAA,IACzB,yBAAyB;AAAA,MACvB,QAAQA,IACJ,CAAC,SAAS,cAAc,QAAQ,aAAa,IAC7C,CAAC,SAAS,cAAc,QAAQ,eAAe,eAAe;AAAA,IAAA;AAAA,IAEpE,kBAAkB;AAAA,EAAA,CACnB;AAED,MAAIC,EAAQ,aAAaE,EAAiB,WAAW;AACnD,UAAME,IAAuBC,EAAoB,CAACL,GAASE,CAAgB,CAAC;AAC5E,6BAAQI,GAAA,EAAW,WAAS,IAAC,OAAOF,EAAqB,QAAQ;AAAA,EACnE;AAEA,QAAMG,IAAeC,EAAqB,CAACR,GAASE,CAAgB,GAAG,YAAY;AAKjF,UAAMO,IAAmBV,IACpBC,EAAQ,KAAK,kBAAkB,YAAY,UAAU,UAAU,KAAK,SACrE,QAEEU,IAAY,MAAMV,EAAQ,QAAQ,SAAA;AACxC,QAAI,CAACU,EAAW;AAMhB,UAAMC,IAAmBD,EAAU,KAAK,eAAe;AAAA,MACrD,CAAAE,MAAKA,EAAE,SAASrB;AAAA,IAAA,GACf,SAEGsB,IAAqB,MAAMX,EAAiB,QAAQ,SAAS;AAAA,MACjE,GAAIO,IAAmB,EAAE,eAAeA,EAAA,IAAqB,CAAA;AAAA,MAC7D,qBAAqBE;AAAA,IAAA,CACtB;AACD,IAAKE,KAELlB;AAAA,MACEmB,EAAgB;AAAA,MAChBD,EAAmB;AAAA,IAAA;AAAA,EAEvB,CAAC,GAEKE,IAAgBV,EAAoB,CAACE,CAAY,CAAC,GAClDS,IAAYhB,EAAQ,OAAO,aAAaE,EAAiB,OAAO;AAEtE,2BACG,WAAA,EAAQ,WAAWe,EAAWC,EAAO,WAAWxB,CAAS,GACxD,UAAA,gBAAAR,EAACoB,GAAA,EAAW,OAAOS,EAAc,QAC/B,4BAACI,GAAA,EAAK,UAAUZ,EAAa,cAC3B,UAAA,gBAAArB;AAAA,IAACkC;AAAA,IAAA;AAAA,MACC,SAAApB;AAAA,MACA,kBAAAE;AAAA,MACA,OAAOL,EAAE,uBAAuB;AAAA,MAChC,gBAAgBA,EAAE,SAAS;AAAA,MAC3B,WAAAmB;AAAA,MACA,UAAU,MAAM;AACd,QAAArB,EAAQmB,EAAgB,oDAAoD;AAAA,MAC9E;AAAA,IAAA;AAAA,EAAA,EACF,CACF,GACF,GACF;AAEJ;"}
|
|
@@ -8,6 +8,7 @@ import { compensationStateMachine as S } from "./compensationStateMachine.js";
|
|
|
8
8
|
import { FlsaStatus as w } from "../../../../shared/constants.js";
|
|
9
9
|
import { useComponentDictionary as I } from "../../../../i18n/I18n.js";
|
|
10
10
|
import { BaseComponent as h } from "../../../Base/Base.js";
|
|
11
|
+
import "../../../Base/useBase.js";
|
|
11
12
|
import { Flow as v } from "../../../Flow/Flow.js";
|
|
12
13
|
import { useFlow as x } from "../../../Flow/useFlow.js";
|
|
13
14
|
import { JobsList as F } from "./JobsList/JobsList.js";
|
|
@@ -58,7 +59,7 @@ function D({
|
|
|
58
59
|
);
|
|
59
60
|
return /* @__PURE__ */ i(v, { machine: l, onEvent: r });
|
|
60
61
|
}
|
|
61
|
-
const
|
|
62
|
+
const z = () => {
|
|
62
63
|
const { employeeId: t, onEvent: o, startDate: n, defaultValues: e } = x(), { t: r } = C("common");
|
|
63
64
|
if (!t || !n)
|
|
64
65
|
throw new Error(
|
|
@@ -82,6 +83,6 @@ s.JobsList = F;
|
|
|
82
83
|
s.EditCompensation = T;
|
|
83
84
|
export {
|
|
84
85
|
s as Compensation,
|
|
85
|
-
|
|
86
|
+
z as CompensationContextual
|
|
86
87
|
};
|
|
87
88
|
//# sourceMappingURL=Compensation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Compensation.js","sources":["../../../../../src/components/Employee/Compensation/onboarding/Compensation.tsx"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport { createMachine } from 'robot3'\nimport { useTranslation } from 'react-i18next'\nimport { useJobsAndCompensationsGetJobsSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/jobsAndCompensationsGetJobs'\nimport { type Job } from '@gusto/embedded-api-v-2025-11-15/models/components/job'\nimport type { FlsaStatusType } from '@gusto/embedded-api-v-2025-11-15/models/components/flsastatustype'\nimport type { OnboardingContextInterface } from '../../OnboardingFlow/OnboardingFlowComponents'\nimport {\n InitialEditCompensationContextual,\n JobsListContextual,\n type CompensationFlowContextInterface,\n} from './CompensationFlowComponents'\nimport { compensationStateMachine } from './compensationStateMachine'\nimport { JobsList } from './JobsList'\nimport { EditCompensation } from './EditCompensation'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\nimport type { PAY_PERIODS } from '@/shared/constants'\nimport { FlsaStatus } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { Flow } from '@/components/Flow/Flow'\nimport { useFlow } from '@/components/Flow/useFlow'\n\ntype CompensationInitialState = 'initialEditJob' | 'viewJobs'\n\ninterface InitialFlowConfig {\n initialState: CompensationInitialState\n currentJobId: string | null\n}\n\nconst INITIAL_COMPONENT_BY_STATE: Record<\n CompensationInitialState,\n React.ComponentType<CommonComponentInterface>\n> = {\n initialEditJob: InitialEditCompensationContextual,\n viewJobs: JobsListContextual,\n}\n\nfunction deriveInitialFlowConfig(employeeJobs: Job[]): InitialFlowConfig {\n if (employeeJobs.length === 0) {\n return { initialState: 'initialEditJob', currentJobId: null }\n }\n\n const onlyJob = employeeJobs.length === 1 ? (employeeJobs[0] ?? null) : null\n const onlyJobCompensation = findCurrentCompensation(onlyJob)\n\n if (onlyJob && onlyJobCompensation?.flsaStatus !== FlsaStatus.NONEXEMPT) {\n return { initialState: 'initialEditJob', currentJobId: onlyJob.uuid }\n }\n\n return { initialState: 'viewJobs', currentJobId: null }\n}\n\n/**\n * Default values for the compensation form fields.\n *\n * @remarks\n * At least one of the fields must be provided. If employee data is available\n * via the API, these values are overwritten.\n *\n * @public\n */\nexport type CompensationDefaultValues = RequireAtLeastOne<{\n /** The compensation rate (an amount in dollars). */\n rate?: Job['rate']\n /** The job title. */\n title?: Job['title']\n /** The pay period — one of `Hour`, `Week`, `Month`, `Year`, `Paycheck`. */\n paymentUnit?: (typeof PAY_PERIODS)[keyof typeof PAY_PERIODS]\n /** The FLSA classification — drives whether the role is treated as exempt, nonexempt, etc. */\n flsaStatus?: FlsaStatusType\n}>\n\n/**\n * Props for {@link Compensation}.\n *\n * @public\n */\nexport interface CompensationProps extends BaseComponentInterface<'Employee.Compensation'> {\n /** The associated employee identifier. */\n employeeId: string\n /** The date the employee will start work. */\n startDate: string\n /** Default values for the compensation form fields. If employee data is available via the API, these values are overwritten. */\n defaultValues?: CompensationDefaultValues\n}\n\n/**\n * Onboarding step for collecting an employee's role and compensation details.\n *\n * @remarks\n * Collects the job title, employee type (hourly, salary), compensation\n * amount, and pay period. For hourly employees, allows configuring multiple\n * roles. Automatically routes between editing the only job (when an employee\n * has zero or one non-Nonexempt job) and a jobs-list view (when multiple\n * roles need to be managed) on first mount; on subsequent refetches the user\n * stays on their current step.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/job/created` | Fired after a job is successfully created | {@link Job} |\n * | `employee/job/updated` | Fired after a job is successfully updated | {@link Job} |\n * | `employee/job/deleted` | Fired after a job is successfully deleted | — |\n * | `employee/compensation/updated` | Fired after compensation details are updated | {@link Compensation} |\n * | `employee/compensation/done` | Fired when compensation setup is complete and the parent flow can advance | — |\n *\n * @param props - See {@link CompensationProps}.\n * @returns The compensation onboarding step.\n * @public\n * @group Block Components\n *\n * @example\n * ```tsx\n * import { EmployeeOnboarding } from '@gusto/embedded-react-sdk'\n *\n * function MyComponent() {\n * return (\n * <EmployeeOnboarding.Compensation\n * employeeId=\"4b3f930f-82cd-48a8-b797-798686e12e5e\"\n * startDate=\"2025-01-01\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport function Compensation(props: CompensationProps) {\n return (\n <BaseComponent {...props}>\n <CompensationFlow {...props} />\n </BaseComponent>\n )\n}\n\nconst findCurrentCompensation = (job?: Job | null) => {\n return job?.compensations?.find(comp => comp.uuid === job.currentCompensationUuid)\n}\n\nfunction CompensationFlow({\n employeeId,\n startDate,\n defaultValues,\n dictionary,\n onEvent,\n}: CompensationProps) {\n useComponentDictionary('Employee.Compensation', dictionary)\n\n const { data: jobsData } = useJobsAndCompensationsGetJobsSuspense({ employeeId })\n\n // Capture the routing decision from the first jobsData snapshot only. Suspense\n // guarantees that snapshot is fresh on first render. Subsequent refetches (e.g.\n // the getJobs invalidation that fires between EditCompensation's awaited job +\n // compensation mutations) must NOT re-seat the machine and reset the user's\n // place in the flow. Callers needing to re-derive routing for a different\n // employee should remount via `key`, matching the contract used by\n // OnboardingFlow / PayrollExecutionFlow / DismissalFlow.\n const [{ initialState, currentJobId }] = useState<InitialFlowConfig>(() =>\n deriveInitialFlowConfig(jobsData.jobs ?? []),\n )\n\n const manageCompensation = useMemo(\n () =>\n createMachine(\n initialState,\n compensationStateMachine,\n (initialContext: CompensationFlowContextInterface) => ({\n ...initialContext,\n component: INITIAL_COMPONENT_BY_STATE[initialState],\n employeeId,\n startDate,\n partnerDefaultValues: defaultValues,\n currentJobId,\n }),\n ),\n // `defaultValues` is intentionally omitted: a partner-supplied prop that may\n // arrive as a fresh object reference each render and only seeds the form\n // once. `initialState` and `currentJobId` are stable values from useState\n // above, so they're listed here as honest deps but never trigger recompute.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [employeeId, startDate, initialState, currentJobId],\n )\n\n return <Flow machine={manageCompensation} onEvent={onEvent} />\n}\n\n/** @internal */\nexport const CompensationContextual = () => {\n const { employeeId, onEvent, startDate, defaultValues } = useFlow<OnboardingContextInterface>()\n const { t } = useTranslation('common')\n\n if (!employeeId || !startDate) {\n throw new Error(\n t('errors.missingParamsOrContext', {\n component: 'Compensation',\n param: !employeeId ? 'employeeId' : 'startDate',\n provider: 'FlowProvider',\n }),\n )\n }\n return (\n <Compensation\n employeeId={employeeId}\n startDate={startDate}\n onEvent={onEvent}\n defaultValues={defaultValues?.compensation}\n />\n )\n}\n\nCompensation.JobsList = JobsList\nCompensation.EditCompensation = EditCompensation\n"],"names":["INITIAL_COMPONENT_BY_STATE","InitialEditCompensationContextual","JobsListContextual","deriveInitialFlowConfig","employeeJobs","onlyJob","onlyJobCompensation","findCurrentCompensation","FlsaStatus","Compensation","props","jsx","BaseComponent","CompensationFlow","job","comp","employeeId","startDate","defaultValues","dictionary","onEvent","useComponentDictionary","jobsData","useJobsAndCompensationsGetJobsSuspense","initialState","currentJobId","useState","manageCompensation","useMemo","createMachine","compensationStateMachine","initialContext","Flow","CompensationContextual","useFlow","t","useTranslation","JobsList","EditCompensation"],"mappings":";;;;;;;;;;;;;;AAkCA,MAAMA,IAGF;AAAA,EACF,gBAAgBC;AAAA,EAChB,UAAUC;AACZ;AAEA,SAASC,EAAwBC,GAAwC;AACvE,MAAIA,EAAa,WAAW;AAC1B,WAAO,EAAE,cAAc,kBAAkB,cAAc,KAAA;AAGzD,QAAMC,IAAUD,EAAa,WAAW,IAAKA,EAAa,CAAC,KAAK,OAAQ,MAClEE,IAAsBC,EAAwBF,CAAO;AAE3D,SAAIA,KAAWC,GAAqB,eAAeE,EAAW,YACrD,EAAE,cAAc,kBAAkB,cAAcH,EAAQ,KAAA,IAG1D,EAAE,cAAc,YAAY,cAAc,KAAA;AACnD;AA2EO,SAASI,EAAaC,GAA0B;AACrD,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAkB,GAAGH,GAAO,EAAA,CAC/B;AAEJ;AAEA,MAAMH,IAA0B,CAACO,MACxBA,GAAK,eAAe,KAAK,OAAQC,EAAK,SAASD,EAAI,uBAAuB;AAGnF,SAASD,EAAiB;AAAA,EACxB,YAAAG;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AACF,GAAsB;AACpB,EAAAC,EAAuB,yBAAyBF,CAAU;AAE1D,QAAM,EAAE,MAAMG,EAAA,IAAaC,EAAuC,EAAE,YAAAP,GAAY,GAS1E,CAAC,EAAE,cAAAQ,GAAc,cAAAC,EAAA,CAAc,IAAIC;AAAA,IAA4B,MACnEvB,EAAwBmB,EAAS,QAAQ,CAAA,CAAE;AAAA,EAAA,GAGvCK,IAAqBC;AAAA,IACzB,MACEC;AAAA,MACEL;AAAA,MACAM;AAAA,MACA,CAACC,OAAsD;AAAA,QACrD,GAAGA;AAAA,QACH,WAAW/B,EAA2BwB,CAAY;AAAA,QAClD,YAAAR;AAAA,QACA,WAAAC;AAAA,QACA,sBAAsBC;AAAA,QACtB,cAAAO;AAAA,MAAA;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOJ,CAACT,GAAYC,GAAWO,GAAcC,CAAY;AAAA,EAAA;AAGpD,SAAO,gBAAAd,EAACqB,GAAA,EAAK,SAASL,GAAoB,SAAAP,EAAA,CAAkB;AAC9D;AAGO,MAAMa,IAAyB,MAAM;AAC1C,QAAM,EAAE,YAAAjB,GAAY,SAAAI,GAAS,WAAAH,GAAW,eAAAC,EAAA,IAAkBgB,EAAA,GACpD,EAAE,GAAAC,EAAA,IAAMC,EAAe,QAAQ;AAErC,MAAI,CAACpB,KAAc,CAACC;AAClB,UAAM,IAAI;AAAA,MACRkB,EAAE,iCAAiC;AAAA,QACjC,WAAW;AAAA,QACX,OAAQnB,IAA4B,cAAf;AAAA,QACrB,UAAU;AAAA,MAAA,CACX;AAAA,IAAA;AAGL,SACE,gBAAAL;AAAA,IAACF;AAAA,IAAA;AAAA,MACC,YAAAO;AAAA,MACA,WAAAC;AAAA,MACA,SAAAG;AAAA,MACA,eAAeF,GAAe;AAAA,IAAA;AAAA,EAAA;AAGpC;AAEAT,EAAa,WAAW4B;AACxB5B,EAAa,mBAAmB6B;"}
|
|
1
|
+
{"version":3,"file":"Compensation.js","sources":["../../../../../src/components/Employee/Compensation/onboarding/Compensation.tsx"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport { createMachine } from 'robot3'\nimport { useTranslation } from 'react-i18next'\nimport { useJobsAndCompensationsGetJobsSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/jobsAndCompensationsGetJobs'\nimport { type Job } from '@gusto/embedded-api-v-2025-11-15/models/components/job'\nimport type { FlsaStatusType } from '@gusto/embedded-api-v-2025-11-15/models/components/flsastatustype'\nimport type { OnboardingContextInterface } from '../../OnboardingFlow/OnboardingFlowComponents'\nimport {\n InitialEditCompensationContextual,\n JobsListContextual,\n type CompensationFlowContextInterface,\n} from './CompensationFlowComponents'\nimport { compensationStateMachine } from './compensationStateMachine'\nimport { JobsList } from './JobsList'\nimport { EditCompensation } from './EditCompensation'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\nimport type { PAY_PERIODS } from '@/shared/constants'\nimport { FlsaStatus } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { Flow } from '@/components/Flow/Flow'\nimport { useFlow } from '@/components/Flow/useFlow'\n\ntype CompensationInitialState = 'initialEditJob' | 'viewJobs'\n\ninterface InitialFlowConfig {\n initialState: CompensationInitialState\n currentJobId: string | null\n}\n\nconst INITIAL_COMPONENT_BY_STATE: Record<\n CompensationInitialState,\n React.ComponentType<CommonComponentInterface>\n> = {\n initialEditJob: InitialEditCompensationContextual,\n viewJobs: JobsListContextual,\n}\n\nfunction deriveInitialFlowConfig(employeeJobs: Job[]): InitialFlowConfig {\n if (employeeJobs.length === 0) {\n return { initialState: 'initialEditJob', currentJobId: null }\n }\n\n const onlyJob = employeeJobs.length === 1 ? (employeeJobs[0] ?? null) : null\n const onlyJobCompensation = findCurrentCompensation(onlyJob)\n\n if (onlyJob && onlyJobCompensation?.flsaStatus !== FlsaStatus.NONEXEMPT) {\n return { initialState: 'initialEditJob', currentJobId: onlyJob.uuid }\n }\n\n return { initialState: 'viewJobs', currentJobId: null }\n}\n\n/**\n * Default values for the compensation form fields.\n *\n * @remarks\n * At least one of the fields must be provided. If employee data is available\n * via the API, these values are overwritten.\n *\n * @public\n */\nexport type CompensationDefaultValues = RequireAtLeastOne<{\n /** The compensation rate (an amount in dollars). */\n rate?: Job['rate']\n /** The job title. */\n title?: Job['title']\n /** The pay period — one of `Hour`, `Week`, `Month`, `Year`, `Paycheck`. */\n paymentUnit?: (typeof PAY_PERIODS)[keyof typeof PAY_PERIODS]\n /** The FLSA classification — drives whether the role is treated as exempt, nonexempt, etc. */\n flsaStatus?: FlsaStatusType\n}>\n\n/**\n * Props for {@link Compensation}.\n *\n * @public\n */\nexport interface CompensationProps extends BaseComponentInterface<'Employee.Compensation'> {\n /** The associated employee identifier. */\n employeeId: string\n /** The date the employee will start work. */\n startDate: string\n /** Default values for the compensation form fields. If employee data is available via the API, these values are overwritten. */\n defaultValues?: CompensationDefaultValues\n}\n\n/**\n * Onboarding step for collecting an employee's role and compensation details.\n *\n * @remarks\n * Collects the job title, employee type (hourly, salary), compensation\n * amount, and pay period. For hourly employees, allows configuring multiple\n * roles. Automatically routes between editing the only job (when an employee\n * has zero or one non-Nonexempt job) and a jobs-list view (when multiple\n * roles need to be managed) on first mount; on subsequent refetches the user\n * stays on their current step.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/job/created` | Fired after a job is successfully created | {@link Job} |\n * | `employee/job/updated` | Fired after a job is successfully updated | {@link Job} |\n * | `employee/job/deleted` | Fired after a job is successfully deleted | — |\n * | `employee/compensation/updated` | Fired after compensation details are updated | {@link Compensation} |\n * | `employee/compensation/done` | Fired when compensation setup is complete and the parent flow can advance | — |\n *\n * @param props - See {@link CompensationProps}.\n * @returns The compensation onboarding step.\n * @public\n * @group Block Components\n *\n * @example\n * ```tsx\n * import { EmployeeOnboarding } from '@gusto/embedded-react-sdk'\n *\n * function MyComponent() {\n * return (\n * <EmployeeOnboarding.Compensation\n * employeeId=\"4b3f930f-82cd-48a8-b797-798686e12e5e\"\n * startDate=\"2025-01-01\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport function Compensation(props: CompensationProps) {\n return (\n <BaseComponent {...props}>\n <CompensationFlow {...props} />\n </BaseComponent>\n )\n}\n\nconst findCurrentCompensation = (job?: Job | null) => {\n return job?.compensations?.find(comp => comp.uuid === job.currentCompensationUuid)\n}\n\nfunction CompensationFlow({\n employeeId,\n startDate,\n defaultValues,\n dictionary,\n onEvent,\n}: CompensationProps) {\n useComponentDictionary('Employee.Compensation', dictionary)\n\n const { data: jobsData } = useJobsAndCompensationsGetJobsSuspense({ employeeId })\n\n // Capture the routing decision from the first jobsData snapshot only. Suspense\n // guarantees that snapshot is fresh on first render. Subsequent refetches (e.g.\n // the getJobs invalidation that fires between EditCompensation's awaited job +\n // compensation mutations) must NOT re-seat the machine and reset the user's\n // place in the flow. Callers needing to re-derive routing for a different\n // employee should remount via `key`, matching the contract used by\n // OnboardingFlow / PayrollExecutionFlow / DismissalFlow.\n const [{ initialState, currentJobId }] = useState<InitialFlowConfig>(() =>\n deriveInitialFlowConfig(jobsData.jobs ?? []),\n )\n\n const manageCompensation = useMemo(\n () =>\n createMachine(\n initialState,\n compensationStateMachine,\n (initialContext: CompensationFlowContextInterface) => ({\n ...initialContext,\n component: INITIAL_COMPONENT_BY_STATE[initialState],\n employeeId,\n startDate,\n partnerDefaultValues: defaultValues,\n currentJobId,\n }),\n ),\n // `defaultValues` is intentionally omitted: a partner-supplied prop that may\n // arrive as a fresh object reference each render and only seeds the form\n // once. `initialState` and `currentJobId` are stable values from useState\n // above, so they're listed here as honest deps but never trigger recompute.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [employeeId, startDate, initialState, currentJobId],\n )\n\n return <Flow machine={manageCompensation} onEvent={onEvent} />\n}\n\n/** @internal */\nexport const CompensationContextual = () => {\n const { employeeId, onEvent, startDate, defaultValues } = useFlow<OnboardingContextInterface>()\n const { t } = useTranslation('common')\n\n if (!employeeId || !startDate) {\n throw new Error(\n t('errors.missingParamsOrContext', {\n component: 'Compensation',\n param: !employeeId ? 'employeeId' : 'startDate',\n provider: 'FlowProvider',\n }),\n )\n }\n return (\n <Compensation\n employeeId={employeeId}\n startDate={startDate}\n onEvent={onEvent}\n defaultValues={defaultValues?.compensation}\n />\n )\n}\n\nCompensation.JobsList = JobsList\nCompensation.EditCompensation = EditCompensation\n"],"names":["INITIAL_COMPONENT_BY_STATE","InitialEditCompensationContextual","JobsListContextual","deriveInitialFlowConfig","employeeJobs","onlyJob","onlyJobCompensation","findCurrentCompensation","FlsaStatus","Compensation","props","jsx","BaseComponent","CompensationFlow","job","comp","employeeId","startDate","defaultValues","dictionary","onEvent","useComponentDictionary","jobsData","useJobsAndCompensationsGetJobsSuspense","initialState","currentJobId","useState","manageCompensation","useMemo","createMachine","compensationStateMachine","initialContext","Flow","CompensationContextual","useFlow","t","useTranslation","JobsList","EditCompensation"],"mappings":";;;;;;;;;;;;;;;AAkCA,MAAMA,IAGF;AAAA,EACF,gBAAgBC;AAAA,EAChB,UAAUC;AACZ;AAEA,SAASC,EAAwBC,GAAwC;AACvE,MAAIA,EAAa,WAAW;AAC1B,WAAO,EAAE,cAAc,kBAAkB,cAAc,KAAA;AAGzD,QAAMC,IAAUD,EAAa,WAAW,IAAKA,EAAa,CAAC,KAAK,OAAQ,MAClEE,IAAsBC,EAAwBF,CAAO;AAE3D,SAAIA,KAAWC,GAAqB,eAAeE,EAAW,YACrD,EAAE,cAAc,kBAAkB,cAAcH,EAAQ,KAAA,IAG1D,EAAE,cAAc,YAAY,cAAc,KAAA;AACnD;AA2EO,SAASI,EAAaC,GAA0B;AACrD,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAkB,GAAGH,GAAO,EAAA,CAC/B;AAEJ;AAEA,MAAMH,IAA0B,CAACO,MACxBA,GAAK,eAAe,KAAK,OAAQC,EAAK,SAASD,EAAI,uBAAuB;AAGnF,SAASD,EAAiB;AAAA,EACxB,YAAAG;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AACF,GAAsB;AACpB,EAAAC,EAAuB,yBAAyBF,CAAU;AAE1D,QAAM,EAAE,MAAMG,EAAA,IAAaC,EAAuC,EAAE,YAAAP,GAAY,GAS1E,CAAC,EAAE,cAAAQ,GAAc,cAAAC,EAAA,CAAc,IAAIC;AAAA,IAA4B,MACnEvB,EAAwBmB,EAAS,QAAQ,CAAA,CAAE;AAAA,EAAA,GAGvCK,IAAqBC;AAAA,IACzB,MACEC;AAAA,MACEL;AAAA,MACAM;AAAA,MACA,CAACC,OAAsD;AAAA,QACrD,GAAGA;AAAA,QACH,WAAW/B,EAA2BwB,CAAY;AAAA,QAClD,YAAAR;AAAA,QACA,WAAAC;AAAA,QACA,sBAAsBC;AAAA,QACtB,cAAAO;AAAA,MAAA;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOJ,CAACT,GAAYC,GAAWO,GAAcC,CAAY;AAAA,EAAA;AAGpD,SAAO,gBAAAd,EAACqB,GAAA,EAAK,SAASL,GAAoB,SAAAP,EAAA,CAAkB;AAC9D;AAGO,MAAMa,IAAyB,MAAM;AAC1C,QAAM,EAAE,YAAAjB,GAAY,SAAAI,GAAS,WAAAH,GAAW,eAAAC,EAAA,IAAkBgB,EAAA,GACpD,EAAE,GAAAC,EAAA,IAAMC,EAAe,QAAQ;AAErC,MAAI,CAACpB,KAAc,CAACC;AAClB,UAAM,IAAI;AAAA,MACRkB,EAAE,iCAAiC;AAAA,QACjC,WAAW;AAAA,QACX,OAAQnB,IAA4B,cAAf;AAAA,QACrB,UAAU;AAAA,MAAA,CACX;AAAA,IAAA;AAGL,SACE,gBAAAL;AAAA,IAACF;AAAA,IAAA;AAAA,MACC,YAAAO;AAAA,MACA,WAAAC;AAAA,MACA,SAAAG;AAAA,MACA,eAAeF,GAAe;AAAA,IAAA;AAAA,EAAA;AAGpC;AAEAT,EAAa,WAAW4B;AACxB5B,EAAa,mBAAmB6B;"}
|
package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js
CHANGED
|
@@ -6,12 +6,13 @@ import { useCompensationForm as O } from "../../shared/useCompensationForm/useCo
|
|
|
6
6
|
import { AddCompensationFormBody as j } from "../../shared/AddCompensationFormBody.js";
|
|
7
7
|
import B from "./EditCompensation.module.scss.js";
|
|
8
8
|
import { BaseBoundaries as N, BaseLayout as l } from "../../../../Base/Base.js";
|
|
9
|
+
import "../../../../Base/useBase.js";
|
|
9
10
|
import { Form as T } from "../../../../Common/Form/Form.js";
|
|
10
11
|
import { useComponentDictionary as _, useI18n as A } from "../../../../../i18n/I18n.js";
|
|
11
12
|
import { composeErrorHandler as f } from "../../../../../partner-hook-utils/composeErrorHandler.js";
|
|
12
13
|
import { composeSubmitHandler as H } from "../../../../../partner-hook-utils/form/composeSubmitHandler.js";
|
|
13
14
|
import { componentEvents as a } from "../../../../../shared/constants.js";
|
|
14
|
-
function
|
|
15
|
+
function $({ dictionary: r, ...s }) {
|
|
15
16
|
return _("Employee.Compensation", r), /* @__PURE__ */ n(N, { componentName: "Employee.Compensation", children: /* @__PURE__ */ n(J, { ...s }) });
|
|
16
17
|
}
|
|
17
18
|
function J({
|
|
@@ -101,6 +102,6 @@ function J({
|
|
|
101
102
|
) }) }) });
|
|
102
103
|
}
|
|
103
104
|
export {
|
|
104
|
-
|
|
105
|
+
$ as EditCompensation
|
|
105
106
|
};
|
|
106
107
|
//# sourceMappingURL=EditCompensation.js.map
|
package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditCompensation.js","sources":["../../../../../../src/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.tsx"],"sourcesContent":["import { useState } from 'react'\nimport classNames from 'classnames'\nimport type { CompensationDefaultValues } from '../Compensation'\nimport { useJobForm } from '../../shared/useJobForm'\nimport { useCompensationForm } from '../../shared/useCompensationForm'\nimport { AddCompensationFormBody } from '../../shared/AddCompensationFormBody'\nimport styles from './EditCompensation.module.scss'\nimport { BaseBoundaries, BaseLayout, type CommonComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport { composeSubmitHandler } from '@/partner-hook-utils/form/composeSubmitHandler'\nimport { componentEvents, type EventType } from '@/shared/constants'\n\n/**\n * Props for {@link EditCompensation}.\n *\n * @public\n */\nexport interface EditCompensationProps extends CommonComponentInterface<'Employee.Compensation'> {\n /** The associated employee identifier. */\n employeeId: string\n /**\n * When provided, the hire date is pre-filled from this value and the hire date field is hidden.\n * When absent, the hire date field is rendered so it can be set explicitly.\n */\n startDate?: string\n /** Existing job to edit. When omitted, a new job is created on submit. */\n currentJobId?: string | null\n /** Heading text shown above the form. */\n title: string\n /** Label for the primary submit button. */\n submitCtaLabel: string\n /** Optional handler invoked when the secondary cancel button is clicked. */\n onCancel?: () => void\n /** Initial values for the job title and compensation fields. */\n partnerDefaultValues?: CompensationDefaultValues\n /** Event handler fired on flow state changes. See the events table on {@link EditCompensation}. */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Renders a form for creating or editing one of an employee's jobs together with its compensation.\n *\n * @remarks\n * The submit chain saves the job first, then the compensation. The `employee/job_created` or\n * `employee/job_updated` event fires once the job is saved; `employee/compensation_updated`\n * fires once the compensation is saved and signals the full save is complete.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/job_created` | Fired when a new job is saved. | The saved {@link https://docs.gusto.com/embedded-payroll/reference/get-v1-jobs-job_id | Job}. |\n * | `employee/job_updated` | Fired when an existing job is saved. | The saved {@link https://docs.gusto.com/embedded-payroll/reference/get-v1-jobs-job_id | Job}. |\n * | `employee/compensation_updated` | Fired when the compensation is saved. Treat as the \"save complete\" signal. | The saved {@link https://docs.gusto.com/embedded-payroll/reference/get-v1-compensations-compensation_id | Compensation}. |\n *\n * @param props - See {@link EditCompensationProps}.\n * @returns The rendered edit-compensation form.\n * @public\n */\nexport function EditCompensation({ dictionary, ...props }: EditCompensationProps) {\n useComponentDictionary('Employee.Compensation', dictionary)\n return (\n <BaseBoundaries componentName=\"Employee.Compensation\">\n <Root {...props} />\n </BaseBoundaries>\n )\n}\n\nfunction Root({\n employeeId,\n startDate,\n currentJobId,\n title,\n submitCtaLabel,\n onCancel,\n partnerDefaultValues,\n className,\n onEvent,\n}: EditCompensationProps) {\n useI18n('Employee.Compensation')\n\n // When startDate is provided (onboarding), hide the hire date field and derive\n // it from the prop at submit time. When absent (add-job from dashboard empty\n // state), render the field so the user can set it explicitly.\n const withHireDateField = !startDate\n\n // Track jobId locally so a partial-failure submit chain (job POST succeeds,\n // comp PUT fails) doesn't re-POST and create a duplicate job on retry. We\n // initialize from the prop and only write back when the partner-supplied\n // `currentJobId` was nullish (i.e. add-job flow) — see the submit handler.\n const [resolvedJobId, setResolvedJobId] = useState<string | undefined>(currentJobId ?? undefined)\n\n const jobForm = useJobForm({\n employeeId,\n jobId: resolvedJobId,\n withHireDateField,\n defaultValues: {\n title: partnerDefaultValues?.title ?? '',\n },\n // The Compensation flow always shows a job title field, even when editing\n // an existing job. The hook's schema only requires `title` on create; we\n // require it on update too to preserve the existing UX.\n optionalFieldsToRequire: { update: ['title'] },\n shouldFocusError: false,\n })\n\n // Resolve the compensationId from the job we just loaded so the comp form can\n // seed from the existing comp on edit. While the job form is still loading we\n // pass undefined (compensation form starts in create mode); once the job\n // resolves the prop change re-renders the comp form into update mode with the\n // existing compensation as the seed.\n const resolvedCompensationId = jobForm.isLoading\n ? undefined\n : (jobForm.data.currentJob?.currentCompensationUuid ?? undefined)\n\n const compensationForm = useCompensationForm({\n employeeId,\n jobId: resolvedJobId,\n compensationId: resolvedCompensationId,\n // No effective-date field is surfaced, and no `effectiveDate` is\n // threaded into `actions.onSubmit` either: the server initializes\n // `effective_date` on the auto-stub created by the parent job POST,\n // and subsequent updates omit it from the PUT body so the existing\n // value is preserved (e.g. a deliberately-set future-dated comp\n // wouldn't be silently overwritten on an unrelated edit).\n withEffectiveDateField: false,\n // The Compensation flow always presents flsaStatus, rate, and paymentUnit\n // as required, even when editing an existing compensation. The hook's\n // schema marks them `'create'`-only by default; we promote them on update\n // here to preserve the existing UX (no \"(optional)\" labels).\n optionalFieldsToRequire: { update: ['flsaStatus', 'rate', 'paymentUnit'] },\n defaultValues: {\n flsaStatus: partnerDefaultValues?.flsaStatus,\n rate:\n typeof partnerDefaultValues?.rate === 'number'\n ? partnerDefaultValues.rate\n : partnerDefaultValues?.rate\n ? Number(partnerDefaultValues.rate)\n : undefined,\n paymentUnit: partnerDefaultValues?.paymentUnit,\n },\n shouldFocusError: false,\n })\n\n if (jobForm.isLoading || compensationForm.isLoading) {\n const loadingErrorHandling = composeErrorHandler([jobForm, compensationForm])\n return <BaseLayout isLoading error={loadingErrorHandling.errors} />\n }\n\n const submitResult = composeSubmitHandler([jobForm, compensationForm], async () => {\n const jobResult = await jobForm.actions.onSubmit({\n employeeId,\n hireDate: startDate ?? undefined,\n })\n if (!jobResult) return\n\n onEvent(\n jobResult.mode === 'create'\n ? componentEvents.EMPLOYEE_JOB_CREATED\n : componentEvents.EMPLOYEE_JOB_UPDATED,\n jobResult.data,\n )\n\n // Always thread through the freshly returned job's currentCompensationUuid +\n // its version so we PUT against the latest comp regardless of whether the job\n // POST just auto-created the stub or the job PUT bumped a version.\n const stubCompensation = jobResult.data.compensations?.find(\n c => c.uuid === jobResult.data.currentCompensationUuid,\n )\n\n const compensationResult = await compensationForm.actions.onSubmit({\n jobId: jobResult.data.uuid,\n compensationId: jobResult.data.currentCompensationUuid ?? undefined,\n compensationVersion: stubCompensation?.version ?? undefined,\n })\n if (!compensationResult) {\n if (!currentJobId) setResolvedJobId(jobResult.data.uuid)\n return\n }\n\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_UPDATED, compensationResult.data)\n })\n\n const errorHandling = composeErrorHandler([submitResult])\n\n const isPending = jobForm.status.isPending || compensationForm.status.isPending\n\n return (\n <section className={classNames(styles.container, className)}>\n <BaseLayout error={errorHandling.errors}>\n <Form onSubmit={submitResult.handleSubmit}>\n <AddCompensationFormBody\n jobForm={jobForm}\n compensationForm={compensationForm}\n title={title}\n submitCtaLabel={submitCtaLabel}\n isPending={isPending}\n onCancel={onCancel}\n />\n </Form>\n </BaseLayout>\n </section>\n )\n}\n"],"names":["EditCompensation","dictionary","props","useComponentDictionary","jsx","BaseBoundaries","Root","employeeId","startDate","currentJobId","title","submitCtaLabel","onCancel","partnerDefaultValues","className","onEvent","useI18n","withHireDateField","resolvedJobId","setResolvedJobId","useState","jobForm","useJobForm","resolvedCompensationId","compensationForm","useCompensationForm","loadingErrorHandling","composeErrorHandler","BaseLayout","submitResult","composeSubmitHandler","jobResult","componentEvents","stubCompensation","c","compensationResult","errorHandling","isPending","classNames","styles","Form","AddCompensationFormBody"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"EditCompensation.js","sources":["../../../../../../src/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.tsx"],"sourcesContent":["import { useState } from 'react'\nimport classNames from 'classnames'\nimport type { CompensationDefaultValues } from '../Compensation'\nimport { useJobForm } from '../../shared/useJobForm'\nimport { useCompensationForm } from '../../shared/useCompensationForm'\nimport { AddCompensationFormBody } from '../../shared/AddCompensationFormBody'\nimport styles from './EditCompensation.module.scss'\nimport { BaseBoundaries, BaseLayout, type CommonComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport { composeSubmitHandler } from '@/partner-hook-utils/form/composeSubmitHandler'\nimport { componentEvents, type EventType } from '@/shared/constants'\n\n/**\n * Props for {@link EditCompensation}.\n *\n * @public\n */\nexport interface EditCompensationProps extends CommonComponentInterface<'Employee.Compensation'> {\n /** The associated employee identifier. */\n employeeId: string\n /**\n * When provided, the hire date is pre-filled from this value and the hire date field is hidden.\n * When absent, the hire date field is rendered so it can be set explicitly.\n */\n startDate?: string\n /** Existing job to edit. When omitted, a new job is created on submit. */\n currentJobId?: string | null\n /** Heading text shown above the form. */\n title: string\n /** Label for the primary submit button. */\n submitCtaLabel: string\n /** Optional handler invoked when the secondary cancel button is clicked. */\n onCancel?: () => void\n /** Initial values for the job title and compensation fields. */\n partnerDefaultValues?: CompensationDefaultValues\n /** Event handler fired on flow state changes. See the events table on {@link EditCompensation}. */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Renders a form for creating or editing one of an employee's jobs together with its compensation.\n *\n * @remarks\n * The submit chain saves the job first, then the compensation. The `employee/job_created` or\n * `employee/job_updated` event fires once the job is saved; `employee/compensation_updated`\n * fires once the compensation is saved and signals the full save is complete.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/job_created` | Fired when a new job is saved. | The saved {@link https://docs.gusto.com/embedded-payroll/reference/get-v1-jobs-job_id | Job}. |\n * | `employee/job_updated` | Fired when an existing job is saved. | The saved {@link https://docs.gusto.com/embedded-payroll/reference/get-v1-jobs-job_id | Job}. |\n * | `employee/compensation_updated` | Fired when the compensation is saved. Treat as the \"save complete\" signal. | The saved {@link https://docs.gusto.com/embedded-payroll/reference/get-v1-compensations-compensation_id | Compensation}. |\n *\n * @param props - See {@link EditCompensationProps}.\n * @returns The rendered edit-compensation form.\n * @public\n */\nexport function EditCompensation({ dictionary, ...props }: EditCompensationProps) {\n useComponentDictionary('Employee.Compensation', dictionary)\n return (\n <BaseBoundaries componentName=\"Employee.Compensation\">\n <Root {...props} />\n </BaseBoundaries>\n )\n}\n\nfunction Root({\n employeeId,\n startDate,\n currentJobId,\n title,\n submitCtaLabel,\n onCancel,\n partnerDefaultValues,\n className,\n onEvent,\n}: EditCompensationProps) {\n useI18n('Employee.Compensation')\n\n // When startDate is provided (onboarding), hide the hire date field and derive\n // it from the prop at submit time. When absent (add-job from dashboard empty\n // state), render the field so the user can set it explicitly.\n const withHireDateField = !startDate\n\n // Track jobId locally so a partial-failure submit chain (job POST succeeds,\n // comp PUT fails) doesn't re-POST and create a duplicate job on retry. We\n // initialize from the prop and only write back when the partner-supplied\n // `currentJobId` was nullish (i.e. add-job flow) — see the submit handler.\n const [resolvedJobId, setResolvedJobId] = useState<string | undefined>(currentJobId ?? undefined)\n\n const jobForm = useJobForm({\n employeeId,\n jobId: resolvedJobId,\n withHireDateField,\n defaultValues: {\n title: partnerDefaultValues?.title ?? '',\n },\n // The Compensation flow always shows a job title field, even when editing\n // an existing job. The hook's schema only requires `title` on create; we\n // require it on update too to preserve the existing UX.\n optionalFieldsToRequire: { update: ['title'] },\n shouldFocusError: false,\n })\n\n // Resolve the compensationId from the job we just loaded so the comp form can\n // seed from the existing comp on edit. While the job form is still loading we\n // pass undefined (compensation form starts in create mode); once the job\n // resolves the prop change re-renders the comp form into update mode with the\n // existing compensation as the seed.\n const resolvedCompensationId = jobForm.isLoading\n ? undefined\n : (jobForm.data.currentJob?.currentCompensationUuid ?? undefined)\n\n const compensationForm = useCompensationForm({\n employeeId,\n jobId: resolvedJobId,\n compensationId: resolvedCompensationId,\n // No effective-date field is surfaced, and no `effectiveDate` is\n // threaded into `actions.onSubmit` either: the server initializes\n // `effective_date` on the auto-stub created by the parent job POST,\n // and subsequent updates omit it from the PUT body so the existing\n // value is preserved (e.g. a deliberately-set future-dated comp\n // wouldn't be silently overwritten on an unrelated edit).\n withEffectiveDateField: false,\n // The Compensation flow always presents flsaStatus, rate, and paymentUnit\n // as required, even when editing an existing compensation. The hook's\n // schema marks them `'create'`-only by default; we promote them on update\n // here to preserve the existing UX (no \"(optional)\" labels).\n optionalFieldsToRequire: { update: ['flsaStatus', 'rate', 'paymentUnit'] },\n defaultValues: {\n flsaStatus: partnerDefaultValues?.flsaStatus,\n rate:\n typeof partnerDefaultValues?.rate === 'number'\n ? partnerDefaultValues.rate\n : partnerDefaultValues?.rate\n ? Number(partnerDefaultValues.rate)\n : undefined,\n paymentUnit: partnerDefaultValues?.paymentUnit,\n },\n shouldFocusError: false,\n })\n\n if (jobForm.isLoading || compensationForm.isLoading) {\n const loadingErrorHandling = composeErrorHandler([jobForm, compensationForm])\n return <BaseLayout isLoading error={loadingErrorHandling.errors} />\n }\n\n const submitResult = composeSubmitHandler([jobForm, compensationForm], async () => {\n const jobResult = await jobForm.actions.onSubmit({\n employeeId,\n hireDate: startDate ?? undefined,\n })\n if (!jobResult) return\n\n onEvent(\n jobResult.mode === 'create'\n ? componentEvents.EMPLOYEE_JOB_CREATED\n : componentEvents.EMPLOYEE_JOB_UPDATED,\n jobResult.data,\n )\n\n // Always thread through the freshly returned job's currentCompensationUuid +\n // its version so we PUT against the latest comp regardless of whether the job\n // POST just auto-created the stub or the job PUT bumped a version.\n const stubCompensation = jobResult.data.compensations?.find(\n c => c.uuid === jobResult.data.currentCompensationUuid,\n )\n\n const compensationResult = await compensationForm.actions.onSubmit({\n jobId: jobResult.data.uuid,\n compensationId: jobResult.data.currentCompensationUuid ?? undefined,\n compensationVersion: stubCompensation?.version ?? undefined,\n })\n if (!compensationResult) {\n if (!currentJobId) setResolvedJobId(jobResult.data.uuid)\n return\n }\n\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_UPDATED, compensationResult.data)\n })\n\n const errorHandling = composeErrorHandler([submitResult])\n\n const isPending = jobForm.status.isPending || compensationForm.status.isPending\n\n return (\n <section className={classNames(styles.container, className)}>\n <BaseLayout error={errorHandling.errors}>\n <Form onSubmit={submitResult.handleSubmit}>\n <AddCompensationFormBody\n jobForm={jobForm}\n compensationForm={compensationForm}\n title={title}\n submitCtaLabel={submitCtaLabel}\n isPending={isPending}\n onCancel={onCancel}\n />\n </Form>\n </BaseLayout>\n </section>\n )\n}\n"],"names":["EditCompensation","dictionary","props","useComponentDictionary","jsx","BaseBoundaries","Root","employeeId","startDate","currentJobId","title","submitCtaLabel","onCancel","partnerDefaultValues","className","onEvent","useI18n","withHireDateField","resolvedJobId","setResolvedJobId","useState","jobForm","useJobForm","resolvedCompensationId","compensationForm","useCompensationForm","loadingErrorHandling","composeErrorHandler","BaseLayout","submitResult","composeSubmitHandler","jobResult","componentEvents","stubCompensation","c","compensationResult","errorHandling","isPending","classNames","styles","Form","AddCompensationFormBody"],"mappings":"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"}
|
|
@@ -5,6 +5,7 @@ import { DeductionsCardContextual as c } from "./DeductionsComponents.js";
|
|
|
5
5
|
import { deductionsStateMachine as a } from "./deductionsStateMachine.js";
|
|
6
6
|
import { Flow as u } from "../../../Flow/Flow.js";
|
|
7
7
|
import { BaseBoundaries as s } from "../../../Base/Base.js";
|
|
8
|
+
import "../../../Base/useBase.js";
|
|
8
9
|
import { useComponentDictionary as p, useI18n as d } from "../../../../i18n/I18n.js";
|
|
9
10
|
function f({ employeeId: o, onEvent: e }) {
|
|
10
11
|
d("Employee.Management.Deductions");
|
|
@@ -19,7 +20,7 @@ function f({ employeeId: o, onEvent: e }) {
|
|
|
19
20
|
);
|
|
20
21
|
return /* @__PURE__ */ t(u, { machine: n, onEvent: e });
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
+
function w({
|
|
23
24
|
dictionary: o,
|
|
24
25
|
FallbackComponent: e,
|
|
25
26
|
...n
|
|
@@ -34,6 +35,6 @@ function E({
|
|
|
34
35
|
);
|
|
35
36
|
}
|
|
36
37
|
export {
|
|
37
|
-
|
|
38
|
+
w as Deductions
|
|
38
39
|
};
|
|
39
40
|
//# sourceMappingURL=Deductions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Deductions.js","sources":["../../../../../src/components/Employee/Deductions/management/Deductions.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { DeductionsCardContextual, type DeductionsContextInterface } from './DeductionsComponents'\nimport { deductionsStateMachine } from './deductionsStateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport {\n BaseBoundaries,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useI18n } from '@/i18n'\nimport type { OnEventType } from '@/components/Base/useBase'\n\n/**\n * Props for {@link Deductions}.\n *\n * @public\n */\nexport interface DeductionsProps extends CommonComponentInterface<'Employee.Management.Deductions'> {\n /** The associated employee identifier. */\n employeeId: string\n /** Callback invoked when the block emits an event. See the events table on {@link Deductions} for the available event types and payloads. */\n onEvent: OnEventType<EventType, unknown>\n}\n\nfunction DeductionsFlow({ employeeId, onEvent }: DeductionsProps) {\n useI18n('Employee.Management.Deductions')\n\n const machine = useMemo(\n () =>\n createMachine('card', deductionsStateMachine, (ctx: DeductionsContextInterface) => ({\n ...ctx,\n component: DeductionsCardContextual,\n employeeId,\n successAlert: null,\n })),\n [employeeId],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n\n/**\n * Self-contained block for viewing and managing an employee's post-tax deductions — the same experience the dashboard surfaces, but as a drop-in component that doesn't require the surrounding dashboard chrome.\n *\n * @remarks\n * Renders a card listing the employee's active deductions with affordances to add a new deduction, edit an existing one, or delete one via a confirm dialog. Choosing to add or edit swaps the card for the deduction form; a successful save returns to the card and emits the corresponding event, and cancelling returns without saving. Wraps everything in error and suspense boundaries.\n *\n * The card and form surfaces ({@link DeductionsCard}, {@link DeductionsEditForm}) are also exported individually for cases where that orchestration is the wrong fit — for example, when the form needs to render in a modal or drawer, or when the swap is driven by a router. Using them directly means owning the swap, the alert, and any cross-component state yourself.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/deductions/card/addRequested` | Fired when the \"Add deduction\" CTA is clicked from the card; the block opens the edit form in add mode | `{ employeeId: string }` |\n * | `employee/management/deductions/card/editRequested` | Fired when an \"Edit\" CTA is clicked for a deduction; the block opens the edit form pre-populated with that deduction | The matching `Garnishment` |\n * | `employee/management/deductions/card/deleted` | Fired after a deduction is deleted via the confirm dialog; the block stays on the card | The deleted `Garnishment` |\n * | `employee/management/deductions/editForm/created` | Fired after a new deduction is saved from the edit form; the block returns to the card view | The created `Garnishment` |\n * | `employee/management/deductions/editForm/updated` | Fired after an existing deduction is updated from the edit form; the block returns to the card view | The updated `Garnishment` |\n * | `employee/management/deductions/editForm/cancelled` | Fired when the user cancels the edit form; the block returns to the card view | — |\n * | `employee/management/deductions/alertDismissed` | Fired when the user dismisses a success alert above the card | `null` |\n *\n * @param props - See {@link DeductionsProps}.\n * @returns The rendered deductions block.\n * @public\n * @group Block Components\n */\nexport function Deductions({\n dictionary,\n FallbackComponent,\n ...props\n}: DeductionsProps & BaseComponentInterface<'Employee.Management.Deductions'>) {\n useComponentDictionary('Employee.Management.Deductions', dictionary)\n return (\n <BaseBoundaries\n componentName=\"Employee.Management.Deductions\"\n FallbackComponent={FallbackComponent}\n >\n <DeductionsFlow {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["DeductionsFlow","employeeId","onEvent","useI18n","machine","useMemo","createMachine","deductionsStateMachine","ctx","DeductionsCardContextual","jsx","Flow","Deductions","dictionary","FallbackComponent","props","useComponentDictionary","BaseBoundaries"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Deductions.js","sources":["../../../../../src/components/Employee/Deductions/management/Deductions.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { DeductionsCardContextual, type DeductionsContextInterface } from './DeductionsComponents'\nimport { deductionsStateMachine } from './deductionsStateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport {\n BaseBoundaries,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useI18n } from '@/i18n'\nimport type { OnEventType } from '@/components/Base/useBase'\n\n/**\n * Props for {@link Deductions}.\n *\n * @public\n */\nexport interface DeductionsProps extends CommonComponentInterface<'Employee.Management.Deductions'> {\n /** The associated employee identifier. */\n employeeId: string\n /** Callback invoked when the block emits an event. See the events table on {@link Deductions} for the available event types and payloads. */\n onEvent: OnEventType<EventType, unknown>\n}\n\nfunction DeductionsFlow({ employeeId, onEvent }: DeductionsProps) {\n useI18n('Employee.Management.Deductions')\n\n const machine = useMemo(\n () =>\n createMachine('card', deductionsStateMachine, (ctx: DeductionsContextInterface) => ({\n ...ctx,\n component: DeductionsCardContextual,\n employeeId,\n successAlert: null,\n })),\n [employeeId],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n\n/**\n * Self-contained block for viewing and managing an employee's post-tax deductions — the same experience the dashboard surfaces, but as a drop-in component that doesn't require the surrounding dashboard chrome.\n *\n * @remarks\n * Renders a card listing the employee's active deductions with affordances to add a new deduction, edit an existing one, or delete one via a confirm dialog. Choosing to add or edit swaps the card for the deduction form; a successful save returns to the card and emits the corresponding event, and cancelling returns without saving. Wraps everything in error and suspense boundaries.\n *\n * The card and form surfaces ({@link DeductionsCard}, {@link DeductionsEditForm}) are also exported individually for cases where that orchestration is the wrong fit — for example, when the form needs to render in a modal or drawer, or when the swap is driven by a router. Using them directly means owning the swap, the alert, and any cross-component state yourself.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/deductions/card/addRequested` | Fired when the \"Add deduction\" CTA is clicked from the card; the block opens the edit form in add mode | `{ employeeId: string }` |\n * | `employee/management/deductions/card/editRequested` | Fired when an \"Edit\" CTA is clicked for a deduction; the block opens the edit form pre-populated with that deduction | The matching `Garnishment` |\n * | `employee/management/deductions/card/deleted` | Fired after a deduction is deleted via the confirm dialog; the block stays on the card | The deleted `Garnishment` |\n * | `employee/management/deductions/editForm/created` | Fired after a new deduction is saved from the edit form; the block returns to the card view | The created `Garnishment` |\n * | `employee/management/deductions/editForm/updated` | Fired after an existing deduction is updated from the edit form; the block returns to the card view | The updated `Garnishment` |\n * | `employee/management/deductions/editForm/cancelled` | Fired when the user cancels the edit form; the block returns to the card view | — |\n * | `employee/management/deductions/alertDismissed` | Fired when the user dismisses a success alert above the card | `null` |\n *\n * @param props - See {@link DeductionsProps}.\n * @returns The rendered deductions block.\n * @public\n * @group Block Components\n */\nexport function Deductions({\n dictionary,\n FallbackComponent,\n ...props\n}: DeductionsProps & BaseComponentInterface<'Employee.Management.Deductions'>) {\n useComponentDictionary('Employee.Management.Deductions', dictionary)\n return (\n <BaseBoundaries\n componentName=\"Employee.Management.Deductions\"\n FallbackComponent={FallbackComponent}\n >\n <DeductionsFlow {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["DeductionsFlow","employeeId","onEvent","useI18n","machine","useMemo","createMachine","deductionsStateMachine","ctx","DeductionsCardContextual","jsx","Flow","Deductions","dictionary","FallbackComponent","props","useComponentDictionary","BaseBoundaries"],"mappings":";;;;;;;;;AA2BA,SAASA,EAAe,EAAE,YAAAC,GAAY,SAAAC,KAA4B;AAChE,EAAAC,EAAQ,gCAAgC;AAExC,QAAMC,IAAUC;AAAA,IACd,MACEC,EAAc,QAAQC,GAAwB,CAACC,OAAqC;AAAA,MAClF,GAAGA;AAAA,MACH,WAAWC;AAAA,MACX,YAAAR;AAAA,MACA,cAAc;AAAA,IAAA,EACd;AAAA,IACJ,CAACA,CAAU;AAAA,EAAA;AAGb,SAAO,gBAAAS,EAACC,GAAA,EAAK,SAAAP,GAAkB,SAAAF,EAAA,CAAkB;AACnD;AAyBO,SAASU,EAAW;AAAA,EACzB,YAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,GAAGC;AACL,GAA+E;AAC7E,SAAAC,EAAuB,kCAAkCH,CAAU,GAEjE,gBAAAH;AAAA,IAACO;AAAA,IAAA;AAAA,MACC,eAAc;AAAA,MACd,mBAAAH;AAAA,MAEA,UAAA,gBAAAJ,EAACV,GAAA,EAAgB,GAAGe,EAAA,CAAO;AAAA,IAAA;AAAA,EAAA;AAGjC;"}
|
package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.js
CHANGED
|
@@ -2,10 +2,11 @@ import { jsx as o } from "react/jsx-runtime";
|
|
|
2
2
|
import { useDeductionsList as D } from "../../shared/useDeductionsList.js";
|
|
3
3
|
import { useManagementDeductionsFormDictionary as d } from "./useFormDictionary.js";
|
|
4
4
|
import { BaseBoundaries as M, BaseLayout as m } from "../../../../Base/Base.js";
|
|
5
|
+
import "../../../../Base/useBase.js";
|
|
5
6
|
import { useI18n as _, useComponentDictionary as p } from "../../../../../i18n/I18n.js";
|
|
6
7
|
import { componentEvents as i } from "../../../../../shared/constants.js";
|
|
7
8
|
import { DeductionsForm as f } from "../../shared/DeductionsForm/DeductionsForm.js";
|
|
8
|
-
function
|
|
9
|
+
function F({
|
|
9
10
|
FallbackComponent: r,
|
|
10
11
|
...n
|
|
11
12
|
}) {
|
|
@@ -48,6 +49,6 @@ function l({
|
|
|
48
49
|
) });
|
|
49
50
|
}
|
|
50
51
|
export {
|
|
51
|
-
|
|
52
|
+
F as DeductionsEditForm
|
|
52
53
|
};
|
|
53
54
|
//# sourceMappingURL=DeductionsEditForm.js.map
|
package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeductionsEditForm.js","sources":["../../../../../../src/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.tsx"],"sourcesContent":["import { DeductionsForm } from '../../shared/DeductionsForm'\nimport { useDeductionsList } from '../../shared/useDeductionsList'\nimport { useManagementDeductionsFormDictionary } from './useFormDictionary'\nimport {\n BaseBoundaries,\n BaseLayout,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\n/**\n * Props for {@link DeductionsEditForm}.\n *\n * @public\n */\nexport interface DeductionsEditFormProps extends CommonComponentInterface<'Employee.Management.Deductions'> {\n /** The associated employee identifier. */\n employeeId: string\n /** When provided, the form opens in edit mode pre-populated with the\n * matching active deduction. Omit to open in add mode. */\n editingDeductionId?: string\n /** Callback invoked when the form emits an event. See the events table on {@link DeductionsEditForm} for the available event types and payloads. */\n onEvent: BaseComponentInterface['onEvent']\n}\n\n/**\n * Standalone add/edit surface for a single employee deduction.\n *\n * @remarks\n * Renders the inline form for a post-tax custom deduction or court-ordered garnishment. Looks up the row to edit by `editingDeductionId`; omit it to open in add mode. Resolves its text against the `Employee.Management.Deductions` translation namespace so partner overrides on that namespace flow into the form. For an orchestrated card-plus-form flow, use {@link Deductions}.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/deductions/editForm/created` | Fired after a new deduction is saved | The created `Garnishment` |\n * | `employee/management/deductions/editForm/updated` | Fired after an existing deduction is updated | The updated `Garnishment` |\n * | `employee/management/deductions/editForm/cancelled` | Fired when the user cancels the form | — |\n *\n * @param input - See {@link DeductionsEditFormProps}, plus a `FallbackComponent` override for the error boundary.\n * @returns The rendered add/edit form.\n * @public\n */\nexport function DeductionsEditForm({\n FallbackComponent,\n ...props\n}: DeductionsEditFormProps & Pick<BaseComponentInterface, 'FallbackComponent'>) {\n return (\n <BaseBoundaries\n componentName=\"Employee.Management.Deductions\"\n FallbackComponent={FallbackComponent}\n >\n <DeductionsEditFormRoot {...props} />\n </BaseBoundaries>\n )\n}\n\nfunction DeductionsEditFormRoot({\n employeeId,\n editingDeductionId,\n dictionary,\n onEvent,\n}: DeductionsEditFormProps) {\n useI18n('Employee.Management.Deductions')\n useComponentDictionary('Employee.Management.Deductions', dictionary)\n\n // React Query dedupes against any sibling consumer of this list, so this\n // is just a typed handle on the loaded row used to seed edit mode.\n const list = useDeductionsList({ employeeId })\n const formDictionary = useManagementDeductionsFormDictionary()\n\n if (list.isLoading) {\n return <BaseLayout isLoading error={list.errorHandling.errors} />\n }\n\n const deduction = editingDeductionId\n ? (list.data.deductions.find(d => d.uuid === editingDeductionId) ?? null)\n : null\n\n return (\n <BaseLayout error={list.errorHandling.errors}>\n <DeductionsForm\n employeeId={employeeId}\n deduction={deduction}\n dictionary={formDictionary}\n onSaved={(saved, mode) => {\n onEvent(\n mode === 'create'\n ? componentEvents.EMPLOYEE_MANAGEMENT_DEDUCTIONS_EDIT_FORM_CREATED\n : componentEvents.EMPLOYEE_MANAGEMENT_DEDUCTIONS_EDIT_FORM_UPDATED,\n saved,\n )\n }}\n onCancel={() => {\n onEvent(componentEvents.EMPLOYEE_MANAGEMENT_DEDUCTIONS_EDIT_FORM_CANCELLED)\n }}\n />\n </BaseLayout>\n )\n}\n"],"names":["DeductionsEditForm","FallbackComponent","props","jsx","BaseBoundaries","DeductionsEditFormRoot","employeeId","editingDeductionId","dictionary","onEvent","useI18n","useComponentDictionary","list","useDeductionsList","formDictionary","useManagementDeductionsFormDictionary","BaseLayout","deduction","d","DeductionsForm","saved","mode","componentEvents"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DeductionsEditForm.js","sources":["../../../../../../src/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.tsx"],"sourcesContent":["import { DeductionsForm } from '../../shared/DeductionsForm'\nimport { useDeductionsList } from '../../shared/useDeductionsList'\nimport { useManagementDeductionsFormDictionary } from './useFormDictionary'\nimport {\n BaseBoundaries,\n BaseLayout,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\n/**\n * Props for {@link DeductionsEditForm}.\n *\n * @public\n */\nexport interface DeductionsEditFormProps extends CommonComponentInterface<'Employee.Management.Deductions'> {\n /** The associated employee identifier. */\n employeeId: string\n /** When provided, the form opens in edit mode pre-populated with the\n * matching active deduction. Omit to open in add mode. */\n editingDeductionId?: string\n /** Callback invoked when the form emits an event. See the events table on {@link DeductionsEditForm} for the available event types and payloads. */\n onEvent: BaseComponentInterface['onEvent']\n}\n\n/**\n * Standalone add/edit surface for a single employee deduction.\n *\n * @remarks\n * Renders the inline form for a post-tax custom deduction or court-ordered garnishment. Looks up the row to edit by `editingDeductionId`; omit it to open in add mode. Resolves its text against the `Employee.Management.Deductions` translation namespace so partner overrides on that namespace flow into the form. For an orchestrated card-plus-form flow, use {@link Deductions}.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/deductions/editForm/created` | Fired after a new deduction is saved | The created `Garnishment` |\n * | `employee/management/deductions/editForm/updated` | Fired after an existing deduction is updated | The updated `Garnishment` |\n * | `employee/management/deductions/editForm/cancelled` | Fired when the user cancels the form | — |\n *\n * @param input - See {@link DeductionsEditFormProps}, plus a `FallbackComponent` override for the error boundary.\n * @returns The rendered add/edit form.\n * @public\n */\nexport function DeductionsEditForm({\n FallbackComponent,\n ...props\n}: DeductionsEditFormProps & Pick<BaseComponentInterface, 'FallbackComponent'>) {\n return (\n <BaseBoundaries\n componentName=\"Employee.Management.Deductions\"\n FallbackComponent={FallbackComponent}\n >\n <DeductionsEditFormRoot {...props} />\n </BaseBoundaries>\n )\n}\n\nfunction DeductionsEditFormRoot({\n employeeId,\n editingDeductionId,\n dictionary,\n onEvent,\n}: DeductionsEditFormProps) {\n useI18n('Employee.Management.Deductions')\n useComponentDictionary('Employee.Management.Deductions', dictionary)\n\n // React Query dedupes against any sibling consumer of this list, so this\n // is just a typed handle on the loaded row used to seed edit mode.\n const list = useDeductionsList({ employeeId })\n const formDictionary = useManagementDeductionsFormDictionary()\n\n if (list.isLoading) {\n return <BaseLayout isLoading error={list.errorHandling.errors} />\n }\n\n const deduction = editingDeductionId\n ? (list.data.deductions.find(d => d.uuid === editingDeductionId) ?? null)\n : null\n\n return (\n <BaseLayout error={list.errorHandling.errors}>\n <DeductionsForm\n employeeId={employeeId}\n deduction={deduction}\n dictionary={formDictionary}\n onSaved={(saved, mode) => {\n onEvent(\n mode === 'create'\n ? componentEvents.EMPLOYEE_MANAGEMENT_DEDUCTIONS_EDIT_FORM_CREATED\n : componentEvents.EMPLOYEE_MANAGEMENT_DEDUCTIONS_EDIT_FORM_UPDATED,\n saved,\n )\n }}\n onCancel={() => {\n onEvent(componentEvents.EMPLOYEE_MANAGEMENT_DEDUCTIONS_EDIT_FORM_CANCELLED)\n }}\n />\n </BaseLayout>\n )\n}\n"],"names":["DeductionsEditForm","FallbackComponent","props","jsx","BaseBoundaries","DeductionsEditFormRoot","employeeId","editingDeductionId","dictionary","onEvent","useI18n","useComponentDictionary","list","useDeductionsList","formDictionary","useManagementDeductionsFormDictionary","BaseLayout","deduction","d","DeductionsForm","saved","mode","componentEvents"],"mappings":";;;;;;;;AA2CO,SAASA,EAAmB;AAAA,EACjC,mBAAAC;AAAA,EACA,GAAGC;AACL,GAAgF;AAC9E,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,eAAc;AAAA,MACd,mBAAAH;AAAA,MAEA,UAAA,gBAAAE,EAACE,GAAA,EAAwB,GAAGH,EAAA,CAAO;AAAA,IAAA;AAAA,EAAA;AAGzC;AAEA,SAASG,EAAuB;AAAA,EAC9B,YAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AACF,GAA4B;AAC1B,EAAAC,EAAQ,gCAAgC,GACxCC,EAAuB,kCAAkCH,CAAU;AAInE,QAAMI,IAAOC,EAAkB,EAAE,YAAAP,GAAY,GACvCQ,IAAiBC,EAAA;AAEvB,MAAIH,EAAK;AACP,6BAAQI,GAAA,EAAW,WAAS,IAAC,OAAOJ,EAAK,cAAc,QAAQ;AAGjE,QAAMK,IAAYV,IACbK,EAAK,KAAK,WAAW,KAAK,CAAAM,MAAKA,EAAE,SAASX,CAAkB,KAAK,OAClE;AAEJ,SACE,gBAAAJ,EAACa,GAAA,EAAW,OAAOJ,EAAK,cAAc,QACpC,UAAA,gBAAAT;AAAA,IAACgB;AAAA,IAAA;AAAA,MACC,YAAAb;AAAA,MACA,WAAAW;AAAA,MACA,YAAYH;AAAA,MACZ,SAAS,CAACM,GAAOC,MAAS;AACxB,QAAAZ;AAAA,UACEY,MAAS,WACLC,EAAgB,mDAChBA,EAAgB;AAAA,UACpBF;AAAA,QAAA;AAAA,MAEJ;AAAA,MACA,UAAU,MAAM;AACd,QAAAX,EAAQa,EAAgB,kDAAkD;AAAA,MAC5E;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -5,6 +5,7 @@ import { DocumentsCardContextual as a } from "./DocumentsComponents.js";
|
|
|
5
5
|
import { documentsStateMachine as i } from "./documentsStateMachine.js";
|
|
6
6
|
import { Flow as u } from "../../../Flow/Flow.js";
|
|
7
7
|
import { BaseBoundaries as p } from "../../../Base/Base.js";
|
|
8
|
+
import "../../../Base/useBase.js";
|
|
8
9
|
import { useComponentDictionary as s, useI18n as f } from "../../../../i18n/I18n.js";
|
|
9
10
|
function D({ employeeId: o, onEvent: e }) {
|
|
10
11
|
f("Employee.Management.Documents");
|
|
@@ -18,7 +19,7 @@ function D({ employeeId: o, onEvent: e }) {
|
|
|
18
19
|
);
|
|
19
20
|
return /* @__PURE__ */ n(u, { machine: m, onEvent: e });
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
+
function w({
|
|
22
23
|
dictionary: o,
|
|
23
24
|
FallbackComponent: e,
|
|
24
25
|
...m
|
|
@@ -33,6 +34,6 @@ function E({
|
|
|
33
34
|
);
|
|
34
35
|
}
|
|
35
36
|
export {
|
|
36
|
-
|
|
37
|
+
w as Documents
|
|
37
38
|
};
|
|
38
39
|
//# sourceMappingURL=Documents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Documents.js","sources":["../../../../../src/components/Employee/Documents/management/Documents.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { DocumentsCardContextual, type DocumentsContextInterface } from './DocumentsComponents'\nimport { documentsStateMachine } from './documentsStateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport {\n BaseBoundaries,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useI18n } from '@/i18n'\nimport type { OnEventType } from '@/components/Base/useBase'\n\n/**\n * Props for {@link Documents}.\n *\n * @public\n */\nexport interface DocumentsProps extends CommonComponentInterface<'Employee.Management.Documents'> {\n /** The associated employee identifier. */\n employeeId: string\n /** Event handler fired on flow state changes. */\n onEvent: OnEventType<EventType, unknown>\n}\n\nfunction DocumentsFlow({ employeeId, onEvent }: DocumentsProps) {\n useI18n('Employee.Management.Documents')\n\n const machine = useMemo(\n () =>\n createMachine('card', documentsStateMachine, (ctx: DocumentsContextInterface) => ({\n ...ctx,\n component: DocumentsCardContextual,\n employeeId,\n })),\n [employeeId],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n\n/**\n * Standalone employee documents management flow.\n *\n * @remarks\n * Orchestrates the documents card and the per-form document manager. The flow\n * starts on the documents card and routes to the document manager when a row's\n * View CTA is selected; cancelling from the document manager returns to the\n * card.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/documents/card/viewRequested` | Fired when a row's View CTA is clicked on the documents card | `{ employeeId: string; formId: string }` |\n *\n * @param props - See {@link DocumentsProps}.\n * @returns The documents management flow.\n * @public\n */\nexport function Documents({\n dictionary,\n FallbackComponent,\n ...props\n}: DocumentsProps & BaseComponentInterface<'Employee.Management.Documents'>) {\n useComponentDictionary('Employee.Management.Documents', dictionary)\n return (\n <BaseBoundaries\n componentName=\"Employee.Management.Documents\"\n FallbackComponent={FallbackComponent}\n >\n <DocumentsFlow {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["DocumentsFlow","employeeId","onEvent","useI18n","machine","useMemo","createMachine","documentsStateMachine","ctx","DocumentsCardContextual","jsx","Flow","Documents","dictionary","FallbackComponent","props","useComponentDictionary","BaseBoundaries"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Documents.js","sources":["../../../../../src/components/Employee/Documents/management/Documents.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { DocumentsCardContextual, type DocumentsContextInterface } from './DocumentsComponents'\nimport { documentsStateMachine } from './documentsStateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport {\n BaseBoundaries,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useI18n } from '@/i18n'\nimport type { OnEventType } from '@/components/Base/useBase'\n\n/**\n * Props for {@link Documents}.\n *\n * @public\n */\nexport interface DocumentsProps extends CommonComponentInterface<'Employee.Management.Documents'> {\n /** The associated employee identifier. */\n employeeId: string\n /** Event handler fired on flow state changes. */\n onEvent: OnEventType<EventType, unknown>\n}\n\nfunction DocumentsFlow({ employeeId, onEvent }: DocumentsProps) {\n useI18n('Employee.Management.Documents')\n\n const machine = useMemo(\n () =>\n createMachine('card', documentsStateMachine, (ctx: DocumentsContextInterface) => ({\n ...ctx,\n component: DocumentsCardContextual,\n employeeId,\n })),\n [employeeId],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n\n/**\n * Standalone employee documents management flow.\n *\n * @remarks\n * Orchestrates the documents card and the per-form document manager. The flow\n * starts on the documents card and routes to the document manager when a row's\n * View CTA is selected; cancelling from the document manager returns to the\n * card.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/documents/card/viewRequested` | Fired when a row's View CTA is clicked on the documents card | `{ employeeId: string; formId: string }` |\n *\n * @param props - See {@link DocumentsProps}.\n * @returns The documents management flow.\n * @public\n */\nexport function Documents({\n dictionary,\n FallbackComponent,\n ...props\n}: DocumentsProps & BaseComponentInterface<'Employee.Management.Documents'>) {\n useComponentDictionary('Employee.Management.Documents', dictionary)\n return (\n <BaseBoundaries\n componentName=\"Employee.Management.Documents\"\n FallbackComponent={FallbackComponent}\n >\n <DocumentsFlow {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["DocumentsFlow","employeeId","onEvent","useI18n","machine","useMemo","createMachine","documentsStateMachine","ctx","DocumentsCardContextual","jsx","Flow","Documents","dictionary","FallbackComponent","props","useComponentDictionary","BaseBoundaries"],"mappings":";;;;;;;;;AA2BA,SAASA,EAAc,EAAE,YAAAC,GAAY,SAAAC,KAA2B;AAC9D,EAAAC,EAAQ,+BAA+B;AAEvC,QAAMC,IAAUC;AAAA,IACd,MACEC,EAAc,QAAQC,GAAuB,CAACC,OAAoC;AAAA,MAChF,GAAGA;AAAA,MACH,WAAWC;AAAA,MACX,YAAAR;AAAA,IAAA,EACA;AAAA,IACJ,CAACA,CAAU;AAAA,EAAA;AAGb,SAAO,gBAAAS,EAACC,GAAA,EAAK,SAAAP,GAAkB,SAAAF,EAAA,CAAkB;AACnD;AAmBO,SAASU,EAAU;AAAA,EACxB,YAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,GAAGC;AACL,GAA6E;AAC3E,SAAAC,EAAuB,iCAAiCH,CAAU,GAEhE,gBAAAH;AAAA,IAACO;AAAA,IAAA;AAAA,MACC,eAAc;AAAA,MACd,mBAAAH;AAAA,MAEA,UAAA,gBAAAJ,EAACV,GAAA,EAAe,GAAGe,EAAA,CAAO;AAAA,IAAA;AAAA,EAAA;AAGhC;"}
|
package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.d.ts
CHANGED
|
@@ -1,7 +1,27 @@
|
|
|
1
|
-
import { BaseComponentInterface
|
|
2
|
-
|
|
1
|
+
import { BaseComponentInterface } from '../../../../../Base/Base';
|
|
2
|
+
/**
|
|
3
|
+
* Props for {@link DocumentList}.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface DocumentListProps extends BaseComponentInterface {
|
|
8
|
+
/** The associated employee identifier. */
|
|
3
9
|
employeeId: string;
|
|
4
10
|
}
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Lists the employee's documents pending signature.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Fetches the employee's forms and renders the list of documents that still
|
|
16
|
+
* require signing along with a continue action once everything is signed.
|
|
17
|
+
*
|
|
18
|
+
* | Event | Description | Data |
|
|
19
|
+
* | ----- | ----------- | ---- |
|
|
20
|
+
* | `employee/forms/view` | Fired when a form's "Sign" action is selected | `{ uuid: string; name?: string }` |
|
|
21
|
+
* | `employee/forms/done` | Fired when all required forms have been signed and the parent flow can advance | — |
|
|
22
|
+
*
|
|
23
|
+
* @param props - See {@link DocumentListProps}.
|
|
24
|
+
* @returns The employee document list.
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
export declare function DocumentList(props: DocumentListProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentList.js","sources":["../../../../../../../src/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.tsx"],"sourcesContent":["import { useEmployeeFormsListSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/employeeFormsList'\nimport { type Form } from '@gusto/embedded-api-v-2025-11-15/models/components/form'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { DocumentListProvider } from './useDocumentList'\nimport {
|
|
1
|
+
{"version":3,"file":"DocumentList.js","sources":["../../../../../../../src/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.tsx"],"sourcesContent":["import { useEmployeeFormsListSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/employeeFormsList'\nimport { type Form } from '@gusto/embedded-api-v-2025-11-15/models/components/form'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { DocumentListProvider } from './useDocumentList'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Flex } from '@/components/Common'\n\n/**\n * Props for {@link DocumentList}.\n *\n * @public\n */\nexport interface DocumentListProps extends BaseComponentInterface {\n /** The associated employee identifier. */\n employeeId: string\n}\n\n/**\n * Lists the employee's documents pending signature.\n *\n * @remarks\n * Fetches the employee's forms and renders the list of documents that still\n * require signing along with a continue action once everything is signed.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/forms/view` | Fired when a form's \"Sign\" action is selected | `{ uuid: string; name?: string }` |\n * | `employee/forms/done` | Fired when all required forms have been signed and the parent flow can advance | — |\n *\n * @param props - See {@link DocumentListProps}.\n * @returns The employee document list.\n * @public\n */\nexport function DocumentList(props: DocumentListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, className, children }: DocumentListProps) {\n useI18n('Employee.DocumentSigner')\n const { onEvent } = useBase()\n\n const { data, error: documentListError } = useEmployeeFormsListSuspense({ employeeId })\n const employeeForms = data.forms!\n\n const hasSignedAllForms = employeeForms.every(employeeForm => !employeeForm.requiresSigning)\n\n const handleRequestFormToSign = (data: Form) => {\n const fullForm = employeeForms.find(f => f.uuid === data.uuid)\n onEvent(componentEvents.EMPLOYEE_VIEW_FORM_TO_SIGN, { uuid: data.uuid, name: fullForm?.name })\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.EMPLOYEE_FORMS_DONE)\n }\n\n return (\n <section className={className}>\n <DocumentListProvider\n value={{\n employeeForms,\n hasSignedAllForms,\n handleContinue,\n handleRequestFormToSign,\n documentListError,\n }}\n >\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Actions />\n </Flex>\n )}\n </DocumentListProvider>\n </section>\n )\n}\n"],"names":["DocumentList","props","jsx","BaseComponent","Root","employeeId","className","children","useI18n","onEvent","useBase","data","documentListError","useEmployeeFormsListSuspense","employeeForms","hasSignedAllForms","employeeForm","DocumentListProvider","componentEvents","fullForm","jsxs","Flex","Head","List","Actions"],"mappings":";;;;;;;;;;;;;;AAsCO,SAASA,EAAaC,GAA0B;AACrD,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,WAAAC,GAAW,UAAAC,KAA+B;AACpE,EAAAC,EAAQ,yBAAyB;AACjC,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEd,EAAE,MAAAC,GAAM,OAAOC,EAAA,IAAsBC,EAA6B,EAAE,YAAAR,GAAY,GAChFS,IAAgBH,EAAK,OAErBI,IAAoBD,EAAc,MAAM,CAAAE,MAAgB,CAACA,EAAa,eAAe;AAW3F,SACE,gBAAAd,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACe;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,eAAAH;AAAA,QACA,mBAAAC;AAAA,QACA,gBAVe,MAAM;AAC3B,UAAAN,EAAQS,EAAgB,mBAAmB;AAAA,QAC7C;AAAA,QASQ,yBAhBwB,CAACP,MAAe;AAC9C,gBAAMQ,IAAWL,EAAc,KAAK,OAAK,EAAE,SAASH,EAAK,IAAI;AAC7D,UAAAF,EAAQS,EAAgB,4BAA4B,EAAE,MAAMP,EAAK,MAAM,MAAMQ,GAAU,MAAM;AAAA,QAC/F;AAAA,QAcQ,mBAAAP;AAAA,MAAA;AAAA,MAGD,UAAAL,KAGC,gBAAAa,EAACC,GAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAAnB,EAACoB,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ;"}
|