@gusto/embedded-react-sdk 0.36.0 → 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 +58 -0
- package/README.md +6 -0
- package/dist/UNSTABLE_Hooks.d.ts +1 -1
- package/dist/UNSTABLE_Hooks.js +50 -6
- package/dist/UNSTABLE_Hooks.js.map +1 -1
- package/dist/components/Base/Base.d.ts +8 -9
- package/dist/components/Base/Base.js +123 -102
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/createCompoundContext.js.map +1 -1
- package/dist/components/Base/index.d.ts +1 -1
- package/dist/components/Base/useBase.d.ts +3 -7
- package/dist/components/Base/useBase.js.map +1 -1
- package/dist/components/Base/useBaseSubmit.d.ts +3 -5
- package/dist/components/Base/useBaseSubmit.js +27 -50
- package/dist/components/Base/useBaseSubmit.js.map +1 -1
- package/dist/components/Common/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/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 +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/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 +13 -14
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +8 -9
- 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 -14
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +8 -9
- 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 -11
- 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 -9
- 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 -9
- 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 -9
- 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 +10 -11
- 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 -12
- 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 -7
- 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 -9
- 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 -9
- 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 -9
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +60 -63
- 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 +15 -15
- 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 -11
- 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 -9
- 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 -9
- 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 +6 -8
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +10 -11
- 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 +10 -10
- 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 +33 -32
- 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 +61 -57
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +15 -16
- 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 +15 -16
- 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 -7
- 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 -9
- 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 -9
- 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 -9
- 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/FederalTaxes.js +42 -42
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +8 -9
- 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 -11
- 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 -44
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +10 -13
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/Profile.js +30 -29
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +8 -9
- 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/StateTaxes.js +50 -50
- package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +8 -9
- 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/Taxes.js +53 -53
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +8 -9
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.d.ts +11 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +123 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.d.ts +11 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +89 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.d.ts +2 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js +30 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.d.ts +24 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +76 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/index.d.ts +3 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.d.ts +8 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js +177 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.test.d.ts +1 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.d.ts +9 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js +86 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.d.ts +20 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +100 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationsData.d.ts +6 -0
- package/dist/components/Employee/Terminations/index.d.ts +8 -0
- package/dist/components/Employee/Terminations/types.d.ts +1 -0
- package/dist/components/Employee/index.d.ts +7 -0
- package/dist/components/Employee/index.js +34 -28
- package/dist/components/Employee/index.js.map +1 -1
- package/dist/components/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 +34 -35
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +41 -41
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
- package/dist/components/Payroll/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.d.ts +2 -0
- package/dist/components/Payroll/Dismissal/DismissalFlow.js +32 -0
- package/dist/components/Payroll/Dismissal/DismissalFlow.js.map +1 -0
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.d.ts +16 -0
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js +52 -0
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js.map +1 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.d.ts +7 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js +73 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.d.ts +9 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +50 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/index.d.ts +3 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.d.ts +6 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.js +51 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.js.map +1 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.test.d.ts +1 -0
- package/dist/components/Payroll/Dismissal/index.d.ts +3 -0
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.d.ts +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +89 -76
- 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 +25 -18
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.d.ts +5 -0
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +31 -24
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +78 -75
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +75 -68
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.module.scss.js +8 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +0 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +18 -26
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.module.scss.js +4 -4
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js +4 -4
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.d.ts +1 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js +1 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js.map +1 -1
- package/dist/components/Payroll/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 +174 -148
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +3 -3
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +71 -71
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.d.ts +3 -2
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js +8 -8
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +5 -3
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +76 -70
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +47 -42
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +5 -3
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +256 -219
- 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.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js +19 -0
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js.map +1 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +3 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js +21 -0
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js.map +1 -0
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +95 -64
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +53 -47
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +38 -40
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +25 -23
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +55 -43
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +2 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +110 -95
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +12 -8
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +15 -15
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +59 -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/Transition/TransitionFlow.d.ts +2 -0
- package/dist/components/Payroll/Transition/TransitionFlow.js +38 -0
- package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -0
- package/dist/components/Payroll/Transition/TransitionFlowComponents.d.ts +19 -0
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js +54 -0
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -0
- package/dist/components/Payroll/Transition/index.d.ts +3 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.d.ts +6 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.js +58 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.js.map +1 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.test.d.ts +1 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.d.ts +2 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js +92 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.d.ts +2 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +109 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.module.scss.js +8 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.d.ts +28 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js +21 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js.map +1 -0
- package/dist/components/Payroll/TransitionCreation/index.d.ts +3 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.d.ts +8 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +83 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +16 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js +100 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -0
- package/dist/components/Payroll/TransitionPayrollAlert/index.d.ts +2 -0
- package/dist/components/Payroll/helpers.d.ts +6 -1
- package/dist/components/Payroll/helpers.js +100 -84
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +6 -0
- package/dist/components/Payroll/index.js +32 -26
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/payrollTypes.d.ts +21 -0
- package/dist/components/Payroll/payrollTypes.js +27 -0
- package/dist/components/Payroll/payrollTypes.js.map +1 -0
- package/dist/components/Payroll/usePreparedPayrollData.js +6 -8
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/collectErrors.d.ts +6 -0
- package/dist/components/UNSTABLE_Hooks/collectErrors.js +9 -0
- package/dist/components/UNSTABLE_Hooks/collectErrors.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.d.ts +8 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js +10 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.d.ts +10 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js +13 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.d.ts +23 -0
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js +24 -0
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.d.ts +26 -0
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.js +24 -0
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.d.ts +53 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js +34 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.test.d.ts +1 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.d.ts +3 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js +14 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.test.d.ts +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.d.ts +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 +16 -0
- 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 +27 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.d.ts +2 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js +17 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.d.ts +4 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js +8 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js.map +1 -0
- 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.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/form/withOptions.js +7 -0
- package/dist/components/UNSTABLE_Hooks/form/withOptions.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js +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 +7 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.d.ts +104 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js +259 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js +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 +9 -0
- package/dist/components/UNSTABLE_Hooks/types.d.ts +49 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.js +12 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.test.d.ts +1 -0
- package/dist/contexts/ApiProvider/ApiProvider.js +11 -11
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +43 -50
- 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/ObservabilityProvider/index.d.ts +1 -1
- package/dist/contexts/ObservabilityProvider/sanitization.d.ts +0 -14
- package/dist/contexts/ObservabilityProvider/sanitization.js +51 -51
- package/dist/contexts/ObservabilityProvider/sanitization.js.map +1 -1
- package/dist/contexts/ObservabilityProvider/useSanitizedObservability.d.ts +0 -3
- package/dist/contexts/ObservabilityProvider/useSanitizedObservability.js.map +1 -1
- package/dist/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 +7 -7
- 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/Employee.Terminations.TerminateEmployee.json.js +18 -0
- package/dist/i18n/en/Employee.Terminations.TerminateEmployee.json.js.map +1 -0
- package/dist/i18n/en/Employee.Terminations.TerminationFlow.json.js +12 -0
- package/dist/i18n/en/Employee.Terminations.TerminationFlow.json.js.map +1 -0
- package/dist/i18n/en/Employee.Terminations.TerminationSummary.json.js +20 -0
- package/dist/i18n/en/Employee.Terminations.TerminationSummary.json.js.map +1 -0
- package/dist/i18n/en/Payroll.Dismissal.json.js +22 -0
- package/dist/i18n/en/Payroll.Dismissal.json.js.map +1 -0
- package/dist/i18n/en/Payroll.GrossUpModal.json.js +16 -14
- package/dist/i18n/en/Payroll.GrossUpModal.json.js.map +1 -1
- package/dist/i18n/en/Payroll.OffCycleCreation.json.js +15 -11
- package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -1
- package/dist/i18n/en/Payroll.OffCyclePayPeriodDateForm.json.js +1 -1
- package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js +5 -5
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +31 -25
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollList.json.js +20 -18
- package/dist/i18n/en/Payroll.PayrollList.json.js.map +1 -1
- package/dist/i18n/en/Payroll.Transition.json.js +8 -0
- package/dist/i18n/en/Payroll.Transition.json.js.map +1 -0
- package/dist/i18n/en/Payroll.TransitionCreation.json.js +26 -0
- package/dist/i18n/en/Payroll.TransitionCreation.json.js.map +1 -0
- package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js +18 -0
- package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.CompensationForm.json.js +58 -0
- package/dist/i18n/en/UNSTABLE.CompensationForm.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js +34 -0
- package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js +24 -0
- package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js.map +1 -0
- package/dist/i18n/en/common.json.d.ts +2 -1
- package/dist/i18n/en/common.json.js +9 -9
- package/dist/index.d.ts +3 -2
- package/dist/index.js +14 -13
- package/dist/models/WA_RISK_CODES.d.ts +5 -2866
- package/dist/models/WA_RISK_CODES.js.map +1 -1
- package/dist/shared/constants.d.ts +32 -0
- package/dist/shared/constants.js +83 -65
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +707 -1
- package/dist/types/observability.d.ts +31 -65
- package/dist/types/sdkError.d.ts +97 -0
- package/dist/types/sdkError.js +95 -0
- package/dist/types/sdkError.js.map +1 -0
- package/dist/types/sdkError.test.d.ts +1 -0
- package/docs/reference/endpoint-inventory.json +212 -14
- package/package.json +17 -17
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.d.ts +0 -6
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js +0 -70
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.d.ts +0 -7
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js +0 -6
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.d.ts +0 -9
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js +0 -40
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/index.d.ts +0 -5
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.d.ts +0 -2
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js +0 -12
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/index.d.ts +0 -2
- package/dist/contexts/ObservabilityProvider/observabilityUtils.d.ts +0 -5
- package/dist/contexts/ObservabilityProvider/observabilityUtils.js +0 -45
- package/dist/contexts/ObservabilityProvider/observabilityUtils.js.map +0 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx as e, jsxs as E } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as p } from "react-i18next";
|
|
3
|
+
import { SDKFormProvider as u } from "../../form/SDKFormProvider.js";
|
|
4
|
+
import { useWorkAddressForm as D } from "./useWorkAddressForm.js";
|
|
5
|
+
import { useComponentContext as A } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
+
import { BaseBoundaries as R, BaseLayout as c } from "../../../Base/Base.js";
|
|
7
|
+
import "../../../Base/useBase.js";
|
|
8
|
+
import { Form as L } from "../../../Common/Form/Form.js";
|
|
9
|
+
import { ActionsLayout as S } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
10
|
+
import { componentEvents as d } from "../../../../shared/constants.js";
|
|
11
|
+
import { useI18n as W, useComponentDictionary as k } from "../../../../i18n/I18n.js";
|
|
12
|
+
import { addressInline as U } from "../../../../helpers/formattedStrings.js";
|
|
13
|
+
function g({ onEvent: i, dictionary: s, ...l }) {
|
|
14
|
+
W("UNSTABLE.WorkAddressForm"), k("UNSTABLE.WorkAddressForm", s);
|
|
15
|
+
const { t: o } = p("UNSTABLE.WorkAddressForm"), m = A(), r = D(l);
|
|
16
|
+
if (r.isLoading)
|
|
17
|
+
return /* @__PURE__ */ e(c, { isLoading: !0, error: r.errorHandling.errors });
|
|
18
|
+
const { Fields: n } = r.form, f = async () => {
|
|
19
|
+
const t = await r.actions.onSubmit({
|
|
20
|
+
onWorkAddressCreated: (a) => {
|
|
21
|
+
i(d.EMPLOYEE_WORK_ADDRESS_CREATED, a);
|
|
22
|
+
},
|
|
23
|
+
onWorkAddressUpdated: (a) => {
|
|
24
|
+
i(d.EMPLOYEE_WORK_ADDRESS_UPDATED, a);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
t && i(d.EMPLOYEE_WORK_ADDRESS, t.data);
|
|
28
|
+
};
|
|
29
|
+
return /* @__PURE__ */ e(c, { error: r.errorHandling.errors, children: /* @__PURE__ */ e(u, { formHookResult: r, children: /* @__PURE__ */ E(
|
|
30
|
+
L,
|
|
31
|
+
{
|
|
32
|
+
onSubmit: (t) => {
|
|
33
|
+
t.preventDefault(), f();
|
|
34
|
+
},
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ e(m.Heading, { as: "h2", children: r.status.mode === "create" ? o("addTitle") : o("editTitle") }),
|
|
37
|
+
/* @__PURE__ */ e(
|
|
38
|
+
n.Location,
|
|
39
|
+
{
|
|
40
|
+
label: o("locationLabel"),
|
|
41
|
+
description: o("locationDescription"),
|
|
42
|
+
getOptionLabel: (t) => U(t),
|
|
43
|
+
validationMessages: {
|
|
44
|
+
REQUIRED: o("fieldValidations.locationUuid.REQUIRED")
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
n.EffectiveDate && /* @__PURE__ */ e(
|
|
49
|
+
n.EffectiveDate,
|
|
50
|
+
{
|
|
51
|
+
label: o("effectiveDateLabel"),
|
|
52
|
+
description: o("effectiveDateDescription"),
|
|
53
|
+
validationMessages: {
|
|
54
|
+
REQUIRED: o("fieldValidations.effectiveDate.REQUIRED")
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
/* @__PURE__ */ e(S, { children: /* @__PURE__ */ e(m.Button, { type: "submit", isLoading: r.status.isPending, children: r.status.mode === "create" ? o("createCta") : o("updateCta") }) })
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
) }) });
|
|
62
|
+
}
|
|
63
|
+
function M({ FallbackComponent: i, ...s }) {
|
|
64
|
+
return /* @__PURE__ */ e(R, { componentName: "UNSTABLE.WorkAddressForm", FallbackComponent: i, children: /* @__PURE__ */ e(g, { ...s }) });
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
M as WorkAddressForm
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=WorkAddressForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkAddressForm.js","sources":["../../../../../src/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { SDKFormProvider } from '../../form/SDKFormProvider'\nimport { useWorkAddressForm } from './useWorkAddressForm'\nimport type { UseWorkAddressFormProps } from './useWorkAddressForm'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { BaseBoundaries, BaseLayout, type BaseComponentInterface } from '@/components/Base'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { addressInline } from '@/helpers/formattedStrings'\n\nexport interface WorkAddressFormProps\n extends UseWorkAddressFormProps, Omit<BaseComponentInterface, 'defaultValues'> {}\n\nfunction WorkAddressFormRoot({ onEvent, dictionary, ...hookProps }: WorkAddressFormProps) {\n useI18n('UNSTABLE.WorkAddressForm')\n useComponentDictionary('UNSTABLE.WorkAddressForm', dictionary)\n const { t } = useTranslation('UNSTABLE.WorkAddressForm')\n const Components = useComponentContext()\n const workAddress = useWorkAddressForm(hookProps)\n\n if (workAddress.isLoading) {\n return <BaseLayout isLoading error={workAddress.errorHandling.errors} />\n }\n\n const { Fields } = workAddress.form\n\n const handleSubmit = async () => {\n const result = await workAddress.actions.onSubmit({\n onWorkAddressCreated: wa => {\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_CREATED, wa)\n },\n onWorkAddressUpdated: wa => {\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_UPDATED, wa)\n },\n })\n if (result) {\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS, result.data)\n }\n }\n\n return (\n <BaseLayout error={workAddress.errorHandling.errors}>\n <SDKFormProvider formHookResult={workAddress}>\n <Form\n onSubmit={e => {\n e.preventDefault()\n void handleSubmit()\n }}\n >\n <Components.Heading as=\"h2\">\n {workAddress.status.mode === 'create' ? t('addTitle') : t('editTitle')}\n </Components.Heading>\n\n <Fields.Location\n label={t('locationLabel')}\n description={t('locationDescription')}\n getOptionLabel={location => addressInline(location)}\n validationMessages={{\n REQUIRED: t('fieldValidations.locationUuid.REQUIRED'),\n }}\n />\n\n {Fields.EffectiveDate && (\n <Fields.EffectiveDate\n label={t('effectiveDateLabel')}\n description={t('effectiveDateDescription')}\n validationMessages={{\n REQUIRED: t('fieldValidations.effectiveDate.REQUIRED'),\n }}\n />\n )}\n\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={workAddress.status.isPending}>\n {workAddress.status.mode === 'create' ? t('createCta') : t('updateCta')}\n </Components.Button>\n </ActionsLayout>\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n )\n}\n\nexport function WorkAddressForm({ FallbackComponent, ...props }: WorkAddressFormProps) {\n return (\n <BaseBoundaries componentName=\"UNSTABLE.WorkAddressForm\" FallbackComponent={FallbackComponent}>\n <WorkAddressFormRoot {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["WorkAddressFormRoot","onEvent","dictionary","hookProps","useI18n","useComponentDictionary","t","useTranslation","Components","useComponentContext","workAddress","useWorkAddressForm","BaseLayout","Fields","handleSubmit","result","wa","componentEvents","jsx","SDKFormProvider","jsxs","Form","e","location","addressInline","ActionsLayout","WorkAddressForm","FallbackComponent","props","BaseBoundaries"],"mappings":";;;;;;;;;;;;AAeA,SAASA,EAAoB,EAAE,SAAAC,GAAS,YAAAC,GAAY,GAAGC,KAAmC;AACxF,EAAAC,EAAQ,0BAA0B,GAClCC,EAAuB,4BAA4BH,CAAU;AAC7D,QAAM,EAAE,GAAAI,EAAA,IAAMC,EAAe,0BAA0B,GACjDC,IAAaC,EAAA,GACbC,IAAcC,EAAmBR,CAAS;AAEhD,MAAIO,EAAY;AACd,6BAAQE,GAAA,EAAW,WAAS,IAAC,OAAOF,EAAY,cAAc,QAAQ;AAGxE,QAAM,EAAE,QAAAG,MAAWH,EAAY,MAEzBI,IAAe,YAAY;AAC/B,UAAMC,IAAS,MAAML,EAAY,QAAQ,SAAS;AAAA,MAChD,sBAAsB,CAAAM,MAAM;AAC1B,QAAAf,EAAQgB,EAAgB,+BAA+BD,CAAE;AAAA,MAC3D;AAAA,MACA,sBAAsB,CAAAA,MAAM;AAC1B,QAAAf,EAAQgB,EAAgB,+BAA+BD,CAAE;AAAA,MAC3D;AAAA,IAAA,CACD;AACD,IAAID,KACFd,EAAQgB,EAAgB,uBAAuBF,EAAO,IAAI;AAAA,EAE9D;AAEA,SACE,gBAAAG,EAACN,KAAW,OAAOF,EAAY,cAAc,QAC3C,UAAA,gBAAAQ,EAACC,GAAA,EAAgB,gBAAgBT,GAC/B,UAAA,gBAAAU;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,UAAU,CAAAC,MAAK;AACb,QAAAA,EAAE,eAAA,GACGR,EAAA;AAAA,MACP;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAI,EAACV,EAAW,SAAX,EAAmB,IAAG,MACpB,UAAAE,EAAY,OAAO,SAAS,WAAWJ,EAAE,UAAU,IAAIA,EAAE,WAAW,GACvE;AAAA,QAEA,gBAAAY;AAAA,UAACL,EAAO;AAAA,UAAP;AAAA,YACC,OAAOP,EAAE,eAAe;AAAA,YACxB,aAAaA,EAAE,qBAAqB;AAAA,YACpC,gBAAgB,CAAAiB,MAAYC,EAAcD,CAAQ;AAAA,YAClD,oBAAoB;AAAA,cAClB,UAAUjB,EAAE,wCAAwC;AAAA,YAAA;AAAA,UACtD;AAAA,QAAA;AAAA,QAGDO,EAAO,iBACN,gBAAAK;AAAA,UAACL,EAAO;AAAA,UAAP;AAAA,YACC,OAAOP,EAAE,oBAAoB;AAAA,YAC7B,aAAaA,EAAE,0BAA0B;AAAA,YACzC,oBAAoB;AAAA,cAClB,UAAUA,EAAE,yCAAyC;AAAA,YAAA;AAAA,UACvD;AAAA,QAAA;AAAA,QAIJ,gBAAAY,EAACO,KACC,UAAA,gBAAAP,EAACV,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWE,EAAY,OAAO,WAC5D,UAAAA,EAAY,OAAO,SAAS,WAAWJ,EAAE,WAAW,IAAIA,EAAE,WAAW,EAAA,CACxE,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAEJ,EAAA,CACF;AAEJ;AAEO,SAASoB,EAAgB,EAAE,mBAAAC,GAAmB,GAAGC,KAA+B;AACrF,SACE,gBAAAV,EAACW,KAAe,eAAc,4BAA2B,mBAAAF,GACvD,UAAA,gBAAAT,EAAClB,GAAA,EAAqB,GAAG4B,EAAA,CAAO,EAAA,CAClC;AAEJ;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Location } from '@gusto/embedded-api/models/components/location';
|
|
2
|
+
import { HookFieldProps } from '../../form/types';
|
|
3
|
+
import { SelectHookFieldProps } from '../../form/fields/SelectHookField';
|
|
4
|
+
import { DatePickerHookFieldProps } from '../../form/fields/DatePickerHookField';
|
|
5
|
+
import { WorkAddressErrorCodes } from './workAddressSchema';
|
|
6
|
+
export type RequiredValidation = typeof WorkAddressErrorCodes.REQUIRED;
|
|
7
|
+
export type LocationFieldProps = HookFieldProps<SelectHookFieldProps<RequiredValidation, Location>>;
|
|
8
|
+
export declare function LocationField(props: LocationFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export type EffectiveDateFieldProps = HookFieldProps<DatePickerHookFieldProps<RequiredValidation>>;
|
|
10
|
+
export declare function EffectiveDateField(props: EffectiveDateFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { DatePickerHookField as t } from "../../form/fields/DatePickerHookField.js";
|
|
3
|
+
import { SelectHookField as i } from "../../form/fields/SelectHookField.js";
|
|
4
|
+
function c(e) {
|
|
5
|
+
return /* @__PURE__ */ o(i, { ...e, name: "locationUuid" });
|
|
6
|
+
}
|
|
7
|
+
function m(e) {
|
|
8
|
+
return /* @__PURE__ */ o(t, { ...e, name: "effectiveDate" });
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
m as EffectiveDateField,
|
|
12
|
+
c as LocationField
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.js","sources":["../../../../../src/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.tsx"],"sourcesContent":["import type { Location } from '@gusto/embedded-api/models/components/location'\nimport type { HookFieldProps } from '../../form/types'\nimport type { SelectHookFieldProps } from '../../form/fields/SelectHookField'\nimport type { DatePickerHookFieldProps } from '../../form/fields/DatePickerHookField'\nimport { SelectHookField, DatePickerHookField } from '../../form/fields'\nimport type { WorkAddressErrorCodes } from './workAddressSchema'\n\nexport type RequiredValidation = typeof WorkAddressErrorCodes.REQUIRED\n\nexport type LocationFieldProps = HookFieldProps<SelectHookFieldProps<RequiredValidation, Location>>\n\nexport function LocationField(props: LocationFieldProps) {\n return <SelectHookField {...props} name=\"locationUuid\" />\n}\n\nexport type EffectiveDateFieldProps = HookFieldProps<DatePickerHookFieldProps<RequiredValidation>>\n\nexport function EffectiveDateField(props: EffectiveDateFieldProps) {\n return <DatePickerHookField {...props} name=\"effectiveDate\" />\n}\n"],"names":["LocationField","props","jsx","SelectHookField","EffectiveDateField","DatePickerHookField"],"mappings":";;;AAWO,SAASA,EAAcC,GAA2B;AACvD,SAAO,gBAAAC,EAACC,GAAA,EAAiB,GAAGF,GAAO,MAAK,gBAAe;AACzD;AAIO,SAASG,EAAmBH,GAAgC;AACjE,SAAO,gBAAAC,EAACG,GAAA,EAAqB,GAAGJ,GAAO,MAAK,iBAAgB;AAC9D;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "./types/i18next.d.ts"
|
|
2
|
+
export { useWorkAddressForm } from './useWorkAddressForm';
|
|
3
|
+
export type { WorkAddressSubmitCallbacks, WorkAddressSubmitOptions, WorkAddressRequiredFields, UseWorkAddressFormProps, UseWorkAddressFormResult, UseWorkAddressFormReady, WorkAddressFieldsMetadata, WorkAddressFormFields, } from './useWorkAddressForm';
|
|
4
|
+
export { WorkAddressForm } from './WorkAddressForm';
|
|
5
|
+
export type { WorkAddressFormProps } from './WorkAddressForm';
|
|
6
|
+
export { createWorkAddressSchema, WorkAddressErrorCodes, type WorkAddressErrorCode, type WorkAddressFormData, type WorkAddressFormOutputs, type WorkAddressField, } from './workAddressSchema';
|
|
7
|
+
export type { RequiredValidation as WorkAddressRequiredValidation, LocationFieldProps, EffectiveDateFieldProps, } from './fields';
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { UseFormProps } from 'react-hook-form';
|
|
2
|
+
import { Location } from '@gusto/embedded-api/models/components/location';
|
|
3
|
+
import { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress';
|
|
4
|
+
import { HookSubmitResult } from '../../types';
|
|
5
|
+
import { RequiredFields } from '../../form/resolveRequiredFields';
|
|
6
|
+
import { WorkAddressFormData, WorkAddressField } from './workAddressSchema';
|
|
7
|
+
import { LocationField, EffectiveDateField } from './fields';
|
|
8
|
+
export type WorkAddressRequiredFields = RequiredFields<WorkAddressField>;
|
|
9
|
+
export interface WorkAddressSubmitCallbacks {
|
|
10
|
+
onWorkAddressCreated?: (workAddress: EmployeeWorkAddress) => void;
|
|
11
|
+
onWorkAddressUpdated?: (workAddress: EmployeeWorkAddress) => void;
|
|
12
|
+
}
|
|
13
|
+
export interface WorkAddressSubmitOptions {
|
|
14
|
+
employeeId?: string;
|
|
15
|
+
effectiveDate?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface UseWorkAddressFormProps {
|
|
18
|
+
companyId: string;
|
|
19
|
+
employeeId?: string;
|
|
20
|
+
withEffectiveDateField?: boolean;
|
|
21
|
+
requiredFields?: WorkAddressRequiredFields;
|
|
22
|
+
defaultValues?: Partial<WorkAddressFormData>;
|
|
23
|
+
validationMode?: UseFormProps['mode'];
|
|
24
|
+
shouldFocusError?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare function useWorkAddressForm({ companyId, employeeId, withEffectiveDateField, requiredFields, defaultValues: partnerDefaults, validationMode, shouldFocusError, }: UseWorkAddressFormProps): {
|
|
27
|
+
isLoading: true;
|
|
28
|
+
errorHandling: import('../..').HookErrorHandling;
|
|
29
|
+
data?: undefined;
|
|
30
|
+
status?: undefined;
|
|
31
|
+
actions?: undefined;
|
|
32
|
+
form?: undefined;
|
|
33
|
+
} | {
|
|
34
|
+
isLoading: false;
|
|
35
|
+
data: {
|
|
36
|
+
workAddress: EmployeeWorkAddress | null;
|
|
37
|
+
workAddresses: EmployeeWorkAddress[] | undefined;
|
|
38
|
+
companyLocations: Location[];
|
|
39
|
+
};
|
|
40
|
+
status: {
|
|
41
|
+
isPending: boolean;
|
|
42
|
+
mode: "create" | "update";
|
|
43
|
+
};
|
|
44
|
+
actions: {
|
|
45
|
+
onSubmit: (callbacks?: WorkAddressSubmitCallbacks, options?: WorkAddressSubmitOptions) => Promise<HookSubmitResult<EmployeeWorkAddress> | undefined>;
|
|
46
|
+
};
|
|
47
|
+
errorHandling: import('../..').HookErrorHandling;
|
|
48
|
+
form: {
|
|
49
|
+
Fields: {
|
|
50
|
+
Location: typeof LocationField;
|
|
51
|
+
EffectiveDate: typeof EffectiveDateField | undefined;
|
|
52
|
+
};
|
|
53
|
+
fieldsMetadata: {
|
|
54
|
+
locationUuid: import('../..').FieldMetadataWithOptions<Location>;
|
|
55
|
+
effectiveDate: import('../..').FieldMetadata;
|
|
56
|
+
};
|
|
57
|
+
hookFormInternals: {
|
|
58
|
+
formMethods: import('react-hook-form').UseFormReturn<WorkAddressFormData, unknown, WorkAddressFormData>;
|
|
59
|
+
};
|
|
60
|
+
getFormSubmissionValues: () => WorkAddressFormData | undefined;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export type UseWorkAddressFormResult = ReturnType<typeof useWorkAddressForm>;
|
|
64
|
+
export type UseWorkAddressFormReady = Extract<UseWorkAddressFormResult, {
|
|
65
|
+
data: object;
|
|
66
|
+
}>;
|
|
67
|
+
export type WorkAddressFieldsMetadata = UseWorkAddressFormReady['form']['fieldsMetadata'];
|
|
68
|
+
export type WorkAddressFormFields = UseWorkAddressFormReady['form']['Fields'];
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { useForm as I } from "react-hook-form";
|
|
2
|
+
import { zodResolver as O } from "@hookform/resolvers/zod";
|
|
3
|
+
import { useLocationsGet as R } from "@gusto/embedded-api/react-query/locationsGet";
|
|
4
|
+
import { useEmployeeAddressesGetWorkAddresses as Q } from "@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses";
|
|
5
|
+
import { useEmployeeAddressesCreateWorkAddressMutation as x } from "@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress";
|
|
6
|
+
import { useEmployeeAddressesUpdateWorkAddressMutation as z } from "@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress";
|
|
7
|
+
import { RFCDate as K } from "@gusto/embedded-api/types/rfcdate";
|
|
8
|
+
import { useErrorHandling as j } from "../../useErrorHandling.js";
|
|
9
|
+
import { deriveFieldsMetadata as J } from "../../form/deriveFieldsMetadata.js";
|
|
10
|
+
import { createGetFormSubmissionValues as N } from "../../form/getFormSubmissionValues.js";
|
|
11
|
+
import { withOptions as T } from "../../form/withOptions.js";
|
|
12
|
+
import { createWorkAddressSchema as X } from "./workAddressSchema.js";
|
|
13
|
+
import { EffectiveDateField as Y, LocationField as Z } from "./fields.js";
|
|
14
|
+
import { useBaseSubmit as _ } from "../../../Base/useBaseSubmit.js";
|
|
15
|
+
import { SDKInternalError as p } from "../../../../types/sdkError.js";
|
|
16
|
+
import { addressInline as $ } from "../../../../helpers/formattedStrings.js";
|
|
17
|
+
function we({
|
|
18
|
+
companyId: E,
|
|
19
|
+
employeeId: o,
|
|
20
|
+
withEffectiveDateField: u = !0,
|
|
21
|
+
requiredFields: F,
|
|
22
|
+
defaultValues: A,
|
|
23
|
+
validationMode: M = "onSubmit",
|
|
24
|
+
shouldFocusError: S = !0
|
|
25
|
+
}) {
|
|
26
|
+
const d = R({ companyId: E }), m = Q(
|
|
27
|
+
{ employeeId: o ?? "" },
|
|
28
|
+
{ enabled: !!o }
|
|
29
|
+
), a = d.data?.companyLocationsList, c = m.data?.employeeWorkAddressesList, t = c?.find((e) => e.active), s = !t, f = X({
|
|
30
|
+
mode: s ? "create" : "update",
|
|
31
|
+
requiredFields: F,
|
|
32
|
+
withEffectiveDateField: u
|
|
33
|
+
}), k = {
|
|
34
|
+
locationUuid: t?.locationUuid ?? A?.locationUuid ?? "",
|
|
35
|
+
effectiveDate: t?.effectiveDate ?? A?.effectiveDate ?? ""
|
|
36
|
+
}, l = I({
|
|
37
|
+
resolver: O(f),
|
|
38
|
+
mode: M,
|
|
39
|
+
shouldFocusError: S,
|
|
40
|
+
defaultValues: k,
|
|
41
|
+
values: k,
|
|
42
|
+
resetOptions: { keepDirtyValues: !0 }
|
|
43
|
+
}), v = x(), W = z(), h = v.isPending || W.isPending, { baseSubmitHandler: q, error: V, setError: C } = _("WorkAddressForm"), w = j(o ? [d, m] : [d], { error: V, setError: C }), P = (a ?? []).map((e) => ({
|
|
44
|
+
value: e.uuid,
|
|
45
|
+
label: $(e)
|
|
46
|
+
})), y = J(f), B = {
|
|
47
|
+
locationUuid: T(
|
|
48
|
+
y.locationUuid,
|
|
49
|
+
P,
|
|
50
|
+
a ?? []
|
|
51
|
+
),
|
|
52
|
+
effectiveDate: y.effectiveDate
|
|
53
|
+
}, G = async (e, D) => {
|
|
54
|
+
let b;
|
|
55
|
+
return await new Promise((L) => {
|
|
56
|
+
l.handleSubmit(
|
|
57
|
+
async (H) => {
|
|
58
|
+
await q(H, async (n) => {
|
|
59
|
+
const g = D?.employeeId ?? o;
|
|
60
|
+
if (!g)
|
|
61
|
+
throw new p("employeeId is required to submit work address");
|
|
62
|
+
let r;
|
|
63
|
+
if (s) {
|
|
64
|
+
const i = u && n.effectiveDate ? n.effectiveDate : D?.effectiveDate, U = await v.mutateAsync({
|
|
65
|
+
request: {
|
|
66
|
+
employeeId: g,
|
|
67
|
+
requestBody: {
|
|
68
|
+
locationUuid: n.locationUuid,
|
|
69
|
+
effectiveDate: i ? new K(new Date(i)) : void 0
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
if (!U.employeeWorkAddress)
|
|
74
|
+
throw new p("Work address creation failed");
|
|
75
|
+
r = U.employeeWorkAddress, e?.onWorkAddressCreated?.(r);
|
|
76
|
+
} else {
|
|
77
|
+
const i = await W.mutateAsync({
|
|
78
|
+
request: {
|
|
79
|
+
workAddressUuid: t.uuid,
|
|
80
|
+
requestBody: {
|
|
81
|
+
version: t.version,
|
|
82
|
+
locationUuid: n.locationUuid
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
if (!i.employeeWorkAddress)
|
|
87
|
+
throw new p("Work address update failed");
|
|
88
|
+
r = i.employeeWorkAddress, e?.onWorkAddressUpdated?.(r);
|
|
89
|
+
}
|
|
90
|
+
b = {
|
|
91
|
+
mode: s ? "create" : "update",
|
|
92
|
+
data: r
|
|
93
|
+
};
|
|
94
|
+
}), L();
|
|
95
|
+
},
|
|
96
|
+
() => {
|
|
97
|
+
L();
|
|
98
|
+
}
|
|
99
|
+
)();
|
|
100
|
+
}), b;
|
|
101
|
+
};
|
|
102
|
+
return d.isLoading || (o ? m.isLoading : !1) || !a || o && !c ? { isLoading: !0, errorHandling: w } : {
|
|
103
|
+
isLoading: !1,
|
|
104
|
+
data: {
|
|
105
|
+
workAddress: t ?? null,
|
|
106
|
+
workAddresses: c,
|
|
107
|
+
companyLocations: a
|
|
108
|
+
},
|
|
109
|
+
status: {
|
|
110
|
+
isPending: h,
|
|
111
|
+
mode: s ? "create" : "update"
|
|
112
|
+
},
|
|
113
|
+
actions: { onSubmit: G },
|
|
114
|
+
errorHandling: w,
|
|
115
|
+
form: {
|
|
116
|
+
Fields: {
|
|
117
|
+
Location: Z,
|
|
118
|
+
EffectiveDate: u && s ? Y : void 0
|
|
119
|
+
},
|
|
120
|
+
fieldsMetadata: B,
|
|
121
|
+
hookFormInternals: { formMethods: l },
|
|
122
|
+
getFormSubmissionValues: N(l, f)
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
export {
|
|
127
|
+
we as useWorkAddressForm
|
|
128
|
+
};
|
|
129
|
+
//# sourceMappingURL=useWorkAddressForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWorkAddressForm.js","sources":["../../../../../src/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.tsx"],"sourcesContent":["import { useForm } from 'react-hook-form'\nimport type { UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport type { Location } from '@gusto/embedded-api/models/components/location'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { useLocationsGet } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useEmployeeAddressesGetWorkAddresses } from '@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses'\nimport { useEmployeeAddressesCreateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress'\nimport { useEmployeeAddressesUpdateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport type { HookSubmitResult } from '../../types'\nimport { useErrorHandling } from '../../useErrorHandling'\nimport { deriveFieldsMetadata } from '../../form/deriveFieldsMetadata'\nimport { createGetFormSubmissionValues } from '../../form/getFormSubmissionValues'\nimport { withOptions } from '../../form/withOptions'\nimport type { RequiredFields } from '../../form/resolveRequiredFields'\nimport {\n createWorkAddressSchema,\n type WorkAddressFormData,\n type WorkAddressFormOutputs,\n type WorkAddressField,\n} from './workAddressSchema'\nimport { LocationField, EffectiveDateField } from './fields'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { SDKInternalError } from '@/types/sdkError'\nimport { addressInline } from '@/helpers/formattedStrings'\n\nexport type WorkAddressRequiredFields = RequiredFields<WorkAddressField>\n\nexport interface WorkAddressSubmitCallbacks {\n onWorkAddressCreated?: (workAddress: EmployeeWorkAddress) => void\n onWorkAddressUpdated?: (workAddress: EmployeeWorkAddress) => void\n}\n\nexport interface WorkAddressSubmitOptions {\n employeeId?: string\n effectiveDate?: string\n}\n\nexport interface UseWorkAddressFormProps {\n companyId: string\n employeeId?: string\n withEffectiveDateField?: boolean\n requiredFields?: WorkAddressRequiredFields\n defaultValues?: Partial<WorkAddressFormData>\n validationMode?: UseFormProps['mode']\n shouldFocusError?: boolean\n}\n\nexport function useWorkAddressForm({\n companyId,\n employeeId,\n withEffectiveDateField = true,\n requiredFields,\n defaultValues: partnerDefaults,\n validationMode = 'onSubmit',\n shouldFocusError = true,\n}: UseWorkAddressFormProps) {\n const locationsQuery = useLocationsGet({ companyId })\n const workAddressesQuery = useEmployeeAddressesGetWorkAddresses(\n { employeeId: employeeId ?? '' },\n { enabled: !!employeeId },\n )\n\n const companyLocations = locationsQuery.data?.companyLocationsList\n const workAddresses = workAddressesQuery.data?.employeeWorkAddressesList\n const currentWorkAddress = workAddresses?.find(address => address.active)\n\n const isCreateMode = !currentWorkAddress\n const mode = isCreateMode ? 'create' : 'update'\n\n const schema = createWorkAddressSchema({\n mode,\n requiredFields,\n withEffectiveDateField,\n })\n\n const resolvedDefaults: WorkAddressFormData = {\n locationUuid: currentWorkAddress?.locationUuid ?? partnerDefaults?.locationUuid ?? '',\n effectiveDate: currentWorkAddress?.effectiveDate ?? partnerDefaults?.effectiveDate ?? '',\n }\n\n const formMethods = useForm<WorkAddressFormData, unknown, WorkAddressFormOutputs>({\n resolver: zodResolver(schema),\n mode: validationMode,\n shouldFocusError,\n defaultValues: resolvedDefaults,\n values: resolvedDefaults,\n resetOptions: { keepDirtyValues: true },\n })\n\n const createWorkAddressMutation = useEmployeeAddressesCreateWorkAddressMutation()\n const updateWorkAddressMutation = useEmployeeAddressesUpdateWorkAddressMutation()\n\n const isPending = createWorkAddressMutation.isPending || updateWorkAddressMutation.isPending\n\n const { baseSubmitHandler, error: submitError, setError } = useBaseSubmit('WorkAddressForm')\n\n const queries = employeeId ? [locationsQuery, workAddressesQuery] : [locationsQuery]\n const errorHandling = useErrorHandling(queries, { error: submitError, setError })\n\n const locationOptions = (companyLocations ?? []).map(location => ({\n value: location.uuid,\n label: addressInline(location),\n }))\n\n const baseMetadata = deriveFieldsMetadata(schema)\n const fieldsMetadata = {\n locationUuid: withOptions<Location>(\n baseMetadata.locationUuid,\n locationOptions,\n companyLocations ?? [],\n ),\n effectiveDate: baseMetadata.effectiveDate,\n }\n\n const onSubmit = async (\n callbacks?: WorkAddressSubmitCallbacks,\n options?: WorkAddressSubmitOptions,\n ): Promise<HookSubmitResult<EmployeeWorkAddress> | undefined> => {\n let submitResult: HookSubmitResult<EmployeeWorkAddress> | undefined\n\n await new Promise<void>(resolve => {\n void formMethods.handleSubmit(\n async (data: WorkAddressFormOutputs) => {\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 work address')\n }\n\n let updatedWorkAddress: EmployeeWorkAddress\n\n if (isCreateMode) {\n const resolvedEffectiveDate =\n withEffectiveDateField && payload.effectiveDate\n ? payload.effectiveDate\n : options?.effectiveDate\n\n const result = await createWorkAddressMutation.mutateAsync({\n request: {\n employeeId: resolvedEmployeeId,\n requestBody: {\n locationUuid: payload.locationUuid,\n effectiveDate: resolvedEffectiveDate\n ? new RFCDate(new Date(resolvedEffectiveDate))\n : undefined,\n },\n },\n })\n\n if (!result.employeeWorkAddress) {\n throw new SDKInternalError('Work address creation failed')\n }\n\n updatedWorkAddress = result.employeeWorkAddress\n callbacks?.onWorkAddressCreated?.(updatedWorkAddress)\n } else {\n const result = await updateWorkAddressMutation.mutateAsync({\n request: {\n workAddressUuid: currentWorkAddress.uuid,\n requestBody: {\n version: currentWorkAddress.version,\n locationUuid: payload.locationUuid,\n },\n },\n })\n\n if (!result.employeeWorkAddress) {\n throw new SDKInternalError('Work address update failed')\n }\n\n updatedWorkAddress = result.employeeWorkAddress\n callbacks?.onWorkAddressUpdated?.(updatedWorkAddress)\n }\n\n submitResult = {\n mode: isCreateMode ? 'create' : 'update',\n data: updatedWorkAddress,\n }\n })\n resolve()\n },\n () => {\n resolve()\n },\n )()\n })\n\n return submitResult\n }\n\n const isDataLoading =\n locationsQuery.isLoading || (employeeId ? workAddressesQuery.isLoading : false)\n\n if (isDataLoading || !companyLocations || (employeeId && !workAddresses)) {\n return { isLoading: true as const, errorHandling }\n }\n\n return {\n isLoading: false as const,\n data: {\n workAddress: currentWorkAddress ?? null,\n workAddresses,\n companyLocations,\n },\n status: {\n isPending,\n mode: isCreateMode ? ('create' as const) : ('update' as const),\n },\n actions: { onSubmit },\n errorHandling,\n form: {\n Fields: {\n Location: LocationField,\n EffectiveDate: withEffectiveDateField && isCreateMode ? EffectiveDateField : undefined,\n },\n fieldsMetadata,\n hookFormInternals: { formMethods },\n getFormSubmissionValues: createGetFormSubmissionValues(formMethods, schema),\n },\n }\n}\n\nexport type UseWorkAddressFormResult = ReturnType<typeof useWorkAddressForm>\nexport type UseWorkAddressFormReady = Extract<UseWorkAddressFormResult, { data: object }>\nexport type WorkAddressFieldsMetadata = UseWorkAddressFormReady['form']['fieldsMetadata']\nexport type WorkAddressFormFields = UseWorkAddressFormReady['form']['Fields']\n"],"names":["useWorkAddressForm","companyId","employeeId","withEffectiveDateField","requiredFields","partnerDefaults","validationMode","shouldFocusError","locationsQuery","useLocationsGet","workAddressesQuery","useEmployeeAddressesGetWorkAddresses","companyLocations","workAddresses","currentWorkAddress","address","isCreateMode","schema","createWorkAddressSchema","resolvedDefaults","formMethods","useForm","zodResolver","createWorkAddressMutation","useEmployeeAddressesCreateWorkAddressMutation","updateWorkAddressMutation","useEmployeeAddressesUpdateWorkAddressMutation","isPending","baseSubmitHandler","submitError","setError","useBaseSubmit","errorHandling","useErrorHandling","locationOptions","location","addressInline","baseMetadata","deriveFieldsMetadata","fieldsMetadata","withOptions","onSubmit","callbacks","options","submitResult","resolve","data","payload","resolvedEmployeeId","SDKInternalError","updatedWorkAddress","resolvedEffectiveDate","result","RFCDate","LocationField","EffectiveDateField","createGetFormSubmissionValues"],"mappings":";;;;;;;;;;;;;;;;AAiDO,SAASA,GAAmB;AAAA,EACjC,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,wBAAAC,IAAyB;AAAA,EACzB,gBAAAC;AAAA,EACA,eAAeC;AAAA,EACf,gBAAAC,IAAiB;AAAA,EACjB,kBAAAC,IAAmB;AACrB,GAA4B;AAC1B,QAAMC,IAAiBC,EAAgB,EAAE,WAAAR,GAAW,GAC9CS,IAAqBC;AAAA,IACzB,EAAE,YAAYT,KAAc,GAAA;AAAA,IAC5B,EAAE,SAAS,CAAC,CAACA,EAAA;AAAA,EAAW,GAGpBU,IAAmBJ,EAAe,MAAM,sBACxCK,IAAgBH,EAAmB,MAAM,2BACzCI,IAAqBD,GAAe,KAAK,CAAAE,MAAWA,EAAQ,MAAM,GAElEC,IAAe,CAACF,GAGhBG,IAASC,EAAwB;AAAA,IACrC,MAHWF,IAAe,WAAW;AAAA,IAIrC,gBAAAZ;AAAA,IACA,wBAAAD;AAAA,EAAA,CACD,GAEKgB,IAAwC;AAAA,IAC5C,cAAcL,GAAoB,gBAAgBT,GAAiB,gBAAgB;AAAA,IACnF,eAAeS,GAAoB,iBAAiBT,GAAiB,iBAAiB;AAAA,EAAA,GAGlFe,IAAcC,EAA8D;AAAA,IAChF,UAAUC,EAAYL,CAAM;AAAA,IAC5B,MAAMX;AAAA,IACN,kBAAAC;AAAA,IACA,eAAeY;AAAA,IACf,QAAQA;AAAA,IACR,cAAc,EAAE,iBAAiB,GAAA;AAAA,EAAK,CACvC,GAEKI,IAA4BC,EAAA,GAC5BC,IAA4BC,EAAA,GAE5BC,IAAYJ,EAA0B,aAAaE,EAA0B,WAE7E,EAAE,mBAAAG,GAAmB,OAAOC,GAAa,UAAAC,EAAA,IAAaC,EAAc,iBAAiB,GAGrFC,IAAgBC,EADN/B,IAAa,CAACM,GAAgBE,CAAkB,IAAI,CAACF,CAAc,GACnC,EAAE,OAAOqB,GAAa,UAAAC,GAAU,GAE1EI,KAAmBtB,KAAoB,CAAA,GAAI,IAAI,CAAAuB,OAAa;AAAA,IAChE,OAAOA,EAAS;AAAA,IAChB,OAAOC,EAAcD,CAAQ;AAAA,EAAA,EAC7B,GAEIE,IAAeC,EAAqBrB,CAAM,GAC1CsB,IAAiB;AAAA,IACrB,cAAcC;AAAA,MACZH,EAAa;AAAA,MACbH;AAAA,MACAtB,KAAoB,CAAA;AAAA,IAAC;AAAA,IAEvB,eAAeyB,EAAa;AAAA,EAAA,GAGxBI,IAAW,OACfC,GACAC,MAC+D;AAC/D,QAAIC;AAEJ,iBAAM,IAAI,QAAc,CAAAC,MAAW;AACjC,MAAKzB,EAAY;AAAA,QACf,OAAO0B,MAAiC;AACtC,gBAAMlB,EAAkBkB,GAAM,OAAMC,MAAW;AAC7C,kBAAMC,IAAqBL,GAAS,cAAczC;AAElD,gBAAI,CAAC8C;AACH,oBAAM,IAAIC,EAAiB,+CAA+C;AAG5E,gBAAIC;AAEJ,gBAAIlC,GAAc;AAChB,oBAAMmC,IACJhD,KAA0B4C,EAAQ,gBAC9BA,EAAQ,gBACRJ,GAAS,eAETS,IAAS,MAAM7B,EAA0B,YAAY;AAAA,gBACzD,SAAS;AAAA,kBACP,YAAYyB;AAAA,kBACZ,aAAa;AAAA,oBACX,cAAcD,EAAQ;AAAA,oBACtB,eAAeI,IACX,IAAIE,EAAQ,IAAI,KAAKF,CAAqB,CAAC,IAC3C;AAAA,kBAAA;AAAA,gBACN;AAAA,cACF,CACD;AAED,kBAAI,CAACC,EAAO;AACV,sBAAM,IAAIH,EAAiB,8BAA8B;AAG3D,cAAAC,IAAqBE,EAAO,qBAC5BV,GAAW,uBAAuBQ,CAAkB;AAAA,YACtD,OAAO;AACL,oBAAME,IAAS,MAAM3B,EAA0B,YAAY;AAAA,gBACzD,SAAS;AAAA,kBACP,iBAAiBX,EAAmB;AAAA,kBACpC,aAAa;AAAA,oBACX,SAASA,EAAmB;AAAA,oBAC5B,cAAciC,EAAQ;AAAA,kBAAA;AAAA,gBACxB;AAAA,cACF,CACD;AAED,kBAAI,CAACK,EAAO;AACV,sBAAM,IAAIH,EAAiB,4BAA4B;AAGzD,cAAAC,IAAqBE,EAAO,qBAC5BV,GAAW,uBAAuBQ,CAAkB;AAAA,YACtD;AAEA,YAAAN,IAAe;AAAA,cACb,MAAM5B,IAAe,WAAW;AAAA,cAChC,MAAMkC;AAAA,YAAA;AAAA,UAEV,CAAC,GACDL,EAAA;AAAA,QACF;AAAA,QACA,MAAM;AACJ,UAAAA,EAAA;AAAA,QACF;AAAA,MAAA,EACF;AAAA,IACF,CAAC,GAEMD;AAAA,EACT;AAKA,SAFEpC,EAAe,cAAcN,IAAaQ,EAAmB,YAAY,OAEtD,CAACE,KAAqBV,KAAc,CAACW,IACjD,EAAE,WAAW,IAAe,eAAAmB,EAAA,IAG9B;AAAA,IACL,WAAW;AAAA,IACX,MAAM;AAAA,MACJ,aAAalB,KAAsB;AAAA,MACnC,eAAAD;AAAA,MACA,kBAAAD;AAAA,IAAA;AAAA,IAEF,QAAQ;AAAA,MACN,WAAAe;AAAA,MACA,MAAMX,IAAgB,WAAsB;AAAA,IAAA;AAAA,IAE9C,SAAS,EAAE,UAAAyB,EAAA;AAAA,IACX,eAAAT;AAAA,IACA,MAAM;AAAA,MACJ,QAAQ;AAAA,QACN,UAAUsB;AAAA,QACV,eAAenD,KAA0Ba,IAAeuC,IAAqB;AAAA,MAAA;AAAA,MAE/E,gBAAAhB;AAAA,MACA,mBAAmB,EAAE,aAAAnB,EAAA;AAAA,MACrB,yBAAyBoC,EAA8BpC,GAAaH,CAAM;AAAA,IAAA;AAAA,EAC5E;AAEJ;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { RequiredFields } from '../../form/resolveRequiredFields';
|
|
3
|
+
export declare const WorkAddressErrorCodes: {
|
|
4
|
+
readonly REQUIRED: "REQUIRED";
|
|
5
|
+
};
|
|
6
|
+
export type WorkAddressErrorCode = (typeof WorkAddressErrorCodes)[keyof typeof WorkAddressErrorCodes];
|
|
7
|
+
declare const fieldValidators: {
|
|
8
|
+
locationUuid: z.ZodString;
|
|
9
|
+
effectiveDate: z.ZodISODate;
|
|
10
|
+
};
|
|
11
|
+
export type WorkAddressField = keyof typeof fieldValidators;
|
|
12
|
+
export type WorkAddressFormData = {
|
|
13
|
+
[K in keyof typeof fieldValidators]: z.infer<(typeof fieldValidators)[K]>;
|
|
14
|
+
};
|
|
15
|
+
export type WorkAddressFormOutputs = WorkAddressFormData;
|
|
16
|
+
interface WorkAddressSchemaOptions {
|
|
17
|
+
mode?: 'create' | 'update';
|
|
18
|
+
requiredFields?: RequiredFields<WorkAddressField>;
|
|
19
|
+
withEffectiveDateField?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare function createWorkAddressSchema(options?: WorkAddressSchemaOptions): z.ZodObject<{
|
|
22
|
+
locationUuid: z.ZodString;
|
|
23
|
+
effectiveDate: z.ZodISODate;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z as r } from "zod";
|
|
2
|
+
import { composeFormSchema as c } from "../../form/composeFormSchema.js";
|
|
3
|
+
import { filterRequiredFields as n } from "../../form/resolveRequiredFields.js";
|
|
4
|
+
const t = {
|
|
5
|
+
REQUIRED: "REQUIRED"
|
|
6
|
+
}, E = {
|
|
7
|
+
locationUuid: r.string().min(1, { message: t.REQUIRED }),
|
|
8
|
+
effectiveDate: r.iso.date({ error: () => t.REQUIRED })
|
|
9
|
+
}, a = /* @__PURE__ */ new Set(["locationUuid"]), R = /* @__PURE__ */ new Set(["locationUuid"]);
|
|
10
|
+
function l(i = {}) {
|
|
11
|
+
const { mode: o = "create", requiredFields: e, withEffectiveDateField: d = !0 } = i, s = d ? e : n(e, "effectiveDate");
|
|
12
|
+
return c({
|
|
13
|
+
fieldValidators: E,
|
|
14
|
+
requiredOnCreate: a,
|
|
15
|
+
requiredOnUpdate: R,
|
|
16
|
+
mode: o,
|
|
17
|
+
requiredFields: s
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
t as WorkAddressErrorCodes,
|
|
22
|
+
l as createWorkAddressSchema
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=workAddressSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workAddressSchema.js","sources":["../../../../../src/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.ts"],"sourcesContent":["import { z } from 'zod'\nimport { composeFormSchema } from '../../form/composeFormSchema'\nimport { filterRequiredFields, type RequiredFields } from '../../form/resolveRequiredFields'\n\nexport const WorkAddressErrorCodes = {\n REQUIRED: 'REQUIRED',\n} as const\n\nexport type WorkAddressErrorCode =\n (typeof WorkAddressErrorCodes)[keyof typeof WorkAddressErrorCodes]\n\nconst fieldValidators = {\n locationUuid: z.string().min(1, { message: WorkAddressErrorCodes.REQUIRED }),\n effectiveDate: z.iso.date({ error: () => WorkAddressErrorCodes.REQUIRED }),\n}\n\nexport type WorkAddressField = keyof typeof fieldValidators\n\nexport type WorkAddressFormData = {\n [K in keyof typeof fieldValidators]: z.infer<(typeof fieldValidators)[K]>\n}\nexport type WorkAddressFormOutputs = WorkAddressFormData\n\nconst REQUIRED_ON_CREATE = new Set<WorkAddressField>(['locationUuid'])\nconst REQUIRED_ON_UPDATE = new Set<WorkAddressField>(['locationUuid'])\n\ninterface WorkAddressSchemaOptions {\n mode?: 'create' | 'update'\n requiredFields?: RequiredFields<WorkAddressField>\n withEffectiveDateField?: boolean\n}\n\nexport function createWorkAddressSchema(options: WorkAddressSchemaOptions = {}) {\n const { mode = 'create', requiredFields, withEffectiveDateField = true } = options\n\n const effectiveRequiredFields = withEffectiveDateField\n ? requiredFields\n : filterRequiredFields(requiredFields, 'effectiveDate')\n\n return composeFormSchema({\n fieldValidators,\n requiredOnCreate: REQUIRED_ON_CREATE,\n requiredOnUpdate: REQUIRED_ON_UPDATE,\n mode,\n requiredFields: effectiveRequiredFields,\n })\n}\n"],"names":["WorkAddressErrorCodes","fieldValidators","z","REQUIRED_ON_CREATE","REQUIRED_ON_UPDATE","createWorkAddressSchema","options","mode","requiredFields","withEffectiveDateField","effectiveRequiredFields","filterRequiredFields","composeFormSchema"],"mappings":";;;AAIO,MAAMA,IAAwB;AAAA,EACnC,UAAU;AACZ,GAKMC,IAAkB;AAAA,EACtB,cAAcC,EAAE,OAAA,EAAS,IAAI,GAAG,EAAE,SAASF,EAAsB,UAAU;AAAA,EAC3E,eAAeE,EAAE,IAAI,KAAK,EAAE,OAAO,MAAMF,EAAsB,SAAA,CAAU;AAC3E,GASMG,IAAqB,oBAAI,IAAsB,CAAC,cAAc,CAAC,GAC/DC,IAAqB,oBAAI,IAAsB,CAAC,cAAc,CAAC;AAQ9D,SAASC,EAAwBC,IAAoC,IAAI;AAC9E,QAAM,EAAE,MAAAC,IAAO,UAAU,gBAAAC,GAAgB,wBAAAC,IAAyB,OAASH,GAErEI,IAA0BD,IAC5BD,IACAG,EAAqBH,GAAgB,eAAe;AAExD,SAAOI,EAAkB;AAAA,IACvB,iBAAAX;AAAA,IACA,kBAAkBE;AAAA,IAClB,kBAAkBC;AAAA,IAClB,MAAAG;AAAA,IACA,gBAAgBG;AAAA,EAAA,CACjB;AACH;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./types/i18next.d.ts"
|
|
2
|
+
export type { HookFormInternals, HookLoadingResult, HookSubmitResult, HookErrorHandling, BaseHookReady, BaseFormHookReady, } from './types';
|
|
3
|
+
export { useErrorHandling } from './useErrorHandling';
|
|
4
|
+
export type { FieldMetadata, FieldMetadataWithOptions, FieldsMetadata, FormFieldsMetadataContextValue, ValidationMessages, BaseFieldProps, TextInputHookFieldProps, SelectHookFieldProps, CheckboxHookFieldProps, NumberInputHookFieldProps, DatePickerHookFieldProps, RadioGroupHookFieldProps, TextInputProps, SelectProps, SelectOption, CheckboxProps, NumberInputProps, DatePickerProps, RadioGroupProps, RadioGroupOption, SwitchHookFieldProps, SwitchProps, } from './form';
|
|
5
|
+
export { collectErrors } from './collectErrors';
|
|
6
|
+
export { withOptions, FormFieldsMetadataProvider, SDKFormProvider, useFieldsMetadata, useFieldErrorMessage, deriveFieldsMetadata, composeSubmitHandler, TextInputHookField, SelectHookField, CheckboxHookField, NumberInputHookField, DatePickerHookField, RadioGroupHookField, SwitchHookField, } from './form';
|
|
7
|
+
export { useCompensationForm, CompensationForm, CompensationErrorCodes, createCompensationSchema, type CompensationFormProps, type CompensationSubmitCallbacks, type CompensationSubmitOptions, type CompensationRequiredFields, type UseCompensationFormProps, type UseCompensationFormResult, type UseCompensationFormReady, type CompensationFieldsMetadata, type CompensationFormFields, type CompensationErrorCode, type CompensationField, type CompensationFormData, type CompensationFormOutputs, type RequiredValidation, type RateValidation, type StartDateFieldProps, type JobTitleFieldProps, type FlsaStatusFieldProps, type RateFieldProps, type PaymentUnitFieldProps, type AdjustForMinimumWageFieldProps, type MinimumWageIdFieldProps, type TwoPercentShareholderFieldProps, type StateWcCoveredFieldProps, type StateWcClassCodeFieldProps, } from './hooks/useCompensationForm';
|
|
8
|
+
export { useEmployeeDetailsForm, EmployeeDetailsForm, EmployeeDetailsErrorCodes, createEmployeeDetailsSchema, type EmployeeDetailsFormProps, type EmployeeDetailsSubmitCallbacks, type EmployeeDetailsRequiredFields, type UseEmployeeDetailsFormProps, type UseEmployeeDetailsFormResult, type UseEmployeeDetailsFormReady, type EmployeeDetailsFieldsMetadata, type EmployeeDetailsFormFields, type EmployeeDetailsErrorCode, type EmployeeDetailsFormData, type EmployeeDetailsFormOutputs, type EmployeeDetailsField, type EmployeeDetailsRequiredValidation, type NameValidation, type EmailValidation, type SsnValidation, type FirstNameFieldProps, type MiddleInitialFieldProps, type LastNameFieldProps, type EmailFieldProps, type DateOfBirthFieldProps, type SsnFieldProps, type SelfOnboardingFieldProps, } from './hooks/useEmployeeDetailsForm';
|
|
9
|
+
export { useWorkAddressForm, WorkAddressForm, WorkAddressErrorCodes, createWorkAddressSchema, type WorkAddressFormProps, type WorkAddressSubmitCallbacks, type WorkAddressSubmitOptions, type WorkAddressRequiredFields, type UseWorkAddressFormProps, type UseWorkAddressFormResult, type UseWorkAddressFormReady, type WorkAddressFieldsMetadata, type WorkAddressFormFields, type WorkAddressErrorCode, type WorkAddressFormData, type WorkAddressFormOutputs, type WorkAddressField, type WorkAddressRequiredValidation, type LocationFieldProps, type EffectiveDateFieldProps, } from './hooks/useWorkAddressForm';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { UseFormReturn, FieldValues } from 'react-hook-form';
|
|
2
|
+
import { FieldsMetadata } from './form/types';
|
|
3
|
+
import { SDKError } from '../../types/sdkError';
|
|
4
|
+
/** Exposes react-hook-form internals for SDK utilities and advanced partner use cases. */
|
|
5
|
+
export interface HookFormInternals<TFormData extends FieldValues = FieldValues> {
|
|
6
|
+
formMethods: UseFormReturn<TFormData>;
|
|
7
|
+
}
|
|
8
|
+
/** Discriminated union member returned while async data is being fetched. */
|
|
9
|
+
export interface HookLoadingResult {
|
|
10
|
+
isLoading: true;
|
|
11
|
+
errorHandling: HookErrorHandling;
|
|
12
|
+
}
|
|
13
|
+
/** Result shape returned by a successful form submission. */
|
|
14
|
+
export interface HookSubmitResult<T> {
|
|
15
|
+
mode: 'create' | 'update';
|
|
16
|
+
data: T;
|
|
17
|
+
}
|
|
18
|
+
/** Error state and recovery actions returned by all hooks. */
|
|
19
|
+
export interface HookErrorHandling {
|
|
20
|
+
errors: SDKError[];
|
|
21
|
+
retryQueries: () => void;
|
|
22
|
+
clearSubmitError: () => void;
|
|
23
|
+
}
|
|
24
|
+
/** Base shape for non-form hooks. Individual hooks override `data`. */
|
|
25
|
+
export interface BaseHookReady {
|
|
26
|
+
isLoading: false;
|
|
27
|
+
data: Record<string, unknown>;
|
|
28
|
+
status: {
|
|
29
|
+
isPending: boolean;
|
|
30
|
+
};
|
|
31
|
+
errorHandling: HookErrorHandling;
|
|
32
|
+
}
|
|
33
|
+
/** Base shape for form hooks. Individual hooks override `data`, `actions`, and `form`. */
|
|
34
|
+
export interface BaseFormHookReady<TFieldsMetadata extends FieldsMetadata = FieldsMetadata> {
|
|
35
|
+
isLoading: false;
|
|
36
|
+
data: Record<string, unknown>;
|
|
37
|
+
status: {
|
|
38
|
+
isPending: boolean;
|
|
39
|
+
mode: 'create' | 'update';
|
|
40
|
+
};
|
|
41
|
+
actions: Record<string, unknown>;
|
|
42
|
+
errorHandling: HookErrorHandling;
|
|
43
|
+
form: {
|
|
44
|
+
Fields: Record<string, unknown>;
|
|
45
|
+
fieldsMetadata: TFieldsMetadata;
|
|
46
|
+
hookFormInternals: HookFormInternals;
|
|
47
|
+
getFormSubmissionValues: () => Record<string, unknown> | undefined;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import { HookErrorHandling } from './types';
|
|
3
|
+
import { SDKError } from '../../types/sdkError';
|
|
4
|
+
type QueryWithRefetch = Pick<UseQueryResult, 'error' | 'refetch'>;
|
|
5
|
+
export declare function useErrorHandling(queries: QueryWithRefetch[], submitState: {
|
|
6
|
+
error: SDKError | null;
|
|
7
|
+
setError: (error: SDKError | null) => void;
|
|
8
|
+
}): HookErrorHandling;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { collectErrors as t } from "./collectErrors.js";
|
|
2
|
+
function i(o, e) {
|
|
3
|
+
return { errors: t(o, e.error), retryQueries: () => {
|
|
4
|
+
o.filter((r) => r.error != null).forEach((r) => void r.refetch());
|
|
5
|
+
}, clearSubmitError: () => {
|
|
6
|
+
e.setError(null);
|
|
7
|
+
} };
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
i as useErrorHandling
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=useErrorHandling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useErrorHandling.js","sources":["../../../src/components/UNSTABLE_Hooks/useErrorHandling.ts"],"sourcesContent":["import type { UseQueryResult } from '@tanstack/react-query'\nimport { collectErrors } from './collectErrors'\nimport type { HookErrorHandling } from './types'\nimport type { SDKError } from '@/types/sdkError'\n\ntype QueryWithRefetch = Pick<UseQueryResult, 'error' | 'refetch'>\n\nexport function useErrorHandling(\n queries: QueryWithRefetch[],\n submitState: { error: SDKError | null; setError: (error: SDKError | null) => void },\n): HookErrorHandling {\n const errors = collectErrors(queries, submitState.error)\n\n const retryQueries = () => {\n queries.filter(q => q.error != null).forEach(q => void q.refetch())\n }\n\n const clearSubmitError = () => {\n submitState.setError(null)\n }\n\n return { errors, retryQueries, clearSubmitError }\n}\n"],"names":["useErrorHandling","queries","submitState","collectErrors","q"],"mappings":";AAOO,SAASA,EACdC,GACAC,GACmB;AAWnB,SAAO,EAAE,QAVMC,EAAcF,GAASC,EAAY,KAAK,GAUtC,cARI,MAAM;AACzB,IAAAD,EAAQ,OAAO,CAAAG,MAAKA,EAAE,SAAS,IAAI,EAAE,QAAQ,CAAAA,MAAK,KAAKA,EAAE,QAAA,CAAS;AAAA,EACpE,GAM+B,kBAJN,MAAM;AAC7B,IAAAF,EAAY,SAAS,IAAI;AAAA,EAC3B,EAE+B;AACjC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { QueryClient as H, QueryClientProvider as
|
|
3
|
-
import { GustoEmbeddedProvider as
|
|
4
|
-
import { GustoEmbeddedCore as
|
|
5
|
-
import { SDKHooks as
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { QueryClient as H, QueryClientProvider as b } from "@tanstack/react-query";
|
|
3
|
+
import { GustoEmbeddedProvider as g } from "@gusto/embedded-api/react-query/_context";
|
|
4
|
+
import { GustoEmbeddedCore as E } from "@gusto/embedded-api/core";
|
|
5
|
+
import { SDKHooks as R } from "@gusto/embedded-api/hooks/hooks";
|
|
6
6
|
import { useMemo as a } from "react";
|
|
7
7
|
import { apiVersionHook as q } from "./apiVersionHook.js";
|
|
8
8
|
function A({
|
|
@@ -13,13 +13,13 @@ function A({
|
|
|
13
13
|
queryClient: i
|
|
14
14
|
}) {
|
|
15
15
|
const m = a(() => {
|
|
16
|
-
const r = new
|
|
16
|
+
const r = new E({
|
|
17
17
|
serverURL: f
|
|
18
|
-
}), t = r._options.hooks || new
|
|
18
|
+
}), t = r._options.hooks || new R();
|
|
19
19
|
if (t.registerBeforeRequestHook(q), s) {
|
|
20
20
|
const o = {
|
|
21
|
-
beforeRequest: (
|
|
22
|
-
|
|
21
|
+
beforeRequest: (y, n) => (new Headers(s).forEach((u, l) => {
|
|
22
|
+
u && n.headers.set(l, u);
|
|
23
23
|
}), n)
|
|
24
24
|
};
|
|
25
25
|
t.registerBeforeRequestHook(o);
|
|
@@ -37,11 +37,11 @@ function A({
|
|
|
37
37
|
if (i)
|
|
38
38
|
return i;
|
|
39
39
|
const r = new H(), t = async () => {
|
|
40
|
-
await r.invalidateQueries();
|
|
40
|
+
await r.invalidateQueries({ queryKey: ["@gusto/embedded-api"] });
|
|
41
41
|
};
|
|
42
42
|
return r.setQueryDefaults(["@gusto/embedded-api"], { retry: !1 }), r.setMutationDefaults(["@gusto/embedded-api"], { onSuccess: t, retry: !1 }), r;
|
|
43
43
|
}, [i]);
|
|
44
|
-
return /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ c(b, { client: p, children: /* @__PURE__ */ c(g, { client: m, children: d }) });
|
|
45
45
|
}
|
|
46
46
|
export {
|
|
47
47
|
A as ApiProvider
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiProvider.js","sources":["../../../src/contexts/ApiProvider/ApiProvider.tsx"],"sourcesContent":["import { QueryClient, QueryClientProvider } from '@tanstack/react-query'\nimport { GustoEmbeddedProvider } from '@gusto/embedded-api/react-query/_context'\nimport { GustoEmbeddedCore } from '@gusto/embedded-api/core'\nimport { SDKHooks as NativeSDKHooks } from '@gusto/embedded-api/hooks/hooks'\nimport { useMemo } from 'react'\nimport { apiVersionHook } from './apiVersionHook'\nimport type { SDKHooks, BeforeRequestHook } from '@/types/hooks'\n\nexport interface ApiProviderProps {\n url: string\n headers?: HeadersInit\n hooks?: SDKHooks\n children: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport function ApiProvider({\n url,\n headers,\n hooks,\n children,\n queryClient: queryClientFromProps,\n}: ApiProviderProps) {\n const gustoClient = useMemo(() => {\n const client = new GustoEmbeddedCore({\n serverURL: url,\n })\n\n const sdkHooks = client._options.hooks || new NativeSDKHooks()\n\n sdkHooks.registerBeforeRequestHook(apiVersionHook)\n\n if (headers) {\n const defaultHeaderHook: BeforeRequestHook = {\n beforeRequest: (context, request) => {\n const headersInstance = new Headers(headers)\n headersInstance.forEach((headerValue, headerName) => {\n if (headerValue) {\n request.headers.set(headerName, headerValue)\n }\n })\n return request\n },\n }\n sdkHooks.registerBeforeRequestHook(defaultHeaderHook)\n }\n\n if (hooks?.beforeCreateRequest) {\n hooks.beforeCreateRequest.forEach(hook => {\n sdkHooks.registerBeforeCreateRequestHook(hook)\n })\n }\n\n if (hooks?.beforeRequest) {\n hooks.beforeRequest.forEach(hook => {\n sdkHooks.registerBeforeRequestHook(hook)\n })\n }\n\n if (hooks?.afterSuccess) {\n hooks.afterSuccess.forEach(hook => {\n sdkHooks.registerAfterSuccessHook(hook)\n })\n }\n\n if (hooks?.afterError) {\n hooks.afterError.forEach(hook => {\n sdkHooks.registerAfterErrorHook(hook)\n })\n }\n\n if (!client._options.hooks) {\n client._options.hooks = sdkHooks\n }\n\n return client\n }, [url, headers, hooks])\n\n const queryClient = useMemo(() => {\n if (queryClientFromProps) {\n return queryClientFromProps\n }\n\n // Create and configure a new QueryClient for internal SDK use\n const client = new QueryClient()\n\n const onSuccess = async () => {\n await client.invalidateQueries()\n }\n client.setQueryDefaults(['@gusto/embedded-api'], { retry: false })\n client.setMutationDefaults(['@gusto/embedded-api'], { onSuccess, retry: false })\n\n return client\n }, [queryClientFromProps])\n\n return (\n <QueryClientProvider client={queryClient}>\n <GustoEmbeddedProvider client={gustoClient}>{children}</GustoEmbeddedProvider>\n </QueryClientProvider>\n )\n}\n"],"names":["ApiProvider","url","headers","hooks","children","queryClientFromProps","gustoClient","useMemo","client","GustoEmbeddedCore","sdkHooks","NativeSDKHooks","apiVersionHook","defaultHeaderHook","context","request","headerValue","headerName","hook","queryClient","QueryClient","onSuccess","jsx","QueryClientProvider","GustoEmbeddedProvider"],"mappings":";;;;;;;AAgBO,SAASA,EAAY;AAAA,EAC1B,KAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAaC;AACf,GAAqB;AACnB,QAAMC,IAAcC,EAAQ,MAAM;AAChC,UAAMC,IAAS,IAAIC,EAAkB;AAAA,MACnC,WAAWR;AAAA,IAAA,CACZ,GAEKS,IAAWF,EAAO,SAAS,SAAS,IAAIG,EAAA;AAI9C,QAFAD,EAAS,0BAA0BE,CAAc,GAE7CV,GAAS;AACX,YAAMW,IAAuC;AAAA,QAC3C,eAAe,CAACC,GAASC,OACC,IAAI,QAAQb,CAAO,EAC3B,QAAQ,CAACc,GAAaC,MAAe;AACnD,UAAID,KACFD,EAAQ,QAAQ,IAAIE,GAAYD,CAAW;AAAA,QAE/C,CAAC,GACMD;AAAA,MACT;AAEF,MAAAL,EAAS,0BAA0BG,CAAiB;AAAA,IACtD;AAEA,WAAIV,GAAO,uBACTA,EAAM,oBAAoB,QAAQ,CAAAe,MAAQ;AACxC,MAAAR,EAAS,gCAAgCQ,CAAI;AAAA,IAC/C,CAAC,GAGCf,GAAO,iBACTA,EAAM,cAAc,QAAQ,CAAAe,MAAQ;AAClC,MAAAR,EAAS,0BAA0BQ,CAAI;AAAA,IACzC,CAAC,GAGCf,GAAO,gBACTA,EAAM,aAAa,QAAQ,CAAAe,MAAQ;AACjC,MAAAR,EAAS,yBAAyBQ,CAAI;AAAA,IACxC,CAAC,GAGCf,GAAO,cACTA,EAAM,WAAW,QAAQ,CAAAe,MAAQ;AAC/B,MAAAR,EAAS,uBAAuBQ,CAAI;AAAA,IACtC,CAAC,GAGEV,EAAO,SAAS,UACnBA,EAAO,SAAS,QAAQE,IAGnBF;AAAA,EACT,GAAG,CAACP,GAAKC,GAASC,CAAK,CAAC,GAElBgB,IAAcZ,EAAQ,MAAM;AAChC,QAAIF;AACF,aAAOA;AAIT,UAAMG,IAAS,IAAIY,EAAA,GAEbC,IAAY,YAAY;AAC5B,YAAMb,EAAO,
|
|
1
|
+
{"version":3,"file":"ApiProvider.js","sources":["../../../src/contexts/ApiProvider/ApiProvider.tsx"],"sourcesContent":["import { QueryClient, QueryClientProvider } from '@tanstack/react-query'\nimport { GustoEmbeddedProvider } from '@gusto/embedded-api/react-query/_context'\nimport { GustoEmbeddedCore } from '@gusto/embedded-api/core'\nimport { SDKHooks as NativeSDKHooks } from '@gusto/embedded-api/hooks/hooks'\nimport { useMemo } from 'react'\nimport { apiVersionHook } from './apiVersionHook'\nimport type { SDKHooks, BeforeRequestHook } from '@/types/hooks'\n\nexport interface ApiProviderProps {\n url: string\n headers?: HeadersInit\n hooks?: SDKHooks\n children: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport function ApiProvider({\n url,\n headers,\n hooks,\n children,\n queryClient: queryClientFromProps,\n}: ApiProviderProps) {\n const gustoClient = useMemo(() => {\n const client = new GustoEmbeddedCore({\n serverURL: url,\n })\n\n const sdkHooks = client._options.hooks || new NativeSDKHooks()\n\n sdkHooks.registerBeforeRequestHook(apiVersionHook)\n\n if (headers) {\n const defaultHeaderHook: BeforeRequestHook = {\n beforeRequest: (context, request) => {\n const headersInstance = new Headers(headers)\n headersInstance.forEach((headerValue, headerName) => {\n if (headerValue) {\n request.headers.set(headerName, headerValue)\n }\n })\n return request\n },\n }\n sdkHooks.registerBeforeRequestHook(defaultHeaderHook)\n }\n\n if (hooks?.beforeCreateRequest) {\n hooks.beforeCreateRequest.forEach(hook => {\n sdkHooks.registerBeforeCreateRequestHook(hook)\n })\n }\n\n if (hooks?.beforeRequest) {\n hooks.beforeRequest.forEach(hook => {\n sdkHooks.registerBeforeRequestHook(hook)\n })\n }\n\n if (hooks?.afterSuccess) {\n hooks.afterSuccess.forEach(hook => {\n sdkHooks.registerAfterSuccessHook(hook)\n })\n }\n\n if (hooks?.afterError) {\n hooks.afterError.forEach(hook => {\n sdkHooks.registerAfterErrorHook(hook)\n })\n }\n\n if (!client._options.hooks) {\n client._options.hooks = sdkHooks\n }\n\n return client\n }, [url, headers, hooks])\n\n const queryClient = useMemo(() => {\n if (queryClientFromProps) {\n return queryClientFromProps\n }\n\n // Create and configure a new QueryClient for internal SDK use\n const client = new QueryClient()\n\n const onSuccess = async () => {\n await client.invalidateQueries({ queryKey: ['@gusto/embedded-api'] })\n }\n client.setQueryDefaults(['@gusto/embedded-api'], { retry: false })\n client.setMutationDefaults(['@gusto/embedded-api'], { onSuccess, retry: false })\n\n return client\n }, [queryClientFromProps])\n\n return (\n <QueryClientProvider client={queryClient}>\n <GustoEmbeddedProvider client={gustoClient}>{children}</GustoEmbeddedProvider>\n </QueryClientProvider>\n )\n}\n"],"names":["ApiProvider","url","headers","hooks","children","queryClientFromProps","gustoClient","useMemo","client","GustoEmbeddedCore","sdkHooks","NativeSDKHooks","apiVersionHook","defaultHeaderHook","context","request","headerValue","headerName","hook","queryClient","QueryClient","onSuccess","jsx","QueryClientProvider","GustoEmbeddedProvider"],"mappings":";;;;;;;AAgBO,SAASA,EAAY;AAAA,EAC1B,KAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAaC;AACf,GAAqB;AACnB,QAAMC,IAAcC,EAAQ,MAAM;AAChC,UAAMC,IAAS,IAAIC,EAAkB;AAAA,MACnC,WAAWR;AAAA,IAAA,CACZ,GAEKS,IAAWF,EAAO,SAAS,SAAS,IAAIG,EAAA;AAI9C,QAFAD,EAAS,0BAA0BE,CAAc,GAE7CV,GAAS;AACX,YAAMW,IAAuC;AAAA,QAC3C,eAAe,CAACC,GAASC,OACC,IAAI,QAAQb,CAAO,EAC3B,QAAQ,CAACc,GAAaC,MAAe;AACnD,UAAID,KACFD,EAAQ,QAAQ,IAAIE,GAAYD,CAAW;AAAA,QAE/C,CAAC,GACMD;AAAA,MACT;AAEF,MAAAL,EAAS,0BAA0BG,CAAiB;AAAA,IACtD;AAEA,WAAIV,GAAO,uBACTA,EAAM,oBAAoB,QAAQ,CAAAe,MAAQ;AACxC,MAAAR,EAAS,gCAAgCQ,CAAI;AAAA,IAC/C,CAAC,GAGCf,GAAO,iBACTA,EAAM,cAAc,QAAQ,CAAAe,MAAQ;AAClC,MAAAR,EAAS,0BAA0BQ,CAAI;AAAA,IACzC,CAAC,GAGCf,GAAO,gBACTA,EAAM,aAAa,QAAQ,CAAAe,MAAQ;AACjC,MAAAR,EAAS,yBAAyBQ,CAAI;AAAA,IACxC,CAAC,GAGCf,GAAO,cACTA,EAAM,WAAW,QAAQ,CAAAe,MAAQ;AAC/B,MAAAR,EAAS,uBAAuBQ,CAAI;AAAA,IACtC,CAAC,GAGEV,EAAO,SAAS,UACnBA,EAAO,SAAS,QAAQE,IAGnBF;AAAA,EACT,GAAG,CAACP,GAAKC,GAASC,CAAK,CAAC,GAElBgB,IAAcZ,EAAQ,MAAM;AAChC,QAAIF;AACF,aAAOA;AAIT,UAAMG,IAAS,IAAIY,EAAA,GAEbC,IAAY,YAAY;AAC5B,YAAMb,EAAO,kBAAkB,EAAE,UAAU,CAAC,qBAAqB,GAAG;AAAA,IACtE;AACA,WAAAA,EAAO,iBAAiB,CAAC,qBAAqB,GAAG,EAAE,OAAO,IAAO,GACjEA,EAAO,oBAAoB,CAAC,qBAAqB,GAAG,EAAE,WAAAa,GAAW,OAAO,IAAO,GAExEb;AAAA,EACT,GAAG,CAACH,CAAoB,CAAC;AAEzB,SACE,gBAAAiB,EAACC,KAAoB,QAAQJ,GAC3B,4BAACK,GAAA,EAAsB,QAAQlB,GAAc,UAAAF,EAAA,CAAS,EAAA,CACxD;AAEJ;"}
|