@gusto/embedded-react-sdk 0.50.0 → 0.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -0
- package/README.md +0 -8
- package/dist/components/Base/index.d.ts +0 -1
- package/dist/components/Base/useBase.d.ts +1 -0
- package/dist/components/Base/useBase.js.map +1 -1
- package/dist/components/Base/useBaseSubmit.js +4 -4
- package/dist/components/Base/useBaseSubmit.js.map +1 -1
- package/dist/components/Common/ActionsLayout/index.d.ts +0 -1
- package/dist/components/Common/DataView/DataCards/index.d.ts +0 -1
- package/dist/components/Common/DataView/index.d.ts +0 -1
- package/dist/components/Common/DetailViewLayout/index.d.ts +0 -1
- package/dist/components/Common/DocumentList/index.d.ts +0 -1
- package/dist/components/Common/DocumentViewer/index.d.ts +0 -1
- package/dist/components/Common/FieldCaption/index.d.ts +0 -1
- package/dist/components/Common/FieldDescription/index.d.ts +0 -1
- package/dist/components/Common/FieldErrorMessage/index.d.ts +0 -1
- package/dist/components/Common/FieldLayout/FieldLayoutTypes.d.ts +1 -0
- package/dist/components/Common/FieldLayout/index.d.ts +0 -1
- package/dist/components/Common/Fields/CheckboxField/index.d.ts +0 -1
- package/dist/components/Common/Fields/CheckboxGroupField/index.d.ts +0 -1
- package/dist/components/Common/Fields/ComboBoxField/index.d.ts +0 -1
- package/dist/components/Common/Fields/DatePickerField/index.d.ts +0 -1
- package/dist/components/Common/Fields/FileInputField/index.d.ts +0 -1
- package/dist/components/Common/Fields/MultiSelectComboBoxField/index.d.ts +0 -1
- package/dist/components/Common/Fields/NumberInputField/index.d.ts +0 -1
- package/dist/components/Common/Fields/RadioGroupField/index.d.ts +0 -1
- package/dist/components/Common/Fields/SelectField/index.d.ts +0 -1
- package/dist/components/Common/Fields/SwitchField/index.d.ts +0 -1
- package/dist/components/Common/Fields/TextAreaField/index.d.ts +0 -1
- package/dist/components/Common/Fields/TextInputField/index.d.ts +0 -1
- package/dist/components/Common/Fieldset/index.d.ts +0 -1
- package/dist/components/Common/Flex/index.d.ts +0 -1
- package/dist/components/Common/FlowBreadcrumbs/index.d.ts +0 -1
- package/dist/components/Common/Form/index.d.ts +0 -1
- package/dist/components/Common/HamburgerMenu/index.d.ts +0 -1
- package/dist/components/Common/HorizontalFieldLayout/HorizontalFieldLayoutTypes.d.ts +1 -0
- package/dist/components/Common/HorizontalFieldLayout/index.d.ts +0 -1
- package/dist/components/Common/InlineSpinner/index.d.ts +0 -1
- package/dist/components/Common/OnboardingStatusBadge/index.d.ts +2 -3
- package/dist/components/Common/OnboardingStatusBadge/index.js.map +1 -1
- package/dist/components/Common/PaginationControl/PaginationControlTypes.d.ts +2 -2
- package/dist/components/Common/PaginationControl/index.d.ts +0 -1
- package/dist/components/Common/PayrollLoading/PayrollLoadingTypes.d.ts +1 -1
- package/dist/components/Common/PayrollLoading/index.d.ts +0 -1
- package/dist/components/Common/ReorderableList/index.d.ts +0 -1
- package/dist/components/Common/TaxInputs/TaxInputs.d.ts +2 -2
- package/dist/components/Common/TaxInputs/TaxInputs.js.map +1 -1
- package/dist/components/Common/TaxInputs/index.d.ts +0 -1
- package/dist/components/Common/UI/Alert/AlertTypes.d.ts +1 -1
- package/dist/components/Common/UI/Alert/AlertTypes.js.map +1 -1
- package/dist/components/Common/UI/Badge/Badge.module.scss.js +5 -5
- package/dist/components/Common/UI/Badge/BadgeTypes.d.ts +1 -1
- package/dist/components/Common/UI/Badge/BadgeTypes.js.map +1 -1
- package/dist/components/Common/UI/Banner/BannerTypes.d.ts +1 -1
- package/dist/components/Common/UI/Banner/BannerTypes.js.map +1 -1
- package/dist/components/Common/UI/Box/BoxTypes.d.ts +1 -1
- package/dist/components/Common/UI/BoxHeader/BoxHeaderTypes.d.ts +1 -1
- package/dist/components/Common/UI/BoxHeader/BoxHeaderTypes.js.map +1 -1
- package/dist/components/Common/UI/BoxHeader/index.d.ts +0 -1
- package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.d.ts +2 -2
- package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.js.map +1 -1
- package/dist/components/Common/UI/Breadcrumbs/index.d.ts +0 -1
- package/dist/components/Common/UI/Button/ButtonTypes.d.ts +2 -2
- package/dist/components/Common/UI/Button/ButtonTypes.js.map +1 -1
- package/dist/components/Common/UI/Button/index.d.ts +0 -1
- package/dist/components/Common/UI/CalendarPreview/CalendarPreviewTypes.d.ts +1 -1
- package/dist/components/Common/UI/CalendarPreview/index.d.ts +0 -1
- package/dist/components/Common/UI/Card/CardTypes.d.ts +1 -1
- package/dist/components/Common/UI/Checkbox/CheckboxTypes.d.ts +1 -1
- package/dist/components/Common/UI/Checkbox/CheckboxTypes.js.map +1 -1
- package/dist/components/Common/UI/Checkbox/index.d.ts +0 -1
- package/dist/components/Common/UI/CheckboxGroup/CheckboxGroupTypes.d.ts +2 -2
- package/dist/components/Common/UI/CheckboxGroup/CheckboxGroupTypes.js.map +1 -1
- package/dist/components/Common/UI/CheckboxGroup/index.d.ts +0 -1
- package/dist/components/Common/UI/ComboBox/ComboBoxTypes.d.ts +2 -2
- package/dist/components/Common/UI/DatePicker/DatePickerTypes.d.ts +1 -1
- package/dist/components/Common/UI/DatePicker/index.d.ts +0 -1
- package/dist/components/Common/UI/DateRangePicker/DateRangePickerTypes.d.ts +2 -2
- package/dist/components/Common/UI/DateRangePicker/index.d.ts +0 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.d.ts +2 -2
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js.map +1 -1
- package/dist/components/Common/UI/DescriptionList/index.d.ts +0 -1
- package/dist/components/Common/UI/Dialog/DialogTypes.d.ts +1 -1
- package/dist/components/Common/UI/Dialog/DialogTypes.js.map +1 -1
- package/dist/components/Common/UI/Dialog/index.d.ts +0 -1
- package/dist/components/Common/UI/FileInput/FileInputTypes.d.ts +1 -1
- package/dist/components/Common/UI/FileInput/FileInputTypes.js.map +1 -1
- package/dist/components/Common/UI/FileInput/index.d.ts +0 -1
- package/dist/components/Common/UI/Heading/HeadingTypes.d.ts +1 -1
- package/dist/components/Common/UI/Heading/index.d.ts +0 -1
- package/dist/components/Common/UI/Input/index.d.ts +0 -1
- package/dist/components/Common/UI/Link/LinkTypes.d.ts +1 -1
- package/dist/components/Common/UI/Link/index.d.ts +0 -1
- package/dist/components/Common/UI/List/ListTypes.d.ts +3 -3
- package/dist/components/Common/UI/List/index.d.ts +0 -1
- package/dist/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes.d.ts +1 -1
- package/dist/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes.js.map +1 -1
- package/dist/components/Common/UI/LoadingSpinner/index.d.ts +0 -1
- package/dist/components/Common/UI/Menu/MenuTypes.d.ts +2 -2
- package/dist/components/Common/UI/Menu/MenuTypes.js.map +1 -1
- package/dist/components/Common/UI/Menu/index.d.ts +0 -1
- package/dist/components/Common/UI/Modal/ModalTypes.d.ts +1 -1
- package/dist/components/Common/UI/Modal/ModalTypes.js.map +1 -1
- package/dist/components/Common/UI/Modal/index.d.ts +0 -1
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBoxTypes.d.ts +2 -2
- package/dist/components/Common/UI/NumberInput/NumberInputTypes.d.ts +1 -1
- package/dist/components/Common/UI/NumberInput/index.d.ts +0 -1
- package/dist/components/Common/UI/ProgressBar/ProgressBarTypes.d.ts +1 -1
- package/dist/components/Common/UI/ProgressBar/index.d.ts +0 -1
- package/dist/components/Common/UI/Radio/RadioTypes.d.ts +1 -1
- package/dist/components/Common/UI/Radio/RadioTypes.js.map +1 -1
- package/dist/components/Common/UI/Radio/index.d.ts +0 -1
- package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.d.ts +2 -2
- package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.js.map +1 -1
- package/dist/components/Common/UI/RadioGroup/index.d.ts +0 -1
- package/dist/components/Common/UI/Select/SelectTypes.d.ts +2 -2
- package/dist/components/Common/UI/Select/index.d.ts +0 -1
- package/dist/components/Common/UI/Switch/SwitchTypes.d.ts +1 -1
- package/dist/components/Common/UI/Switch/SwitchTypes.js.map +1 -1
- package/dist/components/Common/UI/Switch/index.d.ts +0 -1
- package/dist/components/Common/UI/Table/TableTypes.d.ts +3 -3
- package/dist/components/Common/UI/Table/TableTypes.js.map +1 -1
- package/dist/components/Common/UI/Table/index.d.ts +0 -1
- package/dist/components/Common/UI/Tabs/TabsTypes.d.ts +2 -2
- package/dist/components/Common/UI/Tabs/index.d.ts +0 -1
- package/dist/components/Common/UI/Text/TextTypes.d.ts +1 -1
- package/dist/components/Common/UI/Text/TextTypes.js.map +1 -1
- package/dist/components/Common/UI/Text/index.d.ts +0 -1
- package/dist/components/Common/UI/TextArea/TextAreaTypes.d.ts +1 -1
- package/dist/components/Common/UI/TextArea/TextAreaTypes.js.map +1 -1
- package/dist/components/Common/UI/TextArea/index.d.ts +0 -1
- package/dist/components/Common/UI/TextInput/TextInputTypes.d.ts +1 -1
- package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
- package/dist/components/Common/UI/TextInput/index.d.ts +0 -1
- package/dist/components/Common/VisuallyHidden/index.d.ts +0 -1
- package/dist/components/Common/index.d.ts +0 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +5 -5
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/index.d.ts +0 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.d.ts +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +8 -10
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +3 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/index.d.ts +0 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.d.ts +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +8 -10
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/index.d.ts +0 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +10 -12
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccount.d.ts +5 -5
- package/dist/components/Company/BankAccount/BankAccount.js +1 -1
- package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountComponents.d.ts +1 -1
- package/dist/components/Company/BankAccount/BankAccountComponents.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +8 -10
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/context.d.ts +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +2 -2
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/index.d.ts +0 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.d.ts +2 -2
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +8 -10
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentSigner.js +1 -1
- package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/index.d.ts +0 -1
- package/dist/components/Company/DocumentSigner/documentSignerStateMachine.d.ts +2 -2
- package/dist/components/Company/DocumentSigner/documentSignerStateMachine.js.map +1 -1
- package/dist/components/Company/DocumentSigner/index.d.ts +0 -1
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.d.ts +2 -22
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js +4 -4
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js.map +1 -1
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/index.d.ts +1 -2
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/signCompanyFormSchema.d.ts +1 -5
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/signCompanyFormSchema.js.map +1 -1
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.d.ts +10 -9
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.js +41 -38
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -2
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +1 -1
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/index.d.ts +0 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.d.ts +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +13 -15
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +11 -13
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Industry.js +2 -2
- package/dist/components/Company/Industry/Industry.js.map +1 -1
- package/dist/components/Company/Industry/index.d.ts +0 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +4 -4
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/index.d.ts +0 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +8 -10
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/index.d.ts +0 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.d.ts +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +8 -10
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +25 -25
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.d.ts +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +8 -10
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleList.js +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleList.js.map +1 -1
- package/dist/components/Company/PaySchedule/index.d.ts +0 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.d.ts +7 -83
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js +5 -5
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/index.d.ts +2 -4
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.d.ts +2 -8
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.d.ts +22 -27
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js +93 -90
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +2 -2
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/applicableIf.d.ts +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/applicableIf.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.d.ts +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +8 -10
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/index.d.ts +0 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.d.ts +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +8 -10
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/index.d.ts +0 -1
- package/dist/components/Company/index.d.ts +0 -1
- package/dist/components/Contractor/Address/Address.js +39 -39
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/index.d.ts +0 -1
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/contractorAddressSchema.d.ts +1 -6
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/contractorAddressSchema.js.map +1 -1
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/fields.d.ts +5 -52
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/fields.js.map +1 -1
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/index.d.ts +2 -4
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/useContractorAddressForm.d.ts +25 -24
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/useContractorAddressForm.js +102 -98
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/useContractorAddressForm.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.d.ts +0 -1
- package/dist/components/Contractor/ContractorList/index.js +1 -1
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/ContractorList/useContractorList.d.ts +1 -1
- package/dist/components/Contractor/ContractorList/useContractorList.js +1 -1
- package/dist/components/Contractor/ContractorList/useContractorList.js.map +1 -1
- package/dist/components/Contractor/Documents/DocumentSigner/DocumentSigner.d.ts +41 -0
- package/dist/components/Contractor/Documents/DocumentSigner/DocumentSigner.js +32 -0
- package/dist/components/Contractor/Documents/DocumentSigner/DocumentSigner.js.map +1 -0
- package/dist/components/Contractor/Documents/DocumentSigner/documentSignerStateMachine.d.ts +22 -0
- package/dist/components/Contractor/Documents/DocumentSigner/documentSignerStateMachine.js +25 -0
- package/dist/components/Contractor/Documents/DocumentSigner/documentSignerStateMachine.js.map +1 -0
- package/dist/components/Contractor/Documents/DocumentSigner/index.d.ts +1 -0
- package/dist/components/Contractor/Documents/DocumentSigner/stateMachine.d.ts +6 -0
- package/dist/components/Contractor/Documents/DocumentSigner/stateMachine.js +44 -0
- package/dist/components/Contractor/Documents/DocumentSigner/stateMachine.js.map +1 -0
- package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.js.map +1 -1
- package/dist/components/Contractor/Documents/DocumentsList/index.d.ts +0 -1
- package/dist/components/Contractor/Documents/DocumentsList/useContractorDocumentsList/index.d.ts +0 -1
- package/dist/components/Contractor/Documents/DocumentsList/useContractorDocumentsList/useContractorDocumentsList.d.ts +1 -1
- package/dist/components/Contractor/Documents/DocumentsList/useContractorDocumentsList/useContractorDocumentsList.js +1 -1
- package/dist/components/Contractor/Documents/DocumentsList/useContractorDocumentsList/useContractorDocumentsList.js.map +1 -1
- package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.d.ts +30 -0
- package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js +280 -0
- package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js.map +1 -0
- package/dist/components/Contractor/Documents/SignatureForm/index.d.ts +2 -0
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/contractorSignatureFormSchema.d.ts +175 -0
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/contractorSignatureFormSchema.js +110 -0
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/contractorSignatureFormSchema.js.map +1 -0
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/contractorSignatureFormSchema.test.d.ts +1 -0
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/fields.d.ts +259 -0
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/fields.js +85 -0
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/fields.js.map +1 -0
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/index.d.ts +5 -0
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.d.ts +129 -0
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.js +182 -0
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.js.map +1 -0
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.d.ts +223 -0
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.js +162 -0
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.js.map +1 -0
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.test.d.ts +1 -0
- package/dist/components/Contractor/Landing/Landing.js +2 -2
- package/dist/components/Contractor/Landing/Landing.js.map +1 -1
- package/dist/components/Contractor/Landing/index.d.ts +0 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +2 -2
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/OnboardingSummary/index.d.ts +0 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +73 -71
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/shared/index.d.ts +0 -1
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/fields.d.ts +4 -40
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/fields.js +1 -1
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/fields.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/index.d.ts +1 -2
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountForm.d.ts +5 -4
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountForm.js +78 -74
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountFormSchema.d.ts +5 -3
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountFormSchema.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/contractorPaymentMethodSchema.d.ts +4 -2
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/contractorPaymentMethodSchema.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/fields.d.ts +1 -10
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/fields.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/index.d.ts +1 -2
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/useContractorPaymentMethodForm.d.ts +5 -4
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/useContractorPaymentMethodForm.js +65 -62
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/useContractorPaymentMethodForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +5 -5
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +2 -2
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.d.ts +2 -2
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/GenericBlocker.d.ts +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/GenericBlocker.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +4 -4
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/helpers.d.ts +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/helpers.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/index.d.ts +0 -1
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js +3 -3
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.d.ts +2 -2
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js +4 -4
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.d.ts +3 -3
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js +3 -3
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.d.ts +3 -3
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/index.d.ts +0 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +3 -3
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.d.ts +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/SelfOnboardingContractorProfile.js +1 -1
- package/dist/components/Contractor/Profile/SelfOnboardingContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Profile/index.d.ts +0 -1
- package/dist/components/Contractor/Profile/shared/index.d.ts +0 -1
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.d.ts +2 -7
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.js +9 -9
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.js.map +1 -1
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/fields.d.ts +14 -163
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/fields.js +16 -16
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/fields.js.map +1 -1
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/index.d.ts +2 -4
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.d.ts +31 -28
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.js +142 -128
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.js.map +1 -1
- package/dist/components/Contractor/SelfOnboardingFlow/SelfOnboardingComponents.d.ts +30 -0
- package/dist/components/Contractor/SelfOnboardingFlow/SelfOnboardingComponents.js +57 -0
- package/dist/components/Contractor/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -0
- package/dist/components/Contractor/SelfOnboardingFlow/SelfOnboardingFlow.d.ts +45 -0
- package/dist/components/Contractor/SelfOnboardingFlow/SelfOnboardingFlow.js +30 -0
- package/dist/components/Contractor/SelfOnboardingFlow/SelfOnboardingFlow.js.map +1 -0
- package/dist/components/Contractor/SelfOnboardingFlow/selfOnboardingMachine.d.ts +8 -0
- package/dist/components/Contractor/SelfOnboardingFlow/selfOnboardingMachine.js +59 -0
- package/dist/components/Contractor/SelfOnboardingFlow/selfOnboardingMachine.js.map +1 -0
- package/dist/components/Contractor/Submit/Submit.js +3 -3
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Contractor/exports/contractorOnboarding.d.ts +3 -0
- package/dist/components/Contractor/exports/contractorOnboarding.js +20 -14
- package/dist/components/Contractor/exports/contractorOnboarding.js.map +1 -1
- package/dist/components/Employee/Compensation/index.d.ts +0 -1
- package/dist/components/Employee/Compensation/management/Compensation.d.ts +1 -1
- package/dist/components/Employee/Compensation/management/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.d.ts +1 -1
- package/dist/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.d.ts +1 -1
- package/dist/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationAddJobForm/index.d.ts +0 -1
- package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.d.ts +1 -1
- package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.js +1 -1
- package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationCard/index.d.ts +0 -1
- package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.d.ts +1 -1
- package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.js +1 -1
- package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationEditForm/index.d.ts +0 -1
- package/dist/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.js +1 -1
- package/dist/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js.map +1 -1
- package/dist/components/Employee/Compensation/management/index.d.ts +0 -1
- package/dist/components/Employee/Compensation/onboarding/Compensation.d.ts +3 -3
- package/dist/components/Employee/Compensation/onboarding/Compensation.js +1 -1
- package/dist/components/Employee/Compensation/onboarding/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/CompensationFlowComponents.d.ts +2 -2
- package/dist/components/Employee/Compensation/onboarding/CompensationFlowComponents.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/index.d.ts +0 -1
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.d.ts +20 -1
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.js +2 -2
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.d.ts +1 -1
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/JobsList/index.d.ts +0 -1
- package/dist/components/Employee/Compensation/onboarding/index.d.ts +0 -1
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.d.ts +1 -1
- package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/getPendingCompensationChanges.d.ts +2 -2
- package/dist/components/Employee/Compensation/shared/getPendingCompensationChanges.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +2 -11
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.d.ts +10 -109
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js +4 -4
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/index.d.ts +1 -3
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.d.ts +24 -21
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js +191 -177
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationManagement/index.d.ts +0 -1
- package/dist/components/Employee/Compensation/shared/useCompensationManagement/useCompensationManagement.d.ts +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationManagement/useCompensationManagement.js +4 -4
- package/dist/components/Employee/Compensation/shared/useCompensationManagement/useCompensationManagement.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/fields.d.ts +5 -66
- package/dist/components/Employee/Compensation/shared/useJobForm/fields.js +6 -6
- package/dist/components/Employee/Compensation/shared/useJobForm/fields.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/index.d.ts +1 -3
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.d.ts +2 -10
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.d.ts +20 -17
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js +121 -112
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
- package/dist/components/Employee/Dashboard/Dashboard.js +1 -1
- package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Employee/Dashboard/DashboardFlow.d.ts +1 -1
- package/dist/components/Employee/Dashboard/DashboardFlow.js.map +1 -1
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
- package/dist/components/Employee/Dashboard/index.d.ts +0 -1
- package/dist/components/Employee/Deductions/index.d.ts +0 -1
- package/dist/components/Employee/Deductions/management/Deductions.d.ts +1 -1
- package/dist/components/Employee/Deductions/management/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.js.map +1 -1
- package/dist/components/Employee/Deductions/management/DeductionsCard/index.d.ts +0 -1
- package/dist/components/Employee/Deductions/management/DeductionsEditForm/index.d.ts +0 -1
- package/dist/components/Employee/Deductions/management/deductionsStateMachine.js.map +1 -1
- package/dist/components/Employee/Deductions/management/index.d.ts +0 -1
- package/dist/components/Employee/Deductions/onboarding/Deductions.d.ts +1 -1
- package/dist/components/Employee/Deductions/onboarding/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.d.ts +1 -1
- package/dist/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/deductionsContextualComponents.d.ts +1 -1
- package/dist/components/Employee/Deductions/onboarding/deductionsContextualComponents.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/index.d.ts +0 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.d.ts +1 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.d.ts +1 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.d.ts +1 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/index.d.ts +0 -1
- package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.d.ts +1 -1
- package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/formatDeductionAmount.d.ts +1 -1
- package/dist/components/Employee/Deductions/shared/formatDeductionAmount.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.d.ts +2 -7
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.d.ts +9 -97
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +8 -8
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/index.d.ts +1 -3
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.d.ts +26 -23
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js +119 -106
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.d.ts +1 -5
- package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.js +1 -1
- package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.d.ts +8 -86
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +4 -4
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useDeductionForm/index.d.ts +1 -3
- package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.d.ts +20 -19
- package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.js +129 -120
- package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useDeductionsList.d.ts +1 -1
- package/dist/components/Employee/Deductions/shared/useDeductionsList.js +2 -2
- package/dist/components/Employee/Deductions/shared/useDeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useDeleteDeduction.d.ts +1 -1
- package/dist/components/Employee/Deductions/shared/useDeleteDeduction.js.map +1 -1
- package/dist/components/Employee/Documents/management/DocumentManager.js +2 -2
- package/dist/components/Employee/Documents/management/DocumentManager.js.map +1 -1
- package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.js.map +1 -1
- package/dist/components/Employee/Documents/management/DocumentsCard/index.d.ts +0 -1
- package/dist/components/Employee/Documents/management/index.d.ts +0 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/index.d.ts +0 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.d.ts +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +8 -10
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js +2 -2
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js +3 -3
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/index.d.ts +0 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/index.d.ts +0 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/documentSignerStateMachine.d.ts +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/documentSignerStateMachine.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/index.d.ts +0 -1
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.js +2 -2
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/index.d.ts +0 -1
- package/dist/components/Employee/Documents/shared/SignatureForm/index.d.ts +0 -1
- package/dist/components/Employee/Documents/shared/useDocumentsList/index.d.ts +0 -1
- package/dist/components/Employee/Documents/shared/useDocumentsList/useDocumentsList.d.ts +1 -1
- package/dist/components/Employee/Documents/shared/useDocumentsList/useDocumentsList.js +1 -1
- package/dist/components/Employee/Documents/shared/useDocumentsList/useDocumentsList.js.map +1 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.d.ts +39 -287
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js +1 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js.map +1 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/index.d.ts +2 -4
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.d.ts +1 -6
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.js.map +1 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/useSignEmployeeForm.d.ts +75 -25
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/useSignEmployeeForm.js +91 -90
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/useSignEmployeeForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.d.ts +1 -1
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.js.map +1 -1
- package/dist/components/Employee/EmployeeList/shared/index.d.ts +0 -1
- package/dist/components/Employee/EmployeeList/shared/useEmployeeList.d.ts +3 -3
- package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js +3 -3
- package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.d.ts +1 -1
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js.map +1 -1
- package/dist/components/Employee/EmployeeListFlow/index.d.ts +0 -1
- package/dist/components/Employee/FederalTaxes/index.d.ts +0 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.d.ts +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesCard/index.d.ts +0 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.d.ts +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/index.d.ts +0 -1
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.d.ts +1 -1
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/index.d.ts +0 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/federalTaxesSchema.d.ts +1 -5
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/federalTaxesSchema.js +1 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/federalTaxesSchema.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.d.ts +6 -73
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js +4 -4
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/index.d.ts +2 -4
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/useFederalTaxesForm.d.ts +20 -30
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/useFederalTaxesForm.js +78 -69
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/useFederalTaxesForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesSummary/index.d.ts +0 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesSummary/useFederalTaxesSummary.d.ts +1 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesSummary/useFederalTaxesSummary.js +1 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesSummary/useFederalTaxesSummary.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressCard/index.d.ts +0 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressEditForm.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.d.ts +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/getPendingFutureHomeAddress.d.ts +1 -1
- package/dist/components/Employee/HomeAddress/management/getPendingFutureHomeAddress.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/index.d.ts +0 -1
- package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.d.ts +1 -1
- package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.js +3 -3
- package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.js.map +1 -1
- package/dist/components/Employee/HomeAddress/shared/useHomeAddressSummary/index.d.ts +0 -1
- package/dist/components/Employee/HomeAddress/shared/useHomeAddressSummary/useHomeAddressSummary.d.ts +1 -1
- package/dist/components/Employee/HomeAddress/shared/useHomeAddressSummary/useHomeAddressSummary.js +1 -1
- package/dist/components/Employee/HomeAddress/shared/useHomeAddressSummary/useHomeAddressSummary.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +2 -2
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/Landing/index.d.ts +0 -1
- package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlow.d.ts +1 -1
- package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlow.js.map +1 -1
- package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlowComponents.d.ts +1 -1
- package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlowComponents.js.map +1 -1
- package/dist/components/Employee/OnboardingExecutionFlow/index.d.ts +0 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.d.ts +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +78 -53
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/index.d.ts +0 -1
- package/dist/components/Employee/PaymentMethod/index.d.ts +0 -1
- package/dist/components/Employee/PaymentMethod/management/index.d.ts +0 -1
- package/dist/components/Employee/PaymentMethod/onboarding/index.d.ts +0 -1
- package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.d.ts +1 -1
- package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/BankFormBody/index.d.ts +0 -1
- package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.d.ts +1 -1
- package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/index.d.ts +0 -1
- package/dist/components/Employee/PaymentMethod/shared/index.d.ts +0 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.d.ts +4 -45
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/index.d.ts +2 -3
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.d.ts +11 -9
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.js +71 -66
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.d.ts +2 -6
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.d.ts +1 -12
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/index.d.ts +2 -3
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.d.ts +8 -6
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.js +56 -49
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.d.ts +1 -5
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.d.ts +2 -2
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.js +4 -4
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/index.d.ts +1 -2
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js +4 -4
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.d.ts +19 -5
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.js +3 -3
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.js.map +1 -1
- package/dist/components/Employee/Paystubs/management/PaystubsCard/index.d.ts +0 -1
- package/dist/components/Employee/Paystubs/management/index.d.ts +0 -1
- package/dist/components/Employee/Paystubs/shared/usePaystubsList/index.d.ts +0 -1
- package/dist/components/Employee/Paystubs/shared/usePaystubsList/usePaystubsList.d.ts +1 -1
- package/dist/components/Employee/Paystubs/shared/usePaystubsList/usePaystubsList.js +3 -3
- package/dist/components/Employee/Paystubs/shared/usePaystubsList/usePaystubsList.js.map +1 -1
- package/dist/components/Employee/Profile/management/ProfileCard/index.d.ts +0 -1
- package/dist/components/Employee/Profile/management/ProfileEditForm.js +24 -25
- package/dist/components/Employee/Profile/management/ProfileEditForm.js.map +1 -1
- package/dist/components/Employee/Profile/management/index.d.ts +0 -1
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js +31 -32
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js +1 -1
- package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.d.ts +3 -9
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.js +19 -29
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.d.ts +12 -92
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js +8 -8
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/index.d.ts +1 -4
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +23 -28
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.js +91 -80
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeProfileSummary/index.d.ts +0 -1
- package/dist/components/Employee/Profile/shared/useEmployeeProfileSummary/useEmployeeProfileSummary.d.ts +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeProfileSummary/useEmployeeProfileSummary.js +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeProfileSummary/useEmployeeProfileSummary.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.d.ts +7 -77
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +5 -5
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.d.ts +1 -5
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/index.d.ts +2 -4
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.js +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.d.ts +21 -26
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js +64 -61
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.d.ts +3 -25
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js +4 -4
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/index.d.ts +2 -4
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.js +1 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.d.ts +12 -17
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js +68 -63
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/workAddressSchema.d.ts +1 -5
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/workAddressSchema.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.d.ts +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.d.ts +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js.map +1 -1
- package/dist/components/Employee/StateTaxes/index.d.ts +0 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxesCard/index.d.ts +0 -1
- package/dist/components/Employee/StateTaxes/management/index.d.ts +0 -1
- package/dist/components/Employee/StateTaxes/onboarding/index.d.ts +0 -1
- package/dist/components/Employee/StateTaxes/shared/index.d.ts +0 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/__fixtures__/stateTaxesFixtures.d.ts +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/__fixtures__/toWireFormat.d.ts +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/employeeStateTaxesSchema.d.ts +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/employeeStateTaxesSchema.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js +8 -8
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldMapping.d.ts +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldMapping.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fields.d.ts +2 -2
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fields.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/index.d.ts +1 -2
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.d.ts +13 -6
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.js +3 -6
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useStateTaxesSummary/index.d.ts +0 -1
- package/dist/components/Employee/StateTaxes/shared/useStateTaxesSummary/useStateTaxesSummary.d.ts +1 -1
- package/dist/components/Employee/StateTaxes/shared/useStateTaxesSummary/useStateTaxesSummary.js +1 -1
- package/dist/components/Employee/StateTaxes/shared/useStateTaxesSummary/useStateTaxesSummary.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.d.ts +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +9 -9
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.d.ts +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.d.ts +6 -2
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.d.ts +1 -1
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js +4 -4
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressCard/index.d.ts +0 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressEditForm.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.d.ts +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/getPendingFutureWorkAddress.d.ts +2 -2
- package/dist/components/Employee/WorkAddress/management/getPendingFutureWorkAddress.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/index.d.ts +0 -1
- package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.d.ts +1 -1
- package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.js +3 -3
- package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.js.map +1 -1
- package/dist/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/index.d.ts +0 -1
- package/dist/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/useEmployeeWorkAddressSummary.d.ts +1 -1
- package/dist/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/useEmployeeWorkAddressSummary.js +1 -1
- package/dist/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/useEmployeeWorkAddressSummary.js.map +1 -1
- package/dist/components/Employee/index.d.ts +0 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +4 -4
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/index.d.ts +0 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +2 -2
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/index.d.ts +0 -1
- package/dist/components/InformationRequests/index.d.ts +0 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js +2 -2
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/index.d.ts +0 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +3 -3
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/index.d.ts +0 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +2 -2
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/index.d.ts +0 -1
- package/dist/components/Payroll/ConfirmWireDetails/index.d.ts +0 -1
- package/dist/components/Payroll/Dismissal/DismissalFlow.d.ts +4 -0
- package/dist/components/Payroll/Dismissal/DismissalFlow.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js +1 -1
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js +4 -4
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/index.d.ts +0 -1
- package/dist/components/Payroll/Dismissal/index.d.ts +0 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +5 -5
- package/dist/components/Payroll/GrossUpModal/index.d.ts +0 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
- package/dist/components/Payroll/OffCycle/index.d.ts +0 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +4 -4
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/index.d.ts +0 -1
- package/dist/components/Payroll/OffCycleDeductionsSetting/index.d.ts +0 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/index.d.ts +0 -1
- package/dist/components/Payroll/OffCycleReasonSelection/index.d.ts +0 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/index.d.ts +0 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/index.d.ts +0 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +4 -4
- 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.js +2 -2
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +7 -7
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +5 -5
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +4 -4
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +5 -5
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +3 -3
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +4 -4
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.d.ts +2 -2
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.d.ts +1 -1
- 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.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js +2 -2
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +4 -4
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +2 -2
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +2 -2
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +8 -8
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +3 -3
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +7 -7
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +4 -4
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.d.ts +2 -2
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.d.ts +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/index.d.ts +0 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.d.ts +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollStatusBadges/index.d.ts +0 -1
- package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.d.ts +1 -1
- package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js +2 -2
- package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/index.d.ts +0 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +2 -2
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/index.d.ts +0 -1
- package/dist/components/Payroll/RecoveryCases/index.d.ts +0 -1
- package/dist/components/Payroll/Transition/TransitionFlow.d.ts +5 -1
- package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js +1 -1
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -1
- package/dist/components/Payroll/Transition/index.d.ts +0 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js +4 -4
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/index.d.ts +0 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +3 -3
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/index.d.ts +0 -1
- package/dist/components/Payroll/helpers.d.ts +6 -6
- package/dist/components/Payroll/helpers.js +1 -1
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +0 -1
- package/dist/components/Payroll/payrollTypes.js +1 -1
- package/dist/components/Payroll/payrollTypes.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.d.ts +3 -4
- package/dist/components/Payroll/usePreparedPayrollData.js +15 -17
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/Payroll/useUnprocessedTransitionPayPeriods.d.ts +1 -1
- package/dist/components/Payroll/useUnprocessedTransitionPayPeriods.js +3 -3
- package/dist/components/Payroll/useUnprocessedTransitionPayPeriods.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js +3 -3
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/index.d.ts +0 -1
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.js +3 -3
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.js.map +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyList.js +6 -6
- package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettings.js +4 -4
- package/dist/components/TimeOff/PolicySettings/PolicySettings.js.map +1 -1
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelector.js +1 -1
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelector.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlow.d.ts +1 -4
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlow.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/timeOffPolicyTypes.d.ts +1 -1
- package/dist/components/TimeOff/TimeOffFlow/timeOffPolicyTypes.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js +4 -4
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/index.d.ts +0 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js +2 -2
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentationTypes.d.ts +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js +5 -5
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js +3 -3
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js +6 -6
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/index.d.ts +0 -1
- package/dist/components/TimeOff/index.d.ts +0 -1
- package/dist/components/TimeOff/shared/PolicyDetailLayout/index.d.ts +0 -1
- package/dist/components/index.d.ts +32 -2
- package/dist/contexts/ApiProvider/ApiProvider.d.ts +3 -3
- package/dist/contexts/ApiProvider/ApiProvider.js +3 -3
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
- package/dist/contexts/ApiProvider/apiVersionHook.js +1 -1
- package/dist/contexts/ApiProvider/apiVersionHook.js.map +1 -1
- package/dist/contexts/ApiProvider/createSdkQueryClient.d.ts +1 -1
- package/dist/contexts/ApiProvider/createSdkQueryClient.js +2 -2
- package/dist/contexts/ApiProvider/createSdkQueryClient.js.map +1 -1
- package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +1 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +2 -2
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/GustoProvider/index.d.ts +0 -1
- package/dist/contexts/LocaleProvider/index.d.ts +0 -1
- package/dist/contexts/ObservabilityProvider/index.d.ts +0 -1
- package/dist/contexts/ThemeProvider/index.d.ts +0 -1
- package/dist/contexts/ThemeProvider/theme.js +1 -1
- package/dist/contexts/ThemeProvider/theme.js.map +1 -1
- package/dist/contexts/index.d.ts +0 -1
- package/dist/helpers/apiErrorToList.d.ts +1 -1
- package/dist/helpers/apiErrorToList.js.map +1 -1
- package/dist/helpers/formattedStrings.d.ts +2 -2
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/helpers/validations.d.ts +8 -0
- package/dist/helpers/validations.js +3 -2
- package/dist/helpers/validations.js.map +1 -1
- package/dist/hooks/useCompanyPaymentSpeed.d.ts +1 -1
- package/dist/hooks/useCompanyPaymentSpeed.js +1 -1
- package/dist/hooks/useCompanyPaymentSpeed.js.map +1 -1
- package/dist/i18n/I18n.d.ts +3 -2
- package/dist/i18n/I18n.js +1 -0
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Contractor.Address.json.js +10 -8
- package/dist/i18n/en/Contractor.Address.json.js.map +1 -1
- package/dist/i18n/en/Contractor.PaymentMethod.json.js +3 -1
- package/dist/i18n/en/Contractor.PaymentMethod.json.js.map +1 -1
- package/dist/i18n/en/Contractor.SignatureForm.json.js +38 -0
- package/dist/i18n/en/Contractor.SignatureForm.json.js.map +1 -0
- package/dist/i18n/index.d.ts +0 -1
- package/dist/i18n/types.d.ts +7470 -0
- package/dist/index.d.ts +43 -43
- package/dist/index.js +148 -280
- package/dist/index.js.map +1 -1
- package/dist/models/external.d.ts +211 -197
- package/dist/partner-hook-utils/composeErrorHandler.d.ts +2 -2
- package/dist/partner-hook-utils/composeErrorHandler.js.map +1 -1
- package/dist/partner-hook-utils/form/FormFieldsMetadataContext.js +3 -3
- package/dist/partner-hook-utils/form/buildFormSchema.d.ts +19 -9
- package/dist/partner-hook-utils/form/buildFormSchema.js.map +1 -1
- package/dist/partner-hook-utils/form/composeSubmitHandler.d.ts +1 -1
- package/dist/partner-hook-utils/form/composeSubmitHandler.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/index.d.ts +0 -1
- package/dist/partner-hook-utils/form/index.d.ts +0 -4
- package/dist/partner-hook-utils/form/withFlags.d.ts +18 -0
- package/dist/partner-hook-utils/form/withFlags.js +7 -0
- package/dist/partner-hook-utils/form/withFlags.js.map +1 -0
- package/dist/partner-hook-utils/index.d.ts +0 -1
- package/dist/partner-hook-utils/types.d.ts +6 -3
- package/dist/shared/constants.d.ts +18 -4
- package/dist/shared/constants.js +3 -2
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/Helpers.d.ts +21 -8
- package/dist/types/hooks.d.ts +2 -2
- package/dist/types/sdkError.js +3 -3
- package/dist/types/sdkError.js.map +1 -1
- package/docs/guides/endpoint-inventory.json +29 -0
- package/package.json +8 -8
- package/dist/assets/icons/unchecked_circular.svg.js +0 -10
- package/dist/assets/icons/unchecked_circular.svg.js.map +0 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.module.scss.js +0 -16
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.module.scss.js.map +0 -1
- package/dist/partner-hook-utils/form/useFieldErrorMessage.js +0 -20
- package/dist/partner-hook-utils/form/useFieldErrorMessage.js.map +0 -1
- package/dist/types/i18next.d.ts +0 -4075
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sources":["../../../src/components/Payroll/helpers.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api-v-2025-11-15/models/components/employee'\nimport {\n type PayrollShowFixedCompensations,\n OffCycleReasonType,\n} from '@gusto/embedded-api-v-2025-11-15/models/components/payroll'\nimport type {\n PayrollEmployeeCompensationsTypeFixedCompensations as FixedCompensations,\n PayrollEmployeeCompensationsTypeReimbursements as Reimbursement,\n} from '@gusto/embedded-api-v-2025-11-15/models/components/payrollemployeecompensationstype'\nimport type { PayrollUpdateReimbursements } from '@gusto/embedded-api-v-2025-11-15/models/components/payrollupdate'\nimport type { PayrollFixedCompensationTypesType } from '@gusto/embedded-api-v-2025-11-15/models/components/payrollfixedcompensationtypestype'\nimport { useCallback } from 'react'\nimport type { TFunction } from 'i18next'\nimport { useTranslation } from 'react-i18next'\nimport type { PayScheduleShow as PayScheduleObject } from '@gusto/embedded-api-v-2025-11-15/models/components/payscheduleshow'\nimport type {\n Compensation,\n MinimumWages,\n} from '@gusto/embedded-api-v-2025-11-15/models/components/compensation'\nimport type { PayrollEmployeeCompensationsType } from '@gusto/embedded-api-v-2025-11-15/models/components/payrollemployeecompensationstype'\nimport type { Payroll } from '@gusto/embedded-api-v-2025-11-15/models/components/payroll'\nimport type { PayrollType } from './PayrollList/types'\nimport { PayrollCategory, isOffCyclePayroll } from './payrollTypes'\nimport { formatPayRate } from '@/helpers/formattedStrings'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { FlsaStatus } from '@/shared/constants'\nimport { MS_PER_HOUR } from '@/helpers/dateFormatting'\nconst REGULAR_HOURS_NAME = 'regular hours'\n\n// Utility to get the primary job from an employee\nconst getPrimaryJob = (employee: Employee) => {\n return employee.jobs?.find(job => job.primary) || employee.jobs?.[0] || null\n}\n\nconst roundToSixDecimals = (value: number): number => {\n return Math.round(value * 1_000_000) / 1_000_000\n}\n\nconst roundToTwoDecimals = (value: number): number => {\n return Math.round(value * 100) / 100\n}\n\nconst isRegularHours = (compensationName: string): boolean => {\n return compensationName.toLowerCase() === REGULAR_HOURS_NAME\n}\n\nconst PAY_PERIOD_HOURS_MAPPINGS: Record<string, number> = {\n Daily: 8.0,\n 'Every week': 40.0,\n 'Every other week': 80.0,\n 'Twice per month': 86.666667,\n Monthly: 173.333333,\n Quarterly: 520.0,\n Semiannually: 1040.0,\n Annually: 2080.0,\n}\n\n/**\n * Formats an employee's primary-job pay rate into a localized display string.\n *\n * @remarks\n * Returns `null` when the employee has no jobs, the primary job has no compensations, or the rate is missing\n * or zero.\n *\n * @param args - The employee, translation function, and locale to format against.\n * @returns The formatted pay-rate string, or `null` when no usable rate is available.\n * @internal\n */\nexport const formatEmployeePayRate = ({\n employee,\n t,\n locale = 'en-US',\n}: {\n employee?: Employee\n t: TFunction\n locale?: string\n}) => {\n if (!employee?.jobs) {\n return null\n }\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return null\n }\n\n const jobCompensation = primaryJob.compensations[0]\n if (!jobCompensation) {\n return null\n }\n if (!jobCompensation.rate || parseFloat(jobCompensation.rate) === 0) {\n return null\n }\n\n const rate = parseFloat(jobCompensation.rate)\n const paymentUnit = jobCompensation.paymentUnit || 'Hour'\n\n return formatPayRate({ rate, paymentUnit, t, locale })\n}\n\n/**\n * Returns a memoized formatter that produces a localized pay-rate string from an employee's primary job.\n *\n * @returns A callback that takes an `Employee` and returns the formatted pay-rate string, or `null` when the\n * employee has no usable primary-job compensation.\n * @internal\n */\nexport const useFormatEmployeePayRate = () => {\n const { t } = useTranslation('common')\n const { locale } = useLocale()\n\n return useCallback(\n (employee?: Employee) => {\n return formatEmployeePayRate({ employee, t, locale })\n },\n [t, locale],\n )\n}\n\n/**\n * Sums hourly-compensation rows named `'regular hours'`.\n *\n * @param compensation - The employee compensation entry.\n * @returns The total regular hours worked, or `0` when none are recorded.\n * @internal\n */\nexport const getRegularHours = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.hourlyCompensations) return 0\n\n return compensation.hourlyCompensations\n .filter(hourlyCompensation => hourlyCompensation.name?.toLowerCase() === 'regular hours')\n .reduce((sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'), 0)\n}\n\n/**\n * Sums the overtime hours (multiplier greater than `1`) from an employee compensation.\n *\n * @param compensation - The employee compensation entry.\n * @returns The total overtime hours, or `0` when the compensation is excluded or has none.\n * @internal\n */\nexport function getOvertimeHours(compensation: PayrollEmployeeCompensationsType) {\n if (!compensation.hourlyCompensations || compensation.excluded) {\n return 0\n }\n\n return compensation.hourlyCompensations\n .filter(hourlyCompensation => Number(hourlyCompensation.compensationMultiplier) > 1)\n .reduce((sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'), 0)\n}\n\n/**\n * Sums the paid-time-off hours from an employee compensation.\n *\n * @param compensation - The employee compensation entry.\n * @returns The total PTO hours, or `0` when none are recorded.\n * @internal\n */\nexport const getTotalPtoHours = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.paidTimeOff) {\n return 0\n }\n return compensation.paidTimeOff.reduce((sum, pto) => sum + parseFloat(pto.hours || '0'), 0)\n}\n\n/**\n * Sums fixed-compensation amounts excluding reimbursements and minimum-wage adjustments.\n *\n * @param compensation - The employee compensation entry.\n * @returns The total additional earnings amount, or `0` when none qualify.\n * @internal\n */\nexport const getAdditionalEarnings = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.fixedCompensations) {\n return 0\n }\n\n return compensation.fixedCompensations\n .filter(fixedCompensation => {\n const name = fixedCompensation.name?.toLowerCase() || ''\n const amount = parseFloat(fixedCompensation.amount || '0')\n return name !== 'reimbursement' && name !== 'minimum wage adjustment' && amount > 0\n })\n .reduce((sum, fixedCompensation) => sum + parseFloat(fixedCompensation.amount || '0'), 0)\n}\n\n/**\n * Returns the total reimbursement amount for an employee compensation.\n *\n * @remarks\n * Prefers the explicit `reimbursements` array when present; falls back to a fixed-compensation row named\n * `'Reimbursement'` for older payroll shapes.\n *\n * @param compensation - The employee compensation entry.\n * @returns The summed reimbursement amount, or `0` when none.\n * @internal\n */\nexport const getReimbursements = (compensation: PayrollEmployeeCompensationsType) => {\n if (compensation.reimbursements && compensation.reimbursements.length > 0) {\n return compensation.reimbursements.reduce(\n (sum, reimbursement) => sum + parseFloat(reimbursement.amount || '0'),\n 0,\n )\n }\n\n if (!compensation.fixedCompensations) {\n return 0\n }\n\n const reimbursementComp = compensation.fixedCompensations.find(\n fixedCompensation => fixedCompensation.name?.toLowerCase() === 'reimbursement',\n )\n return reimbursementComp ? parseFloat(reimbursementComp.amount || '0') : 0\n}\n\n/**\n * Normalizes a reimbursement list for submission to the v2025-11-15 API.\n *\n * @remarks\n * - Drops named rows that would be no-ops on the server (zero amount with no existing uuid).\n * - Drops named rows with an existing uuid and zero amount — these are removals, and the backend's\n * `replace_itemized_reimbursements` deletes any persisted reimbursement whose uuid is omitted from the\n * incoming list.\n * - Consolidates multiple unnamed (description-less) rows into a single unnamed entry, since the API rejects\n * more than one unnamed reimbursement per employee.\n * - When the consolidated unnamed total is zero, sends no unnamed entry at all. The backend's full-replace\n * semantics then delete any persisted unnamed entry (unnamed entries never have uuids, so this is the only\n * way to remove them).\n * - Maps the read shape (`description: string | null`) to the write shape (`description?: string`), omitting\n * the field when there is no description.\n *\n * @param reimbursements - The reimbursements pulled from the prepared payroll.\n * @returns The normalized reimbursements ready to send on a payroll update.\n * @internal\n */\nexport const cleanupReimbursements = (\n reimbursements: Reimbursement[],\n): PayrollUpdateReimbursements[] => {\n const consolidated: PayrollUpdateReimbursements[] = []\n let unnamedTotal = 0\n\n reimbursements.forEach(reimbursement => {\n const amount = reimbursement.amount\n const numericAmount = parseFloat(amount || '0')\n const description = reimbursement.description?.trim() || ''\n const uuid = reimbursement.uuid ?? undefined\n\n if (description === '') {\n unnamedTotal += numericAmount\n return\n }\n\n if (numericAmount === 0 && !uuid) {\n return\n }\n\n consolidated.push({\n amount,\n description,\n ...(uuid ? { uuid } : {}),\n })\n })\n\n if (unnamedTotal > 0) {\n consolidated.push({\n amount: unnamedTotal.toFixed(2),\n })\n }\n\n return consolidated\n}\n\n/**\n * Formats an hours value for display, rounding to two decimals and ensuring whole numbers render with `.0`.\n *\n * @param hours - The hours value to format.\n * @returns A string like `'40.0'` or `'37.25'`.\n * @internal\n */\nexport const formatHoursDisplay = (hours: number): string => {\n const rounded = roundToTwoDecimals(hours)\n\n if (rounded % 1 === 0) {\n return `${rounded}.0`\n }\n\n return rounded.toString()\n}\n\nconst getHoursInPayPeriod = (paySchedule: PayScheduleObject): number => {\n if (!paySchedule.frequency) {\n return 0\n }\n\n return PAY_PERIOD_HOURS_MAPPINGS[paySchedule.frequency] || 0\n}\n\nconst getEffectiveCompensation = (\n compensations: Compensation[],\n effectiveDate: Date,\n): Compensation | null => {\n if (!compensations.length) return null\n\n const sorted = [...compensations].sort(\n (a, b) =>\n (a.effectiveDate ? new Date(a.effectiveDate).getTime() : 0) -\n (b.effectiveDate ? new Date(b.effectiveDate).getTime() : 0),\n )\n\n for (let i = sorted.length - 1; i >= 0; i--) {\n const currentDateString = sorted[i]?.effectiveDate\n const currentDate = currentDateString ? new Date(currentDateString) : null\n if (currentDate && currentDate <= effectiveDate) {\n return sorted[i] || null\n }\n }\n\n return sorted[0] || null\n}\n\nconst getEffectiveMinimumWage = (\n minimumWages: MinimumWages[],\n effectiveDate: Date,\n): MinimumWages | null => {\n if (!minimumWages.length) return null\n\n const sorted = [...minimumWages].sort(\n (a, b) =>\n (a.effectiveDate ? new Date(a.effectiveDate).getTime() : 0) -\n (b.effectiveDate ? new Date(b.effectiveDate).getTime() : 0),\n )\n\n for (let i = sorted.length - 1; i >= 0; i--) {\n const currentDateString = sorted[i]?.effectiveDate\n const currentDate = currentDateString ? new Date(currentDateString) : null\n if (currentDate && currentDate <= effectiveDate) {\n return sorted[i] || null\n }\n }\n\n return sorted[0] || null\n}\n\nconst isSalaried = (compensation: Compensation): boolean => {\n return compensation.flsaStatus === 'Exempt' || compensation.flsaStatus === 'Salaried Nonexempt'\n}\n\nconst getTotalTipCompensations = (fixedCompensations: PayrollShowFixedCompensations[]): number => {\n if (!fixedCompensations.length) return 0\n\n return fixedCompensations\n .filter(fixedCompensation => {\n const name = fixedCompensation.name?.toLowerCase()\n const amount = parseFloat(fixedCompensation.amount || '0')\n return (name === 'paycheck tips' || name === 'cash tips') && amount > 0\n })\n .reduce((sum, fixedCompensation) => sum + parseFloat(fixedCompensation.amount || '0'), 0)\n}\n\nconst calculateHourlyRate = (compensation: Compensation): number => {\n const rate = parseFloat(compensation.rate || '0')\n const paymentUnit = compensation.paymentUnit || 'Hour'\n\n switch (paymentUnit) {\n case 'Hour':\n return rate\n case 'Year':\n return rate / 2080 // 52 weeks * 40 hours\n case 'Month':\n return rate / 173.333333\n case 'Week':\n return rate / 40\n case 'Paycheck':\n return 0 // Paycheck rate is 0 for hourly calculation\n default:\n return rate\n }\n}\n\nconst getHourlyRateForJob = (employee: Employee, jobUuid: string, effectiveDate: Date): number => {\n const job = employee.jobs?.find(j => j.uuid === jobUuid)\n if (!job?.compensations) {\n return 0\n }\n\n const compensation = getEffectiveCompensation(job.compensations, effectiveDate)\n return compensation ? calculateHourlyRate(compensation) : 0\n}\n\nconst getPrimaryHourlyRate = (employee: Employee, effectiveDate: Date): number => {\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return 0\n }\n\n const compensation = getEffectiveCompensation(primaryJob.compensations, effectiveDate)\n return compensation ? calculateHourlyRate(compensation) : 0\n}\n\nconst getTotalOutstandingPtoHours = (compensation: PayrollEmployeeCompensationsType): number => {\n if (!compensation.paidTimeOff) {\n return 0\n }\n\n return compensation.paidTimeOff.reduce(\n (sum, paidTimeOff) => sum + parseFloat(paidTimeOff.finalPayoutUnusedHoursInput || '0'),\n 0,\n )\n}\n\nconst getPtoHours = (\n compensation: PayrollEmployeeCompensationsType,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n offCycle: boolean,\n): number => {\n const regularPtoHours = getTotalPtoHours(compensation)\n\n if (offCycle) {\n const outstandingPtoHours = getTotalOutstandingPtoHours(compensation)\n return regularPtoHours + outstandingPtoHours\n }\n\n if (isSalariedWithExpectedHours) {\n return Math.min(hoursInPayPeriod, regularPtoHours)\n }\n\n return regularPtoHours\n}\n\nconst calculateMinimumWageAdjustment = (\n primaryCompensation: Compensation,\n compensation: PayrollEmployeeCompensationsType,\n effectiveDate: Date,\n): number => {\n if (!primaryCompensation.adjustForMinimumWage) return 0\n\n const effectiveMinWage = getEffectiveMinimumWage(\n primaryCompensation.minimumWages || [],\n effectiveDate,\n )\n if (!effectiveMinWage) {\n return 0\n }\n\n const totalHours =\n compensation.hourlyCompensations?.reduce(\n (sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'),\n 0,\n ) || 0\n\n const hourlyRate = calculateHourlyRate(primaryCompensation)\n\n const totalTipCredit = (parseFloat(effectiveMinWage.wage || '0') - hourlyRate) * totalHours\n const totalTips = getTotalTipCompensations(compensation.fixedCompensations || [])\n\n return Math.max(0, totalTipCredit - totalTips)\n}\n\nconst calculateRegularPlusOvertimePay = (\n compensation: PayrollEmployeeCompensationsType,\n employee: Employee,\n effectiveDate: Date,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n ptoHours: number,\n isOffCycle: boolean,\n): number => {\n if (!isOffCycle && isSalariedWithExpectedHours) {\n const primaryHourlyRate = getPrimaryHourlyRate(employee, effectiveDate)\n return primaryHourlyRate * (hoursInPayPeriod - ptoHours)\n }\n\n if (!compensation.hourlyCompensations || !employee.jobs) {\n return 0\n }\n\n const regularRatePay = compensation.hourlyCompensations.reduce((sum, hc) => {\n const hours = parseFloat(hc.hours || '0')\n const hourlyRate = getHourlyRateForJob(employee, hc.jobUuid || '', effectiveDate)\n return sum + hours * hourlyRate\n }, 0)\n\n const totalHours = compensation.hourlyCompensations.reduce((sum, hc) => {\n return sum + parseFloat(hc.hours || '0')\n }, 0)\n\n if (totalHours === 0) return regularRatePay\n\n const overtimeWeightedRate = roundToSixDecimals(regularRatePay / totalHours)\n\n // Calculate overtime pay for non-regular hours\n const overtimePay = compensation.hourlyCompensations\n .filter(hc => !isRegularHours(hc.name || ''))\n .reduce((sum, hc) => {\n const hours = parseFloat(hc.hours || '0')\n const multiplier = hc.compensationMultiplier || 1\n return sum + hours * overtimeWeightedRate * (multiplier - 1)\n }, 0)\n\n return regularRatePay + overtimePay\n}\n\nconst calculatePtoPay = (\n compensation: PayrollEmployeeCompensationsType,\n employee: Employee,\n effectiveDate: Date,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n offCycle: boolean,\n): number => {\n const ptoHours = getPtoHours(\n compensation,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n offCycle,\n )\n const primaryHourlyRate = getPrimaryHourlyRate(employee, effectiveDate)\n return ptoHours * primaryHourlyRate\n}\n\nconst isSalariedWithPayPeriodExpectedHours = (\n compensation: PayrollEmployeeCompensationsType,\n isSalaried: boolean,\n hoursInPayPeriod: number,\n): boolean => {\n if (!isSalaried) return false\n\n const regularHourlyCompensation = compensation.hourlyCompensations?.find(hourlyCompensation =>\n isRegularHours(hourlyCompensation.name || ''),\n )\n\n if (!regularHourlyCompensation) return false\n\n const regularHours = parseFloat(regularHourlyCompensation.hours || '0')\n return regularHours === hoursInPayPeriod\n}\n\n/**\n * Calculates an employee's gross pay for a payroll, combining regular and overtime pay,\n * additional earnings, PTO pay, and any minimum-wage adjustment.\n *\n * @remarks\n * Returns `0` when the compensation is excluded or the employee has no primary job compensation effective\n * on the given date. The result is rounded to two decimal places.\n *\n * @param compensation - The employee compensation entry from the payroll.\n * @param employee - The employee record (used to look up jobs and effective compensations).\n * @param compensationEffectiveDateString - ISO date used to resolve the effective compensation; defaults to now.\n * @param paySchedule - The pay schedule, used to derive expected hours per pay period.\n * @param payrollCategory - The payroll category; off-cycle categories change how PTO hours are summed.\n * @returns The gross pay amount.\n * @internal\n */\nexport const calculateGrossPay = (\n compensation: PayrollEmployeeCompensationsType,\n employee: Employee,\n compensationEffectiveDateString?: string,\n paySchedule?: PayScheduleObject,\n payrollCategory: PayrollCategory = PayrollCategory.Regular,\n): number => {\n if (compensation.excluded) {\n return 0\n }\n\n const compensationEffectiveDate = compensationEffectiveDateString\n ? new Date(compensationEffectiveDateString)\n : new Date()\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return 0\n }\n\n const primaryCompensation = getEffectiveCompensation(\n primaryJob.compensations,\n compensationEffectiveDate,\n )\n\n if (!primaryCompensation) {\n return 0\n }\n\n const salaried = isSalaried(primaryCompensation)\n const hoursInPayPeriod = paySchedule ? getHoursInPayPeriod(paySchedule) : 0\n\n const isSalariedWithExpectedHours = isSalariedWithPayPeriodExpectedHours(\n compensation,\n salaried,\n hoursInPayPeriod,\n )\n\n const offCycle = isOffCyclePayroll(payrollCategory)\n\n const ptoHours = getPtoHours(\n compensation,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n offCycle,\n )\n\n const regularPlusOvertimePay = calculateRegularPlusOvertimePay(\n compensation,\n employee,\n compensationEffectiveDate,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n ptoHours,\n offCycle,\n )\n\n const fixedPay = getAdditionalEarnings(compensation)\n const ptoPay = calculatePtoPay(\n compensation,\n employee,\n compensationEffectiveDate,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n offCycle,\n )\n const minimumWageAdjustment = calculateMinimumWageAdjustment(\n primaryCompensation,\n compensation,\n compensationEffectiveDate,\n )\n\n const total = regularPlusOvertimePay + fixedPay + ptoPay + minimumWageAdjustment\n return roundToTwoDecimals(total)\n}\n\n/**\n * Returns the high-level payroll type — `'External'`, `'Off-Cycle'`, or `'Regular'`.\n *\n * @param payroll - The payroll whose type to classify.\n * @returns The payroll type string.\n * @internal\n */\nexport const getPayrollType = (payroll: {\n external?: boolean\n offCycle?: boolean\n}): PayrollType => {\n if (payroll.external) return 'External'\n if (payroll.offCycle) return 'Off-Cycle'\n return 'Regular'\n}\n\n/**\n * Returns whether an off-cycle reason indicates a dismissal payroll.\n *\n * @param offCycleReason - The payroll's off-cycle reason string.\n * @returns `true` when the reason matches the dismissed-employee reason.\n * @internal\n */\nexport const isDismissalPayroll = (offCycleReason?: string | null): boolean =>\n offCycleReason === OffCycleReasonType.DismissedEmployee\n\nconst OFF_CYCLE_REASON_LABELS: Record<string, string> = {\n Bonus: 'Bonus',\n Correction: 'Correction',\n 'Transition from old pay schedule': 'Transition',\n 'Dismissed employee': 'Dismissal',\n 'Hired employee': 'New Hire',\n 'Benefit reversal': 'Benefit Reversal',\n 'Wage correction': 'Wage Correction',\n 'Tax reconciliation': 'Tax Reconciliation',\n Reversal: 'Reversal',\n 'Disability insurance distribution': 'Disability Insurance',\n}\n\n/**\n * Returns a human-readable label describing the payroll type, mapping off-cycle reasons to display strings.\n *\n * @param payroll - The payroll whose type to describe.\n * @returns `'External'`, `'Regular'`, `'Off-Cycle'`, or a label derived from the off-cycle reason\n * (e.g. `'Bonus'`, `'Dismissal'`).\n * @internal\n */\nexport const getPayrollTypeLabel = (payroll: {\n external?: boolean\n offCycle?: boolean\n offCycleReason?: string | null\n}): string => {\n if (payroll.external) return 'External'\n if (payroll.offCycle && payroll.offCycleReason) {\n return OFF_CYCLE_REASON_LABELS[payroll.offCycleReason] ?? payroll.offCycleReason\n }\n if (payroll.offCycle) return 'Off-Cycle'\n return 'Regular'\n}\n\n/**\n * Merges existing fixed compensations with placeholder entries for any compensation types the employee\n * doesn't yet have, then filters out excluded types and sorts the result alphabetically.\n *\n * @remarks\n * Owners (FLSA status `Owner`) never receive placeholder entries. Placeholders are added with `amount: '0.00'`\n * and the supplied `primaryJobUuid`.\n *\n * @param options - Inputs controlling which placeholder entries to add and which types to exclude.\n * @returns The merged, filtered, and sorted list of fixed compensations.\n * @internal\n */\nexport const getAdditionalEarningsCompensations = ({\n flsaStatus,\n existingFixedCompensations = [],\n primaryJobUuid,\n fixedCompensationTypes = [],\n excludedTypes = [],\n}: {\n flsaStatus: string | undefined\n existingFixedCompensations?: FixedCompensations[]\n primaryJobUuid?: string\n fixedCompensationTypes?: PayrollFixedCompensationTypesType[]\n excludedTypes?: string[]\n}): FixedCompensations[] => {\n const allFixedCompensations = [...existingFixedCompensations]\n\n if (flsaStatus !== FlsaStatus.OWNER && primaryJobUuid && fixedCompensationTypes.length > 0) {\n const compensationTypeNames = fixedCompensationTypes\n .map(type => type.name)\n .filter(Boolean) as string[]\n\n compensationTypeNames.forEach(compensationName => {\n const exists = allFixedCompensations.some(\n comp => comp.name?.toLowerCase() === compensationName.toLowerCase(),\n )\n\n if (!exists) {\n allFixedCompensations.push({\n name: compensationName,\n amount: '0.00',\n jobUuid: primaryJobUuid,\n })\n }\n })\n }\n\n // Filter and sort additional earnings (exclude specified types)\n return allFixedCompensations\n .filter(comp => comp.name && !excludedTypes.includes(comp.name))\n .sort((a, b) => (a.name || '').localeCompare(b.name || ''))\n}\n\n/**\n * Returns whether any non-excluded employee compensation uses Direct Deposit.\n *\n * @remarks\n * When the input is empty or every compensation is excluded, returns `true` so callers don't gate UI on an\n * empty set.\n *\n * @param employeeCompensations - The employee compensations to inspect.\n * @returns `true` when at least one active compensation pays via Direct Deposit, or when the list is empty.\n * @internal\n */\nexport const hasDirectDepositEmployees = (\n employeeCompensations?: Array<{ paymentMethod?: string | null; excluded?: boolean }>,\n): boolean => {\n if (!employeeCompensations || employeeCompensations.length === 0) return true\n const activeCompensations = employeeCompensations.filter(comp => !comp.excluded)\n if (activeCompensations.length === 0) return true\n return activeCompensations.some(comp => comp.paymentMethod === 'Direct Deposit')\n}\n\n/**\n * Sums gross pay, employer taxes, reimbursements, and benefits from a payroll's totals.\n *\n * @param payrollData - The payroll whose totals to sum.\n * @returns The total payroll cost, or `0` when `payrollData.totals` is missing.\n * @internal\n */\nexport const calculateTotalPayroll = (payrollData: Payroll) => {\n const totalPayroll = payrollData.totals\n ? Number(payrollData.totals.grossPay ?? 0) +\n Number(payrollData.totals.employerTaxes ?? 0) +\n Number(payrollData.totals.reimbursements ?? 0) +\n Number(payrollData.totals.benefits ?? 0)\n : 0\n\n return totalPayroll\n}\n\n/**\n * Converts a Date to Pacific Time considering Daylight Saving Time.\n * Returns the UTC offset in hours (e.g., -7 for PDT, -8 for PST).\n *\n * DST rules for Pacific Time:\n * - Starts: Second Sunday in March at 2:00 AM\n * - Ends: First Sunday in November at 2:00 AM\n */\nconst getPacificTimeOffset = (date: Date): number => {\n const year = date.getFullYear()\n\n const secondSundayMarch = new Date(year, 2, 1)\n secondSundayMarch.setDate(1 + (7 - secondSundayMarch.getDay()) + 7)\n\n const firstSundayNovember = new Date(year, 10, 1)\n firstSundayNovember.setDate(1 + ((7 - firstSundayNovember.getDay()) % 7))\n\n const isDST = date >= secondSundayMarch && date < firstSundayNovember\n return isDST ? -7 : -8\n}\n\n/**\n * Determines whether a payroll can be cancelled based on its status, deadline, and the 4:00 PM PT cutoff.\n *\n * @remarks\n * Returns `true` only when the payroll has been processed, `payrollStatusMeta.cancellable` is not explicitly `false`,\n * the payroll has a `payrollDeadline`, and the current time is before 4:00 PM Pacific Time on that deadline date.\n *\n * @param payroll - The payroll to evaluate.\n * @returns `true` if the payroll is still cancellable, `false` otherwise.\n * @internal\n */\nexport const canCancelPayroll = (payroll: Payroll): boolean => {\n if (payroll.payrollStatusMeta?.cancellable === false) {\n return false\n }\n\n if (!payroll.processed) {\n return false\n }\n\n if (!payroll.payrollDeadline) {\n return false\n }\n\n const now = new Date()\n const deadline = new Date(payroll.payrollDeadline)\n\n const nowInPT = new Date(now.getTime() + getPacificTimeOffset(now) * MS_PER_HOUR)\n const deadlineInPT = new Date(deadline.getTime() + getPacificTimeOffset(deadline) * MS_PER_HOUR)\n\n const cutoffTime = new Date(deadlineInPT)\n cutoffTime.setUTCHours(16, 0, 0, 0)\n\n if (nowInPT >= cutoffTime) {\n return false\n }\n\n return true\n}\n"],"names":["REGULAR_HOURS_NAME","getPrimaryJob","employee","job","roundToSixDecimals","value","roundToTwoDecimals","isRegularHours","compensationName","PAY_PERIOD_HOURS_MAPPINGS","formatEmployeePayRate","locale","primaryJob","jobCompensation","rate","paymentUnit","formatPayRate","useFormatEmployeePayRate","t","useTranslation","useLocale","useCallback","getRegularHours","compensation","hourlyCompensation","sum","getOvertimeHours","getTotalPtoHours","pto","getAdditionalEarnings","fixedCompensation","name","amount","getReimbursements","reimbursement","reimbursementComp","cleanupReimbursements","reimbursements","consolidated","unnamedTotal","numericAmount","description","uuid","formatHoursDisplay","hours","rounded","getHoursInPayPeriod","paySchedule","getEffectiveCompensation","compensations","effectiveDate","sorted","a","b","i","currentDateString","currentDate","getEffectiveMinimumWage","minimumWages","isSalaried","getTotalTipCompensations","fixedCompensations","calculateHourlyRate","getHourlyRateForJob","jobUuid","j","getPrimaryHourlyRate","getTotalOutstandingPtoHours","paidTimeOff","getPtoHours","isSalariedWithExpectedHours","hoursInPayPeriod","offCycle","regularPtoHours","outstandingPtoHours","calculateMinimumWageAdjustment","primaryCompensation","effectiveMinWage","totalHours","hourlyRate","totalTipCredit","totalTips","calculateRegularPlusOvertimePay","ptoHours","isOffCycle","regularRatePay","hc","overtimeWeightedRate","overtimePay","multiplier","calculatePtoPay","primaryHourlyRate","isSalariedWithPayPeriodExpectedHours","regularHourlyCompensation","calculateGrossPay","compensationEffectiveDateString","payrollCategory","PayrollCategory","compensationEffectiveDate","salaried","isOffCyclePayroll","regularPlusOvertimePay","fixedPay","ptoPay","minimumWageAdjustment","total","isDismissalPayroll","offCycleReason","OffCycleReasonType","OFF_CYCLE_REASON_LABELS","getPayrollTypeLabel","payroll","getAdditionalEarningsCompensations","flsaStatus","existingFixedCompensations","primaryJobUuid","fixedCompensationTypes","excludedTypes","allFixedCompensations","FlsaStatus","type","comp","hasDirectDepositEmployees","employeeCompensations","activeCompensations","calculateTotalPayroll","payrollData","getPacificTimeOffset","date","year","secondSundayMarch","firstSundayNovember","canCancelPayroll","now","deadline","nowInPT","MS_PER_HOUR","deadlineInPT","cutoffTime"],"mappings":";;;;;;;;AA2BA,MAAMA,IAAqB,iBAGrBC,IAAgB,CAACC,MACdA,EAAS,MAAM,KAAK,CAAAC,MAAOA,EAAI,OAAO,KAAKD,EAAS,OAAO,CAAC,KAAK,MAGpEE,IAAqB,CAACC,MACnB,KAAK,MAAMA,IAAQ,GAAS,IAAI,KAGnCC,IAAqB,CAACD,MACnB,KAAK,MAAMA,IAAQ,GAAG,IAAI,KAG7BE,IAAiB,CAACC,MACfA,EAAiB,kBAAkBR,GAGtCS,IAAoD;AAAA,EACxD,OAAO;AAAA,EACP,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,SAAS;AAAA,EACT,WAAW;AAAA,EACX,cAAc;AAAA,EACd,UAAU;AACZ,GAaaC,IAAwB,CAAC;AAAA,EACpC,UAAAR;AAAA,EACA;AAAA,EACA,QAAAS,IAAS;AACX,MAIM;AACJ,MAAI,CAACT,GAAU;AACb,WAAO;AAGT,QAAMU,IAAaX,EAAcC,CAAQ;AACzC,MAAI,CAACU,GAAY;AACf,WAAO;AAGT,QAAMC,IAAkBD,EAAW,cAAc,CAAC;AAIlD,MAHI,CAACC,KAGD,CAACA,EAAgB,QAAQ,WAAWA,EAAgB,IAAI,MAAM;AAChE,WAAO;AAGT,QAAMC,IAAO,WAAWD,EAAgB,IAAI,GACtCE,IAAcF,EAAgB,eAAe;AAEnD,SAAOG,EAAc,EAAE,MAAAF,GAAM,aAAAC,GAAa,GAAG,QAAAJ,GAAQ;AACvD,GASaM,KAA2B,MAAM;AAC5C,QAAM,EAAE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aAIT,CAACA,EAAQ;AACX,WAAO;AAGT,QAAMsB,wBAAU,KAAA,GACVC,IAAW,IAAI,KAAKvB,EAAQ,eAAe,GAE3CwB,IAAU,IAAI,KAAKF,EAAI,YAAYN,EAAqBM,CAAG,IAAIG,CAAW,GAC1EC,IAAe,IAAI,KAAKH,EAAS,YAAYP,EAAqBO,CAAQ,IAAIE,CAAW,GAEzFE,IAAa,IAAI,KAAKD,CAAY;AAGxC,SAFAC,EAAW,YAAY,IAAI,GAAG,GAAG,CAAC,GAE9B,EAAAH,KAAWG;AAKjB;"}
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":["../../../src/components/Payroll/helpers.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api-v-2026-02-01/models/components/employee'\nimport {\n type PayrollShowFixedCompensations,\n OffCycleReasonType,\n} from '@gusto/embedded-api-v-2026-02-01/models/components/payroll'\nimport type {\n PayrollEmployeeCompensationsTypeFixedCompensations as FixedCompensations,\n PayrollEmployeeCompensationsTypeReimbursements as Reimbursement,\n} from '@gusto/embedded-api-v-2026-02-01/models/components/payrollemployeecompensationstype'\nimport type { PayrollUpdateReimbursements } from '@gusto/embedded-api-v-2026-02-01/models/components/payrollupdate'\nimport type { PayrollFixedCompensationTypesType } from '@gusto/embedded-api-v-2026-02-01/models/components/payrollfixedcompensationtypestype'\nimport { useCallback } from 'react'\nimport type { TFunction } from 'i18next'\nimport { useTranslation } from 'react-i18next'\nimport type { PayScheduleShow as PayScheduleObject } from '@gusto/embedded-api-v-2026-02-01/models/components/payscheduleshow'\nimport type {\n Compensation,\n MinimumWages,\n} from '@gusto/embedded-api-v-2026-02-01/models/components/compensation'\nimport type { PayrollEmployeeCompensationsType } from '@gusto/embedded-api-v-2026-02-01/models/components/payrollemployeecompensationstype'\nimport type { Payroll } from '@gusto/embedded-api-v-2026-02-01/models/components/payroll'\nimport type { PayrollType } from './PayrollList/types'\nimport { PayrollCategory, isOffCyclePayroll } from './payrollTypes'\nimport { formatPayRate } from '@/helpers/formattedStrings'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { FlsaStatus } from '@/shared/constants'\nimport { MS_PER_HOUR } from '@/helpers/dateFormatting'\nconst REGULAR_HOURS_NAME = 'regular hours'\n\n// Utility to get the primary job from an employee\nconst getPrimaryJob = (employee: Employee) => {\n return employee.jobs?.find(job => job.primary) || employee.jobs?.[0] || null\n}\n\nconst roundToSixDecimals = (value: number): number => {\n return Math.round(value * 1_000_000) / 1_000_000\n}\n\nconst roundToTwoDecimals = (value: number): number => {\n return Math.round(value * 100) / 100\n}\n\nconst isRegularHours = (compensationName: string): boolean => {\n return compensationName.toLowerCase() === REGULAR_HOURS_NAME\n}\n\nconst PAY_PERIOD_HOURS_MAPPINGS: Record<string, number> = {\n Daily: 8.0,\n 'Every week': 40.0,\n 'Every other week': 80.0,\n 'Twice per month': 86.666667,\n Monthly: 173.333333,\n Quarterly: 520.0,\n Semiannually: 1040.0,\n Annually: 2080.0,\n}\n\n/**\n * Formats an employee's primary-job pay rate into a localized display string.\n *\n * @remarks\n * Returns `null` when the employee has no jobs, the primary job has no compensations, or the rate is missing\n * or zero.\n *\n * @param args - The employee, translation function, and locale to format against.\n * @returns The formatted pay-rate string, or `null` when no usable rate is available.\n * @internal\n */\nexport const formatEmployeePayRate = ({\n employee,\n t,\n locale = 'en-US',\n}: {\n employee?: Employee\n t: TFunction\n locale?: string\n}) => {\n if (!employee?.jobs) {\n return null\n }\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return null\n }\n\n const jobCompensation = primaryJob.compensations[0]\n if (!jobCompensation) {\n return null\n }\n if (!jobCompensation.rate || parseFloat(jobCompensation.rate) === 0) {\n return null\n }\n\n const rate = parseFloat(jobCompensation.rate)\n const paymentUnit = jobCompensation.paymentUnit || 'Hour'\n\n return formatPayRate({ rate, paymentUnit, t, locale })\n}\n\n/**\n * Returns a memoized formatter that produces a localized pay-rate string from an employee's primary job.\n *\n * @returns A callback that takes an `Employee` and returns the formatted pay-rate string, or `null` when the\n * employee has no usable primary-job compensation.\n * @internal\n */\nexport const useFormatEmployeePayRate = () => {\n const { t } = useTranslation('common')\n const { locale } = useLocale()\n\n return useCallback(\n (employee?: Employee) => {\n return formatEmployeePayRate({ employee, t, locale })\n },\n [t, locale],\n )\n}\n\n/**\n * Sums hourly-compensation rows named `'regular hours'`.\n *\n * @param compensation - The employee compensation entry.\n * @returns The total regular hours worked, or `0` when none are recorded.\n * @internal\n */\nexport const getRegularHours = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.hourlyCompensations) return 0\n\n return compensation.hourlyCompensations\n .filter(hourlyCompensation => hourlyCompensation.name?.toLowerCase() === 'regular hours')\n .reduce((sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'), 0)\n}\n\n/**\n * Sums the overtime hours (multiplier greater than `1`) from an employee compensation.\n *\n * @param compensation - The employee compensation entry.\n * @returns The total overtime hours, or `0` when the compensation is excluded or has none.\n * @internal\n */\nexport function getOvertimeHours(compensation: PayrollEmployeeCompensationsType) {\n if (!compensation.hourlyCompensations || compensation.excluded) {\n return 0\n }\n\n return compensation.hourlyCompensations\n .filter(hourlyCompensation => Number(hourlyCompensation.compensationMultiplier) > 1)\n .reduce((sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'), 0)\n}\n\n/**\n * Sums the paid-time-off hours from an employee compensation.\n *\n * @param compensation - The employee compensation entry.\n * @returns The total PTO hours, or `0` when none are recorded.\n * @internal\n */\nexport const getTotalPtoHours = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.paidTimeOff) {\n return 0\n }\n return compensation.paidTimeOff.reduce((sum, pto) => sum + parseFloat(pto.hours || '0'), 0)\n}\n\n/**\n * Sums fixed-compensation amounts excluding reimbursements and minimum-wage adjustments.\n *\n * @param compensation - The employee compensation entry.\n * @returns The total additional earnings amount, or `0` when none qualify.\n * @internal\n */\nexport const getAdditionalEarnings = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.fixedCompensations) {\n return 0\n }\n\n return compensation.fixedCompensations\n .filter(fixedCompensation => {\n const name = fixedCompensation.name?.toLowerCase() || ''\n const amount = parseFloat(fixedCompensation.amount || '0')\n return name !== 'reimbursement' && name !== 'minimum wage adjustment' && amount > 0\n })\n .reduce((sum, fixedCompensation) => sum + parseFloat(fixedCompensation.amount || '0'), 0)\n}\n\n/**\n * Returns the total reimbursement amount for an employee compensation.\n *\n * @remarks\n * Prefers the explicit `reimbursements` array when present; falls back to a fixed-compensation row named\n * `'Reimbursement'` for older payroll shapes.\n *\n * @param compensation - The employee compensation entry.\n * @returns The summed reimbursement amount, or `0` when none.\n * @internal\n */\nexport const getReimbursements = (compensation: PayrollEmployeeCompensationsType) => {\n if (compensation.reimbursements && compensation.reimbursements.length > 0) {\n return compensation.reimbursements.reduce(\n (sum, reimbursement) => sum + parseFloat(reimbursement.amount || '0'),\n 0,\n )\n }\n\n if (!compensation.fixedCompensations) {\n return 0\n }\n\n const reimbursementComp = compensation.fixedCompensations.find(\n fixedCompensation => fixedCompensation.name?.toLowerCase() === 'reimbursement',\n )\n return reimbursementComp ? parseFloat(reimbursementComp.amount || '0') : 0\n}\n\n/**\n * Normalizes a reimbursement list for submission to the v2025-11-15 API.\n *\n * @remarks\n * - Drops named rows that would be no-ops on the server (zero amount with no existing uuid).\n * - Drops named rows with an existing uuid and zero amount — these are removals, and the backend's\n * `replace_itemized_reimbursements` deletes any persisted reimbursement whose uuid is omitted from the\n * incoming list.\n * - Consolidates multiple unnamed (description-less) rows into a single unnamed entry, since the API rejects\n * more than one unnamed reimbursement per employee.\n * - When the consolidated unnamed total is zero, sends no unnamed entry at all. The backend's full-replace\n * semantics then delete any persisted unnamed entry (unnamed entries never have uuids, so this is the only\n * way to remove them).\n * - Maps the read shape (`description: string | null`) to the write shape (`description?: string`), omitting\n * the field when there is no description.\n *\n * @param reimbursements - The reimbursements pulled from the prepared payroll.\n * @returns The normalized reimbursements ready to send on a payroll update.\n * @internal\n */\nexport const cleanupReimbursements = (\n reimbursements: Reimbursement[],\n): PayrollUpdateReimbursements[] => {\n const consolidated: PayrollUpdateReimbursements[] = []\n let unnamedTotal = 0\n\n reimbursements.forEach(reimbursement => {\n const amount = reimbursement.amount\n const numericAmount = parseFloat(amount || '0')\n const description = reimbursement.description?.trim() || ''\n const uuid = reimbursement.uuid ?? undefined\n\n if (description === '') {\n unnamedTotal += numericAmount\n return\n }\n\n if (numericAmount === 0 && !uuid) {\n return\n }\n\n consolidated.push({\n amount,\n description,\n ...(uuid ? { uuid } : {}),\n })\n })\n\n if (unnamedTotal > 0) {\n consolidated.push({\n amount: unnamedTotal.toFixed(2),\n })\n }\n\n return consolidated\n}\n\n/**\n * Formats an hours value for display, rounding to two decimals and ensuring whole numbers render with `.0`.\n *\n * @param hours - The hours value to format.\n * @returns A string like `'40.0'` or `'37.25'`.\n * @internal\n */\nexport const formatHoursDisplay = (hours: number): string => {\n const rounded = roundToTwoDecimals(hours)\n\n if (rounded % 1 === 0) {\n return `${rounded}.0`\n }\n\n return rounded.toString()\n}\n\nconst getHoursInPayPeriod = (paySchedule: PayScheduleObject): number => {\n if (!paySchedule.frequency) {\n return 0\n }\n\n return PAY_PERIOD_HOURS_MAPPINGS[paySchedule.frequency] || 0\n}\n\nconst getEffectiveCompensation = (\n compensations: Compensation[],\n effectiveDate: Date,\n): Compensation | null => {\n if (!compensations.length) return null\n\n const sorted = [...compensations].sort(\n (a, b) =>\n (a.effectiveDate ? new Date(a.effectiveDate).getTime() : 0) -\n (b.effectiveDate ? new Date(b.effectiveDate).getTime() : 0),\n )\n\n for (let i = sorted.length - 1; i >= 0; i--) {\n const currentDateString = sorted[i]?.effectiveDate\n const currentDate = currentDateString ? new Date(currentDateString) : null\n if (currentDate && currentDate <= effectiveDate) {\n return sorted[i] || null\n }\n }\n\n return sorted[0] || null\n}\n\nconst getEffectiveMinimumWage = (\n minimumWages: MinimumWages[],\n effectiveDate: Date,\n): MinimumWages | null => {\n if (!minimumWages.length) return null\n\n const sorted = [...minimumWages].sort(\n (a, b) =>\n (a.effectiveDate ? new Date(a.effectiveDate).getTime() : 0) -\n (b.effectiveDate ? new Date(b.effectiveDate).getTime() : 0),\n )\n\n for (let i = sorted.length - 1; i >= 0; i--) {\n const currentDateString = sorted[i]?.effectiveDate\n const currentDate = currentDateString ? new Date(currentDateString) : null\n if (currentDate && currentDate <= effectiveDate) {\n return sorted[i] || null\n }\n }\n\n return sorted[0] || null\n}\n\nconst isSalaried = (compensation: Compensation): boolean => {\n return compensation.flsaStatus === 'Exempt' || compensation.flsaStatus === 'Salaried Nonexempt'\n}\n\nconst getTotalTipCompensations = (fixedCompensations: PayrollShowFixedCompensations[]): number => {\n if (!fixedCompensations.length) return 0\n\n return fixedCompensations\n .filter(fixedCompensation => {\n const name = fixedCompensation.name?.toLowerCase()\n const amount = parseFloat(fixedCompensation.amount || '0')\n return (name === 'paycheck tips' || name === 'cash tips') && amount > 0\n })\n .reduce((sum, fixedCompensation) => sum + parseFloat(fixedCompensation.amount || '0'), 0)\n}\n\nconst calculateHourlyRate = (compensation: Compensation): number => {\n const rate = parseFloat(compensation.rate || '0')\n const paymentUnit = compensation.paymentUnit || 'Hour'\n\n switch (paymentUnit) {\n case 'Hour':\n return rate\n case 'Year':\n return rate / 2080 // 52 weeks * 40 hours\n case 'Month':\n return rate / 173.333333\n case 'Week':\n return rate / 40\n case 'Paycheck':\n return 0 // Paycheck rate is 0 for hourly calculation\n default:\n return rate\n }\n}\n\nconst getHourlyRateForJob = (employee: Employee, jobUuid: string, effectiveDate: Date): number => {\n const job = employee.jobs?.find(j => j.uuid === jobUuid)\n if (!job?.compensations) {\n return 0\n }\n\n const compensation = getEffectiveCompensation(job.compensations, effectiveDate)\n return compensation ? calculateHourlyRate(compensation) : 0\n}\n\nconst getPrimaryHourlyRate = (employee: Employee, effectiveDate: Date): number => {\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return 0\n }\n\n const compensation = getEffectiveCompensation(primaryJob.compensations, effectiveDate)\n return compensation ? calculateHourlyRate(compensation) : 0\n}\n\nconst getTotalOutstandingPtoHours = (compensation: PayrollEmployeeCompensationsType): number => {\n if (!compensation.paidTimeOff) {\n return 0\n }\n\n return compensation.paidTimeOff.reduce(\n (sum, paidTimeOff) => sum + parseFloat(paidTimeOff.finalPayoutUnusedHoursInput || '0'),\n 0,\n )\n}\n\nconst getPtoHours = (\n compensation: PayrollEmployeeCompensationsType,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n offCycle: boolean,\n): number => {\n const regularPtoHours = getTotalPtoHours(compensation)\n\n if (offCycle) {\n const outstandingPtoHours = getTotalOutstandingPtoHours(compensation)\n return regularPtoHours + outstandingPtoHours\n }\n\n if (isSalariedWithExpectedHours) {\n return Math.min(hoursInPayPeriod, regularPtoHours)\n }\n\n return regularPtoHours\n}\n\nconst calculateMinimumWageAdjustment = (\n primaryCompensation: Compensation,\n compensation: PayrollEmployeeCompensationsType,\n effectiveDate: Date,\n): number => {\n if (!primaryCompensation.adjustForMinimumWage) return 0\n\n const effectiveMinWage = getEffectiveMinimumWage(\n primaryCompensation.minimumWages || [],\n effectiveDate,\n )\n if (!effectiveMinWage) {\n return 0\n }\n\n const totalHours =\n compensation.hourlyCompensations?.reduce(\n (sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'),\n 0,\n ) || 0\n\n const hourlyRate = calculateHourlyRate(primaryCompensation)\n\n const totalTipCredit = (parseFloat(effectiveMinWage.wage || '0') - hourlyRate) * totalHours\n const totalTips = getTotalTipCompensations(compensation.fixedCompensations || [])\n\n return Math.max(0, totalTipCredit - totalTips)\n}\n\nconst calculateRegularPlusOvertimePay = (\n compensation: PayrollEmployeeCompensationsType,\n employee: Employee,\n effectiveDate: Date,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n ptoHours: number,\n isOffCycle: boolean,\n): number => {\n if (!isOffCycle && isSalariedWithExpectedHours) {\n const primaryHourlyRate = getPrimaryHourlyRate(employee, effectiveDate)\n return primaryHourlyRate * (hoursInPayPeriod - ptoHours)\n }\n\n if (!compensation.hourlyCompensations || !employee.jobs) {\n return 0\n }\n\n const regularRatePay = compensation.hourlyCompensations.reduce((sum, hc) => {\n const hours = parseFloat(hc.hours || '0')\n const hourlyRate = getHourlyRateForJob(employee, hc.jobUuid || '', effectiveDate)\n return sum + hours * hourlyRate\n }, 0)\n\n const totalHours = compensation.hourlyCompensations.reduce((sum, hc) => {\n return sum + parseFloat(hc.hours || '0')\n }, 0)\n\n if (totalHours === 0) return regularRatePay\n\n const overtimeWeightedRate = roundToSixDecimals(regularRatePay / totalHours)\n\n // Calculate overtime pay for non-regular hours\n const overtimePay = compensation.hourlyCompensations\n .filter(hc => !isRegularHours(hc.name || ''))\n .reduce((sum, hc) => {\n const hours = parseFloat(hc.hours || '0')\n const multiplier = hc.compensationMultiplier || 1\n return sum + hours * overtimeWeightedRate * (multiplier - 1)\n }, 0)\n\n return regularRatePay + overtimePay\n}\n\nconst calculatePtoPay = (\n compensation: PayrollEmployeeCompensationsType,\n employee: Employee,\n effectiveDate: Date,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n offCycle: boolean,\n): number => {\n const ptoHours = getPtoHours(\n compensation,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n offCycle,\n )\n const primaryHourlyRate = getPrimaryHourlyRate(employee, effectiveDate)\n return ptoHours * primaryHourlyRate\n}\n\nconst isSalariedWithPayPeriodExpectedHours = (\n compensation: PayrollEmployeeCompensationsType,\n isSalaried: boolean,\n hoursInPayPeriod: number,\n): boolean => {\n if (!isSalaried) return false\n\n const regularHourlyCompensation = compensation.hourlyCompensations?.find(hourlyCompensation =>\n isRegularHours(hourlyCompensation.name || ''),\n )\n\n if (!regularHourlyCompensation) return false\n\n const regularHours = parseFloat(regularHourlyCompensation.hours || '0')\n return regularHours === hoursInPayPeriod\n}\n\n/**\n * Calculates an employee's gross pay for a payroll, combining regular and overtime pay,\n * additional earnings, PTO pay, and any minimum-wage adjustment.\n *\n * @remarks\n * Returns `0` when the compensation is excluded or the employee has no primary job compensation effective\n * on the given date. The result is rounded to two decimal places.\n *\n * @param compensation - The employee compensation entry from the payroll.\n * @param employee - The employee record (used to look up jobs and effective compensations).\n * @param compensationEffectiveDateString - ISO date used to resolve the effective compensation; defaults to now.\n * @param paySchedule - The pay schedule, used to derive expected hours per pay period.\n * @param payrollCategory - The payroll category; off-cycle categories change how PTO hours are summed.\n * @returns The gross pay amount.\n * @internal\n */\nexport const calculateGrossPay = (\n compensation: PayrollEmployeeCompensationsType,\n employee: Employee,\n compensationEffectiveDateString?: string,\n paySchedule?: PayScheduleObject,\n payrollCategory: PayrollCategory = PayrollCategory.Regular,\n): number => {\n if (compensation.excluded) {\n return 0\n }\n\n const compensationEffectiveDate = compensationEffectiveDateString\n ? new Date(compensationEffectiveDateString)\n : new Date()\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return 0\n }\n\n const primaryCompensation = getEffectiveCompensation(\n primaryJob.compensations,\n compensationEffectiveDate,\n )\n\n if (!primaryCompensation) {\n return 0\n }\n\n const salaried = isSalaried(primaryCompensation)\n const hoursInPayPeriod = paySchedule ? getHoursInPayPeriod(paySchedule) : 0\n\n const isSalariedWithExpectedHours = isSalariedWithPayPeriodExpectedHours(\n compensation,\n salaried,\n hoursInPayPeriod,\n )\n\n const offCycle = isOffCyclePayroll(payrollCategory)\n\n const ptoHours = getPtoHours(\n compensation,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n offCycle,\n )\n\n const regularPlusOvertimePay = calculateRegularPlusOvertimePay(\n compensation,\n employee,\n compensationEffectiveDate,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n ptoHours,\n offCycle,\n )\n\n const fixedPay = getAdditionalEarnings(compensation)\n const ptoPay = calculatePtoPay(\n compensation,\n employee,\n compensationEffectiveDate,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n offCycle,\n )\n const minimumWageAdjustment = calculateMinimumWageAdjustment(\n primaryCompensation,\n compensation,\n compensationEffectiveDate,\n )\n\n const total = regularPlusOvertimePay + fixedPay + ptoPay + minimumWageAdjustment\n return roundToTwoDecimals(total)\n}\n\n/**\n * Returns the high-level payroll type — `'External'`, `'Off-Cycle'`, or `'Regular'`.\n *\n * @param payroll - The payroll whose type to classify.\n * @returns The payroll type string.\n * @internal\n */\nexport const getPayrollType = (payroll: {\n external?: boolean\n offCycle?: boolean\n}): PayrollType => {\n if (payroll.external) return 'External'\n if (payroll.offCycle) return 'Off-Cycle'\n return 'Regular'\n}\n\n/**\n * Returns whether an off-cycle reason indicates a dismissal payroll.\n *\n * @param offCycleReason - The payroll's off-cycle reason string.\n * @returns `true` when the reason matches the dismissed-employee reason.\n * @internal\n */\nexport const isDismissalPayroll = (offCycleReason?: string | null): boolean =>\n offCycleReason === OffCycleReasonType.DismissedEmployee\n\nconst OFF_CYCLE_REASON_LABELS: Record<string, string> = {\n Bonus: 'Bonus',\n Correction: 'Correction',\n 'Transition from old pay schedule': 'Transition',\n 'Dismissed employee': 'Dismissal',\n 'Hired employee': 'New Hire',\n 'Benefit reversal': 'Benefit Reversal',\n 'Wage correction': 'Wage Correction',\n 'Tax reconciliation': 'Tax Reconciliation',\n Reversal: 'Reversal',\n 'Disability insurance distribution': 'Disability Insurance',\n}\n\n/**\n * Returns a human-readable label describing the payroll type, mapping off-cycle reasons to display strings.\n *\n * @param payroll - The payroll whose type to describe.\n * @returns `'External'`, `'Regular'`, `'Off-Cycle'`, or a label derived from the off-cycle reason\n * (e.g. `'Bonus'`, `'Dismissal'`).\n * @internal\n */\nexport const getPayrollTypeLabel = (payroll: {\n external?: boolean\n offCycle?: boolean\n offCycleReason?: string | null\n}): string => {\n if (payroll.external) return 'External'\n if (payroll.offCycle && payroll.offCycleReason) {\n return OFF_CYCLE_REASON_LABELS[payroll.offCycleReason] ?? payroll.offCycleReason\n }\n if (payroll.offCycle) return 'Off-Cycle'\n return 'Regular'\n}\n\n/**\n * Merges existing fixed compensations with placeholder entries for any compensation types the employee\n * doesn't yet have, then filters out excluded types and sorts the result alphabetically.\n *\n * @remarks\n * Owners (FLSA status `Owner`) never receive placeholder entries. Placeholders are added with `amount: '0.00'`\n * and the supplied `primaryJobUuid`.\n *\n * @param options - Inputs controlling which placeholder entries to add and which types to exclude.\n * @returns The merged, filtered, and sorted list of fixed compensations.\n * @internal\n */\nexport const getAdditionalEarningsCompensations = ({\n flsaStatus,\n existingFixedCompensations = [],\n primaryJobUuid,\n fixedCompensationTypes = [],\n excludedTypes = [],\n}: {\n flsaStatus: string | undefined\n existingFixedCompensations?: FixedCompensations[]\n primaryJobUuid?: string\n fixedCompensationTypes?: PayrollFixedCompensationTypesType[]\n excludedTypes?: string[]\n}): FixedCompensations[] => {\n const allFixedCompensations = [...existingFixedCompensations]\n\n if (flsaStatus !== FlsaStatus.OWNER && primaryJobUuid && fixedCompensationTypes.length > 0) {\n const compensationTypeNames = fixedCompensationTypes\n .map(type => type.name)\n .filter(Boolean) as string[]\n\n compensationTypeNames.forEach(compensationName => {\n const exists = allFixedCompensations.some(\n comp => comp.name?.toLowerCase() === compensationName.toLowerCase(),\n )\n\n if (!exists) {\n allFixedCompensations.push({\n name: compensationName,\n amount: '0.00',\n jobUuid: primaryJobUuid,\n })\n }\n })\n }\n\n // Filter and sort additional earnings (exclude specified types)\n return allFixedCompensations\n .filter(comp => comp.name && !excludedTypes.includes(comp.name))\n .sort((a, b) => (a.name || '').localeCompare(b.name || ''))\n}\n\n/**\n * Returns whether any non-excluded employee compensation uses Direct Deposit.\n *\n * @remarks\n * When the input is empty or every compensation is excluded, returns `true` so callers don't gate UI on an\n * empty set.\n *\n * @param employeeCompensations - The employee compensations to inspect.\n * @returns `true` when at least one active compensation pays via Direct Deposit, or when the list is empty.\n * @internal\n */\nexport const hasDirectDepositEmployees = (\n employeeCompensations?: Array<{ paymentMethod?: string | null; excluded?: boolean }>,\n): boolean => {\n if (!employeeCompensations || employeeCompensations.length === 0) return true\n const activeCompensations = employeeCompensations.filter(comp => !comp.excluded)\n if (activeCompensations.length === 0) return true\n return activeCompensations.some(comp => comp.paymentMethod === 'Direct Deposit')\n}\n\n/**\n * Sums gross pay, employer taxes, reimbursements, and benefits from a payroll's totals.\n *\n * @param payrollData - The payroll whose totals to sum.\n * @returns The total payroll cost, or `0` when `payrollData.totals` is missing.\n * @internal\n */\nexport const calculateTotalPayroll = (payrollData: Payroll) => {\n const totalPayroll = payrollData.totals\n ? Number(payrollData.totals.grossPay ?? 0) +\n Number(payrollData.totals.employerTaxes ?? 0) +\n Number(payrollData.totals.reimbursements ?? 0) +\n Number(payrollData.totals.benefits ?? 0)\n : 0\n\n return totalPayroll\n}\n\n/**\n * Converts a Date to Pacific Time considering Daylight Saving Time.\n * Returns the UTC offset in hours (e.g., -7 for PDT, -8 for PST).\n *\n * DST rules for Pacific Time:\n * - Starts: Second Sunday in March at 2:00 AM\n * - Ends: First Sunday in November at 2:00 AM\n */\nconst getPacificTimeOffset = (date: Date): number => {\n const year = date.getFullYear()\n\n const secondSundayMarch = new Date(year, 2, 1)\n secondSundayMarch.setDate(1 + (7 - secondSundayMarch.getDay()) + 7)\n\n const firstSundayNovember = new Date(year, 10, 1)\n firstSundayNovember.setDate(1 + ((7 - firstSundayNovember.getDay()) % 7))\n\n const isDST = date >= secondSundayMarch && date < firstSundayNovember\n return isDST ? -7 : -8\n}\n\n/**\n * Determines whether a payroll can be cancelled based on its status, deadline, and the 4:00 PM PT cutoff.\n *\n * @remarks\n * Returns `true` only when the payroll has been processed, `payrollStatusMeta.cancellable` is not explicitly `false`,\n * the payroll has a `payrollDeadline`, and the current time is before 4:00 PM Pacific Time on that deadline date.\n *\n * @param payroll - The payroll to evaluate.\n * @returns `true` if the payroll is still cancellable, `false` otherwise.\n * @internal\n */\nexport const canCancelPayroll = (payroll: Payroll): boolean => {\n if (payroll.payrollStatusMeta?.cancellable === false) {\n return false\n }\n\n if (!payroll.processed) {\n return false\n }\n\n if (!payroll.payrollDeadline) {\n return false\n }\n\n const now = new Date()\n const deadline = new Date(payroll.payrollDeadline)\n\n const nowInPT = new Date(now.getTime() + getPacificTimeOffset(now) * MS_PER_HOUR)\n const deadlineInPT = new Date(deadline.getTime() + getPacificTimeOffset(deadline) * MS_PER_HOUR)\n\n const cutoffTime = new Date(deadlineInPT)\n cutoffTime.setUTCHours(16, 0, 0, 0)\n\n if (nowInPT >= cutoffTime) {\n return false\n }\n\n return true\n}\n"],"names":["REGULAR_HOURS_NAME","getPrimaryJob","employee","job","roundToSixDecimals","value","roundToTwoDecimals","isRegularHours","compensationName","PAY_PERIOD_HOURS_MAPPINGS","formatEmployeePayRate","locale","primaryJob","jobCompensation","rate","paymentUnit","formatPayRate","useFormatEmployeePayRate","t","useTranslation","useLocale","useCallback","getRegularHours","compensation","hourlyCompensation","sum","getOvertimeHours","getTotalPtoHours","pto","getAdditionalEarnings","fixedCompensation","name","amount","getReimbursements","reimbursement","reimbursementComp","cleanupReimbursements","reimbursements","consolidated","unnamedTotal","numericAmount","description","uuid","formatHoursDisplay","hours","rounded","getHoursInPayPeriod","paySchedule","getEffectiveCompensation","compensations","effectiveDate","sorted","a","b","i","currentDateString","currentDate","getEffectiveMinimumWage","minimumWages","isSalaried","getTotalTipCompensations","fixedCompensations","calculateHourlyRate","getHourlyRateForJob","jobUuid","j","getPrimaryHourlyRate","getTotalOutstandingPtoHours","paidTimeOff","getPtoHours","isSalariedWithExpectedHours","hoursInPayPeriod","offCycle","regularPtoHours","outstandingPtoHours","calculateMinimumWageAdjustment","primaryCompensation","effectiveMinWage","totalHours","hourlyRate","totalTipCredit","totalTips","calculateRegularPlusOvertimePay","ptoHours","isOffCycle","regularRatePay","hc","overtimeWeightedRate","overtimePay","multiplier","calculatePtoPay","primaryHourlyRate","isSalariedWithPayPeriodExpectedHours","regularHourlyCompensation","calculateGrossPay","compensationEffectiveDateString","payrollCategory","PayrollCategory","compensationEffectiveDate","salaried","isOffCyclePayroll","regularPlusOvertimePay","fixedPay","ptoPay","minimumWageAdjustment","total","isDismissalPayroll","offCycleReason","OffCycleReasonType","OFF_CYCLE_REASON_LABELS","getPayrollTypeLabel","payroll","getAdditionalEarningsCompensations","flsaStatus","existingFixedCompensations","primaryJobUuid","fixedCompensationTypes","excludedTypes","allFixedCompensations","FlsaStatus","type","comp","hasDirectDepositEmployees","employeeCompensations","activeCompensations","calculateTotalPayroll","payrollData","getPacificTimeOffset","date","year","secondSundayMarch","firstSundayNovember","canCancelPayroll","now","deadline","nowInPT","MS_PER_HOUR","deadlineInPT","cutoffTime"],"mappings":";;;;;;;;AA2BA,MAAMA,IAAqB,iBAGrBC,IAAgB,CAACC,MACdA,EAAS,MAAM,KAAK,CAAAC,MAAOA,EAAI,OAAO,KAAKD,EAAS,OAAO,CAAC,KAAK,MAGpEE,IAAqB,CAACC,MACnB,KAAK,MAAMA,IAAQ,GAAS,IAAI,KAGnCC,IAAqB,CAACD,MACnB,KAAK,MAAMA,IAAQ,GAAG,IAAI,KAG7BE,IAAiB,CAACC,MACfA,EAAiB,kBAAkBR,GAGtCS,IAAoD;AAAA,EACxD,OAAO;AAAA,EACP,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,SAAS;AAAA,EACT,WAAW;AAAA,EACX,cAAc;AAAA,EACd,UAAU;AACZ,GAaaC,IAAwB,CAAC;AAAA,EACpC,UAAAR;AAAA,EACA;AAAA,EACA,QAAAS,IAAS;AACX,MAIM;AACJ,MAAI,CAACT,GAAU;AACb,WAAO;AAGT,QAAMU,IAAaX,EAAcC,CAAQ;AACzC,MAAI,CAACU,GAAY;AACf,WAAO;AAGT,QAAMC,IAAkBD,EAAW,cAAc,CAAC;AAIlD,MAHI,CAACC,KAGD,CAACA,EAAgB,QAAQ,WAAWA,EAAgB,IAAI,MAAM;AAChE,WAAO;AAGT,QAAMC,IAAO,WAAWD,EAAgB,IAAI,GACtCE,IAAcF,EAAgB,eAAe;AAEnD,SAAOG,EAA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,KAAK;AACtB,GAaaC,KAAmB,CAACrB,MAA8B;AAS7D,MARIA,EAAQ,mBAAmB,gBAAgB,MAI3C,CAACA,EAAQ,aAIT,CAACA,EAAQ;AACX,WAAO;AAGT,QAAMsB,wBAAU,KAAA,GACVC,IAAW,IAAI,KAAKvB,EAAQ,eAAe,GAE3CwB,IAAU,IAAI,KAAKF,EAAI,YAAYN,EAAqBM,CAAG,IAAIG,CAAW,GAC1EC,IAAe,IAAI,KAAKH,EAAS,YAAYP,EAAqBO,CAAQ,IAAIE,CAAW,GAEzFE,IAAa,IAAI,KAAKD,CAAY;AAGxC,SAFAC,EAAW,YAAY,IAAI,GAAG,GAAG,CAAC,GAE9B,EAAAH,KAAWG;AAKjB;"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import "./types/i18next.d.ts"
|
|
2
1
|
export { PayrollConfiguration } from './PayrollConfiguration/PayrollConfiguration';
|
|
3
2
|
export type { PayrollConfigurationProps } from './PayrollConfiguration/PayrollConfiguration';
|
|
4
3
|
export { PayrollEditEmployee } from './PayrollEditEmployee/PayrollEditEmployee';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payrollTypes.js","sources":["../../../src/components/Payroll/payrollTypes.ts"],"sourcesContent":["import { OffCycleReasonType } from '@gusto/embedded-api-v-
|
|
1
|
+
{"version":3,"file":"payrollTypes.js","sources":["../../../src/components/Payroll/payrollTypes.ts"],"sourcesContent":["import { OffCycleReasonType } from '@gusto/embedded-api-v-2026-02-01/models/components/payroll'\n\n/**\n * Enum-like map of payroll categories combining `Regular`, `External`, and every off-cycle reason.\n *\n * @internal\n */\nexport const PayrollCategory = {\n Regular: 'Regular',\n External: 'External',\n Bonus: OffCycleReasonType.Bonus,\n Correction: OffCycleReasonType.Correction,\n Dismissal: OffCycleReasonType.DismissedEmployee,\n HiredEmployee: OffCycleReasonType.HiredEmployee,\n Transition: OffCycleReasonType.TransitionFromOldPaySchedule,\n BenefitReversal: OffCycleReasonType.BenefitReversal,\n WageCorrection: OffCycleReasonType.WageCorrection,\n TaxReconciliation: OffCycleReasonType.TaxReconciliation,\n Reversal: OffCycleReasonType.Reversal,\n DisabilityInsurance: OffCycleReasonType.DisabilityInsuranceDistribution,\n} as const\n\n/**\n * Union of payroll category string values from {@link PayrollCategory}.\n *\n * @internal\n */\nexport type PayrollCategory = (typeof PayrollCategory)[keyof typeof PayrollCategory]\n\nconst VALID_PAYROLL_CATEGORIES = new Set<string>(Object.values(PayrollCategory))\n\n/**\n * Derives a {@link PayrollCategory} from a payroll's `external`, `offCycle`, and `offCycleReason` flags.\n *\n * @param payroll - The payroll whose category to derive.\n * @returns The matching category, falling back to `Regular` when nothing else applies.\n * @internal\n */\nexport function derivePayrollCategory(payroll: {\n offCycle?: boolean\n offCycleReason?: string | null\n external?: boolean\n}): PayrollCategory {\n if (payroll.external) return PayrollCategory.External\n if (\n payroll.offCycle &&\n payroll.offCycleReason &&\n VALID_PAYROLL_CATEGORIES.has(payroll.offCycleReason)\n ) {\n return payroll.offCycleReason as PayrollCategory\n }\n return PayrollCategory.Regular\n}\n\n/**\n * Returns whether a payroll category represents an off-cycle payroll.\n *\n * @param category - The payroll category to check.\n * @returns `true` for any category other than `Regular` or `External`.\n * @internal\n */\nexport function isOffCyclePayroll(category: PayrollCategory): boolean {\n return category !== PayrollCategory.Regular && category !== PayrollCategory.External\n}\n"],"names":["PayrollCategory","OffCycleReasonType","VALID_PAYROLL_CATEGORIES","derivePayrollCategory","payroll","isOffCyclePayroll","category"],"mappings":";AAOO,MAAMA,IAAkB;AAAA,EAC7B,SAAS;AAAA,EACT,UAAU;AAAA,EACV,OAAOC,EAAmB;AAAA,EAC1B,YAAYA,EAAmB;AAAA,EAC/B,WAAWA,EAAmB;AAAA,EAC9B,eAAeA,EAAmB;AAAA,EAClC,YAAYA,EAAmB;AAAA,EAC/B,iBAAiBA,EAAmB;AAAA,EACpC,gBAAgBA,EAAmB;AAAA,EACnC,mBAAmBA,EAAmB;AAAA,EACtC,UAAUA,EAAmB;AAAA,EAC7B,qBAAqBA,EAAmB;AAC1C,GASMC,IAA2B,IAAI,IAAY,OAAO,OAAOF,CAAe,CAAC;AASxE,SAASG,EAAsBC,GAIlB;AAClB,SAAIA,EAAQ,WAAiBJ,EAAgB,WAE3CI,EAAQ,YACRA,EAAQ,kBACRF,EAAyB,IAAIE,EAAQ,cAAc,IAE5CA,EAAQ,iBAEVJ,EAAgB;AACzB;AASO,SAASK,EAAkBC,GAAoC;AACpE,SAAOA,MAAaN,EAAgB,WAAWM,MAAaN,EAAgB;AAC9E;"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { PayrollPrepared } from '@gusto/embedded-api-v-
|
|
2
|
-
import { PayScheduleShow } from '@gusto/embedded-api-v-
|
|
3
|
-
import { QueryParamSortBy } from '@gusto/embedded-api-v-2025-11-15/models/operations/putv1companiescompanyidpayrollspayrollidprepare';
|
|
1
|
+
import { PayrollPrepared } from '@gusto/embedded-api-v-2026-02-01/models/components/payroll';
|
|
2
|
+
import { PayScheduleShow } from '@gusto/embedded-api-v-2026-02-01/models/components/payscheduleshow';
|
|
4
3
|
interface UsePreparedPayrollDataParams {
|
|
5
4
|
companyId: string;
|
|
6
5
|
payrollId: string;
|
|
7
6
|
employeeUuids?: string[];
|
|
8
|
-
sortBy?:
|
|
7
|
+
sortBy?: string;
|
|
9
8
|
onDataReady?: (preparedPayroll: PayrollPrepared) => void;
|
|
10
9
|
}
|
|
11
10
|
interface UsePreparedPayrollDataReturn {
|
|
@@ -1,29 +1,27 @@
|
|
|
1
|
-
import { useState as M, useRef as
|
|
2
|
-
import { usePayrollsPrepareMutation as L } from "@gusto/embedded-api-v-
|
|
3
|
-
import { usePaySchedulesGet as D } from "@gusto/embedded-api-v-
|
|
4
|
-
import { UnprocessableEntityError as T } from "@gusto/embedded-api-v-
|
|
1
|
+
import { useState as M, useRef as y, useMemo as _, useCallback as m, useEffect as b } from "react";
|
|
2
|
+
import { usePayrollsPrepareMutation as L } from "@gusto/embedded-api-v-2026-02-01/react-query/payrollsPrepare";
|
|
3
|
+
import { usePaySchedulesGet as D } from "@gusto/embedded-api-v-2026-02-01/react-query/paySchedulesGet";
|
|
4
|
+
import { UnprocessableEntityError as T } from "@gusto/embedded-api-v-2026-02-01/models/errors/unprocessableentityerror";
|
|
5
5
|
import "react/jsx-runtime";
|
|
6
6
|
import "react-error-boundary";
|
|
7
7
|
import "react-i18next";
|
|
8
8
|
import "@tanstack/react-query";
|
|
9
9
|
import { useBase as w } from "../Base/useBase.js";
|
|
10
|
-
import "@gusto/embedded-api-v-
|
|
11
|
-
import "@gusto/embedded-api-v-
|
|
12
|
-
import "@gusto/embedded-api-v-
|
|
13
|
-
import "@gusto/embedded-api-v-
|
|
14
|
-
import "dompurify";
|
|
15
|
-
import "../../contexts/LocaleProvider/useLocale.js";
|
|
10
|
+
import "@gusto/embedded-api-v-2026-02-01/models/errors/apierror";
|
|
11
|
+
import "@gusto/embedded-api-v-2026-02-01/models/errors/gustoembeddederror";
|
|
12
|
+
import "@gusto/embedded-api-v-2026-02-01/models/errors/sdkvalidationerror";
|
|
13
|
+
import "@gusto/embedded-api-v-2026-02-01/models/errors/httpclienterrors";
|
|
16
14
|
import "../../shared/constants.js";
|
|
17
15
|
import "../../contexts/ComponentAdapter/useComponentContext.js";
|
|
18
16
|
import { retryAsync as x } from "../../helpers/retryAsync.js";
|
|
19
|
-
const q = 4, v = 1500, B = (e) => e instanceof T ? e.errors.some((r) => r.category === "invalid_operation") : !1,
|
|
17
|
+
const q = 4, v = 1500, B = (e) => e instanceof T ? e.errors.some((r) => r.category === "invalid_operation") : !1, V = ({
|
|
20
18
|
companyId: e,
|
|
21
19
|
payrollId: r,
|
|
22
20
|
employeeUuids: a,
|
|
23
21
|
sortBy: n,
|
|
24
22
|
onDataReady: l
|
|
25
23
|
}) => {
|
|
26
|
-
const { mutateAsync:
|
|
24
|
+
const { mutateAsync: c, isPending: p } = L(), [o, f] = M(), t = y(!1), u = y(!1), { baseSubmitHandler: d } = w(), h = _(() => a?.join(",") ?? "", [a]), { data: S, isLoading: E } = D(
|
|
27
25
|
{
|
|
28
26
|
companyId: e,
|
|
29
27
|
payScheduleId: o?.payPeriod?.payScheduleUuid || ""
|
|
@@ -31,8 +29,8 @@ const q = 4, v = 1500, B = (e) => e instanceof T ? e.errors.some((r) => r.catego
|
|
|
31
29
|
{
|
|
32
30
|
enabled: !!o?.payPeriod?.payScheduleUuid
|
|
33
31
|
}
|
|
34
|
-
), P =
|
|
35
|
-
const i = await
|
|
32
|
+
), P = m(async () => {
|
|
33
|
+
const i = await c({
|
|
36
34
|
request: {
|
|
37
35
|
companyId: e,
|
|
38
36
|
payrollId: r,
|
|
@@ -43,7 +41,7 @@ const q = 4, v = 1500, B = (e) => e instanceof T ? e.errors.some((r) => r.catego
|
|
|
43
41
|
}
|
|
44
42
|
});
|
|
45
43
|
f(i.payrollPrepared), i.payrollPrepared && (t.current = !0, l?.(i.payrollPrepared));
|
|
46
|
-
}, [e, r,
|
|
44
|
+
}, [e, r, c, h, n, l]), s = m(async () => {
|
|
47
45
|
await d(
|
|
48
46
|
null,
|
|
49
47
|
() => x(P, {
|
|
@@ -56,7 +54,7 @@ const q = 4, v = 1500, B = (e) => e instanceof T ? e.errors.some((r) => r.catego
|
|
|
56
54
|
b(() => {
|
|
57
55
|
u.current || (u.current = !0, s());
|
|
58
56
|
}, [s]);
|
|
59
|
-
const g =
|
|
57
|
+
const g = p && !t.current, R = p && t.current, A = g || E;
|
|
60
58
|
return {
|
|
61
59
|
handlePreparePayroll: s,
|
|
62
60
|
preparedPayroll: o,
|
|
@@ -67,6 +65,6 @@ const q = 4, v = 1500, B = (e) => e instanceof T ? e.errors.some((r) => r.catego
|
|
|
67
65
|
};
|
|
68
66
|
};
|
|
69
67
|
export {
|
|
70
|
-
|
|
68
|
+
V as usePreparedPayrollData
|
|
71
69
|
};
|
|
72
70
|
//# sourceMappingURL=usePreparedPayrollData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePreparedPayrollData.js","sources":["../../../src/components/Payroll/usePreparedPayrollData.ts"],"sourcesContent":["import { useState, useEffect, useCallback, useRef, useMemo } from 'react'\nimport { usePayrollsPrepareMutation } from '@gusto/embedded-api-v-
|
|
1
|
+
{"version":3,"file":"usePreparedPayrollData.js","sources":["../../../src/components/Payroll/usePreparedPayrollData.ts"],"sourcesContent":["import { useState, useEffect, useCallback, useRef, useMemo } from 'react'\nimport { usePayrollsPrepareMutation } from '@gusto/embedded-api-v-2026-02-01/react-query/payrollsPrepare'\nimport { usePaySchedulesGet } from '@gusto/embedded-api-v-2026-02-01/react-query/paySchedulesGet'\nimport type { PayrollPrepared } from '@gusto/embedded-api-v-2026-02-01/models/components/payroll'\nimport type { PayScheduleShow } from '@gusto/embedded-api-v-2026-02-01/models/components/payscheduleshow'\nimport { UnprocessableEntityError } from '@gusto/embedded-api-v-2026-02-01/models/errors/unprocessableentityerror'\nimport { useBase } from '../Base'\nimport { retryAsync } from '@/helpers/retryAsync'\n\ninterface UsePreparedPayrollDataParams {\n companyId: string\n payrollId: string\n employeeUuids?: string[]\n sortBy?: string\n onDataReady?: (preparedPayroll: PayrollPrepared) => void\n}\n\ninterface UsePreparedPayrollDataReturn {\n handlePreparePayroll: () => Promise<void>\n preparedPayroll: PayrollPrepared | undefined\n paySchedule: PayScheduleShow | undefined\n isLoading: boolean\n isPaginating: boolean\n hasInitialData: boolean\n}\n\nconst PREPARE_MAX_ATTEMPTS = 4\nconst PREPARE_RETRY_DELAY_MS = 1500\n\nconst isPayrollBeingProcessedError = (error: unknown): boolean => {\n if (!(error instanceof UnprocessableEntityError)) return false\n return error.errors.some(e => e.category === 'invalid_operation')\n}\n\n/**\n * Wraps the prepare-payroll mutation and pay-schedule fetch, retrying while the payroll is still being processed.\n *\n * @remarks\n * Fires the prepare call once on mount, then exposes `handlePreparePayroll` for callers that need to re-prepare\n * (e.g. after sort or pagination changes). Distinguishes initial loading from subsequent pagination via\n * `isLoading` and `isPaginating`, and surfaces the pay schedule for the prepared payroll's pay period.\n *\n * @param params - The company and payroll identifiers, plus optional employee filter, sort, and ready callback.\n * @returns The prepared payroll, its pay schedule, loading flags, and a `handlePreparePayroll` callback to re-run.\n * @internal\n */\nexport const usePreparedPayrollData = ({\n companyId,\n payrollId,\n employeeUuids,\n sortBy,\n onDataReady,\n}: UsePreparedPayrollDataParams): UsePreparedPayrollDataReturn => {\n const { mutateAsync: preparePayroll, isPending: isPreparePayrollPending } =\n usePayrollsPrepareMutation()\n const [preparedPayroll, setPreparedPayroll] = useState<PayrollPrepared | undefined>()\n const hasInitialDataRef = useRef(false)\n const hasFiredRef = useRef(false)\n const { baseSubmitHandler } = useBase()\n\n const employeeUuidsKey = useMemo(() => employeeUuids?.join(',') ?? '', [employeeUuids])\n\n const { data: payScheduleData, isLoading: isPayScheduleLoading } = usePaySchedulesGet(\n {\n companyId,\n payScheduleId: preparedPayroll?.payPeriod?.payScheduleUuid || '',\n },\n {\n enabled: !!preparedPayroll?.payPeriod?.payScheduleUuid,\n },\n )\n\n const executePrepare = useCallback(async () => {\n const result = await preparePayroll({\n request: {\n companyId,\n payrollId,\n sortBy,\n requestBody: {\n employeeUuids,\n },\n },\n })\n setPreparedPayroll(result.payrollPrepared)\n if (result.payrollPrepared) {\n hasInitialDataRef.current = true\n onDataReady?.(result.payrollPrepared)\n }\n }, [companyId, payrollId, preparePayroll, employeeUuidsKey, sortBy, onDataReady])\n\n const handlePreparePayroll = useCallback(async () => {\n await baseSubmitHandler(null, () =>\n retryAsync(executePrepare, {\n maxAttempts: PREPARE_MAX_ATTEMPTS,\n delayMs: PREPARE_RETRY_DELAY_MS,\n shouldRetry: isPayrollBeingProcessedError,\n }),\n )\n }, [baseSubmitHandler, executePrepare])\n\n useEffect(() => {\n if (hasFiredRef.current) return\n hasFiredRef.current = true\n void handlePreparePayroll()\n }, [handlePreparePayroll])\n\n const isInitialLoading = isPreparePayrollPending && !hasInitialDataRef.current\n const isPaginating = isPreparePayrollPending && hasInitialDataRef.current\n const isLoading = isInitialLoading || isPayScheduleLoading\n\n return {\n handlePreparePayroll,\n preparedPayroll,\n paySchedule: payScheduleData?.payScheduleShow,\n isLoading,\n isPaginating,\n hasInitialData: hasInitialDataRef.current,\n }\n}\n"],"names":["PREPARE_MAX_ATTEMPTS","PREPARE_RETRY_DELAY_MS","isPayrollBeingProcessedError","error","UnprocessableEntityError","e","usePreparedPayrollData","companyId","payrollId","employeeUuids","sortBy","onDataReady","preparePayroll","isPreparePayrollPending","usePayrollsPrepareMutation","preparedPayroll","setPreparedPayroll","useState","hasInitialDataRef","useRef","hasFiredRef","baseSubmitHandler","useBase","employeeUuidsKey","useMemo","payScheduleData","isPayScheduleLoading","usePaySchedulesGet","executePrepare","useCallback","result","handlePreparePayroll","retryAsync","useEffect","isInitialLoading","isPaginating","isLoading"],"mappings":";;;;;;;;;;;;;;;;AA0BA,MAAMA,IAAuB,GACvBC,IAAyB,MAEzBC,IAA+B,CAACC,MAC9BA,aAAiBC,IAChBD,EAAM,OAAO,KAAK,CAAAE,MAAKA,EAAE,aAAa,mBAAmB,IADP,IAgB9CC,IAAyB,CAAC;AAAA,EACrC,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AACF,MAAkE;AAChE,QAAM,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAC9CC,EAAA,GACI,CAACC,GAAiBC,CAAkB,IAAIC,EAAA,GACxCC,IAAoBC,EAAO,EAAK,GAChCC,IAAcD,EAAO,EAAK,GAC1B,EAAE,mBAAAE,EAAA,IAAsBC,EAAA,GAExBC,IAAmBC,EAAQ,MAAMf,GAAe,KAAK,GAAG,KAAK,IAAI,CAACA,CAAa,CAAC,GAEhF,EAAE,MAAMgB,GAAiB,WAAWC,MAAyBC;AAAA,IACjE;AAAA,MACE,WAAApB;AAAA,MACA,eAAeQ,GAAiB,WAAW,mBAAmB;AAAA,IAAA;AAAA,IAEhE;AAAA,MACE,SAAS,CAAC,CAACA,GAAiB,WAAW;AAAA,IAAA;AAAA,EACzC,GAGIa,IAAiBC,EAAY,YAAY;AAC7C,UAAMC,IAAS,MAAMlB,EAAe;AAAA,MAClC,SAAS;AAAA,QACP,WAAAL;AAAA,QACA,WAAAC;AAAA,QACA,QAAAE;AAAA,QACA,aAAa;AAAA,UACX,eAAAD;AAAA,QAAA;AAAA,MACF;AAAA,IACF,CACD;AACD,IAAAO,EAAmBc,EAAO,eAAe,GACrCA,EAAO,oBACTZ,EAAkB,UAAU,IAC5BP,IAAcmB,EAAO,eAAe;AAAA,EAExC,GAAG,CAACvB,GAAWC,GAAWI,GAAgBW,GAAkBb,GAAQC,CAAW,CAAC,GAE1EoB,IAAuBF,EAAY,YAAY;AACnD,UAAMR;AAAA,MAAkB;AAAA,MAAM,MAC5BW,EAAWJ,GAAgB;AAAA,QACzB,aAAa5B;AAAA,QACb,SAASC;AAAA,QACT,aAAaC;AAAA,MAAA,CACd;AAAA,IAAA;AAAA,EAEL,GAAG,CAACmB,GAAmBO,CAAc,CAAC;AAEtC,EAAAK,EAAU,MAAM;AACd,IAAIb,EAAY,YAChBA,EAAY,UAAU,IACjBW,EAAA;AAAA,EACP,GAAG,CAACA,CAAoB,CAAC;AAEzB,QAAMG,IAAmBrB,KAA2B,CAACK,EAAkB,SACjEiB,IAAetB,KAA2BK,EAAkB,SAC5DkB,IAAYF,KAAoBR;AAEtC,SAAO;AAAA,IACL,sBAAAK;AAAA,IACA,iBAAAhB;AAAA,IACA,aAAaU,GAAiB;AAAA,IAC9B,WAAAW;AAAA,IACA,cAAAD;AAAA,IACA,gBAAgBjB,EAAkB;AAAA,EAAA;AAEtC;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PayPeriod } from '@gusto/embedded-api-v-
|
|
1
|
+
import { PayPeriod } from '@gusto/embedded-api-v-2026-02-01/models/components/payperiod';
|
|
2
2
|
interface UseUnprocessedTransitionPayPeriodsResult {
|
|
3
3
|
unprocessedPayPeriods: PayPeriod[];
|
|
4
4
|
hasUnprocessedTransitions: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMemo as t } from "react";
|
|
2
|
-
import { usePaySchedulesGetPayPeriodsSuspense as a } from "@gusto/embedded-api-v-
|
|
3
|
-
import { PayrollTypes as i } from "@gusto/embedded-api-v-
|
|
4
|
-
import { RFCDate as p } from "@gusto/embedded-api-v-
|
|
2
|
+
import { usePaySchedulesGetPayPeriodsSuspense as a } from "@gusto/embedded-api-v-2026-02-01/react-query/paySchedulesGetPayPeriods";
|
|
3
|
+
import { PayrollTypes as i } from "@gusto/embedded-api-v-2026-02-01/models/operations/getv1companiescompanyidpayperiods";
|
|
4
|
+
import { RFCDate as p } from "@gusto/embedded-api-v-2026-02-01/types/rfcdate";
|
|
5
5
|
const d = 90;
|
|
6
6
|
function u(r) {
|
|
7
7
|
const n = t(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUnprocessedTransitionPayPeriods.js","sources":["../../../src/components/Payroll/useUnprocessedTransitionPayPeriods.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { usePaySchedulesGetPayPeriodsSuspense } from '@gusto/embedded-api-v-
|
|
1
|
+
{"version":3,"file":"useUnprocessedTransitionPayPeriods.js","sources":["../../../src/components/Payroll/useUnprocessedTransitionPayPeriods.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { usePaySchedulesGetPayPeriodsSuspense } from '@gusto/embedded-api-v-2026-02-01/react-query/paySchedulesGetPayPeriods'\nimport { PayrollTypes } from '@gusto/embedded-api-v-2026-02-01/models/operations/getv1companiescompanyidpayperiods'\nimport type { PayPeriod } from '@gusto/embedded-api-v-2026-02-01/models/components/payperiod'\nimport { RFCDate } from '@gusto/embedded-api-v-2026-02-01/types/rfcdate'\n\nconst LOOK_AHEAD_DAYS = 90\n\ninterface UseUnprocessedTransitionPayPeriodsResult {\n unprocessedPayPeriods: PayPeriod[]\n hasUnprocessedTransitions: boolean\n}\n\n/**\n * Returns the company's unprocessed transition pay periods within the next 90 days.\n *\n * @param companyId - The company whose transition pay periods to fetch.\n * @returns The unprocessed transition pay periods and a flag indicating whether any exist.\n * @internal\n */\nexport function useUnprocessedTransitionPayPeriods(\n companyId: string,\n): UseUnprocessedTransitionPayPeriodsResult {\n const lookAheadEndDate = useMemo(() => {\n const date = new Date()\n date.setDate(date.getDate() + LOOK_AHEAD_DAYS)\n return new RFCDate(date)\n }, [])\n\n const { data } = usePaySchedulesGetPayPeriodsSuspense({\n companyId,\n payrollTypes: PayrollTypes.Transition,\n endDate: lookAheadEndDate,\n })\n\n const unprocessedPayPeriods = useMemo<PayPeriod[]>(\n () => (data.payPeriods ?? []).filter((pp: PayPeriod) => !pp.payroll?.processed),\n [data],\n )\n\n return {\n unprocessedPayPeriods,\n hasUnprocessedTransitions: unprocessedPayPeriods.length > 0,\n }\n}\n"],"names":["LOOK_AHEAD_DAYS","useUnprocessedTransitionPayPeriods","companyId","lookAheadEndDate","useMemo","date","RFCDate","data","usePaySchedulesGetPayPeriodsSuspense","PayrollTypes","unprocessedPayPeriods","pp"],"mappings":";;;;AAMA,MAAMA,IAAkB;AAcjB,SAASC,EACdC,GAC0C;AAC1C,QAAMC,IAAmBC,EAAQ,MAAM;AACrC,UAAMC,wBAAW,KAAA;AACjB,WAAAA,EAAK,QAAQA,EAAK,QAAA,IAAYL,CAAe,GACtC,IAAIM,EAAQD,CAAI;AAAA,EACzB,GAAG,CAAA,CAAE,GAEC,EAAE,MAAAE,EAAA,IAASC,EAAqC;AAAA,IACpD,WAAAN;AAAA,IACA,cAAcO,EAAa;AAAA,IAC3B,SAASN;AAAA,EAAA,CACV,GAEKO,IAAwBN;AAAA,IAC5B,OAAOG,EAAK,cAAc,IAAI,OAAO,CAACI,MAAkB,CAACA,EAAG,SAAS,SAAS;AAAA,IAC9E,CAACJ,CAAI;AAAA,EAAA;AAGP,SAAO;AAAA,IACL,uBAAAG;AAAA,IACA,2BAA2BA,EAAsB,SAAS;AAAA,EAAA;AAE9D;"}
|
|
@@ -2,9 +2,9 @@ import { jsx as a } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as d, useMemo as u } from "react";
|
|
3
3
|
import { useTranslation as T } from "react-i18next";
|
|
4
4
|
import { useQueryClient as Y } from "@tanstack/react-query";
|
|
5
|
-
import { useHolidayPayPoliciesGetSuspense as j, invalidateAllHolidayPayPoliciesGet as q } from "@gusto/embedded-api-v-
|
|
6
|
-
import { useHolidayPayPoliciesRemoveEmployeesMutation as x } from "@gusto/embedded-api-v-
|
|
7
|
-
import { useEmployeesListSuspense as Q } from "@gusto/embedded-api-v-
|
|
5
|
+
import { useHolidayPayPoliciesGetSuspense as j, invalidateAllHolidayPayPoliciesGet as q } from "@gusto/embedded-api-v-2026-02-01/react-query/holidayPayPoliciesGet";
|
|
6
|
+
import { useHolidayPayPoliciesRemoveEmployeesMutation as x } from "@gusto/embedded-api-v-2026-02-01/react-query/holidayPayPoliciesRemoveEmployees";
|
|
7
|
+
import { useEmployeesListSuspense as Q } from "@gusto/embedded-api-v-2026-02-01/react-query/employeesList";
|
|
8
8
|
import { getDefaultHolidayItems as G } from "../shared/holidayHelpers.js";
|
|
9
9
|
import { HolidayPolicyDetailPresentation as $ } from "./HolidayPolicyDetailPresentation.js";
|
|
10
10
|
import { useClientPagination as K } from "../../../hooks/useClientPagination/useClientPagination.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HolidayPolicyDetail.js","sources":["../../../../src/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.tsx"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useQueryClient } from '@tanstack/react-query'\nimport {\n useHolidayPayPoliciesGetSuspense,\n invalidateAllHolidayPayPoliciesGet,\n} from '@gusto/embedded-api-v-2025-11-15/react-query/holidayPayPoliciesGet'\nimport { useHolidayPayPoliciesRemoveEmployeesMutation } from '@gusto/embedded-api-v-2025-11-15/react-query/holidayPayPoliciesRemoveEmployees'\nimport { useEmployeesListSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/employeesList'\nimport { getDefaultHolidayItems } from '../shared/holidayHelpers'\nimport { HolidayPolicyDetailPresentation } from './HolidayPolicyDetailPresentation'\nimport type { HolidayPolicyDetailEmployee } from './HolidayPolicyDetailTypes'\nimport { useClientPagination } from '@/hooks/useClientPagination/useClientPagination'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { firstLastName } from '@/helpers/formattedStrings'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport EditIcon from '@/assets/icons/edit-02.svg?react'\nimport PlusCircleIcon from '@/assets/icons/plus-circle.svg?react'\n\n/** @internal */\nexport interface HolidayPolicyDetailProps extends BaseComponentInterface<\n 'Company.TimeOff.HolidayPolicy' | 'Company.TimeOff.PolicyDetail'\n> {\n /** The associated company identifier. */\n companyId: string\n /** Which tab to display initially. Defaults to `'holidays'`. */\n defaultTab?: 'holidays' | 'employees'\n}\n\n/** @internal */\nexport function HolidayPolicyDetail(props: HolidayPolicyDetailProps) {\n return (\n <BaseComponent {...props} componentName=\"Company.TimeOff.HolidayPolicy\">\n <Root {...props} />\n </BaseComponent>\n )\n}\n\ninterface RemoveDialogTarget {\n uuid: string\n name: string\n}\n\nfunction Root({ companyId, defaultTab = 'holidays' }: HolidayPolicyDetailProps) {\n useI18n('Company.TimeOff.HolidayPolicy')\n useI18n('Company.TimeOff.PolicyDetail')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n const { t: tShared } = useTranslation('Company.TimeOff.PolicyDetail')\n const { Button } = useComponentContext()\n const { locale } = useLocale()\n const queryClient = useQueryClient()\n const { onEvent, baseSubmitHandler } = useBase()\n\n const [selectedTabId, setSelectedTabId] = useState<string>(defaultTab)\n const [successAlert, setSuccessAlert] = useState<string | null>(null)\n const [removeDialogTarget, setRemoveDialogTarget] = useState<RemoveDialogTarget | null>(null)\n\n const holidayQuery = useHolidayPayPoliciesGetSuspense({ companyUuid: companyId })\n const holidayPayPolicy = holidayQuery.data.holidayPayPolicy!\n\n const { data: employeesData } = useEmployeesListSuspense({\n companyId,\n terminated: false,\n })\n\n const removeEmployeesMutation = useHolidayPayPoliciesRemoveEmployeesMutation()\n\n const holidays = useMemo(() => {\n const allHolidays = getDefaultHolidayItems(t, undefined, locale)\n const { federalHolidays } = holidayPayPolicy\n return allHolidays.filter(holiday => {\n const holidayData = federalHolidays[holiday.uuid as keyof typeof federalHolidays]\n return holidayData?.selected === true\n })\n }, [t, holidayPayPolicy, locale])\n\n const policyEmployeeUuids = useMemo(\n () => new Set(holidayPayPolicy.employees.map(e => e.uuid)),\n [holidayPayPolicy.employees],\n )\n\n const employees: HolidayPolicyDetailEmployee[] = useMemo(() => {\n const allEmployees = employeesData.showEmployees ?? []\n return allEmployees\n .filter(emp => policyEmployeeUuids.has(emp.uuid))\n .map(emp => ({\n uuid: emp.uuid,\n firstName: emp.firstName,\n lastName: emp.lastName,\n jobTitle: emp.jobs?.find(job => job.primary)?.title ?? null,\n }))\n }, [employeesData.showEmployees, policyEmployeeUuids])\n\n const {\n data: pagedEmployees,\n pagination,\n searchValue,\n actions: paginationActions,\n } = useClientPagination(employees, {\n defaultItemsPerPage: 10,\n searchPredicate: (emp, query) =>\n `${emp.firstName ?? ''} ${emp.lastName ?? ''}`.toLowerCase().includes(query.toLowerCase()),\n })\n\n const handleRemoveEmployee = async () => {\n if (!removeDialogTarget) return\n\n const targetUuid = removeDialogTarget.uuid\n const targetName = removeDialogTarget.name\n setRemoveDialogTarget(null)\n\n await baseSubmitHandler({}, async () => {\n await removeEmployeesMutation.mutateAsync({\n request: {\n companyUuid: companyId,\n requestBody: {\n version: holidayPayPolicy.version!,\n employees: [{ uuid: targetUuid }],\n },\n },\n })\n await invalidateAllHolidayPayPoliciesGet(queryClient)\n setSuccessAlert(t('flash.employeeRemoved', { name: targetName }))\n })\n }\n\n const handleBack = () => {\n onEvent(componentEvents.TIME_OFF_BACK_TO_LIST)\n }\n\n const handleAddEmployees = () => {\n onEvent(componentEvents.TIME_OFF_HOLIDAY_ADD_EMPLOYEES)\n }\n\n const handleEditPolicy = () => {\n onEvent(componentEvents.TIME_OFF_EDIT_HOLIDAY_POLICY)\n }\n\n const actions = [\n <Button\n key=\"add\"\n variant=\"secondary\"\n icon={<PlusCircleIcon aria-hidden />}\n onClick={handleAddEmployees}\n >\n {t('show.addEmployeesCta')}\n </Button>,\n <Button\n key=\"edit\"\n variant=\"secondary\"\n icon={<EditIcon aria-hidden />}\n onClick={handleEditPolicy}\n >\n {t('show.editPolicyCta')}\n </Button>,\n ]\n\n return (\n <HolidayPolicyDetailPresentation\n title={t('show.title')}\n onBack={handleBack}\n backLabel={tShared('backLabel')}\n actions={actions}\n onAddEmployee={handleAddEmployees}\n holidays={holidays}\n selectedTabId={selectedTabId}\n onTabChange={setSelectedTabId}\n employees={{\n data: pagedEmployees,\n searchValue,\n onSearchChange: paginationActions.onSearchChange,\n onSearchClear: paginationActions.onSearchClear,\n pagination,\n itemMenu: employee => (\n <HamburgerMenu\n items={[\n {\n label: tShared('removeEmployeeDialog.confirmCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n setRemoveDialogTarget({\n uuid: employee.uuid,\n name: firstLastName({\n first_name: employee.firstName,\n last_name: employee.lastName,\n }),\n })\n },\n },\n ]}\n triggerLabel={tShared('employeeActions', {\n name: firstLastName({ first_name: employee.firstName, last_name: employee.lastName }),\n })}\n />\n ),\n }}\n removeDialog={{\n isOpen: removeDialogTarget !== null,\n employeeName: removeDialogTarget?.name ?? '',\n onConfirm: handleRemoveEmployee,\n onClose: () => {\n setRemoveDialogTarget(null)\n },\n isPending: removeEmployeesMutation.isPending,\n }}\n successAlert={successAlert ?? undefined}\n onDismissAlert={() => {\n setSuccessAlert(null)\n }}\n />\n )\n}\n"],"names":["HolidayPolicyDetail","props","jsx","BaseComponent","Root","companyId","defaultTab","useI18n","t","useTranslation","tShared","Button","useComponentContext","locale","useLocale","queryClient","useQueryClient","onEvent","baseSubmitHandler","useBase","selectedTabId","setSelectedTabId","useState","successAlert","setSuccessAlert","removeDialogTarget","setRemoveDialogTarget","holidayPayPolicy","useHolidayPayPoliciesGetSuspense","employeesData","useEmployeesListSuspense","removeEmployeesMutation","useHolidayPayPoliciesRemoveEmployeesMutation","holidays","useMemo","allHolidays","getDefaultHolidayItems","federalHolidays","holiday","policyEmployeeUuids","employees","emp","job","pagedEmployees","pagination","searchValue","paginationActions","useClientPagination","query","handleRemoveEmployee","targetUuid","targetName","invalidateAllHolidayPayPoliciesGet","handleBack","componentEvents","handleAddEmployees","handleEditPolicy","actions","PlusCircleIcon","EditIcon","HolidayPolicyDetailPresentation","employee","HamburgerMenu","TrashCanSvg","firstLastName"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoCO,SAASA,GAAoBC,GAAiC;AACnE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GAAO,eAAc,iCACtC,UAAA,gBAAAC,EAACE,IAAA,EAAM,GAAGH,EAAA,CAAO,EAAA,CACnB;AAEJ;AAOA,SAASG,GAAK,EAAE,WAAAC,GAAW,YAAAC,IAAa,cAAwC;AAC9E,EAAAC,EAAQ,+BAA+B,GACvCA,EAAQ,8BAA8B;AACtC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,+BAA+B,GACtD,EAAE,GAAGC,MAAYD,EAAe,8BAA8B,GAC9D,EAAE,QAAAE,EAAA,IAAWC,EAAA,GACb,EAAE,QAAAC,EAAA,IAAWC,EAAA,GACbC,IAAcC,EAAA,GACd,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GAEj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;AAAA,EAAA;AAGN;"}
|
|
1
|
+
{"version":3,"file":"HolidayPolicyDetail.js","sources":["../../../../src/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.tsx"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useQueryClient } from '@tanstack/react-query'\nimport {\n useHolidayPayPoliciesGetSuspense,\n invalidateAllHolidayPayPoliciesGet,\n} from '@gusto/embedded-api-v-2026-02-01/react-query/holidayPayPoliciesGet'\nimport { useHolidayPayPoliciesRemoveEmployeesMutation } from '@gusto/embedded-api-v-2026-02-01/react-query/holidayPayPoliciesRemoveEmployees'\nimport { useEmployeesListSuspense } from '@gusto/embedded-api-v-2026-02-01/react-query/employeesList'\nimport { getDefaultHolidayItems } from '../shared/holidayHelpers'\nimport { HolidayPolicyDetailPresentation } from './HolidayPolicyDetailPresentation'\nimport type { HolidayPolicyDetailEmployee } from './HolidayPolicyDetailTypes'\nimport { useClientPagination } from '@/hooks/useClientPagination/useClientPagination'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { firstLastName } from '@/helpers/formattedStrings'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport EditIcon from '@/assets/icons/edit-02.svg?react'\nimport PlusCircleIcon from '@/assets/icons/plus-circle.svg?react'\n\n/** @internal */\nexport interface HolidayPolicyDetailProps extends BaseComponentInterface<\n 'Company.TimeOff.HolidayPolicy' | 'Company.TimeOff.PolicyDetail'\n> {\n /** The associated company identifier. */\n companyId: string\n /** Which tab to display initially. Defaults to `'holidays'`. */\n defaultTab?: 'holidays' | 'employees'\n}\n\n/** @internal */\nexport function HolidayPolicyDetail(props: HolidayPolicyDetailProps) {\n return (\n <BaseComponent {...props} componentName=\"Company.TimeOff.HolidayPolicy\">\n <Root {...props} />\n </BaseComponent>\n )\n}\n\ninterface RemoveDialogTarget {\n uuid: string\n name: string\n}\n\nfunction Root({ companyId, defaultTab = 'holidays' }: HolidayPolicyDetailProps) {\n useI18n('Company.TimeOff.HolidayPolicy')\n useI18n('Company.TimeOff.PolicyDetail')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n const { t: tShared } = useTranslation('Company.TimeOff.PolicyDetail')\n const { Button } = useComponentContext()\n const { locale } = useLocale()\n const queryClient = useQueryClient()\n const { onEvent, baseSubmitHandler } = useBase()\n\n const [selectedTabId, setSelectedTabId] = useState<string>(defaultTab)\n const [successAlert, setSuccessAlert] = useState<string | null>(null)\n const [removeDialogTarget, setRemoveDialogTarget] = useState<RemoveDialogTarget | null>(null)\n\n const holidayQuery = useHolidayPayPoliciesGetSuspense({ companyUuid: companyId })\n const holidayPayPolicy = holidayQuery.data.holidayPayPolicy!\n\n const { data: employeesData } = useEmployeesListSuspense({\n companyId,\n terminated: false,\n })\n\n const removeEmployeesMutation = useHolidayPayPoliciesRemoveEmployeesMutation()\n\n const holidays = useMemo(() => {\n const allHolidays = getDefaultHolidayItems(t, undefined, locale)\n const { federalHolidays } = holidayPayPolicy\n return allHolidays.filter(holiday => {\n const holidayData = federalHolidays[holiday.uuid as keyof typeof federalHolidays]\n return holidayData?.selected === true\n })\n }, [t, holidayPayPolicy, locale])\n\n const policyEmployeeUuids = useMemo(\n () => new Set(holidayPayPolicy.employees.map(e => e.uuid)),\n [holidayPayPolicy.employees],\n )\n\n const employees: HolidayPolicyDetailEmployee[] = useMemo(() => {\n const allEmployees = employeesData.showEmployees ?? []\n return allEmployees\n .filter(emp => policyEmployeeUuids.has(emp.uuid))\n .map(emp => ({\n uuid: emp.uuid,\n firstName: emp.firstName,\n lastName: emp.lastName,\n jobTitle: emp.jobs?.find(job => job.primary)?.title ?? null,\n }))\n }, [employeesData.showEmployees, policyEmployeeUuids])\n\n const {\n data: pagedEmployees,\n pagination,\n searchValue,\n actions: paginationActions,\n } = useClientPagination(employees, {\n defaultItemsPerPage: 10,\n searchPredicate: (emp, query) =>\n `${emp.firstName ?? ''} ${emp.lastName ?? ''}`.toLowerCase().includes(query.toLowerCase()),\n })\n\n const handleRemoveEmployee = async () => {\n if (!removeDialogTarget) return\n\n const targetUuid = removeDialogTarget.uuid\n const targetName = removeDialogTarget.name\n setRemoveDialogTarget(null)\n\n await baseSubmitHandler({}, async () => {\n await removeEmployeesMutation.mutateAsync({\n request: {\n companyUuid: companyId,\n requestBody: {\n version: holidayPayPolicy.version!,\n employees: [{ uuid: targetUuid }],\n },\n },\n })\n await invalidateAllHolidayPayPoliciesGet(queryClient)\n setSuccessAlert(t('flash.employeeRemoved', { name: targetName }))\n })\n }\n\n const handleBack = () => {\n onEvent(componentEvents.TIME_OFF_BACK_TO_LIST)\n }\n\n const handleAddEmployees = () => {\n onEvent(componentEvents.TIME_OFF_HOLIDAY_ADD_EMPLOYEES)\n }\n\n const handleEditPolicy = () => {\n onEvent(componentEvents.TIME_OFF_EDIT_HOLIDAY_POLICY)\n }\n\n const actions = [\n <Button\n key=\"add\"\n variant=\"secondary\"\n icon={<PlusCircleIcon aria-hidden />}\n onClick={handleAddEmployees}\n >\n {t('show.addEmployeesCta')}\n </Button>,\n <Button\n key=\"edit\"\n variant=\"secondary\"\n icon={<EditIcon aria-hidden />}\n onClick={handleEditPolicy}\n >\n {t('show.editPolicyCta')}\n </Button>,\n ]\n\n return (\n <HolidayPolicyDetailPresentation\n title={t('show.title')}\n onBack={handleBack}\n backLabel={tShared('backLabel')}\n actions={actions}\n onAddEmployee={handleAddEmployees}\n holidays={holidays}\n selectedTabId={selectedTabId}\n onTabChange={setSelectedTabId}\n employees={{\n data: pagedEmployees,\n searchValue,\n onSearchChange: paginationActions.onSearchChange,\n onSearchClear: paginationActions.onSearchClear,\n pagination,\n itemMenu: employee => (\n <HamburgerMenu\n items={[\n {\n label: tShared('removeEmployeeDialog.confirmCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n setRemoveDialogTarget({\n uuid: employee.uuid,\n name: firstLastName({\n first_name: employee.firstName,\n last_name: employee.lastName,\n }),\n })\n },\n },\n ]}\n triggerLabel={tShared('employeeActions', {\n name: firstLastName({ first_name: employee.firstName, last_name: employee.lastName }),\n })}\n />\n ),\n }}\n removeDialog={{\n isOpen: removeDialogTarget !== null,\n employeeName: removeDialogTarget?.name ?? '',\n onConfirm: handleRemoveEmployee,\n onClose: () => {\n setRemoveDialogTarget(null)\n },\n isPending: removeEmployeesMutation.isPending,\n }}\n successAlert={successAlert ?? undefined}\n onDismissAlert={() => {\n setSuccessAlert(null)\n }}\n />\n )\n}\n"],"names":["HolidayPolicyDetail","props","jsx","BaseComponent","Root","companyId","defaultTab","useI18n","t","useTranslation","tShared","Button","useComponentContext","locale","useLocale","queryClient","useQueryClient","onEvent","baseSubmitHandler","useBase","selectedTabId","setSelectedTabId","useState","successAlert","setSuccessAlert","removeDialogTarget","setRemoveDialogTarget","holidayPayPolicy","useHolidayPayPoliciesGetSuspense","employeesData","useEmployeesListSuspense","removeEmployeesMutation","useHolidayPayPoliciesRemoveEmployeesMutation","holidays","useMemo","allHolidays","getDefaultHolidayItems","federalHolidays","holiday","policyEmployeeUuids","employees","emp","job","pagedEmployees","pagination","searchValue","paginationActions","useClientPagination","query","handleRemoveEmployee","targetUuid","targetName","invalidateAllHolidayPayPoliciesGet","handleBack","componentEvents","handleAddEmployees","handleEditPolicy","actions","PlusCircleIcon","EditIcon","HolidayPolicyDetailPresentation","employee","HamburgerMenu","TrashCanSvg","firstLastName"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoCO,SAASA,GAAoBC,GAAiC;AACnE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GAAO,eAAc,iCACtC,UAAA,gBAAAC,EAACE,IAAA,EAAM,GAAGH,EAAA,CAAO,EAAA,CACnB;AA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AU;AAAA,YAAA,CACrF;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,MAGJ,cAAc;AAAA,QACZ,QAAQpC,MAAuB;AAAA,QAC/B,cAAcA,GAAoB,QAAQ;AAAA,QAC1C,WAAWwB;AAAA,QACX,SAAS,MAAM;AACb,UAAAvB,EAAsB,IAAI;AAAA,QAC5B;AAAA,QACA,WAAWK,EAAwB;AAAA,MAAA;AAAA,MAErC,cAAcR,KAAgB;AAAA,MAC9B,gBAAgB,MAAM;AACpB,QAAAC,EAAgB,IAAI;AAAA,MACtB;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -2,9 +2,9 @@ import { jsx as u } from "react/jsx-runtime";
|
|
|
2
2
|
import { useMemo as C, useCallback as r, useState as b } from "react";
|
|
3
3
|
import { useTranslation as A } from "react-i18next";
|
|
4
4
|
import { useQueryClient as O } from "@tanstack/react-query";
|
|
5
|
-
import { useHolidayPayPoliciesCreateMutation as k } from "@gusto/embedded-api-v-
|
|
6
|
-
import { useHolidayPayPoliciesGetSuspense as N, invalidateAllHolidayPayPoliciesGet as _, queryKeyHolidayPayPoliciesGet as x } from "@gusto/embedded-api-v-
|
|
7
|
-
import { useHolidayPayPoliciesUpdateMutation as M } from "@gusto/embedded-api-v-
|
|
5
|
+
import { useHolidayPayPoliciesCreateMutation as k } from "@gusto/embedded-api-v-2026-02-01/react-query/holidayPayPoliciesCreate";
|
|
6
|
+
import { useHolidayPayPoliciesGetSuspense as N, invalidateAllHolidayPayPoliciesGet as _, queryKeyHolidayPayPoliciesGet as x } from "@gusto/embedded-api-v-2026-02-01/react-query/holidayPayPoliciesGet";
|
|
7
|
+
import { useHolidayPayPoliciesUpdateMutation as M } from "@gusto/embedded-api-v-2026-02-01/react-query/holidayPayPoliciesUpdate";
|
|
8
8
|
import { getDefaultHolidayItems as w, FEDERAL_HOLIDAY_KEYS as T, buildFederalHolidaysPayload as U } from "../shared/holidayHelpers.js";
|
|
9
9
|
import { HolidaySelectionFormPresentation as v } from "./HolidaySelectionFormPresentation.js";
|
|
10
10
|
import { BaseComponent as R } from "../../Base/Base.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HolidaySelectionForm.js","sources":["../../../../src/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.tsx"],"sourcesContent":["import { useCallback, useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { useHolidayPayPoliciesCreateMutation } from '@gusto/embedded-api-v-2025-11-15/react-query/holidayPayPoliciesCreate'\nimport {\n useHolidayPayPoliciesGetSuspense,\n queryKeyHolidayPayPoliciesGet,\n invalidateAllHolidayPayPoliciesGet,\n type HolidayPayPoliciesGetQueryData,\n} from '@gusto/embedded-api-v-2025-11-15/react-query/holidayPayPoliciesGet'\nimport { useHolidayPayPoliciesUpdateMutation } from '@gusto/embedded-api-v-2025-11-15/react-query/holidayPayPoliciesUpdate'\nimport type { HolidayPayPolicy } from '@gusto/embedded-api-v-2025-11-15/models/components/holidaypaypolicy'\nimport {\n getDefaultHolidayItems,\n buildFederalHolidaysPayload,\n FEDERAL_HOLIDAY_KEYS,\n} from '../shared/holidayHelpers'\nimport { HolidaySelectionFormPresentation } from './HolidaySelectionFormPresentation'\nimport type { HolidayItem } from './HolidaySelectionFormTypes'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { componentEvents } from '@/shared/constants'\nimport { useI18n } from '@/i18n'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\n\n/**\n * Props for {@link HolidaySelectionForm}.\n *\n * @public\n */\nexport interface HolidaySelectionFormProps extends BaseComponentInterface<'Company.TimeOff.HolidayPolicy'> {\n /** The associated company identifier. */\n companyId: string\n /** Whether to create a new holiday policy or edit the existing one. Defaults to `'create'`. */\n mode?: 'create' | 'edit'\n}\n\n/**\n * Lets a user select which US federal holidays are observed by the company's holiday pay policy.\n *\n * In `'create'` mode, submitting creates a new holiday pay policy. In `'edit'` mode, the form\n * is pre-populated with the existing policy's selections and submitting updates it. All 11 US\n * federal holidays are shown with their observed and next-observation dates; in create mode they\n * are all selected by default.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `timeOff/holidaySelection/done` | Holidays were saved in create mode | — |\n * | `timeOff/holidaySelection/editDone` | Holidays were saved in edit mode | — |\n * | `CANCEL` | The user backed out of the form | — |\n *\n * @param props - See {@link HolidaySelectionFormProps}.\n * @returns The rendered holiday selection form.\n * @public\n */\nexport function HolidaySelectionForm(props: HolidaySelectionFormProps) {\n return (\n <BaseComponent {...props}>\n {props.mode === 'edit' ? (\n <EditRoot companyId={props.companyId} />\n ) : (\n <CreateRoot companyId={props.companyId} />\n )}\n </BaseComponent>\n )\n}\n\ninterface RootProps {\n companyId: string\n}\n\nfunction useHolidaySelection(initialKeys: Set<string>) {\n const [selectedUuids, setSelectedUuids] = useState(initialKeys)\n\n const handleSelectionChange = useCallback((item: HolidayItem, selected: boolean) => {\n setSelectedUuids(prev => {\n const next = new Set(prev)\n if (selected) {\n next.add(item.uuid)\n } else {\n next.delete(item.uuid)\n }\n return next\n })\n }, [])\n\n const handleSelectAll = useCallback((selected: boolean, visibleItems: HolidayItem[]) => {\n setSelectedUuids(prev => {\n const next = new Set(prev)\n for (const item of visibleItems) {\n if (selected) next.add(item.uuid)\n else next.delete(item.uuid)\n }\n return next\n })\n }, [])\n\n return { selectedUuids, handleSelectionChange, handleSelectAll }\n}\n\nfunction seedPolicyCache(\n queryClient: ReturnType<typeof useQueryClient>,\n companyId: string,\n policy: HolidayPayPolicy | undefined,\n) {\n if (!policy) return\n queryClient.setQueryData<HolidayPayPoliciesGetQueryData>(\n queryKeyHolidayPayPoliciesGet(companyId, {}),\n prev =>\n prev\n ? { ...prev, holidayPayPolicy: policy }\n : (undefined as unknown as HolidayPayPoliciesGetQueryData),\n )\n}\n\nfunction CreateRoot({ companyId }: RootProps) {\n useI18n('Company.TimeOff.HolidayPolicy')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n const { onEvent, baseSubmitHandler } = useBase()\n const { locale } = useLocale()\n const queryClient = useQueryClient()\n\n const holidays = useMemo(() => getDefaultHolidayItems(t, undefined, locale), [t, locale])\n const allKeys = useMemo(() => new Set(FEDERAL_HOLIDAY_KEYS), [])\n const { selectedUuids, handleSelectionChange, handleSelectAll } = useHolidaySelection(allKeys)\n\n const { mutateAsync: createPolicy, isPending } = useHolidayPayPoliciesCreateMutation()\n\n const handleContinue = useCallback(async () => {\n await baseSubmitHandler({}, async () => {\n const response = await createPolicy({\n request: {\n companyUuid: companyId,\n holidayPayPolicyRequest: {\n federalHolidays: buildFederalHolidaysPayload(selectedUuids),\n },\n },\n })\n // Seed the GET cache so the next mount of SelectEmployeesHoliday's\n // StandaloneLoader (in addEmployeesHoliday state) reads the freshly\n // created policy instead of a stale `{ holidayPayPolicy: undefined }`\n // left over from PolicyList's pre-create GET.\n seedPolicyCache(queryClient, companyId, response.holidayPayPolicy)\n await invalidateAllHolidayPayPoliciesGet(queryClient)\n onEvent(componentEvents.TIME_OFF_HOLIDAY_SELECTION_DONE)\n })\n }, [baseSubmitHandler, createPolicy, companyId, selectedUuids, queryClient, onEvent])\n\n const handleBack = useCallback(() => {\n onEvent(componentEvents.CANCEL)\n }, [onEvent])\n\n return (\n <HolidaySelectionFormPresentation\n holidays={holidays}\n selectedHolidayUuids={selectedUuids}\n onSelectionChange={handleSelectionChange}\n onSelectAll={handleSelectAll}\n onContinue={handleContinue}\n onBack={handleBack}\n isPending={isPending}\n />\n )\n}\n\nfunction EditRoot({ companyId }: RootProps) {\n useI18n('Company.TimeOff.HolidayPolicy')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n const { onEvent, baseSubmitHandler } = useBase()\n const { locale } = useLocale()\n const queryClient = useQueryClient()\n\n const { data } = useHolidayPayPoliciesGetSuspense({ companyUuid: companyId })\n const policy = data.holidayPayPolicy!\n\n const holidays = useMemo(() => getDefaultHolidayItems(t, undefined, locale), [t, locale])\n\n const initialSelected = useMemo(() => {\n const next = new Set<string>()\n const federal = policy.federalHolidays\n for (const key of FEDERAL_HOLIDAY_KEYS) {\n const entry = federal[key as keyof typeof federal]\n if (entry?.selected === true) {\n next.add(key)\n }\n }\n return next\n }, [policy.federalHolidays])\n\n const { selectedUuids, handleSelectionChange, handleSelectAll } =\n useHolidaySelection(initialSelected)\n\n const { mutateAsync: updatePolicy, isPending } = useHolidayPayPoliciesUpdateMutation()\n\n const handleContinue = useCallback(async () => {\n await baseSubmitHandler({}, async () => {\n const response = await updatePolicy({\n request: {\n companyUuid: companyId,\n requestBody: {\n version: policy.version!,\n federalHolidays: buildFederalHolidaysPayload(selectedUuids),\n },\n },\n })\n seedPolicyCache(queryClient, companyId, response.holidayPayPolicy)\n await invalidateAllHolidayPayPoliciesGet(queryClient)\n onEvent(componentEvents.TIME_OFF_HOLIDAY_SELECTION_EDIT_DONE)\n })\n }, [\n baseSubmitHandler,\n updatePolicy,\n companyId,\n policy.version,\n selectedUuids,\n queryClient,\n onEvent,\n ])\n\n const handleBack = useCallback(() => {\n onEvent(componentEvents.CANCEL)\n }, [onEvent])\n\n return (\n <HolidaySelectionFormPresentation\n holidays={holidays}\n selectedHolidayUuids={selectedUuids}\n onSelectionChange={handleSelectionChange}\n onSelectAll={handleSelectAll}\n onContinue={handleContinue}\n onBack={handleBack}\n isPending={isPending}\n />\n )\n}\n"],"names":["HolidaySelectionForm","props","BaseComponent","jsx","EditRoot","CreateRoot","useHolidaySelection","initialKeys","selectedUuids","setSelectedUuids","useState","handleSelectionChange","useCallback","item","selected","prev","next","handleSelectAll","visibleItems","seedPolicyCache","queryClient","companyId","policy","queryKeyHolidayPayPoliciesGet","useI18n","t","useTranslation","onEvent","baseSubmitHandler","useBase","locale","useLocale","useQueryClient","holidays","useMemo","getDefaultHolidayItems","allKeys","FEDERAL_HOLIDAY_KEYS","createPolicy","isPending","useHolidayPayPoliciesCreateMutation","handleContinue","response","buildFederalHolidaysPayload","invalidateAllHolidayPayPoliciesGet","componentEvents","handleBack","HolidaySelectionFormPresentation","data","useHolidayPayPoliciesGetSuspense","initialSelected","federal","key","updatePolicy","useHolidayPayPoliciesUpdateMutation"],"mappings":";;;;;;;;;;;;;;AAwDO,SAASA,GAAqBC,GAAkC;AACrE,2BACGC,GAAA,EAAe,GAAGD,GAChB,UAAAA,EAAM,SAAS,SACd,gBAAAE,EAACC,GAAA,EAAS,WAAWH,EAAM,WAAW,IAEtC,gBAAAE,EAACE,KAAW,WAAWJ,EAAM,WAAW,GAE5C;AAEJ;AAMA,SAASK,EAAoBC,GAA0B;AACrD,QAAM,CAACC,GAAeC,CAAgB,IAAIC,EAASH,CAAW,GAExDI,IAAwBC,EAAY,CAACC,GAAmBC,MAAsB;AAClF,IAAAL,EAAiB,CAAAM,MAAQ;AACvB,YAAMC,IAAO,IAAI,IAAID,CAAI;AACzB,aAAID,IACFE,EAAK,IAAIH,EAAK,IAAI,IAElBG,EAAK,OAAOH,EAAK,IAAI,GAEhBG;AAAA,IACT,CAAC;AAAA,EACH,GAAG,CAAA,CAAE,GAECC,IAAkBL,EAAY,CAACE,GAAmBI,MAAgC;AACtF,IAAAT,EAAiB,CAAAM,MAAQ;AACvB,YAAMC,IAAO,IAAI,IAAID,CAAI;AACzB,iBAAWF,KAAQK;AACjB,QAAIJ,IAAUE,EAAK,IAAIH,EAAK,IAAI,IAC3BG,EAAK,OAAOH,EAAK,IAAI;AAE5B,aAAOG;AAAA,IACT,CAAC;AAAA,EACH,GAAG,CAAA,CAAE;AAEL,SAAO,EAAE,eAAAR,GAAe,uBAAAG,GAAuB,iBAAAM,EAAA;AACjD;AAEA,SAASE,EACPC,GACAC,GACAC,GACA;AACA,EAAKA,KACLF,EAAY;AAAA,IACVG,EAA8BF,GAAW,EAAE;AAAA,IAC3C,OACEN,IACI,EAAE,GAAGA,GAAM,kBAAkBO,MAC5B;AAAA,EAAA;AAEX;AAEA,SAASjB,EAAW,E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C;AAAA,IACAC,EAAO;AAAA,IACPd;AAAA,IACAY;AAAA,IACAO;AAAA,EAAA,CACD,GAEKmB,IAAalC,EAAY,MAAM;AACnC,IAAAe,EAAQkB,EAAgB,MAAM;AAAA,EAChC,GAAG,CAAClB,CAAO,CAAC;AAEZ,SACE,gBAAAxB;AAAA,IAAC4C;AAAA,IAAA;AAAA,MACC,UAAAd;AAAA,MACA,sBAAsBzB;AAAA,MACtB,mBAAmBG;AAAA,MACnB,aAAaM;AAAA,MACb,YAAYwB;AAAA,MACZ,QAAQK;AAAA,MACR,WAAAP;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
1
|
+
{"version":3,"file":"HolidaySelectionForm.js","sources":["../../../../src/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.tsx"],"sourcesContent":["import { useCallback, useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { useHolidayPayPoliciesCreateMutation } from '@gusto/embedded-api-v-2026-02-01/react-query/holidayPayPoliciesCreate'\nimport {\n useHolidayPayPoliciesGetSuspense,\n queryKeyHolidayPayPoliciesGet,\n invalidateAllHolidayPayPoliciesGet,\n type HolidayPayPoliciesGetQueryData,\n} from '@gusto/embedded-api-v-2026-02-01/react-query/holidayPayPoliciesGet'\nimport { useHolidayPayPoliciesUpdateMutation } from '@gusto/embedded-api-v-2026-02-01/react-query/holidayPayPoliciesUpdate'\nimport type { HolidayPayPolicy } from '@gusto/embedded-api-v-2026-02-01/models/components/holidaypaypolicy'\nimport {\n getDefaultHolidayItems,\n buildFederalHolidaysPayload,\n FEDERAL_HOLIDAY_KEYS,\n} from '../shared/holidayHelpers'\nimport { HolidaySelectionFormPresentation } from './HolidaySelectionFormPresentation'\nimport type { HolidayItem } from './HolidaySelectionFormTypes'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { componentEvents } from '@/shared/constants'\nimport { useI18n } from '@/i18n'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\n\n/**\n * Props for {@link HolidaySelectionForm}.\n *\n * @public\n */\nexport interface HolidaySelectionFormProps extends BaseComponentInterface<'Company.TimeOff.HolidayPolicy'> {\n /** The associated company identifier. */\n companyId: string\n /** Whether to create a new holiday policy or edit the existing one. Defaults to `'create'`. */\n mode?: 'create' | 'edit'\n}\n\n/**\n * Lets a user select which US federal holidays are observed by the company's holiday pay policy.\n *\n * In `'create'` mode, submitting creates a new holiday pay policy. In `'edit'` mode, the form\n * is pre-populated with the existing policy's selections and submitting updates it. All 11 US\n * federal holidays are shown with their observed and next-observation dates; in create mode they\n * are all selected by default.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `timeOff/holidaySelection/done` | Holidays were saved in create mode | — |\n * | `timeOff/holidaySelection/editDone` | Holidays were saved in edit mode | — |\n * | `CANCEL` | The user backed out of the form | — |\n *\n * @param props - See {@link HolidaySelectionFormProps}.\n * @returns The rendered holiday selection form.\n * @public\n */\nexport function HolidaySelectionForm(props: HolidaySelectionFormProps) {\n return (\n <BaseComponent {...props}>\n {props.mode === 'edit' ? (\n <EditRoot companyId={props.companyId} />\n ) : (\n <CreateRoot companyId={props.companyId} />\n )}\n </BaseComponent>\n )\n}\n\ninterface RootProps {\n companyId: string\n}\n\nfunction useHolidaySelection(initialKeys: Set<string>) {\n const [selectedUuids, setSelectedUuids] = useState(initialKeys)\n\n const handleSelectionChange = useCallback((item: HolidayItem, selected: boolean) => {\n setSelectedUuids(prev => {\n const next = new Set(prev)\n if (selected) {\n next.add(item.uuid)\n } else {\n next.delete(item.uuid)\n }\n return next\n })\n }, [])\n\n const handleSelectAll = useCallback((selected: boolean, visibleItems: HolidayItem[]) => {\n setSelectedUuids(prev => {\n const next = new Set(prev)\n for (const item of visibleItems) {\n if (selected) next.add(item.uuid)\n else next.delete(item.uuid)\n }\n return next\n })\n }, [])\n\n return { selectedUuids, handleSelectionChange, handleSelectAll }\n}\n\nfunction seedPolicyCache(\n queryClient: ReturnType<typeof useQueryClient>,\n companyId: string,\n policy: HolidayPayPolicy | undefined,\n) {\n if (!policy) return\n queryClient.setQueryData<HolidayPayPoliciesGetQueryData>(\n queryKeyHolidayPayPoliciesGet(companyId, {}),\n prev =>\n prev\n ? { ...prev, holidayPayPolicy: policy }\n : (undefined as unknown as HolidayPayPoliciesGetQueryData),\n )\n}\n\nfunction CreateRoot({ companyId }: RootProps) {\n useI18n('Company.TimeOff.HolidayPolicy')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n const { onEvent, baseSubmitHandler } = useBase()\n const { locale } = useLocale()\n const queryClient = useQueryClient()\n\n const holidays = useMemo(() => getDefaultHolidayItems(t, undefined, locale), [t, locale])\n const allKeys = useMemo(() => new Set(FEDERAL_HOLIDAY_KEYS), [])\n const { selectedUuids, handleSelectionChange, handleSelectAll } = useHolidaySelection(allKeys)\n\n const { mutateAsync: createPolicy, isPending } = useHolidayPayPoliciesCreateMutation()\n\n const handleContinue = useCallback(async () => {\n await baseSubmitHandler({}, async () => {\n const response = await createPolicy({\n request: {\n companyUuid: companyId,\n holidayPayPolicyRequest: {\n federalHolidays: buildFederalHolidaysPayload(selectedUuids),\n },\n },\n })\n // Seed the GET cache so the next mount of SelectEmployeesHoliday's\n // StandaloneLoader (in addEmployeesHoliday state) reads the freshly\n // created policy instead of a stale `{ holidayPayPolicy: undefined }`\n // left over from PolicyList's pre-create GET.\n seedPolicyCache(queryClient, companyId, response.holidayPayPolicy)\n await invalidateAllHolidayPayPoliciesGet(queryClient)\n onEvent(componentEvents.TIME_OFF_HOLIDAY_SELECTION_DONE)\n })\n }, [baseSubmitHandler, createPolicy, companyId, selectedUuids, queryClient, onEvent])\n\n const handleBack = useCallback(() => {\n onEvent(componentEvents.CANCEL)\n }, [onEvent])\n\n return (\n <HolidaySelectionFormPresentation\n holidays={holidays}\n selectedHolidayUuids={selectedUuids}\n onSelectionChange={handleSelectionChange}\n onSelectAll={handleSelectAll}\n onContinue={handleContinue}\n onBack={handleBack}\n isPending={isPending}\n />\n )\n}\n\nfunction EditRoot({ companyId }: RootProps) {\n useI18n('Company.TimeOff.HolidayPolicy')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n const { onEvent, baseSubmitHandler } = useBase()\n const { locale } = useLocale()\n const queryClient = useQueryClient()\n\n const { data } = useHolidayPayPoliciesGetSuspense({ companyUuid: companyId })\n const policy = data.holidayPayPolicy!\n\n const holidays = useMemo(() => getDefaultHolidayItems(t, undefined, locale), [t, locale])\n\n const initialSelected = useMemo(() => {\n const next = new Set<string>()\n const federal = policy.federalHolidays\n for (const key of FEDERAL_HOLIDAY_KEYS) {\n const entry = federal[key as keyof typeof federal]\n if (entry?.selected === true) {\n next.add(key)\n }\n }\n return next\n }, [policy.federalHolidays])\n\n const { selectedUuids, handleSelectionChange, handleSelectAll } =\n useHolidaySelection(initialSelected)\n\n const { mutateAsync: updatePolicy, isPending } = useHolidayPayPoliciesUpdateMutation()\n\n const handleContinue = useCallback(async () => {\n await baseSubmitHandler({}, async () => {\n const response = await updatePolicy({\n request: {\n companyUuid: companyId,\n requestBody: {\n version: policy.version!,\n federalHolidays: buildFederalHolidaysPayload(selectedUuids),\n },\n },\n })\n seedPolicyCache(queryClient, companyId, response.holidayPayPolicy)\n await invalidateAllHolidayPayPoliciesGet(queryClient)\n onEvent(componentEvents.TIME_OFF_HOLIDAY_SELECTION_EDIT_DONE)\n })\n }, [\n baseSubmitHandler,\n updatePolicy,\n companyId,\n policy.version,\n selectedUuids,\n queryClient,\n onEvent,\n ])\n\n const handleBack = useCallback(() => {\n onEvent(componentEvents.CANCEL)\n }, [onEvent])\n\n return (\n <HolidaySelectionFormPresentation\n holidays={holidays}\n selectedHolidayUuids={selectedUuids}\n onSelectionChange={handleSelectionChange}\n onSelectAll={handleSelectAll}\n onContinue={handleContinue}\n onBack={handleBack}\n isPending={isPending}\n />\n )\n}\n"],"names":["HolidaySelectionForm","props","BaseComponent","jsx","EditRoot","CreateRoot","useHolidaySelection","initialKeys","selectedUuids","setSelectedUuids","useState","handleSelectionChange","useCallback","item","selected","prev","next","handleSelectAll","visibleItems","seedPolicyCache","queryClient","companyId","policy","queryKeyHolidayPayPoliciesGet","useI18n","t","useTranslation","onEvent","baseSubmitHandler","useBase","locale","useLocale","useQueryClient","holidays","useMemo","getDefaultHolidayItems","allKeys","FEDERAL_HOLIDAY_KEYS","createPolicy","isPending","useHolidayPayPoliciesCreateMutation","handleContinue","response","buildFederalHolidaysPayload","invalidateAllHolidayPayPoliciesGet","componentEvents","handleBack","HolidaySelectionFormPresentation","data","useHolidayPayPoliciesGetSuspense","initialSelected","federal","key","updatePolicy","useHolidayPayPoliciesUpdateMutation"],"mappings":";;;;;;;;;;;;;;AAwDO,SAASA,GAAqBC,GAAkC;AACrE,2BACGC,GAAA,EAAe,GAAGD,GAChB,UAAAA,EAAM,SAAS,SACd,gBAAAE,EAACC,GAAA,EAAS,WAAWH,EAAM,WAAW,IAEtC,gBAAAE,EAACE,KAAW,WAAWJ,EAAM,WAAW,GAE5C;AAEJ;AAMA,SAASK,EAAoBC,GAA0B;AACrD,QAAM,CAACC,GAAeC,CAAgB,IAAIC,EAASH,CAAW,GAExDI,IAAwBC,EAAY,CAACC,GAAmBC,MAAsB;AAClF,IAAAL,EAAiB,CAAAM,MAAQ;AACvB,YAAMC,IAAO,IAAI,IAAID,CAAI;AACzB,aAAID,IACFE,EAAK,IAAIH,EAAK,IAAI,IAElBG,EAAK,OAAOH,EAAK,IAAI,GAEhBG;AAAA,IACT,CAAC;AAAA,EACH,GAAG,CAAA,CAAE,GAECC,IAAkBL,EAAY,CAACE,GAAmBI,MAAgC;AACtF,IAAAT,EAAiB,CAAAM,MAAQ;AACvB,YAAMC,IAAO,IAAI,IAAID,CAAI;AACzB,iBAAWF,KAAQK;AACjB,QAAIJ,IAAUE,EAAK,IAAIH,EAAK,IAAI,IAC3BG,EAAK,OAAOH,EAAK,IAAI;AAE5B,aAAOG;AAAA,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