@gusto/embedded-react-sdk 0.37.0-rc.1 → 0.37.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -8
- package/README.md +6 -0
- package/dist/UNSTABLE_Hooks.d.ts +1 -1
- package/dist/UNSTABLE_Hooks.js +50 -6
- package/dist/UNSTABLE_Hooks.js.map +1 -1
- package/dist/components/Base/Base.d.ts +2 -1
- package/dist/components/Base/Base.js +76 -76
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/createCompoundContext.js.map +1 -1
- package/dist/components/Common/DataView/DataCards/DataCards.js +42 -36
- package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
- package/dist/components/Common/Fields/CheckboxField/CheckboxField.d.ts +2 -0
- package/dist/components/Common/Fields/CheckboxField/CheckboxField.js +22 -19
- package/dist/components/Common/Fields/CheckboxField/CheckboxField.js.map +1 -1
- package/dist/components/Common/Fields/CheckboxGroupField/CheckboxGroupField.d.ts +1 -1
- package/dist/components/Common/Fields/CheckboxGroupField/CheckboxGroupField.js +32 -30
- package/dist/components/Common/Fields/CheckboxGroupField/CheckboxGroupField.js.map +1 -1
- package/dist/components/Common/Fields/ComboBoxField/ComboBoxField.d.ts +1 -1
- package/dist/components/Common/Fields/ComboBoxField/ComboBoxField.js +36 -34
- package/dist/components/Common/Fields/ComboBoxField/ComboBoxField.js.map +1 -1
- package/dist/components/Common/Fields/DatePickerField/DatePickerField.d.ts +5 -3
- package/dist/components/Common/Fields/DatePickerField/DatePickerField.js +52 -40
- package/dist/components/Common/Fields/DatePickerField/DatePickerField.js.map +1 -1
- package/dist/components/Common/Fields/FileInputField/FileInputField.js +24 -22
- package/dist/components/Common/Fields/FileInputField/FileInputField.js.map +1 -1
- package/dist/components/Common/Fields/MultiSelectComboBoxField/MultiSelectComboBoxField.js +24 -22
- package/dist/components/Common/Fields/MultiSelectComboBoxField/MultiSelectComboBoxField.js.map +1 -1
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.d.ts +2 -0
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.js +31 -28
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.js.map +1 -1
- package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.d.ts +3 -1
- package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js +30 -27
- package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js.map +1 -1
- package/dist/components/Common/Fields/SelectField/SelectField.d.ts +3 -1
- package/dist/components/Common/Fields/SelectField/SelectField.js +31 -28
- package/dist/components/Common/Fields/SelectField/SelectField.js.map +1 -1
- package/dist/components/Common/Fields/SwitchField/SwitchField.d.ts +2 -0
- package/dist/components/Common/Fields/SwitchField/SwitchField.js +24 -21
- package/dist/components/Common/Fields/SwitchField/SwitchField.js.map +1 -1
- package/dist/components/Common/Fields/TextAreaField/TextAreaField.js +24 -22
- package/dist/components/Common/Fields/TextAreaField/TextAreaField.js.map +1 -1
- package/dist/components/Common/Fields/TextInputField/TextInputField.d.ts +2 -0
- package/dist/components/Common/Fields/TextInputField/TextInputField.js +26 -23
- package/dist/components/Common/Fields/TextInputField/TextInputField.js.map +1 -1
- package/dist/components/Common/Fields/hooks/useField.d.ts +3 -2
- package/dist/components/Common/Fields/hooks/useField.js +37 -33
- package/dist/components/Common/Fields/hooks/useField.js.map +1 -1
- package/dist/components/Common/ReorderableList/ReorderableList.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +10 -15
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +10 -14
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +14 -19
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Common/UI/Button/Button.js +33 -29
- package/dist/components/Common/UI/Button/Button.js.map +1 -1
- package/dist/components/Common/UI/Button/Button.module.scss.js +5 -3
- package/dist/components/Common/UI/Button/Button.module.scss.js.map +1 -1
- package/dist/components/Common/UI/Button/ButtonTypes.d.ts +4 -0
- package/dist/components/Common/UI/Button/ButtonTypes.js.map +1 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +2 -2
- package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.js +94 -80
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.js.map +1 -1
- package/dist/components/Common/UI/NumberInput/NumberInput.js +1 -1
- package/dist/components/Common/UI/NumberInput/NumberInput.js.map +1 -1
- package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +7 -11
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -10
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -11
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +6 -9
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +15 -17
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +8 -7
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -9
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +5 -8
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +13 -15
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +8 -7
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +2 -5
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +10 -9
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -11
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +9 -13
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +8 -7
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +10 -13
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +12 -15
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -8
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -8
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +11 -15
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +8 -7
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +11 -15
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +8 -7
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +8 -11
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +15 -19
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +6 -8
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +13 -12
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +8 -11
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +11 -10
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +10 -14
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +8 -11
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +5 -8
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +15 -19
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +8 -7
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +6 -9
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +17 -19
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +6 -10
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +8 -7
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +12 -15
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +9 -12
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +6 -10
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +8 -7
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +3 -6
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +10 -13
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +23 -24
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +11 -14
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +19 -21
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +10 -9
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +5 -8
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +8 -7
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -9
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +5 -8
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +8 -7
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +3 -7
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +9 -12
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +10 -9
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +29 -30
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +2 -3
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +10 -14
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -5
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +12 -14
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +12 -13
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +18 -21
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +3 -4
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +17 -19
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +6 -8
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +2 -4
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +2 -5
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
- package/dist/components/Contractor/Profile/useContractorProfile.js +11 -8
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +20 -22
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +12 -14
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +27 -28
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +23 -25
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +55 -49
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +14 -13
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +14 -13
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +18 -19
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +6 -8
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +6 -9
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +10 -14
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -6
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +8 -7
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +24 -26
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +9 -11
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +11 -15
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +8 -7
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +6 -9
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +6 -9
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +3 -7
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +5 -8
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +16 -17
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +8 -7
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Actions.js +7 -10
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +10 -13
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +8 -7
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +14 -15
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/Actions.js +8 -11
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +5 -8
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +9 -10
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +7 -10
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +9 -10
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +10 -9
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/Actions.js +8 -11
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +14 -17
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.d.ts +3 -3
- package/dist/components/Employee/Profile/HomeAddress.js +45 -45
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +15 -19
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +8 -7
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/Actions.js +8 -11
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +8 -7
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +8 -11
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +10 -13
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +8 -7
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +14 -17
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.d.ts +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +37 -33
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.d.ts +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js +57 -45
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +8 -11
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -1
- package/dist/components/Flow/Flow.js +20 -23
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +16 -18
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +18 -20
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +3 -4
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +8 -10
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalFlow.js +14 -14
- package/dist/components/Payroll/Dismissal/DismissalFlow.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.d.ts +2 -2
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js +8 -8
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.d.ts +2 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js +61 -57
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +8 -11
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.d.ts +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +88 -75
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.module.scss.js +6 -6
- package/dist/components/Payroll/GrossUpModal/GrossUpModalTypes.d.ts +0 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlow.d.ts +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js +24 -18
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.d.ts +2 -0
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +30 -31
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +56 -53
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +30 -32
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +18 -26
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js +2 -2
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +6 -9
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +12 -14
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +11 -14
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +12 -12
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +66 -67
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +20 -21
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +222 -216
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +19 -21
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js +13 -6
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +31 -33
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +44 -40
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +15 -17
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +15 -15
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +58 -59
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +7 -10
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +2 -3
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +2 -4
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +11 -13
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +2 -5
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +12 -14
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/helpers.d.ts +4 -0
- package/dist/components/Payroll/helpers.js +21 -16
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +4 -4
- package/dist/components/UNSTABLE_Hooks/collectErrors.d.ts +6 -0
- package/dist/components/UNSTABLE_Hooks/collectErrors.js +9 -0
- package/dist/components/UNSTABLE_Hooks/collectErrors.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.d.ts +2 -2
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js +6 -9
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.d.ts +2 -2
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js +13 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.d.ts +11 -6
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js +24 -0
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.d.ts +26 -0
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.js +24 -0
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.d.ts +53 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js +34 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.test.d.ts +1 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.d.ts +1 -1
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js +14 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.d.ts +11 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js +34 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.d.ts +11 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js +34 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.d.ts +14 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js +40 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.d.ts +12 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js +40 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.d.ts +12 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js +40 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.d.ts +11 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js +34 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.d.ts +13 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js +38 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/index.d.ts +15 -0
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.d.ts +2 -0
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.js +8 -0
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.d.ts +18 -0
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.js +10 -0
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.test.d.ts +1 -0
- package/dist/components/UNSTABLE_Hooks/form/index.d.ts +8 -1
- package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.d.ts +4 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.js +13 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.d.ts +6 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.js +14 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/types.d.ts +12 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.d.ts +2 -1
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js +11 -9
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.d.ts +2 -2
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js +2 -3
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/useHookFieldResolution.d.ts +23 -0
- package/dist/components/UNSTABLE_Hooks/form/useHookFieldResolution.js +11 -0
- package/dist/components/UNSTABLE_Hooks/form/useHookFieldResolution.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/withOptions.js +7 -0
- package/dist/components/UNSTABLE_Hooks/form/withOptions.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js +149 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.d.ts +97 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js +121 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.d.ts +34 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.js +50 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/index.d.ts +5 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.d.ts +97 -9
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js +255 -3
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js +112 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.d.ts +39 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js +45 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.d.ts +23 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.js +46 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/index.d.ts +7 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +77 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js +153 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js +69 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.d.ts +10 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.js +14 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/index.d.ts +7 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.d.ts +68 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js +129 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.d.ts +25 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js +24 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/index.d.ts +8 -4
- package/dist/components/UNSTABLE_Hooks/types.d.ts +9 -6
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.js +12 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.test.d.ts +1 -0
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +10 -13
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.d.ts +10 -2
- package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.js.map +1 -1
- package/dist/contexts/ThemeProvider/useTheme.js.map +1 -1
- package/dist/helpers/requiredIf.d.ts +13 -0
- package/dist/helpers/requiredIf.js +8 -0
- package/dist/helpers/requiredIf.js.map +1 -0
- package/dist/i18n/I18n.js +12 -12
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js +26 -0
- package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js.map +1 -0
- package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js +24 -0
- package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js.map +1 -0
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js +32 -0
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js.map +1 -0
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicyDetails.json.js +52 -0
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicyDetails.json.js.map +1 -0
- package/dist/i18n/en/Company.TimeOff.TimeOffRequests.json.js +21 -0
- package/dist/i18n/en/Company.TimeOff.TimeOffRequests.json.js.map +1 -0
- package/dist/i18n/en/Payroll.GrossUpModal.json.js +16 -14
- package/dist/i18n/en/Payroll.GrossUpModal.json.js.map +1 -1
- package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js +5 -5
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +29 -25
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
- package/dist/i18n/en/UNSTABLE.CompensationForm.json.js +58 -0
- package/dist/i18n/en/UNSTABLE.CompensationForm.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js +34 -0
- package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js +24 -0
- package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js.map +1 -0
- package/dist/models/WA_RISK_CODES.d.ts +5 -2866
- package/dist/models/WA_RISK_CODES.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +545 -1
- package/dist/types/sdkError.d.ts +7 -1
- package/dist/types/sdkError.js.map +1 -1
- package/docs/reference/endpoint-inventory.json +92 -0
- package/package.json +12 -12
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { SelectHookField as n } from "../../form/fields/SelectHookField.js";
|
|
3
|
+
import { RadioGroupHookField as o } from "../../form/fields/RadioGroupHookField.js";
|
|
4
|
+
import { CheckboxHookField as r } from "../../form/fields/CheckboxHookField.js";
|
|
5
|
+
import { NumberInputHookField as i } from "../../form/fields/NumberInputHookField.js";
|
|
6
|
+
import { TextInputHookField as a } from "../../form/fields/TextInputHookField.js";
|
|
7
|
+
import { DatePickerHookField as m } from "../../form/fields/DatePickerHookField.js";
|
|
8
|
+
function p(e) {
|
|
9
|
+
return /* @__PURE__ */ t(a, { ...e, name: "jobTitle" });
|
|
10
|
+
}
|
|
11
|
+
function k(e) {
|
|
12
|
+
return /* @__PURE__ */ t(n, { ...e, name: "flsaStatus" });
|
|
13
|
+
}
|
|
14
|
+
function S(e) {
|
|
15
|
+
return /* @__PURE__ */ t(i, { ...e, name: "rate", format: "currency", min: 0 });
|
|
16
|
+
}
|
|
17
|
+
function W(e) {
|
|
18
|
+
return /* @__PURE__ */ t(n, { ...e, name: "paymentUnit" });
|
|
19
|
+
}
|
|
20
|
+
function C(e) {
|
|
21
|
+
return /* @__PURE__ */ t(r, { ...e, name: "adjustForMinimumWage" });
|
|
22
|
+
}
|
|
23
|
+
function H(e) {
|
|
24
|
+
return /* @__PURE__ */ t(n, { ...e, name: "minimumWageId" });
|
|
25
|
+
}
|
|
26
|
+
function h(e) {
|
|
27
|
+
return /* @__PURE__ */ t(r, { ...e, name: "twoPercentShareholder" });
|
|
28
|
+
}
|
|
29
|
+
function b(e) {
|
|
30
|
+
return /* @__PURE__ */ t(o, { ...e, name: "stateWcCovered" });
|
|
31
|
+
}
|
|
32
|
+
function g(e) {
|
|
33
|
+
return /* @__PURE__ */ t(n, { ...e, name: "stateWcClassCode" });
|
|
34
|
+
}
|
|
35
|
+
function j(e) {
|
|
36
|
+
return /* @__PURE__ */ t(m, { ...e, name: "startDate" });
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
C as AdjustForMinimumWageField,
|
|
40
|
+
k as FlsaStatusField,
|
|
41
|
+
p as JobTitleField,
|
|
42
|
+
H as MinimumWageIdField,
|
|
43
|
+
W as PaymentUnitField,
|
|
44
|
+
S as RateField,
|
|
45
|
+
j as StartDateField,
|
|
46
|
+
g as StateWcClassCodeField,
|
|
47
|
+
b as StateWcCoveredField,
|
|
48
|
+
h as TwoPercentShareholderField
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.js","sources":["../../../../../src/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.tsx"],"sourcesContent":["import type { MinimumWage } from '@gusto/embedded-api/models/components/minimumwage'\nimport type { FlsaStatusType } from '@gusto/embedded-api/models/components/flsastatustype'\nimport type { PaymentUnit } from '@gusto/embedded-api/models/components/compensation'\nimport type { HookFieldProps } from '../../form/types'\nimport type { TextInputHookFieldProps } from '../../form/fields/TextInputHookField'\nimport type { SelectHookFieldProps } from '../../form/fields/SelectHookField'\nimport type { NumberInputHookFieldProps } from '../../form/fields/NumberInputHookField'\nimport type { CheckboxHookFieldProps } from '../../form/fields/CheckboxHookField'\nimport type { RadioGroupHookFieldProps } from '../../form/fields/RadioGroupHookField'\nimport type { DatePickerHookFieldProps } from '../../form/fields/DatePickerHookField'\nimport {\n TextInputHookField,\n SelectHookField,\n NumberInputHookField,\n CheckboxHookField,\n RadioGroupHookField,\n DatePickerHookField,\n} from '../../form/fields'\nimport type { CompensationErrorCodes } from './compensationSchema'\nimport type { WARiskClassCode } from '@/models/WA_RISK_CODES'\n\nexport type RequiredValidation = typeof CompensationErrorCodes.REQUIRED\nexport type RateValidation = (typeof CompensationErrorCodes)[\n | 'REQUIRED'\n | 'RATE_MINIMUM'\n | 'RATE_EXEMPT_THRESHOLD']\n\nexport type JobTitleFieldProps = HookFieldProps<TextInputHookFieldProps<RequiredValidation>>\n\nexport function JobTitleField(props: JobTitleFieldProps) {\n return <TextInputHookField {...props} name=\"jobTitle\" />\n}\n\nexport type FlsaStatusFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, FlsaStatusType>\n>\n\nexport function FlsaStatusField(props: FlsaStatusFieldProps) {\n return <SelectHookField {...props} name=\"flsaStatus\" />\n}\n\nexport type RateFieldProps = HookFieldProps<NumberInputHookFieldProps<RateValidation>>\n\nexport function RateField(props: RateFieldProps) {\n return <NumberInputHookField {...props} name=\"rate\" format=\"currency\" min={0} />\n}\n\nexport type PaymentUnitFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, PaymentUnit>\n>\n\nexport function PaymentUnitField(props: PaymentUnitFieldProps) {\n return <SelectHookField {...props} name=\"paymentUnit\" />\n}\n\nexport type AdjustForMinimumWageFieldProps = HookFieldProps<CheckboxHookFieldProps>\n\nexport function AdjustForMinimumWageField(props: AdjustForMinimumWageFieldProps) {\n return <CheckboxHookField {...props} name=\"adjustForMinimumWage\" />\n}\n\nexport type MinimumWageIdFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, MinimumWage>\n>\n\nexport function MinimumWageIdField(props: MinimumWageIdFieldProps) {\n return <SelectHookField {...props} name=\"minimumWageId\" />\n}\n\nexport type TwoPercentShareholderFieldProps = HookFieldProps<CheckboxHookFieldProps>\n\nexport function TwoPercentShareholderField(props: TwoPercentShareholderFieldProps) {\n return <CheckboxHookField {...props} name=\"twoPercentShareholder\" />\n}\n\nexport type StateWcCoveredFieldProps = HookFieldProps<RadioGroupHookFieldProps<never, string>>\n\nexport function StateWcCoveredField(props: StateWcCoveredFieldProps) {\n return <RadioGroupHookField {...props} name=\"stateWcCovered\" />\n}\n\nexport type StateWcClassCodeFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, WARiskClassCode>\n>\n\nexport function StateWcClassCodeField(props: StateWcClassCodeFieldProps) {\n return <SelectHookField {...props} name=\"stateWcClassCode\" />\n}\n\nexport type StartDateFieldProps = HookFieldProps<\n DatePickerHookFieldProps<typeof CompensationErrorCodes.REQUIRED>\n>\n\nexport function StartDateField(props: StartDateFieldProps) {\n return <DatePickerHookField {...props} name=\"startDate\" />\n}\n"],"names":["JobTitleField","props","jsx","TextInputHookField","FlsaStatusField","SelectHookField","RateField","NumberInputHookField","PaymentUnitField","AdjustForMinimumWageField","CheckboxHookField","MinimumWageIdField","TwoPercentShareholderField","StateWcCoveredField","RadioGroupHookField","StateWcClassCodeField","StartDateField","DatePickerHookField"],"mappings":";;;;;;;AA6BO,SAASA,EAAcC,GAA2B;AACvD,SAAO,gBAAAC,EAACC,GAAA,EAAoB,GAAGF,GAAO,MAAK,YAAW;AACxD;AAMO,SAASG,EAAgBH,GAA6B;AAC3D,SAAO,gBAAAC,EAACG,GAAA,EAAiB,GAAGJ,GAAO,MAAK,cAAa;AACvD;AAIO,SAASK,EAAUL,GAAuB;AAC/C,SAAO,gBAAAC,EAACK,KAAsB,GAAGN,GAAO,MAAK,QAAO,QAAO,YAAW,KAAK,EAAA,CAAG;AAChF;AAMO,SAASO,EAAiBP,GAA8B;AAC7D,SAAO,gBAAAC,EAACG,GAAA,EAAiB,GAAGJ,GAAO,MAAK,eAAc;AACxD;AAIO,SAASQ,EAA0BR,GAAuC;AAC/E,SAAO,gBAAAC,EAACQ,GAAA,EAAmB,GAAGT,GAAO,MAAK,wBAAuB;AACnE;AAMO,SAASU,EAAmBV,GAAgC;AACjE,SAAO,gBAAAC,EAACG,GAAA,EAAiB,GAAGJ,GAAO,MAAK,iBAAgB;AAC1D;AAIO,SAASW,EAA2BX,GAAwC;AACjF,SAAO,gBAAAC,EAACQ,GAAA,EAAmB,GAAGT,GAAO,MAAK,yBAAwB;AACpE;AAIO,SAASY,EAAoBZ,GAAiC;AACnE,SAAO,gBAAAC,EAACY,GAAA,EAAqB,GAAGb,GAAO,MAAK,kBAAiB;AAC/D;AAMO,SAASc,EAAsBd,GAAmC;AACvE,SAAO,gBAAAC,EAACG,GAAA,EAAiB,GAAGJ,GAAO,MAAK,oBAAmB;AAC7D;AAMO,SAASe,EAAef,GAA4B;AACzD,SAAO,gBAAAC,EAACe,GAAA,EAAqB,GAAGhB,GAAO,MAAK,aAAY;AAC1D;"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import "./types/i18next.d.ts"
|
|
2
2
|
export { useCompensationForm } from './useCompensationForm';
|
|
3
|
-
export type { UseCompensationFormProps, UseCompensationFormResult, UseCompensationFormReady, } from './useCompensationForm';
|
|
3
|
+
export type { CompensationSubmitCallbacks, CompensationSubmitOptions, CompensationRequiredFields, UseCompensationFormProps, UseCompensationFormResult, UseCompensationFormReady, CompensationFieldsMetadata, CompensationFormFields, } from './useCompensationForm';
|
|
4
|
+
export { CompensationForm } from './CompensationForm';
|
|
5
|
+
export type { CompensationFormProps } from './CompensationForm';
|
|
6
|
+
export { CompensationSchema, createCompensationSchema, CompensationErrorCodes, type CompensationErrorCode, type CompensationField, type CompensationFormData, type CompensationFormOutputs, } from './compensationSchema';
|
|
7
|
+
export type { RequiredValidation, RateValidation, StartDateFieldProps, JobTitleFieldProps, FlsaStatusFieldProps, RateFieldProps, PaymentUnitFieldProps, AdjustForMinimumWageFieldProps, MinimumWageIdFieldProps, TwoPercentShareholderFieldProps, StateWcCoveredFieldProps, StateWcClassCodeFieldProps, } from './fields';
|
|
@@ -1,16 +1,104 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { UseFormProps } from 'react-hook-form';
|
|
2
|
+
import { Compensation, PaymentUnit } from '@gusto/embedded-api/models/components/compensation';
|
|
3
|
+
import { Job } from '@gusto/embedded-api/models/components/job';
|
|
4
|
+
import { FlsaStatusType } from '@gusto/embedded-api/models/components/flsastatustype';
|
|
5
|
+
import { MinimumWage } from '@gusto/embedded-api/models/components/minimumwage';
|
|
6
|
+
import { HookSubmitResult } from '../../types';
|
|
7
|
+
import { RequiredFields } from '../../form/resolveRequiredFields';
|
|
8
|
+
import { CompensationField, CompensationFormData } from './compensationSchema';
|
|
9
|
+
import { JobTitleField, FlsaStatusField, RateField, PaymentUnitField, AdjustForMinimumWageField, MinimumWageIdField, TwoPercentShareholderField, StateWcCoveredField, StateWcClassCodeField, StartDateField } from './fields';
|
|
10
|
+
import { WARiskClassCode } from '../../../../models/WA_RISK_CODES';
|
|
11
|
+
export interface CompensationSubmitCallbacks {
|
|
12
|
+
onJobCreated?: (job: Job) => void;
|
|
13
|
+
onJobUpdated?: (job: Job) => void;
|
|
14
|
+
onCompensationUpdated?: (compensation: Compensation | undefined) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface CompensationSubmitOptions {
|
|
4
17
|
employeeId?: string;
|
|
5
18
|
startDate?: string;
|
|
6
19
|
}
|
|
7
|
-
export
|
|
20
|
+
export type CompensationRequiredFields = RequiredFields<CompensationField>;
|
|
21
|
+
export interface UseCompensationFormProps {
|
|
22
|
+
employeeId?: string;
|
|
23
|
+
withStartDateField?: boolean;
|
|
24
|
+
jobId?: string;
|
|
25
|
+
requiredFields?: CompensationRequiredFields;
|
|
26
|
+
defaultValues?: Partial<CompensationFormData>;
|
|
27
|
+
validationMode?: UseFormProps['mode'];
|
|
28
|
+
shouldFocusError?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare function useCompensationForm({ employeeId, withStartDateField, jobId, requiredFields, defaultValues: partnerDefaults, validationMode, shouldFocusError, }: UseCompensationFormProps): {
|
|
31
|
+
isLoading: true;
|
|
32
|
+
errorHandling: import('../..').HookErrorHandling;
|
|
33
|
+
data?: undefined;
|
|
34
|
+
status?: undefined;
|
|
35
|
+
actions?: undefined;
|
|
36
|
+
form?: undefined;
|
|
37
|
+
} | {
|
|
38
|
+
isLoading: false;
|
|
8
39
|
data: {
|
|
9
|
-
compensation: Compensation;
|
|
40
|
+
compensation: Compensation | null;
|
|
41
|
+
jobs: Job[] | undefined;
|
|
42
|
+
currentJob: Job | null;
|
|
43
|
+
minimumWages: MinimumWage[];
|
|
44
|
+
};
|
|
45
|
+
status: {
|
|
46
|
+
isPending: boolean;
|
|
47
|
+
mode: string;
|
|
10
48
|
};
|
|
11
49
|
actions: {
|
|
12
|
-
onSubmit: () => Promise<HookSubmitResult<Compensation> | undefined>;
|
|
50
|
+
onSubmit: (callbacks?: CompensationSubmitCallbacks, options?: CompensationSubmitOptions) => Promise<HookSubmitResult<Compensation | undefined> | undefined>;
|
|
13
51
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
52
|
+
errorHandling: import('../..').HookErrorHandling;
|
|
53
|
+
form: {
|
|
54
|
+
Fields: {
|
|
55
|
+
StartDate: typeof StartDateField | undefined;
|
|
56
|
+
JobTitle: typeof JobTitleField;
|
|
57
|
+
FlsaStatus: typeof FlsaStatusField | undefined;
|
|
58
|
+
Rate: typeof RateField;
|
|
59
|
+
PaymentUnit: typeof PaymentUnitField;
|
|
60
|
+
AdjustForMinimumWage: typeof AdjustForMinimumWageField | undefined;
|
|
61
|
+
MinimumWageId: typeof MinimumWageIdField | undefined;
|
|
62
|
+
TwoPercentShareholder: typeof TwoPercentShareholderField | undefined;
|
|
63
|
+
StateWcCovered: typeof StateWcCoveredField | undefined;
|
|
64
|
+
StateWcClassCode: typeof StateWcClassCodeField | undefined;
|
|
65
|
+
};
|
|
66
|
+
fieldsMetadata: {
|
|
67
|
+
startDate: import('../..').FieldMetadata;
|
|
68
|
+
jobTitle: import('../..').FieldMetadata;
|
|
69
|
+
flsaStatus: import('../..').FieldMetadataWithOptions<FlsaStatusType>;
|
|
70
|
+
rate: {
|
|
71
|
+
isDisabled: boolean;
|
|
72
|
+
name: string;
|
|
73
|
+
isRequired?: boolean;
|
|
74
|
+
hasRedactedValue?: boolean;
|
|
75
|
+
};
|
|
76
|
+
paymentUnit: import('../..').FieldMetadataWithOptions<PaymentUnit>;
|
|
77
|
+
adjustForMinimumWage: {
|
|
78
|
+
isDisabled: boolean;
|
|
79
|
+
name: string;
|
|
80
|
+
isRequired?: boolean;
|
|
81
|
+
hasRedactedValue?: boolean;
|
|
82
|
+
};
|
|
83
|
+
minimumWageId: import('../..').FieldMetadataWithOptions<MinimumWage>;
|
|
84
|
+
twoPercentShareholder: {
|
|
85
|
+
isDisabled: boolean;
|
|
86
|
+
name: string;
|
|
87
|
+
isRequired?: boolean;
|
|
88
|
+
hasRedactedValue?: boolean;
|
|
89
|
+
};
|
|
90
|
+
stateWcCovered: import('../..').FieldMetadataWithOptions<string>;
|
|
91
|
+
stateWcClassCode: import('../..').FieldMetadataWithOptions<WARiskClassCode>;
|
|
92
|
+
};
|
|
93
|
+
hookFormInternals: {
|
|
94
|
+
formMethods: import('react-hook-form').UseFormReturn<CompensationFormData, unknown, CompensationFormData>;
|
|
95
|
+
};
|
|
96
|
+
getFormSubmissionValues: () => CompensationFormData | undefined;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
export type UseCompensationFormResult = ReturnType<typeof useCompensationForm>;
|
|
100
|
+
export type UseCompensationFormReady = Extract<UseCompensationFormResult, {
|
|
101
|
+
data: object;
|
|
102
|
+
}>;
|
|
103
|
+
export type CompensationFieldsMetadata = UseCompensationFormReady['form']['fieldsMetadata'];
|
|
104
|
+
export type CompensationFormFields = UseCompensationFormReady['form']['Fields'];
|
|
@@ -1,7 +1,259 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { useMemo as j, useEffect as Me } from "react";
|
|
2
|
+
import { useForm as ge, useWatch as I } from "react-hook-form";
|
|
3
|
+
import { zodResolver as Ee } from "@hookform/resolvers/zod";
|
|
4
|
+
import { useJobsAndCompensationsGetJobs as he } from "@gusto/embedded-api/react-query/jobsAndCompensationsGetJobs";
|
|
5
|
+
import { useJobsAndCompensationsCreateJobMutation as Oe } from "@gusto/embedded-api/react-query/jobsAndCompensationsCreateJob";
|
|
6
|
+
import { useJobsAndCompensationsUpdateMutation as Fe } from "@gusto/embedded-api/react-query/jobsAndCompensationsUpdate";
|
|
7
|
+
import { useJobsAndCompensationsUpdateCompensationMutation as Pe } from "@gusto/embedded-api/react-query/jobsAndCompensationsUpdateCompensation";
|
|
8
|
+
import { useLocationsGetMinimumWages as Ue } from "@gusto/embedded-api/react-query/locationsGetMinimumWages";
|
|
9
|
+
import { useEmployeeAddressesGetWorkAddresses as De } from "@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses";
|
|
10
|
+
import { useEmployeesGet as Te } from "@gusto/embedded-api/react-query/employeesGet";
|
|
11
|
+
import { useFederalTaxDetailsGet as Ae } from "@gusto/embedded-api/react-query/federalTaxDetailsGet";
|
|
12
|
+
import { useErrorHandling as Ne } from "../../useErrorHandling.js";
|
|
13
|
+
import { withOptions as f } from "../../form/withOptions.js";
|
|
14
|
+
import { deriveFieldsMetadata as we } from "../../form/deriveFieldsMetadata.js";
|
|
15
|
+
import { createGetFormSubmissionValues as je } from "../../form/getFormSubmissionValues.js";
|
|
16
|
+
import { createCompensationSchema as Ie } from "./compensationSchema.js";
|
|
17
|
+
import { StateWcClassCodeField as Le, StateWcCoveredField as Je, TwoPercentShareholderField as Re, MinimumWageIdField as _e, AdjustForMinimumWageField as qe, PaymentUnitField as Ve, RateField as Ye, FlsaStatusField as He, JobTitleField as Xe, StartDateField as ke } from "./fields.js";
|
|
18
|
+
import { PAY_PERIODS as u, FlsaStatus as s, TIP_CREDITS_UNSUPPORTED_STATES as xe } from "../../../../shared/constants.js";
|
|
19
|
+
import { useBaseSubmit as Ge } from "../../../Base/useBaseSubmit.js";
|
|
20
|
+
import { SDKInternalError as Z } from "../../../../types/sdkError.js";
|
|
21
|
+
import { WA_RISK_CLASS_CODES as ee } from "../../../../models/WA_RISK_CODES.js";
|
|
22
|
+
function Ke(e) {
|
|
23
|
+
return e?.compensations?.find((m) => m.uuid === e.currentCompensationUuid);
|
|
24
|
+
}
|
|
25
|
+
function Qe(e) {
|
|
26
|
+
return e.reduce((m, l) => {
|
|
27
|
+
const S = l.compensations?.find(
|
|
28
|
+
(c) => c.uuid === l.currentCompensationUuid
|
|
29
|
+
);
|
|
30
|
+
return !l.primary || !S ? m : S.flsaStatus ?? m;
|
|
31
|
+
}, void 0);
|
|
32
|
+
}
|
|
33
|
+
const te = Object.keys(s).map((e) => s[e]), $e = te.map((e) => ({
|
|
34
|
+
value: e,
|
|
35
|
+
label: e
|
|
36
|
+
})), oe = [
|
|
37
|
+
u.HOUR,
|
|
38
|
+
u.WEEK,
|
|
39
|
+
u.MONTH,
|
|
40
|
+
u.YEAR,
|
|
41
|
+
u.PAYCHECK
|
|
42
|
+
], Be = oe.map((e) => ({
|
|
43
|
+
value: e,
|
|
44
|
+
label: e
|
|
45
|
+
}));
|
|
46
|
+
function gt({
|
|
47
|
+
employeeId: e,
|
|
48
|
+
withStartDateField: m = !0,
|
|
49
|
+
jobId: l,
|
|
50
|
+
requiredFields: S,
|
|
51
|
+
defaultValues: c,
|
|
52
|
+
validationMode: ae = "onSubmit",
|
|
53
|
+
shouldFocusError: se = !0
|
|
54
|
+
}) {
|
|
55
|
+
const g = he(
|
|
56
|
+
{ employeeId: e ?? "" },
|
|
57
|
+
{ enabled: !!e }
|
|
58
|
+
), E = De(
|
|
59
|
+
{ employeeId: e ?? "" },
|
|
60
|
+
{ enabled: !!e }
|
|
61
|
+
), h = Te({ employeeId: e ?? "" }, { enabled: !!e }), n = g.data?.jobList, L = E.data?.employeeWorkAddressesList, O = L?.find((t) => t.active), J = O?.locationUuid, R = h.data?.employee, F = R?.companyUuid, P = Ue(
|
|
62
|
+
{ locationUuid: J ?? "" },
|
|
63
|
+
{ enabled: !!J }
|
|
64
|
+
), U = Ae(
|
|
65
|
+
{ companyId: F ?? "" },
|
|
66
|
+
{ enabled: !!F }
|
|
67
|
+
), W = P.data?.minimumWageList ?? [], _ = U.data?.federalTaxDetails, q = _?.taxPayerType === "S-Corporation", o = j(() => n ? l ? n.find((t) => t.uuid === l) ?? null : n.length === 1 ? n[0] ?? null : null : null, [n, l]), C = j(() => Ke(o), [o]), ne = j(() => {
|
|
68
|
+
if (n)
|
|
69
|
+
return Qe(n);
|
|
70
|
+
}, [n]), b = !o, D = Ie({
|
|
71
|
+
mode: b ? "create" : "update",
|
|
72
|
+
requiredFields: S,
|
|
73
|
+
withStartDateField: m
|
|
74
|
+
}), T = O?.state, ie = o?.hireDate, y = {
|
|
75
|
+
jobTitle: o?.title || c?.jobTitle || "",
|
|
76
|
+
flsaStatus: C?.flsaStatus ?? ne ?? c?.flsaStatus ?? s.NONEXEMPT,
|
|
77
|
+
rate: Number(C?.rate ?? c?.rate ?? 0),
|
|
78
|
+
adjustForMinimumWage: C?.adjustForMinimumWage ?? !1,
|
|
79
|
+
minimumWageId: C?.minimumWages?.[0]?.uuid ?? "",
|
|
80
|
+
paymentUnit: C?.paymentUnit ?? c?.paymentUnit ?? u.HOUR,
|
|
81
|
+
stateWcCovered: o?.stateWcCovered ?? !1,
|
|
82
|
+
stateWcClassCode: o?.stateWcClassCode ?? "",
|
|
83
|
+
twoPercentShareholder: o?.twoPercentShareholder ?? !1,
|
|
84
|
+
startDate: ie ?? c?.startDate ?? null
|
|
85
|
+
}, a = ge({
|
|
86
|
+
resolver: Ee(D),
|
|
87
|
+
mode: ae,
|
|
88
|
+
shouldFocusError: se,
|
|
89
|
+
defaultValues: y,
|
|
90
|
+
values: y,
|
|
91
|
+
resetOptions: { keepDirtyValues: !0 }
|
|
92
|
+
}), d = I({
|
|
93
|
+
control: a.control,
|
|
94
|
+
name: "flsaStatus"
|
|
95
|
+
}), re = I({
|
|
96
|
+
control: a.control,
|
|
97
|
+
name: "adjustForMinimumWage"
|
|
98
|
+
}), de = I({
|
|
99
|
+
control: a.control,
|
|
100
|
+
name: "stateWcCovered"
|
|
101
|
+
});
|
|
102
|
+
Me(() => {
|
|
103
|
+
d === s.OWNER ? a.setValue("paymentUnit", u.PAYCHECK) : d === s.COMMISSION_ONLY_NONEXEMPT || d === s.COMMISSION_ONLY_EXEMPT ? (a.setValue("paymentUnit", u.YEAR), a.setValue("rate", 0)) : a.setValue("paymentUnit", y.paymentUnit);
|
|
104
|
+
}, [d, a.setValue, y.paymentUnit]);
|
|
105
|
+
const V = Pe(), Y = Oe(), H = Fe(), me = V.isPending || Y.isPending || H.isPending, { baseSubmitHandler: ue, error: le, setError: ce } = Ge("CompensationForm"), X = Ne(e ? [g, E, h, P, U] : [], { error: le, setError: ce }), k = d === s.COMMISSION_ONLY_NONEXEMPT || d === s.COMMISSION_ONLY_EXEMPT, pe = d === s.OWNER, Ce = d !== s.NONEXEMPT || o?.primary === !0 || b, A = d === s.NONEXEMPT && W.length > 0 && T !== void 0 && !xe.includes(T), v = T === "WA", fe = W.map((t) => ({
|
|
106
|
+
value: t.uuid,
|
|
107
|
+
label: `${t.wage} - ${t.authority}: ${t.notes ?? ""}`
|
|
108
|
+
})), Se = ee.map(({ code: t, description: M }) => ({
|
|
109
|
+
value: t,
|
|
110
|
+
label: `${t}: ${M}`
|
|
111
|
+
})), i = we(D), We = {
|
|
112
|
+
startDate: i.startDate,
|
|
113
|
+
jobTitle: i.jobTitle,
|
|
114
|
+
flsaStatus: f(
|
|
115
|
+
i.flsaStatus,
|
|
116
|
+
$e,
|
|
117
|
+
te
|
|
118
|
+
),
|
|
119
|
+
rate: { ...i.rate, isDisabled: k },
|
|
120
|
+
paymentUnit: f(
|
|
121
|
+
{ ...i.paymentUnit, isDisabled: pe || k },
|
|
122
|
+
Be,
|
|
123
|
+
oe
|
|
124
|
+
),
|
|
125
|
+
adjustForMinimumWage: {
|
|
126
|
+
...i.adjustForMinimumWage,
|
|
127
|
+
isDisabled: !A
|
|
128
|
+
},
|
|
129
|
+
minimumWageId: f(
|
|
130
|
+
i.minimumWageId,
|
|
131
|
+
fe,
|
|
132
|
+
W
|
|
133
|
+
),
|
|
134
|
+
twoPercentShareholder: {
|
|
135
|
+
...i.twoPercentShareholder,
|
|
136
|
+
isDisabled: !q
|
|
137
|
+
},
|
|
138
|
+
stateWcCovered: f(
|
|
139
|
+
{ ...i.stateWcCovered, isDisabled: !v },
|
|
140
|
+
[
|
|
141
|
+
{ label: "Yes", value: "true" },
|
|
142
|
+
{ label: "No", value: "false" }
|
|
143
|
+
],
|
|
144
|
+
["yes", "no"]
|
|
145
|
+
),
|
|
146
|
+
stateWcClassCode: f(
|
|
147
|
+
{ ...i.stateWcClassCode, isDisabled: !v },
|
|
148
|
+
Se,
|
|
149
|
+
ee
|
|
150
|
+
)
|
|
151
|
+
}, be = async (t, M) => {
|
|
152
|
+
let x;
|
|
153
|
+
return await new Promise((G) => {
|
|
154
|
+
a.handleSubmit(
|
|
155
|
+
async (ye) => {
|
|
156
|
+
await ue(ye, async (ve) => {
|
|
157
|
+
const K = M?.employeeId ?? e;
|
|
158
|
+
if (!K)
|
|
159
|
+
throw new Z("employeeId is required to submit compensation");
|
|
160
|
+
const {
|
|
161
|
+
jobTitle: Q,
|
|
162
|
+
twoPercentShareholder: $,
|
|
163
|
+
startDate: B,
|
|
164
|
+
...r
|
|
165
|
+
} = ve, N = m && B ? B : M?.startDate;
|
|
166
|
+
let p;
|
|
167
|
+
if (o)
|
|
168
|
+
p = (await H.mutateAsync({
|
|
169
|
+
request: {
|
|
170
|
+
jobId: o.uuid,
|
|
171
|
+
requestBody: {
|
|
172
|
+
title: Q,
|
|
173
|
+
version: o.version,
|
|
174
|
+
hireDate: N,
|
|
175
|
+
stateWcClassCode: r.stateWcCovered ? r.stateWcClassCode : null,
|
|
176
|
+
stateWcCovered: r.stateWcCovered,
|
|
177
|
+
twoPercentShareholder: $ ?? !1
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
})).job, t?.onJobUpdated?.(p);
|
|
181
|
+
else {
|
|
182
|
+
if (!N)
|
|
183
|
+
throw new Z("Start date is required");
|
|
184
|
+
p = (await Y.mutateAsync({
|
|
185
|
+
request: {
|
|
186
|
+
employeeId: K,
|
|
187
|
+
requestBody: {
|
|
188
|
+
title: Q,
|
|
189
|
+
hireDate: N,
|
|
190
|
+
stateWcCovered: r.stateWcCovered,
|
|
191
|
+
stateWcClassCode: r.stateWcCovered ? r.stateWcClassCode : null,
|
|
192
|
+
twoPercentShareholder: $ ?? !1
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
})).job, t?.onJobCreated?.(p);
|
|
196
|
+
}
|
|
197
|
+
const { compensation: z } = await V.mutateAsync({
|
|
198
|
+
request: {
|
|
199
|
+
compensationId: p.currentCompensationUuid,
|
|
200
|
+
compensationsUpdateRequestBody: {
|
|
201
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
|
202
|
+
version: p.compensations?.find(
|
|
203
|
+
(w) => w.uuid === p.currentCompensationUuid
|
|
204
|
+
)?.version,
|
|
205
|
+
...r,
|
|
206
|
+
rate: String(r.rate),
|
|
207
|
+
minimumWages: r.adjustForMinimumWage ? [{ uuid: r.minimumWageId }] : []
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
t?.onCompensationUpdated?.(z), x = {
|
|
212
|
+
mode: b ? "create" : "update",
|
|
213
|
+
data: z
|
|
214
|
+
};
|
|
215
|
+
}), G();
|
|
216
|
+
},
|
|
217
|
+
() => {
|
|
218
|
+
G();
|
|
219
|
+
}
|
|
220
|
+
)();
|
|
221
|
+
}), x;
|
|
222
|
+
};
|
|
223
|
+
return (e ? g.isLoading || E.isLoading || h.isLoading || P.isLoading || U.isLoading : !1) || e && (!n || !L || !O || !R || !F || !_) ? { isLoading: !0, errorHandling: X } : {
|
|
224
|
+
isLoading: !1,
|
|
225
|
+
data: {
|
|
226
|
+
compensation: C ?? null,
|
|
227
|
+
jobs: n,
|
|
228
|
+
currentJob: o,
|
|
229
|
+
minimumWages: W
|
|
230
|
+
},
|
|
231
|
+
status: {
|
|
232
|
+
isPending: me,
|
|
233
|
+
mode: b ? "create" : "update"
|
|
234
|
+
},
|
|
235
|
+
actions: { onSubmit: be },
|
|
236
|
+
errorHandling: X,
|
|
237
|
+
form: {
|
|
238
|
+
Fields: {
|
|
239
|
+
StartDate: m ? ke : void 0,
|
|
240
|
+
JobTitle: Xe,
|
|
241
|
+
FlsaStatus: Ce ? He : void 0,
|
|
242
|
+
Rate: Ye,
|
|
243
|
+
PaymentUnit: Ve,
|
|
244
|
+
AdjustForMinimumWage: A ? qe : void 0,
|
|
245
|
+
MinimumWageId: A && re ? _e : void 0,
|
|
246
|
+
TwoPercentShareholder: q ? Re : void 0,
|
|
247
|
+
StateWcCovered: v ? Je : void 0,
|
|
248
|
+
StateWcClassCode: v && de ? Le : void 0
|
|
249
|
+
},
|
|
250
|
+
fieldsMetadata: We,
|
|
251
|
+
hookFormInternals: { formMethods: a },
|
|
252
|
+
getFormSubmissionValues: je(a, D)
|
|
253
|
+
}
|
|
254
|
+
};
|
|
3
255
|
}
|
|
4
256
|
export {
|
|
5
|
-
|
|
257
|
+
gt as useCompensationForm
|
|
6
258
|
};
|
|
7
259
|
//# sourceMappingURL=useCompensationForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCompensationForm.js","sources":["../../../../../src/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.ts"],"sourcesContent":["import type { Compensation } from '@gusto/embedded-api/models/components/compensation'\nimport type { HookLoadingResult, HookSubmitResult, BaseFormHookReady } from '../../types'\n\nexport interface UseCompensationFormProps {\n employeeId?: string\n startDate?: string\n}\n\nexport interface UseCompensationFormReady extends BaseFormHookReady {\n data: { compensation: Compensation }\n actions: { onSubmit: () => Promise<HookSubmitResult<Compensation> | undefined> }\n}\n\nexport type UseCompensationFormResult = HookLoadingResult | UseCompensationFormReady\n\nexport function useCompensationForm(props: UseCompensationFormProps): UseCompensationFormResult {\n throw new Error('useCompensationForm is not yet implemented')\n}\n"],"names":["useCompensationForm","props"],"mappings":"AAeO,SAASA,EAAoBC,GAA4D;AAC9F,QAAM,IAAI,MAAM,4CAA4C;AAC9D;"}
|
|
1
|
+
{"version":3,"file":"useCompensationForm.js","sources":["../../../../../src/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.tsx"],"sourcesContent":["import { useEffect, useMemo } from 'react'\nimport { useForm, useWatch } from 'react-hook-form'\nimport type { Resolver, UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport type { Compensation, PaymentUnit } from '@gusto/embedded-api/models/components/compensation'\nimport type { Job } from '@gusto/embedded-api/models/components/job'\nimport type { FlsaStatusType } from '@gusto/embedded-api/models/components/flsastatustype'\nimport type { MinimumWage } from '@gusto/embedded-api/models/components/minimumwage'\nimport { useJobsAndCompensationsGetJobs } from '@gusto/embedded-api/react-query/jobsAndCompensationsGetJobs'\nimport { useJobsAndCompensationsCreateJobMutation } from '@gusto/embedded-api/react-query/jobsAndCompensationsCreateJob'\nimport { useJobsAndCompensationsUpdateMutation } from '@gusto/embedded-api/react-query/jobsAndCompensationsUpdate'\nimport { useJobsAndCompensationsUpdateCompensationMutation } from '@gusto/embedded-api/react-query/jobsAndCompensationsUpdateCompensation'\nimport { useLocationsGetMinimumWages } from '@gusto/embedded-api/react-query/locationsGetMinimumWages'\nimport { useEmployeeAddressesGetWorkAddresses } from '@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses'\nimport { useEmployeesGet } from '@gusto/embedded-api/react-query/employeesGet'\nimport { useFederalTaxDetailsGet } from '@gusto/embedded-api/react-query/federalTaxDetailsGet'\nimport type { HookSubmitResult } from '../../types'\nimport { useErrorHandling } from '../../useErrorHandling'\nimport { withOptions } from '../../form/withOptions'\nimport { deriveFieldsMetadata } from '../../form/deriveFieldsMetadata'\nimport { createGetFormSubmissionValues } from '../../form/getFormSubmissionValues'\nimport type { RequiredFields } from '../../form/resolveRequiredFields'\nimport {\n createCompensationSchema,\n type CompensationField,\n type CompensationFormData,\n type CompensationFormOutputs,\n} from './compensationSchema'\nimport {\n JobTitleField,\n FlsaStatusField,\n RateField,\n PaymentUnitField,\n AdjustForMinimumWageField,\n MinimumWageIdField,\n TwoPercentShareholderField,\n StateWcCoveredField,\n StateWcClassCodeField,\n StartDateField,\n} from './fields'\nimport { FlsaStatus, PAY_PERIODS, TIP_CREDITS_UNSUPPORTED_STATES } from '@/shared/constants'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { SDKInternalError } from '@/types/sdkError'\nimport { WA_RISK_CLASS_CODES, type WARiskClassCode } from '@/models/WA_RISK_CODES'\n\nexport interface CompensationSubmitCallbacks {\n onJobCreated?: (job: Job) => void\n onJobUpdated?: (job: Job) => void\n onCompensationUpdated?: (compensation: Compensation | undefined) => void\n}\n\nexport interface CompensationSubmitOptions {\n employeeId?: string\n startDate?: string\n}\n\nexport type CompensationRequiredFields = RequiredFields<CompensationField>\n\nexport interface UseCompensationFormProps {\n employeeId?: string\n withStartDateField?: boolean\n jobId?: string\n requiredFields?: CompensationRequiredFields\n defaultValues?: Partial<CompensationFormData>\n validationMode?: UseFormProps['mode']\n shouldFocusError?: boolean\n}\n\nfunction findCurrentCompensation(job?: Job | null): Compensation | undefined {\n return job?.compensations?.find(comp => comp.uuid === job.currentCompensationUuid)\n}\n\ntype FlsaStatusValue = CompensationFormData['flsaStatus']\n\nfunction derivePrimaryFlsaStatus(jobs: Job[]): FlsaStatusValue | undefined {\n return jobs.reduce<FlsaStatusValue | undefined>((prev, curr) => {\n const compensation = curr.compensations?.find(\n comp => comp.uuid === curr.currentCompensationUuid,\n )\n if (!curr.primary || !compensation) return prev\n return compensation.flsaStatus ?? prev\n }, undefined)\n}\n\nconst flsaStatusEntries: FlsaStatusType[] = (\n Object.keys(FlsaStatus) as Array<keyof typeof FlsaStatus>\n).map(key => FlsaStatus[key])\n\nconst flsaOptions = flsaStatusEntries.map(status => ({\n value: status,\n label: status,\n}))\n\nconst paymentUnitEntries: PaymentUnit[] = [\n PAY_PERIODS.HOUR,\n PAY_PERIODS.WEEK,\n PAY_PERIODS.MONTH,\n PAY_PERIODS.YEAR,\n PAY_PERIODS.PAYCHECK,\n]\n\nconst paymentUnitOptions = paymentUnitEntries.map(unit => ({\n value: unit,\n label: unit,\n}))\n\nexport function useCompensationForm({\n employeeId,\n withStartDateField = true,\n jobId,\n requiredFields,\n defaultValues: partnerDefaults,\n validationMode = 'onSubmit',\n shouldFocusError = true,\n}: UseCompensationFormProps) {\n const jobsQuery = useJobsAndCompensationsGetJobs(\n { employeeId: employeeId ?? '' },\n { enabled: !!employeeId },\n )\n const addressesQuery = useEmployeeAddressesGetWorkAddresses(\n { employeeId: employeeId ?? '' },\n { enabled: !!employeeId },\n )\n const employeeQuery = useEmployeesGet({ employeeId: employeeId ?? '' }, { enabled: !!employeeId })\n\n const employeeJobs = jobsQuery.data?.jobList\n const workAddresses = addressesQuery.data?.employeeWorkAddressesList\n const currentWorkAddress = workAddresses?.find(address => address.active)\n const locationUuid = currentWorkAddress?.locationUuid\n const employee = employeeQuery.data?.employee\n const companyUuid = employee?.companyUuid\n\n const minWagesQuery = useLocationsGetMinimumWages(\n { locationUuid: locationUuid ?? '' },\n { enabled: !!locationUuid },\n )\n\n const taxQuery = useFederalTaxDetailsGet(\n { companyId: companyUuid ?? '' },\n { enabled: !!companyUuid },\n )\n\n const minimumWages = minWagesQuery.data?.minimumWageList ?? []\n const federalTaxDetails = taxQuery.data?.federalTaxDetails\n const showTwoPercentStakeholder = federalTaxDetails?.taxPayerType === 'S-Corporation'\n\n const currentJob = useMemo<Job | null>(() => {\n if (!employeeJobs) return null\n if (jobId) {\n return employeeJobs.find(j => j.uuid === jobId) ?? null\n }\n return employeeJobs.length === 1 ? (employeeJobs[0] ?? null) : null\n }, [employeeJobs, jobId])\n\n const currentCompensation = useMemo(() => findCurrentCompensation(currentJob), [currentJob])\n\n const primaryFlsaStatus = useMemo(() => {\n if (!employeeJobs) return undefined\n return derivePrimaryFlsaStatus(employeeJobs)\n }, [employeeJobs])\n\n const isCreateMode = !currentJob\n const mode = isCreateMode ? 'create' : 'update'\n\n const schema = createCompensationSchema({\n mode,\n requiredFields,\n withStartDateField,\n })\n\n const state = currentWorkAddress?.state\n\n const hireDate = currentJob?.hireDate\n const resolvedDefaults: CompensationFormData = {\n jobTitle: currentJob?.title || partnerDefaults?.jobTitle || '',\n flsaStatus:\n currentCompensation?.flsaStatus ??\n primaryFlsaStatus ??\n partnerDefaults?.flsaStatus ??\n FlsaStatus.NONEXEMPT,\n rate: Number(currentCompensation?.rate ?? partnerDefaults?.rate ?? 0),\n adjustForMinimumWage: currentCompensation?.adjustForMinimumWage ?? false,\n minimumWageId: currentCompensation?.minimumWages?.[0]?.uuid ?? '',\n paymentUnit:\n currentCompensation?.paymentUnit ?? partnerDefaults?.paymentUnit ?? PAY_PERIODS.HOUR,\n stateWcCovered: currentJob?.stateWcCovered ?? false,\n stateWcClassCode: currentJob?.stateWcClassCode ?? '',\n twoPercentShareholder: currentJob?.twoPercentShareholder ?? false,\n startDate: hireDate ?? partnerDefaults?.startDate ?? null,\n }\n\n const formMethods = useForm<CompensationFormData, unknown, CompensationFormOutputs>({\n resolver: zodResolver(schema) as unknown as Resolver<CompensationFormData>,\n mode: validationMode,\n shouldFocusError,\n defaultValues: resolvedDefaults,\n values: resolvedDefaults,\n resetOptions: { keepDirtyValues: true },\n })\n\n const watchedFlsaStatus = useWatch({\n control: formMethods.control,\n name: 'flsaStatus',\n })\n const watchedAdjustForMinimumWage = useWatch({\n control: formMethods.control,\n name: 'adjustForMinimumWage',\n })\n const watchedStateWcCovered = useWatch({\n control: formMethods.control,\n name: 'stateWcCovered',\n })\n\n useEffect(() => {\n if (watchedFlsaStatus === FlsaStatus.OWNER) {\n formMethods.setValue('paymentUnit', PAY_PERIODS.PAYCHECK)\n } else if (\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n ) {\n formMethods.setValue('paymentUnit', PAY_PERIODS.YEAR)\n formMethods.setValue('rate', 0)\n } else {\n formMethods.setValue('paymentUnit', resolvedDefaults.paymentUnit)\n }\n }, [watchedFlsaStatus, formMethods.setValue, resolvedDefaults.paymentUnit])\n\n const updateCompensationMutation = useJobsAndCompensationsUpdateCompensationMutation()\n const createJobMutation = useJobsAndCompensationsCreateJobMutation()\n const updateJobMutation = useJobsAndCompensationsUpdateMutation()\n\n const isPending =\n updateCompensationMutation.isPending ||\n createJobMutation.isPending ||\n updateJobMutation.isPending\n\n const { baseSubmitHandler, error: submitError, setError } = useBaseSubmit('CompensationForm')\n\n const queries = employeeId\n ? [jobsQuery, addressesQuery, employeeQuery, minWagesQuery, taxQuery]\n : []\n const errorHandling = useErrorHandling(queries, { error: submitError, setError })\n\n const isCommissionOnly =\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n\n const isOwner = watchedFlsaStatus === FlsaStatus.OWNER\n\n const isFlsaSelectionEnabled =\n watchedFlsaStatus !== FlsaStatus.NONEXEMPT || currentJob?.primary === true || isCreateMode\n\n const isAdjustMinimumWageEnabled =\n watchedFlsaStatus === FlsaStatus.NONEXEMPT &&\n minimumWages.length > 0 &&\n state !== undefined &&\n !TIP_CREDITS_UNSUPPORTED_STATES.includes(state)\n\n const isWaState = state === 'WA'\n\n const minimumWageOptions = minimumWages.map(wage => ({\n value: wage.uuid,\n label: `${wage.wage} - ${wage.authority}: ${wage.notes ?? ''}`,\n }))\n\n const stateWcClassCodeOptions = WA_RISK_CLASS_CODES.map(({ code, description }) => ({\n value: code,\n label: `${code}: ${description}`,\n }))\n\n const baseMetadata = deriveFieldsMetadata(schema)\n const fieldsMetadata = {\n startDate: baseMetadata.startDate,\n jobTitle: baseMetadata.jobTitle,\n flsaStatus: withOptions<FlsaStatusType>(\n baseMetadata.flsaStatus,\n flsaOptions,\n flsaStatusEntries,\n ),\n rate: { ...baseMetadata.rate, isDisabled: isCommissionOnly },\n paymentUnit: withOptions<PaymentUnit>(\n { ...baseMetadata.paymentUnit, isDisabled: isOwner || isCommissionOnly },\n paymentUnitOptions,\n paymentUnitEntries,\n ),\n adjustForMinimumWage: {\n ...baseMetadata.adjustForMinimumWage,\n isDisabled: !isAdjustMinimumWageEnabled,\n },\n minimumWageId: withOptions<MinimumWage>(\n baseMetadata.minimumWageId,\n minimumWageOptions,\n minimumWages,\n ),\n twoPercentShareholder: {\n ...baseMetadata.twoPercentShareholder,\n isDisabled: !showTwoPercentStakeholder,\n },\n stateWcCovered: withOptions<string>(\n { ...baseMetadata.stateWcCovered, isDisabled: !isWaState },\n [\n { label: 'Yes', value: 'true' },\n { label: 'No', value: 'false' },\n ],\n ['yes', 'no'],\n ),\n stateWcClassCode: withOptions<WARiskClassCode>(\n { ...baseMetadata.stateWcClassCode, isDisabled: !isWaState },\n stateWcClassCodeOptions,\n WA_RISK_CLASS_CODES,\n ),\n }\n\n const onSubmit = async (\n callbacks?: CompensationSubmitCallbacks,\n options?: CompensationSubmitOptions,\n ): Promise<HookSubmitResult<Compensation | undefined> | undefined> => {\n let submitResult: HookSubmitResult<Compensation | undefined> | undefined\n\n await new Promise<void>(resolve => {\n void formMethods.handleSubmit(\n async (data: CompensationFormOutputs) => {\n await baseSubmitHandler(data, async payload => {\n const resolvedEmployeeId = options?.employeeId ?? employeeId\n\n if (!resolvedEmployeeId) {\n throw new SDKInternalError('employeeId is required to submit compensation')\n }\n\n const {\n jobTitle,\n twoPercentShareholder,\n startDate: formStartDate,\n ...compensationData\n } = payload\n\n const resolvedHireDate =\n withStartDateField && formStartDate ? formStartDate : options?.startDate\n\n let updatedJobData: Job\n\n if (!currentJob) {\n if (!resolvedHireDate) {\n throw new SDKInternalError('Start date is required')\n }\n\n const result = await createJobMutation.mutateAsync({\n request: {\n employeeId: resolvedEmployeeId,\n requestBody: {\n title: jobTitle,\n hireDate: resolvedHireDate,\n stateWcCovered: compensationData.stateWcCovered,\n stateWcClassCode: compensationData.stateWcCovered\n ? compensationData.stateWcClassCode\n : null,\n twoPercentShareholder: twoPercentShareholder ?? false,\n },\n },\n })\n updatedJobData = result.job!\n callbacks?.onJobCreated?.(updatedJobData)\n } else {\n const result = await updateJobMutation.mutateAsync({\n request: {\n jobId: currentJob.uuid,\n requestBody: {\n title: jobTitle,\n version: currentJob.version as string,\n hireDate: resolvedHireDate,\n stateWcClassCode: compensationData.stateWcCovered\n ? compensationData.stateWcClassCode\n : null,\n stateWcCovered: compensationData.stateWcCovered,\n twoPercentShareholder: twoPercentShareholder ?? false,\n },\n },\n })\n updatedJobData = result.job!\n callbacks?.onJobUpdated?.(updatedJobData)\n }\n\n const { compensation } = await updateCompensationMutation.mutateAsync({\n request: {\n compensationId: updatedJobData.currentCompensationUuid!,\n compensationsUpdateRequestBody: {\n // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain\n version: updatedJobData.compensations?.find(\n comp => comp.uuid === updatedJobData.currentCompensationUuid,\n )?.version!,\n ...compensationData,\n rate: String(compensationData.rate),\n minimumWages: compensationData.adjustForMinimumWage\n ? [{ uuid: compensationData.minimumWageId }]\n : [],\n },\n },\n })\n\n callbacks?.onCompensationUpdated?.(compensation)\n\n submitResult = {\n mode: isCreateMode ? 'create' : 'update',\n data: compensation,\n }\n })\n resolve()\n },\n () => {\n resolve()\n },\n )()\n })\n\n return submitResult\n }\n\n const isDataLoading = employeeId\n ? jobsQuery.isLoading ||\n addressesQuery.isLoading ||\n employeeQuery.isLoading ||\n minWagesQuery.isLoading ||\n taxQuery.isLoading\n : false\n\n if (\n isDataLoading ||\n (employeeId &&\n (!employeeJobs ||\n !workAddresses ||\n !currentWorkAddress ||\n !employee ||\n !companyUuid ||\n !federalTaxDetails))\n ) {\n return { isLoading: true as const, errorHandling }\n }\n\n return {\n isLoading: false as const,\n data: {\n compensation: currentCompensation ?? null,\n jobs: employeeJobs,\n currentJob,\n minimumWages,\n },\n status: {\n isPending,\n mode: isCreateMode ? 'create' : 'update',\n },\n actions: { onSubmit },\n errorHandling,\n form: {\n Fields: {\n StartDate: withStartDateField ? StartDateField : undefined,\n JobTitle: JobTitleField,\n FlsaStatus: isFlsaSelectionEnabled ? FlsaStatusField : undefined,\n Rate: RateField,\n PaymentUnit: PaymentUnitField,\n AdjustForMinimumWage: isAdjustMinimumWageEnabled ? AdjustForMinimumWageField : undefined,\n MinimumWageId:\n isAdjustMinimumWageEnabled && watchedAdjustForMinimumWage\n ? MinimumWageIdField\n : undefined,\n TwoPercentShareholder: showTwoPercentStakeholder ? TwoPercentShareholderField : undefined,\n StateWcCovered: isWaState ? StateWcCoveredField : undefined,\n StateWcClassCode: isWaState && watchedStateWcCovered ? StateWcClassCodeField : undefined,\n },\n fieldsMetadata,\n hookFormInternals: { formMethods },\n getFormSubmissionValues: createGetFormSubmissionValues(formMethods, schema),\n },\n }\n}\n\nexport type UseCompensationFormResult = ReturnType<typeof useCompensationForm>\nexport type UseCompensationFormReady = Extract<UseCompensationFormResult, { data: object }>\nexport type CompensationFieldsMetadata = UseCompensationFormReady['form']['fieldsMetadata']\nexport type CompensationFormFields = UseCompensationFormReady['form']['Fields']\n"],"names":["findCurrentCompensation","job","comp","derivePrimaryFlsaStatus","jobs","prev","curr","compensation","flsaStatusEntries","FlsaStatus","key","flsaOptions","status","paymentUnitEntries","PAY_PERIODS","paymentUnitOptions","unit","useCompensationForm","employeeId","withStartDateField","jobId","requiredFields","partnerDefaults","validationMode","shouldFocusError","jobsQuery","useJobsAndCompensationsGetJobs","addressesQuery","useEmployeeAddressesGetWorkAddresses","employeeQuery","useEmployeesGet","employeeJobs","workAddresses","currentWorkAddress","address","locationUuid","employee","companyUuid","minWagesQuery","useLocationsGetMinimumWages","taxQuery","useFederalTaxDetailsGet","minimumWages","federalTaxDetails","showTwoPercentStakeholder","currentJob","useMemo","j","currentCompensation","primaryFlsaStatus","isCreateMode","schema","createCompensationSchema","state","hireDate","resolvedDefaults","formMethods","useForm","zodResolver","watchedFlsaStatus","useWatch","watchedAdjustForMinimumWage","watchedStateWcCovered","useEffect","updateCompensationMutation","useJobsAndCompensationsUpdateCompensationMutation","createJobMutation","useJobsAndCompensationsCreateJobMutation","updateJobMutation","useJobsAndCompensationsUpdateMutation","isPending","baseSubmitHandler","submitError","setError","useBaseSubmit","errorHandling","useErrorHandling","isCommissionOnly","isOwner","isFlsaSelectionEnabled","isAdjustMinimumWageEnabled","TIP_CREDITS_UNSUPPORTED_STATES","isWaState","minimumWageOptions","wage","stateWcClassCodeOptions","WA_RISK_CLASS_CODES","code","description","baseMetadata","deriveFieldsMetadata","fieldsMetadata","withOptions","onSubmit","callbacks","options","submitResult","resolve","data","payload","resolvedEmployeeId","SDKInternalError","jobTitle","twoPercentShareholder","formStartDate","compensationData","resolvedHireDate","updatedJobData","StartDateField","JobTitleField","FlsaStatusField","RateField","PaymentUnitField","AdjustForMinimumWageField","MinimumWageIdField","TwoPercentShareholderField","StateWcCoveredField","StateWcClassCodeField","createGetFormSubmissionValues"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoEA,SAASA,GAAwBC,GAA4C;AAC3E,SAAOA,GAAK,eAAe,KAAK,OAAQC,EAAK,SAASD,EAAI,uBAAuB;AACnF;AAIA,SAASE,GAAwBC,GAA0C;AACzE,SAAOA,EAAK,OAAoC,CAACC,GAAMC,MAAS;AAC9D,UAAMC,IAAeD,EAAK,eAAe;AAAA,MACvC,CAAAJ,MAAQA,EAAK,SAASI,EAAK;AAAA,IAAA;AAE7B,WAAI,CAACA,EAAK,WAAW,CAACC,IAAqBF,IACpCE,EAAa,cAAcF;AAAA,EACpC,GAAG,MAAS;AACd;AAEA,MAAMG,KACJ,OAAO,KAAKC,CAAU,EACtB,IAAI,CAAAC,MAAOD,EAAWC,CAAG,CAAC,GAEtBC,KAAcH,GAAkB,IAAI,CAAAI,OAAW;AAAA,EACnD,OAAOA;AAAA,EACP,OAAOA;AACT,EAAE,GAEIC,KAAoC;AAAA,EACxCC,EAAY;AAAA,EACZA,EAAY;AAAA,EACZA,EAAY;AAAA,EACZA,EAAY;AAAA,EACZA,EAAY;AACd,GAEMC,KAAqBF,GAAmB,IAAI,CAAAG,OAAS;AAAA,EACzD,OAAOA;AAAA,EACP,OAAOA;AACT,EAAE;AAEK,SAASC,G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BlC,KAAapB,KAAwBuD,KAAwB;AAAA,MAAA;AAAA,MAEjF,gBAAA1B;AAAA,MACA,mBAAmB,EAAE,aAAAnC,EAAA;AAAA,MACrB,yBAAyB8D,GAA8B9D,GAAaL,CAAM;AAAA,IAAA;AAAA,EAC5E;AAEJ;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UseEmployeeDetailsFormProps } from './useEmployeeDetailsForm';
|
|
2
|
+
import { BaseComponentInterface } from '../../../Base';
|
|
3
|
+
export interface EmployeeDetailsFormProps extends UseEmployeeDetailsFormProps, Omit<BaseComponentInterface, 'defaultValues'> {
|
|
4
|
+
}
|
|
5
|
+
export declare function EmployeeDetailsForm({ FallbackComponent, ...props }: EmployeeDetailsFormProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { jsx as i, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as L } from "react-i18next";
|
|
3
|
+
import { SDKFormProvider as I } from "../../form/SDKFormProvider.js";
|
|
4
|
+
import { useEmployeeDetailsForm as f } from "./useEmployeeDetailsForm.js";
|
|
5
|
+
import { useComponentContext as N } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
+
import { BaseBoundaries as u, BaseLayout as d } from "../../../Base/Base.js";
|
|
7
|
+
import "../../../Base/useBase.js";
|
|
8
|
+
import { Form as c } from "../../../Common/Form/Form.js";
|
|
9
|
+
import { ActionsLayout as A } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
10
|
+
import { componentEvents as s } from "../../../../shared/constants.js";
|
|
11
|
+
import { useI18n as R, useComponentDictionary as b } from "../../../../i18n/I18n.js";
|
|
12
|
+
function _({ onEvent: t, dictionary: n, ...E }) {
|
|
13
|
+
R("UNSTABLE.EmployeeDetailsForm"), b("UNSTABLE.EmployeeDetailsForm", n);
|
|
14
|
+
const { t: e } = L("UNSTABLE.EmployeeDetailsForm"), m = N(), a = f({
|
|
15
|
+
...E,
|
|
16
|
+
requiredFields: { update: ["ssn"] }
|
|
17
|
+
});
|
|
18
|
+
if (a.isLoading)
|
|
19
|
+
return /* @__PURE__ */ i(d, { isLoading: !0, error: a.errorHandling.errors });
|
|
20
|
+
const { Fields: o } = a.form, D = async () => {
|
|
21
|
+
const r = await a.actions.onSubmit({
|
|
22
|
+
onEmployeeCreated: (l) => {
|
|
23
|
+
t(s.EMPLOYEE_CREATED, l);
|
|
24
|
+
},
|
|
25
|
+
onEmployeeUpdated: (l) => {
|
|
26
|
+
t(s.EMPLOYEE_UPDATED, l);
|
|
27
|
+
},
|
|
28
|
+
onOnboardingStatusUpdated: (l) => {
|
|
29
|
+
t(s.EMPLOYEE_ONBOARDING_STATUS_UPDATED, l);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
r && t(s.EMPLOYEE_PROFILE_DONE, r.data);
|
|
33
|
+
};
|
|
34
|
+
return /* @__PURE__ */ i(d, { error: a.errorHandling.errors, children: /* @__PURE__ */ i(I, { formHookResult: a, children: /* @__PURE__ */ p(
|
|
35
|
+
c,
|
|
36
|
+
{
|
|
37
|
+
onSubmit: (r) => {
|
|
38
|
+
r.preventDefault(), D();
|
|
39
|
+
},
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ i(m.Heading, { as: "h2", children: a.status.mode === "create" ? e("addTitle") : e("editTitle") }),
|
|
42
|
+
/* @__PURE__ */ i(
|
|
43
|
+
o.FirstName,
|
|
44
|
+
{
|
|
45
|
+
label: e("firstNameLabel"),
|
|
46
|
+
validationMessages: {
|
|
47
|
+
REQUIRED: e("fieldValidations.firstName.REQUIRED"),
|
|
48
|
+
INVALID_NAME: e("fieldValidations.firstName.INVALID_NAME")
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ i(o.MiddleInitial, { label: e("middleInitialLabel") }),
|
|
53
|
+
/* @__PURE__ */ i(
|
|
54
|
+
o.LastName,
|
|
55
|
+
{
|
|
56
|
+
label: e("lastNameLabel"),
|
|
57
|
+
validationMessages: {
|
|
58
|
+
REQUIRED: e("fieldValidations.lastName.REQUIRED"),
|
|
59
|
+
INVALID_NAME: e("fieldValidations.lastName.INVALID_NAME")
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
/* @__PURE__ */ i(
|
|
64
|
+
o.Email,
|
|
65
|
+
{
|
|
66
|
+
label: e("emailLabel"),
|
|
67
|
+
description: e("emailDescription"),
|
|
68
|
+
validationMessages: {
|
|
69
|
+
REQUIRED: e("fieldValidations.email.REQUIRED"),
|
|
70
|
+
INVALID_EMAIL: e("fieldValidations.email.INVALID_EMAIL"),
|
|
71
|
+
EMAIL_REQUIRED_FOR_SELF_ONBOARDING: e(
|
|
72
|
+
"fieldValidations.email.EMAIL_REQUIRED_FOR_SELF_ONBOARDING"
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
o.SelfOnboarding && /* @__PURE__ */ i(
|
|
78
|
+
o.SelfOnboarding,
|
|
79
|
+
{
|
|
80
|
+
label: e("selfOnboardingLabel"),
|
|
81
|
+
description: e("selfOnboardingDescription")
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
/* @__PURE__ */ i(o.DateOfBirth, { label: e("dateOfBirthLabel") }),
|
|
85
|
+
/* @__PURE__ */ i(
|
|
86
|
+
o.Ssn,
|
|
87
|
+
{
|
|
88
|
+
label: e("ssnLabel"),
|
|
89
|
+
validationMessages: {
|
|
90
|
+
INVALID_SSN: e("fieldValidations.ssn.INVALID_SSN")
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
/* @__PURE__ */ i(A, { children: /* @__PURE__ */ i(m.Button, { type: "submit", isLoading: a.status.isPending, children: a.status.mode === "create" ? e("createCta") : e("updateCta") }) })
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
) }) });
|
|
98
|
+
}
|
|
99
|
+
function P({ FallbackComponent: t, ...n }) {
|
|
100
|
+
return /* @__PURE__ */ i(
|
|
101
|
+
u,
|
|
102
|
+
{
|
|
103
|
+
componentName: "UNSTABLE.EmployeeDetailsForm",
|
|
104
|
+
FallbackComponent: t,
|
|
105
|
+
children: /* @__PURE__ */ i(_, { ...n })
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
export {
|
|
110
|
+
P as EmployeeDetailsForm
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=EmployeeDetailsForm.js.map
|