@gusto/embedded-react-sdk 0.8.0 → 0.8.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 +20 -3
- package/dist/components/Base/Base.d.ts +6 -5
- package/dist/components/Base/Base.js +40 -39
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/index.d.ts +1 -0
- package/dist/components/Common/ActionsLayout/index.d.ts +1 -0
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js +5 -3
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js.map +1 -1
- package/dist/components/Common/DataView/DataCards/index.d.ts +1 -0
- package/dist/components/Common/DataView/index.d.ts +1 -0
- package/dist/components/Common/DocumentList/index.d.ts +1 -0
- package/dist/components/Common/DocumentViewer/index.d.ts +1 -0
- package/dist/components/Common/FadeIn/FadeIn.module.scss.js +4 -4
- package/dist/components/Common/{UI/FieldCaption → FieldCaption}/FieldCaption.js +1 -1
- package/dist/components/Common/FieldCaption/FieldCaption.js.map +1 -0
- package/dist/components/Common/{UI/FieldCaption → FieldCaption}/index.d.ts +1 -0
- package/dist/components/Common/{UI/FieldDescription → FieldDescription}/FieldDescription.js +1 -1
- package/dist/components/Common/FieldDescription/FieldDescription.js.map +1 -0
- package/dist/components/Common/{UI/FieldDescription → FieldDescription}/index.d.ts +1 -0
- package/dist/components/Common/{UI/FieldErrorMessage → FieldErrorMessage}/FieldErrorMessage.js +1 -1
- package/dist/components/Common/FieldErrorMessage/FieldErrorMessage.js.map +1 -0
- package/dist/components/Common/{UI/FieldErrorMessage → FieldErrorMessage}/index.d.ts +1 -0
- package/dist/components/Common/{UI/FieldLayout → FieldLayout}/FieldLayout.js +1 -1
- package/dist/components/Common/FieldLayout/FieldLayout.js.map +1 -0
- package/dist/components/Common/FieldLayout/FieldLayoutTypes.d.ts +52 -0
- package/dist/components/Common/{UI/FieldLayout → FieldLayout}/index.d.ts +1 -0
- package/dist/components/Common/Fields/CheckboxField/index.d.ts +1 -0
- package/dist/components/Common/Fields/CheckboxGroupField/index.d.ts +1 -0
- package/dist/components/Common/Fields/ComboBoxField/index.d.ts +1 -0
- package/dist/components/Common/Fields/DatePickerField/index.d.ts +1 -0
- package/dist/components/Common/Fields/NumberInputField/index.d.ts +1 -0
- package/dist/components/Common/Fields/RadioGroupField/index.d.ts +1 -0
- package/dist/components/Common/Fields/SelectField/index.d.ts +1 -0
- package/dist/components/Common/Fields/SwitchField/index.d.ts +1 -0
- package/dist/components/Common/Fields/TextInputField/index.d.ts +1 -0
- package/dist/components/Common/{UI/Fieldset → Fieldset}/Fieldset.js +1 -1
- package/dist/components/Common/Fieldset/Fieldset.js.map +1 -0
- package/dist/components/Common/{UI/Fieldset → Fieldset}/index.d.ts +1 -0
- package/dist/components/Common/Flex/index.d.ts +1 -0
- package/dist/components/Common/Form/index.d.ts +1 -0
- package/dist/components/Common/HamburgerMenu/index.d.ts +1 -0
- package/dist/components/Common/{UI/HorizontalFieldLayout → HorizontalFieldLayout}/HorizontalFieldLayout.js +2 -2
- package/dist/components/Common/HorizontalFieldLayout/HorizontalFieldLayout.js.map +1 -0
- package/dist/components/Common/{UI/HorizontalFieldLayout → HorizontalFieldLayout}/index.d.ts +1 -0
- package/dist/components/Common/PaginationControl/index.d.ts +1 -0
- package/dist/components/Common/ReorderableList/index.d.ts +1 -0
- package/dist/components/Common/SignatureForm/SignatureForm.d.ts +12 -6
- package/dist/components/Common/SignatureForm/SignatureForm.js +10 -10
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/index.d.ts +1 -0
- package/dist/components/Common/TaxInputs/index.d.ts +1 -0
- package/dist/components/Common/UI/Alert/Alert.d.ts +1 -1
- package/dist/components/Common/UI/Alert/Alert.js +13 -12
- package/dist/components/Common/UI/Alert/Alert.js.map +1 -1
- package/dist/components/Common/UI/Alert/AlertTypes.d.ts +16 -4
- package/dist/components/Common/UI/Alert/index.d.ts +1 -0
- package/dist/components/Common/UI/Badge/BadgeTypes.d.ts +6 -0
- package/dist/components/Common/UI/Button/Button.js +28 -27
- package/dist/components/Common/UI/Button/Button.js.map +1 -1
- package/dist/components/Common/UI/Button/Button.module.scss.js +1 -1
- package/dist/components/Common/UI/Button/ButtonTypes.d.ts +29 -4
- package/dist/components/Common/UI/Button/index.d.ts +1 -0
- package/dist/components/Common/UI/CalendarPreview/CalendarPreviewTypes.d.ts +24 -0
- package/dist/components/Common/UI/CalendarPreview/index.d.ts +1 -0
- package/dist/components/Common/UI/Card/Card.module.scss.js +1 -1
- package/dist/components/Common/UI/Card/CardTypes.d.ts +12 -4
- package/dist/components/Common/UI/Checkbox/Checkbox.js +4 -4
- package/dist/components/Common/UI/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Common/UI/Checkbox/CheckboxTypes.d.ts +16 -1
- package/dist/components/Common/UI/Checkbox/index.d.ts +1 -0
- package/dist/components/Common/UI/CheckboxGroup/CheckboxGroup.js +4 -4
- package/dist/components/Common/UI/CheckboxGroup/CheckboxGroup.js.map +1 -1
- package/dist/components/Common/UI/CheckboxGroup/CheckboxGroupTypes.d.ts +33 -3
- package/dist/components/Common/UI/CheckboxGroup/index.d.ts +1 -0
- package/dist/components/Common/UI/ComboBox/ComboBox.js +8 -8
- package/dist/components/Common/UI/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBoxTypes.d.ts +31 -1
- package/dist/components/Common/UI/DatePicker/DatePicker.js +13 -13
- package/dist/components/Common/UI/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/Common/UI/DatePicker/DatePickerTypes.d.ts +25 -1
- package/dist/components/Common/UI/DatePicker/index.d.ts +1 -0
- package/dist/components/Common/UI/Heading/HeadingTypes.d.ts +12 -0
- package/dist/components/Common/UI/Heading/index.d.ts +1 -0
- package/dist/components/Common/UI/Input/index.d.ts +1 -0
- package/dist/components/Common/UI/Link/LinkTypes.d.ts +53 -1
- package/dist/components/Common/UI/Link/index.d.ts +1 -0
- package/dist/components/Common/UI/List/ListTypes.d.ts +3 -5
- package/dist/components/Common/UI/List/index.d.ts +1 -0
- package/dist/components/Common/UI/Menu/MenuTypes.d.ts +30 -0
- package/dist/components/Common/UI/Menu/index.d.ts +1 -0
- package/dist/components/Common/UI/NumberInput/NumberInput.js +4 -4
- package/dist/components/Common/UI/NumberInput/NumberInput.js.map +1 -1
- package/dist/components/Common/UI/NumberInput/NumberInputTypes.d.ts +34 -1
- package/dist/components/Common/UI/NumberInput/index.d.ts +1 -0
- package/dist/components/Common/UI/ProgressBar/ProgressBarTypes.d.ts +12 -0
- package/dist/components/Common/UI/ProgressBar/index.d.ts +1 -0
- package/dist/components/Common/UI/Radio/Radio.js +1 -1
- package/dist/components/Common/UI/Radio/Radio.js.map +1 -1
- package/dist/components/Common/UI/Radio/RadioTypes.d.ts +16 -1
- package/dist/components/Common/UI/Radio/index.d.ts +1 -0
- package/dist/components/Common/UI/RadioGroup/RadioGroup.js +4 -4
- package/dist/components/Common/UI/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.d.ts +33 -3
- package/dist/components/Common/UI/RadioGroup/index.d.ts +1 -0
- package/dist/components/Common/UI/Select/Select.js +8 -8
- package/dist/components/Common/UI/Select/Select.js.map +1 -1
- package/dist/components/Common/UI/Select/SelectTypes.d.ts +34 -1
- package/dist/components/Common/UI/Select/index.d.ts +1 -0
- package/dist/components/Common/UI/Switch/Switch.js +1 -1
- package/dist/components/Common/UI/Switch/Switch.js.map +1 -1
- package/dist/components/Common/UI/Switch/SwitchTypes.d.ts +25 -1
- package/dist/components/Common/UI/Switch/index.d.ts +1 -0
- package/dist/components/Common/UI/Table/TableTypes.d.ts +21 -0
- package/dist/components/Common/UI/Table/index.d.ts +1 -0
- package/dist/components/Common/UI/Text/TextTypes.d.ts +18 -0
- package/dist/components/Common/UI/Text/index.d.ts +1 -0
- package/dist/components/Common/UI/TextInput/TextInput.js +1 -1
- package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
- package/dist/components/Common/UI/TextInput/TextInputTypes.d.ts +22 -1
- package/dist/components/Common/UI/TextInput/index.d.ts +1 -0
- package/dist/components/Common/VisuallyHidden/index.d.ts +1 -0
- package/dist/components/Common/index.d.ts +1 -0
- package/dist/components/Company/AssignSignatory/AssignSignatory.d.ts +3 -3
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +26 -25
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +7 -7
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.d.ts +2 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Schema.d.ts +41 -15
- package/dist/components/Company/AssignSignatory/CreateSignatory/Schema.js +17 -20
- package/dist/components/Company/AssignSignatory/CreateSignatory/Schema.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/index.d.ts +1 -0
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +10 -10
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.d.ts +17 -11
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +42 -45
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/index.d.ts +1 -0
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/index.d.ts +1 -0
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccount.d.ts +10 -0
- package/dist/components/Company/BankAccount/BankAccount.js +32 -0
- package/dist/components/Company/BankAccount/BankAccount.js.map +1 -0
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +6 -6
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.d.ts +12 -6
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +2 -2
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js +10 -10
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.d.ts +12 -6
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +17 -17
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -0
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.d.ts +13 -0
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +63 -0
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -0
- package/dist/components/Company/DocumentSigner/DocumentList/Head.js.map +1 -0
- package/dist/components/Company/DocumentSigner/DocumentList/List.js.map +1 -0
- package/dist/components/Company/DocumentSigner/DocumentList/ManageSignatories.js.map +1 -0
- package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/index.d.ts +1 -0
- package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -0
- package/dist/components/Company/DocumentSigner/DocumentSigner.d.ts +12 -0
- package/dist/components/Company/DocumentSigner/DocumentSigner.js +41 -0
- package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -0
- package/dist/components/Company/DocumentSigner/SignatureForm/Actions.js.map +1 -0
- package/dist/components/Company/DocumentSigner/SignatureForm/Form.js.map +1 -0
- package/dist/components/Company/DocumentSigner/SignatureForm/Head.js.map +1 -0
- package/dist/components/Company/DocumentSigner/SignatureForm/Preview.js.map +1 -0
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.d.ts +14 -0
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +72 -0
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -0
- package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/index.d.ts +1 -0
- package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/useSignatureForm.js +3 -4
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -0
- package/dist/components/Company/DocumentSigner/assignSignatoryState.js.map +1 -0
- package/dist/components/Company/DocumentSigner/documentSignerStateMachine.js.map +1 -0
- package/dist/components/Company/DocumentSigner/index.d.ts +2 -0
- package/dist/components/Company/DocumentSigner/stateMachine.js.map +1 -0
- package/dist/components/Company/FederalTaxes/FederalTaxes.d.ts +1 -4
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +31 -31
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/index.d.ts +1 -0
- package/dist/components/Company/FederalTaxes/useFederalTaxes.d.ts +18 -8
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +10 -15
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +6 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Industry.d.ts +1 -1
- package/dist/components/Company/Industry/Industry.js +29 -28
- package/dist/components/Company/Industry/Industry.js.map +1 -1
- package/dist/components/Company/Industry/index.d.ts +1 -0
- package/dist/components/Company/Locations/LocationForm/Form.d.ts +27 -11
- package/dist/components/Company/Locations/LocationForm/Form.js +24 -24
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +24 -24
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/Locations.d.ts +9 -0
- package/dist/components/Company/Locations/Locations.js +27 -0
- package/dist/components/Company/Locations/Locations.js.map +1 -0
- package/dist/components/Company/Locations/LocationsList/LocationsList.d.ts +3 -3
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +27 -32
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/index.d.ts +1 -0
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.d.ts +2 -2
- package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.js +13 -13
- package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js +3 -3
- package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.d.ts +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +15 -15
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +3 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.d.ts +2 -2
- package/dist/components/Company/PaySchedule/PaySchedule.js +68 -67
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +28 -31
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.module.scss.js +8 -0
- package/dist/components/Company/PaySchedule/_parts/List.module.scss.js.map +1 -0
- package/dist/components/Company/PaySchedule/_parts/index.d.ts +1 -0
- package/dist/components/Company/PaySchedule/index.d.ts +1 -0
- package/dist/components/Company/PaySchedule/usePaySchedule.d.ts +31 -13
- package/dist/components/Company/PaySchedule/usePaySchedule.js +13 -19
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxes.d.ts +9 -0
- package/dist/components/Company/StateTaxes/StateTaxes.js +27 -0
- package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -0
- package/dist/components/Company/StateTaxes/{StateTaxesFlowComponents.js → StateTaxesComponents.js} +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesComponents.js.map +1 -0
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.d.ts +3 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js +3 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +66 -77
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +3 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js +1 -1
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js.map +1 -1
- package/dist/components/Company/index.d.ts +7 -6
- package/dist/components/Company/index.js +18 -18
- package/dist/components/Employee/Compensation/Compensation.d.ts +1 -1
- package/dist/components/Employee/Compensation/Compensation.js +48 -47
- package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +17 -16
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +10 -10
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Compensation/index.d.ts +1 -0
- package/dist/components/Employee/Compensation/useCompensation.d.ts +53 -45
- package/dist/components/Employee/Compensation/useCompensation.js +59 -68
- package/dist/components/Employee/Compensation/useCompensation.js.map +1 -1
- package/dist/components/Employee/Deductions/Deductions.d.ts +11 -7
- package/dist/components/Employee/Deductions/Deductions.js +76 -74
- package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/index.d.ts +1 -0
- package/dist/components/Employee/Deductions/useDeductions.d.ts +34 -14
- package/dist/components/Employee/Deductions/useDeductions.js +10 -29
- package/dist/components/Employee/Deductions/useDeductions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentSigner.d.ts +11 -0
- package/dist/components/Employee/DocumentSigner/DocumentSigner.js +27 -0
- package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -0
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/index.d.ts +2 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.d.ts +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +38 -38
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +3 -4
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.d.ts +1 -1
- package/dist/components/Employee/Landing/Landing.js +5 -5
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/Landing/index.d.ts +1 -0
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.d.ts +27 -0
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js +29 -0
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js.map +1 -0
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js +107 -0
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -0
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.d.ts +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +30 -30
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/index.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/BankAccount.d.ts +22 -10
- package/dist/components/Employee/PaymentMethod/BankAccount.js +9 -9
- package/dist/components/Employee/PaymentMethod/BankAccount.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentMethod.d.ts +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js +74 -74
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.d.ts +10 -6
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +8 -8
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/index.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.d.ts +92 -37
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +31 -39
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +68 -31
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +33 -46
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.d.ts +33 -13
- package/dist/components/Employee/Profile/HomeAddress.js +39 -38
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +81 -32
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +60 -74
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/Profile.d.ts +1 -1
- package/dist/components/Employee/Profile/Profile.js +69 -72
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/SelfPersonalDetails.d.ts +44 -15
- package/dist/components/Employee/Profile/SelfPersonalDetails.js +18 -21
- package/dist/components/Employee/Profile/SelfPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/index.d.ts +1 -0
- package/dist/components/Employee/Profile/useProfile.js +3 -4
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.d.ts +17 -0
- package/dist/components/{Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingComponents.js → Employee/SelfOnboardingFlow/SelfOnboardingComponents.js} +7 -7
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -0
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.d.ts +2 -0
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js +22 -0
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js.map +1 -0
- package/dist/components/{Flow/StateMachines/employeeSelfOnboarding.js → Employee/SelfOnboardingFlow/selfOnboardingMachine.js} +4 -4
- package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js.map +1 -0
- package/dist/components/Employee/Taxes/FederalForm.d.ts +28 -12
- package/dist/components/Employee/Taxes/FederalForm.js +28 -28
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/StateForm.d.ts +9 -5
- package/dist/components/Employee/Taxes/StateForm.js +6 -6
- package/dist/components/Employee/Taxes/StateForm.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.d.ts +1 -1
- package/dist/components/Employee/Taxes/Taxes.js +78 -77
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/components/Employee/Taxes/index.d.ts +1 -0
- package/dist/components/Employee/Taxes/useTaxes.js +3 -4
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Employee/index.d.ts +4 -1
- package/dist/components/Employee/index.js +20 -16
- package/dist/components/Employee/index.js.map +1 -1
- package/dist/components/Flow/useFlow.d.ts +2 -1
- package/dist/components/Flow/useFlow.js.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/contexts/ApiProvider/ApiProvider.d.ts +5 -0
- package/dist/contexts/ApiProvider/ApiProvider.js +34 -0
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -0
- package/dist/contexts/GustoApiProvider/index.d.ts +1 -0
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +2 -7
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +26 -24
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/GustoProvider/index.d.ts +2 -1
- package/dist/contexts/LocaleProvider/index.d.ts +1 -0
- package/dist/contexts/ThemeProvider/index.d.ts +1 -0
- package/dist/contexts/index.d.ts +1 -0
- package/dist/helpers/validations.d.ts +6 -5
- package/dist/helpers/validations.js +10 -17
- package/dist/helpers/validations.js.map +1 -1
- package/dist/hooks/useForkRef/index.d.ts +1 -0
- package/dist/i18n/I18n.d.ts +2 -0
- package/dist/i18n/I18n.js +27 -21
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/index.d.ts +1 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +7 -13
- package/dist/index.js.map +1 -1
- package/dist/shared/constants.d.ts +1 -1
- package/dist/shared/constants.js +1 -1
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/Helpers.d.ts +14 -0
- package/dist/types/i18next.d.ts +60 -61
- package/package.json +7 -4
- package/dist/components/Common/UI/FieldCaption/FieldCaption.js.map +0 -1
- package/dist/components/Common/UI/FieldDescription/FieldDescription.js.map +0 -1
- package/dist/components/Common/UI/FieldErrorMessage/FieldErrorMessage.js.map +0 -1
- package/dist/components/Common/UI/FieldLayout/FieldLayout.js.map +0 -1
- package/dist/components/Common/UI/FieldLayout/FieldLayoutTypes.d.ts +0 -19
- package/dist/components/Common/UI/Fieldset/Fieldset.js.map +0 -1
- package/dist/components/Common/UI/HorizontalFieldLayout/HorizontalFieldLayout.js.map +0 -1
- package/dist/components/Company/BankAccount/BankAccountFlow.d.ts +0 -5
- package/dist/components/Company/BankAccount/BankAccountFlow.js +0 -24
- package/dist/components/Company/BankAccount/BankAccountFlow.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/DocumentList/Actions.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/DocumentList/DocumentList.d.ts +0 -13
- package/dist/components/Company/DocumentSignerFlow/DocumentList/DocumentList.js +0 -69
- package/dist/components/Company/DocumentSignerFlow/DocumentList/DocumentList.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/DocumentList/Head.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/DocumentList/List.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/DocumentList/ManageSignatories.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/DocumentList/useDocumentList.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/DocumentSignerFlow.d.ts +0 -6
- package/dist/components/Company/DocumentSignerFlow/DocumentSignerFlow.js +0 -35
- package/dist/components/Company/DocumentSignerFlow/DocumentSignerFlow.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/SignatureForm/Actions.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/SignatureForm/Form.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/SignatureForm/Head.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/SignatureForm/Preview.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/SignatureForm/SignatureForm.d.ts +0 -17
- package/dist/components/Company/DocumentSignerFlow/SignatureForm/SignatureForm.js +0 -78
- package/dist/components/Company/DocumentSignerFlow/SignatureForm/SignatureForm.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/SignatureForm/useSignatureForm.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/assignSignatoryState.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/documentSignerStateMachine.js.map +0 -1
- package/dist/components/Company/DocumentSignerFlow/index.d.ts +0 -1
- package/dist/components/Company/DocumentSignerFlow/stateMachine.js.map +0 -1
- package/dist/components/Company/Locations/LocationsFlow.d.ts +0 -5
- package/dist/components/Company/Locations/LocationsFlow.js +0 -21
- package/dist/components/Company/Locations/LocationsFlow.js.map +0 -1
- package/dist/components/Company/StateTaxes/StateTaxesFlow.d.ts +0 -5
- package/dist/components/Company/StateTaxes/StateTaxesFlow.js +0 -21
- package/dist/components/Company/StateTaxes/StateTaxesFlow.js.map +0 -1
- package/dist/components/Company/StateTaxes/StateTaxesFlowComponents.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/DocumentSignerFlow.d.ts +0 -5
- package/dist/components/Employee/DocumentSigner/DocumentSignerFlow.js +0 -21
- package/dist/components/Employee/DocumentSigner/DocumentSignerFlow.js.map +0 -1
- package/dist/components/Flow/EmployeeOnboardingFlow.d.ts +0 -27
- package/dist/components/Flow/EmployeeOnboardingFlow.js +0 -29
- package/dist/components/Flow/EmployeeOnboardingFlow.js.map +0 -1
- package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingComponents.d.ts +0 -5
- package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingComponents.js.map +0 -1
- package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingFlow.d.ts +0 -13
- package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingFlow.js +0 -26
- package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingFlow.js.map +0 -1
- package/dist/components/Flow/StateMachines/employeeOnboarding.js +0 -136
- package/dist/components/Flow/StateMachines/employeeOnboarding.js.map +0 -1
- package/dist/components/Flow/StateMachines/employeeSelfOnboarding.js.map +0 -1
- package/dist/components/Flow/StateMachines/index.d.ts +0 -2
- package/dist/components/Flow/index.d.ts +0 -2
- package/dist/components/Flow/index.js +0 -7
- package/dist/components/Flow/index.js.map +0 -1
- /package/dist/components/Common/{UI/FieldCaption → FieldCaption}/FieldCaption.d.ts +0 -0
- /package/dist/components/Common/{UI/FieldCaption → FieldCaption}/FieldCaption.module.scss.js +0 -0
- /package/dist/components/Common/{UI/FieldCaption → FieldCaption}/FieldCaption.module.scss.js.map +0 -0
- /package/dist/components/Common/{UI/FieldDescription → FieldDescription}/FieldDescription.d.ts +0 -0
- /package/dist/components/Common/{UI/FieldDescription → FieldDescription}/FieldDescription.module.scss.js +0 -0
- /package/dist/components/Common/{UI/FieldDescription → FieldDescription}/FieldDescription.module.scss.js.map +0 -0
- /package/dist/components/Common/{UI/FieldErrorMessage → FieldErrorMessage}/FieldErrorMessage.d.ts +0 -0
- /package/dist/components/Common/{UI/FieldErrorMessage → FieldErrorMessage}/FieldErrorMessage.module.scss.js +0 -0
- /package/dist/components/Common/{UI/FieldErrorMessage → FieldErrorMessage}/FieldErrorMessage.module.scss.js.map +0 -0
- /package/dist/components/Common/{UI/FieldLayout → FieldLayout}/FieldLayout.d.ts +0 -0
- /package/dist/components/Common/{UI/FieldLayout → FieldLayout}/FieldLayout.module.scss.js +0 -0
- /package/dist/components/Common/{UI/FieldLayout → FieldLayout}/FieldLayout.module.scss.js.map +0 -0
- /package/dist/components/Common/{UI/Fieldset → Fieldset}/Fieldset.d.ts +0 -0
- /package/dist/components/Common/{UI/Fieldset → Fieldset}/Fieldset.module.scss.js +0 -0
- /package/dist/components/Common/{UI/Fieldset → Fieldset}/Fieldset.module.scss.js.map +0 -0
- /package/dist/components/Common/{UI/HorizontalFieldLayout → HorizontalFieldLayout}/HorizontalFieldLayout.d.ts +0 -0
- /package/dist/components/Common/{UI/HorizontalFieldLayout → HorizontalFieldLayout}/HorizontalFieldLayout.module.scss.js +0 -0
- /package/dist/components/Common/{UI/HorizontalFieldLayout → HorizontalFieldLayout}/HorizontalFieldLayout.module.scss.js.map +0 -0
- /package/dist/components/Common/{UI/HorizontalFieldLayout → HorizontalFieldLayout}/HorizontalFieldLayoutTypes.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/Actions.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/Actions.js +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/Head.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/Head.js +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/List.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/List.js +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/ManageSignatories.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/ManageSignatories.js +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/ManageSignatories.module.scss.js +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/ManageSignatories.module.scss.js.map +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/useDocumentList.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Actions.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Actions.js +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Form.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Form.js +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Head.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Head.js +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Preview.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Preview.js +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/useSignatureForm.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/assignSignatoryState.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/assignSignatoryState.js +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/documentSignerStateMachine.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/documentSignerStateMachine.js +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/stateMachine.d.ts +0 -0
- /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/stateMachine.js +0 -0
- /package/dist/components/Company/{DocumentSignerFlow/useDocumentSignerFlow.d.ts → DocumentSigner/useDocumentSigner.d.ts} +0 -0
- /package/dist/components/Company/StateTaxes/{StateTaxesFlowComponents.d.ts → StateTaxesComponents.d.ts} +0 -0
- /package/dist/components/{Flow/StateMachines/employeeOnboarding.d.ts → Employee/OnboardingFlow/onboardingStateMachine.d.ts} +0 -0
- /package/dist/components/{Flow/StateMachines/employeeSelfOnboarding.d.ts → Employee/SelfOnboardingFlow/selfOnboardingMachine.d.ts} +0 -0
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { useForm as
|
|
5
|
-
import * as De from "valibot";
|
|
1
|
+
import { jsx as t, jsxs as pe, Fragment as ye } from "react/jsx-runtime";
|
|
2
|
+
import { zodResolver as Ae } from "@hookform/resolvers/zod";
|
|
3
|
+
import { useRef as Ee } from "react";
|
|
4
|
+
import { useForm as fe, useWatch as he, FormProvider as De } from "react-hook-form";
|
|
6
5
|
import { useLocationsGetSuspense as Oe } from "@gusto/embedded-api/react-query/locationsGet";
|
|
7
6
|
import { useEmployeesCreateMutation as Se } from "@gusto/embedded-api/react-query/employeesCreate";
|
|
8
7
|
import { useEmployeesGetSuspense as Pe } from "@gusto/embedded-api/react-query/employeesGet";
|
|
@@ -15,12 +14,12 @@ import { useEmployeeAddressesGetWorkAddressesSuspense as we } from "@gusto/embed
|
|
|
15
14
|
import { useEmployeeAddressesCreateWorkAddressMutation as ke } from "@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress";
|
|
16
15
|
import { RFCDate as Me } from "@gusto/embedded-api/types/rfcdate";
|
|
17
16
|
import { useEmployeesUpdateOnboardingStatusMutation as Re } from "@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus";
|
|
18
|
-
import { invalidateEmployeesList as
|
|
19
|
-
import { useQueryClient as
|
|
20
|
-
import { AdminPersonalDetailsSchema as
|
|
21
|
-
import { SelfPersonalDetailsSchema as
|
|
22
|
-
import { Head as
|
|
23
|
-
import { Actions as
|
|
17
|
+
import { invalidateEmployeesList as Le } from "@gusto/embedded-api/react-query/employeesList";
|
|
18
|
+
import { useQueryClient as Be } from "@tanstack/react-query";
|
|
19
|
+
import { AdminPersonalDetailsSchema as Ce, AdminPersonalDetails as L } from "./AdminPersonalDetails.js";
|
|
20
|
+
import { SelfPersonalDetailsSchema as ve, SelfPersonalDetails as B } from "./SelfPersonalDetails.js";
|
|
21
|
+
import { Head as C } from "./Head.js";
|
|
22
|
+
import { Actions as v } from "./Actions.js";
|
|
24
23
|
import { HomeAddressSchema as We, HomeAddress as W } from "./HomeAddress.js";
|
|
25
24
|
import { WorkAddress as U } from "./WorkAddress.js";
|
|
26
25
|
import { ProfileProvider as Ue } from "./useProfile.js";
|
|
@@ -28,54 +27,55 @@ import { getEmployeeAddressForProfile as qe } from "./getEmployeeAddressForProfi
|
|
|
28
27
|
import { Form as Te } from "../../Common/Form/Form.js";
|
|
29
28
|
import { BaseComponent as He } from "../../Base/Base.js";
|
|
30
29
|
import { useBase as Ge } from "../../Base/useBase.js";
|
|
31
|
-
import { useI18n as R } from "../../../i18n/I18n.js";
|
|
32
|
-
import { EmployeeOnboardingStatus as l, EmployeeSelfOnboardingStatuses as
|
|
33
|
-
import { useFlow as
|
|
34
|
-
import { ensureRequired as
|
|
30
|
+
import { useI18n as R, useComponentDictionary as Fe } from "../../../i18n/I18n.js";
|
|
31
|
+
import { EmployeeOnboardingStatus as l, EmployeeSelfOnboardingStatuses as Ve, componentEvents as d } from "../../../shared/constants.js";
|
|
32
|
+
import { useFlow as Ye } from "../../Flow/useFlow.js";
|
|
33
|
+
import { ensureRequired as xe } from "../../../helpers/ensureRequired.js";
|
|
35
34
|
function m(r) {
|
|
36
|
-
return /* @__PURE__ */ t(He, { ...r, children: r.employeeId ? /* @__PURE__ */ t(
|
|
35
|
+
return /* @__PURE__ */ t(He, { ...r, children: r.employeeId ? /* @__PURE__ */ t(ze, { ...r, employeeId: r.employeeId, children: r.children }) : /* @__PURE__ */ t(q, { ...r, children: r.children }) });
|
|
37
36
|
}
|
|
38
|
-
function
|
|
37
|
+
function ze({ employeeId: r, ...a }) {
|
|
39
38
|
const {
|
|
40
39
|
data: { employee: u }
|
|
41
40
|
} = Pe({ employeeId: r }), {
|
|
42
|
-
data: { employeeAddressList:
|
|
41
|
+
data: { employeeAddressList: c }
|
|
43
42
|
} = ge({ employeeId: r }), {
|
|
44
|
-
data: { employeeWorkAddressList:
|
|
43
|
+
data: { employeeWorkAddressList: i }
|
|
45
44
|
} = we({ employeeId: r });
|
|
46
45
|
return /* @__PURE__ */ t(
|
|
47
46
|
q,
|
|
48
47
|
{
|
|
49
48
|
...a,
|
|
50
49
|
employee: u,
|
|
51
|
-
homeAddresses:
|
|
52
|
-
workAddresses:
|
|
50
|
+
homeAddresses: c,
|
|
51
|
+
workAddresses: i
|
|
53
52
|
}
|
|
54
53
|
);
|
|
55
54
|
}
|
|
56
55
|
const q = ({
|
|
57
56
|
isAdmin: r = !1,
|
|
58
57
|
isSelfOnboardingEnabled: a = !0,
|
|
59
|
-
|
|
58
|
+
dictionary: u,
|
|
59
|
+
...c
|
|
60
60
|
}) => {
|
|
61
|
-
R("Employee.Profile"), R("Employee.HomeAddress");
|
|
61
|
+
R("Employee.Profile"), R("Employee.HomeAddress"), Fe("Employee.Profile", u);
|
|
62
62
|
const {
|
|
63
63
|
companyId: i,
|
|
64
|
-
employee:
|
|
65
|
-
homeAddresses:
|
|
64
|
+
employee: f,
|
|
65
|
+
homeAddresses: T,
|
|
66
66
|
workAddresses: S,
|
|
67
67
|
children: P,
|
|
68
|
-
className:
|
|
68
|
+
className: H = "",
|
|
69
69
|
defaultValues: s
|
|
70
|
-
} =
|
|
71
|
-
mutateAsync:
|
|
72
|
-
isPending:
|
|
70
|
+
} = c, { onEvent: n, baseSubmitHandler: G } = Ge(), F = Be(), { data: V } = Oe({ companyId: i }), Y = V.locationList, { mutateAsync: x, isPending: z } = Se(), { mutateAsync: j, isPending: K } = _e(), { mutateAsync: Q, isPending: J } = ke(), { mutateAsync: X, isPending: Z } = Ie(), { mutateAsync: $, isPending: ee } = be(), { mutateAsync: re, isPending: te } = Ne(), {
|
|
71
|
+
mutateAsync: oe,
|
|
72
|
+
isPending: se
|
|
73
73
|
} = Re({
|
|
74
|
-
onSettled: () =>
|
|
75
|
-
}), g = { employee:
|
|
74
|
+
onSettled: () => Le(F, [i])
|
|
75
|
+
}), g = { employee: f, workAddresses: S }, ne = qe(T), de = g.workAddresses?.find((O) => O.active), e = Ee({
|
|
76
76
|
employee: g.employee,
|
|
77
|
-
homeAddress:
|
|
78
|
-
workAddress:
|
|
77
|
+
homeAddress: ne,
|
|
78
|
+
workAddress: de
|
|
79
79
|
}), h = {
|
|
80
80
|
firstName: e.current.employee?.firstName ?? s?.employee?.firstName ?? "",
|
|
81
81
|
middleInitial: e.current.employee?.middleInitial ?? s?.employee?.middleInitial ?? "",
|
|
@@ -91,32 +91,29 @@ const q = ({
|
|
|
91
91
|
zip: e.current.homeAddress?.zip ?? s?.homeAddress?.zip ?? "",
|
|
92
92
|
state: e.current.homeAddress?.state ?? s?.homeAddress?.state ?? "",
|
|
93
93
|
courtesyWithholding: e.current.homeAddress?.courtesyWithholding ?? !1
|
|
94
|
-
},
|
|
94
|
+
}, ie = e.current.employee?.onboarded || e.current.employee?.onboardingStatus === l.ONBOARDING_COMPLETED || e.current.employee?.onboardingStatus !== void 0 && e.current.employee.onboardingStatus !== l.ADMIN_ONBOARDING_INCOMPLETE ? { ...h, enableSsn: !1, selfOnboarding: !0 } : {
|
|
95
95
|
...h,
|
|
96
96
|
selfOnboarding: a && e.current.employee?.onboardingStatus ? (
|
|
97
97
|
// @ts-expect-error: onboarding_status during runtime can be one of self onboarding statuses
|
|
98
|
-
|
|
98
|
+
Ve.has(e.current.employee.onboarding_status)
|
|
99
99
|
) : !1,
|
|
100
100
|
enableSsn: !e.current.employee?.hasSsn,
|
|
101
101
|
ssn: ""
|
|
102
|
-
},
|
|
102
|
+
}, me = {
|
|
103
103
|
...h,
|
|
104
104
|
enableSsn: !e.current.employee?.hasSsn,
|
|
105
105
|
ssn: ""
|
|
106
|
-
}, D =
|
|
107
|
-
resolver:
|
|
108
|
-
|
|
109
|
-
r ? Be : Ce,
|
|
110
|
-
We
|
|
111
|
-
])
|
|
106
|
+
}, D = fe({
|
|
107
|
+
resolver: Ae(
|
|
108
|
+
(r ? Ce : ve).and(We)
|
|
112
109
|
),
|
|
113
|
-
defaultValues: r ?
|
|
114
|
-
}), { handleSubmit:
|
|
115
|
-
await
|
|
116
|
-
const { workAddress: N, startDate:
|
|
110
|
+
defaultValues: r ? ie : me
|
|
111
|
+
}), { handleSubmit: ae } = D, b = he({ control: D.control, name: "selfOnboarding" }), le = async (O) => {
|
|
112
|
+
await G(O, async (A) => {
|
|
113
|
+
const { workAddress: N, startDate: ce, selfOnboarding: E, ...I } = A;
|
|
117
114
|
if (e.current.employee) {
|
|
118
115
|
if (E && e.current.employee.onboardingStatus === l.ADMIN_ONBOARDING_INCOMPLETE || !E && e.current.employee.onboardingStatus === l.SELF_ONBOARDING_PENDING_INVITE) {
|
|
119
|
-
const { employeeOnboardingStatus: p } = await
|
|
116
|
+
const { employeeOnboardingStatus: p } = await oe({
|
|
120
117
|
request: {
|
|
121
118
|
employeeId: e.current.employee.uuid,
|
|
122
119
|
requestBody: {
|
|
@@ -137,7 +134,7 @@ const q = ({
|
|
|
137
134
|
});
|
|
138
135
|
e.current = { ...e.current, employee: o }, n(d.EMPLOYEE_UPDATED, o);
|
|
139
136
|
} else {
|
|
140
|
-
const { employee: o } = await
|
|
137
|
+
const { employee: o } = await x({
|
|
141
138
|
request: {
|
|
142
139
|
companyId: i,
|
|
143
140
|
requestBody: { ...I, selfOnboarding: E }
|
|
@@ -150,7 +147,7 @@ const q = ({
|
|
|
150
147
|
if ((!b || !r) && !A.selfOnboarding) {
|
|
151
148
|
const { street1: o, street2: p, city: _, state: w, zip: k, courtesyWithholding: M } = A;
|
|
152
149
|
if (e.current.homeAddress) {
|
|
153
|
-
const { employeeAddress: y } = await
|
|
150
|
+
const { employeeAddress: y } = await re({
|
|
154
151
|
request: {
|
|
155
152
|
homeAddressUuid: e.current.homeAddress.uuid,
|
|
156
153
|
requestBody: {
|
|
@@ -166,7 +163,7 @@ const q = ({
|
|
|
166
163
|
});
|
|
167
164
|
e.current = { ...e.current, homeAddress: y }, n(d.EMPLOYEE_HOME_ADDRESS_UPDATED, y);
|
|
168
165
|
} else {
|
|
169
|
-
const { employeeAddress: y } = await
|
|
166
|
+
const { employeeAddress: y } = await $({
|
|
170
167
|
request: {
|
|
171
168
|
employeeId: e.current.employee.uuid,
|
|
172
169
|
requestBody: {
|
|
@@ -184,7 +181,7 @@ const q = ({
|
|
|
184
181
|
}
|
|
185
182
|
if (r)
|
|
186
183
|
if (e.current.workAddress) {
|
|
187
|
-
const { employeeWorkAddress: o } = await
|
|
184
|
+
const { employeeWorkAddress: o } = await X({
|
|
188
185
|
request: {
|
|
189
186
|
workAddressUuid: e.current.workAddress.uuid,
|
|
190
187
|
requestBody: {
|
|
@@ -195,7 +192,7 @@ const q = ({
|
|
|
195
192
|
});
|
|
196
193
|
e.current = { ...e.current, workAddress: o }, n(d.EMPLOYEE_WORK_ADDRESS_UPDATED, o);
|
|
197
194
|
} else {
|
|
198
|
-
const { employeeWorkAddress: o } = await
|
|
195
|
+
const { employeeWorkAddress: o } = await Q({
|
|
199
196
|
request: {
|
|
200
197
|
employeeId: e.current.employee?.uuid,
|
|
201
198
|
requestBody: {
|
|
@@ -208,58 +205,58 @@ const q = ({
|
|
|
208
205
|
}
|
|
209
206
|
n(d.EMPLOYEE_PROFILE_DONE, {
|
|
210
207
|
...e.current.employee,
|
|
211
|
-
startDate:
|
|
208
|
+
startDate: ce
|
|
212
209
|
});
|
|
213
210
|
});
|
|
214
|
-
},
|
|
211
|
+
}, ue = () => {
|
|
215
212
|
n(d.CANCEL);
|
|
216
213
|
};
|
|
217
|
-
return /* @__PURE__ */ t("section", { className:
|
|
214
|
+
return /* @__PURE__ */ t("section", { className: H, children: /* @__PURE__ */ t(
|
|
218
215
|
Ue,
|
|
219
216
|
{
|
|
220
217
|
value: {
|
|
221
|
-
companyLocations:
|
|
218
|
+
companyLocations: Y,
|
|
222
219
|
workAddresses: S,
|
|
223
220
|
employee: e.current.employee ?? void 0,
|
|
224
221
|
isSelfOnboardingIntended: b,
|
|
225
|
-
handleCancel:
|
|
222
|
+
handleCancel: ue,
|
|
226
223
|
isAdmin: r,
|
|
227
224
|
isSelfOnboardingEnabled: a,
|
|
228
|
-
isPending:
|
|
225
|
+
isPending: K || Z || ee || te || z || J || se
|
|
229
226
|
},
|
|
230
|
-
children: /* @__PURE__ */ t(
|
|
231
|
-
/* @__PURE__ */ t(
|
|
232
|
-
/* @__PURE__ */ t(v, {}),
|
|
227
|
+
children: /* @__PURE__ */ t(De, { ...D, children: /* @__PURE__ */ t(Te, { onSubmit: ae(le), children: P || /* @__PURE__ */ pe(ye, { children: [
|
|
228
|
+
/* @__PURE__ */ t(C, {}),
|
|
233
229
|
/* @__PURE__ */ t(L, {}),
|
|
230
|
+
/* @__PURE__ */ t(B, {}),
|
|
234
231
|
/* @__PURE__ */ t(W, {}),
|
|
235
232
|
/* @__PURE__ */ t(U, {}),
|
|
236
|
-
/* @__PURE__ */ t(
|
|
233
|
+
/* @__PURE__ */ t(v, {})
|
|
237
234
|
] }) }) })
|
|
238
235
|
}
|
|
239
236
|
) });
|
|
240
237
|
};
|
|
241
|
-
m.Head =
|
|
242
|
-
m.Actions =
|
|
243
|
-
m.AdminPersonalDetails =
|
|
244
|
-
m.SelfPersonalDetails =
|
|
238
|
+
m.Head = C;
|
|
239
|
+
m.Actions = v;
|
|
240
|
+
m.AdminPersonalDetails = L;
|
|
241
|
+
m.SelfPersonalDetails = B;
|
|
245
242
|
m.HomeAddress = W;
|
|
246
243
|
m.WorkAddress = U;
|
|
247
|
-
const
|
|
248
|
-
const { companyId: r, employeeId: a, onEvent: u, isAdmin:
|
|
244
|
+
const Ir = () => {
|
|
245
|
+
const { companyId: r, employeeId: a, onEvent: u, isAdmin: c, defaultValues: i, isSelfOnboardingEnabled: f } = Ye();
|
|
249
246
|
return /* @__PURE__ */ t(
|
|
250
247
|
m,
|
|
251
248
|
{
|
|
252
|
-
companyId:
|
|
249
|
+
companyId: xe(r),
|
|
253
250
|
employeeId: a,
|
|
254
251
|
onEvent: u,
|
|
255
|
-
isAdmin:
|
|
256
|
-
defaultValues:
|
|
252
|
+
isAdmin: c,
|
|
253
|
+
defaultValues: i?.profile,
|
|
257
254
|
isSelfOnboardingEnabled: f
|
|
258
255
|
}
|
|
259
256
|
);
|
|
260
257
|
};
|
|
261
258
|
export {
|
|
262
259
|
m as Profile,
|
|
263
|
-
|
|
260
|
+
Ir as ProfileContextual
|
|
264
261
|
};
|
|
265
262
|
//# sourceMappingURL=Profile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Profile.js","sources":["../../../../src/components/Employee/Profile/Profile.tsx"],"sourcesContent":["import { valibotResolver } from '@hookform/resolvers/valibot'\nimport { useRef } from 'react'\nimport type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport * as v from 'valibot'\nimport { useLocationsGetSuspense } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useEmployeesCreateMutation } from '@gusto/embedded-api/react-query/employeesCreate'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { type Employee } from '@gusto/embedded-api/models/components/employee'\nimport { useEmployeeAddressesGetSuspense } from '@gusto/embedded-api/react-query/employeeAddressesGet'\nimport { type EmployeeAddress } from '@gusto/embedded-api/models/components/employeeaddress'\nimport { useEmployeeAddressesCreateMutation } from '@gusto/embedded-api/react-query/employeeAddressesCreate'\nimport { useEmployeeAddressesUpdateMutation } from '@gusto/embedded-api/react-query/employeeAddressesUpdate'\nimport { useEmployeeAddressesUpdateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress'\nimport { useEmployeesUpdateMutation } from '@gusto/embedded-api/react-query/employeesUpdate'\nimport { useEmployeeAddressesGetWorkAddressesSuspense } from '@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { useEmployeeAddressesCreateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport { useEmployeesUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus'\nimport { invalidateEmployeesList } from '@gusto/embedded-api/react-query/employeesList'\nimport { useQueryClient } from '@gusto/embedded-api/ReactSDKProvider'\nimport { AdminPersonalDetails, AdminPersonalDetailsSchema } from './AdminPersonalDetails'\nimport { SelfPersonalDetails, SelfPersonalDetailsSchema } from './SelfPersonalDetails'\nimport { type PersonalDetailsPayload, type PersonalDetailsInputs } from './PersonalDetailsInputs'\nimport { Head } from './Head'\nimport { Actions } from './Actions'\nimport { HomeAddress, HomeAddressSchema, type HomeAddressInputs } from './HomeAddress'\nimport { WorkAddress } from './WorkAddress'\nimport { ProfileProvider } from './useProfile'\nimport { getEmployeeAddressForProfile } from './getEmployeeAddressForProfile'\nimport { Form } from '@/components/Common/Form'\nimport {\n useBase,\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport {\n componentEvents,\n EmployeeOnboardingStatus,\n EmployeeSelfOnboardingStatuses,\n} from '@/shared/constants'\nimport type { RequireAtLeastOne, WithRequired } from '@/types/Helpers'\nimport type { EmployeeOnboardingContextInterface } from '@/components/Flow/EmployeeOnboardingFlow'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\nexport type ProfileDefaultValues = RequireAtLeastOne<{\n employee?: RequireAtLeastOne<{\n firstName?: string\n middleInitial?: string\n lastName?: string\n email?: string\n dateOfBirth?: string\n }>\n homeAddress?: RequireAtLeastOne<{\n street1?: string\n street2?: string\n city?: string\n state?: string\n zip?: string\n }>\n}>\ninterface ProfileProps extends CommonComponentInterface {\n employeeId?: string\n companyId: string\n defaultValues?: ProfileDefaultValues\n isAdmin?: boolean\n isSelfOnboardingEnabled?: boolean\n}\n\ninterface ProfileConditionalProps {\n employee?: Employee\n homeAddresses?: EmployeeAddress[]\n workAddresses?: EmployeeWorkAddress[]\n}\n\nexport function Profile(props: ProfileProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n {props.employeeId ? (\n <RootWithEmployee {...props} employeeId={props.employeeId}>\n {props.children}\n </RootWithEmployee>\n ) : (\n <Root {...props}>{props.children}</Root>\n )}\n </BaseComponent>\n )\n}\n\n/**Accounting for conditional logic where employee data needs to be fetched only if employeeId is present */\nfunction RootWithEmployee({ employeeId, ...props }: WithRequired<ProfileProps, 'employeeId'>) {\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n const {\n data: { employeeAddressList },\n } = useEmployeeAddressesGetSuspense({ employeeId })\n const {\n data: { employeeWorkAddressList },\n } = useEmployeeAddressesGetWorkAddressesSuspense({ employeeId })\n return (\n <Root\n {...props}\n employee={employee}\n homeAddresses={employeeAddressList}\n workAddresses={employeeWorkAddressList}\n />\n )\n}\n\nconst Root = ({\n isAdmin = false,\n isSelfOnboardingEnabled = true,\n ...props\n}: ProfileProps & ProfileConditionalProps) => {\n useI18n('Employee.Profile')\n useI18n('Employee.HomeAddress')\n const {\n companyId,\n employee,\n homeAddresses,\n workAddresses,\n children,\n className = '',\n defaultValues,\n } = props\n const { onEvent, baseSubmitHandler } = useBase()\n const queryClient = useQueryClient()\n\n const { data } = useLocationsGetSuspense({ companyId })\n const companyLocations = data.locationList!\n\n const { mutateAsync: createEmployee, isPending: isPendingCreateEmployee } =\n useEmployeesCreateMutation()\n const { mutateAsync: mutateEmployee, isPending: isPendingEmployeeUpdate } =\n useEmployeesUpdateMutation()\n\n const { mutateAsync: createEmployeeWorkAddress, isPending: isPendingCreateWA } =\n useEmployeeAddressesCreateWorkAddressMutation()\n const { mutateAsync: mutateEmployeeWorkAddress, isPending: isPendingWorkAddressUpdate } =\n useEmployeeAddressesUpdateWorkAddressMutation()\n\n const { mutateAsync: createEmployeeHomeAddress, isPending: isPendingAddHA } =\n useEmployeeAddressesCreateMutation()\n const { mutateAsync: mutateEmployeeHomeAddress, isPending: isPendingUpdateHA } =\n useEmployeeAddressesUpdateMutation()\n\n const {\n mutateAsync: updateEmployeeOnboardingStatus,\n isPending: isPendingUpdateOnboardingStatus,\n } = useEmployeesUpdateOnboardingStatusMutation({\n onSettled: () => invalidateEmployeesList(queryClient, [companyId]),\n })\n\n const existingData = { employee, workAddresses, homeAddresses }\n\n const currentHomeAddress = getEmployeeAddressForProfile(homeAddresses)\n\n const currentWorkAddress = existingData.workAddresses?.find(address => address.active)\n const mergedData = useRef({\n employee: existingData.employee,\n homeAddress: currentHomeAddress,\n workAddress: currentWorkAddress,\n })\n const initialValues = {\n firstName: mergedData.current.employee?.firstName ?? defaultValues?.employee?.firstName ?? '',\n middleInitial:\n mergedData.current.employee?.middleInitial ?? defaultValues?.employee?.middleInitial ?? '',\n lastName: mergedData.current.employee?.lastName ?? defaultValues?.employee?.lastName ?? '',\n workAddress: mergedData.current.workAddress?.locationUuid,\n startDate: mergedData.current.employee?.jobs?.[0]?.hireDate\n ? new Date(mergedData.current.employee.jobs[0].hireDate)\n : null, // By default employee response contains only current job - therefore jobs[0]\n email: mergedData.current.employee?.email ?? defaultValues?.employee?.email ?? '',\n dateOfBirth: mergedData.current.employee?.dateOfBirth\n ? new Date(mergedData.current.employee.dateOfBirth)\n : defaultValues?.employee?.dateOfBirth\n ? new Date(defaultValues.employee.dateOfBirth)\n : null,\n\n street1: mergedData.current.homeAddress?.street1 ?? defaultValues?.homeAddress?.street1 ?? '',\n street2: mergedData.current.homeAddress?.street2 ?? defaultValues?.homeAddress?.street2 ?? '',\n city: mergedData.current.homeAddress?.city ?? defaultValues?.homeAddress?.city ?? '',\n zip: mergedData.current.homeAddress?.zip ?? defaultValues?.homeAddress?.zip ?? '',\n state: mergedData.current.homeAddress?.state ?? defaultValues?.homeAddress?.state ?? '',\n courtesyWithholding: mergedData.current.homeAddress?.courtesyWithholding ?? false,\n }\n\n const adminDefaultValues =\n mergedData.current.employee?.onboarded ||\n mergedData.current.employee?.onboardingStatus ===\n EmployeeOnboardingStatus.ONBOARDING_COMPLETED ||\n (mergedData.current.employee?.onboardingStatus !== undefined &&\n mergedData.current.employee.onboardingStatus !==\n EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE)\n ? { ...initialValues, enableSsn: false, selfOnboarding: true }\n : {\n ...initialValues,\n selfOnboarding: isSelfOnboardingEnabled\n ? mergedData.current.employee?.onboardingStatus\n ? // @ts-expect-error: onboarding_status during runtime can be one of self onboarding statuses\n EmployeeSelfOnboardingStatuses.has(mergedData.current.employee.onboarding_status)\n : false\n : false,\n enableSsn: !mergedData.current.employee?.hasSsn,\n ssn: '',\n } // In edit mode ssn is submitted only if it has been modified\n\n const selfDetaultValues = {\n ...initialValues,\n enableSsn: !mergedData.current.employee?.hasSsn,\n ssn: '',\n }\n\n const formMethods = useForm<\n PersonalDetailsInputs & HomeAddressInputs,\n unknown,\n PersonalDetailsPayload & HomeAddressInputs\n >({\n resolver: valibotResolver(\n v.intersect([\n isAdmin ? AdminPersonalDetailsSchema : SelfPersonalDetailsSchema,\n HomeAddressSchema,\n ]),\n ),\n defaultValues: isAdmin ? adminDefaultValues : selfDetaultValues,\n })\n\n const { handleSubmit } = formMethods\n const watchedSelfOnboarding = useWatch({ control: formMethods.control, name: 'selfOnboarding' })\n\n const onSubmit: SubmitHandler<PersonalDetailsPayload & HomeAddressInputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n const { workAddress, startDate, selfOnboarding, ...body } = payload\n //create or update employee\n if (!mergedData.current.employee) {\n const { employee: employeeData } = await createEmployee({\n request: {\n companyId,\n requestBody: { ...body, selfOnboarding },\n },\n })\n mergedData.current = { ...mergedData.current, employee: employeeData }\n onEvent(componentEvents.EMPLOYEE_CREATED, employeeData)\n } else {\n // Updating self-onboarding status\n if (\n (selfOnboarding &&\n mergedData.current.employee.onboardingStatus ===\n EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE) ||\n (!selfOnboarding &&\n mergedData.current.employee.onboardingStatus ===\n EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE)\n ) {\n const { employeeOnboardingStatus } = await updateEmployeeOnboardingStatus({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: {\n onboardingStatus: selfOnboarding\n ? EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE\n : EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE,\n },\n },\n })\n mergedData.current.employee = {\n ...mergedData.current.employee,\n onboardingStatus: employeeOnboardingStatus!\n .onboardingStatus as (typeof EmployeeOnboardingStatus)[keyof typeof EmployeeOnboardingStatus],\n }\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_STATUS_UPDATED, employeeOnboardingStatus)\n }\n const { employee: employeeData } = await mutateEmployee({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: { ...body, version: mergedData.current.employee.version as string },\n },\n })\n mergedData.current = { ...mergedData.current, employee: employeeData }\n onEvent(componentEvents.EMPLOYEE_UPDATED, employeeData)\n }\n if (typeof mergedData.current.employee?.uuid !== 'string') {\n throw new Error('Employee id is not available')\n }\n //create or update home address - only if not intended for self onboarding\n if (!watchedSelfOnboarding || !isAdmin) {\n //typeguard: in this scenario payload will contain address information\n if (!payload.selfOnboarding) {\n const { street1, street2, city, state, zip, courtesyWithholding } = payload\n if (!mergedData.current.homeAddress) {\n // Creating home address - for new employee effective_date is the same as work start date\n const { employeeAddress } = await createEmployeeHomeAddress({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: {\n street1,\n street2,\n city,\n state,\n zip,\n courtesyWithholding,\n },\n },\n })\n mergedData.current = { ...mergedData.current, homeAddress: employeeAddress }\n onEvent(componentEvents.EMPLOYEE_HOME_ADDRESS_CREATED, employeeAddress)\n } else {\n const { employeeAddress } = await mutateEmployeeHomeAddress({\n request: {\n homeAddressUuid: mergedData.current.homeAddress.uuid as string,\n requestBody: {\n version: mergedData.current.homeAddress.version as string,\n street1,\n street2,\n city,\n state,\n zip,\n courtesyWithholding,\n },\n },\n })\n mergedData.current = { ...mergedData.current, homeAddress: employeeAddress }\n onEvent(componentEvents.EMPLOYEE_HOME_ADDRESS_UPDATED, employeeAddress)\n }\n }\n }\n\n if (isAdmin) {\n //create or update workaddress\n if (!mergedData.current.workAddress) {\n const { employeeWorkAddress } = await createEmployeeWorkAddress({\n request: {\n employeeId: mergedData.current.employee?.uuid as string,\n requestBody: {\n locationUuid: workAddress,\n effectiveDate: new RFCDate(payload.startDate || new Date()),\n },\n },\n })\n\n mergedData.current = { ...mergedData.current, workAddress: employeeWorkAddress }\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_CREATED, employeeWorkAddress)\n } else {\n //effective_date is excluded from update operation since it cannot be changed on initial work address\n const { employeeWorkAddress } = await mutateEmployeeWorkAddress({\n request: {\n workAddressUuid: mergedData.current.workAddress.uuid,\n requestBody: {\n version: mergedData.current.workAddress.version,\n locationUuid: workAddress,\n },\n },\n })\n mergedData.current = { ...mergedData.current, workAddress: employeeWorkAddress }\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_UPDATED, employeeWorkAddress)\n }\n }\n\n onEvent(componentEvents.EMPLOYEE_PROFILE_DONE, {\n ...mergedData.current.employee,\n startDate,\n })\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n return (\n <section className={className}>\n <ProfileProvider\n value={{\n companyLocations,\n workAddresses,\n employee: mergedData.current.employee ?? undefined,\n isSelfOnboardingIntended: watchedSelfOnboarding,\n handleCancel,\n isAdmin,\n isSelfOnboardingEnabled,\n isPending:\n isPendingEmployeeUpdate ||\n isPendingWorkAddressUpdate ||\n isPendingAddHA ||\n isPendingUpdateHA ||\n isPendingCreateEmployee ||\n isPendingCreateWA ||\n isPendingUpdateOnboardingStatus,\n }}\n >\n <FormProvider {...formMethods}>\n <Form onSubmit={handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <AdminPersonalDetails />\n <SelfPersonalDetails />\n <HomeAddress />\n <WorkAddress />\n <Actions />\n </>\n )}\n </Form>\n </FormProvider>\n </ProfileProvider>\n </section>\n )\n}\n\nProfile.Head = Head\nProfile.Actions = Actions\nProfile.AdminPersonalDetails = AdminPersonalDetails\nProfile.SelfPersonalDetails = SelfPersonalDetails\nProfile.HomeAddress = HomeAddress\nProfile.WorkAddress = WorkAddress\n\nexport const ProfileContextual = () => {\n const { companyId, employeeId, onEvent, isAdmin, defaultValues, isSelfOnboardingEnabled } =\n useFlow<EmployeeOnboardingContextInterface>()\n\n return (\n <Profile\n companyId={ensureRequired(companyId)}\n employeeId={employeeId}\n onEvent={onEvent}\n isAdmin={isAdmin}\n defaultValues={defaultValues?.profile}\n isSelfOnboardingEnabled={isSelfOnboardingEnabled}\n />\n )\n}\n"],"names":["Profile","props","jsx","BaseComponent","RootWithEmployee","Root","employeeId","employee","useEmployeesGetSuspense","employeeAddressList","useEmployeeAddressesGetSuspense","employeeWorkAddressList","useEmployeeAddressesGetWorkAddressesSuspense","isAdmin","isSelfOnboardingEnabled","useI18n","companyId","homeAddresses","workAddresses","children","className","defaultValues","onEvent","baseSubmitHandler","useBase","queryClient","useQueryClient","data","useLocationsGetSuspense","companyLocations","createEmployee","isPendingCreateEmployee","useEmployeesCreateMutation","mutateEmployee","isPendingEmployeeUpdate","useEmployeesUpdateMutation","createEmployeeWorkAddress","isPendingCreateWA","useEmployeeAddressesCreateWorkAddressMutation","mutateEmployeeWorkAddress","isPendingWorkAddressUpdate","useEmployeeAddressesUpdateWorkAddressMutation","createEmployeeHomeAddress","isPendingAddHA","useEmployeeAddressesCreateMutation","mutateEmployeeHomeAddress","isPendingUpdateHA","useEmployeeAddressesUpdateMutation","updateEmployeeOnboardingStatus","isPendingUpdateOnboardingStatus","useEmployeesUpdateOnboardingStatusMutation","invalidateEmployeesList","existingData","currentHomeAddress","getEmployeeAddressForProfile","currentWorkAddress","address","mergedData","useRef","initialValues","adminDefaultValues","EmployeeOnboardingStatus","EmployeeSelfOnboardingStatuses","selfDetaultValues","formMethods","useForm","valibotResolver","v","AdminPersonalDetailsSchema","SelfPersonalDetailsSchema","HomeAddressSchema","handleSubmit","watchedSelfOnboarding","useWatch","onSubmit","payload","workAddress","startDate","selfOnboarding","body","employeeOnboardingStatus","componentEvents","employeeData","street1","street2","city","state","zip","courtesyWithholding","employeeAddress","employeeWorkAddress","RFCDate","handleCancel","ProfileProvider","FormProvider","Form","jsxs","Fragment","Head","AdminPersonalDetails","SelfPersonalDetails","HomeAddress","WorkAddress","Actions","ProfileContextual","useFlow","ensureRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+EO,SAASA,EAAQC,GAA8C;AAElE,SAAA,gBAAAC,EAACC,MAAe,GAAGF,GAChB,YAAM,aACL,gBAAAC,EAACE,IAAkB,EAAA,GAAGH,GAAO,YAAYA,EAAM,YAC5C,UAAAA,EAAM,SACT,CAAA,IAEA,gBAAAC,EAACG,KAAM,GAAGJ,GAAQ,UAAMA,EAAA,SAAA,CAAS,EAErC,CAAA;AAEJ;AAGA,SAASG,GAAiB,EAAE,YAAAE,GAAY,GAAGL,KAAmD;AACtF,QAAA;AAAA,IACJ,MAAM,EAAE,UAAAM,EAAS;AAAA,EAAA,IACfC,GAAwB,EAAE,YAAAF,GAAY,GACpC;AAAA,IACJ,MAAM,EAAE,qBAAAG,EAAoB;AAAA,EAAA,IAC1BC,GAAgC,EAAE,YAAAJ,GAAY,GAC5C;AAAA,IACJ,MAAM,EAAE,yBAAAK,EAAwB;AAAA,EAAA,IAC9BC,GAA6C,EAAE,YAAAN,GAAY;AAE7D,SAAA,gBAAAJ;AAAA,IAACG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Q,UAAUuG;AAClBvG,EAAQ,uBAAuBmG;AAC/BnG,EAAQ,sBAAsBoG;AAC9BpG,EAAQ,cAAcqG;AACtBrG,EAAQ,cAAcsG;AAEf,MAAME,KAAoB,MAAM;AAC/B,QAAA,EAAE,WAAAxF,GAAW,YAAAV,GAAY,SAAAgB,GAAS,SAAAT,GAAS,eAAAQ,GAAe,yBAAAP,MAC9D2F,GAA4C;AAG5C,SAAA,gBAAAvG;AAAA,IAACF;AAAA,IAAA;AAAA,MACC,WAAW0G,GAAe1F,CAAS;AAAA,MACnC,YAAAV;AAAA,MACA,SAAAgB;AAAA,MACA,SAAAT;AAAA,MACA,eAAeQ,GAAe;AAAA,MAC9B,yBAAAP;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"Profile.js","sources":["../../../../src/components/Employee/Profile/Profile.tsx"],"sourcesContent":["import { zodResolver } from '@hookform/resolvers/zod'\nimport { useRef } from 'react'\nimport type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useLocationsGetSuspense } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useEmployeesCreateMutation } from '@gusto/embedded-api/react-query/employeesCreate'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { type Employee } from '@gusto/embedded-api/models/components/employee'\nimport { useEmployeeAddressesGetSuspense } from '@gusto/embedded-api/react-query/employeeAddressesGet'\nimport { type EmployeeAddress } from '@gusto/embedded-api/models/components/employeeaddress'\nimport { useEmployeeAddressesCreateMutation } from '@gusto/embedded-api/react-query/employeeAddressesCreate'\nimport { useEmployeeAddressesUpdateMutation } from '@gusto/embedded-api/react-query/employeeAddressesUpdate'\nimport { useEmployeeAddressesUpdateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress'\nimport { useEmployeesUpdateMutation } from '@gusto/embedded-api/react-query/employeesUpdate'\nimport { useEmployeeAddressesGetWorkAddressesSuspense } from '@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { useEmployeeAddressesCreateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport { useEmployeesUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus'\nimport { invalidateEmployeesList } from '@gusto/embedded-api/react-query/employeesList'\nimport { useQueryClient } from '@tanstack/react-query'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlow'\nimport { AdminPersonalDetails, AdminPersonalDetailsSchema } from './AdminPersonalDetails'\nimport { SelfPersonalDetails, SelfPersonalDetailsSchema } from './SelfPersonalDetails'\nimport { type PersonalDetailsPayload, type PersonalDetailsInputs } from './PersonalDetailsInputs'\nimport { Head } from './Head'\nimport { Actions } from './Actions'\nimport { HomeAddress, HomeAddressSchema, type HomeAddressInputs } from './HomeAddress'\nimport { WorkAddress } from './WorkAddress'\nimport { ProfileProvider } from './useProfile'\nimport { getEmployeeAddressForProfile } from './getEmployeeAddressForProfile'\nimport { Form } from '@/components/Common/Form'\nimport {\n useBase,\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport {\n componentEvents,\n EmployeeOnboardingStatus,\n EmployeeSelfOnboardingStatuses,\n} from '@/shared/constants'\nimport type { RequireAtLeastOne, WithRequired } from '@/types/Helpers'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport type ProfileDefaultValues = RequireAtLeastOne<{\n employee?: RequireAtLeastOne<{\n firstName?: string\n middleInitial?: string\n lastName?: string\n email?: string\n dateOfBirth?: string\n }>\n homeAddress?: RequireAtLeastOne<{\n street1?: string\n street2?: string\n city?: string\n state?: string\n zip?: string\n }>\n}>\ninterface ProfileProps extends CommonComponentInterface<'Employee.Profile'> {\n employeeId?: string\n companyId: string\n defaultValues?: ProfileDefaultValues\n isAdmin?: boolean\n isSelfOnboardingEnabled?: boolean\n}\n\ninterface ProfileConditionalProps {\n employee?: Employee\n homeAddresses?: EmployeeAddress[]\n workAddresses?: EmployeeWorkAddress[]\n}\n\nexport function Profile(props: ProfileProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n {props.employeeId ? (\n <RootWithEmployee {...props} employeeId={props.employeeId}>\n {props.children}\n </RootWithEmployee>\n ) : (\n <Root {...props}>{props.children}</Root>\n )}\n </BaseComponent>\n )\n}\n\n/**Accounting for conditional logic where employee data needs to be fetched only if employeeId is present */\nfunction RootWithEmployee({ employeeId, ...props }: WithRequired<ProfileProps, 'employeeId'>) {\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n const {\n data: { employeeAddressList },\n } = useEmployeeAddressesGetSuspense({ employeeId })\n const {\n data: { employeeWorkAddressList },\n } = useEmployeeAddressesGetWorkAddressesSuspense({ employeeId })\n return (\n <Root\n {...props}\n employee={employee}\n homeAddresses={employeeAddressList}\n workAddresses={employeeWorkAddressList}\n />\n )\n}\n\nconst Root = ({\n isAdmin = false,\n isSelfOnboardingEnabled = true,\n dictionary,\n ...props\n}: ProfileProps & ProfileConditionalProps) => {\n useI18n('Employee.Profile')\n useI18n('Employee.HomeAddress')\n useComponentDictionary('Employee.Profile', dictionary)\n const {\n companyId,\n employee,\n homeAddresses,\n workAddresses,\n children,\n className = '',\n defaultValues,\n } = props\n const { onEvent, baseSubmitHandler } = useBase()\n const queryClient = useQueryClient()\n\n const { data } = useLocationsGetSuspense({ companyId })\n const companyLocations = data.locationList!\n\n const { mutateAsync: createEmployee, isPending: isPendingCreateEmployee } =\n useEmployeesCreateMutation()\n const { mutateAsync: mutateEmployee, isPending: isPendingEmployeeUpdate } =\n useEmployeesUpdateMutation()\n\n const { mutateAsync: createEmployeeWorkAddress, isPending: isPendingCreateWA } =\n useEmployeeAddressesCreateWorkAddressMutation()\n const { mutateAsync: mutateEmployeeWorkAddress, isPending: isPendingWorkAddressUpdate } =\n useEmployeeAddressesUpdateWorkAddressMutation()\n\n const { mutateAsync: createEmployeeHomeAddress, isPending: isPendingAddHA } =\n useEmployeeAddressesCreateMutation()\n const { mutateAsync: mutateEmployeeHomeAddress, isPending: isPendingUpdateHA } =\n useEmployeeAddressesUpdateMutation()\n\n const {\n mutateAsync: updateEmployeeOnboardingStatus,\n isPending: isPendingUpdateOnboardingStatus,\n } = useEmployeesUpdateOnboardingStatusMutation({\n onSettled: () => invalidateEmployeesList(queryClient, [companyId]),\n })\n\n const existingData = { employee, workAddresses, homeAddresses }\n\n const currentHomeAddress = getEmployeeAddressForProfile(homeAddresses)\n\n const currentWorkAddress = existingData.workAddresses?.find(address => address.active)\n const mergedData = useRef({\n employee: existingData.employee,\n homeAddress: currentHomeAddress,\n workAddress: currentWorkAddress,\n })\n const initialValues = {\n firstName: mergedData.current.employee?.firstName ?? defaultValues?.employee?.firstName ?? '',\n middleInitial:\n mergedData.current.employee?.middleInitial ?? defaultValues?.employee?.middleInitial ?? '',\n lastName: mergedData.current.employee?.lastName ?? defaultValues?.employee?.lastName ?? '',\n workAddress: mergedData.current.workAddress?.locationUuid,\n startDate: mergedData.current.employee?.jobs?.[0]?.hireDate\n ? new Date(mergedData.current.employee.jobs[0].hireDate)\n : null, // By default employee response contains only current job - therefore jobs[0]\n email: mergedData.current.employee?.email ?? defaultValues?.employee?.email ?? '',\n dateOfBirth: mergedData.current.employee?.dateOfBirth\n ? new Date(mergedData.current.employee.dateOfBirth)\n : defaultValues?.employee?.dateOfBirth\n ? new Date(defaultValues.employee.dateOfBirth)\n : null,\n\n street1: mergedData.current.homeAddress?.street1 ?? defaultValues?.homeAddress?.street1 ?? '',\n street2: mergedData.current.homeAddress?.street2 ?? defaultValues?.homeAddress?.street2 ?? '',\n city: mergedData.current.homeAddress?.city ?? defaultValues?.homeAddress?.city ?? '',\n zip: mergedData.current.homeAddress?.zip ?? defaultValues?.homeAddress?.zip ?? '',\n state: mergedData.current.homeAddress?.state ?? defaultValues?.homeAddress?.state ?? '',\n courtesyWithholding: mergedData.current.homeAddress?.courtesyWithholding ?? false,\n }\n\n const adminDefaultValues =\n mergedData.current.employee?.onboarded ||\n mergedData.current.employee?.onboardingStatus ===\n EmployeeOnboardingStatus.ONBOARDING_COMPLETED ||\n (mergedData.current.employee?.onboardingStatus !== undefined &&\n mergedData.current.employee.onboardingStatus !==\n EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE)\n ? { ...initialValues, enableSsn: false, selfOnboarding: true }\n : {\n ...initialValues,\n selfOnboarding: isSelfOnboardingEnabled\n ? mergedData.current.employee?.onboardingStatus\n ? // @ts-expect-error: onboarding_status during runtime can be one of self onboarding statuses\n EmployeeSelfOnboardingStatuses.has(mergedData.current.employee.onboarding_status)\n : false\n : false,\n enableSsn: !mergedData.current.employee?.hasSsn,\n ssn: '',\n } // In edit mode ssn is submitted only if it has been modified\n\n const selfDetaultValues = {\n ...initialValues,\n enableSsn: !mergedData.current.employee?.hasSsn,\n ssn: '',\n }\n\n const formMethods = useForm<\n PersonalDetailsInputs & HomeAddressInputs,\n unknown,\n PersonalDetailsPayload & HomeAddressInputs\n >({\n resolver: zodResolver(\n (isAdmin ? AdminPersonalDetailsSchema : SelfPersonalDetailsSchema).and(HomeAddressSchema),\n ),\n defaultValues: isAdmin ? adminDefaultValues : selfDetaultValues,\n })\n\n const { handleSubmit } = formMethods\n const watchedSelfOnboarding = useWatch({ control: formMethods.control, name: 'selfOnboarding' })\n\n const onSubmit: SubmitHandler<PersonalDetailsPayload & HomeAddressInputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n const { workAddress, startDate, selfOnboarding, ...body } = payload\n //create or update employee\n if (!mergedData.current.employee) {\n const { employee: employeeData } = await createEmployee({\n request: {\n companyId,\n requestBody: { ...body, selfOnboarding },\n },\n })\n mergedData.current = { ...mergedData.current, employee: employeeData }\n onEvent(componentEvents.EMPLOYEE_CREATED, employeeData)\n } else {\n // Updating self-onboarding status\n if (\n (selfOnboarding &&\n mergedData.current.employee.onboardingStatus ===\n EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE) ||\n (!selfOnboarding &&\n mergedData.current.employee.onboardingStatus ===\n EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE)\n ) {\n const { employeeOnboardingStatus } = await updateEmployeeOnboardingStatus({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: {\n onboardingStatus: selfOnboarding\n ? EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE\n : EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE,\n },\n },\n })\n mergedData.current.employee = {\n ...mergedData.current.employee,\n onboardingStatus: employeeOnboardingStatus!\n .onboardingStatus as (typeof EmployeeOnboardingStatus)[keyof typeof EmployeeOnboardingStatus],\n }\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_STATUS_UPDATED, employeeOnboardingStatus)\n }\n const { employee: employeeData } = await mutateEmployee({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: { ...body, version: mergedData.current.employee.version as string },\n },\n })\n mergedData.current = { ...mergedData.current, employee: employeeData }\n onEvent(componentEvents.EMPLOYEE_UPDATED, employeeData)\n }\n if (typeof mergedData.current.employee?.uuid !== 'string') {\n throw new Error('Employee id is not available')\n }\n //create or update home address - only if not intended for self onboarding\n if (!watchedSelfOnboarding || !isAdmin) {\n //typeguard: in this scenario payload will contain address information\n if (!payload.selfOnboarding) {\n const { street1, street2, city, state, zip, courtesyWithholding } = payload\n if (!mergedData.current.homeAddress) {\n // Creating home address - for new employee effective_date is the same as work start date\n const { employeeAddress } = await createEmployeeHomeAddress({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: {\n street1,\n street2,\n city,\n state,\n zip,\n courtesyWithholding,\n },\n },\n })\n mergedData.current = { ...mergedData.current, homeAddress: employeeAddress }\n onEvent(componentEvents.EMPLOYEE_HOME_ADDRESS_CREATED, employeeAddress)\n } else {\n const { employeeAddress } = await mutateEmployeeHomeAddress({\n request: {\n homeAddressUuid: mergedData.current.homeAddress.uuid as string,\n requestBody: {\n version: mergedData.current.homeAddress.version as string,\n street1,\n street2,\n city,\n state,\n zip,\n courtesyWithholding,\n },\n },\n })\n mergedData.current = { ...mergedData.current, homeAddress: employeeAddress }\n onEvent(componentEvents.EMPLOYEE_HOME_ADDRESS_UPDATED, employeeAddress)\n }\n }\n }\n\n if (isAdmin) {\n //create or update workaddress\n if (!mergedData.current.workAddress) {\n const { employeeWorkAddress } = await createEmployeeWorkAddress({\n request: {\n employeeId: mergedData.current.employee?.uuid as string,\n requestBody: {\n locationUuid: workAddress,\n effectiveDate: new RFCDate(payload.startDate || new Date()),\n },\n },\n })\n\n mergedData.current = { ...mergedData.current, workAddress: employeeWorkAddress }\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_CREATED, employeeWorkAddress)\n } else {\n //effective_date is excluded from update operation since it cannot be changed on initial work address\n const { employeeWorkAddress } = await mutateEmployeeWorkAddress({\n request: {\n workAddressUuid: mergedData.current.workAddress.uuid,\n requestBody: {\n version: mergedData.current.workAddress.version,\n locationUuid: workAddress,\n },\n },\n })\n mergedData.current = { ...mergedData.current, workAddress: employeeWorkAddress }\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_UPDATED, employeeWorkAddress)\n }\n }\n\n onEvent(componentEvents.EMPLOYEE_PROFILE_DONE, {\n ...mergedData.current.employee,\n startDate,\n })\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n return (\n <section className={className}>\n <ProfileProvider\n value={{\n companyLocations,\n workAddresses,\n employee: mergedData.current.employee ?? undefined,\n isSelfOnboardingIntended: watchedSelfOnboarding,\n handleCancel,\n isAdmin,\n isSelfOnboardingEnabled,\n isPending:\n isPendingEmployeeUpdate ||\n isPendingWorkAddressUpdate ||\n isPendingAddHA ||\n isPendingUpdateHA ||\n isPendingCreateEmployee ||\n isPendingCreateWA ||\n isPendingUpdateOnboardingStatus,\n }}\n >\n <FormProvider {...formMethods}>\n <Form onSubmit={handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <AdminPersonalDetails />\n <SelfPersonalDetails />\n <HomeAddress />\n <WorkAddress />\n <Actions />\n </>\n )}\n </Form>\n </FormProvider>\n </ProfileProvider>\n </section>\n )\n}\n\nProfile.Head = Head\nProfile.Actions = Actions\nProfile.AdminPersonalDetails = AdminPersonalDetails\nProfile.SelfPersonalDetails = SelfPersonalDetails\nProfile.HomeAddress = HomeAddress\nProfile.WorkAddress = WorkAddress\n\nexport const ProfileContextual = () => {\n const { companyId, employeeId, onEvent, isAdmin, defaultValues, isSelfOnboardingEnabled } =\n useFlow<OnboardingContextInterface>()\n\n return (\n <Profile\n companyId={ensureRequired(companyId)}\n employeeId={employeeId}\n onEvent={onEvent}\n isAdmin={isAdmin}\n defaultValues={defaultValues?.profile}\n isSelfOnboardingEnabled={isSelfOnboardingEnabled}\n />\n )\n}\n"],"names":["Profile","props","jsx","BaseComponent","RootWithEmployee","Root","employeeId","employee","useEmployeesGetSuspense","employeeAddressList","useEmployeeAddressesGetSuspense","employeeWorkAddressList","useEmployeeAddressesGetWorkAddressesSuspense","isAdmin","isSelfOnboardingEnabled","dictionary","useI18n","useComponentDictionary","companyId","homeAddresses","workAddresses","children","className","defaultValues","onEvent","baseSubmitHandler","useBase","queryClient","useQueryClient","data","useLocationsGetSuspense","companyLocations","createEmployee","isPendingCreateEmployee","useEmployeesCreateMutation","mutateEmployee","isPendingEmployeeUpdate","useEmployeesUpdateMutation","createEmployeeWorkAddress","isPendingCreateWA","useEmployeeAddressesCreateWorkAddressMutation","mutateEmployeeWorkAddress","isPendingWorkAddressUpdate","useEmployeeAddressesUpdateWorkAddressMutation","createEmployeeHomeAddress","isPendingAddHA","useEmployeeAddressesCreateMutation","mutateEmployeeHomeAddress","isPendingUpdateHA","useEmployeeAddressesUpdateMutation","updateEmployeeOnboardingStatus","isPendingUpdateOnboardingStatus","useEmployeesUpdateOnboardingStatusMutation","invalidateEmployeesList","existingData","currentHomeAddress","getEmployeeAddressForProfile","currentWorkAddress","address","mergedData","useRef","initialValues","adminDefaultValues","EmployeeOnboardingStatus","EmployeeSelfOnboardingStatuses","selfDetaultValues","formMethods","useForm","zodResolver","AdminPersonalDetailsSchema","SelfPersonalDetailsSchema","HomeAddressSchema","handleSubmit","watchedSelfOnboarding","useWatch","onSubmit","payload","workAddress","startDate","selfOnboarding","body","employeeOnboardingStatus","componentEvents","employeeData","street1","street2","city","state","zip","courtesyWithholding","employeeAddress","employeeWorkAddress","RFCDate","handleCancel","ProfileProvider","FormProvider","Form","jsxs","Fragment","Head","AdminPersonalDetails","SelfPersonalDetails","HomeAddress","WorkAddress","Actions","ProfileContextual","useFlow","ensureRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+EO,SAASA,EAAQC,GAA8C;AAElE,SAAA,gBAAAC,EAACC,MAAe,GAAGF,GAChB,YAAM,aACL,gBAAAC,EAACE,IAAkB,EAAA,GAAGH,GAAO,YAAYA,EAAM,YAC5C,UAAAA,EAAM,SACT,CAAA,IAEA,gBAAAC,EAACG,KAAM,GAAGJ,GAAQ,UAAMA,EAAA,SAAA,CAAS,EAErC,CAAA;AAEJ;AAGA,SAASG,GAAiB,EAAE,YAAAE,GAAY,GAAGL,KAAmD;AACtF,QAAA;AAAA,IACJ,MAAM,EAAE,UAAAM,EAAS;AAAA,EAAA,IACfC,GAAwB,EAAE,YAAAF,GAAY,GACpC;AAAA,IACJ,MAAM,EAAE,qBAAAG,EAAoB;AAAA,EAAA,IAC1BC,GAAgC,EAAE,YAAAJ,GAAY,GAC5C;AAAA,IACJ,MAAM,EAAE,yBAAAK,EAAwB;AAAA,EAAA,IAC9BC,GAA6C,EAAE,YAAAN,GAAY;AAE7D,SAAA,gBAAAJ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,EAAQ,OAAOmG;AACfnG,EAAQ,UAAUwG;AAClBxG,EAAQ,uBAAuBoG;AAC/BpG,EAAQ,sBAAsBqG;AAC9BrG,EAAQ,cAAcsG;AACtBtG,EAAQ,cAAcuG;AAEf,MAAME,KAAoB,MAAM;AAC/B,QAAA,EAAE,WAAAvF,GAAW,YAAAZ,GAAY,SAAAkB,GAAS,SAAAX,GAAS,eAAAU,GAAe,yBAAAT,MAC9D4F,GAAoC;AAGpC,SAAA,gBAAAxG;AAAA,IAACF;AAAA,IAAA;AAAA,MACC,WAAW2G,GAAezF,CAAS;AAAA,MACnC,YAAAZ;AAAA,MACA,SAAAkB;AAAA,MACA,SAAAX;AAAA,MACA,eAAeU,GAAe;AAAA,MAC9B,yBAAAT;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
@@ -1,16 +1,45 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const SelfPersonalDetailsSchema:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SelfPersonalDetailsSchema: z.ZodDiscriminatedUnion<"enableSsn", [z.ZodObject<{
|
|
3
|
+
firstName: z.ZodString;
|
|
4
|
+
middleInitial: z.ZodOptional<z.ZodString>;
|
|
5
|
+
lastName: z.ZodString;
|
|
6
|
+
ssn: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
7
|
+
dateOfBirth: z.ZodEffects<z.ZodDate, string | undefined, Date>;
|
|
8
|
+
} & {
|
|
9
|
+
enableSsn: z.ZodLiteral<true>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
ssn: string;
|
|
12
|
+
firstName: string;
|
|
13
|
+
lastName: string;
|
|
14
|
+
enableSsn: true;
|
|
15
|
+
middleInitial?: string | undefined;
|
|
16
|
+
dateOfBirth?: string | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
ssn: string;
|
|
19
|
+
firstName: string;
|
|
20
|
+
lastName: string;
|
|
21
|
+
enableSsn: true;
|
|
22
|
+
dateOfBirth: Date;
|
|
23
|
+
middleInitial?: string | undefined;
|
|
24
|
+
}>, z.ZodObject<{
|
|
25
|
+
firstName: z.ZodString;
|
|
26
|
+
middleInitial: z.ZodOptional<z.ZodString>;
|
|
27
|
+
lastName: z.ZodString;
|
|
28
|
+
} & {
|
|
29
|
+
dateOfBirth: z.ZodEffects<z.ZodDate, string | undefined, Date>;
|
|
30
|
+
} & {
|
|
31
|
+
enableSsn: z.ZodLiteral<false>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
firstName: string;
|
|
34
|
+
lastName: string;
|
|
35
|
+
enableSsn: false;
|
|
36
|
+
middleInitial?: string | undefined;
|
|
37
|
+
dateOfBirth?: string | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
firstName: string;
|
|
40
|
+
lastName: string;
|
|
41
|
+
enableSsn: false;
|
|
42
|
+
dateOfBirth: Date;
|
|
43
|
+
middleInitial?: string | undefined;
|
|
44
|
+
}>]>;
|
|
16
45
|
export declare const SelfPersonalDetails: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { jsxs as a, Fragment as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { z as r } from "zod";
|
|
3
|
+
import { NameInputsSchema as t, SocialSecurityNumberSchema as o, DateOfBirthSchema as n, NameInputs as s, SocialSecurityNumberInput as c, DateOfBirthInput as u } from "./PersonalDetailsInputs.js";
|
|
4
4
|
import { useProfile as S } from "./useProfile.js";
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
...r.entries,
|
|
10
|
-
enableSsn: e.literal(!0)
|
|
5
|
+
const b = r.discriminatedUnion("enableSsn", [
|
|
6
|
+
// Case 1: enableSsn is true
|
|
7
|
+
t.merge(o).merge(n).extend({
|
|
8
|
+
enableSsn: r.literal(!0)
|
|
11
9
|
}),
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
enableSsn: e.literal(!1)
|
|
10
|
+
// Case 2: enableSsn is false
|
|
11
|
+
t.merge(n).extend({
|
|
12
|
+
enableSsn: r.literal(!1)
|
|
16
13
|
})
|
|
17
|
-
]),
|
|
18
|
-
const { employee: i, isAdmin:
|
|
19
|
-
return
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
/* @__PURE__ */
|
|
14
|
+
]), x = () => {
|
|
15
|
+
const { employee: i, isAdmin: m } = S();
|
|
16
|
+
return m ? null : /* @__PURE__ */ a(l, { children: [
|
|
17
|
+
/* @__PURE__ */ e(s, {}),
|
|
18
|
+
/* @__PURE__ */ e(c, { employee: i }),
|
|
19
|
+
/* @__PURE__ */ e(u, {})
|
|
23
20
|
] });
|
|
24
21
|
};
|
|
25
22
|
export {
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
x as SelfPersonalDetails,
|
|
24
|
+
b as SelfPersonalDetailsSchema
|
|
28
25
|
};
|
|
29
26
|
//# sourceMappingURL=SelfPersonalDetails.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelfPersonalDetails.js","sources":["../../../../src/components/Employee/Profile/SelfPersonalDetails.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"SelfPersonalDetails.js","sources":["../../../../src/components/Employee/Profile/SelfPersonalDetails.tsx"],"sourcesContent":["import { z } from 'zod'\nimport {\n NameInputsSchema,\n SocialSecurityNumberSchema,\n DateOfBirthSchema,\n NameInputs,\n SocialSecurityNumberInput,\n DateOfBirthInput,\n} from './PersonalDetailsInputs'\nimport { useProfile } from './useProfile'\n\nexport const SelfPersonalDetailsSchema = z.discriminatedUnion('enableSsn', [\n // Case 1: enableSsn is true\n NameInputsSchema.merge(SocialSecurityNumberSchema)\n .merge(DateOfBirthSchema)\n .extend({\n enableSsn: z.literal(true),\n }),\n // Case 2: enableSsn is false\n NameInputsSchema.merge(DateOfBirthSchema).extend({\n enableSsn: z.literal(false),\n }),\n])\n\nexport const SelfPersonalDetails = () => {\n const { employee, isAdmin } = useProfile()\n\n if (isAdmin) {\n return null\n }\n\n return (\n <>\n <NameInputs />\n <SocialSecurityNumberInput employee={employee} />\n <DateOfBirthInput />\n </>\n )\n}\n"],"names":["SelfPersonalDetailsSchema","z","NameInputsSchema","SocialSecurityNumberSchema","DateOfBirthSchema","SelfPersonalDetails","employee","isAdmin","useProfile","jsxs","Fragment","jsx","NameInputs","SocialSecurityNumberInput","DateOfBirthInput"],"mappings":";;;;AAWa,MAAAA,IAA4BC,EAAE,mBAAmB,aAAa;AAAA;AAAA,EAEzEC,EAAiB,MAAMC,CAA0B,EAC9C,MAAMC,CAAiB,EACvB,OAAO;AAAA,IACN,WAAWH,EAAE,QAAQ,EAAI;AAAA,EAAA,CAC1B;AAAA;AAAA,EAEHC,EAAiB,MAAME,CAAiB,EAAE,OAAO;AAAA,IAC/C,WAAWH,EAAE,QAAQ,EAAK;AAAA,EAC3B,CAAA;AACH,CAAC,GAEYI,IAAsB,MAAM;AACvC,QAAM,EAAE,UAAAC,GAAU,SAAAC,EAAQ,IAAIC,EAAW;AAEzC,SAAID,IACK,OAKL,gBAAAE,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAW,EAAA;AAAA,IACZ,gBAAAD,EAACE,KAA0B,UAAAP,GAAoB;AAAA,sBAC9CQ,GAAiB,CAAA,CAAA;AAAA,EAAA,GACpB;AAEJ;"}
|
|
@@ -7,11 +7,10 @@ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
|
7
7
|
import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
8
8
|
import "../../Base/useBase.js";
|
|
9
9
|
import "dompurify";
|
|
10
|
-
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
10
|
import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
|
|
12
|
-
const [
|
|
11
|
+
const [x, C] = o("ProfileContext");
|
|
13
12
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
C as ProfileProvider,
|
|
14
|
+
x as useProfile
|
|
16
15
|
};
|
|
17
16
|
//# sourceMappingURL=useProfile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProfile.js","sources":["../../../../src/components/Employee/Profile/useProfile.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\n\n//Interface for context passed down to component slots\ntype ProfileContextType = {\n companyLocations: Location[]\n workAddresses?: EmployeeWorkAddress[]\n employee?: Employee\n isSelfOnboardingIntended?: boolean\n isPending: boolean\n isAdmin: boolean\n handleCancel: () => void\n isSelfOnboardingEnabled: boolean\n}\n\nconst [useProfile, ProfileProvider] = createCompoundContext<ProfileContextType>('ProfileContext')\nexport { useProfile, ProfileProvider }\n"],"names":["useProfile","ProfileProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useProfile.js","sources":["../../../../src/components/Employee/Profile/useProfile.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\n\n//Interface for context passed down to component slots\ntype ProfileContextType = {\n companyLocations: Location[]\n workAddresses?: EmployeeWorkAddress[]\n employee?: Employee\n isSelfOnboardingIntended?: boolean\n isPending: boolean\n isAdmin: boolean\n handleCancel: () => void\n isSelfOnboardingEnabled: boolean\n}\n\nconst [useProfile, ProfileProvider] = createCompoundContext<ProfileContextType>('ProfileContext')\nexport { useProfile, ProfileProvider }\n"],"names":["useProfile","ProfileProvider","createCompoundContext"],"mappings":";;;;;;;;;;AAiBA,MAAM,CAACA,GAAYC,CAAe,IAAIC,EAA0C,gBAAgB;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PaymentMethodBankAccount } from '@gusto/embedded-api/models/components/paymentmethodbankaccount';
|
|
2
|
+
import { FlowContextInterface } from '../../Flow/useFlow';
|
|
3
|
+
import { BaseComponentInterface } from '../../Base';
|
|
4
|
+
export interface SelfOnboardingFlowProps extends BaseComponentInterface {
|
|
5
|
+
companyId: string;
|
|
6
|
+
employeeId: string;
|
|
7
|
+
}
|
|
8
|
+
export interface SelfOnboardingContextInterface extends FlowContextInterface {
|
|
9
|
+
companyId: string;
|
|
10
|
+
employeeId: string;
|
|
11
|
+
paymentMethod?: PaymentMethodBankAccount;
|
|
12
|
+
}
|
|
13
|
+
export declare function Landing(): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function Profile(): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function Taxes(): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function PaymentMethod(): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function OnboardingSummary(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import { useFlow as r } from "../useFlow.js";
|
|
3
2
|
import { ensureRequired as n } from "../../../helpers/ensureRequired.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { useFlow as r } from "../../Flow/useFlow.js";
|
|
4
|
+
import { Landing as i } from "../Landing/Landing.js";
|
|
5
|
+
import { OnboardingSummary as a } from "../OnboardingSummary/OnboardingSummary.js";
|
|
6
|
+
import { PaymentMethod as d } from "../PaymentMethod/PaymentMethod.js";
|
|
7
|
+
import { Taxes as p } from "../Taxes/Taxes.js";
|
|
8
|
+
import { Profile as s } from "../Profile/Profile.js";
|
|
9
9
|
function v() {
|
|
10
10
|
const { companyId: e, employeeId: o, onEvent: t } = r();
|
|
11
11
|
return /* @__PURE__ */ m(
|
|
@@ -55,4 +55,4 @@ export {
|
|
|
55
55
|
x as Profile,
|
|
56
56
|
E as Taxes
|
|
57
57
|
};
|
|
58
|
-
//# sourceMappingURL=
|
|
58
|
+
//# sourceMappingURL=SelfOnboardingComponents.js.map
|