@gusto/embedded-react-sdk 0.37.0 → 0.38.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/README.md +3 -0
- package/dist/UNSTABLE_Hooks.d.ts +1 -1
- package/dist/UNSTABLE_Hooks.js +65 -47
- package/dist/UNSTABLE_Hooks.js.map +1 -1
- package/dist/assets/icons/filter-funnel.svg.js +10 -0
- package/dist/assets/icons/filter-funnel.svg.js.map +1 -0
- package/dist/assets/icons/percent-circle.svg.js +10 -0
- package/dist/assets/icons/percent-circle.svg.js.map +1 -0
- package/dist/assets/icons/plus-circle.svg.js +1 -1
- package/dist/assets/icons/plus-circle.svg.js.map +1 -1
- package/dist/components/Base/Base.js +2 -3
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/createCompoundContext.js.map +1 -1
- package/dist/components/Common/DataView/DataCards/DataCards.d.ts +5 -3
- package/dist/components/Common/DataView/DataCards/DataCards.js +58 -39
- package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js +9 -7
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js.map +1 -1
- package/dist/components/Common/DataView/DataTable/DataTable.d.ts +4 -2
- package/dist/components/Common/DataView/DataTable/DataTable.js +95 -76
- package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
- package/dist/components/Common/DataView/DataView.d.ts +4 -3
- package/dist/components/Common/DataView/DataView.js +24 -22
- package/dist/components/Common/DataView/DataView.js.map +1 -1
- package/dist/components/Common/DataView/useDataView.d.ts +33 -6
- package/dist/components/Common/DataView/useDataView.js +23 -20
- package/dist/components/Common/DataView/useDataView.js.map +1 -1
- package/dist/components/Common/DataView/useSelectionState.d.ts +5 -0
- package/dist/components/Common/DataView/useSelectionState.js +8 -0
- package/dist/components/Common/DataView/useSelectionState.js.map +1 -0
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.d.ts +19 -0
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.js +94 -0
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.js.map +1 -0
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.module.scss.js +14 -0
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.module.scss.js.map +1 -0
- package/dist/components/Common/DetailViewLayout/DetailViewLayout.d.ts +2 -0
- package/dist/components/Common/DetailViewLayout/DetailViewLayoutTypes.d.ts +40 -0
- package/dist/components/Common/DetailViewLayout/index.d.ts +3 -0
- package/dist/components/Common/EmptyData/EmptyData.d.ts +2 -1
- package/dist/components/Common/EmptyData/EmptyData.js +15 -13
- package/dist/components/Common/EmptyData/EmptyData.js.map +1 -1
- package/dist/components/Common/EmptyData/EmptyData.module.scss.js +6 -4
- package/dist/components/Common/EmptyData/EmptyData.module.scss.js.map +1 -1
- package/dist/components/Common/Fields/CheckboxField/CheckboxField.js +26 -24
- package/dist/components/Common/Fields/CheckboxField/CheckboxField.js.map +1 -1
- package/dist/components/Common/Fields/CheckboxGroupField/CheckboxGroupField.d.ts +1 -1
- package/dist/components/Common/Fields/CheckboxGroupField/CheckboxGroupField.js +32 -30
- package/dist/components/Common/Fields/CheckboxGroupField/CheckboxGroupField.js.map +1 -1
- package/dist/components/Common/Fields/ComboBoxField/ComboBoxField.d.ts +1 -1
- package/dist/components/Common/Fields/ComboBoxField/ComboBoxField.js +36 -34
- package/dist/components/Common/Fields/ComboBoxField/ComboBoxField.js.map +1 -1
- package/dist/components/Common/Fields/DatePickerField/DatePickerField.d.ts +1 -1
- package/dist/components/Common/Fields/DatePickerField/DatePickerField.js +40 -38
- package/dist/components/Common/Fields/DatePickerField/DatePickerField.js.map +1 -1
- package/dist/components/Common/Fields/FileInputField/FileInputField.js +24 -22
- package/dist/components/Common/Fields/FileInputField/FileInputField.js.map +1 -1
- package/dist/components/Common/Fields/MultiSelectComboBoxField/MultiSelectComboBoxField.js +24 -22
- package/dist/components/Common/Fields/MultiSelectComboBoxField/MultiSelectComboBoxField.js.map +1 -1
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.js +27 -25
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.js.map +1 -1
- package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.d.ts +1 -1
- package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js +34 -32
- package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js.map +1 -1
- package/dist/components/Common/Fields/SelectField/SelectField.d.ts +1 -1
- package/dist/components/Common/Fields/SelectField/SelectField.js +34 -32
- package/dist/components/Common/Fields/SelectField/SelectField.js.map +1 -1
- package/dist/components/Common/Fields/SwitchField/SwitchField.js +26 -24
- package/dist/components/Common/Fields/SwitchField/SwitchField.js.map +1 -1
- package/dist/components/Common/Fields/TextAreaField/TextAreaField.js +24 -22
- package/dist/components/Common/Fields/TextAreaField/TextAreaField.js.map +1 -1
- package/dist/components/Common/Fields/TextInputField/TextInputField.js +26 -24
- package/dist/components/Common/Fields/TextInputField/TextInputField.js.map +1 -1
- package/dist/components/Common/Fields/hooks/useField.d.ts +3 -2
- package/dist/components/Common/Fields/hooks/useField.js +37 -33
- package/dist/components/Common/Fields/hooks/useField.js.map +1 -1
- package/dist/components/Common/Fields/hooks/useStringifyGenericFieldValue.d.ts +2 -2
- package/dist/components/Common/Fields/hooks/useStringifyGenericFieldValue.js +2 -2
- package/dist/components/Common/Fields/hooks/useStringifyGenericFieldValue.js.map +1 -1
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +21 -20
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js.map +1 -1
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes.d.ts +5 -0
- package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.d.ts +1 -1
- package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js +10 -8
- package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js.map +1 -1
- package/dist/components/Common/ReorderableList/ReorderableList.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +10 -15
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +9 -12
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +14 -18
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/Box/Box.d.ts +1 -1
- package/dist/components/Common/UI/Box/Box.js +9 -8
- package/dist/components/Common/UI/Box/Box.js.map +1 -1
- package/dist/components/Common/UI/Box/Box.module.scss.js +12 -8
- package/dist/components/Common/UI/Box/Box.module.scss.js.map +1 -1
- package/dist/components/Common/UI/Box/BoxTypes.d.ts +2 -9
- package/dist/components/Common/UI/BoxHeader/BoxHeader.d.ts +2 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeader.js +23 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeader.js.map +1 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeader.module.scss.js +8 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeader.module.scss.js.map +1 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeaderTypes.d.ts +10 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeaderTypes.js +7 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeaderTypes.js.map +1 -0
- package/dist/components/Common/UI/BoxHeader/index.d.ts +2 -0
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +17 -17
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.d.ts +5 -0
- package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.js.map +1 -1
- package/dist/components/Common/UI/Button/Button.js +33 -29
- package/dist/components/Common/UI/Button/Button.js.map +1 -1
- package/dist/components/Common/UI/Button/Button.module.scss.js +5 -3
- package/dist/components/Common/UI/Button/Button.module.scss.js.map +1 -1
- package/dist/components/Common/UI/Button/ButtonTypes.d.ts +4 -0
- package/dist/components/Common/UI/Button/ButtonTypes.js.map +1 -1
- package/dist/components/Common/UI/Checkbox/Checkbox.js +60 -49
- package/dist/components/Common/UI/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Common/UI/Checkbox/Checkbox.module.scss.js +10 -6
- package/dist/components/Common/UI/Checkbox/Checkbox.module.scss.js.map +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBox.js +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBoxTypes.d.ts +1 -1
- package/dist/components/Common/UI/DatePicker/DatePicker.d.ts +1 -1
- package/dist/components/Common/UI/DatePicker/DatePicker.js +88 -69
- package/dist/components/Common/UI/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/Common/UI/DatePicker/DatePickerTypes.d.ts +13 -0
- package/dist/components/Common/UI/DateRangePicker/DateRangePicker.d.ts +2 -0
- package/dist/components/Common/UI/DateRangePicker/DateRangePicker.js +72 -0
- package/dist/components/Common/UI/DateRangePicker/DateRangePicker.js.map +1 -0
- package/dist/components/Common/UI/DateRangePicker/DateRangePicker.module.scss.js +30 -0
- package/dist/components/Common/UI/DateRangePicker/DateRangePicker.module.scss.js.map +1 -0
- package/dist/components/Common/UI/DateRangePicker/DateRangePickerTypes.d.ts +14 -0
- package/dist/components/Common/UI/DateRangePicker/index.d.ts +2 -0
- package/dist/components/Common/UI/DescriptionList/DescriptionList.js +19 -12
- package/dist/components/Common/UI/DescriptionList/DescriptionList.js.map +1 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +6 -4
- package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js.map +1 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.d.ts +6 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js +4 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js.map +1 -1
- package/dist/components/Common/UI/Heading/Heading.d.ts +1 -1
- package/dist/components/Common/UI/Heading/Heading.js +11 -9
- package/dist/components/Common/UI/Heading/Heading.js.map +1 -1
- package/dist/components/Common/UI/Heading/Heading.module.scss.js +15 -15
- package/dist/components/Common/UI/Heading/HeadingTypes.d.ts +1 -1
- package/dist/components/Common/UI/Input/Input.js.map +1 -1
- package/dist/components/Common/UI/Menu/Menu.module.scss.js +5 -5
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.js +94 -80
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.js.map +1 -1
- package/dist/components/Common/UI/NumberInput/NumberInput.js +1 -1
- package/dist/components/Common/UI/NumberInput/NumberInput.js.map +1 -1
- package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.d.ts +1 -1
- package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.js.map +1 -1
- package/dist/components/Common/UI/Select/Select.js +22 -22
- package/dist/components/Common/UI/Select/Select.js.map +1 -1
- package/dist/components/Common/UI/Select/SelectTypes.d.ts +1 -1
- package/dist/components/Common/UI/Table/Table.js +12 -12
- package/dist/components/Common/UI/Table/Table.js.map +1 -1
- package/dist/components/Common/UI/Table/Table.module.scss.js +1 -1
- package/dist/components/Common/UI/Table/TableTypes.d.ts +3 -3
- package/dist/components/Common/UI/Table/TableTypes.js +3 -3
- package/dist/components/Common/UI/Table/TableTypes.js.map +1 -1
- package/dist/components/Common/UI/TextArea/TextArea.js +1 -1
- package/dist/components/Common/UI/TextArea/TextArea.js.map +1 -1
- package/dist/components/Common/UI/TextInput/TextInput.js +13 -13
- package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
- package/dist/components/Common/index.d.ts +2 -0
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +7 -11
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +2 -5
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +2 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +6 -9
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +13 -14
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +2 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +5 -8
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +13 -14
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +2 -5
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +8 -10
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +9 -13
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +8 -10
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +8 -10
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -8
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +2 -4
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +11 -15
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +11 -15
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +7 -9
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +22 -26
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +7 -9
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -9
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +7 -9
- package/dist/components/Company/Industry/Actions.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/Edit.js +4 -7
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +8 -10
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +5 -7
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +15 -19
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +6 -8
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +15 -16
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +6 -10
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +12 -15
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +9 -12
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +6 -10
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +3 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +94 -91
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +16 -18
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +47 -39
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +11 -14
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +19 -21
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.d.ts +6 -5
- package/dist/components/Company/PaySchedule/usePaySchedule.js +5 -6
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +2 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +33 -33
- 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/Actions.js +2 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +5 -7
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +14 -14
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.d.ts +2 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +3 -7
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +2 -4
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +5 -6
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +33 -34
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +2 -3
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +10 -13
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -5
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +135 -126
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +2 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +72 -71
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +10 -10
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.d.ts +2 -1
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +18 -21
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +2 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +83 -84
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +17 -19
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js +10 -10
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +67 -79
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js +10 -12
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +47 -49
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +63 -66
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.module.scss.js +4 -4
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +13 -13
- package/dist/components/Contractor/Profile/useContractorProfile.js +31 -30
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.d.ts +2 -2
- package/dist/components/Contractor/Submit/Submit.js +44 -46
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +12 -14
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Compensation.js +80 -77
- package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +27 -28
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +22 -23
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Dashboard/BasicDetailsView.d.ts +13 -0
- package/dist/components/Employee/Dashboard/BasicDetailsView.js +107 -0
- package/dist/components/Employee/Dashboard/BasicDetailsView.js.map +1 -0
- package/dist/components/Employee/Dashboard/Dashboard.d.ts +5 -0
- package/dist/components/Employee/Dashboard/Dashboard.js +146 -0
- package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -0
- package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +5 -0
- package/dist/components/Employee/Dashboard/DashboardComponents.js +12 -0
- package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -0
- package/dist/components/Employee/Dashboard/DashboardFlow.d.ts +5 -0
- package/dist/components/Employee/Dashboard/DashboardFlow.js +25 -0
- package/dist/components/Employee/Dashboard/DashboardFlow.js.map +1 -0
- package/dist/components/Employee/Dashboard/DocumentsView.d.ts +7 -0
- package/dist/components/Employee/Dashboard/DocumentsView.js +51 -0
- package/dist/components/Employee/Dashboard/DocumentsView.js.map +1 -0
- package/dist/components/Employee/Dashboard/JobAndPayView.d.ts +22 -0
- package/dist/components/Employee/Dashboard/JobAndPayView.js +211 -0
- package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -0
- package/dist/components/Employee/Dashboard/TaxesView.d.ts +13 -0
- package/dist/components/Employee/Dashboard/TaxesView.js +97 -0
- package/dist/components/Employee/Dashboard/TaxesView.js.map +1 -0
- package/dist/components/Employee/Dashboard/dashboardStateMachine.d.ts +3 -0
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js +8 -0
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -0
- package/dist/components/Employee/Dashboard/hooks/index.d.ts +9 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.d.ts +20 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js +29 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js.map +1 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +30 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +52 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.d.ts +16 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js +22 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js.map +1 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.d.ts +20 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js +24 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js.map +1 -0
- package/dist/components/Employee/Dashboard/index.d.ts +14 -0
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +57 -53
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +17 -18
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +11 -12
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +18 -19
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +6 -7
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +6 -8
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +10 -14
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -6
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js +22 -22
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +24 -26
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +12 -14
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +11 -15
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +6 -9
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.d.ts +3 -7
- package/dist/components/Employee/EmployeeList/EmployeeList.js +45 -95
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeListView.d.ts +15 -0
- package/dist/components/Employee/EmployeeList/EmployeeListView.js +130 -0
- package/dist/components/Employee/EmployeeList/EmployeeListView.js.map +1 -0
- package/dist/components/Employee/EmployeeList/ManagementEmployeeList.d.ts +9 -0
- package/dist/components/Employee/EmployeeList/ManagementEmployeeList.js +81 -0
- package/dist/components/Employee/EmployeeList/ManagementEmployeeList.js.map +1 -0
- package/dist/components/Employee/EmployeeList/ManagementEmployeeListView.d.ts +17 -0
- package/dist/components/Employee/EmployeeList/ManagementEmployeeListView.js +193 -0
- package/dist/components/Employee/EmployeeList/ManagementEmployeeListView.js.map +1 -0
- package/dist/components/Employee/EmployeeList/index.d.ts +3 -0
- package/dist/components/Employee/EmployeeList/useEmployeeList.d.ts +36 -23
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +114 -19
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Actions.js +7 -9
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +10 -12
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +3 -4
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +14 -15
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js +4 -4
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.d.ts +1 -0
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js +14 -8
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js +10 -11
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/Actions.js +6 -8
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +5 -8
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +12 -13
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js +44 -43
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +7 -10
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +9 -10
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +5 -6
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/Actions.js +7 -9
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +14 -16
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +9 -10
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +10 -12
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +3 -4
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/Actions.js +8 -10
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +3 -4
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +8 -10
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +10 -12
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +3 -4
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +48 -48
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +14 -17
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.d.ts +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +37 -33
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.d.ts +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js +57 -45
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +8 -11
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -1
- package/dist/components/Employee/index.d.ts +3 -0
- package/dist/components/Employee/index.js +38 -34
- package/dist/components/Employee/index.js.map +1 -1
- package/dist/components/Flow/Flow.js +20 -23
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +16 -18
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +18 -20
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +3 -4
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +8 -10
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalFlow.js +14 -14
- package/dist/components/Payroll/Dismissal/DismissalFlow.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.d.ts +2 -2
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js +21 -20
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.d.ts +2 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js +57 -55
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +8 -11
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.d.ts +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +85 -74
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.module.scss.js +7 -7
- package/dist/components/Payroll/GrossUpModal/GrossUpModalTypes.d.ts +0 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlow.d.ts +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js +24 -18
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.d.ts +2 -0
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +28 -22
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +92 -84
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +30 -32
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +17 -24
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.d.ts +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js +21 -21
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.d.ts +3 -3
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js +13 -13
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +6 -8
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +12 -13
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +11 -14
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +12 -12
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +194 -190
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +69 -69
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +4 -3
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +102 -76
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +2 -2
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +235 -238
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.module.scss.js +7 -7
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.d.ts +11 -0
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +63 -30
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.d.ts +2 -1
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js +43 -41
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/index.d.ts +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.d.ts +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +62 -51
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js +13 -6
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js +22 -20
- package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js +35 -14
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +80 -69
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.d.ts +0 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +59 -66
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +5 -4
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +97 -105
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +98 -64
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +11 -3
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +225 -123
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +10 -8
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +106 -105
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +2 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +222 -213
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.d.ts +2 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +7 -10
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +103 -114
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js +16 -18
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +2 -4
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +11 -13
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +2 -5
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlow.d.ts +1 -1
- package/dist/components/Payroll/Transition/TransitionFlow.js +29 -27
- package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlowComponents.d.ts +1 -0
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js +67 -63
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +12 -14
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.d.ts +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js +5 -5
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js.map +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +13 -13
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js +44 -55
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -1
- package/dist/components/Payroll/helpers.d.ts +6 -1
- package/dist/components/Payroll/helpers.js +81 -74
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.d.ts +2 -2
- package/dist/components/Payroll/usePreparedPayrollData.js +7 -8
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.d.ts +2 -2
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js +6 -9
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.d.ts +1 -1
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.d.ts +1 -2
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/buildFormSchema.d.ts +48 -0
- package/dist/components/UNSTABLE_Hooks/form/buildFormSchema.js +94 -0
- package/dist/components/UNSTABLE_Hooks/form/buildFormSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.d.ts +3 -2
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js +24 -23
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.d.ts +3 -2
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js +22 -17
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.d.ts +3 -2
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js +31 -30
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.d.ts +3 -2
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js +27 -26
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.d.ts +3 -2
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js +28 -27
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.d.ts +3 -2
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js +24 -23
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.d.ts +5 -4
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js +28 -27
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.d.ts +1 -1
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/index.d.ts +5 -5
- package/dist/components/UNSTABLE_Hooks/form/preprocessors.d.ts +3 -0
- package/dist/components/UNSTABLE_Hooks/form/preprocessors.js +15 -0
- package/dist/components/UNSTABLE_Hooks/form/preprocessors.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.d.ts +4 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.js +14 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/useDeriveFieldsMetadata.d.ts +17 -0
- package/dist/components/UNSTABLE_Hooks/form/useDeriveFieldsMetadata.js +21 -0
- package/dist/components/UNSTABLE_Hooks/form/useDeriveFieldsMetadata.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.d.ts +1 -1
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js +8 -8
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/useHookFieldResolution.d.ts +22 -0
- package/dist/components/UNSTABLE_Hooks/form/useHookFieldResolution.js +11 -0
- package/dist/components/UNSTABLE_Hooks/form/useHookFieldResolution.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/withOptions.d.ts +1 -1
- package/dist/components/UNSTABLE_Hooks/form/withOptions.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js +3 -5
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.d.ts +48 -42
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js +48 -79
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.d.ts +2 -2
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/index.d.ts +2 -2
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.d.ts +13 -15
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js +109 -110
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js +16 -18
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.d.ts +13 -4
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js +31 -25
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.d.ts +5 -4
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.js +27 -27
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/index.d.ts +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +8 -22
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js +81 -84
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/PayScheduleForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/PayScheduleForm.js +172 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/PayScheduleForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/PayScheduleForm.module.scss.js +14 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/PayScheduleForm.module.scss.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/fields.d.ts +23 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/fields.js +37 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/fields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/index.d.ts +7 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/payScheduleSchema.d.ts +55 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/payScheduleSchema.js +54 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/payScheduleSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/usePayScheduleForm.d.ts +69 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/usePayScheduleForm.js +180 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/usePayScheduleForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/SignCompanyForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/SignCompanyForm.js +69 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/SignCompanyForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/fields.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/fields.js +14 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/fields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/index.d.ts +7 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/signCompanyFormSchema.d.ts +25 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/signCompanyFormSchema.js +24 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/signCompanyFormSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/useSignCompanyForm.d.ts +57 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/useSignCompanyForm.js +101 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/useSignCompanyForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeForm.js +71 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeI9Form.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeI9Form.js +179 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeI9Form.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/fields.d.ts +53 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/fields.js +164 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/fields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/index.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/signEmployeeFormSchema.d.ts +150 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/signEmployeeFormSchema.js +152 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/signEmployeeFormSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/useSignEmployeeForm.d.ts +151 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/useSignEmployeeForm.js +172 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/useSignEmployeeForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js +15 -17
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.d.ts +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/index.d.ts +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.d.ts +9 -10
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js +85 -83
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.d.ts +8 -4
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js +18 -17
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/index.d.ts +10 -7
- package/dist/components/UNSTABLE_TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.d.ts +5 -0
- package/dist/components/UNSTABLE_TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.js +46 -0
- package/dist/components/UNSTABLE_TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.d.ts +5 -0
- package/dist/components/UNSTABLE_TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.js +46 -0
- package/dist/components/UNSTABLE_TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionForm.d.ts +5 -0
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionForm.js +49 -0
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionForm.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js +55 -0
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormTypes.d.ts +25 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyList.d.ts +5 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyList.js +73 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyList.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.js +122 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.module.scss.js +8 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.module.scss.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListTypes.d.ts +17 -0
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettings.d.ts +5 -0
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettings.js +46 -0
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettings.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelector.d.ts +7 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelector.js +29 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelector.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js +66 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorTypes.d.ts +6 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlow.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlow.js +25 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlow.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +29 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js +103 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/index.d.ts +3 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/timeOffStateMachine.d.ts +14 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/timeOffStateMachine.js +290 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/timeOffStateMachine.test.d.ts +1 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.d.ts +8 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js +71 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.module.scss.js +12 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.module.scss.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +206 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormTypes.d.ts +20 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/index.d.ts +6 -0
- package/dist/components/UNSTABLE_TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.d.ts +5 -0
- package/dist/components/UNSTABLE_TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.js +35 -0
- package/dist/components/UNSTABLE_TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.d.ts +5 -0
- package/dist/components/UNSTABLE_TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.js +35 -0
- package/dist/components/UNSTABLE_TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/ViewPolicyDetails/ViewPolicyDetails.d.ts +5 -0
- package/dist/components/UNSTABLE_TimeOff/ViewPolicyDetails/ViewPolicyDetails.js +35 -0
- package/dist/components/UNSTABLE_TimeOff/ViewPolicyDetails/ViewPolicyDetails.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/ViewPolicyEmployees/ViewPolicyEmployees.d.ts +5 -0
- package/dist/components/UNSTABLE_TimeOff/ViewPolicyEmployees/ViewPolicyEmployees.js +35 -0
- package/dist/components/UNSTABLE_TimeOff/ViewPolicyEmployees/ViewPolicyEmployees.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/index.d.ts +25 -0
- package/dist/components/UNSTABLE_TimeOff/index.js +27 -0
- package/dist/components/UNSTABLE_TimeOff/index.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/shared/EmployeeTable/EmployeeTable.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/shared/EmployeeTable/EmployeeTableTypes.d.ts +26 -0
- package/dist/components/UNSTABLE_TimeOff/shared/EmployeeTable/index.d.ts +4 -0
- package/dist/components/UNSTABLE_TimeOff/shared/holidayHelpers.d.ts +30 -0
- package/dist/components/UNSTABLE_TimeOff/shared/holidayHelpers.js +97 -0
- package/dist/components/UNSTABLE_TimeOff/shared/holidayHelpers.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/shared/holidayHelpers.test.d.ts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +66 -62
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
- package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +10 -0
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js +28 -21
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
- package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +4 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +10 -12
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.d.ts +10 -2
- package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.js.map +1 -1
- package/dist/contexts/ThemeProvider/theme.d.ts +2 -0
- package/dist/contexts/ThemeProvider/theme.js +4 -2
- package/dist/contexts/ThemeProvider/theme.js.map +1 -1
- package/dist/contexts/ThemeProvider/useTheme.js.map +1 -1
- package/dist/helpers/breadcrumbHelpers.d.ts +14 -0
- package/dist/helpers/breadcrumbHelpers.js +35 -26
- package/dist/helpers/breadcrumbHelpers.js.map +1 -1
- package/dist/helpers/buildQueryErrorHandling.d.ts +22 -0
- package/dist/helpers/buildQueryErrorHandling.js +11 -0
- package/dist/helpers/buildQueryErrorHandling.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → helpers}/collectErrors.d.ts +1 -1
- package/dist/{components/UNSTABLE_Hooks → helpers}/collectErrors.js +1 -1
- package/dist/helpers/collectErrors.js.map +1 -0
- package/dist/helpers/dateFormatting.d.ts +2 -0
- package/dist/helpers/dateFormatting.js +38 -33
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/helpers/formattedStrings.js +40 -33
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/hooks/useCompanyPaymentSpeed.d.ts +6 -0
- package/dist/hooks/useCompanyPaymentSpeed.js +19 -0
- package/dist/hooks/useCompanyPaymentSpeed.js.map +1 -0
- package/dist/hooks/useCompanyPaymentSpeed.test.d.ts +1 -0
- package/dist/hooks/useDateRangeFilter/useDateRangeFilter.d.ts +20 -0
- package/dist/hooks/useDateRangeFilter/useDateRangeFilter.js +38 -0
- package/dist/hooks/useDateRangeFilter/useDateRangeFilter.js.map +1 -0
- package/dist/hooks/useDateRangeFilter/useDateRangeFilter.test.d.ts +1 -0
- package/dist/{components/UNSTABLE_Hooks → hooks}/useErrorHandling.d.ts +2 -2
- package/dist/{components/UNSTABLE_Hooks → hooks}/useErrorHandling.js +1 -1
- package/dist/hooks/useErrorHandling.js.map +1 -0
- package/dist/hooks/useErrorHandling.test.d.ts +1 -0
- package/dist/hooks/usePagination/usePagination.d.ts +2 -0
- package/dist/hooks/usePagination/usePagination.js +32 -29
- package/dist/hooks/usePagination/usePagination.js.map +1 -1
- package/dist/i18n/I18n.js +21 -21
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.PaySchedule.json.js +6 -6
- package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js +24 -0
- package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js.map +1 -0
- package/dist/i18n/en/Company.TimeOff.EmployeeTable.json.js +32 -0
- package/dist/i18n/en/Company.TimeOff.EmployeeTable.json.js.map +1 -0
- package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js +28 -0
- package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js.map +1 -0
- package/dist/i18n/en/Company.TimeOff.SelectPolicyType.json.js +28 -0
- package/dist/i18n/en/Company.TimeOff.SelectPolicyType.json.js.map +1 -0
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js +38 -0
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js.map +1 -0
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicyDetails.json.js +52 -0
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicyDetails.json.js.map +1 -0
- package/dist/i18n/en/Company.TimeOff.TimeOffRequests.json.js +21 -0
- package/dist/i18n/en/Company.TimeOff.TimeOffRequests.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +36 -34
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js.map +1 -1
- package/dist/i18n/en/Employee.Dashboard.json.js +26 -0
- package/dist/i18n/en/Employee.Dashboard.json.js.map +1 -0
- package/dist/i18n/en/Employee.EmployeeList.json.js +22 -20
- package/dist/i18n/en/Employee.EmployeeList.json.js.map +1 -1
- package/dist/i18n/en/Employee.ManagementEmployeeList.json.js +40 -0
- package/dist/i18n/en/Employee.ManagementEmployeeList.json.js.map +1 -0
- package/dist/i18n/en/Payroll.GrossUpModal.json.js +16 -14
- package/dist/i18n/en/Payroll.GrossUpModal.json.js.map +1 -1
- package/dist/i18n/en/Payroll.OffCycle.json.js +1 -1
- package/dist/i18n/en/Payroll.OffCyclePayPeriodDateForm.json.js +5 -5
- package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js +5 -5
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +38 -34
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +29 -25
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollHistory.json.js +12 -12
- package/dist/i18n/en/Payroll.PayrollList.json.js +30 -22
- package/dist/i18n/en/Payroll.PayrollList.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +64 -58
- package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
- package/dist/i18n/en/Payroll.TransitionCreation.json.js +9 -9
- package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js +8 -8
- package/dist/i18n/en/UNSTABLE.PayScheduleForm.json.js +24 -0
- package/dist/i18n/en/UNSTABLE.PayScheduleForm.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.SignCompanyForm.json.js +20 -0
- package/dist/i18n/en/UNSTABLE.SignCompanyForm.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.SignEmployeeForm.json.js +22 -0
- package/dist/i18n/en/UNSTABLE.SignEmployeeForm.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.SignEmployeeI9Form.json.js +70 -0
- package/dist/i18n/en/UNSTABLE.SignEmployeeI9Form.json.js.map +1 -0
- package/dist/i18n/en/common.json.d.ts +3 -1
- package/dist/i18n/en/common.json.js +5 -5
- package/dist/index.js +18 -16
- package/dist/index.js.map +1 -1
- package/dist/shared/constants.d.ts +56 -0
- package/dist/shared/constants.js +100 -70
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +817 -12
- package/dist/{components/UNSTABLE_Hooks/types.d.ts → types/sdkHooks.d.ts} +29 -5
- package/docs/reference/endpoint-inventory.json +659 -391
- package/package.json +33 -24
- package/dist/components/Employee/EmployeeList/Actions.d.ts +0 -1
- package/dist/components/Employee/EmployeeList/Actions.js +0 -16
- package/dist/components/Employee/EmployeeList/Actions.js.map +0 -1
- package/dist/components/Employee/EmployeeList/Head.d.ts +0 -1
- package/dist/components/Employee/EmployeeList/Head.js +0 -15
- package/dist/components/Employee/EmployeeList/Head.js.map +0 -1
- package/dist/components/Employee/EmployeeList/List.d.ts +0 -2
- package/dist/components/Employee/EmployeeList/List.js +0 -125
- package/dist/components/Employee/EmployeeList/List.js.map +0 -1
- package/dist/components/Employee/EmployeeList/List.module.scss.js +0 -8
- package/dist/components/Employee/EmployeeList/List.module.scss.js.map +0 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.module.scss.js +0 -8
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.module.scss.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/collectErrors.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.d.ts +0 -26
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.js +0 -24
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.d.ts +0 -3
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js +0 -14
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.d.ts +0 -6
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.js +0 -14
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/types.d.ts +0 -27
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.d.ts +0 -4
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js +0 -9
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.js.map +0 -1
- package/dist/helpers/requiredIf.d.ts +0 -13
- package/dist/helpers/requiredIf.js +0 -8
- package/dist/helpers/requiredIf.js.map +0 -1
- /package/dist/components/UNSTABLE_Hooks/form/{deriveFieldsMetadata.test.d.ts → buildFormSchema.test.d.ts} +0 -0
- /package/dist/components/UNSTABLE_Hooks/{useErrorHandling.test.d.ts → hooks/useCompensationForm/compensationSchemaParity.test.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSignEmployeeForm.js","sources":["../../../../../src/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/useSignEmployeeForm.tsx"],"sourcesContent":["import { useMemo, useCallback, useState, useEffect } from 'react'\nimport { useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport type { Form } from '@gusto/embedded-api/models/components/form'\nimport { useEmployeeFormsGet } from '@gusto/embedded-api/react-query/employeeFormsGet'\nimport { useEmployeeFormsGetPdf } from '@gusto/embedded-api/react-query/employeeFormsGetPdf'\nimport { useEmployeeFormsSignMutation } from '@gusto/embedded-api/react-query/employeeFormsSign'\nimport { useDeriveFieldsMetadata } from '../../form/useDeriveFieldsMetadata'\nimport { withOptions } from '../../form/withOptions'\nimport { createGetFormSubmissionValues } from '../../form/getFormSubmissionValues'\nimport {\n createSignEmployeeFormSchema,\n MAX_PREPARERS,\n PREPARER_FIELDS_BY_INDEX,\n PREPARERS_BY_INDEX,\n type SignEmployeeFormData,\n type SignEmployeeFormOutputs,\n} from './signEmployeeFormSchema'\nimport {\n SignatureField,\n ConfirmSignatureField,\n UsedPreparerField,\n Preparer1FirstName,\n Preparer1LastName,\n Preparer1Street1,\n Preparer1Street2,\n Preparer1City,\n Preparer1State,\n Preparer1Zip,\n Preparer1Signature,\n Preparer1ConfirmSignature,\n Preparer2FirstName,\n Preparer2LastName,\n Preparer2Street1,\n Preparer2Street2,\n Preparer2City,\n Preparer2State,\n Preparer2Zip,\n Preparer2Signature,\n Preparer2ConfirmSignature,\n Preparer3FirstName,\n Preparer3LastName,\n Preparer3Street1,\n Preparer3Street2,\n Preparer3City,\n Preparer3State,\n Preparer3Zip,\n Preparer3Signature,\n Preparer3ConfirmSignature,\n Preparer4FirstName,\n Preparer4LastName,\n Preparer4Street1,\n Preparer4Street2,\n Preparer4City,\n Preparer4State,\n Preparer4Zip,\n Preparer4Signature,\n Preparer4ConfirmSignature,\n} from './fields'\nimport { useErrorHandling } from '@/hooks/useErrorHandling'\nimport type { HookSubmitResult } from '@/types/sdkHooks'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { I9_FORM_NAME, STATES_ABBR } from '@/shared/constants'\n\nconst stateOptions = STATES_ABBR.map(abbr => ({ label: abbr, value: abbr }))\n\n// ── Preparer field groups ──────────────────────────────────────────────\n\nconst preparer1Fields = {\n FirstName: Preparer1FirstName,\n LastName: Preparer1LastName,\n Street1: Preparer1Street1,\n Street2: Preparer1Street2,\n City: Preparer1City,\n State: Preparer1State,\n Zip: Preparer1Zip,\n Signature: Preparer1Signature,\n ConfirmSignature: Preparer1ConfirmSignature,\n}\n\nconst preparer2Fields = {\n FirstName: Preparer2FirstName,\n LastName: Preparer2LastName,\n Street1: Preparer2Street1,\n Street2: Preparer2Street2,\n City: Preparer2City,\n State: Preparer2State,\n Zip: Preparer2Zip,\n Signature: Preparer2Signature,\n ConfirmSignature: Preparer2ConfirmSignature,\n}\n\nconst preparer3Fields = {\n FirstName: Preparer3FirstName,\n LastName: Preparer3LastName,\n Street1: Preparer3Street1,\n Street2: Preparer3Street2,\n City: Preparer3City,\n State: Preparer3State,\n Zip: Preparer3Zip,\n Signature: Preparer3Signature,\n ConfirmSignature: Preparer3ConfirmSignature,\n}\n\nconst preparer4Fields = {\n FirstName: Preparer4FirstName,\n LastName: Preparer4LastName,\n Street1: Preparer4Street1,\n Street2: Preparer4Street2,\n City: Preparer4City,\n State: Preparer4State,\n Zip: Preparer4Zip,\n Signature: Preparer4Signature,\n ConfirmSignature: Preparer4ConfirmSignature,\n}\n\nexport type PreparerFieldGroup = typeof preparer1Fields\n\n// ── Types ──────────────────────────────────────────────────────────────\n\nexport interface UseSignEmployeeFormProps {\n employeeId: string\n formId: string\n}\n\n// ── Hook ───────────────────────────────────────────────────────────────\n\nexport function useSignEmployeeForm({ employeeId, formId }: UseSignEmployeeFormProps) {\n const formQuery = useEmployeeFormsGet({ employeeId, formId })\n const pdfQuery = useEmployeeFormsGetPdf({ employeeId, formId })\n\n const form = formQuery.data?.form\n const pdfUrl = pdfQuery.data?.formPdf?.documentUrl\n const isI9 = form?.name === I9_FORM_NAME\n\n const [preparerCount, setPreparerCount] = useState(0)\n\n const [schema, metadataConfig] = useMemo(\n () => createSignEmployeeFormSchema({ isI9, preparerCount }),\n [isI9, preparerCount],\n )\n\n const formMethods = useForm<SignEmployeeFormData, unknown, SignEmployeeFormOutputs>({\n resolver: zodResolver(schema),\n defaultValues: {\n signature: '',\n confirmSignature: false,\n usedPreparer: 'no',\n },\n })\n\n const { mutateAsync: signForm, isPending } = useEmployeeFormsSignMutation()\n\n const { baseSubmitHandler, error: submitError, setError } = useBaseSubmit('SignEmployeeForm')\n\n const queries = [formQuery, pdfQuery]\n const errorHandling = useErrorHandling(queries, { error: submitError, setError })\n\n const baseMetadata = useDeriveFieldsMetadata(metadataConfig, formMethods.control)\n\n const fieldsMetadata = useMemo(\n () => ({\n ...baseMetadata,\n ...(isI9\n ? {\n usedPreparer: withOptions(baseMetadata.usedPreparer, [\n { label: 'No, I completed this myself', value: 'no' },\n { label: 'Yes, I used a preparer/translator', value: 'yes' },\n ]),\n preparerState: withOptions(baseMetadata.preparerState, stateOptions),\n preparer2State: withOptions(baseMetadata.preparer2State, stateOptions),\n preparer3State: withOptions(baseMetadata.preparer3State, stateOptions),\n preparer4State: withOptions(baseMetadata.preparer4State, stateOptions),\n }\n : {}),\n }),\n [baseMetadata, isI9],\n )\n\n const addPreparer = useCallback(() => {\n setPreparerCount(prev => Math.min(prev + 1, MAX_PREPARERS))\n }, [])\n\n const removePreparer = useCallback(() => {\n setPreparerCount(prev => {\n if (prev <= 0) return prev\n const preparerFields = PREPARER_FIELDS_BY_INDEX[prev - 1]\n if (!preparerFields) return prev\n for (const name of preparerFields) {\n formMethods.unregister(name)\n }\n return prev - 1\n })\n }, [formMethods.unregister])\n\n const usedPreparer = isI9 ? formMethods.watch('usedPreparer') : undefined\n\n useEffect(() => {\n if (!isI9) return\n if (usedPreparer === 'yes' && preparerCount === 0) {\n addPreparer()\n }\n if (usedPreparer === 'no' && preparerCount > 0) {\n for (let i = preparerCount; i > 0; i--) {\n removePreparer()\n }\n }\n }, [usedPreparer, isI9, preparerCount, addPreparer, removePreparer])\n\n const onSubmit = async (): Promise<HookSubmitResult<Form> | undefined> => {\n let submitResult: HookSubmitResult<Form> | undefined\n\n await new Promise<void>(resolve => {\n void formMethods.handleSubmit(\n async (data: SignEmployeeFormOutputs) => {\n await baseSubmitHandler(data, async payload => {\n const requestBody: Record<string, unknown> = {\n signatureText: payload.signature,\n agree: payload.confirmSignature,\n }\n\n if (isI9) {\n Object.assign(requestBody, buildPreparerPayload(payload, preparerCount))\n }\n\n const result = await signForm({\n request: {\n employeeId,\n formId: form!.uuid,\n requestBody: requestBody as {\n signatureText: string\n agree: boolean\n signedByIpAddress: string\n },\n },\n })\n\n if (result.form) {\n submitResult = { mode: 'create', data: result.form }\n }\n })\n resolve()\n },\n () => {\n resolve()\n },\n )()\n })\n\n return submitResult\n }\n\n const isDataLoading = formQuery.isLoading || pdfQuery.isLoading\n\n if (isDataLoading || !form) {\n return { isLoading: true as const, errorHandling }\n }\n\n return {\n isLoading: false as const,\n data: { form, pdfUrl },\n status: { isPending },\n actions: {\n onSubmit,\n ...(isI9 ? { addPreparer, removePreparer } : {}),\n },\n errorHandling,\n form: {\n Fields: {\n Signature: SignatureField,\n ConfirmSignature: ConfirmSignatureField,\n UsedPreparer: isI9 ? UsedPreparerField : undefined,\n Preparer1: isI9 && preparerCount >= 1 ? preparer1Fields : undefined,\n Preparer2: isI9 && preparerCount >= 2 ? preparer2Fields : undefined,\n Preparer3: isI9 && preparerCount >= 3 ? preparer3Fields : undefined,\n Preparer4: isI9 && preparerCount >= 4 ? preparer4Fields : undefined,\n },\n fieldsMetadata,\n hookFormInternals: { formMethods },\n getFormSubmissionValues: createGetFormSubmissionValues(formMethods, schema),\n ...(isI9\n ? {\n preparers: {\n count: preparerCount,\n canAdd: preparerCount < MAX_PREPARERS,\n canRemove: preparerCount > 0,\n },\n }\n : {}),\n },\n }\n}\n\n// ── Helpers ─────────────────────────────────────────────────────────────\n\nfunction buildPreparerPayload(payload: SignEmployeeFormOutputs, count: number) {\n if (payload.usedPreparer !== 'yes' || count === 0) {\n return { preparer: false }\n }\n\n const result: Record<string, unknown> = { preparer: true }\n\n for (let index = 0; index < count; index++) {\n if (index > 0) {\n result[`preparer${String(index + 1)}`] = true\n }\n\n const preparer = PREPARERS_BY_INDEX[index]\n if (!preparer) continue\n\n result[preparer.firstName] = payload[preparer.firstName]\n result[preparer.lastName] = payload[preparer.lastName]\n result[preparer.street1] = payload[preparer.street1]\n if (payload[preparer.street2]) {\n result[preparer.street2] = payload[preparer.street2]\n }\n result[preparer.city] = payload[preparer.city]\n result[preparer.state] = payload[preparer.state]\n result[preparer.zip] = payload[preparer.zip]\n result[preparer.signature] = payload[preparer.signature]\n result[preparer.agree] = 'true'\n }\n\n return result\n}\n\nexport type UseSignEmployeeFormResult = ReturnType<typeof useSignEmployeeForm>\nexport type UseSignEmployeeFormReady = Extract<UseSignEmployeeFormResult, { data: object }>\nexport type SignEmployeeFormFieldsMetadata = UseSignEmployeeFormReady['form']['fieldsMetadata']\nexport type SignEmployeeFormFields = UseSignEmployeeFormReady['form']['Fields']\n"],"names":["stateOptions","STATES_ABBR","abbr","preparer1Fields","Preparer1FirstName","Preparer1LastName","Preparer1Street1","Preparer1Street2","Preparer1City","Preparer1State","Preparer1Zip","Preparer1Signature","Preparer1ConfirmSignature","preparer2Fields","Preparer2FirstName","Preparer2LastName","Preparer2Street1","Preparer2Street2","Preparer2City","Preparer2State","Preparer2Zip","Preparer2Signature","Preparer2ConfirmSignature","preparer3Fields","Preparer3FirstName","Preparer3LastName","Preparer3Street1","Preparer3Street2","Preparer3City","Preparer3State","Preparer3Zip","Preparer3Signature","Preparer3ConfirmSignature","preparer4Fields","Preparer4FirstName","Preparer4LastName","Preparer4Street1","Preparer4Street2","Preparer4City","Preparer4State","Preparer4Zip","Preparer4Signature","Preparer4ConfirmSignature","useSignEmployeeForm","employeeId","formId","formQuery","useEmployeeFormsGet","pdfQuery","useEmployeeFormsGetPdf","form","pdfUrl","isI9","I9_FORM_NAME","preparerCount","setPreparerCount","useState","schema","metadataConfig","useMemo","createSignEmployeeFormSchema","formMethods","useForm","zodResolver","signForm","isPending","useEmployeeFormsSignMutation","baseSubmitHandler","submitError","setError","useBaseSubmit","errorHandling","useErrorHandling","baseMetadata","useDeriveFieldsMetadata","fieldsMetadata","withOptions","addPreparer","useCallback","prev","MAX_PREPARERS","removePreparer","preparerFields","PREPARER_FIELDS_BY_INDEX","name","usedPreparer","useEffect","i","onSubmit","submitResult","resolve","data","payload","requestBody","buildPreparerPayload","result","SignatureField","ConfirmSignatureField","UsedPreparerField","createGetFormSubmissionValues","count","index","preparer","PREPARERS_BY_INDEX"],"mappings":";;;;;;;;;;;;;;AAgEA,MAAMA,IAAeC,GAAY,IAAI,CAAAC,OAAS,EAAE,OAAOA,GAAM,OAAOA,EAAA,EAAO,GAIrEC,KAAkB;AAAA,EACtB,WAAWC;AAAA,EACX,UAAUC;AAAA,EACV,SAASC;AAAA,EACT,SAASC;AAAA,EACT,MAAMC;AAAA,EACN,OAAOC;AAAA,EACP,KAAKC;AAAA,EACL,WAAWC;AAAA,EACX,kBAAkBC;AACpB,GAEMC,KAAkB;AAAA,EACtB,WAAWC;AAAA,EACX,UAAUC;AAAA,EACV,SAASC;AAAA,EACT,SAASC;AAAA,EACT,MAAMC;AAAA,EACN,OAAOC;AAAA,EACP,KAAKC;AAAA,EACL,WAAWC;AAAA,EACX,kBAAkBC;AACpB,GAEMC,KAAkB;AAAA,EACtB,WAAWC;AAAA,EACX,UAAUC;AAAA,EACV,SAASC;AAAA,EACT,SAASC;AAAA,EACT,MAAMC;AAAA,EACN,OAAOC;AAAA,EACP,KAAKC;AAAA,EACL,WAAWC;AAAA,EACX,kBAAkBC;AACpB,GAEMC,KAAkB;AAAA,EACtB,WAAWC;AAAA,EACX,UAAUC;AAAA,EACV,SAASC;AAAA,EACT,SAASC;AAAA,EACT,MAAMC;AAAA,EACN,OAAOC;AAAA,EACP,KAAKC;AAAA,EACL,WAAWC;AAAA,EACX,kBAAkB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AAA,MAC7B,IAEF,CAAA;AAAA,IAAC;AAAA,EACP;AAEJ;AAIA,SAASwC,GAAqBF,GAAkCQ,GAAe;AAC7E,MAAIR,EAAQ,iBAAiB,SAASQ,MAAU;AAC9C,WAAO,EAAE,UAAU,GAAA;AAGrB,QAAML,IAAkC,EAAE,UAAU,GAAA;AAEpD,WAASM,IAAQ,GAAGA,IAAQD,GAAOC,KAAS;AAC1C,IAAIA,IAAQ,MACVN,EAAO,WAAW,OAAOM,IAAQ,CAAC,CAAC,EAAE,IAAI;AAG3C,UAAMC,IAAWC,EAAmBF,CAAK;AACzC,IAAKC,MAELP,EAAOO,EAAS,SAAS,IAAIV,EAAQU,EAAS,SAAS,GACvDP,EAAOO,EAAS,QAAQ,IAAIV,EAAQU,EAAS,QAAQ,GACrDP,EAAOO,EAAS,OAAO,IAAIV,EAAQU,EAAS,OAAO,GAC/CV,EAAQU,EAAS,OAAO,MAC1BP,EAAOO,EAAS,OAAO,IAAIV,EAAQU,EAAS,OAAO,IAErDP,EAAOO,EAAS,IAAI,IAAIV,EAAQU,EAAS,IAAI,GAC7CP,EAAOO,EAAS,KAAK,IAAIV,EAAQU,EAAS,KAAK,GAC/CP,EAAOO,EAAS,GAAG,IAAIV,EAAQU,EAAS,GAAG,GAC3CP,EAAOO,EAAS,SAAS,IAAIV,EAAQU,EAAS,SAAS,GACvDP,EAAOO,EAAS,KAAK,IAAI;AAAA,EAC3B;AAEA,SAAOP;AACT;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useTranslation as
|
|
1
|
+
import { jsx as e, jsxs as E } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as p } from "react-i18next";
|
|
3
3
|
import { SDKFormProvider as u } from "../../form/SDKFormProvider.js";
|
|
4
4
|
import { useWorkAddressForm as D } from "./useWorkAddressForm.js";
|
|
5
5
|
import { useComponentContext as A } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
@@ -7,18 +7,16 @@ import { BaseBoundaries as R, BaseLayout as c } from "../../../Base/Base.js";
|
|
|
7
7
|
import "../../../Base/useBase.js";
|
|
8
8
|
import { Form as L } from "../../../Common/Form/Form.js";
|
|
9
9
|
import { componentEvents as d } from "../../../../shared/constants.js";
|
|
10
|
-
import "classnames";
|
|
11
10
|
import { ActionsLayout as S } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
12
|
-
import "react";
|
|
13
11
|
import { useI18n as W, useComponentDictionary as k } from "../../../../i18n/I18n.js";
|
|
14
12
|
import { addressInline as U } from "../../../../helpers/formattedStrings.js";
|
|
15
13
|
function g({ onEvent: i, dictionary: s, ...l }) {
|
|
16
14
|
W("UNSTABLE.WorkAddressForm"), k("UNSTABLE.WorkAddressForm", s);
|
|
17
|
-
const { t: o } =
|
|
18
|
-
if (
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
const { Fields: n } =
|
|
21
|
-
const t = await
|
|
15
|
+
const { t: o } = p("UNSTABLE.WorkAddressForm"), m = A(), r = D(l);
|
|
16
|
+
if (r.isLoading)
|
|
17
|
+
return /* @__PURE__ */ e(c, { isLoading: !0, error: r.errorHandling.errors });
|
|
18
|
+
const { Fields: n } = r.form, f = async () => {
|
|
19
|
+
const t = await r.actions.onSubmit({
|
|
22
20
|
onWorkAddressCreated: (a) => {
|
|
23
21
|
i(d.EMPLOYEE_WORK_ADDRESS_CREATED, a);
|
|
24
22
|
},
|
|
@@ -28,15 +26,15 @@ function g({ onEvent: i, dictionary: s, ...l }) {
|
|
|
28
26
|
});
|
|
29
27
|
t && i(d.EMPLOYEE_WORK_ADDRESS, t.data);
|
|
30
28
|
};
|
|
31
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ e(c, { error: r.errorHandling.errors, children: /* @__PURE__ */ e(u, { formHookResult: r, children: /* @__PURE__ */ E(
|
|
32
30
|
L,
|
|
33
31
|
{
|
|
34
32
|
onSubmit: (t) => {
|
|
35
33
|
t.preventDefault(), f();
|
|
36
34
|
},
|
|
37
35
|
children: [
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ e(m.Heading, { as: "h2", children: r.status.mode === "create" ? o("addTitle") : o("editTitle") }),
|
|
37
|
+
/* @__PURE__ */ e(
|
|
40
38
|
n.Location,
|
|
41
39
|
{
|
|
42
40
|
label: o("locationLabel"),
|
|
@@ -47,7 +45,7 @@ function g({ onEvent: i, dictionary: s, ...l }) {
|
|
|
47
45
|
}
|
|
48
46
|
}
|
|
49
47
|
),
|
|
50
|
-
n.EffectiveDate && /* @__PURE__ */
|
|
48
|
+
n.EffectiveDate && /* @__PURE__ */ e(
|
|
51
49
|
n.EffectiveDate,
|
|
52
50
|
{
|
|
53
51
|
label: o("effectiveDateLabel"),
|
|
@@ -57,15 +55,15 @@ function g({ onEvent: i, dictionary: s, ...l }) {
|
|
|
57
55
|
}
|
|
58
56
|
}
|
|
59
57
|
),
|
|
60
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ e(S, { children: /* @__PURE__ */ e(m.Button, { type: "submit", isLoading: r.status.isPending, children: r.status.mode === "create" ? o("createCta") : o("updateCta") }) })
|
|
61
59
|
]
|
|
62
60
|
}
|
|
63
61
|
) }) });
|
|
64
62
|
}
|
|
65
|
-
function
|
|
66
|
-
return /* @__PURE__ */
|
|
63
|
+
function M({ FallbackComponent: i, ...s }) {
|
|
64
|
+
return /* @__PURE__ */ e(R, { componentName: "UNSTABLE.WorkAddressForm", FallbackComponent: i, children: /* @__PURE__ */ e(g, { ...s }) });
|
|
67
65
|
}
|
|
68
66
|
export {
|
|
69
|
-
|
|
67
|
+
M as WorkAddressForm
|
|
70
68
|
};
|
|
71
69
|
//# sourceMappingURL=WorkAddressForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkAddressForm.js","sources":["../../../../../src/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { SDKFormProvider } from '../../form/SDKFormProvider'\nimport { useWorkAddressForm } from './useWorkAddressForm'\nimport type { UseWorkAddressFormProps } from './useWorkAddressForm'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { BaseBoundaries, BaseLayout, type BaseComponentInterface } from '@/components/Base'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { addressInline } from '@/helpers/formattedStrings'\n\nexport interface WorkAddressFormProps\n extends UseWorkAddressFormProps, Omit<BaseComponentInterface, 'defaultValues'> {}\n\nfunction WorkAddressFormRoot({ onEvent, dictionary, ...hookProps }: WorkAddressFormProps) {\n useI18n('UNSTABLE.WorkAddressForm')\n useComponentDictionary('UNSTABLE.WorkAddressForm', dictionary)\n const { t } = useTranslation('UNSTABLE.WorkAddressForm')\n const Components = useComponentContext()\n const workAddress = useWorkAddressForm(hookProps)\n\n if (workAddress.isLoading) {\n return <BaseLayout isLoading error={workAddress.errorHandling.errors} />\n }\n\n const { Fields } = workAddress.form\n\n const handleSubmit = async () => {\n const result = await workAddress.actions.onSubmit({\n onWorkAddressCreated: wa => {\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_CREATED, wa)\n },\n onWorkAddressUpdated: wa => {\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_UPDATED, wa)\n },\n })\n if (result) {\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS, result.data)\n }\n }\n\n return (\n <BaseLayout error={workAddress.errorHandling.errors}>\n <SDKFormProvider formHookResult={workAddress}>\n <Form\n onSubmit={e => {\n e.preventDefault()\n void handleSubmit()\n }}\n >\n <Components.Heading as=\"h2\">\n {workAddress.status.mode === 'create' ? t('addTitle') : t('editTitle')}\n </Components.Heading>\n\n <Fields.Location\n label={t('locationLabel')}\n description={t('locationDescription')}\n getOptionLabel={location => addressInline(location)}\n validationMessages={{\n REQUIRED: t('fieldValidations.locationUuid.REQUIRED'),\n }}\n />\n\n {Fields.EffectiveDate && (\n <Fields.EffectiveDate\n label={t('effectiveDateLabel')}\n description={t('effectiveDateDescription')}\n validationMessages={{\n REQUIRED: t('fieldValidations.effectiveDate.REQUIRED'),\n }}\n />\n )}\n\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={workAddress.status.isPending}>\n {workAddress.status.mode === 'create' ? t('createCta') : t('updateCta')}\n </Components.Button>\n </ActionsLayout>\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n )\n}\n\nexport function WorkAddressForm({ FallbackComponent, ...props }: WorkAddressFormProps) {\n return (\n <BaseBoundaries componentName=\"UNSTABLE.WorkAddressForm\" FallbackComponent={FallbackComponent}>\n <WorkAddressFormRoot {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["WorkAddressFormRoot","onEvent","dictionary","hookProps","useI18n","useComponentDictionary","t","useTranslation","Components","useComponentContext","workAddress","useWorkAddressForm","BaseLayout","Fields","handleSubmit","result","wa","componentEvents","jsx","SDKFormProvider","jsxs","Form","e","location","addressInline","ActionsLayout","WorkAddressForm","FallbackComponent","props","BaseBoundaries"],"mappings":"
|
|
1
|
+
{"version":3,"file":"WorkAddressForm.js","sources":["../../../../../src/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { SDKFormProvider } from '../../form/SDKFormProvider'\nimport { useWorkAddressForm } from './useWorkAddressForm'\nimport type { UseWorkAddressFormProps } from './useWorkAddressForm'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { BaseBoundaries, BaseLayout, type BaseComponentInterface } from '@/components/Base'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { addressInline } from '@/helpers/formattedStrings'\n\nexport interface WorkAddressFormProps\n extends UseWorkAddressFormProps, Omit<BaseComponentInterface, 'defaultValues'> {}\n\nfunction WorkAddressFormRoot({ onEvent, dictionary, ...hookProps }: WorkAddressFormProps) {\n useI18n('UNSTABLE.WorkAddressForm')\n useComponentDictionary('UNSTABLE.WorkAddressForm', dictionary)\n const { t } = useTranslation('UNSTABLE.WorkAddressForm')\n const Components = useComponentContext()\n const workAddress = useWorkAddressForm(hookProps)\n\n if (workAddress.isLoading) {\n return <BaseLayout isLoading error={workAddress.errorHandling.errors} />\n }\n\n const { Fields } = workAddress.form\n\n const handleSubmit = async () => {\n const result = await workAddress.actions.onSubmit({\n onWorkAddressCreated: wa => {\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_CREATED, wa)\n },\n onWorkAddressUpdated: wa => {\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_UPDATED, wa)\n },\n })\n if (result) {\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS, result.data)\n }\n }\n\n return (\n <BaseLayout error={workAddress.errorHandling.errors}>\n <SDKFormProvider formHookResult={workAddress}>\n <Form\n onSubmit={e => {\n e.preventDefault()\n void handleSubmit()\n }}\n >\n <Components.Heading as=\"h2\">\n {workAddress.status.mode === 'create' ? t('addTitle') : t('editTitle')}\n </Components.Heading>\n\n <Fields.Location\n label={t('locationLabel')}\n description={t('locationDescription')}\n getOptionLabel={location => addressInline(location)}\n validationMessages={{\n REQUIRED: t('fieldValidations.locationUuid.REQUIRED'),\n }}\n />\n\n {Fields.EffectiveDate && (\n <Fields.EffectiveDate\n label={t('effectiveDateLabel')}\n description={t('effectiveDateDescription')}\n validationMessages={{\n REQUIRED: t('fieldValidations.effectiveDate.REQUIRED'),\n }}\n />\n )}\n\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={workAddress.status.isPending}>\n {workAddress.status.mode === 'create' ? t('createCta') : t('updateCta')}\n </Components.Button>\n </ActionsLayout>\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n )\n}\n\nexport function WorkAddressForm({ FallbackComponent, ...props }: WorkAddressFormProps) {\n return (\n <BaseBoundaries componentName=\"UNSTABLE.WorkAddressForm\" FallbackComponent={FallbackComponent}>\n <WorkAddressFormRoot {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["WorkAddressFormRoot","onEvent","dictionary","hookProps","useI18n","useComponentDictionary","t","useTranslation","Components","useComponentContext","workAddress","useWorkAddressForm","BaseLayout","Fields","handleSubmit","result","wa","componentEvents","jsx","SDKFormProvider","jsxs","Form","e","location","addressInline","ActionsLayout","WorkAddressForm","FallbackComponent","props","BaseBoundaries"],"mappings":";;;;;;;;;;;;AAeA,SAASA,EAAoB,EAAE,SAAAC,GAAS,YAAAC,GAAY,GAAGC,KAAmC;AACxF,EAAAC,EAAQ,0BAA0B,GAClCC,EAAuB,4BAA4BH,CAAU;AAC7D,QAAM,EAAE,GAAAI,EAAA,IAAMC,EAAe,0BAA0B,GACjDC,IAAaC,EAAA,GACbC,IAAcC,EAAmBR,CAAS;AAEhD,MAAIO,EAAY;AACd,6BAAQE,GAAA,EAAW,WAAS,IAAC,OAAOF,EAAY,cAAc,QAAQ;AAGxE,QAAM,EAAE,QAAAG,MAAWH,EAAY,MAEzBI,IAAe,YAAY;AAC/B,UAAMC,IAAS,MAAML,EAAY,QAAQ,SAAS;AAAA,MAChD,sBAAsB,CAAAM,MAAM;AAC1B,QAAAf,EAAQgB,EAAgB,+BAA+BD,CAAE;AAAA,MAC3D;AAAA,MACA,sBAAsB,CAAAA,MAAM;AAC1B,QAAAf,EAAQgB,EAAgB,+BAA+BD,CAAE;AAAA,MAC3D;AAAA,IAAA,CACD;AACD,IAAID,KACFd,EAAQgB,EAAgB,uBAAuBF,EAAO,IAAI;AAAA,EAE9D;AAEA,SACE,gBAAAG,EAACN,KAAW,OAAOF,EAAY,cAAc,QAC3C,UAAA,gBAAAQ,EAACC,GAAA,EAAgB,gBAAgBT,GAC/B,UAAA,gBAAAU;AAAA,IAACC;AAAA,IAAA;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|
-
import { HookFieldProps } from '../../form/types';
|
|
3
2
|
import { SelectHookFieldProps } from '../../form/fields/SelectHookField';
|
|
4
3
|
import { DatePickerHookFieldProps } from '../../form/fields/DatePickerHookField';
|
|
5
4
|
import { WorkAddressErrorCodes } from './workAddressSchema';
|
|
5
|
+
import { HookFieldProps } from '../../../../types/sdkHooks';
|
|
6
6
|
export type RequiredValidation = typeof WorkAddressErrorCodes.REQUIRED;
|
|
7
7
|
export type LocationFieldProps = HookFieldProps<SelectHookFieldProps<RequiredValidation, Location>>;
|
|
8
8
|
export declare function LocationField(props: LocationFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields.js","sources":["../../../../../src/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.tsx"],"sourcesContent":["import type { Location } from '@gusto/embedded-api/models/components/location'\nimport type {
|
|
1
|
+
{"version":3,"file":"fields.js","sources":["../../../../../src/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.tsx"],"sourcesContent":["import type { Location } from '@gusto/embedded-api/models/components/location'\nimport type { SelectHookFieldProps } from '../../form/fields/SelectHookField'\nimport type { DatePickerHookFieldProps } from '../../form/fields/DatePickerHookField'\nimport { SelectHookField, DatePickerHookField } from '../../form/fields'\nimport type { WorkAddressErrorCodes } from './workAddressSchema'\nimport type { HookFieldProps } from '@/types/sdkHooks'\n\nexport type RequiredValidation = typeof WorkAddressErrorCodes.REQUIRED\n\nexport type LocationFieldProps = HookFieldProps<SelectHookFieldProps<RequiredValidation, Location>>\n\nexport function LocationField(props: LocationFieldProps) {\n return <SelectHookField {...props} name=\"locationUuid\" />\n}\n\nexport type EffectiveDateFieldProps = HookFieldProps<DatePickerHookFieldProps<RequiredValidation>>\n\nexport function EffectiveDateField(props: EffectiveDateFieldProps) {\n return <DatePickerHookField {...props} name=\"effectiveDate\" />\n}\n"],"names":["LocationField","props","jsx","SelectHookField","EffectiveDateField","DatePickerHookField"],"mappings":";;;AAWO,SAASA,EAAcC,GAA2B;AACvD,SAAO,gBAAAC,EAACC,GAAA,EAAiB,GAAGF,GAAO,MAAK,gBAAe;AACzD;AAIO,SAASG,EAAmBH,GAAgC;AACjE,SAAO,gBAAAC,EAACG,GAAA,EAAqB,GAAGJ,GAAO,MAAK,iBAAgB;AAC9D;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./types/i18next.d.ts"
|
|
2
2
|
export { useWorkAddressForm } from './useWorkAddressForm';
|
|
3
|
-
export type { WorkAddressSubmitCallbacks, WorkAddressSubmitOptions,
|
|
3
|
+
export type { WorkAddressSubmitCallbacks, WorkAddressSubmitOptions, WorkAddressOptionalFieldsToRequire, UseWorkAddressFormProps, UseWorkAddressFormResult, UseWorkAddressFormReady, WorkAddressFieldsMetadata, WorkAddressFormFields, } from './useWorkAddressForm';
|
|
4
4
|
export { WorkAddressForm } from './WorkAddressForm';
|
|
5
5
|
export type { WorkAddressFormProps } from './WorkAddressForm';
|
|
6
6
|
export { createWorkAddressSchema, WorkAddressErrorCodes, type WorkAddressErrorCode, type WorkAddressFormData, type WorkAddressFormOutputs, type WorkAddressField, } from './workAddressSchema';
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { UseFormProps } from 'react-hook-form';
|
|
2
2
|
import { Location } from '@gusto/embedded-api/models/components/location';
|
|
3
3
|
import { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress';
|
|
4
|
-
import {
|
|
5
|
-
import { RequiredFields } from '../../form/resolveRequiredFields';
|
|
6
|
-
import { WorkAddressFormData, WorkAddressField } from './workAddressSchema';
|
|
4
|
+
import { WorkAddressOptionalFieldsToRequire, WorkAddressFormData } from './workAddressSchema';
|
|
7
5
|
import { LocationField, EffectiveDateField } from './fields';
|
|
8
|
-
|
|
6
|
+
import { HookSubmitResult } from '../../../../types/sdkHooks';
|
|
7
|
+
export type { WorkAddressOptionalFieldsToRequire } from './workAddressSchema';
|
|
9
8
|
export interface WorkAddressSubmitCallbacks {
|
|
10
9
|
onWorkAddressCreated?: (workAddress: EmployeeWorkAddress) => void;
|
|
11
10
|
onWorkAddressUpdated?: (workAddress: EmployeeWorkAddress) => void;
|
|
@@ -18,14 +17,14 @@ export interface UseWorkAddressFormProps {
|
|
|
18
17
|
companyId: string;
|
|
19
18
|
employeeId?: string;
|
|
20
19
|
withEffectiveDateField?: boolean;
|
|
21
|
-
|
|
20
|
+
optionalFieldsToRequire?: WorkAddressOptionalFieldsToRequire;
|
|
22
21
|
defaultValues?: Partial<WorkAddressFormData>;
|
|
23
22
|
validationMode?: UseFormProps['mode'];
|
|
24
23
|
shouldFocusError?: boolean;
|
|
25
24
|
}
|
|
26
|
-
export declare function useWorkAddressForm({ companyId, employeeId, withEffectiveDateField,
|
|
25
|
+
export declare function useWorkAddressForm({ companyId, employeeId, withEffectiveDateField, optionalFieldsToRequire, defaultValues: partnerDefaults, validationMode, shouldFocusError, }: UseWorkAddressFormProps): {
|
|
27
26
|
isLoading: true;
|
|
28
|
-
errorHandling: import('
|
|
27
|
+
errorHandling: import('../../../../types/sdkHooks').HookErrorHandling;
|
|
29
28
|
data?: undefined;
|
|
30
29
|
status?: undefined;
|
|
31
30
|
actions?: undefined;
|
|
@@ -44,15 +43,15 @@ export declare function useWorkAddressForm({ companyId, employeeId, withEffectiv
|
|
|
44
43
|
actions: {
|
|
45
44
|
onSubmit: (callbacks?: WorkAddressSubmitCallbacks, options?: WorkAddressSubmitOptions) => Promise<HookSubmitResult<EmployeeWorkAddress> | undefined>;
|
|
46
45
|
};
|
|
47
|
-
errorHandling: import('
|
|
46
|
+
errorHandling: import('../../../../types/sdkHooks').HookErrorHandling;
|
|
48
47
|
form: {
|
|
49
48
|
Fields: {
|
|
50
49
|
Location: typeof LocationField;
|
|
51
50
|
EffectiveDate: typeof EffectiveDateField | undefined;
|
|
52
51
|
};
|
|
53
52
|
fieldsMetadata: {
|
|
54
|
-
locationUuid: import('
|
|
55
|
-
effectiveDate: import('
|
|
53
|
+
locationUuid: import('../../../../types/sdkHooks').FieldMetadataWithOptions<Location>;
|
|
54
|
+
effectiveDate: import('../../../../types/sdkHooks').FieldMetadata;
|
|
56
55
|
};
|
|
57
56
|
hookFormInternals: {
|
|
58
57
|
formMethods: import('react-hook-form').UseFormReturn<WorkAddressFormData, unknown, WorkAddressFormData>;
|
|
@@ -1,129 +1,131 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { createGetFormSubmissionValues as
|
|
11
|
-
import { withOptions as
|
|
12
|
-
import { createWorkAddressSchema as
|
|
13
|
-
import { EffectiveDateField as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { useMemo as R } from "react";
|
|
2
|
+
import { useForm as x } from "react-hook-form";
|
|
3
|
+
import { zodResolver as z } from "@hookform/resolvers/zod";
|
|
4
|
+
import { useLocationsGet as K } from "@gusto/embedded-api/react-query/locationsGet";
|
|
5
|
+
import { useEmployeeAddressesGetWorkAddresses as j } from "@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses";
|
|
6
|
+
import { useEmployeeAddressesCreateWorkAddressMutation as J } from "@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress";
|
|
7
|
+
import { useEmployeeAddressesUpdateWorkAddressMutation as N } from "@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress";
|
|
8
|
+
import { RFCDate as X } from "@gusto/embedded-api/types/rfcdate";
|
|
9
|
+
import { useDeriveFieldsMetadata as Y } from "../../form/useDeriveFieldsMetadata.js";
|
|
10
|
+
import { createGetFormSubmissionValues as Z } from "../../form/getFormSubmissionValues.js";
|
|
11
|
+
import { withOptions as _ } from "../../form/withOptions.js";
|
|
12
|
+
import { createWorkAddressSchema as $ } from "./workAddressSchema.js";
|
|
13
|
+
import { EffectiveDateField as T, LocationField as ee } from "./fields.js";
|
|
14
|
+
import { useErrorHandling as oe } from "../../../../hooks/useErrorHandling.js";
|
|
15
|
+
import { useBaseSubmit as te } from "../../../Base/useBaseSubmit.js";
|
|
16
|
+
import { SDKInternalError as l } from "../../../../types/sdkError.js";
|
|
17
|
+
import { addressInline as se } from "../../../../helpers/formattedStrings.js";
|
|
18
|
+
function ge({
|
|
19
|
+
companyId: F,
|
|
19
20
|
employeeId: o,
|
|
20
|
-
withEffectiveDateField:
|
|
21
|
-
|
|
21
|
+
withEffectiveDateField: i = !0,
|
|
22
|
+
optionalFieldsToRequire: p,
|
|
22
23
|
defaultValues: A,
|
|
23
|
-
validationMode:
|
|
24
|
-
shouldFocusError:
|
|
24
|
+
validationMode: h = "onSubmit",
|
|
25
|
+
shouldFocusError: q = !0
|
|
25
26
|
}) {
|
|
26
|
-
const
|
|
27
|
+
const a = K({ companyId: F }), c = j(
|
|
27
28
|
{ employeeId: o ?? "" },
|
|
28
29
|
{ enabled: !!o }
|
|
29
|
-
),
|
|
30
|
-
mode:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}), k = {
|
|
30
|
+
), d = a.data?.companyLocationsList, f = c.data?.employeeWorkAddressesList, t = f?.find((e) => e.active), n = !t, k = n ? "create" : "update", [v, C] = R(
|
|
31
|
+
() => $({ mode: k, optionalFieldsToRequire: p, withEffectiveDateField: i }),
|
|
32
|
+
[k, p, i]
|
|
33
|
+
), W = {
|
|
34
34
|
locationUuid: t?.locationUuid ?? A?.locationUuid ?? "",
|
|
35
35
|
effectiveDate: t?.effectiveDate ?? A?.effectiveDate ?? ""
|
|
36
|
-
},
|
|
37
|
-
resolver:
|
|
38
|
-
mode:
|
|
39
|
-
shouldFocusError:
|
|
40
|
-
defaultValues:
|
|
41
|
-
values:
|
|
36
|
+
}, u = x({
|
|
37
|
+
resolver: z(v),
|
|
38
|
+
mode: h,
|
|
39
|
+
shouldFocusError: q,
|
|
40
|
+
defaultValues: W,
|
|
41
|
+
values: W,
|
|
42
42
|
resetOptions: { keepDirtyValues: !0 }
|
|
43
|
-
}),
|
|
43
|
+
}), D = J(), y = N(), P = D.isPending || y.isPending, { baseSubmitHandler: V, error: B, setError: G } = te("WorkAddressForm"), w = oe(o ? [a, c] : [a], { error: B, setError: G }), H = (d ?? []).map((e) => ({
|
|
44
44
|
value: e.uuid,
|
|
45
|
-
label:
|
|
46
|
-
})),
|
|
47
|
-
locationUuid:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
label: se(e)
|
|
46
|
+
})), b = Y(C, u.control), I = {
|
|
47
|
+
locationUuid: _(
|
|
48
|
+
b.locationUuid,
|
|
49
|
+
H,
|
|
50
|
+
d ?? []
|
|
51
51
|
),
|
|
52
|
-
effectiveDate:
|
|
53
|
-
},
|
|
54
|
-
let
|
|
55
|
-
return await new Promise((
|
|
56
|
-
|
|
57
|
-
async (
|
|
58
|
-
await
|
|
59
|
-
const
|
|
60
|
-
if (!
|
|
61
|
-
throw new
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
52
|
+
effectiveDate: b.effectiveDate
|
|
53
|
+
}, O = async (e, g) => {
|
|
54
|
+
let L;
|
|
55
|
+
return await new Promise((U) => {
|
|
56
|
+
u.handleSubmit(
|
|
57
|
+
async (Q) => {
|
|
58
|
+
await V(Q, async (m) => {
|
|
59
|
+
const M = g?.employeeId ?? o;
|
|
60
|
+
if (!M)
|
|
61
|
+
throw new l("employeeId is required to submit work address");
|
|
62
|
+
const S = i && m.effectiveDate ? m.effectiveDate : g?.effectiveDate, E = S ? new X(new Date(S)) : void 0;
|
|
63
|
+
let s;
|
|
64
|
+
if (n) {
|
|
65
|
+
const r = await D.mutateAsync({
|
|
65
66
|
request: {
|
|
66
|
-
employeeId:
|
|
67
|
+
employeeId: M,
|
|
67
68
|
requestBody: {
|
|
68
|
-
locationUuid:
|
|
69
|
-
effectiveDate:
|
|
69
|
+
locationUuid: m.locationUuid,
|
|
70
|
+
effectiveDate: E
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
73
|
});
|
|
73
|
-
if (!
|
|
74
|
-
throw new
|
|
75
|
-
|
|
74
|
+
if (!r.employeeWorkAddress)
|
|
75
|
+
throw new l("Work address creation failed");
|
|
76
|
+
s = r.employeeWorkAddress, e?.onWorkAddressCreated?.(s);
|
|
76
77
|
} else {
|
|
77
|
-
const
|
|
78
|
+
const r = await y.mutateAsync({
|
|
78
79
|
request: {
|
|
79
80
|
workAddressUuid: t.uuid,
|
|
80
81
|
requestBody: {
|
|
81
82
|
version: t.version,
|
|
82
|
-
locationUuid:
|
|
83
|
+
locationUuid: m.locationUuid,
|
|
84
|
+
effectiveDate: E
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
87
|
});
|
|
86
|
-
if (!
|
|
87
|
-
throw new
|
|
88
|
-
|
|
88
|
+
if (!r.employeeWorkAddress)
|
|
89
|
+
throw new l("Work address update failed");
|
|
90
|
+
s = r.employeeWorkAddress, e?.onWorkAddressUpdated?.(s);
|
|
89
91
|
}
|
|
90
|
-
|
|
91
|
-
mode:
|
|
92
|
-
data:
|
|
92
|
+
L = {
|
|
93
|
+
mode: n ? "create" : "update",
|
|
94
|
+
data: s
|
|
93
95
|
};
|
|
94
|
-
}),
|
|
96
|
+
}), U();
|
|
95
97
|
},
|
|
96
98
|
() => {
|
|
97
|
-
|
|
99
|
+
U();
|
|
98
100
|
}
|
|
99
101
|
)();
|
|
100
|
-
}),
|
|
102
|
+
}), L;
|
|
101
103
|
};
|
|
102
|
-
return
|
|
104
|
+
return a.isLoading || (o ? c.isLoading : !1) || !d || o && !f ? { isLoading: !0, errorHandling: w } : {
|
|
103
105
|
isLoading: !1,
|
|
104
106
|
data: {
|
|
105
107
|
workAddress: t ?? null,
|
|
106
|
-
workAddresses:
|
|
107
|
-
companyLocations:
|
|
108
|
+
workAddresses: f,
|
|
109
|
+
companyLocations: d
|
|
108
110
|
},
|
|
109
111
|
status: {
|
|
110
|
-
isPending:
|
|
111
|
-
mode:
|
|
112
|
+
isPending: P,
|
|
113
|
+
mode: n ? "create" : "update"
|
|
112
114
|
},
|
|
113
|
-
actions: { onSubmit:
|
|
115
|
+
actions: { onSubmit: O },
|
|
114
116
|
errorHandling: w,
|
|
115
117
|
form: {
|
|
116
118
|
Fields: {
|
|
117
|
-
Location:
|
|
118
|
-
EffectiveDate:
|
|
119
|
+
Location: ee,
|
|
120
|
+
EffectiveDate: i ? T : void 0
|
|
119
121
|
},
|
|
120
|
-
fieldsMetadata:
|
|
121
|
-
hookFormInternals: { formMethods:
|
|
122
|
-
getFormSubmissionValues:
|
|
122
|
+
fieldsMetadata: I,
|
|
123
|
+
hookFormInternals: { formMethods: u },
|
|
124
|
+
getFormSubmissionValues: Z(u, v)
|
|
123
125
|
}
|
|
124
126
|
};
|
|
125
127
|
}
|
|
126
128
|
export {
|
|
127
|
-
|
|
129
|
+
ge as useWorkAddressForm
|
|
128
130
|
};
|
|
129
131
|
//# sourceMappingURL=useWorkAddressForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWorkAddressForm.js","sources":["../../../../../src/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.tsx"],"sourcesContent":["import { useForm } from 'react-hook-form'\nimport type { UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport type { Location } from '@gusto/embedded-api/models/components/location'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { useLocationsGet } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useEmployeeAddressesGetWorkAddresses } from '@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses'\nimport { useEmployeeAddressesCreateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress'\nimport { useEmployeeAddressesUpdateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport type { HookSubmitResult } from '../../types'\nimport { useErrorHandling } from '../../useErrorHandling'\nimport { deriveFieldsMetadata } from '../../form/deriveFieldsMetadata'\nimport { createGetFormSubmissionValues } from '../../form/getFormSubmissionValues'\nimport { withOptions } from '../../form/withOptions'\nimport type { RequiredFields } from '../../form/resolveRequiredFields'\nimport {\n createWorkAddressSchema,\n type WorkAddressFormData,\n type WorkAddressFormOutputs,\n type WorkAddressField,\n} from './workAddressSchema'\nimport { LocationField, EffectiveDateField } from './fields'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { SDKInternalError } from '@/types/sdkError'\nimport { addressInline } from '@/helpers/formattedStrings'\n\nexport type WorkAddressRequiredFields = RequiredFields<WorkAddressField>\n\nexport interface WorkAddressSubmitCallbacks {\n onWorkAddressCreated?: (workAddress: EmployeeWorkAddress) => void\n onWorkAddressUpdated?: (workAddress: EmployeeWorkAddress) => void\n}\n\nexport interface WorkAddressSubmitOptions {\n employeeId?: string\n effectiveDate?: string\n}\n\nexport interface UseWorkAddressFormProps {\n companyId: string\n employeeId?: string\n withEffectiveDateField?: boolean\n requiredFields?: WorkAddressRequiredFields\n defaultValues?: Partial<WorkAddressFormData>\n validationMode?: UseFormProps['mode']\n shouldFocusError?: boolean\n}\n\nexport function useWorkAddressForm({\n companyId,\n employeeId,\n withEffectiveDateField = true,\n requiredFields,\n defaultValues: partnerDefaults,\n validationMode = 'onSubmit',\n shouldFocusError = true,\n}: UseWorkAddressFormProps) {\n const locationsQuery = useLocationsGet({ companyId })\n const workAddressesQuery = useEmployeeAddressesGetWorkAddresses(\n { employeeId: employeeId ?? '' },\n { enabled: !!employeeId },\n )\n\n const companyLocations = locationsQuery.data?.companyLocationsList\n const workAddresses = workAddressesQuery.data?.employeeWorkAddressesList\n const currentWorkAddress = workAddresses?.find(address => address.active)\n\n const isCreateMode = !currentWorkAddress\n const mode = isCreateMode ? 'create' : 'update'\n\n const schema = createWorkAddressSchema({\n mode,\n requiredFields,\n withEffectiveDateField,\n })\n\n const resolvedDefaults: WorkAddressFormData = {\n locationUuid: currentWorkAddress?.locationUuid ?? partnerDefaults?.locationUuid ?? '',\n effectiveDate: currentWorkAddress?.effectiveDate ?? partnerDefaults?.effectiveDate ?? '',\n }\n\n const formMethods = useForm<WorkAddressFormData, unknown, WorkAddressFormOutputs>({\n resolver: zodResolver(schema),\n mode: validationMode,\n shouldFocusError,\n defaultValues: resolvedDefaults,\n values: resolvedDefaults,\n resetOptions: { keepDirtyValues: true },\n })\n\n const createWorkAddressMutation = useEmployeeAddressesCreateWorkAddressMutation()\n const updateWorkAddressMutation = useEmployeeAddressesUpdateWorkAddressMutation()\n\n const isPending = createWorkAddressMutation.isPending || updateWorkAddressMutation.isPending\n\n const { baseSubmitHandler, error: submitError, setError } = useBaseSubmit('WorkAddressForm')\n\n const queries = employeeId ? [locationsQuery, workAddressesQuery] : [locationsQuery]\n const errorHandling = useErrorHandling(queries, { error: submitError, setError })\n\n const locationOptions = (companyLocations ?? []).map(location => ({\n value: location.uuid,\n label: addressInline(location),\n }))\n\n const baseMetadata = deriveFieldsMetadata(schema)\n const fieldsMetadata = {\n locationUuid: withOptions<Location>(\n baseMetadata.locationUuid,\n locationOptions,\n companyLocations ?? [],\n ),\n effectiveDate: baseMetadata.effectiveDate,\n }\n\n const onSubmit = async (\n callbacks?: WorkAddressSubmitCallbacks,\n options?: WorkAddressSubmitOptions,\n ): Promise<HookSubmitResult<EmployeeWorkAddress> | undefined> => {\n let submitResult: HookSubmitResult<EmployeeWorkAddress> | undefined\n\n await new Promise<void>(resolve => {\n void formMethods.handleSubmit(\n async (data: WorkAddressFormOutputs) => {\n await baseSubmitHandler(data, async payload => {\n const resolvedEmployeeId = options?.employeeId ?? employeeId\n\n if (!resolvedEmployeeId) {\n throw new SDKInternalError('employeeId is required to submit work address')\n }\n\n let updatedWorkAddress: EmployeeWorkAddress\n\n if (isCreateMode) {\n const resolvedEffectiveDate =\n withEffectiveDateField && payload.effectiveDate\n ? payload.effectiveDate\n : options?.effectiveDate\n\n const result = await createWorkAddressMutation.mutateAsync({\n request: {\n employeeId: resolvedEmployeeId,\n requestBody: {\n locationUuid: payload.locationUuid,\n effectiveDate: resolvedEffectiveDate\n ? new RFCDate(new Date(resolvedEffectiveDate))\n : undefined,\n },\n },\n })\n\n if (!result.employeeWorkAddress) {\n throw new SDKInternalError('Work address creation failed')\n }\n\n updatedWorkAddress = result.employeeWorkAddress\n callbacks?.onWorkAddressCreated?.(updatedWorkAddress)\n } else {\n const result = await updateWorkAddressMutation.mutateAsync({\n request: {\n workAddressUuid: currentWorkAddress.uuid,\n requestBody: {\n version: currentWorkAddress.version,\n locationUuid: payload.locationUuid,\n },\n },\n })\n\n if (!result.employeeWorkAddress) {\n throw new SDKInternalError('Work address update failed')\n }\n\n updatedWorkAddress = result.employeeWorkAddress\n callbacks?.onWorkAddressUpdated?.(updatedWorkAddress)\n }\n\n submitResult = {\n mode: isCreateMode ? 'create' : 'update',\n data: updatedWorkAddress,\n }\n })\n resolve()\n },\n () => {\n resolve()\n },\n )()\n })\n\n return submitResult\n }\n\n const isDataLoading =\n locationsQuery.isLoading || (employeeId ? workAddressesQuery.isLoading : false)\n\n if (isDataLoading || !companyLocations || (employeeId && !workAddresses)) {\n return { isLoading: true as const, errorHandling }\n }\n\n return {\n isLoading: false as const,\n data: {\n workAddress: currentWorkAddress ?? null,\n workAddresses,\n companyLocations,\n },\n status: {\n isPending,\n mode: isCreateMode ? ('create' as const) : ('update' as const),\n },\n actions: { onSubmit },\n errorHandling,\n form: {\n Fields: {\n Location: LocationField,\n EffectiveDate: withEffectiveDateField && isCreateMode ? EffectiveDateField : undefined,\n },\n fieldsMetadata,\n hookFormInternals: { formMethods },\n getFormSubmissionValues: createGetFormSubmissionValues(formMethods, schema),\n },\n }\n}\n\nexport type UseWorkAddressFormResult = ReturnType<typeof useWorkAddressForm>\nexport type UseWorkAddressFormReady = Extract<UseWorkAddressFormResult, { data: object }>\nexport type WorkAddressFieldsMetadata = UseWorkAddressFormReady['form']['fieldsMetadata']\nexport type WorkAddressFormFields = UseWorkAddressFormReady['form']['Fields']\n"],"names":["useWorkAddressForm","companyId","employeeId","withEffectiveDateField","requiredFields","partnerDefaults","validationMode","shouldFocusError","locationsQuery","useLocationsGet","workAddressesQuery","useEmployeeAddressesGetWorkAddresses","companyLocations","workAddresses","currentWorkAddress","address","isCreateMode","schema","createWorkAddressSchema","resolvedDefaults","formMethods","useForm","zodResolver","createWorkAddressMutation","useEmployeeAddressesCreateWorkAddressMutation","updateWorkAddressMutation","useEmployeeAddressesUpdateWorkAddressMutation","isPending","baseSubmitHandler","submitError","setError","useBaseSubmit","errorHandling","useErrorHandling","locationOptions","location","addressInline","baseMetadata","deriveFieldsMetadata","fieldsMetadata","withOptions","onSubmit","callbacks","options","submitResult","resolve","data","payload","resolvedEmployeeId","SDKInternalError","updatedWorkAddress","resolvedEffectiveDate","result","RFCDate","LocationField","EffectiveDateField","createGetFormSubmissionValues"],"mappings":";;;;;;;;;;;;;;;;AAiDO,SAASA,GAAmB;AAAA,EACjC,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,wBAAAC,IAAyB;AAAA,EACzB,gBAAAC;AAAA,EACA,eAAeC;AAAA,EACf,gBAAAC,IAAiB;AAAA,EACjB,kBAAAC,IAAmB;AACrB,GAA4B;AAC1B,QAAMC,IAAiBC,EAAgB,EAAE,WAAAR,GAAW,GAC9CS,IAAqBC;AAAA,IACzB,EAAE,YAAYT,KAAc,GAAA;AAAA,IAC5B,EAAE,SAAS,CAAC,CAACA,EAAA;AAAA,EAAW,GAGpBU,IAAmBJ,EAAe,MAAM,sBACxCK,IAAgBH,EAAmB,MAAM,2BACzCI,IAAqBD,GAAe,KAAK,CAAAE,MAAWA,EAAQ,MAAM,GAElEC,IAAe,CAACF,GAGhBG,IAASC,EAAwB;AAAA,IACrC,MAHWF,IAAe,WAAW;AAAA,IAIrC,gBAAAZ;AAAA,IACA,wBAAAD;AAAA,EAA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A,IAEF,QAAQ;AAAA,MACN,WAAAe;AAAA,MACA,MAAMX,IAAgB,WAAsB;AAAA,IAAA;AAAA,IAE9C,SAAS,EAAE,UAAAyB,EAAA;AAAA,IACX,eAAAT;AAAA,IACA,MAAM;AAAA,MACJ,QAAQ;AAAA,QACN,UAAUsB;AAAA,QACV,eAAenD,KAA0Ba,IAAeuC,IAAqB;AAAA,MAAA;AAAA,MAE/E,gBAAAhB;AAAA,MACA,mBAAmB,EAAE,aAAAnB,EAAA;AAAA,MACrB,yBAAyBoC,EAA8BpC,GAAaH,CAAM;AAAA,IAAA;AAAA,EAC5E;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"useWorkAddressForm.js","sources":["../../../../../src/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useForm } from 'react-hook-form'\nimport type { UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport type { Location } from '@gusto/embedded-api/models/components/location'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { useLocationsGet } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useEmployeeAddressesGetWorkAddresses } from '@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses'\nimport { useEmployeeAddressesCreateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress'\nimport { useEmployeeAddressesUpdateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport { useDeriveFieldsMetadata } from '../../form/useDeriveFieldsMetadata'\nimport { createGetFormSubmissionValues } from '../../form/getFormSubmissionValues'\nimport { withOptions } from '../../form/withOptions'\nimport {\n createWorkAddressSchema,\n type WorkAddressOptionalFieldsToRequire,\n type WorkAddressFormData,\n type WorkAddressFormOutputs,\n} from './workAddressSchema'\nimport { LocationField, EffectiveDateField } from './fields'\nimport { useErrorHandling } from '@/hooks/useErrorHandling'\nimport type { HookSubmitResult } from '@/types/sdkHooks'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { SDKInternalError } from '@/types/sdkError'\nimport { addressInline } from '@/helpers/formattedStrings'\n\nexport type { WorkAddressOptionalFieldsToRequire } from './workAddressSchema'\n\nexport interface WorkAddressSubmitCallbacks {\n onWorkAddressCreated?: (workAddress: EmployeeWorkAddress) => void\n onWorkAddressUpdated?: (workAddress: EmployeeWorkAddress) => void\n}\n\nexport interface WorkAddressSubmitOptions {\n employeeId?: string\n effectiveDate?: string\n}\n\nexport interface UseWorkAddressFormProps {\n companyId: string\n employeeId?: string\n withEffectiveDateField?: boolean\n optionalFieldsToRequire?: WorkAddressOptionalFieldsToRequire\n defaultValues?: Partial<WorkAddressFormData>\n validationMode?: UseFormProps['mode']\n shouldFocusError?: boolean\n}\n\nexport function useWorkAddressForm({\n companyId,\n employeeId,\n withEffectiveDateField = true,\n optionalFieldsToRequire,\n defaultValues: partnerDefaults,\n validationMode = 'onSubmit',\n shouldFocusError = true,\n}: UseWorkAddressFormProps) {\n const locationsQuery = useLocationsGet({ companyId })\n const workAddressesQuery = useEmployeeAddressesGetWorkAddresses(\n { employeeId: employeeId ?? '' },\n { enabled: !!employeeId },\n )\n\n const companyLocations = locationsQuery.data?.companyLocationsList\n const workAddresses = workAddressesQuery.data?.employeeWorkAddressesList\n const currentWorkAddress = workAddresses?.find(address => address.active)\n\n const isCreateMode = !currentWorkAddress\n const mode = isCreateMode ? 'create' : 'update'\n\n const [schema, metadataConfig] = useMemo(\n () => createWorkAddressSchema({ mode, optionalFieldsToRequire, withEffectiveDateField }),\n [mode, optionalFieldsToRequire, withEffectiveDateField],\n )\n\n const resolvedDefaults: WorkAddressFormData = {\n locationUuid: currentWorkAddress?.locationUuid ?? partnerDefaults?.locationUuid ?? '',\n effectiveDate: currentWorkAddress?.effectiveDate ?? partnerDefaults?.effectiveDate ?? '',\n }\n\n const formMethods = useForm<WorkAddressFormData, unknown, WorkAddressFormOutputs>({\n resolver: zodResolver(schema),\n mode: validationMode,\n shouldFocusError,\n defaultValues: resolvedDefaults,\n values: resolvedDefaults,\n resetOptions: { keepDirtyValues: true },\n })\n\n const createWorkAddressMutation = useEmployeeAddressesCreateWorkAddressMutation()\n const updateWorkAddressMutation = useEmployeeAddressesUpdateWorkAddressMutation()\n\n const isPending = createWorkAddressMutation.isPending || updateWorkAddressMutation.isPending\n\n const { baseSubmitHandler, error: submitError, setError } = useBaseSubmit('WorkAddressForm')\n\n const queries = employeeId ? [locationsQuery, workAddressesQuery] : [locationsQuery]\n const errorHandling = useErrorHandling(queries, { error: submitError, setError })\n\n const locationOptions = (companyLocations ?? []).map(location => ({\n value: location.uuid,\n label: addressInline(location),\n }))\n\n const baseMetadata = useDeriveFieldsMetadata(metadataConfig, formMethods.control)\n const fieldsMetadata = {\n locationUuid: withOptions<Location>(\n baseMetadata.locationUuid,\n locationOptions,\n companyLocations ?? [],\n ),\n effectiveDate: baseMetadata.effectiveDate,\n }\n\n const onSubmit = async (\n callbacks?: WorkAddressSubmitCallbacks,\n options?: WorkAddressSubmitOptions,\n ): Promise<HookSubmitResult<EmployeeWorkAddress> | undefined> => {\n let submitResult: HookSubmitResult<EmployeeWorkAddress> | undefined\n\n await new Promise<void>(resolve => {\n void formMethods.handleSubmit(\n async (data: WorkAddressFormOutputs) => {\n await baseSubmitHandler(data, async payload => {\n const resolvedEmployeeId = options?.employeeId ?? employeeId\n\n if (!resolvedEmployeeId) {\n throw new SDKInternalError('employeeId is required to submit work address')\n }\n\n const resolvedEffectiveDate =\n withEffectiveDateField && payload.effectiveDate\n ? payload.effectiveDate\n : options?.effectiveDate\n\n const effectiveDateParam = resolvedEffectiveDate\n ? new RFCDate(new Date(resolvedEffectiveDate))\n : undefined\n\n let updatedWorkAddress: EmployeeWorkAddress\n\n if (isCreateMode) {\n const result = await createWorkAddressMutation.mutateAsync({\n request: {\n employeeId: resolvedEmployeeId,\n requestBody: {\n locationUuid: payload.locationUuid,\n effectiveDate: effectiveDateParam,\n },\n },\n })\n\n if (!result.employeeWorkAddress) {\n throw new SDKInternalError('Work address creation failed')\n }\n\n updatedWorkAddress = result.employeeWorkAddress\n callbacks?.onWorkAddressCreated?.(updatedWorkAddress)\n } else {\n const result = await updateWorkAddressMutation.mutateAsync({\n request: {\n workAddressUuid: currentWorkAddress.uuid,\n requestBody: {\n version: currentWorkAddress.version,\n locationUuid: payload.locationUuid,\n effectiveDate: effectiveDateParam,\n },\n },\n })\n\n if (!result.employeeWorkAddress) {\n throw new SDKInternalError('Work address update failed')\n }\n\n updatedWorkAddress = result.employeeWorkAddress\n callbacks?.onWorkAddressUpdated?.(updatedWorkAddress)\n }\n\n submitResult = {\n mode: isCreateMode ? 'create' : 'update',\n data: updatedWorkAddress,\n }\n })\n resolve()\n },\n () => {\n resolve()\n },\n )()\n })\n\n return submitResult\n }\n\n const isDataLoading =\n locationsQuery.isLoading || (employeeId ? workAddressesQuery.isLoading : false)\n\n if (isDataLoading || !companyLocations || (employeeId && !workAddresses)) {\n return { isLoading: true as const, errorHandling }\n }\n\n return {\n isLoading: false as const,\n data: {\n workAddress: currentWorkAddress ?? null,\n workAddresses,\n companyLocations,\n },\n status: {\n isPending,\n mode: isCreateMode ? ('create' as const) : ('update' as const),\n },\n actions: { onSubmit },\n errorHandling,\n form: {\n Fields: {\n Location: LocationField,\n EffectiveDate: withEffectiveDateField ? EffectiveDateField : undefined,\n },\n fieldsMetadata,\n hookFormInternals: { formMethods },\n getFormSubmissionValues: createGetFormSubmissionValues(formMethods, schema),\n },\n }\n}\n\nexport type UseWorkAddressFormResult = ReturnType<typeof useWorkAddressForm>\nexport type UseWorkAddressFormReady = Extract<UseWorkAddressFormResult, { data: object }>\nexport type WorkAddressFieldsMetadata = UseWorkAddressFormReady['form']['fieldsMetadata']\nexport type WorkAddressFormFields = UseWorkAddressFormReady['form']['Fields']\n"],"names":["useWorkAddressForm","companyId","employeeId","withEffectiveDateField","optionalFieldsToRequire","partnerDefaults","validationMode","shouldFocusError","locationsQuery","useLocationsGet","workAddressesQuery","useEmployeeAddressesGetWorkAddresses","companyLocations","workAddresses","currentWorkAddress","address","isCreateMode","mode","schema","metadataConfig","useMemo","createWorkAddressSchema","resolvedDefaults","formMethods","useForm","zodResolver","createWorkAddressMutation","useEmployeeAddressesCreateWorkAddressMutation","updateWorkAddressMutation","useEmployeeAddressesUpdateWorkAddressMutation","isPending","baseSubmitHandler","submitError","setError","useBaseSubmit","errorHandling","useErrorHandling","locationOptions","location","addressInline","baseMetadata","useDeriveFieldsMetadata","fieldsMetadata","withOptions","onSubmit","callbacks","options","submitResult","resolve","data","payload","resolvedEmployeeId","SDKInternalError","resolvedEffectiveDate","effectiveDateParam","RFCDate","updatedWorkAddress","result","LocationField","EffectiveDateField","createGetFormSubmissionValues"],"mappings":";;;;;;;;;;;;;;;;;AAiDO,SAASA,GAAmB;AAAA,EACjC,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,wBAAAC,IAAyB;AAAA,EACzB,yBAAAC;AAAA,EACA,eAAeC;AAAA,EACf,gBAAAC,IAAiB;AAAA,EACjB,kBAAAC,IAAmB;AACrB,GAA4B;AAC1B,QAAMC,IAAiBC,EAAgB,EAAE,WAAAR,GAAW,GAC9CS,IAAqBC;AAAA,IACzB,EAAE,YAAYT,KAAc,GAAA;AAAA,IAC5B,EAAE,SAAS,CAAC,CAACA,EAAA;AAAA,EAAW,GAGpBU,IAAmBJ,EAAe,MAAM,sBACxCK,IAAgBH,EAAmB,MAAM,2BACzCI,IAAqBD,GAAe,KAAK,CAAAE,MAAWA,EAAQ,MAAM,GAElEC,IAAe,CAACF,GAChBG,IAAOD,IAAe,WAAW,UAEjC,CAACE,GAAQC,CAAc,IAAIC;AAAA,IAC/B,MAAMC,EAAwB,EAAE,MAAAJ,GAAM,yBAAAb,GAAyB,wBAAAD,GAAwB;AAAA,IACvF,CAACc,GAAMb,GAAyBD,CAAsB;AAAA,E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arB,KAAsB;AAAA,MACnC,eAAAD;AAAA,MACA,kBAAAD;AAAA,IAAA;AAAA,IAEF,QAAQ;AAAA,MACN,WAAAkB;AAAA,MACA,MAAMd,IAAgB,WAAsB;AAAA,IAAA;AAAA,IAE9C,SAAS,EAAE,UAAA4B,EAAA;AAAA,IACX,eAAAT;AAAA,IACA,MAAM;AAAA,MACJ,QAAQ;AAAA,QACN,UAAUuB;AAAA,QACV,eAAevD,IAAyBwD,IAAqB;AAAA,MAAA;AAAA,MAE/D,gBAAAjB;AAAA,MACA,mBAAmB,EAAE,aAAAnB,EAAA;AAAA,MACrB,yBAAyBqC,EAA8BrC,GAAaL,CAAM;AAAA,IAAA;AAAA,EAC5E;AAEJ;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { OptionalFieldsToRequire } from '../../form/buildFormSchema';
|
|
3
3
|
export declare const WorkAddressErrorCodes: {
|
|
4
4
|
readonly REQUIRED: "REQUIRED";
|
|
5
5
|
};
|
|
@@ -13,13 +13,17 @@ export type WorkAddressFormData = {
|
|
|
13
13
|
[K in keyof typeof fieldValidators]: z.infer<(typeof fieldValidators)[K]>;
|
|
14
14
|
};
|
|
15
15
|
export type WorkAddressFormOutputs = WorkAddressFormData;
|
|
16
|
+
declare const requiredFieldsConfig: {
|
|
17
|
+
effectiveDate: "never";
|
|
18
|
+
};
|
|
19
|
+
export type WorkAddressOptionalFieldsToRequire = OptionalFieldsToRequire<typeof requiredFieldsConfig>;
|
|
16
20
|
interface WorkAddressSchemaOptions {
|
|
17
21
|
mode?: 'create' | 'update';
|
|
18
|
-
|
|
22
|
+
optionalFieldsToRequire?: WorkAddressOptionalFieldsToRequire;
|
|
19
23
|
withEffectiveDateField?: boolean;
|
|
20
24
|
}
|
|
21
|
-
export declare function createWorkAddressSchema(options?: WorkAddressSchemaOptions):
|
|
25
|
+
export declare function createWorkAddressSchema(options?: WorkAddressSchemaOptions): import('../../form').BuildFormSchemaResult<{
|
|
22
26
|
locationUuid: z.ZodString;
|
|
23
27
|
effectiveDate: z.ZodISODate;
|
|
24
|
-
}
|
|
28
|
+
}>;
|
|
25
29
|
export {};
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { z as r } from "zod";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const t = {
|
|
2
|
+
import { buildFormSchema as s } from "../../form/buildFormSchema.js";
|
|
3
|
+
const e = {
|
|
5
4
|
REQUIRED: "REQUIRED"
|
|
6
|
-
},
|
|
7
|
-
locationUuid: r.string().min(1, { message:
|
|
8
|
-
effectiveDate: r.iso.date({ error: () =>
|
|
9
|
-
}, a =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
}, c = {
|
|
6
|
+
locationUuid: r.string().min(1, { message: e.REQUIRED }),
|
|
7
|
+
effectiveDate: r.iso.date({ error: () => e.REQUIRED })
|
|
8
|
+
}, a = {
|
|
9
|
+
effectiveDate: "never"
|
|
10
|
+
};
|
|
11
|
+
function E(o = {}) {
|
|
12
|
+
const { mode: t = "create", optionalFieldsToRequire: i, withEffectiveDateField: d = !0 } = o;
|
|
13
|
+
return s(c, {
|
|
14
|
+
requiredFieldsConfig: a,
|
|
15
|
+
requiredErrorCode: e.REQUIRED,
|
|
16
|
+
mode: t,
|
|
17
|
+
optionalFieldsToRequire: i,
|
|
18
|
+
excludeFields: d ? [] : ["effectiveDate"]
|
|
18
19
|
});
|
|
19
20
|
}
|
|
20
21
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
e as WorkAddressErrorCodes,
|
|
23
|
+
E as createWorkAddressSchema
|
|
23
24
|
};
|
|
24
25
|
//# sourceMappingURL=workAddressSchema.js.map
|