@gusto/embedded-react-sdk 0.56.1 → 0.56.3
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 +36 -0
- package/dist/components/Common/FieldCaption/FieldCaption.js +18 -24
- package/dist/components/Common/FieldCaption/FieldCaption.js.map +1 -1
- package/dist/components/Common/FieldCaption/FieldCaption.module.scss.js +3 -5
- package/dist/components/Common/FieldCaption/FieldCaption.module.scss.js.map +1 -1
- package/dist/components/Common/PaginationControl/PaginationControl.js +66 -62
- package/dist/components/Common/PaginationControl/PaginationControl.js.map +1 -1
- package/dist/components/Company/PaySchedule/management/PaySchedule.js +60 -0
- package/dist/components/Company/PaySchedule/management/PaySchedule.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentReviewStepPresentation.js +67 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentReviewStepPresentation.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentScheduleStepPresentation.js +59 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentScheduleStepPresentation.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.js +57 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.js +46 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.js +101 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/payScheduleAssignmentStateMachine.js +81 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/payScheduleAssignmentStateMachine.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/stripNullAssignmentPreviewFields.js +18 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/stripNullAssignmentPreviewFields.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleManagementComponents.js +56 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleManagementComponents.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleOverview.js +34 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleOverview.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleOverviewPresentation.js +77 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleOverviewPresentation.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleOverviewPresentation.module.scss.js +10 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleOverviewPresentation.module.scss.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/payScheduleManagementStateMachine.js +66 -0
- package/dist/components/Company/PaySchedule/management/payScheduleManagementStateMachine.js.map +1 -0
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +75 -57
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/shared/requirementSetError.js +15 -0
- package/dist/components/Company/StateTaxes/shared/requirementSetError.js.map +1 -0
- package/dist/components/Company/exports/companyManagement.js +7 -0
- package/dist/components/Company/exports/companyManagement.js.map +1 -0
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +24 -24
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +51 -58
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +12 -7
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +87 -85
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +55 -54
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +81 -67
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +129 -125
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +30 -27
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/fields.js +41 -30
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/fields.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/usePayrollEditEmployeeForm.js +159 -152
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/usePayrollEditEmployeeForm.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +61 -59
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +32 -31
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +16 -16
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +61 -61
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +192 -193
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlow.js +27 -22
- package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +55 -53
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js +44 -41
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -1
- package/dist/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.js +48 -47
- package/dist/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/helpers.js +72 -67
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +37 -28
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/ApiProvider/ApiProvider.js +23 -22
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
- package/dist/contexts/ApiProvider/informationRequestEnumHook.js +30 -0
- package/dist/contexts/ApiProvider/informationRequestEnumHook.js.map +1 -0
- package/dist/contexts/UnstableFeaturesProvider/useUnstableFeature.js.map +1 -1
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/helpers/formattedStrings.js +9 -8
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/i18n/I18n.js +2 -0
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.Management.PaySchedule.json.js +24 -0
- package/dist/i18n/en/Company.Management.PaySchedule.json.js.map +1 -0
- package/dist/i18n/en/Company.Management.PayScheduleAssignment.json.js +18 -0
- package/dist/i18n/en/Company.Management.PayScheduleAssignment.json.js.map +1 -0
- package/dist/i18n/en/Company.StateTaxes.json.js +1 -1
- package/dist/i18n/en/Payroll.GrossUpModal.json.js +12 -14
- package/dist/i18n/en/Payroll.GrossUpModal.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +1 -1
- package/dist/i18n/en/Payroll.UNSTABLE_PayrollEditEmployee.json.js +52 -50
- package/dist/i18n/en/Payroll.UNSTABLE_PayrollEditEmployee.json.js.map +1 -1
- package/dist/i18n/en/common.json.js +36 -38
- package/dist/i18n/en/common.json.js.map +1 -1
- package/dist/index.js +137 -135
- package/dist/index.js.map +1 -1
- package/dist/package.json.js +1 -1
- package/dist/shared/constants.js +39 -31
- package/dist/shared/constants.js.map +1 -1
- package/dist/src/components/Common/ActionsLayout/ActionsLayout.d.ts +1 -1
- package/dist/src/components/Common/Alert/Alert.d.ts +1 -1
- package/dist/src/components/Common/DataView/DataCards/DataCards.d.ts +1 -1
- package/dist/src/components/Common/DataView/DataTable/DataTable.d.ts +1 -1
- package/dist/src/components/Common/DataView/DataView.d.ts +1 -1
- package/dist/src/components/Common/DateRangeFilter/DateRangeFilter.d.ts +1 -1
- package/dist/src/components/Common/DetailViewLayout/DetailViewLayout.d.ts +1 -1
- package/dist/src/components/Common/DocumentList/DocumentList.d.ts +1 -1
- package/dist/src/components/Common/DocumentViewer/DocumentViewer.d.ts +1 -1
- package/dist/src/components/Common/EmptyData/EmptyData.d.ts +1 -1
- package/dist/src/components/Common/FieldCaption/FieldCaption.d.ts +1 -1
- package/dist/src/components/Common/FieldErrorMessage/FieldErrorMessage.d.ts +1 -1
- package/dist/src/components/Common/Fields/CheckboxGroupField/CheckboxGroupField.d.ts +1 -1
- package/dist/src/components/Common/Fields/ComboBoxField/ComboBoxField.d.ts +1 -1
- package/dist/src/components/Common/Fields/PercentageField/PercentageField.d.ts +1 -1
- package/dist/src/components/Common/Fields/RadioGroupField/RadioGroupField.d.ts +1 -1
- package/dist/src/components/Common/Fields/SelectField/SelectField.d.ts +1 -1
- package/dist/src/components/Common/Fields/hooks/FieldElementRegistryProvider.d.ts +1 -1
- package/dist/src/components/Common/Flex/Flex.d.ts +2 -2
- package/dist/src/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.d.ts +1 -1
- package/dist/src/components/Common/Form/Form.d.ts +1 -1
- package/dist/src/components/Common/Grid/Grid.d.ts +1 -1
- package/dist/src/components/Common/HamburgerMenu/HamburgerMenu.d.ts +1 -1
- package/dist/src/components/Common/InlineSpinner/InlineSpinner.d.ts +1 -1
- package/dist/src/components/Common/InternalError/InternalError.d.ts +1 -1
- package/dist/src/components/Common/Loading/Loading.d.ts +1 -1
- package/dist/src/components/Common/OnboardingStatusBadge/index.d.ts +3 -3
- package/dist/src/components/Common/PaginationControl/PaginationControl.d.ts +1 -1
- package/dist/src/components/Common/PayrollLoading/PayrollLoading.d.ts +1 -1
- package/dist/src/components/Common/ReorderableList/ReorderableList.d.ts +1 -1
- package/dist/src/components/Common/RequirementsList/RequirementsList.d.ts +1 -1
- package/dist/src/components/Common/TaxInputs/TaxInputs.d.ts +7 -7
- package/dist/src/components/Common/Toast/Toast.d.ts +1 -1
- package/dist/src/components/Common/UI/Alert/Alert.d.ts +1 -1
- package/dist/src/components/Common/UI/Box/Box.d.ts +1 -1
- package/dist/src/components/Common/UI/BoxHeader/BoxHeader.d.ts +1 -1
- package/dist/src/components/Common/UI/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/src/components/Common/UI/Button/Button.d.ts +1 -1
- package/dist/src/components/Common/UI/Button/ButtonIcon.d.ts +1 -1
- package/dist/src/components/Common/UI/CalendarPreview/CalendarLegend.d.ts +1 -1
- package/dist/src/components/Common/UI/CalendarPreview/CalendarPreview.d.ts +1 -1
- package/dist/src/components/Common/UI/Card/Card.d.ts +1 -1
- package/dist/src/components/Common/UI/Checkbox/Checkbox.d.ts +1 -1
- package/dist/src/components/Common/UI/ComboBox/ComboBox.d.ts +1 -1
- package/dist/src/components/Common/UI/DatePicker/DatePicker.d.ts +1 -1
- package/dist/src/components/Common/UI/DateRangePicker/DateRangePicker.d.ts +1 -1
- package/dist/src/components/Common/UI/DescriptionList/DescriptionList.d.ts +1 -1
- package/dist/src/components/Common/UI/Dialog/Dialog.d.ts +1 -1
- package/dist/src/components/Common/UI/FileInput/FileInput.d.ts +1 -1
- package/dist/src/components/Common/UI/FormBox/FormBox.d.ts +1 -1
- package/dist/src/components/Common/UI/FormBoxHeader/FormBoxHeader.d.ts +1 -1
- package/dist/src/components/Common/UI/Heading/Heading.d.ts +1 -1
- package/dist/src/components/Common/UI/Input/Input.d.ts +1 -1
- package/dist/src/components/Common/UI/Link/Link.d.ts +1 -1
- package/dist/src/components/Common/UI/List/OrderedList.d.ts +1 -1
- package/dist/src/components/Common/UI/List/UnorderedList.d.ts +1 -1
- package/dist/src/components/Common/UI/Menu/Menu.d.ts +1 -1
- package/dist/src/components/Common/UI/Modal/Modal.d.ts +1 -1
- package/dist/src/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.d.ts +1 -1
- package/dist/src/components/Common/UI/NumberInput/NumberInput.d.ts +1 -1
- package/dist/src/components/Common/UI/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/src/components/Common/UI/Radio/Radio.d.ts +1 -1
- package/dist/src/components/Common/UI/Select/Select.d.ts +1 -1
- package/dist/src/components/Common/UI/Switch/Switch.d.ts +1 -1
- package/dist/src/components/Common/UI/Table/Table.d.ts +1 -1
- package/dist/src/components/Common/UI/Tabs/Tabs.d.ts +1 -1
- package/dist/src/components/Common/UI/Text/Text.d.ts +1 -1
- package/dist/src/components/Common/UI/TextArea/TextArea.d.ts +1 -1
- package/dist/src/components/Common/UI/TextInput/TextInput.d.ts +1 -1
- package/dist/src/components/Company/AssignSignatory/AssignSignatory.d.ts +1 -1
- package/dist/src/components/Company/AssignSignatory/AssignSignatorySelection.d.ts +1 -1
- package/dist/src/components/Company/AssignSignatory/CreateSignatory/Actions.d.ts +1 -1
- package/dist/src/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.d.ts +1 -1
- package/dist/src/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.d.ts +1 -1
- package/dist/src/components/Company/AssignSignatory/Head.d.ts +1 -1
- package/dist/src/components/Company/AssignSignatory/InviteSignatory/Actions.d.ts +1 -1
- package/dist/src/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.d.ts +1 -1
- package/dist/src/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.d.ts +1 -1
- package/dist/src/components/Company/AssignSignatory/SignatoryForm.d.ts +1 -1
- package/dist/src/components/Company/AssignSignatory/TitleSelect.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccount.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccountComponents.d.ts +3 -3
- package/dist/src/components/Company/BankAccount/BankAccountForm/Actions.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccountForm/BankAccountForm.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccountForm/Form.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccountForm/Head.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccountList/AccountView.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccountList/Actions.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccountList/BankAccountList.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccountList/Head.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccountVerify/Actions.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccountVerify/Form.d.ts +1 -1
- package/dist/src/components/Company/BankAccount/BankAccountVerify/Head.d.ts +1 -1
- package/dist/src/components/Company/DocumentSigner/DocumentList/Actions.d.ts +1 -1
- package/dist/src/components/Company/DocumentSigner/DocumentList/DocumentList.d.ts +1 -1
- package/dist/src/components/Company/DocumentSigner/DocumentList/Head.d.ts +1 -1
- package/dist/src/components/Company/DocumentSigner/DocumentList/List.d.ts +1 -1
- package/dist/src/components/Company/DocumentSigner/DocumentList/ManageSignatories.d.ts +1 -1
- package/dist/src/components/Company/DocumentSigner/DocumentSigner.d.ts +1 -1
- package/dist/src/components/Company/DocumentSigner/SignatureForm/SignatureForm.d.ts +1 -1
- package/dist/src/components/Company/DocumentSigner/documentSignerStateMachine.d.ts +3 -3
- package/dist/src/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.d.ts +2 -2
- package/dist/src/components/Company/FederalTaxes/Actions.d.ts +1 -1
- package/dist/src/components/Company/FederalTaxes/FederalTaxes.d.ts +1 -1
- package/dist/src/components/Company/FederalTaxes/Form.d.ts +1 -1
- package/dist/src/components/Company/FederalTaxes/Head.d.ts +1 -1
- package/dist/src/components/Company/Industry/Actions.d.ts +1 -1
- package/dist/src/components/Company/Industry/Edit.d.ts +1 -1
- package/dist/src/components/Company/Industry/Head.d.ts +1 -1
- package/dist/src/components/Company/Industry/Industry.d.ts +1 -1
- package/dist/src/components/Company/Industry/IndustrySelect.d.ts +1 -1
- package/dist/src/components/Company/Locations/LocationForm/Actions.d.ts +1 -1
- package/dist/src/components/Company/Locations/LocationForm/Form.d.ts +1 -1
- package/dist/src/components/Company/Locations/LocationForm/Head.d.ts +1 -1
- package/dist/src/components/Company/Locations/LocationForm/LocationForm.d.ts +1 -1
- package/dist/src/components/Company/Locations/Locations.d.ts +1 -1
- package/dist/src/components/Company/Locations/LocationsList/Actions.d.ts +1 -1
- package/dist/src/components/Company/Locations/LocationsList/Head.d.ts +1 -1
- package/dist/src/components/Company/Locations/LocationsList/List.d.ts +1 -1
- package/dist/src/components/Company/Locations/LocationsList/LocationsList.d.ts +1 -1
- package/dist/src/components/Company/Locations/locationsStateMachine.d.ts +2 -2
- package/dist/src/components/Company/OnboardingFlow/OnboardingFlow.d.ts +1 -1
- package/dist/src/components/Company/OnboardingFlow/OnboardingFlowComponents.d.ts +9 -9
- package/dist/src/components/Company/OnboardingOverview/Completed.d.ts +1 -1
- package/dist/src/components/Company/OnboardingOverview/MissingRequirements.d.ts +1 -1
- package/dist/src/components/Company/OnboardingOverview/OnboardingOverview.d.ts +1 -1
- package/dist/src/components/Company/PaySchedule/PaySchedule.d.ts +1 -1
- package/dist/src/components/Company/PaySchedule/PayScheduleComponents.d.ts +2 -2
- package/dist/src/components/Company/PaySchedule/PayScheduleForm.d.ts +1 -1
- package/dist/src/components/Company/PaySchedule/PayScheduleList.d.ts +1 -1
- package/dist/src/components/Company/PaySchedule/management/PaySchedule.d.ts +24 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentReviewStepPresentation.d.ts +10 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentScheduleStepPresentation.d.ts +11 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.d.ts +9 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.d.ts +35 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.d.ts +29 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/index.d.ts +1 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/payScheduleAssignmentStateMachine.d.ts +7 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/stripNullAssignmentPreviewFields.d.ts +12 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/usePayScheduleAssignment.d.ts +9 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleManagementComponents.d.ts +20 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleOverview.d.ts +11 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleOverviewPresentation.d.ts +18 -0
- package/dist/src/components/Company/PaySchedule/management/index.d.ts +1 -0
- package/dist/src/components/Company/PaySchedule/management/payScheduleManagementStateMachine.d.ts +12 -0
- package/dist/src/components/Company/PaySchedule/shared/usePayScheduleForm/fields.d.ts +8 -8
- package/dist/src/components/Company/StateTaxes/StateTaxes.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/StateTaxesComponents.d.ts +3 -3
- package/dist/src/components/Company/StateTaxes/StateTaxesForm/Actions.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/StateTaxesForm/Form.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/StateTaxesForm/Head.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/StateTaxesList/Actions.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/StateTaxesList/Head.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/StateTaxesList/List.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/TaxRateManagement/AddRateAction.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/TaxRateManagement/TaxRateHistorySection.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/TaxRateManagement/TaxRateManagement.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/shared/RequirementFields.d.ts +1 -1
- package/dist/src/components/Company/StateTaxes/shared/requirementSetError.d.ts +18 -0
- package/dist/src/components/Company/StateTaxes/shared/requirementSetError.test.d.ts +1 -0
- package/dist/src/components/Company/exports/companyManagement.d.ts +2 -0
- package/dist/src/components/Contractor/Address/management/Address.d.ts +1 -1
- package/dist/src/components/Contractor/Address/management/AddressCard/AddressCard.d.ts +1 -1
- package/dist/src/components/Contractor/Address/management/AddressComponents.d.ts +2 -2
- package/dist/src/components/Contractor/Address/management/AddressEditForm.d.ts +1 -1
- package/dist/src/components/Contractor/Address/shared/useContractorAddressForm/fields.d.ts +5 -5
- package/dist/src/components/Contractor/Compensation/management/Compensation.d.ts +1 -1
- package/dist/src/components/Contractor/Compensation/management/CompensationCard/CompensationCard.d.ts +1 -1
- package/dist/src/components/Contractor/Compensation/management/CompensationComponents.d.ts +2 -2
- package/dist/src/components/Contractor/Compensation/management/CompensationEditForm.d.ts +1 -1
- package/dist/src/components/Contractor/Compensation/shared/useContractorPayForm/fields.d.ts +2 -2
- package/dist/src/components/Contractor/ContractorList/management/ManagementContractorList.d.ts +1 -1
- package/dist/src/components/Contractor/ContractorList/management/ManagementContractorListView.d.ts +1 -1
- package/dist/src/components/Contractor/ContractorList/onboarding/ContractorList.d.ts +1 -1
- package/dist/src/components/Contractor/ContractorList/onboarding/ContractorListView.d.ts +1 -1
- package/dist/src/components/Contractor/ContractorListFlow/ContractorListFlow.d.ts +1 -1
- package/dist/src/components/Contractor/ContractorListFlow/ContractorListFlowComponents.d.ts +2 -2
- package/dist/src/components/Contractor/Dashboard/Dashboard.d.ts +1 -1
- package/dist/src/components/Contractor/Dashboard/DashboardComponents.d.ts +5 -5
- package/dist/src/components/Contractor/Dashboard/DashboardFlow.d.ts +1 -1
- package/dist/src/components/Contractor/Dashboard/DetailsView.d.ts +1 -1
- package/dist/src/components/Contractor/Dashboard/PayView.d.ts +1 -1
- package/dist/src/components/Contractor/Documents/management/DocumentsCard/DocumentsCard.d.ts +1 -1
- package/dist/src/components/Contractor/Documents/onboarding/DocumentSigner/DocumentSigner.d.ts +1 -1
- package/dist/src/components/Contractor/Documents/onboarding/DocumentSigner/documentSignerStateMachine.d.ts +2 -2
- package/dist/src/components/Contractor/Documents/onboarding/DocumentsList/DocumentsList.d.ts +1 -1
- package/dist/src/components/Contractor/Documents/shared/SignatureForm/SignatureForm.d.ts +1 -1
- package/dist/src/components/Contractor/Documents/shared/SignatureForm/useContractorSignatureForm/fields.d.ts +19 -19
- package/dist/src/components/Contractor/Landing/Landing.d.ts +1 -1
- package/dist/src/components/Contractor/NewHireReport/NewHireReport.d.ts +1 -1
- package/dist/src/components/Contractor/OnboardingFlow/OnboardingFlow.d.ts +1 -1
- package/dist/src/components/Contractor/OnboardingFlow/OnboardingFlowComponents.d.ts +7 -7
- package/dist/src/components/Contractor/OnboardingSummary/OnboardingSummary.d.ts +1 -1
- package/dist/src/components/Contractor/PaymentMethod/management/PaymentMethod.d.ts +1 -1
- package/dist/src/components/Contractor/PaymentMethod/management/PaymentMethodCard/PaymentMethodCard.d.ts +1 -1
- package/dist/src/components/Contractor/PaymentMethod/management/PaymentMethodComponents.d.ts +2 -2
- package/dist/src/components/Contractor/PaymentMethod/management/PaymentMethodEditForm.d.ts +1 -1
- package/dist/src/components/Contractor/PaymentMethod/onboarding/PaymentMethod.d.ts +1 -1
- package/dist/src/components/Contractor/PaymentMethod/shared/ContractorBankAccountFields/ContractorBankAccountFields.d.ts +1 -1
- package/dist/src/components/Contractor/PaymentMethod/shared/ContractorBankAccountFormBody/ContractorBankAccountFormBody.d.ts +1 -1
- package/dist/src/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/fields.d.ts +4 -4
- package/dist/src/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/fields.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/CreateHistoricalPayment/CreateHistoricalPayment.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/CreatePayment/CreatePayment.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/CreatePayment/GenericBlocker.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlow.d.ts +2 -2
- package/dist/src/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlowComponents.d.ts +2 -2
- package/dist/src/components/Contractor/Payments/HistoricalPaymentFlow/HistoricalPaymentFlow.d.ts +2 -2
- package/dist/src/components/Contractor/Payments/HistoricalPaymentFlow/HistoricalPaymentFlowComponents.d.ts +2 -2
- package/dist/src/components/Contractor/Payments/HistoricalPaymentSummary/HistoricalPaymentSummary.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/PaymentFlow/PaymentFlow.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +5 -5
- package/dist/src/components/Contractor/Payments/PaymentHistory/PaymentHistory.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/PaymentStatement/PaymentStatement.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/PaymentSummary/PaymentSummary.d.ts +2 -2
- package/dist/src/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/PaymentsList/PaymentsList.d.ts +2 -2
- package/dist/src/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlow.d.ts +2 -2
- package/dist/src/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlowComponents.d.ts +2 -2
- package/dist/src/components/Contractor/Payments/shared/PaymentSummaryBlock/PaymentSummaryBlock.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/shared/SetPaymentAmounts/EditContractorPaymentPresentation.d.ts +1 -1
- package/dist/src/components/Contractor/Payments/shared/SetPaymentAmounts/SetPaymentAmounts.d.ts +1 -1
- package/dist/src/components/Contractor/Profile/management/Profile.d.ts +1 -1
- package/dist/src/components/Contractor/Profile/management/ProfileCard/ProfileCard.d.ts +1 -1
- package/dist/src/components/Contractor/Profile/management/ProfileComponents.d.ts +2 -2
- package/dist/src/components/Contractor/Profile/management/ProfileEditForm.d.ts +1 -1
- package/dist/src/components/Contractor/Profile/onboarding/BusinessSelfOnboardingProfile.d.ts +1 -1
- package/dist/src/components/Contractor/Profile/onboarding/ContractorProfile.d.ts +1 -1
- package/dist/src/components/Contractor/Profile/onboarding/IndividualSelfOnboardingProfile.d.ts +1 -1
- package/dist/src/components/Contractor/Profile/onboarding/SelfOnboardingContractorProfile.d.ts +1 -1
- package/dist/src/components/Contractor/Profile/shared/useContractorDetailsForm/fields.d.ts +14 -14
- package/dist/src/components/Contractor/SelfOnboardingFlow/SelfOnboardingComponents.d.ts +6 -6
- package/dist/src/components/Contractor/SelfOnboardingFlow/SelfOnboardingFlow.d.ts +1 -1
- package/dist/src/components/Contractor/Submit/Submit.d.ts +1 -1
- package/dist/src/components/Contractor/Submit/SubmitDone.d.ts +1 -1
- package/dist/src/components/Contractor/shared/SelectContractors/SelectContractors.d.ts +1 -1
- package/dist/src/components/Contractor/shared/SelectContractors/SelectContractorsPresentation.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/management/Compensation.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/management/CompensationCard/CompensationCard.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/management/CompensationComponents.d.ts +4 -4
- package/dist/src/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/management/CompensationEditPendingJobForm/CompensationEditPendingJobForm.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/management/ManagementCompensationFormBody.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/onboarding/Compensation.d.ts +2 -2
- package/dist/src/components/Employee/Compensation/onboarding/CompensationFlowComponents.d.ts +3 -3
- package/dist/src/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/onboarding/JobsList/JobsList.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/shared/AddCompensationFormBody.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/shared/PendingChangesReviewModal.d.ts +1 -1
- package/dist/src/components/Employee/Compensation/shared/useCompensationForm/fields.d.ts +7 -7
- package/dist/src/components/Employee/Compensation/shared/useJobForm/fields.d.ts +5 -5
- package/dist/src/components/Employee/Dashboard/BasicDetailsView.d.ts +1 -1
- package/dist/src/components/Employee/Dashboard/Dashboard.d.ts +1 -1
- package/dist/src/components/Employee/Dashboard/DashboardComponents.d.ts +13 -13
- package/dist/src/components/Employee/Dashboard/DashboardFlow.d.ts +1 -1
- package/dist/src/components/Employee/Dashboard/JobAndPayView.d.ts +1 -1
- package/dist/src/components/Employee/Dashboard/TaxesView.d.ts +2 -2
- package/dist/src/components/Employee/Deductions/management/Deductions.d.ts +1 -1
- package/dist/src/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.d.ts +1 -1
- package/dist/src/components/Employee/Deductions/management/DeductionsComponents.d.ts +2 -2
- package/dist/src/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.d.ts +1 -1
- package/dist/src/components/Employee/Deductions/onboarding/Deductions.d.ts +1 -1
- package/dist/src/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.d.ts +1 -1
- package/dist/src/components/Employee/Deductions/onboarding/deductionsContextualComponents.d.ts +2 -2
- package/dist/src/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.d.ts +1 -1
- package/dist/src/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.d.ts +1 -1
- package/dist/src/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.d.ts +1 -1
- package/dist/src/components/Employee/Deductions/shared/DeleteDeductionDialog.d.ts +1 -1
- package/dist/src/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.d.ts +8 -8
- package/dist/src/components/Employee/Deductions/shared/useDeductionForm/fields.d.ts +7 -7
- package/dist/src/components/Employee/Documents/management/DocumentManager.d.ts +1 -1
- package/dist/src/components/Employee/Documents/management/Documents.d.ts +1 -1
- package/dist/src/components/Employee/Documents/management/DocumentsCard/DocumentsCard.d.ts +1 -1
- package/dist/src/components/Employee/Documents/management/DocumentsComponents.d.ts +2 -2
- package/dist/src/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.d.ts +1 -1
- package/dist/src/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.d.ts +1 -1
- package/dist/src/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Head.d.ts +1 -1
- package/dist/src/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.d.ts +1 -1
- package/dist/src/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.d.ts +1 -1
- package/dist/src/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.d.ts +1 -1
- package/dist/src/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.d.ts +1 -1
- package/dist/src/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.d.ts +1 -1
- package/dist/src/components/Employee/Documents/onboarding/DocumentSigner/documentSignerStateMachine.d.ts +4 -4
- package/dist/src/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.d.ts +2 -2
- package/dist/src/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.d.ts +1 -1
- package/dist/src/components/Employee/Documents/shared/SignatureForm/SignatureForm.d.ts +1 -1
- package/dist/src/components/Employee/Documents/shared/useSignEmployeeForm/fields.d.ts +39 -39
- package/dist/src/components/Employee/EmployeeList/management/ManagementEmployeeList.d.ts +1 -1
- package/dist/src/components/Employee/EmployeeList/management/ManagementEmployeeListView.d.ts +1 -1
- package/dist/src/components/Employee/EmployeeList/onboarding/EmployeeList.d.ts +1 -1
- package/dist/src/components/Employee/EmployeeList/onboarding/EmployeeListView.d.ts +1 -1
- package/dist/src/components/Employee/EmployeeListFlow/EmployeeListFlow.d.ts +1 -1
- package/dist/src/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.d.ts +4 -4
- package/dist/src/components/Employee/FederalTaxes/management/FederalTaxes.d.ts +1 -1
- package/dist/src/components/Employee/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.d.ts +1 -1
- package/dist/src/components/Employee/FederalTaxes/management/FederalTaxesComponents.d.ts +2 -2
- package/dist/src/components/Employee/FederalTaxes/management/FederalTaxesEditForm.d.ts +1 -1
- package/dist/src/components/Employee/FederalTaxes/onboarding/FederalTaxes.d.ts +1 -1
- package/dist/src/components/Employee/FederalTaxes/shared/FederalTaxesView.d.ts +1 -1
- package/dist/src/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.d.ts +6 -6
- package/dist/src/components/Employee/HomeAddress/management/HomeAddress.d.ts +1 -1
- package/dist/src/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.d.ts +1 -1
- package/dist/src/components/Employee/HomeAddress/management/HomeAddressComponents.d.ts +2 -2
- package/dist/src/components/Employee/HomeAddress/management/HomeAddressEditForm.d.ts +1 -1
- package/dist/src/components/Employee/HomeAddress/management/HomeAddressView.d.ts +1 -1
- package/dist/src/components/Employee/Landing/Landing.d.ts +1 -1
- package/dist/src/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlow.d.ts +1 -1
- package/dist/src/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlowComponents.d.ts +3 -3
- package/dist/src/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.d.ts +1 -1
- package/dist/src/components/Employee/OnboardingFlow/OnboardingFlow.d.ts +1 -1
- package/dist/src/components/Employee/OnboardingFlow/OnboardingFlowComponents.d.ts +2 -2
- package/dist/src/components/Employee/OnboardingSummary/OnboardingSummary.d.ts +2 -2
- package/dist/src/components/Employee/PaymentMethod/management/PaymentMethod.d.ts +1 -1
- package/dist/src/components/Employee/PaymentMethod/management/PaymentMethodBankForm.d.ts +1 -1
- package/dist/src/components/Employee/PaymentMethod/management/PaymentMethodCard.d.ts +1 -1
- package/dist/src/components/Employee/PaymentMethod/management/PaymentMethodComponents.d.ts +3 -3
- package/dist/src/components/Employee/PaymentMethod/management/PaymentMethodSplitForm.d.ts +1 -1
- package/dist/src/components/Employee/PaymentMethod/onboarding/BankForm.d.ts +1 -1
- package/dist/src/components/Employee/PaymentMethod/onboarding/ListView.d.ts +1 -1
- package/dist/src/components/Employee/PaymentMethod/onboarding/PaymentMethod.d.ts +2 -2
- package/dist/src/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.d.ts +3 -3
- package/dist/src/components/Employee/PaymentMethod/onboarding/SplitView.d.ts +1 -1
- package/dist/src/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.d.ts +1 -1
- package/dist/src/components/Employee/PaymentMethod/shared/DeleteBankAccountDialog.d.ts +1 -1
- package/dist/src/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.d.ts +1 -1
- package/dist/src/components/Employee/PaymentMethod/shared/useBankForm/fields.d.ts +4 -4
- package/dist/src/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.d.ts +1 -1
- package/dist/src/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/fields.d.ts +1 -1
- package/dist/src/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.d.ts +1 -1
- package/dist/src/components/Employee/Profile/management/Profile.d.ts +1 -1
- package/dist/src/components/Employee/Profile/management/ProfileCard/ProfileCard.d.ts +1 -1
- package/dist/src/components/Employee/Profile/management/ProfileComponents.d.ts +2 -2
- package/dist/src/components/Employee/Profile/management/ProfileEditForm.d.ts +1 -1
- package/dist/src/components/Employee/Profile/onboarding/AdminProfile.d.ts +1 -1
- package/dist/src/components/Employee/Profile/onboarding/EmployeeProfile.d.ts +1 -1
- package/dist/src/components/Employee/Profile/onboarding/Profile.d.ts +2 -2
- package/dist/src/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.d.ts +7 -7
- package/dist/src/components/Employee/Profile/shared/useHomeAddressForm/fields.d.ts +7 -7
- package/dist/src/components/Employee/Profile/shared/useWorkAddressForm/fields.d.ts +2 -2
- package/dist/src/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.d.ts +7 -7
- package/dist/src/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.d.ts +1 -1
- package/dist/src/components/Employee/StateTaxes/management/StateTaxes.d.ts +1 -1
- package/dist/src/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.d.ts +1 -1
- package/dist/src/components/Employee/StateTaxes/management/StateTaxesComponents.d.ts +2 -2
- package/dist/src/components/Employee/StateTaxes/management/StateTaxesEditForm.d.ts +1 -1
- package/dist/src/components/Employee/StateTaxes/onboarding/StateTaxes.d.ts +1 -1
- package/dist/src/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.d.ts +1 -1
- package/dist/src/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.d.ts +6 -6
- package/dist/src/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.d.ts +1 -1
- package/dist/src/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.d.ts +1 -1
- package/dist/src/components/Employee/Terminations/TerminationFlow/TerminationFlow.d.ts +1 -1
- package/dist/src/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.d.ts +4 -4
- package/dist/src/components/Employee/Terminations/TerminationSummary/TerminationSummary.d.ts +1 -1
- package/dist/src/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.d.ts +1 -1
- package/dist/src/components/Employee/WorkAddress/management/WorkAddress.d.ts +1 -1
- package/dist/src/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.d.ts +1 -1
- package/dist/src/components/Employee/WorkAddress/management/WorkAddressComponents.d.ts +2 -2
- package/dist/src/components/Employee/WorkAddress/management/WorkAddressEditForm.d.ts +1 -1
- package/dist/src/components/Employee/WorkAddress/management/WorkAddressView.d.ts +1 -1
- package/dist/src/components/Flow/Flow.d.ts +1 -1
- package/dist/src/components/Flow/FlowHeader.d.ts +1 -1
- package/dist/src/components/InformationRequests/InformationRequestForm/InformationRequestForm.d.ts +2 -2
- package/dist/src/components/InformationRequests/InformationRequestList/InformationRequestList.d.ts +1 -1
- package/dist/src/components/InformationRequests/InformationRequests.d.ts +1 -1
- package/dist/src/components/InformationRequests/InformationRequestsComponents.d.ts +1 -1
- package/dist/src/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.d.ts +1 -1
- package/dist/src/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.d.ts +1 -1
- package/dist/src/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.d.ts +2 -2
- package/dist/src/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.d.ts +1 -1
- package/dist/src/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.d.ts +1 -1
- package/dist/src/components/Payroll/Dismissal/DismissalFlow.d.ts +1 -1
- package/dist/src/components/Payroll/Dismissal/DismissalFlowComponents.d.ts +2 -2
- package/dist/src/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.d.ts +1 -1
- package/dist/src/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.d.ts +1 -1
- package/dist/src/components/Payroll/GrossUpModal/GrossUpModal.d.ts +1 -1
- package/dist/src/components/Payroll/OffCycle/OffCycleFlow.d.ts +1 -1
- package/dist/src/components/Payroll/OffCycle/OffCycleFlowComponents.d.ts +3 -3
- package/dist/src/components/Payroll/OffCycleCreation/OffCycleCreation.d.ts +1 -1
- package/dist/src/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
- package/dist/src/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.d.ts +1 -1
- package/dist/src/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.d.ts +1 -1
- package/dist/src/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.d.ts +1 -1
- package/dist/src/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.d.ts +1 -1
- package/dist/src/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.d.ts +1 -1
- package/dist/src/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollBlocker/components/PayrollBlockerList.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollBlocker/payrollHelpers.d.ts +12 -0
- package/dist/src/components/Payroll/PayrollConfiguration/PayrollConfiguration.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +6 -1
- package/dist/src/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollEditEmployee/TimeOffField.d.ts +2 -2
- package/dist/src/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeHelpers.d.ts +2 -2
- package/dist/src/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.d.ts +2 -2
- package/dist/src/components/Payroll/PayrollFlow/OffCycleFlowContextual.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollFlow/PayrollFlow.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +7 -7
- package/dist/src/components/Payroll/PayrollFlow/TransitionFlowContextual.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollHistory/PayrollHistory.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollLanding/PayrollLanding.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +3 -3
- package/dist/src/components/Payroll/PayrollList/PayrollList.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollList/PayrollListPresentation.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollOverview/PayrollOverview.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollReceipts/PayrollReceipts.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.d.ts +1 -1
- package/dist/src/components/Payroll/PrintChecks/PrintChecks.d.ts +1 -1
- package/dist/src/components/Payroll/PrintChecks/PrintChecksBanner/PrintChecksBanner.d.ts +1 -1
- package/dist/src/components/Payroll/PrintChecks/PrintChecksComponents.d.ts +3 -3
- package/dist/src/components/Payroll/PrintChecks/PrintChecksFailure/PrintChecksFailure.d.ts +1 -1
- package/dist/src/components/Payroll/PrintChecks/PrintChecksForm/PrintChecksForm.d.ts +1 -1
- package/dist/src/components/Payroll/PrintChecks/PrintChecksSummary/PrintChecksSummary.d.ts +1 -1
- package/dist/src/components/Payroll/RecoveryCases/RecoveryCases.d.ts +1 -1
- package/dist/src/components/Payroll/RecoveryCases/RecoveryCasesComponents.d.ts +1 -1
- package/dist/src/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.d.ts +1 -1
- package/dist/src/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.d.ts +1 -1
- package/dist/src/components/Payroll/Transition/TransitionFlow.d.ts +1 -1
- package/dist/src/components/Payroll/Transition/TransitionFlowComponents.d.ts +1 -1
- package/dist/src/components/Payroll/TransitionCreation/TransitionCreation.d.ts +1 -1
- package/dist/src/components/Payroll/TransitionCreation/TransitionCreationPresentation.d.ts +1 -1
- package/dist/src/components/Payroll/TransitionPayroll/TransitionPayroll.d.ts +1 -1
- package/dist/src/components/Payroll/TransitionPayroll/TransitionPayrollComponents.d.ts +2 -2
- package/dist/src/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.d.ts +6 -1
- package/dist/src/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +7 -1
- package/dist/src/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.d.ts +1 -1
- package/dist/src/components/Payroll/helpers.d.ts +34 -0
- package/dist/src/components/Payroll/usePreparedPayrollData.d.ts +6 -1
- package/dist/src/components/TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.d.ts +1 -1
- package/dist/src/components/TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.d.ts +1 -1
- package/dist/src/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.d.ts +1 -1
- package/dist/src/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.d.ts +1 -1
- package/dist/src/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.d.ts +1 -1
- package/dist/src/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.d.ts +1 -1
- package/dist/src/components/TimeOff/PolicyList/PolicyList.d.ts +1 -1
- package/dist/src/components/TimeOff/PolicyList/PolicyListPresentation.d.ts +1 -1
- package/dist/src/components/TimeOff/PolicySettings/PolicySettings.d.ts +1 -1
- package/dist/src/components/TimeOff/PolicySettings/PolicySettingsPresentation.d.ts +1 -1
- package/dist/src/components/TimeOff/PolicyTypeSelector/PolicyTypeSelector.d.ts +1 -1
- package/dist/src/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.d.ts +1 -1
- package/dist/src/components/TimeOff/TimeOffFlow/TimeOffFlow.d.ts +1 -1
- package/dist/src/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +12 -12
- package/dist/src/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.d.ts +1 -1
- package/dist/src/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.d.ts +1 -1
- package/dist/src/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.d.ts +1 -1
- package/dist/src/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.d.ts +1 -1
- package/dist/src/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.d.ts +1 -1
- package/dist/src/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.d.ts +1 -1
- package/dist/src/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.d.ts +1 -1
- package/dist/src/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.d.ts +1 -1
- package/dist/src/components/TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.d.ts +1 -1
- package/dist/src/components/TimeOff/ViewHolidayPolicyDetails/ViewHolidayPolicyDetails.d.ts +1 -1
- package/dist/src/components/TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.d.ts +1 -1
- package/dist/src/components/TimeOff/shared/EmployeeTable/EmployeeTable.d.ts +1 -1
- package/dist/src/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.d.ts +1 -1
- package/dist/src/components/index.d.ts +12 -0
- package/dist/src/contexts/ApiProvider/ApiProvider.d.ts +1 -1
- package/dist/src/contexts/ApiProvider/informationRequestEnumHook.d.ts +14 -0
- package/dist/src/contexts/ApiProvider/informationRequestEnumHook.test.d.ts +1 -0
- package/dist/src/contexts/LoadingIndicatorProvider/LoadingIndicatorProvider.d.ts +1 -1
- package/dist/src/contexts/LocaleProvider/LocaleProvider.d.ts +1 -1
- package/dist/src/contexts/ObservabilityProvider/ObservabilityProvider.d.ts +1 -1
- package/dist/src/contexts/ThemeProvider/customRender.d.ts +1 -1
- package/dist/src/contexts/UnstableFeaturesProvider/UnstableFeaturesProvider.d.ts +1 -1
- package/dist/src/contexts/UnstableFeaturesProvider/useUnstableFeature.d.ts +2 -0
- package/dist/src/helpers/dateFormatting.d.ts +2 -2
- package/dist/src/helpers/formattedStrings.d.ts +15 -0
- package/dist/src/i18n/en/common.json.d.ts +0 -1
- package/dist/src/i18n/types.d.ts +99 -7
- package/dist/src/models/external.d.ts +12 -0
- package/dist/src/partner-hook-utils/form/FormFieldsMetadataProvider.d.ts +1 -1
- package/dist/src/partner-hook-utils/form/SDKFormProvider.d.ts +1 -1
- package/dist/src/shared/constants.d.ts +16 -0
- package/dist/src/test-utils/renderWithProviders.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/types/sdkError.js +32 -21
- package/dist/types/sdkError.js.map +1 -1
- package/docs/guides/endpoint-inventory.json +59 -10
- package/package.json +11 -11
|
@@ -1,88 +1,106 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useForm as
|
|
3
|
-
import { zodResolver as
|
|
4
|
-
import { useTaxRequirementsUpdateStateMutation as
|
|
1
|
+
import { jsx as t, jsxs as V, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
+
import { useForm as K, FormProvider as M } from "react-hook-form";
|
|
3
|
+
import { zodResolver as z } from "@hookform/resolvers/zod";
|
|
4
|
+
import { useTaxRequirementsUpdateStateMutation as H } from "@gusto/embedded-api/react-query/taxRequirementsUpdateState";
|
|
5
5
|
import { useTaxRequirementsGetSuspense as N } from "@gusto/embedded-api/react-query/taxRequirementsGet";
|
|
6
6
|
import { z as b } from "zod";
|
|
7
7
|
import { useMemo as O } from "react";
|
|
8
8
|
import { useTranslation as G } from "react-i18next";
|
|
9
9
|
import { getUniqueRhfKey as d } from "../shared/rhfKey.js";
|
|
10
|
-
import { isRequirementApplicable as
|
|
11
|
-
import { prepareRequirements as
|
|
12
|
-
import { buildRequirementSchema as
|
|
13
|
-
import { stringifyRequirementValue as
|
|
10
|
+
import { isRequirementApplicable as I } from "../shared/applicableIf.js";
|
|
11
|
+
import { prepareRequirements as k } from "../shared/prepareRequirements.js";
|
|
12
|
+
import { buildRequirementSchema as L } from "../shared/buildRequirementSchema.js";
|
|
13
|
+
import { stringifyRequirementValue as X } from "../shared/requirementValue.js";
|
|
14
|
+
import { parseRequirementSetError as Y } from "../shared/requirementSetError.js";
|
|
14
15
|
import { Head as $ } from "./Head.js";
|
|
15
|
-
import { StateTaxesFormProvider as
|
|
16
|
-
import { Form as
|
|
17
|
-
import { Actions as
|
|
18
|
-
import { BaseComponent as
|
|
19
|
-
import { useI18n as
|
|
20
|
-
import { Flex as
|
|
16
|
+
import { StateTaxesFormProvider as J } from "./context.js";
|
|
17
|
+
import { Form as Q } from "./Form.js";
|
|
18
|
+
import { Actions as W } from "./Actions.js";
|
|
19
|
+
import { BaseComponent as Z } from "../../../Base/Base.js";
|
|
20
|
+
import { useI18n as ee } from "../../../../i18n/I18n.js";
|
|
21
|
+
import { Flex as re } from "../../../Common/Flex/Flex.js";
|
|
21
22
|
import { Form as te } from "../../../Common/Form/Form.js";
|
|
22
|
-
import { componentEvents as
|
|
23
|
-
import { useBase as
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
import { componentEvents as v } from "../../../../shared/constants.js";
|
|
24
|
+
import { useBase as oe } from "../../../Base/useBase.js";
|
|
25
|
+
import { SDKInternalError as ne } from "../../../../types/sdkError.js";
|
|
26
|
+
function Ue(m) {
|
|
27
|
+
return /* @__PURE__ */ t(Z, { ...m, children: /* @__PURE__ */ t(me, { ...m, children: m.children }) });
|
|
26
28
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
const { onEvent:
|
|
30
|
-
const f = {},
|
|
31
|
-
return p.forEach((
|
|
32
|
-
if (!
|
|
33
|
-
const r = d(
|
|
34
|
-
Object.keys(
|
|
29
|
+
function me({ companyId: m, state: a, className: F, children: y }) {
|
|
30
|
+
ee("Company.StateTaxes");
|
|
31
|
+
const { onEvent: R, baseSubmitHandler: P } = oe(), { t: h } = G("Company.StateTaxes", { keyPrefix: "form" }), { data: E } = N({ companyUuid: m, state: a }), c = E.taxRequirementsState, { mutateAsync: g, isPending: A } = H(), { dynamicSchema: C, defaultValues: U } = O(() => {
|
|
32
|
+
const f = {}, i = {}, p = c.requirementSets ?? [];
|
|
33
|
+
return p.forEach((u, e) => {
|
|
34
|
+
if (!u.key) return;
|
|
35
|
+
const r = d(u, e, p), o = k(u.requirements ?? []), { shape: n, defaults: S } = L(o, h);
|
|
36
|
+
Object.keys(n).length > 0 && (f[r] = b.object(n), i[r] = S);
|
|
35
37
|
}), {
|
|
36
38
|
dynamicSchema: b.object(f),
|
|
37
|
-
defaultValues:
|
|
39
|
+
defaultValues: i
|
|
38
40
|
};
|
|
39
|
-
}, [
|
|
40
|
-
resolver:
|
|
41
|
+
}, [c, h]), { control: j, ...x } = K({
|
|
42
|
+
resolver: z(C),
|
|
41
43
|
defaultValues: U
|
|
42
|
-
}),
|
|
43
|
-
await
|
|
44
|
-
const p =
|
|
44
|
+
}), w = async (f) => {
|
|
45
|
+
await P(f, async (i) => {
|
|
46
|
+
const p = i, l = c.requirementSets ?? [], u = l.map((e, r) => ({ requirementSet: e, setIndex: r })).filter(({ requirementSet: e, setIndex: r }) => {
|
|
45
47
|
if (!e.key) return !1;
|
|
46
|
-
const
|
|
47
|
-
return !!
|
|
48
|
+
const o = d(e, r, l);
|
|
49
|
+
return !!i[o];
|
|
48
50
|
}).map(({ requirementSet: e, setIndex: r }) => {
|
|
49
|
-
const
|
|
51
|
+
const o = e.key, n = d(e, r, l), S = i[n], T = k(e.requirements ?? []), D = T.map((s, q) => ({ req: s, index: q })).filter(({ req: s }) => I(s, n, p));
|
|
50
52
|
return {
|
|
51
|
-
state:
|
|
52
|
-
key:
|
|
53
|
+
state: a,
|
|
54
|
+
key: o,
|
|
53
55
|
effectiveFrom: e.effectiveFrom,
|
|
54
|
-
requirements: D.map(({ req:
|
|
55
|
-
key:
|
|
56
|
-
value:
|
|
57
|
-
|
|
56
|
+
requirements: D.map(({ req: s, index: q }) => ({
|
|
57
|
+
key: s.key,
|
|
58
|
+
value: X(
|
|
59
|
+
S[d(s, q, T)]
|
|
58
60
|
)
|
|
59
61
|
}))
|
|
60
62
|
};
|
|
61
63
|
});
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
try {
|
|
65
|
+
await g({
|
|
66
|
+
request: {
|
|
67
|
+
companyUuid: m,
|
|
68
|
+
requestBody: { requirementSets: u },
|
|
69
|
+
state: a
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
} catch (e) {
|
|
73
|
+
const r = Y(e);
|
|
74
|
+
if (!r) throw e;
|
|
75
|
+
const o = c.requirementSets?.find(
|
|
76
|
+
(n) => n.key === r.key
|
|
77
|
+
)?.label ?? r.key;
|
|
78
|
+
throw new ne(
|
|
79
|
+
h("errors.incompleteRequirementSet", {
|
|
80
|
+
section: o,
|
|
81
|
+
state: r.state ?? a
|
|
82
|
+
}),
|
|
83
|
+
"api_error"
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
R(v.COMPANY_STATE_TAX_UPDATED);
|
|
69
87
|
});
|
|
70
|
-
},
|
|
71
|
-
|
|
88
|
+
}, B = () => {
|
|
89
|
+
R(v.CANCEL);
|
|
72
90
|
};
|
|
73
|
-
return /* @__PURE__ */ t("section", { className:
|
|
74
|
-
|
|
91
|
+
return /* @__PURE__ */ t("section", { className: F, children: /* @__PURE__ */ t(M, { ...x, control: j, children: /* @__PURE__ */ t(te, { onSubmit: x.handleSubmit(w), children: /* @__PURE__ */ t(
|
|
92
|
+
J,
|
|
75
93
|
{
|
|
76
|
-
value: { stateTaxRequirements:
|
|
77
|
-
children: /* @__PURE__ */ t(
|
|
94
|
+
value: { stateTaxRequirements: c, isPending: A, state: a, handleCancel: B },
|
|
95
|
+
children: /* @__PURE__ */ t(re, { flexDirection: "column", gap: 32, children: y || /* @__PURE__ */ V(_, { children: [
|
|
78
96
|
/* @__PURE__ */ t($, {}),
|
|
79
|
-
/* @__PURE__ */ t(
|
|
80
|
-
/* @__PURE__ */ t(
|
|
97
|
+
/* @__PURE__ */ t(Q, {}),
|
|
98
|
+
/* @__PURE__ */ t(W, {})
|
|
81
99
|
] }) })
|
|
82
100
|
}
|
|
83
101
|
) }) }) });
|
|
84
102
|
}
|
|
85
103
|
export {
|
|
86
|
-
|
|
104
|
+
Ue as StateTaxesForm
|
|
87
105
|
};
|
|
88
106
|
//# sourceMappingURL=StateTaxesForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateTaxesForm.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useTaxRequirementsUpdateStateMutation } from '@gusto/embedded-api/react-query/taxRequirementsUpdateState'\nimport { useTaxRequirementsGetSuspense } from '@gusto/embedded-api/react-query/taxRequirementsGet'\nimport { z } from 'zod'\nimport { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { getUniqueRhfKey } from '../shared/rhfKey'\nimport { isRequirementApplicable, type StateTaxesFormValues } from '../shared/applicableIf'\nimport { prepareRequirements } from '../shared/prepareRequirements'\nimport { buildRequirementSchema } from '../shared/buildRequirementSchema'\nimport { stringifyRequirementValue } from '../shared/requirementValue'\nimport { Head } from './Head'\nimport { StateTaxesFormProvider } from './context'\nimport { Form } from './Form'\nimport { Actions } from './Actions'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useI18n } from '@/i18n/I18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { componentEvents } from '@/shared/constants'\nimport { useBase } from '@/components/Base'\n\n/**\n * Props for {@link StateTaxesForm}.\n *\n * @public\n */\nexport interface StateTaxesFormProps extends BaseComponentInterface<'Company.StateTaxes'> {\n /** The associated company identifier. */\n companyId: string\n /** Two-letter code of the state whose tax requirements are edited. */\n state: string\n}\n\n/**\n * Standalone form for editing a company's state tax requirements for a single state.\n *\n * @remarks\n * Lower-level building block used by {@link StateTaxes} for its edit view. Use directly when\n * you need full control over navigation between the list and edit views.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `company/stateTaxes/updated` | State tax requirements were saved successfully | Response from the update state tax requirements API |\n * | `CANCEL` | The user cancelled editing | — |\n *\n * @param props - {@link StateTaxesFormProps}\n * @returns The rendered state taxes edit form.\n * @public\n *\n * @example\n * ```tsx\n * import { CompanyOnboarding } from '@gusto/embedded-react-sdk'\n *\n * function MyComponent() {\n * return (\n * <CompanyOnboarding.StateTaxesForm\n * companyId=\"a007e1ab-3595-43c2-ab4b-af7a5af2e365\"\n * state=\"CA\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport function StateTaxesForm(props: StateTaxesFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, state, className, children }: StateTaxesFormProps) {\n useI18n('Company.StateTaxes')\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { data } = useTaxRequirementsGetSuspense({ companyUuid: companyId, state })\n const stateTaxRequirements = data.taxRequirementsState!\n\n const { mutateAsync: updateStateTax, isPending: isPendingUpdate } =\n useTaxRequirementsUpdateStateMutation()\n\n // Schema and default value generation\n const { dynamicSchema, defaultValues } = useMemo(() => {\n const schemaShape: Record<string, z.ZodObject> = {}\n const values: Partial<Record<string, Record<string, string | boolean | number | undefined>>> =\n {}\n const requirementSets = stateTaxRequirements.requirementSets ?? []\n\n //Looping through each requirement set. A single key (e.g. \"taxrates\") can appear more than\n //once when a future-dated set is already scheduled alongside the current one, so each set\n //needs its own disambiguated path — otherwise two visually distinct sections would silently\n //share one underlying form field.\n requirementSets.forEach((requirementSet, index) => {\n if (!requirementSet.key) return\n\n const requirementSetPath = getUniqueRhfKey(requirementSet, index, requirementSets)\n const preparedRequirements = prepareRequirements(requirementSet.requirements ?? [])\n const { shape, defaults } = buildRequirementSchema(preparedRequirements, t)\n\n if (Object.keys(shape).length > 0) {\n schemaShape[requirementSetPath] = z.object(shape)\n values[requirementSetPath] = defaults\n }\n })\n\n const finalSchema = z.object(schemaShape)\n\n // Return both the schema and the default values\n return {\n dynamicSchema: finalSchema,\n defaultValues: values as z.infer<typeof finalSchema>,\n }\n }, [stateTaxRequirements, t])\n\n // Infer the type from the schema\n type InferredFormInputs = z.infer<typeof dynamicSchema>\n\n const { control, ...methods } = useForm({\n resolver: zodResolver(dynamicSchema),\n defaultValues,\n })\n\n const onSubmit = async (formData: InferredFormInputs) => {\n await baseSubmitHandler(formData, async payload => {\n const formValues = payload as StateTaxesFormValues\n const allRequirementSets = stateTaxRequirements.requirementSets ?? []\n const requirementSets = allRequirementSets\n .map((requirementSet, setIndex) => ({ requirementSet, setIndex }))\n .filter(({ requirementSet, setIndex }) => {\n if (!requirementSet.key) return false\n const requirementSetPath = getUniqueRhfKey(requirementSet, setIndex, allRequirementSets)\n return Boolean(payload[requirementSetPath])\n })\n .map(({ requirementSet, setIndex }) => {\n const requirementSetKey = requirementSet.key as string\n const requirementSetPath = getUniqueRhfKey(requirementSet, setIndex, allRequirementSets)\n const payloadSet = payload[requirementSetPath] as Record<string, unknown>\n const preparedRequirements = prepareRequirements(requirementSet.requirements ?? [])\n\n const applicableRequirements = preparedRequirements\n .map((req, index) => ({ req, index }))\n .filter(({ req }) => isRequirementApplicable(req, requirementSetPath, formValues))\n\n return {\n state,\n key: requirementSetKey,\n effectiveFrom: requirementSet.effectiveFrom,\n requirements: applicableRequirements.map(({ req, index }) => ({\n key: req.key as string,\n value: stringifyRequirementValue(\n payloadSet[getUniqueRhfKey(req, index, preparedRequirements)],\n ),\n })),\n }\n })\n await updateStateTax({\n request: {\n companyUuid: companyId,\n requestBody: { requirementSets },\n state,\n },\n })\n onEvent(componentEvents.COMPANY_STATE_TAX_UPDATED)\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <StateTaxesFormProvider\n value={{ stateTaxRequirements, isPending: isPendingUpdate, state, handleCancel }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </StateTaxesFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n"],"names":["StateTaxesForm","props","jsx","BaseComponent","Root","companyId","state","className","children","useI18n","onEvent","baseSubmitHandler","useBase","t","useTranslation","data","useTaxRequirementsGetSuspense","stateTaxRequirements","updateStateTax","isPendingUpdate","useTaxRequirementsUpdateStateMutation","dynamicSchema","defaultValues","useMemo","schemaShape","values","requirementSets","requirementSet","index","requirementSetPath","getUniqueRhfKey","preparedRequirements","prepareRequirements","shape","defaults","buildRequirementSchema","z","control","methods","useForm","zodResolver","onSubmit","formData","payload","formValues","allRequirementSets","setIndex","requirementSetKey","payloadSet","applicableRequirements","req","isRequirementApplicable","stringifyRequirementValue","componentEvents","handleCancel","FormProvider","HtmlForm","StateTaxesFormProvider","Flex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,YAAA;AAAA,UAC9D,EACA;AAAA,QAAA;AAAA,MAEN,CAAC;AACH,YAAMb,EAAe;AAAA,QACnB,SAAS;AAAA,UACP,aAAab;AAAA,UACb,aAAa,EAAE,iBAAAqB,EAAA;AAAA,UACf,OAAApB;AAAA,QAAA;AAAA,MACF,CACD,GACDI,EAAQ2C,EAAgB,yBAAyB;AAAA,IACnD,CAAC;AAAA,EACH,GAEMC,IAAe,MAAM;AACzB,IAAA5C,EAAQ2C,EAAgB,MAAM;AAAA,EAChC;AAEA,SACE,gBAAAnD,EAAC,WAAA,EAAQ,WAAAK,GACP,UAAA,gBAAAL,EAACqD,KAAc,GAAGjB,GAAS,SAAAD,GACzB,UAAA,gBAAAnC,EAACsD,IAAA,EAAS,UAAUlB,EAAQ,aAAaG,CAAQ,GAC/C,UAAA,gBAAAvC;AAAA,IAACuD;AAAA,IAAA;AAAA,MACC,OAAO,EAAE,sBAAAxC,GAAsB,WAAWE,GAAiB,OAAAb,GAAO,cAAAgD,EAAA;AAAA,MAElE,UAAA,gBAAApD,EAACwD,MAAK,eAAc,UAAS,KAAK,IAC/B,UAAAlD,KAGC,gBAAAmD,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAA1D,EAAC2D,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA,EACF,CACF,GACF,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"StateTaxesForm.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useTaxRequirementsUpdateStateMutation } from '@gusto/embedded-api/react-query/taxRequirementsUpdateState'\nimport { useTaxRequirementsGetSuspense } from '@gusto/embedded-api/react-query/taxRequirementsGet'\nimport { z } from 'zod'\nimport { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { getUniqueRhfKey } from '../shared/rhfKey'\nimport { isRequirementApplicable, type StateTaxesFormValues } from '../shared/applicableIf'\nimport { prepareRequirements } from '../shared/prepareRequirements'\nimport { buildRequirementSchema } from '../shared/buildRequirementSchema'\nimport { stringifyRequirementValue } from '../shared/requirementValue'\nimport { parseRequirementSetError } from '../shared/requirementSetError'\nimport { Head } from './Head'\nimport { StateTaxesFormProvider } from './context'\nimport { Form } from './Form'\nimport { Actions } from './Actions'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useI18n } from '@/i18n/I18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { componentEvents } from '@/shared/constants'\nimport { useBase } from '@/components/Base'\nimport { SDKInternalError } from '@/types/sdkError'\n\n/**\n * Props for {@link StateTaxesForm}.\n *\n * @public\n */\nexport interface StateTaxesFormProps extends BaseComponentInterface<'Company.StateTaxes'> {\n /** The associated company identifier. */\n companyId: string\n /** Two-letter code of the state whose tax requirements are edited. */\n state: string\n}\n\n/**\n * Standalone form for editing a company's state tax requirements for a single state.\n *\n * @remarks\n * Lower-level building block used by {@link StateTaxes} for its edit view. Use directly when\n * you need full control over navigation between the list and edit views.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `company/stateTaxes/updated` | State tax requirements were saved successfully | Response from the update state tax requirements API |\n * | `CANCEL` | The user cancelled editing | — |\n *\n * @param props - {@link StateTaxesFormProps}\n * @returns The rendered state taxes edit form.\n * @public\n *\n * @example\n * ```tsx\n * import { CompanyOnboarding } from '@gusto/embedded-react-sdk'\n *\n * function MyComponent() {\n * return (\n * <CompanyOnboarding.StateTaxesForm\n * companyId=\"a007e1ab-3595-43c2-ab4b-af7a5af2e365\"\n * state=\"CA\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport function StateTaxesForm(props: StateTaxesFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, state, className, children }: StateTaxesFormProps) {\n useI18n('Company.StateTaxes')\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { data } = useTaxRequirementsGetSuspense({ companyUuid: companyId, state })\n const stateTaxRequirements = data.taxRequirementsState!\n\n const { mutateAsync: updateStateTax, isPending: isPendingUpdate } =\n useTaxRequirementsUpdateStateMutation()\n\n // Schema and default value generation\n const { dynamicSchema, defaultValues } = useMemo(() => {\n const schemaShape: Record<string, z.ZodObject> = {}\n const values: Partial<Record<string, Record<string, string | boolean | number | undefined>>> =\n {}\n const requirementSets = stateTaxRequirements.requirementSets ?? []\n\n //Looping through each requirement set. A single key (e.g. \"taxrates\") can appear more than\n //once when a future-dated set is already scheduled alongside the current one, so each set\n //needs its own disambiguated path — otherwise two visually distinct sections would silently\n //share one underlying form field.\n requirementSets.forEach((requirementSet, index) => {\n if (!requirementSet.key) return\n\n const requirementSetPath = getUniqueRhfKey(requirementSet, index, requirementSets)\n const preparedRequirements = prepareRequirements(requirementSet.requirements ?? [])\n const { shape, defaults } = buildRequirementSchema(preparedRequirements, t)\n\n if (Object.keys(shape).length > 0) {\n schemaShape[requirementSetPath] = z.object(shape)\n values[requirementSetPath] = defaults\n }\n })\n\n const finalSchema = z.object(schemaShape)\n\n // Return both the schema and the default values\n return {\n dynamicSchema: finalSchema,\n defaultValues: values as z.infer<typeof finalSchema>,\n }\n }, [stateTaxRequirements, t])\n\n // Infer the type from the schema\n type InferredFormInputs = z.infer<typeof dynamicSchema>\n\n const { control, ...methods } = useForm({\n resolver: zodResolver(dynamicSchema),\n defaultValues,\n })\n\n const onSubmit = async (formData: InferredFormInputs) => {\n await baseSubmitHandler(formData, async payload => {\n const formValues = payload as StateTaxesFormValues\n const allRequirementSets = stateTaxRequirements.requirementSets ?? []\n const requirementSets = allRequirementSets\n .map((requirementSet, setIndex) => ({ requirementSet, setIndex }))\n .filter(({ requirementSet, setIndex }) => {\n if (!requirementSet.key) return false\n const requirementSetPath = getUniqueRhfKey(requirementSet, setIndex, allRequirementSets)\n return Boolean(payload[requirementSetPath])\n })\n .map(({ requirementSet, setIndex }) => {\n const requirementSetKey = requirementSet.key as string\n const requirementSetPath = getUniqueRhfKey(requirementSet, setIndex, allRequirementSets)\n const payloadSet = payload[requirementSetPath] as Record<string, unknown>\n const preparedRequirements = prepareRequirements(requirementSet.requirements ?? [])\n\n const applicableRequirements = preparedRequirements\n .map((req, index) => ({ req, index }))\n .filter(({ req }) => isRequirementApplicable(req, requirementSetPath, formValues))\n\n return {\n state,\n key: requirementSetKey,\n effectiveFrom: requirementSet.effectiveFrom,\n requirements: applicableRequirements.map(({ req, index }) => ({\n key: req.key as string,\n value: stringifyRequirementValue(\n payloadSet[getUniqueRhfKey(req, index, preparedRequirements)],\n ),\n })),\n }\n })\n try {\n await updateStateTax({\n request: {\n companyUuid: companyId,\n requestBody: { requirementSets },\n state,\n },\n })\n } catch (error) {\n const requirementSetError = parseRequirementSetError(error)\n if (!requirementSetError) throw error\n\n const section =\n stateTaxRequirements.requirementSets?.find(\n requirementSet => requirementSet.key === requirementSetError.key,\n )?.label ?? requirementSetError.key\n throw new SDKInternalError(\n t('errors.incompleteRequirementSet', {\n section,\n state: requirementSetError.state ?? state,\n }),\n 'api_error',\n )\n }\n onEvent(componentEvents.COMPANY_STATE_TAX_UPDATED)\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <StateTaxesFormProvider\n value={{ stateTaxRequirements, isPending: isPendingUpdate, state, handleCancel }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </StateTaxesFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n"],"names":["StateTaxesForm","props","jsx","BaseComponent","Root","companyId","state","className","children","useI18n","onEvent","baseSubmitHandler","useBase","t","useTranslation","data","useTaxRequirementsGetSuspense","stateTaxRequirements","updateStateTax","isPendingUpdate","useTaxRequirementsUpdateStateMutation","dynamicSchema","defaultValues","useMemo","schemaShape","values","requirementSets","requirementSet","index","requirementSetPath","getUniqueRhfKey","preparedRequirements","prepareRequirements","shape","defaults","buildRequirementSchema","z","control","methods","useForm","zodResolver","onSubmit","formData","payload","formValues","allRequirementSets","setIndex","requirementSetKey","payloadSet","applicableRequirements","req","isRequirementApplicable","stringifyRequirementValue","error","requirementSetError","parseRequirementSetError","section","SDKInternalError","componentEvents","handleCancel","FormProvider","HtmlForm","StateTaxesFormProvider","Flex","jsxs","Fragment","Head","Form","Actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAsEO,SAASA,GAAeC,GAA4B;AACzD,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,MAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,GAAK,EAAE,WAAAC,GAAW,OAAAC,GAAO,WAAAC,GAAW,UAAAC,KAAiC;AAC5E,EAAAC,GAAQ,oBAAoB;AAC5B,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,GAAA,GACjC,EAAE,GAAAC,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,MAAAC,MAASC,EAA8B,EAAE,aAAaX,GAAW,OAAAC,GAAO,GAC1EW,IAAuBF,EAAK,sBAE5B,EAAE,aAAaG,GAAgB,WAAWC,EAAA,IAC9CC,EAAA,GAGI,EAAE,eAAAC,GAAe,eAAAC,EAAA,IAAkBC,EAAQ,MAAM;AACrD,UAAMC,IAA2C,CAAA,GAC3CC,IACJ,CAAA,G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EA,SACE,gBAAAxD,EAAC,WAAA,EAAQ,WAAAK,GACP,UAAA,gBAAAL,EAAC0D,KAAc,GAAGtB,GAAS,SAAAD,GACzB,UAAA,gBAAAnC,EAAC2D,IAAA,EAAS,UAAUvB,EAAQ,aAAaG,CAAQ,GAC/C,UAAA,gBAAAvC;AAAA,IAAC4D;AAAA,IAAA;AAAA,MACC,OAAO,EAAE,sBAAA7C,GAAsB,WAAWE,GAAiB,OAAAb,GAAO,cAAAqD,EAAA;AAAA,MAElE,UAAA,gBAAAzD,EAAC6D,MAAK,eAAc,UAAS,KAAK,IAC/B,UAAAvD,KAGC,gBAAAwD,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAA/D,EAACgE,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA,EACF,CACF,GACF,GACF;AAEJ;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { UnprocessableEntityError as n } from "@gusto/embedded-api/models/errors/unprocessableentityerror";
|
|
2
|
+
function o(e) {
|
|
3
|
+
return typeof e == "object" && e !== null && "key" in e && typeof e.key == "string";
|
|
4
|
+
}
|
|
5
|
+
function i(e) {
|
|
6
|
+
if (!(e instanceof n)) return null;
|
|
7
|
+
const t = e.errors.find(
|
|
8
|
+
(r) => r.errorKey === "requirement_sets" && r.category === "nested_errors"
|
|
9
|
+
);
|
|
10
|
+
return !t || !o(t.metadata) ? null : { key: t.metadata.key, state: t.metadata.state };
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
i as parseRequirementSetError
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=requirementSetError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requirementSetError.js","sources":["../../../../../src/components/Company/StateTaxes/shared/requirementSetError.ts"],"sourcesContent":["import { UnprocessableEntityError } from '@gusto/embedded-api/models/errors/unprocessableentityerror'\n\nfunction hasMetadataKey(metadata: unknown): metadata is { key: string; state?: string } {\n return (\n typeof metadata === 'object' &&\n metadata !== null &&\n 'key' in metadata &&\n typeof (metadata as { key: unknown }).key === 'string'\n )\n}\n\n/**\n * `{ key, state }` identifying which requirement set an incomplete-requirement-set error targets.\n *\n * @internal\n */\nexport interface RequirementSetError {\n key: string\n state?: string\n}\n\n/**\n * Extracts `{ key, state }` from a tax-requirements-update error shaped as\n * `{ errorKey: \"requirement_sets\", category: \"nested_errors\", metadata: { key, state } }` —\n * the update endpoint's response when a requirement set (e.g. \"registrations\") was submitted\n * incomplete. Returns `null` for any other error shape.\n *\n * @internal\n */\nexport function parseRequirementSetError(error: unknown): RequirementSetError | null {\n if (!(error instanceof UnprocessableEntityError)) return null\n\n const match = error.errors.find(\n err => err.errorKey === 'requirement_sets' && err.category === 'nested_errors',\n )\n if (!match || !hasMetadataKey(match.metadata)) return null\n\n return { key: match.metadata.key, state: match.metadata.state }\n}\n"],"names":["hasMetadataKey","metadata","parseRequirementSetError","error","UnprocessableEntityError","match","err"],"mappings":";AAEA,SAASA,EAAeC,GAAgE;AACtF,SACE,OAAOA,KAAa,YACpBA,MAAa,QACb,SAASA,KACT,OAAQA,EAA8B,OAAQ;AAElD;AAoBO,SAASC,EAAyBC,GAA4C;AACnF,MAAI,EAAEA,aAAiBC,GAA2B,QAAO;AAEzD,QAAMC,IAAQF,EAAM,OAAO;AAAA,IACzB,CAAAG,MAAOA,EAAI,aAAa,sBAAsBA,EAAI,aAAa;AAAA,EAAA;AAEjE,SAAI,CAACD,KAAS,CAACL,EAAeK,EAAM,QAAQ,IAAU,OAE/C,EAAE,KAAKA,EAAM,SAAS,KAAK,OAAOA,EAAM,SAAS,MAAA;AAC1D;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PaySchedule as r } from "../PaySchedule/management/PaySchedule.js";
|
|
2
|
+
import { PayScheduleAssignment as t } from "../PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.js";
|
|
3
|
+
export {
|
|
4
|
+
r as PaySchedule,
|
|
5
|
+
t as PayScheduleAssignment
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=companyManagement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"companyManagement.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -2,31 +2,31 @@ import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef as F, useState as o, useEffect as G } from "react";
|
|
3
3
|
import { useForm as R, FormProvider as U } from "react-hook-form";
|
|
4
4
|
import { useTranslation as z } from "react-i18next";
|
|
5
|
-
import { z as
|
|
5
|
+
import { z as C } from "zod";
|
|
6
6
|
import { zodResolver as H } from "@hookform/resolvers/zod";
|
|
7
7
|
import a from "./GrossUpModal.module.scss.js";
|
|
8
|
-
import { Flex as
|
|
9
|
-
import { ActionsLayout as
|
|
8
|
+
import { Flex as L } from "../../Common/Flex/Flex.js";
|
|
9
|
+
import { ActionsLayout as j } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
10
10
|
import "react-error-boundary";
|
|
11
11
|
import "@tanstack/react-query";
|
|
12
|
-
import { useBase as
|
|
12
|
+
import { useBase as k } from "../../Base/useBase.js";
|
|
13
13
|
import "@gusto/embedded-api/models/errors/apierror";
|
|
14
14
|
import "@gusto/embedded-api/models/errors/gustoembeddederror";
|
|
15
15
|
import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
16
16
|
import "@gusto/embedded-api/models/errors/unprocessableentityerror";
|
|
17
17
|
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
18
|
-
import { formatNumberAsCurrency as
|
|
18
|
+
import { formatNumberAsCurrency as B } from "../../../helpers/formattedStrings.js";
|
|
19
19
|
import "../../../shared/constants.js";
|
|
20
|
-
import { useComponentContext as
|
|
20
|
+
import { useComponentContext as V } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
21
21
|
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
22
|
-
import { useI18n as
|
|
22
|
+
import { useI18n as D } from "../../../i18n/I18n.js";
|
|
23
23
|
import { NumberInputField as E } from "../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
24
|
-
const T =
|
|
25
|
-
netPay:
|
|
24
|
+
const T = C.object({
|
|
25
|
+
netPay: C.number().positive()
|
|
26
26
|
});
|
|
27
|
-
function ue({ isOpen: n, onCalculateGrossUp:
|
|
28
|
-
|
|
29
|
-
const { t: r } = z("Payroll.GrossUpModal"), { Modal:
|
|
27
|
+
function ue({ isOpen: n, onCalculateGrossUp: w, onApply: P, onCancel: p }) {
|
|
28
|
+
D("Payroll.GrossUpModal");
|
|
29
|
+
const { t: r } = z("Payroll.GrossUpModal"), { Modal: x, Heading: u, Text: i, Button: c, Alert: f } = V(), { baseSubmitHandler: y } = k(), A = F(null), [l, m] = o(null), [h, d] = o(null), [M, g] = o(!1), [N, v] = o(!1), s = R({
|
|
30
30
|
resolver: H(T),
|
|
31
31
|
// Start blank rather than 0: 0 is not a valid net amount, and a leading 0
|
|
32
32
|
// in the field means typing an amount produces values like "0350".
|
|
@@ -36,22 +36,22 @@ function ue({ isOpen: n, onCalculateGrossUp: P, onApply: x, onCancel: p }) {
|
|
|
36
36
|
n || (s.reset(), m(null), d(null));
|
|
37
37
|
}, [n, s.reset]);
|
|
38
38
|
const I = async (S) => {
|
|
39
|
-
d(null), m(null),
|
|
39
|
+
d(null), m(null), g(!0), await y(null, async () => {
|
|
40
40
|
try {
|
|
41
|
-
const
|
|
42
|
-
|
|
41
|
+
const b = await w(S.netPay);
|
|
42
|
+
b ? m(b) : d(r("errorMessage"));
|
|
43
43
|
} finally {
|
|
44
|
-
|
|
44
|
+
g(!1);
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
};
|
|
48
48
|
return /* @__PURE__ */ e(
|
|
49
|
-
|
|
49
|
+
x,
|
|
50
50
|
{
|
|
51
51
|
isOpen: n,
|
|
52
52
|
onClose: p,
|
|
53
|
-
containerRef:
|
|
54
|
-
footer: /* @__PURE__ */ t(
|
|
53
|
+
containerRef: A,
|
|
54
|
+
footer: /* @__PURE__ */ t(j, { children: [
|
|
55
55
|
/* @__PURE__ */ e(
|
|
56
56
|
c,
|
|
57
57
|
{
|
|
@@ -60,7 +60,7 @@ function ue({ isOpen: n, onCalculateGrossUp: P, onApply: x, onCancel: p }) {
|
|
|
60
60
|
onClick: async () => {
|
|
61
61
|
l && (v(!0), await y(null, async () => {
|
|
62
62
|
try {
|
|
63
|
-
await
|
|
63
|
+
await P(l);
|
|
64
64
|
} finally {
|
|
65
65
|
v(!1);
|
|
66
66
|
}
|
|
@@ -80,7 +80,7 @@ function ue({ isOpen: n, onCalculateGrossUp: P, onApply: x, onCancel: p }) {
|
|
|
80
80
|
/* @__PURE__ */ t("div", { className: a.content, children: [
|
|
81
81
|
h && /* @__PURE__ */ e("div", { className: a.alert, children: /* @__PURE__ */ e(f, { label: h, status: "error", disableScrollIntoView: !0 }) }),
|
|
82
82
|
/* @__PURE__ */ e("div", { className: a.alert, children: /* @__PURE__ */ e(f, { label: r("warning"), status: "warning", disableScrollIntoView: !0 }) }),
|
|
83
|
-
/* @__PURE__ */ t(
|
|
83
|
+
/* @__PURE__ */ t(L, { flexDirection: "row", gap: 8, alignItems: "flex-end", children: [
|
|
84
84
|
/* @__PURE__ */ e(
|
|
85
85
|
E,
|
|
86
86
|
{
|
|
@@ -98,15 +98,15 @@ function ue({ isOpen: n, onCalculateGrossUp: P, onApply: x, onCancel: p }) {
|
|
|
98
98
|
{
|
|
99
99
|
variant: "secondary",
|
|
100
100
|
className: a.calculateButton,
|
|
101
|
-
|
|
101
|
+
isLoading: M,
|
|
102
102
|
onClick: s.handleSubmit(I),
|
|
103
|
-
children: r(
|
|
103
|
+
children: r("calculateCta")
|
|
104
104
|
}
|
|
105
105
|
)
|
|
106
106
|
] }),
|
|
107
107
|
l ? /* @__PURE__ */ t("div", { className: a.result, children: [
|
|
108
108
|
/* @__PURE__ */ e(i, { size: "sm", variant: "supporting", weight: "semibold", children: r("grossPayResult") }),
|
|
109
|
-
/* @__PURE__ */ e(u, { as: "h3", children:
|
|
109
|
+
/* @__PURE__ */ e(u, { as: "h3", children: B(parseFloat(l)) })
|
|
110
110
|
] }) : /* @__PURE__ */ e(i, { size: "sm", variant: "supporting", children: r("applyHint") })
|
|
111
111
|
] })
|
|
112
112
|
] })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GrossUpModal.js","sources":["../../../../src/components/Payroll/GrossUpModal/GrossUpModal.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport type { GrossUpModalProps } from './GrossUpModalTypes'\nimport styles from './GrossUpModal.module.scss'\nimport { ActionsLayout, Flex, NumberInputField } from '@/components/Common'\nimport { useBase } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\n\nconst GrossUpFormSchema = z.object({\n netPay: z.number().positive(),\n})\n\ntype GrossUpFormValues = z.infer<typeof GrossUpFormSchema>\n\n/** @internal */\nexport function GrossUpModal({ isOpen, onCalculateGrossUp, onApply, onCancel }: GrossUpModalProps) {\n useI18n('Payroll.GrossUpModal')\n const { t } = useTranslation('Payroll.GrossUpModal')\n const { Modal, Heading, Text, Button, Alert } = useComponentContext()\n const { baseSubmitHandler } = useBase()\n const modalContainerRef = useRef<HTMLDivElement>(null)\n\n const [calculatedGrossUp, setCalculatedGrossUp] = useState<string | null>(null)\n const [errorMessage, setErrorMessage] = useState<string | null>(null)\n const [isCalculating, setIsCalculating] = useState(false)\n const [isApplying, setIsApplying] = useState(false)\n\n const formHandlers = useForm<GrossUpFormValues>({\n resolver: zodResolver(GrossUpFormSchema),\n // Start blank rather than 0: 0 is not a valid net amount, and a leading 0\n // in the field means typing an amount produces values like \"0350\".\n defaultValues: {},\n })\n\n useEffect(() => {\n if (!isOpen) {\n formHandlers.reset()\n setCalculatedGrossUp(null)\n setErrorMessage(null)\n }\n }, [isOpen, formHandlers.reset])\n\n const handleCalculate = async (data: GrossUpFormValues) => {\n setErrorMessage(null)\n setCalculatedGrossUp(null)\n setIsCalculating(true)\n\n await baseSubmitHandler(null, async () => {\n try {\n const result = await onCalculateGrossUp(data.netPay)\n\n if (result) {\n setCalculatedGrossUp(result)\n } else {\n setErrorMessage(t('errorMessage'))\n }\n } finally {\n setIsCalculating(false)\n }\n })\n }\n\n const handleApply = async () => {\n if (calculatedGrossUp) {\n setIsApplying(true)\n await baseSubmitHandler(null, async () => {\n try {\n await onApply(calculatedGrossUp)\n } finally {\n setIsApplying(false)\n }\n })\n }\n }\n\n return (\n <Modal\n isOpen={isOpen}\n onClose={onCancel}\n containerRef={modalContainerRef}\n footer={\n <ActionsLayout>\n <Button\n variant=\"primary\"\n isDisabled={!calculatedGrossUp}\n onClick={handleApply}\n isLoading={isApplying}\n >\n {t('applyCta')}\n </Button>\n <Button variant=\"secondary\" onClick={onCancel}>\n {t('cancelCta')}\n </Button>\n </ActionsLayout>\n }\n >\n <FormProvider {...formHandlers}>\n <div className={styles.header}>\n <Heading as=\"h2\" styledAs=\"h3\">\n {t('title')}\n </Heading>\n <Text variant=\"supporting\" as=\"p\">\n {t('description')}\n </Text>\n </div>\n\n <div className={styles.content}>\n {errorMessage && (\n <div className={styles.alert}>\n <Alert label={errorMessage} status=\"error\" disableScrollIntoView />\n </div>\n )}\n\n <div className={styles.alert}>\n <Alert label={t('warning')} status=\"warning\" disableScrollIntoView />\n </div>\n\n {/* Bottom-align on the row itself: the .calculateButton align-self\n rule below only targets the default (react-aria) adapter, so in\n other adapters the button otherwise falls back to flex-start. */}\n <Flex flexDirection=\"row\" gap={8} alignItems=\"flex-end\">\n <NumberInputField\n name=\"netPay\"\n label={t('netPayLabel')}\n format=\"currency\"\n adornmentStart=\"$\"\n errorMessage={t('validations.netPay')}\n min={0}\n isRequired\n />\n <Button\n variant=\"secondary\"\n className={styles.calculateButton}\n
|
|
1
|
+
{"version":3,"file":"GrossUpModal.js","sources":["../../../../src/components/Payroll/GrossUpModal/GrossUpModal.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport type { GrossUpModalProps } from './GrossUpModalTypes'\nimport styles from './GrossUpModal.module.scss'\nimport { ActionsLayout, Flex, NumberInputField } from '@/components/Common'\nimport { useBase } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\n\nconst GrossUpFormSchema = z.object({\n netPay: z.number().positive(),\n})\n\ntype GrossUpFormValues = z.infer<typeof GrossUpFormSchema>\n\n/** @internal */\nexport function GrossUpModal({ isOpen, onCalculateGrossUp, onApply, onCancel }: GrossUpModalProps) {\n useI18n('Payroll.GrossUpModal')\n const { t } = useTranslation('Payroll.GrossUpModal')\n const { Modal, Heading, Text, Button, Alert } = useComponentContext()\n const { baseSubmitHandler } = useBase()\n const modalContainerRef = useRef<HTMLDivElement>(null)\n\n const [calculatedGrossUp, setCalculatedGrossUp] = useState<string | null>(null)\n const [errorMessage, setErrorMessage] = useState<string | null>(null)\n const [isCalculating, setIsCalculating] = useState(false)\n const [isApplying, setIsApplying] = useState(false)\n\n const formHandlers = useForm<GrossUpFormValues>({\n resolver: zodResolver(GrossUpFormSchema),\n // Start blank rather than 0: 0 is not a valid net amount, and a leading 0\n // in the field means typing an amount produces values like \"0350\".\n defaultValues: {},\n })\n\n useEffect(() => {\n if (!isOpen) {\n formHandlers.reset()\n setCalculatedGrossUp(null)\n setErrorMessage(null)\n }\n }, [isOpen, formHandlers.reset])\n\n const handleCalculate = async (data: GrossUpFormValues) => {\n setErrorMessage(null)\n setCalculatedGrossUp(null)\n setIsCalculating(true)\n\n await baseSubmitHandler(null, async () => {\n try {\n const result = await onCalculateGrossUp(data.netPay)\n\n if (result) {\n setCalculatedGrossUp(result)\n } else {\n setErrorMessage(t('errorMessage'))\n }\n } finally {\n setIsCalculating(false)\n }\n })\n }\n\n const handleApply = async () => {\n if (calculatedGrossUp) {\n setIsApplying(true)\n await baseSubmitHandler(null, async () => {\n try {\n await onApply(calculatedGrossUp)\n } finally {\n setIsApplying(false)\n }\n })\n }\n }\n\n return (\n <Modal\n isOpen={isOpen}\n onClose={onCancel}\n containerRef={modalContainerRef}\n footer={\n <ActionsLayout>\n <Button\n variant=\"primary\"\n isDisabled={!calculatedGrossUp}\n onClick={handleApply}\n isLoading={isApplying}\n >\n {t('applyCta')}\n </Button>\n <Button variant=\"secondary\" onClick={onCancel}>\n {t('cancelCta')}\n </Button>\n </ActionsLayout>\n }\n >\n <FormProvider {...formHandlers}>\n <div className={styles.header}>\n <Heading as=\"h2\" styledAs=\"h3\">\n {t('title')}\n </Heading>\n <Text variant=\"supporting\" as=\"p\">\n {t('description')}\n </Text>\n </div>\n\n <div className={styles.content}>\n {errorMessage && (\n <div className={styles.alert}>\n <Alert label={errorMessage} status=\"error\" disableScrollIntoView />\n </div>\n )}\n\n <div className={styles.alert}>\n <Alert label={t('warning')} status=\"warning\" disableScrollIntoView />\n </div>\n\n {/* Bottom-align on the row itself: the .calculateButton align-self\n rule below only targets the default (react-aria) adapter, so in\n other adapters the button otherwise falls back to flex-start. */}\n <Flex flexDirection=\"row\" gap={8} alignItems=\"flex-end\">\n <NumberInputField\n name=\"netPay\"\n label={t('netPayLabel')}\n format=\"currency\"\n adornmentStart=\"$\"\n errorMessage={t('validations.netPay')}\n min={0}\n isRequired\n />\n <Button\n variant=\"secondary\"\n className={styles.calculateButton}\n isLoading={isCalculating}\n onClick={formHandlers.handleSubmit(handleCalculate)}\n >\n {t('calculateCta')}\n </Button>\n </Flex>\n\n {calculatedGrossUp ? (\n <div className={styles.result}>\n <Text size=\"sm\" variant=\"supporting\" weight=\"semibold\">\n {t('grossPayResult')}\n </Text>\n <Heading as=\"h3\">{formatNumberAsCurrency(parseFloat(calculatedGrossUp))}</Heading>\n </div>\n ) : (\n <Text size=\"sm\" variant=\"supporting\">\n {t('applyHint')}\n </Text>\n )}\n </div>\n </FormProvider>\n </Modal>\n )\n}\n"],"names":["GrossUpFormSchema","z","GrossUpModal","isOpen","onCalculateGrossUp","onApply","onCancel","useI18n","t","useTranslation","Modal","Heading","Text","Button","Alert","useComponentContext","baseSubmitHandler","useBase","modalContainerRef","useRef","calculatedGrossUp","setCalculatedGrossUp","useState","errorMessage","setErrorMessage","isCalculating","setIsCalculating","isApplying","setIsApplying","formHandlers","useForm","zodResolver","useEffect","handleCalculate","data","result","jsx","ActionsLayout","jsxs","FormProvider","styles","Flex","NumberInputField"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAMA,IAAoBC,EAAE,OAAO;AAAA,EACjC,QAAQA,EAAE,OAAA,EAAS,SAAA;AACrB,CAAC;AAKM,SAASC,GAAa,EAAE,QAAAC,GAAQ,oBAAAC,GAAoB,SAAAC,GAAS,UAAAC,KAA+B;AACjG,EAAAC,EAAQ,sBAAsB;AAC9B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,sBAAsB,GAC7C,EAAE,OAAAC,GAAO,SAAAC,GAAS,MAAAC,GAAM,QAAAC,GAAQ,OAAAC,EAAA,IAAUC,EAAA,GAC1C,EAAE,mBAAAC,EAAA,IAAsBC,EAAA,GACxBC,IAAoBC,EAAuB,IAAI,GAE/C,CAACC,GAAmBC,CAAoB,IAAIC,EAAwB,IAAI,GACxE,CAACC,GAAcC,CAAe,IAAIF,EAAwB,IAAI,GAC9D,CAACG,GAAeC,CAAgB,IAAIJ,EAAS,EAAK,GAClD,CAAC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B,GACF;AAAA,UAECb,IACC,gBAAAkB,EAAC,OAAA,EAAI,WAAWE,EAAO,QACrB,UAAA;AAAA,YAAA,gBAAAJ,EAACxB,GAAA,EAAK,MAAK,MAAK,SAAQ,cAAa,QAAO,YACzC,UAAAJ,EAAE,gBAAgB,EAAA,CACrB;AAAA,YACA,gBAAA4B,EAACzB,KAAQ,IAAG,MAAM,YAAuB,WAAWS,CAAiB,CAAC,EAAA,CAAE;AAAA,UAAA,EAAA,CAC1E,sBAECR,GAAA,EAAK,MAAK,MAAK,SAAQ,cACrB,UAAAJ,EAAE,WAAW,EAAA,CAChB;AAAA,QAAA,EAAA,CAEJ;AAAA,MAAA,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,108 +1,101 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useTranslation as
|
|
1
|
+
import { jsx as o, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { useState as I, useCallback as u } from "react";
|
|
3
|
+
import { useTranslation as S } from "react-i18next";
|
|
4
4
|
import C from "classnames";
|
|
5
|
-
import { usePayrollsGetBlockersSuspense as
|
|
6
|
-
import {
|
|
7
|
-
import { useInformationRequestsGetInformationRequestsSuspense as _ } from "@gusto/embedded-api/react-query/informationRequestsGetInformationRequests";
|
|
8
|
-
import { InformationRequestStatus as F } from "@gusto/embedded-api/models/components/informationrequest";
|
|
9
|
-
import { getBlockerTranslationKeys as K } from "../payrollHelpers.js";
|
|
5
|
+
import { usePayrollsGetBlockersSuspense as v } from "@gusto/embedded-api/react-query/payrollsGetBlockers";
|
|
6
|
+
import { PENDING_RECOVERY_CASE_BLOCKER_KEY as K, PENDING_INFORMATION_REQUEST_BLOCKER_KEY as w, getBlockerTranslationKeys as L } from "../payrollHelpers.js";
|
|
10
7
|
import B from "./PayrollBlockerList.module.scss.js";
|
|
11
|
-
import { useComponentContext as
|
|
12
|
-
import { FlexItem as
|
|
13
|
-
import { DataView as
|
|
14
|
-
import { useDataView as
|
|
15
|
-
import { useComponentDictionary as
|
|
8
|
+
import { useComponentContext as V } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
|
+
import { FlexItem as F, Flex as i } from "../../../Common/Flex/Flex.js";
|
|
10
|
+
import { DataView as M } from "../../../Common/DataView/DataView.js";
|
|
11
|
+
import { useDataView as q } from "../../../Common/DataView/useDataView.js";
|
|
12
|
+
import { useComponentDictionary as G, useI18n as U } from "../../../../i18n/I18n.js";
|
|
16
13
|
import { RecoveryCases as Y } from "../../RecoveryCases/RecoveryCases.js";
|
|
17
|
-
import { BaseComponent as
|
|
14
|
+
import { BaseComponent as j } from "../../../Base/Base.js";
|
|
18
15
|
import "../../../Base/useBase.js";
|
|
19
|
-
import { recoveryCasesEvents as
|
|
20
|
-
import { InformationRequestsFlow as
|
|
21
|
-
function
|
|
22
|
-
return /* @__PURE__ */ o(
|
|
16
|
+
import { recoveryCasesEvents as Q, informationRequestEvents as $ } from "../../../../shared/constants.js";
|
|
17
|
+
import { InformationRequestsFlow as H } from "../../../InformationRequests/InformationRequests.js";
|
|
18
|
+
function pe(l) {
|
|
19
|
+
return /* @__PURE__ */ o(j, { ...l, children: /* @__PURE__ */ o(z, { ...l, children: l.children }) });
|
|
23
20
|
}
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
const { t: r } =
|
|
21
|
+
function z({ className: l, companyId: a, dictionary: D, onEvent: f }) {
|
|
22
|
+
G("Payroll.PayrollBlocker", D), U("Payroll.PayrollBlocker");
|
|
23
|
+
const { t: r } = S("Payroll.PayrollBlocker"), { Button: _, Text: n, Heading: b, Alert: g } = V(), [x, p] = I({
|
|
27
24
|
id: 0,
|
|
28
25
|
alerts: []
|
|
29
|
-
}),
|
|
30
|
-
|
|
26
|
+
}), A = u((e) => {
|
|
27
|
+
p((t) => ({
|
|
31
28
|
...t,
|
|
32
|
-
alerts: t.alerts.filter((
|
|
29
|
+
alerts: t.alerts.filter((s) => s.id !== e)
|
|
33
30
|
}));
|
|
34
|
-
}, []), c =
|
|
35
|
-
|
|
31
|
+
}, []), c = u((e) => {
|
|
32
|
+
p((t) => ({
|
|
36
33
|
id: t.id + 1,
|
|
37
34
|
alerts: [{ id: t.id, type: e }, ...t.alerts]
|
|
38
35
|
}));
|
|
39
|
-
}, []),
|
|
36
|
+
}, []), h = u(
|
|
40
37
|
(e, t) => {
|
|
41
|
-
e ===
|
|
38
|
+
e === Q.RECOVERY_CASE_RESUBMIT_DONE && c("recoveryCaseResubmitted"), e === $.INFORMATION_REQUEST_FORM_DONE && c("informationRequestResponded"), f(e, t);
|
|
42
39
|
},
|
|
43
|
-
[
|
|
44
|
-
), { data:
|
|
45
|
-
companyUuid:
|
|
46
|
-
}),
|
|
47
|
-
|
|
48
|
-
}), { data: q } = _({
|
|
49
|
-
companyUuid: n
|
|
50
|
-
}), y = (A.payrollBlockers ?? []).map((e) => {
|
|
51
|
-
const t = e.key, l = K(t), I = r(l.titleKey, {
|
|
40
|
+
[f, c]
|
|
41
|
+
), { data: N } = v({
|
|
42
|
+
companyUuid: a
|
|
43
|
+
}), m = N.payrollBlockers ?? [], y = m.map((e) => {
|
|
44
|
+
const t = e.key, s = L(t), P = r(s.titleKey, {
|
|
52
45
|
defaultValue: r("genericBlockerTitle")
|
|
53
|
-
}),
|
|
46
|
+
}), T = r(s.descriptionKey, {
|
|
54
47
|
defaultValue: e.message || r("defaultBlockerDescription")
|
|
55
48
|
});
|
|
56
49
|
return {
|
|
57
50
|
id: t,
|
|
58
|
-
title:
|
|
59
|
-
description:
|
|
51
|
+
title: P,
|
|
52
|
+
description: T
|
|
60
53
|
};
|
|
61
|
-
}),
|
|
62
|
-
(e) => e.
|
|
63
|
-
),
|
|
64
|
-
(e) => e.
|
|
65
|
-
),
|
|
54
|
+
}), k = m.some(
|
|
55
|
+
(e) => e.key === K
|
|
56
|
+
), E = m.some(
|
|
57
|
+
(e) => e.key === w
|
|
58
|
+
), O = q({
|
|
66
59
|
data: y,
|
|
67
60
|
columns: [
|
|
68
61
|
{
|
|
69
62
|
title: r("blockerSectionLabel"),
|
|
70
|
-
render: (e) => /* @__PURE__ */ o(
|
|
71
|
-
/* @__PURE__ */ o(
|
|
72
|
-
/* @__PURE__ */ o(
|
|
63
|
+
render: (e) => /* @__PURE__ */ o(F, { flexGrow: 1, children: /* @__PURE__ */ d(i, { flexDirection: "column", gap: 8, children: [
|
|
64
|
+
/* @__PURE__ */ o(n, { weight: "semibold", children: e.title }),
|
|
65
|
+
/* @__PURE__ */ o(n, { variant: "supporting", children: e.description })
|
|
73
66
|
] }) })
|
|
74
67
|
},
|
|
75
68
|
{
|
|
76
69
|
title: "",
|
|
77
70
|
render: (e) => {
|
|
78
71
|
const t = e.action;
|
|
79
|
-
return t ? /* @__PURE__ */ o(
|
|
72
|
+
return t ? /* @__PURE__ */ o(i, { justifyContent: "flex-end", alignItems: "center", children: /* @__PURE__ */ o(_, { variant: "secondary", onClick: t.onClick, title: t.label, children: t.label }) }) : null;
|
|
80
73
|
}
|
|
81
74
|
}
|
|
82
75
|
]
|
|
83
76
|
}), R = y.length > 0;
|
|
84
|
-
return R ||
|
|
77
|
+
return R || k || E ? /* @__PURE__ */ o("div", { className: C(B.root, l), children: /* @__PURE__ */ d(i, { flexDirection: "column", gap: 32, children: [
|
|
85
78
|
x.alerts.map((e) => /* @__PURE__ */ o(
|
|
86
79
|
g,
|
|
87
80
|
{
|
|
88
81
|
status: "success",
|
|
89
82
|
label: r(`alerts.${e.type}.title`),
|
|
90
83
|
onDismiss: () => {
|
|
91
|
-
|
|
84
|
+
A(e.id);
|
|
92
85
|
},
|
|
93
|
-
children: /* @__PURE__ */ o(
|
|
86
|
+
children: /* @__PURE__ */ o(n, { children: r(`alerts.${e.type}.description`) })
|
|
94
87
|
},
|
|
95
88
|
e.id
|
|
96
89
|
)),
|
|
97
|
-
R && /* @__PURE__ */
|
|
90
|
+
R && /* @__PURE__ */ d(i, { flexDirection: "column", gap: 20, children: [
|
|
98
91
|
/* @__PURE__ */ o(b, { as: "h2", styledAs: "h4", children: r("blockersListTitle") }),
|
|
99
|
-
/* @__PURE__ */ o(
|
|
92
|
+
/* @__PURE__ */ o(M, { ...O, label: r("blockersListTitle") })
|
|
100
93
|
] }),
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
] }) }) : /* @__PURE__ */ o("div", { className: C(B.root,
|
|
94
|
+
k && /* @__PURE__ */ o(Y, { companyId: a, onEvent: h }),
|
|
95
|
+
E && /* @__PURE__ */ o(H, { companyId: a, withAlert: !1, onEvent: h })
|
|
96
|
+
] }) }) : /* @__PURE__ */ o("div", { className: C(B.root, l), children: /* @__PURE__ */ o(n, { children: r("noBlockersMessage") }) });
|
|
104
97
|
}
|
|
105
98
|
export {
|
|
106
|
-
|
|
99
|
+
pe as PayrollBlockerList
|
|
107
100
|
};
|
|
108
101
|
//# sourceMappingURL=PayrollBlockerList.js.map
|