@gusto/embedded-react-sdk 0.11.3 → 0.12.0
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 +181 -0
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js +1 -1
- package/dist/components/Common/DocumentList/DocumentList.module.scss.js +1 -1
- package/dist/components/Common/DocumentViewer/DocumentViewer.module.scss.js +1 -1
- package/dist/components/Common/EmptyData/EmptyData.module.scss.js +1 -1
- package/dist/components/Common/FieldErrorMessage/FieldErrorMessage.module.scss.js +1 -1
- package/dist/components/Common/FieldLayout/FieldLayout.module.scss.js +6 -6
- package/dist/components/Common/Flex/Flex.d.ts +2 -2
- package/dist/components/Common/Flex/Flex.js +5 -5
- package/dist/components/Common/Flex/Flex.js.map +1 -1
- package/dist/components/Common/Form/Form.module.scss.js +2 -2
- package/dist/components/Common/Grid/Grid.d.ts +2 -2
- package/dist/components/Common/Grid/Grid.js +13 -13
- package/dist/components/Common/Grid/Grid.js.map +1 -1
- package/dist/components/Common/HorizontalFieldLayout/HorizontalFieldLayout.module.scss.js +12 -12
- package/dist/components/Common/InternalError/InternalError.module.scss.js +1 -1
- package/dist/components/Common/Loading/Loading.module.scss.js +1 -1
- package/dist/components/Common/PaginationControl/PaginationControl.module.scss.js +1 -1
- package/dist/components/Common/ReorderableList/ReorderableList.module.scss.js +15 -15
- package/dist/components/Common/RequirementsList/RequirementsList.module.scss.js +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.module.scss.js +6 -6
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +1 -1
- package/dist/components/Common/UI/Alert/Alert.module.scss.js +1 -1
- package/dist/components/Common/UI/Badge/Badge.module.scss.js +1 -1
- package/dist/components/Common/UI/Button/Button.module.scss.js +1 -1
- package/dist/components/Common/UI/Button/ButtonIcon.module.scss.js +1 -1
- package/dist/components/Common/UI/CalendarPreview/CalendarPreview.module.scss.js +5 -5
- package/dist/components/Common/UI/Card/Card.module.scss.js +1 -1
- package/dist/components/Common/UI/Checkbox/Checkbox.module.scss.js +8 -8
- package/dist/components/Common/UI/CheckboxGroup/CheckboxGroup.module.scss.js +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +1 -1
- package/dist/components/Common/UI/DatePicker/DatePicker.module.scss.js +5 -5
- package/dist/components/Common/UI/Input/Input.module.scss.js +7 -7
- package/dist/components/Common/UI/Link/Link.module.scss.js +1 -1
- package/dist/components/Common/UI/List/List.module.scss.js +1 -1
- package/dist/components/Common/UI/Menu/Menu.module.scss.js +5 -5
- package/dist/components/Common/UI/NumberInput/NumberInput.js +36 -38
- package/dist/components/Common/UI/NumberInput/NumberInput.js.map +1 -1
- package/dist/components/Common/UI/ProgressBar/ProgressBar.module.scss.js +1 -1
- package/dist/components/Common/UI/Radio/Radio.module.scss.js +1 -1
- package/dist/components/Common/UI/RadioGroup/RadioGroup.module.scss.js +1 -1
- package/dist/components/Common/UI/Select/Select.module.scss.js +1 -1
- package/dist/components/Common/UI/Switch/Switch.module.scss.js +4 -4
- package/dist/components/Common/UI/Table/Table.module.scss.js +1 -1
- package/dist/components/Common/UI/Text/Text.module.scss.js +14 -14
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +7 -6
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +2 -3
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +2 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +3 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +14 -13
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +2 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +6 -5
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +11 -10
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +6 -6
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +8 -9
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +8 -9
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -8
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -5
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +2 -3
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +9 -8
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +7 -6
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +5 -6
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +13 -12
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +3 -4
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +2 -3
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +4 -5
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +6 -7
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +6 -5
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +11 -10
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +6 -7
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +2 -3
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +7 -6
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +10 -11
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +6 -7
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +3 -2
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +34 -33
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +9 -10
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +17 -16
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.module.scss.js +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +6 -7
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +11 -12
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +2 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js +8 -8
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +2 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +2 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +5 -4
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +4 -3
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.d.ts +16 -0
- package/dist/components/Contractor/ContractorList/index.js +125 -0
- package/dist/components/Contractor/ContractorList/index.js.map +1 -0
- package/dist/components/Contractor/{List → ContractorList}/useContractorList.d.ts +1 -3
- package/dist/components/Contractor/{List → ContractorList}/useContractorList.js +9 -10
- package/dist/components/Contractor/ContractorList/useContractorList.js.map +1 -0
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.d.ts +2 -0
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js +25 -0
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js.map +1 -0
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.d.ts +26 -0
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js +71 -0
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js.map +1 -0
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.d.ts +9 -0
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js +119 -0
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +5 -6
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfile.js +31 -17
- package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.d.ts +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +40 -44
- package/dist/components/Contractor/Profile/ContractorProfileForm.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.d.ts +13 -12
- package/dist/components/Contractor/Profile/useContractorProfile.js +144 -144
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.d.ts +7 -0
- package/dist/components/Contractor/Submit/Submit.js +77 -0
- package/dist/components/Contractor/Submit/Submit.js.map +1 -0
- package/dist/components/Contractor/Submit/SubmitDone.js +11 -11
- package/dist/components/Contractor/Submit/SubmitDone.js.map +1 -1
- package/dist/components/Contractor/index.d.ts +3 -2
- package/dist/components/Contractor/index.js +10 -8
- package/dist/components/Contractor/index.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +1 -1
- package/dist/components/Employee/Compensation/Edit.js +12 -12
- package/dist/components/Employee/Compensation/List.js +22 -23
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/Deductions.d.ts +8 -14
- package/dist/components/Employee/Deductions/Deductions.js +47 -140
- package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsComponents.d.ts +23 -0
- package/dist/components/Employee/Deductions/DeductionsComponents.js +31 -0
- package/dist/components/Employee/Deductions/DeductionsComponents.js.map +1 -0
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.d.ts +41 -0
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +135 -0
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -0
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.d.ts +6 -0
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +99 -0
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -0
- package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.d.ts +15 -0
- package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +49 -0
- package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js.map +1 -0
- package/dist/components/Employee/Deductions/stateMachine.d.ts +7 -0
- package/dist/components/Employee/Deductions/stateMachine.js +107 -0
- package/dist/components/Employee/Deductions/stateMachine.js.map +1 -0
- package/dist/components/Employee/Deductions/useDeductions.d.ts +2 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +6 -7
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +8 -7
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +10 -9
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +2 -3
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +4 -3
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +5 -6
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +12 -12
- package/dist/components/Employee/Landing/Landing.js +8 -8
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.module.scss.js +6 -6
- package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +8 -9
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +8 -8
- package/dist/components/Employee/Profile/Actions.js +6 -7
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +6 -5
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +22 -21
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +8 -9
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +12 -13
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +3 -3
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +2 -3
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/ThemeProvider/ThemeProvider.d.ts +1 -5
- package/dist/contexts/ThemeProvider/ThemeProvider.js +18 -60
- package/dist/contexts/ThemeProvider/ThemeProvider.js.map +1 -1
- package/dist/contexts/ThemeProvider/theme.d.ts +42 -11
- package/dist/contexts/ThemeProvider/theme.js +31 -15
- package/dist/contexts/ThemeProvider/theme.js.map +1 -1
- package/dist/helpers/responsive.d.ts +0 -3
- package/dist/helpers/responsive.js +20 -34
- package/dist/helpers/responsive.js.map +1 -1
- package/dist/i18n/I18n.js +1 -1
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Contractor.ContractorList.json.js +14 -10
- package/dist/i18n/en/Contractor.ContractorList.json.js.map +1 -1
- package/dist/i18n/en/Contractor.Submit.json.js +22 -0
- package/dist/i18n/en/Contractor.Submit.json.js.map +1 -0
- package/dist/i18n/en/Employee.Deductions.json.js +49 -51
- package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
- package/dist/shared/constants.d.ts +20 -2
- package/dist/shared/constants.js +21 -11
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +25 -14
- package/package.json +2 -1
- package/dist/components/Common/UI/NumberInput/NumberInput.module.scss.js +0 -8
- package/dist/components/Common/UI/NumberInput/NumberInput.module.scss.js.map +0 -1
- package/dist/components/Contractor/List/index.d.ts +0 -25
- package/dist/components/Contractor/List/index.js +0 -81
- package/dist/components/Contractor/List/index.js.map +0 -1
- package/dist/components/Contractor/List/useContractorList.js.map +0 -1
- package/dist/components/Contractor/Submit/ContractorSubmitWithApi.d.ts +0 -6
- package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js +0 -27
- package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js.map +0 -1
- package/dist/components/Contractor/Submit/index.d.ts +0 -6
- package/dist/components/Contractor/Submit/index.js +0 -20
- package/dist/components/Contractor/Submit/index.js.map +0 -1
- package/dist/components/Contractor/Submit/index.module.scss.js +0 -8
- package/dist/components/Contractor/Submit/index.module.scss.js.map +0 -1
- package/dist/components/Employee/Deductions/Actions.js +0 -27
- package/dist/components/Employee/Deductions/Actions.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionForm.d.ts +0 -1
- package/dist/components/Employee/Deductions/DeductionForm.js +0 -78
- package/dist/components/Employee/Deductions/DeductionForm.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsList.d.ts +0 -2
- package/dist/components/Employee/Deductions/DeductionsList.js +0 -60
- package/dist/components/Employee/Deductions/DeductionsList.js.map +0 -1
- package/dist/components/Employee/Deductions/Head.js +0 -13
- package/dist/components/Employee/Deductions/Head.js.map +0 -1
- package/dist/components/Employee/Deductions/IncludeDeductionsForm.d.ts +0 -1
- package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +0 -27
- package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +0 -1
- package/dist/components/Employee/Deductions/useDeductions.js +0 -33
- package/dist/components/Employee/Deductions/useDeductions.js.map +0 -1
- package/dist/contexts/ThemeProvider/createTheme.d.ts +0 -21
- package/dist/contexts/ThemeProvider/createTheme.js +0 -269
- package/dist/contexts/ThemeProvider/createTheme.js.map +0 -1
- package/dist/i18n/en/Contractor.ContractorSubmit.json.js +0 -18
- package/dist/i18n/en/Contractor.ContractorSubmit.json.js.map +0 -1
- package/dist/types/GTheme.d.ts +0 -254
- /package/dist/contexts/ThemeProvider/{createTheme.test.d.ts → theme.test.d.ts} +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import "./types/i18next.d.ts"
|
|
2
2
|
export { PaymentMethod } from './PaymentMethod/PaymentMethod';
|
|
3
3
|
export { Address } from './Address';
|
|
4
|
-
export {
|
|
4
|
+
export { ContractorList } from './ContractorList';
|
|
5
5
|
export { NewHireReport } from './NewHireReport/NewHireReport';
|
|
6
|
-
export {
|
|
6
|
+
export { ContractorSubmit } from './Submit/Submit';
|
|
7
7
|
export { ContractorProfile } from './Profile';
|
|
8
|
+
export { OnboardingFlow } from './OnboardingFlow/OnboardingFlow';
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { PaymentMethod as t } from "./PaymentMethod/PaymentMethod.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ContractorList as m } from "./ContractorList/index.js";
|
|
3
3
|
import { NewHireReport as p } from "./NewHireReport/NewHireReport.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { ContractorSubmit as n } from "./Submit/Submit.js";
|
|
5
|
+
import { OnboardingFlow as i } from "./OnboardingFlow/OnboardingFlow.js";
|
|
6
|
+
import { Address as c } from "./Address/Address.js";
|
|
7
|
+
import { ContractorProfile as C } from "./Profile/ContractorProfile.js";
|
|
7
8
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
c as Address,
|
|
10
|
+
m as ContractorList,
|
|
11
|
+
C as ContractorProfile,
|
|
12
|
+
n as ContractorSubmit,
|
|
12
13
|
p as NewHireReport,
|
|
14
|
+
i as OnboardingFlow,
|
|
13
15
|
t as PaymentMethod
|
|
14
16
|
};
|
|
15
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -3,8 +3,8 @@ import { useFormContext as l, useWatch as d } from "react-hook-form";
|
|
|
3
3
|
import { useTranslation as T } from "react-i18next";
|
|
4
4
|
import { useCompensation as O } from "./useCompensation.js";
|
|
5
5
|
import "classnames";
|
|
6
|
-
import { FlsaStatus as a } from "../../../shared/constants.js";
|
|
7
6
|
import { ActionsLayout as u } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
7
|
+
import { FlsaStatus as a } from "../../../shared/constants.js";
|
|
8
8
|
import { useComponentContext as C } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
9
|
const h = () => {
|
|
10
10
|
const { isPending: s, mode: t, submitWithEffect: o, handleAdd: D, handleCancelAddJob: m, primaryFlsaStatus: r } = O(), { t: n } = T("Employee.Compensation"), { control: I } = l(), c = d({ control: I, name: "flsaStatus" }), e = C();
|
|
@@ -6,17 +6,17 @@ import { useCompensation as R, rateMinimumError as Y, rateExemptThresholdError a
|
|
|
6
6
|
import { FlsaStatus as a, PAY_PERIODS as r, FLSA_OVERTIME_SALARY_LIMIT as N } from "../../../shared/constants.js";
|
|
7
7
|
import x from "../../Common/hooks/useNumberFormatter.js";
|
|
8
8
|
import "classnames";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { SwitchField as J } from "../../Common/Fields/SwitchField/SwitchField.js";
|
|
13
|
-
import { useComponentContext as K } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
-
import { WA_RISK_CLASS_CODES as q } from "../../../models/WA_RISK_CODES.js";
|
|
9
|
+
import { useComponentContext as j } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
|
+
import { WA_RISK_CLASS_CODES as X } from "../../../models/WA_RISK_CODES.js";
|
|
11
|
+
import { TextInputField as B } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
15
12
|
import { SelectField as b } from "../../Common/Fields/SelectField/SelectField.js";
|
|
13
|
+
import { NumberInputField as J } from "../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
14
|
+
import { SwitchField as K } from "../../Common/Fields/SwitchField/SwitchField.js";
|
|
15
|
+
import { RadioGroupField as q } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
16
16
|
import { ComboBoxField as H } from "../../Common/Fields/ComboBoxField/ComboBoxField.js";
|
|
17
17
|
const pe = () => {
|
|
18
|
-
const { t: e } = P("Employee.Compensation"), l = x("currency"), m =
|
|
19
|
-
() =>
|
|
18
|
+
const { t: e } = P("Employee.Compensation"), l = x("currency"), m = j(), S = F(
|
|
19
|
+
() => X.map(({ code: o, description: D }) => ({ value: o, label: D })),
|
|
20
20
|
[]
|
|
21
21
|
), {
|
|
22
22
|
control: f,
|
|
@@ -45,7 +45,7 @@ const pe = () => {
|
|
|
45
45
|
limit: l(N)
|
|
46
46
|
})), /* @__PURE__ */ d(O, { children: [
|
|
47
47
|
/* @__PURE__ */ t(
|
|
48
|
-
|
|
48
|
+
B,
|
|
49
49
|
{
|
|
50
50
|
name: "jobTitle",
|
|
51
51
|
label: e("jobTitle"),
|
|
@@ -77,7 +77,7 @@ const pe = () => {
|
|
|
77
77
|
}
|
|
78
78
|
),
|
|
79
79
|
/* @__PURE__ */ t(
|
|
80
|
-
|
|
80
|
+
J,
|
|
81
81
|
{
|
|
82
82
|
name: "rate",
|
|
83
83
|
label: e("amount"),
|
|
@@ -90,7 +90,7 @@ const pe = () => {
|
|
|
90
90
|
),
|
|
91
91
|
A && /* @__PURE__ */ d(O, { children: [
|
|
92
92
|
/* @__PURE__ */ t(
|
|
93
|
-
|
|
93
|
+
K,
|
|
94
94
|
{
|
|
95
95
|
name: "adjustForMinimumWage",
|
|
96
96
|
label: e("adjustForMinimumWage"),
|
|
@@ -126,7 +126,7 @@ const pe = () => {
|
|
|
126
126
|
v && /* @__PURE__ */ t(m.Checkbox, { label: e("twoPercentStakeholderLabel"), name: "twoPercentShareholder" }),
|
|
127
127
|
W === "WA" && /* @__PURE__ */ d(O, { children: [
|
|
128
128
|
/* @__PURE__ */ t(
|
|
129
|
-
|
|
129
|
+
q,
|
|
130
130
|
{
|
|
131
131
|
name: "stateWcCovered",
|
|
132
132
|
label: e("stateWcCoveredLabel"),
|
|
@@ -4,58 +4,57 @@ import { useCompensation as d } from "./useCompensation.js";
|
|
|
4
4
|
import C from "../../../assets/icons/pencil.svg.js";
|
|
5
5
|
import c from "../../../assets/icons/trashcan.svg.js";
|
|
6
6
|
import "classnames";
|
|
7
|
-
import "../../../shared/constants.js";
|
|
8
7
|
import { HamburgerMenu as f } from "../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
9
8
|
import { useDataView as y } from "../../Common/DataView/useDataView.js";
|
|
10
9
|
import { DataView as g } from "../../Common/DataView/DataView.js";
|
|
11
|
-
const
|
|
12
|
-
const { employeeJobs: i, mode: o, isPending: r, handleEdit: l, handleDelete: s } = d(), { t
|
|
10
|
+
const P = () => {
|
|
11
|
+
const { employeeJobs: i, mode: o, isPending: r, handleEdit: l, handleDelete: s } = d(), { t } = p("Employee.Compensation"), { ...m } = y({
|
|
13
12
|
data: i,
|
|
14
13
|
columns: [
|
|
15
14
|
{
|
|
16
15
|
key: "title",
|
|
17
|
-
title:
|
|
18
|
-
render: (
|
|
16
|
+
title: t("allCompensations.jobColumn"),
|
|
17
|
+
render: (e) => e.title || ""
|
|
19
18
|
},
|
|
20
19
|
{
|
|
21
20
|
key: "flsaStatus",
|
|
22
|
-
title:
|
|
23
|
-
render: (
|
|
24
|
-
const n =
|
|
25
|
-
(u) => u.uuid ===
|
|
21
|
+
title: t("allCompensations.typeColumn"),
|
|
22
|
+
render: (e) => {
|
|
23
|
+
const n = e.compensations?.find(
|
|
24
|
+
(u) => u.uuid === e.currentCompensationUuid
|
|
26
25
|
)?.flsaStatus;
|
|
27
|
-
return n !== void 0 ?
|
|
26
|
+
return n !== void 0 ? t(`flsaStatusLabels.${n}`) : null;
|
|
28
27
|
}
|
|
29
28
|
},
|
|
30
29
|
{
|
|
31
30
|
key: "rate",
|
|
32
|
-
title:
|
|
33
|
-
render: (
|
|
31
|
+
title: t("allCompensations.amountColumn"),
|
|
32
|
+
render: (e) => e.rate?.toString() || ""
|
|
34
33
|
},
|
|
35
34
|
{
|
|
36
35
|
key: "paymentUnit",
|
|
37
|
-
title:
|
|
38
|
-
render: (
|
|
36
|
+
title: t("allCompensations.perColumn"),
|
|
37
|
+
render: (e) => e.paymentUnit || ""
|
|
39
38
|
}
|
|
40
39
|
],
|
|
41
|
-
itemMenu: (
|
|
40
|
+
itemMenu: (e) => /* @__PURE__ */ a(
|
|
42
41
|
f,
|
|
43
42
|
{
|
|
44
|
-
triggerLabel:
|
|
43
|
+
triggerLabel: t("hamburgerTitle"),
|
|
45
44
|
items: [
|
|
46
45
|
{
|
|
47
|
-
label:
|
|
46
|
+
label: t("allCompensations.editCta"),
|
|
48
47
|
icon: /* @__PURE__ */ a(C, { "aria-hidden": !0 }),
|
|
49
48
|
onClick: () => {
|
|
50
|
-
l(
|
|
49
|
+
l(e.uuid);
|
|
51
50
|
}
|
|
52
51
|
},
|
|
53
|
-
...
|
|
52
|
+
...e.primary ? [] : [
|
|
54
53
|
{
|
|
55
|
-
label:
|
|
54
|
+
label: t("allCompensations.deleteCta"),
|
|
56
55
|
icon: /* @__PURE__ */ a(c, { "aria-hidden": !0 }),
|
|
57
56
|
onClick: () => {
|
|
58
|
-
s(
|
|
57
|
+
s(e.uuid);
|
|
59
58
|
}
|
|
60
59
|
}
|
|
61
60
|
]
|
|
@@ -65,9 +64,9 @@ const U = () => {
|
|
|
65
64
|
)
|
|
66
65
|
});
|
|
67
66
|
if (o === "LIST")
|
|
68
|
-
return /* @__PURE__ */ a(g, { "data-testid": "data-view", label:
|
|
67
|
+
return /* @__PURE__ */ a(g, { "data-testid": "data-view", label: t("allCompensations.tableLabel"), ...m });
|
|
69
68
|
};
|
|
70
69
|
export {
|
|
71
|
-
|
|
70
|
+
P as List
|
|
72
71
|
};
|
|
73
72
|
//# sourceMappingURL=List.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sources":["../../../../src/components/Employee/Compensation/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type Job } from '@gusto/embedded-api/models/components/job'\nimport { useCompensation } from './useCompensation'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { DataView, useDataView } from '@/components/Common'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { employeeJobs, mode, isPending, handleEdit, handleDelete } = useCompensation()\n const { t } = useTranslation('Employee.Compensation')\n\n const { ...dataViewProps } = useDataView({\n data: employeeJobs,\n columns: [\n {\n key: 'title',\n title: t('allCompensations.jobColumn'),\n render: (job: Job) => job.title || '',\n },\n {\n key: 'flsaStatus',\n title: t('allCompensations.typeColumn'),\n render: (job: Job) => {\n const flsaStatus = job.compensations?.find(\n comp => comp.uuid === job.currentCompensationUuid,\n )?.flsaStatus\n return flsaStatus !== undefined ? t(`flsaStatusLabels.${flsaStatus}`) : null\n },\n },\n {\n key: 'rate',\n title: t('allCompensations.amountColumn'),\n render: (job: Job) => job.rate?.toString() || '',\n },\n {\n key: 'paymentUnit',\n title: t('allCompensations.perColumn'),\n render: (job: Job) => job.paymentUnit || '',\n },\n ],\n itemMenu: (job: Job) => (\n <HamburgerMenu\n triggerLabel={t('hamburgerTitle')}\n items={[\n {\n label: t('allCompensations.editCta'),\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n handleEdit(job.uuid)\n },\n },\n ...(!job.primary\n ? [\n {\n label: t('allCompensations.deleteCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n handleDelete(job.uuid)\n },\n },\n ]\n : []),\n ]}\n isLoading={isPending}\n />\n ),\n })\n\n if (mode !== 'LIST') {\n return\n }\n\n return (\n <DataView data-testid=\"data-view\" label={t('allCompensations.tableLabel')} {...dataViewProps} />\n )\n}\n"],"names":["List","employeeJobs","mode","isPending","handleEdit","handleDelete","useCompensation","
|
|
1
|
+
{"version":3,"file":"List.js","sources":["../../../../src/components/Employee/Compensation/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type Job } from '@gusto/embedded-api/models/components/job'\nimport { useCompensation } from './useCompensation'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { DataView, useDataView } from '@/components/Common'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { employeeJobs, mode, isPending, handleEdit, handleDelete } = useCompensation()\n const { t } = useTranslation('Employee.Compensation')\n\n const { ...dataViewProps } = useDataView({\n data: employeeJobs,\n columns: [\n {\n key: 'title',\n title: t('allCompensations.jobColumn'),\n render: (job: Job) => job.title || '',\n },\n {\n key: 'flsaStatus',\n title: t('allCompensations.typeColumn'),\n render: (job: Job) => {\n const flsaStatus = job.compensations?.find(\n comp => comp.uuid === job.currentCompensationUuid,\n )?.flsaStatus\n return flsaStatus !== undefined ? t(`flsaStatusLabels.${flsaStatus}`) : null\n },\n },\n {\n key: 'rate',\n title: t('allCompensations.amountColumn'),\n render: (job: Job) => job.rate?.toString() || '',\n },\n {\n key: 'paymentUnit',\n title: t('allCompensations.perColumn'),\n render: (job: Job) => job.paymentUnit || '',\n },\n ],\n itemMenu: (job: Job) => (\n <HamburgerMenu\n triggerLabel={t('hamburgerTitle')}\n items={[\n {\n label: t('allCompensations.editCta'),\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n handleEdit(job.uuid)\n },\n },\n ...(!job.primary\n ? [\n {\n label: t('allCompensations.deleteCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n handleDelete(job.uuid)\n },\n },\n ]\n : []),\n ]}\n isLoading={isPending}\n />\n ),\n })\n\n if (mode !== 'LIST') {\n return\n }\n\n return (\n <DataView data-testid=\"data-view\" label={t('allCompensations.tableLabel')} {...dataViewProps} />\n )\n}\n"],"names":["List","employeeJobs","mode","isPending","handleEdit","handleDelete","useCompensation","useTranslation","dataViewProps","useDataView","job","flsaStatus","comp","jsx","HamburgerMenu","PencilSvg","TrashCanSvg","DataView"],"mappings":";;;;;;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,cAAAC,GAAc,MAAAC,GAAM,WAAAC,GAAW,YAAAC,GAAY,cAAAC,EAAA,IAAiBC,EAAA,GAC9D,EAAE,EAAA,IAAMC,EAAe,uBAAuB,GAE9C,EAAE,GAAGC,EAAA,IAAkBC,EAAY;AAAA,IACvC,MAAMR;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,4BAA4B;AAAA,QACrC,QAAQ,CAACS,MAAaA,EAAI,SAAS;AAAA,MAAA;AAAA,MAErC;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,6BAA6B;AAAA,QACtC,QAAQ,CAACA,MAAa;AACpB,gBAAMC,IAAaD,EAAI,eAAe;AAAA,YACpC,CAAAE,MAAQA,EAAK,SAASF,EAAI;AAAA,UAAA,GACzB;AACH,iBAAOC,MAAe,SAAY,EAAE,oBAAoBA,CAAU,EAAE,IAAI;AAAA,QAC1E;AAAA,MAAA;AAAA,MAEF;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,+BAA+B;AAAA,QACxC,QAAQ,CAACD,MAAaA,EAAI,MAAM,cAAc;AAAA,MAAA;AAAA,MAEhD;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,4BAA4B;AAAA,QACrC,QAAQ,CAACA,MAAaA,EAAI,eAAe;AAAA,MAAA;AAAA,IAC3C;AAAA,IAEF,UAAU,CAACA,MACT,gBAAAG;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,cAAc,EAAE,gBAAgB;AAAA,QAChC,OAAO;AAAA,UACL;AAAA,YACE,OAAO,EAAE,0BAA0B;AAAA,YACnC,MAAM,gBAAAD,EAACE,GAAA,EAAU,eAAW,GAAA,CAAC;AAAA,YAC7B,SAAS,MAAM;AACb,cAAAX,EAAWM,EAAI,IAAI;AAAA,YACrB;AAAA,UAAA;AAAA,UAEF,GAAKA,EAAI,UAUL,CAAA,IATA;AAAA,YACE;AAAA,cACE,OAAO,EAAE,4BAA4B;AAAA,cACrC,MAAM,gBAAAG,EAACG,GAAA,EAAY,eAAW,GAAA,CAAC;AAAA,cAC/B,SAAS,MAAM;AACb,gBAAAX,EAAaK,EAAI,IAAI;AAAA,cACvB;AAAA,YAAA;AAAA,UACF;AAAA,QAED;AAAA,QAEP,WAAWP;AAAA,MAAA;AAAA,IAAA;AAAA,EACb,CAEH;AAED,MAAID,MAAS;AAIb,WACE,gBAAAW,EAACI,KAAS,eAAY,aAAY,OAAO,EAAE,6BAA6B,GAAI,GAAGT,GAAe;AAElG;"}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
interface DeductionsProps extends CommonComponentInterface<'Employee.Deductions'> {
|
|
1
|
+
import { BaseComponentInterface } from '../../Base';
|
|
2
|
+
export interface DeductionsProps extends BaseComponentInterface<'Employee.Deductions'> {
|
|
4
3
|
employeeId: string;
|
|
5
4
|
}
|
|
6
|
-
declare
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}>;
|
|
13
|
-
export type IncludeDeductionsPayload = z.output<typeof IncludeDeductionsSchema>;
|
|
14
|
-
export declare function Deductions(props: DeductionsProps & BaseComponentInterface): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export declare const Root: ({ employeeId, className, dictionary }: DeductionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function Deductions(props: DeductionsProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare namespace Deductions {
|
|
7
|
+
var DeductionsForm: typeof import("./DeductionsForm/DeductionsForm").DeductionsForm;
|
|
8
|
+
var DeductionsList: typeof import("./DeductionsList/DeductionsList").DeductionsList;
|
|
9
|
+
var IncludeDeductionsForm: typeof import("./IncludeDeductionsForm/IncludeDeductionsForm").IncludeDeductionsForm;
|
|
10
|
+
}
|
|
16
11
|
export declare const DeductionsContextual: () => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export {};
|
|
@@ -1,152 +1,59 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import { useComponentDictionary as
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
k("Employee.Deductions", a);
|
|
29
|
-
const { data: _ } = B({ employeeId: o }), f = _.garnishmentList, { mutateAsync: p, isPending: b } = j(), { mutateAsync: x, isPending: w } = R(), g = f.filter((r) => r.active), [u, m] = M(g.length < 1 ? "INITIAL" : "LIST"), [e, l] = M(null);
|
|
30
|
-
J("Employee.Deductions");
|
|
31
|
-
const D = Y(() => ({
|
|
32
|
-
amount: e?.amount ? Number(e.amount) : 0,
|
|
33
|
-
description: e?.description ?? "",
|
|
34
|
-
times: e?.times ?? null,
|
|
35
|
-
recurring: e?.recurring?.toString() ?? "true",
|
|
36
|
-
annualMaximum: e?.annualMaximum ? Number(e.annualMaximum) : null,
|
|
37
|
-
payPeriodMaximum: e?.payPeriodMaximum ? Number(e.payPeriodMaximum) : null,
|
|
38
|
-
deductAsPercentage: e?.deductAsPercentage?.toString() ?? "true",
|
|
39
|
-
active: !0,
|
|
40
|
-
courtOrdered: e?.courtOrdered ?? !1
|
|
41
|
-
}), [e]), I = O({
|
|
42
|
-
// resolver: zodResolver(IncludeDeductionsSchema),
|
|
43
|
-
defaultValues: { includeDeductions: "No" }
|
|
44
|
-
}), E = O({
|
|
45
|
-
resolver: y(G),
|
|
46
|
-
defaultValues: D
|
|
47
|
-
}), { reset: P } = E;
|
|
48
|
-
q(() => {
|
|
49
|
-
P(D);
|
|
50
|
-
}, [e, D, P, u]);
|
|
51
|
-
const F = async (r) => {
|
|
52
|
-
await h(r, async (n) => {
|
|
53
|
-
const { garnishment: c } = await p({
|
|
54
|
-
request: {
|
|
55
|
-
garnishmentId: n.uuid,
|
|
56
|
-
requestBody: {
|
|
57
|
-
...n,
|
|
58
|
-
totalAmount: n.totalAmount ?? void 0,
|
|
59
|
-
active: !1,
|
|
60
|
-
version: n.version
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
i(s.EMPLOYEE_DEDUCTION_DELETED, c);
|
|
65
|
-
});
|
|
66
|
-
}, v = async (r) => {
|
|
67
|
-
await h(r, async (n) => {
|
|
68
|
-
if ("includeDeductions" in n)
|
|
69
|
-
if (n.includeDeductions === "Yes")
|
|
70
|
-
m("ADD"), i(s.EMPLOYEE_DEDUCTION_ADD);
|
|
71
|
-
else {
|
|
72
|
-
i(s.EMPLOYEE_DEDUCTION_DONE);
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
if (!("includeDeductions" in n)) {
|
|
76
|
-
if (u === "ADD") {
|
|
77
|
-
const { garnishment: c } = await x({
|
|
78
|
-
request: {
|
|
79
|
-
employeeId: o,
|
|
80
|
-
requestBody: { ...n, times: n.recurring ? null : 1 }
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
i(s.EMPLOYEE_DEDUCTION_CREATED, c);
|
|
84
|
-
} else if (u === "EDIT") {
|
|
85
|
-
const { garnishment: c } = await p({
|
|
86
|
-
request: {
|
|
87
|
-
garnishmentId: e?.uuid ?? "",
|
|
88
|
-
requestBody: {
|
|
89
|
-
...n,
|
|
90
|
-
version: e?.version,
|
|
91
|
-
times: n.recurring ? null : 1
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
i(s.EMPLOYEE_DEDUCTION_UPDATED, c), l(null);
|
|
96
|
-
}
|
|
97
|
-
m("LIST");
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
};
|
|
101
|
-
return /* @__PURE__ */ t("section", { className: d, children: /* @__PURE__ */ t(
|
|
102
|
-
z,
|
|
103
|
-
{
|
|
104
|
-
value: {
|
|
105
|
-
isPending: w || b,
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as l } from "react-i18next";
|
|
3
|
+
import { createMachine as D } from "robot3";
|
|
4
|
+
import { useGarnishmentsListSuspense as f } from "@gusto/embedded-api/react-query/garnishmentsList";
|
|
5
|
+
import { useMemo as d } from "react";
|
|
6
|
+
import { DeductionsListContextual as h, IncludeDeductionsFormContextual as F } from "./DeductionsComponents.js";
|
|
7
|
+
import { deductionsStateMachine as w } from "./stateMachine.js";
|
|
8
|
+
import { DeductionsForm as x } from "./DeductionsForm/DeductionsForm.js";
|
|
9
|
+
import { DeductionsList as C } from "./DeductionsList/DeductionsList.js";
|
|
10
|
+
import { IncludeDeductionsForm as g } from "./IncludeDeductionsForm/IncludeDeductionsForm.js";
|
|
11
|
+
import { Flow as v } from "../../Flow/Flow.js";
|
|
12
|
+
import { BaseComponent as L } from "../../Base/Base.js";
|
|
13
|
+
import "../../Base/useBase.js";
|
|
14
|
+
import { useComponentDictionary as E } from "../../../i18n/I18n.js";
|
|
15
|
+
import { useFlow as I } from "../../Flow/useFlow.js";
|
|
16
|
+
function M({ employeeId: o, onEvent: i, dictionary: r }) {
|
|
17
|
+
E("Employee.Deductions", r);
|
|
18
|
+
const { data: a } = f({ employeeId: o }), c = a.garnishmentList.filter((s) => s.active), t = d(
|
|
19
|
+
() => c.length > 0,
|
|
20
|
+
[c.length]
|
|
21
|
+
), m = t ? "viewDeductions" : "includeDeductions", u = t ? h : F, p = d(
|
|
22
|
+
() => D(
|
|
23
|
+
m,
|
|
24
|
+
w,
|
|
25
|
+
(s) => ({
|
|
26
|
+
...s,
|
|
27
|
+
component: u,
|
|
106
28
|
employeeId: o,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
i(s.EMPLOYEE_DEDUCTION_DONE);
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
children: u === "INITIAL" ? /* @__PURE__ */ t(C, { ...I, children: /* @__PURE__ */ A(L, { onSubmit: I.handleSubmit(v), children: [
|
|
124
|
-
/* @__PURE__ */ t(S, {}),
|
|
125
|
-
/* @__PURE__ */ t(K, {}),
|
|
126
|
-
/* @__PURE__ */ t(N, {})
|
|
127
|
-
] }) }) : /* @__PURE__ */ t(C, { ...E, children: /* @__PURE__ */ A(L, { onSubmit: E.handleSubmit(v), children: [
|
|
128
|
-
/* @__PURE__ */ t(S, {}),
|
|
129
|
-
/* @__PURE__ */ t(W, {}),
|
|
130
|
-
/* @__PURE__ */ t(Q, {}),
|
|
131
|
-
/* @__PURE__ */ t(N, {})
|
|
132
|
-
] }) })
|
|
133
|
-
}
|
|
134
|
-
) });
|
|
135
|
-
}, Oe = () => {
|
|
136
|
-
const { employeeId: o, onEvent: d } = X(), { t: a } = U("common");
|
|
29
|
+
currentDeductionId: null,
|
|
30
|
+
hasExistingDeductions: t
|
|
31
|
+
})
|
|
32
|
+
),
|
|
33
|
+
[m, u, o, t]
|
|
34
|
+
);
|
|
35
|
+
return /* @__PURE__ */ n(v, { machine: p, onEvent: i });
|
|
36
|
+
}
|
|
37
|
+
function e(o) {
|
|
38
|
+
return /* @__PURE__ */ n(L, { ...o, children: /* @__PURE__ */ n(M, { ...o }) });
|
|
39
|
+
}
|
|
40
|
+
const N = () => {
|
|
41
|
+
const { employeeId: o, onEvent: i } = I(), { t: r } = l("common");
|
|
137
42
|
if (!o)
|
|
138
43
|
throw new Error(
|
|
139
|
-
|
|
44
|
+
r("errors.missingParamsOrContext", {
|
|
140
45
|
component: "Deductions",
|
|
141
46
|
param: "employeeId",
|
|
142
47
|
provider: "FlowProvider"
|
|
143
48
|
})
|
|
144
49
|
);
|
|
145
|
-
return /* @__PURE__ */
|
|
50
|
+
return /* @__PURE__ */ n(e, { employeeId: o, onEvent: i });
|
|
146
51
|
};
|
|
52
|
+
e.DeductionsForm = x;
|
|
53
|
+
e.DeductionsList = C;
|
|
54
|
+
e.IncludeDeductionsForm = g;
|
|
147
55
|
export {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
$ as Root
|
|
56
|
+
e as Deductions,
|
|
57
|
+
N as DeductionsContextual
|
|
151
58
|
};
|
|
152
59
|
//# sourceMappingURL=Deductions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Deductions.js","sources":["../../../../src/components/Employee/Deductions/Deductions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEffect, useMemo, useState } from 'react'\nimport { z } from 'zod'\nimport { FormProvider, useForm, type SubmitHandler } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useGarnishmentsListSuspense } from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { type Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { useGarnishmentsCreateMutation } from '@gusto/embedded-api/react-query/garnishmentsCreate'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api/react-query/garnishmentsUpdate'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlow'\nimport {\n type DeductionInputs,\n type DeductionPayload,\n DeductionSchema,\n DeductionsProvider,\n type MODE,\n} from './useDeductions'\nimport {\n useBase,\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { Form } from '@/components/Common/Form'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Actions } from '@/components/Employee/Deductions/Actions'\nimport { IncludeDeductionsForm } from '@/components/Employee/Deductions/IncludeDeductionsForm'\nimport { Head } from '@/components/Employee/Deductions/Head'\nimport { DeductionForm } from '@/components/Employee/Deductions/DeductionForm'\nimport { DeductionsList } from '@/components/Employee/Deductions/DeductionsList'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface DeductionsProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n}\n\nconst IncludeDeductionsSchema = z.object({ includeDeductions: z.enum(['Yes', 'No']) })\nexport type IncludeDeductionsPayload = z.output<typeof IncludeDeductionsSchema>\n\nexport function Deductions(props: DeductionsProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\nexport const Root = ({ employeeId, className, dictionary }: DeductionsProps) => {\n const { onEvent, baseSubmitHandler } = useBase()\n useComponentDictionary('Employee.Deductions', dictionary)\n\n const { data } = useGarnishmentsListSuspense({ employeeId })\n const deductions = data.garnishmentList!\n\n // Used for deletion or edit of deduction\n const { mutateAsync: updateDeduction, isPending: isPendingUpdate } =\n useGarnishmentsUpdateMutation()\n const { mutateAsync: createDeduction, isPending: isPendingCreate } =\n useGarnishmentsCreateMutation()\n\n const activeDeductions = deductions.filter(deduction => deduction.active)\n const [mode, setMode] = useState<MODE>(activeDeductions.length < 1 ? 'INITIAL' : 'LIST')\n const [currentDeduction, setCurrentDeduction] = useState<Garnishment | null>(null)\n useI18n('Employee.Deductions')\n\n const defaultValues: DeductionInputs = useMemo(() => {\n return {\n amount: currentDeduction?.amount ? Number(currentDeduction.amount) : 0,\n description: currentDeduction?.description ?? '',\n times: currentDeduction?.times ?? null,\n recurring: currentDeduction?.recurring?.toString() ?? 'true',\n annualMaximum: currentDeduction?.annualMaximum\n ? Number(currentDeduction.annualMaximum)\n : null,\n payPeriodMaximum: currentDeduction?.payPeriodMaximum\n ? Number(currentDeduction.payPeriodMaximum)\n : null,\n deductAsPercentage: currentDeduction?.deductAsPercentage?.toString() ?? 'true',\n active: true,\n courtOrdered: currentDeduction?.courtOrdered ?? false,\n } as DeductionInputs\n }, [currentDeduction])\n\n const includeDeductionsFormMethods = useForm<IncludeDeductionsPayload>({\n // resolver: zodResolver(IncludeDeductionsSchema),\n defaultValues: { includeDeductions: 'No' },\n })\n\n const formMethods = useForm<DeductionInputs, unknown, DeductionPayload>({\n resolver: zodResolver(DeductionSchema),\n defaultValues,\n })\n\n const { reset: resetForm } = formMethods\n\n useEffect(() => {\n resetForm(defaultValues)\n }, [currentDeduction, defaultValues, resetForm, mode])\n\n const handleDelete = async (deduction: Garnishment) => {\n await baseSubmitHandler(deduction, async payload => {\n //Deletion of deduction is simply updating it with active: false\n const { garnishment } = await updateDeduction({\n request: {\n garnishmentId: payload.uuid,\n requestBody: {\n ...payload,\n totalAmount: payload.totalAmount ?? undefined,\n active: false,\n version: payload.version as string,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DELETED, garnishment)\n })\n }\n const onSubmit: SubmitHandler<DeductionPayload | IncludeDeductionsPayload> = async data => {\n await baseSubmitHandler(data, async payload => {\n if ('includeDeductions' in payload) {\n if (payload.includeDeductions === 'Yes') {\n setMode('ADD')\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_ADD)\n } else {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DONE)\n return\n }\n }\n if (!('includeDeductions' in payload)) {\n if (mode === 'ADD') {\n const { garnishment: createDeductionResponse } = await createDeduction({\n request: {\n employeeId: employeeId,\n requestBody: { ...payload, times: payload.recurring ? null : 1 },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CREATED, createDeductionResponse)\n } else if (mode === 'EDIT') {\n const { garnishment: updateDeductionResponse } = await updateDeduction({\n request: {\n garnishmentId: currentDeduction?.uuid ?? '',\n requestBody: {\n ...payload,\n version: currentDeduction?.version as string,\n times: payload.recurring ? null : 1,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_UPDATED, updateDeductionResponse)\n setCurrentDeduction(null)\n }\n setMode('LIST')\n }\n })\n }\n const handleAdd = () => {\n setMode('ADD')\n }\n const handleCancel = () => {\n setMode(activeDeductions.length < 1 ? 'INITIAL' : 'LIST')\n setCurrentDeduction(null)\n }\n const handleEdit = (deduction: Garnishment) => {\n setMode('EDIT')\n setCurrentDeduction(deduction)\n }\n const handlePassthrough = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DONE)\n }\n return (\n <section className={className}>\n <DeductionsProvider\n value={{\n isPending: isPendingCreate || isPendingUpdate,\n employeeId,\n mode,\n deductions,\n handleAdd,\n handleCancel,\n handleDelete,\n handleEdit,\n handlePassthrough,\n }}\n >\n {mode === 'INITIAL' ? (\n <FormProvider {...includeDeductionsFormMethods}>\n <Form onSubmit={includeDeductionsFormMethods.handleSubmit(onSubmit)}>\n <Head />\n <IncludeDeductionsForm />\n <Actions />\n </Form>\n </FormProvider>\n ) : (\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Head />\n <DeductionsList />\n <DeductionForm />\n <Actions />\n </Form>\n </FormProvider>\n )}\n </DeductionsProvider>\n </section>\n )\n}\n\nexport const DeductionsContextual = () => {\n const { employeeId, onEvent } = useFlow<OnboardingContextInterface>()\n const { t } = useTranslation('common')\n\n if (!employeeId) {\n throw new Error(\n t('errors.missingParamsOrContext', {\n component: 'Deductions',\n param: 'employeeId',\n provider: 'FlowProvider',\n }),\n )\n }\n return <Deductions employeeId={employeeId} onEvent={onEvent} />\n}\n"],"names":["z","Deductions","props","jsx","BaseComponent","Root","employeeId","className","dictionary","onEvent","baseSubmitHandler","useBase","useComponentDictionary","data","useGarnishmentsListSuspense","deductions","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","createDeduction","isPendingCreate","useGarnishmentsCreateMutation","activeDeductions","deduction","mode","setMode","useState","currentDeduction","setCurrentDeduction","useI18n","defaultValues","useMemo","includeDeductionsFormMethods","useForm","formMethods","zodResolver","DeductionSchema","resetForm","useEffect","handleDelete","payload","garnishment","componentEvents","onSubmit","createDeductionResponse","updateDeductionResponse","DeductionsProvider","FormProvider","jsxs","Form","Head","IncludeDeductionsForm","Actions","DeductionsList","DeductionForm","DeductionsContextual","useFlow","t","useTranslation"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsCgCA,EAAE,OAAO,EAAE,mBAAmBA,EAAE,KAAK,CAAC,OAAO,IAAI,CAAC,EAAA,CAAG;AAG9E,SAASC,EAAWC,GAAiD;AAC1E,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AACO,MAAMG,IAAO,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,YAAAC,QAAkC;AAC9E,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA;AACvC,EAAAC,EAAuB,uBAAuBJ,CAAU;AAExD,QAAM,EAAE,MAAAK,EAAA,IAASC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EJ,GAEaG,KAAuB,MAAM;AACxC,QAAM,EAAE,YAAAjD,GAAY,SAAAG,EAAA,IAAY+C,EAAA,GAC1B,EAAE,GAAAC,EAAA,IAAMC,EAAe,QAAQ;AAErC,MAAI,CAACpD;AACH,UAAM,IAAI;AAAA,MACRmD,EAAE,iCAAiC;AAAA,QACjC,WAAW;AAAA,QACX,OAAO;AAAA,QACP,UAAU;AAAA,MAAA,CACX;AAAA,IAAA;AAGL,SAAO,gBAAAtD,EAACF,GAAA,EAAW,YAAAK,GAAwB,SAAAG,EAAA,CAAkB;AAC/D;"}
|
|
1
|
+
{"version":3,"file":"Deductions.js","sources":["../../../../src/components/Employee/Deductions/Deductions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { createMachine } from 'robot3'\nimport { useGarnishmentsListSuspense } from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { useMemo } from 'react'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlow'\nimport {\n IncludeDeductionsFormContextual,\n type DeductionsContextInterface,\n DeductionsListContextual,\n} from './DeductionsComponents'\nimport { deductionsStateMachine } from './stateMachine'\nimport { DeductionsForm } from './DeductionsForm/DeductionsForm'\nimport { DeductionsList } from './DeductionsList/DeductionsList'\nimport { IncludeDeductionsForm } from './IncludeDeductionsForm/IncludeDeductionsForm'\nimport { Flow } from '@/components/Flow/Flow'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useFlow } from '@/components/Flow/useFlow'\n\nexport interface DeductionsProps extends BaseComponentInterface<'Employee.Deductions'> {\n employeeId: string\n}\nfunction DeductionsFlow({ employeeId, onEvent, dictionary }: DeductionsProps) {\n useComponentDictionary('Employee.Deductions', dictionary)\n const { data } = useGarnishmentsListSuspense({ employeeId })\n const deductions = data.garnishmentList!\n const activeDeductions = deductions.filter(deduction => deduction.active)\n const hasExistingDeductions = useMemo(\n () => activeDeductions.length > 0,\n [activeDeductions.length],\n )\n\n // Determine initial state based on existing deductions\n const initialState: 'includeDeductions' | 'viewDeductions' = hasExistingDeductions\n ? 'viewDeductions'\n : 'includeDeductions'\n\n const initialComponent: React.ComponentType = hasExistingDeductions\n ? DeductionsListContextual\n : IncludeDeductionsFormContextual\n\n const manageDeductions = useMemo(\n () =>\n createMachine(\n initialState,\n deductionsStateMachine,\n (initialContext: DeductionsContextInterface) => ({\n ...initialContext,\n component: initialComponent,\n employeeId,\n currentDeductionId: null,\n hasExistingDeductions,\n }),\n ),\n [initialState, initialComponent, employeeId, hasExistingDeductions],\n )\n\n return <Flow machine={manageDeductions} onEvent={onEvent} />\n}\n\nexport function Deductions(props: DeductionsProps) {\n return (\n <BaseComponent {...props}>\n <DeductionsFlow {...props} />\n </BaseComponent>\n )\n}\n\nexport const DeductionsContextual = () => {\n const { employeeId, onEvent } = useFlow<OnboardingContextInterface>()\n const { t } = useTranslation('common')\n\n if (!employeeId) {\n throw new Error(\n t('errors.missingParamsOrContext', {\n component: 'Deductions',\n param: 'employeeId',\n provider: 'FlowProvider',\n }),\n )\n }\n return <Deductions employeeId={employeeId} onEvent={onEvent} />\n}\n\nDeductions.DeductionsForm = DeductionsForm\nDeductions.DeductionsList = DeductionsList\nDeductions.IncludeDeductionsForm = IncludeDeductionsForm\n"],"names":["DeductionsFlow","employeeId","onEvent","dictionary","useComponentDictionary","data","useGarnishmentsListSuspense","activeDeductions","deduction","hasExistingDeductions","useMemo","initialState","initialComponent","DeductionsListContextual","IncludeDeductionsFormContextual","manageDeductions","createMachine","deductionsStateMachine","initialContext","jsx","Flow","Deductions","props","BaseComponent","DeductionsContextual","useFlow","t","useTranslation","DeductionsForm","DeductionsList","IncludeDeductionsForm"],"mappings":";;;;;;;;;;;;;;;AAsBA,SAASA,EAAe,EAAE,YAAAC,GAAY,SAAAC,GAAS,YAAAC,KAA+B;AAC5E,EAAAC,EAAuB,uBAAuBD,CAAU;AACxD,QAAM,EAAE,MAAAE,EAAA,IAASC,EAA4B,EAAE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terface } from '../../Flow/useFlow';
|
|
3
|
+
import { componentEvents } from '../../../shared/constants';
|
|
4
|
+
export type EventPayloads = {
|
|
5
|
+
[componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_YES]: undefined;
|
|
6
|
+
[componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_NO]: undefined;
|
|
7
|
+
[componentEvents.EMPLOYEE_DEDUCTION_ADD]: undefined;
|
|
8
|
+
[componentEvents.EMPLOYEE_DEDUCTION_CREATED]: Garnishment;
|
|
9
|
+
[componentEvents.EMPLOYEE_DEDUCTION_UPDATED]: Garnishment;
|
|
10
|
+
[componentEvents.EMPLOYEE_DEDUCTION_DELETED]: Garnishment;
|
|
11
|
+
[componentEvents.EMPLOYEE_DEDUCTION_EDIT]: Garnishment;
|
|
12
|
+
[componentEvents.EMPLOYEE_DEDUCTION_CANCEL]: undefined;
|
|
13
|
+
[componentEvents.EMPLOYEE_DEDUCTION_DONE]: undefined;
|
|
14
|
+
[componentEvents.CANCEL]: undefined;
|
|
15
|
+
};
|
|
16
|
+
export interface DeductionsContextInterface extends FlowContextInterface {
|
|
17
|
+
employeeId: string;
|
|
18
|
+
currentDeductionId?: string | null;
|
|
19
|
+
hasExistingDeductions?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare function IncludeDeductionsFormContextual(): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare function DeductionsListContextual(): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare function DeductionFormContextual(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { IncludeDeductionsForm as m } from "./IncludeDeductionsForm/IncludeDeductionsForm.js";
|
|
3
|
+
import { DeductionsList as d } from "./DeductionsList/DeductionsList.js";
|
|
4
|
+
import { DeductionsForm as i } from "./DeductionsForm/DeductionsForm.js";
|
|
5
|
+
import { useFlow as n } from "../../Flow/useFlow.js";
|
|
6
|
+
import { ensureRequired as r } from "../../../helpers/ensureRequired.js";
|
|
7
|
+
function D() {
|
|
8
|
+
const { employeeId: e, onEvent: o } = n();
|
|
9
|
+
return /* @__PURE__ */ t(m, { onEvent: o, employeeId: r(e) });
|
|
10
|
+
}
|
|
11
|
+
function y() {
|
|
12
|
+
const { employeeId: e, onEvent: o } = n();
|
|
13
|
+
return /* @__PURE__ */ t(d, { onEvent: o, employeeId: r(e) });
|
|
14
|
+
}
|
|
15
|
+
function x() {
|
|
16
|
+
const { employeeId: e, onEvent: o, currentDeductionId: u } = n();
|
|
17
|
+
return /* @__PURE__ */ t(
|
|
18
|
+
i,
|
|
19
|
+
{
|
|
20
|
+
onEvent: o,
|
|
21
|
+
employeeId: r(e),
|
|
22
|
+
deductionId: u
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
x as DeductionFormContextual,
|
|
28
|
+
y as DeductionsListContextual,
|
|
29
|
+
D as IncludeDeductionsFormContextual
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=DeductionsComponents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeductionsComponents.js","sources":["../../../../src/components/Employee/Deductions/DeductionsComponents.tsx"],"sourcesContent":["import type { Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { IncludeDeductionsForm } from './IncludeDeductionsForm/IncludeDeductionsForm'\nimport { DeductionsList } from './DeductionsList/DeductionsList'\nimport { DeductionsForm } from './DeductionsForm/DeductionsForm'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { componentEvents } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\nexport type EventPayloads = {\n [componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_YES]: undefined\n [componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_NO]: undefined\n [componentEvents.EMPLOYEE_DEDUCTION_ADD]: undefined\n [componentEvents.EMPLOYEE_DEDUCTION_CREATED]: Garnishment\n [componentEvents.EMPLOYEE_DEDUCTION_UPDATED]: Garnishment\n [componentEvents.EMPLOYEE_DEDUCTION_DELETED]: Garnishment\n [componentEvents.EMPLOYEE_DEDUCTION_EDIT]: Garnishment\n [componentEvents.EMPLOYEE_DEDUCTION_CANCEL]: undefined\n [componentEvents.EMPLOYEE_DEDUCTION_DONE]: undefined\n [componentEvents.CANCEL]: undefined\n}\n\nexport interface DeductionsContextInterface extends FlowContextInterface {\n employeeId: string\n currentDeductionId?: string | null\n hasExistingDeductions?: boolean\n}\n\nexport function IncludeDeductionsFormContextual() {\n const { employeeId, onEvent } = useFlow<DeductionsContextInterface>()\n return <IncludeDeductionsForm onEvent={onEvent} employeeId={ensureRequired(employeeId)} />\n}\n\nexport function DeductionsListContextual() {\n const { employeeId, onEvent } = useFlow<DeductionsContextInterface>()\n return <DeductionsList onEvent={onEvent} employeeId={ensureRequired(employeeId)} />\n}\n\nexport function DeductionFormContextual() {\n const { employeeId, onEvent, currentDeductionId } = useFlow<DeductionsContextInterface>()\n\n return (\n <DeductionsForm\n onEvent={onEvent}\n employeeId={ensureRequired(employeeId)}\n deductionId={currentDeductionId}\n />\n )\n}\n"],"names":["IncludeDeductionsFormContextual","employeeId","onEvent","useFlow","IncludeDeductionsForm","ensureRequired","DeductionsListContextual","DeductionsList","DeductionFormContextual","currentDeductionId","jsx","DeductionsForm"],"mappings":";;;;;;AA2BO,SAASA,IAAkC;AAChD,QAAM,EAAE,YAAAC,GAAY,SAAAC,EAAA,IAAYC,EAAA;AAChC,2BAAQC,GAAA,EAAsB,SAAAF,GAAkB,YAAYG,EAAeJ,CAAU,GAAG;AAC1F;AAEO,SAASK,IAA2B;AACzC,QAAM,EAAE,YAAAL,GAAY,SAAAC,EAAA,IAAYC,EAAA;AAChC,2BAAQI,GAAA,EAAe,SAAAL,GAAkB,YAAYG,EAAeJ,CAAU,GAAG;AACnF;AAEO,SAASO,IAA0B;AACxC,QAAM,EAAE,YAAAP,GAAY,SAAAC,GAAS,oBAAAO,EAAA,IAAuBN,EAAA;AAEpD,SACE,gBAAAO;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAAAT;AAAA,MACA,YAAYG,EAAeJ,CAAU;AAAA,MACrC,aAAaQ;AAAA,IAAA;AAAA,EAAA;AAGnB;"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BaseComponentInterface, CommonComponentInterface } from '../../../Base';
|
|
3
|
+
export declare const DeductionSchema: z.ZodObject<{
|
|
4
|
+
active: z.ZodBoolean;
|
|
5
|
+
amount: z.ZodEffects<z.ZodNumber, string, number>;
|
|
6
|
+
description: z.ZodString;
|
|
7
|
+
courtOrdered: z.ZodBoolean;
|
|
8
|
+
times: z.ZodNullable<z.ZodNumber>;
|
|
9
|
+
recurring: z.ZodEffects<z.ZodString, boolean, string>;
|
|
10
|
+
annualMaximum: z.ZodNullable<z.ZodEffects<z.ZodNumber, string | null, number>>;
|
|
11
|
+
payPeriodMaximum: z.ZodNullable<z.ZodEffects<z.ZodNumber, string | null, number>>;
|
|
12
|
+
deductAsPercentage: z.ZodEffects<z.ZodString, boolean, string>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
description: string;
|
|
15
|
+
active: boolean;
|
|
16
|
+
amount: string;
|
|
17
|
+
recurring: boolean;
|
|
18
|
+
courtOrdered: boolean;
|
|
19
|
+
times: number | null;
|
|
20
|
+
annualMaximum: string | null;
|
|
21
|
+
payPeriodMaximum: string | null;
|
|
22
|
+
deductAsPercentage: boolean;
|
|
23
|
+
}, {
|
|
24
|
+
description: string;
|
|
25
|
+
active: boolean;
|
|
26
|
+
amount: number;
|
|
27
|
+
recurring: string;
|
|
28
|
+
courtOrdered: boolean;
|
|
29
|
+
times: number | null;
|
|
30
|
+
annualMaximum: number | null;
|
|
31
|
+
payPeriodMaximum: number | null;
|
|
32
|
+
deductAsPercentage: string;
|
|
33
|
+
}>;
|
|
34
|
+
export type DeductionInputs = z.input<typeof DeductionSchema>;
|
|
35
|
+
export type DeductionPayload = z.output<typeof DeductionSchema>;
|
|
36
|
+
interface DeductionsFormProps extends CommonComponentInterface<'Employee.Deductions'> {
|
|
37
|
+
employeeId: string;
|
|
38
|
+
deductionId?: string | null;
|
|
39
|
+
}
|
|
40
|
+
export declare function DeductionsForm(props: DeductionsFormProps & BaseComponentInterface): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export {};
|