@gusto/embedded-react-sdk 0.34.0 → 0.35.0-rc.1
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 +38 -0
- package/dist/components/Base/Base.d.ts +6 -2
- package/dist/components/Base/Base.js +105 -59
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/useBase.d.ts +1 -0
- package/dist/components/Base/useBase.js.map +1 -1
- package/dist/components/Base/useBaseSubmit.d.ts +1 -1
- package/dist/components/Base/useBaseSubmit.js +60 -33
- package/dist/components/Base/useBaseSubmit.js.map +1 -1
- package/dist/components/Common/HamburgerMenu/HamburgerMenu.d.ts +1 -1
- package/dist/components/Common/HamburgerMenu/HamburgerMenu.js +15 -13
- package/dist/components/Common/HamburgerMenu/HamburgerMenu.js.map +1 -1
- package/dist/components/Common/HamburgerMenu/HamburgerMenuTypes.d.ts +1 -0
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +1 -1
- package/dist/components/Common/UI/Menu/Menu.js +26 -25
- package/dist/components/Common/UI/Menu/Menu.js.map +1 -1
- package/dist/components/Common/UI/Menu/Menu.module.scss.js +7 -7
- package/dist/components/Common/UI/Menu/MenuTypes.d.ts +5 -0
- package/dist/components/Common/UI/Menu/MenuTypes.js +4 -3
- package/dist/components/Common/UI/Menu/MenuTypes.js.map +1 -1
- package/dist/components/Common/UI/Table/Table.module.scss.js +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +12 -12
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +5 -6
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +6 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +3 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
- package/dist/components/Company/PaySchedule/usePaySchedule.js +5 -6
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +1 -1
- package/dist/components/Contractor/Address/useAddress.js +5 -6
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -2
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +119 -113
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +10 -10
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
- package/dist/components/Employee/Compensation/Edit.js +70 -70
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +9 -10
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +10 -11
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +10 -11
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +18 -18
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +7 -7
- package/dist/components/Employee/DocumentSigner/SignatureForm/Form.js +5 -5
- package/dist/components/Employee/DocumentSigner/SignatureForm/Form.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/Preview.js +8 -8
- package/dist/components/Employee/DocumentSigner/SignatureForm/Preview.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +3 -4
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +7 -7
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +3 -4
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +2 -2
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +8 -8
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +5 -6
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
- package/dist/components/Employee/Profile/useProfile.js +3 -4
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/StateTaxes.js +69 -61
- package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +3 -4
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +7 -7
- package/dist/components/Employee/Taxes/useTaxes.js +3 -4
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +10 -10
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +9 -9
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.d.ts +2 -0
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +101 -0
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -0
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.module.scss.js +16 -0
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.module.scss.js.map +1 -0
- package/dist/components/Payroll/GrossUpModal/GrossUpModalTypes.d.ts +7 -0
- package/dist/components/Payroll/GrossUpModal/index.d.ts +3 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +86 -67
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +83 -49
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +6 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +102 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.module.scss.js +14 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.module.scss.js.map +1 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js +52 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js.map +1 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.module.scss.js +16 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.module.scss.js.map +1 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts +12 -2
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js +15 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js.map +1 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/index.d.ts +2 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +212 -120
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +3 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +76 -64
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.d.ts +2 -0
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js +11 -0
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js.map +1 -0
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +67 -57
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +36 -36
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +6 -6
- package/dist/components/Payroll/usePreparedPayrollData.js +44 -44
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +2 -0
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +58 -39
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/ObservabilityProvider/ObservabilityContext.d.ts +5 -0
- package/dist/contexts/ObservabilityProvider/ObservabilityContext.js +6 -0
- package/dist/contexts/ObservabilityProvider/ObservabilityContext.js.map +1 -0
- package/dist/contexts/ObservabilityProvider/ObservabilityProvider.d.ts +7 -0
- package/dist/contexts/ObservabilityProvider/ObservabilityProvider.js +11 -0
- package/dist/contexts/ObservabilityProvider/ObservabilityProvider.js.map +1 -0
- package/dist/contexts/ObservabilityProvider/index.d.ts +5 -0
- package/dist/contexts/ObservabilityProvider/observabilityUtils.d.ts +5 -0
- package/dist/contexts/ObservabilityProvider/observabilityUtils.js +45 -0
- package/dist/contexts/ObservabilityProvider/observabilityUtils.js.map +1 -0
- package/dist/contexts/ObservabilityProvider/sanitization.d.ts +19 -0
- package/dist/contexts/ObservabilityProvider/sanitization.js +95 -0
- package/dist/contexts/ObservabilityProvider/sanitization.js.map +1 -0
- package/dist/contexts/ObservabilityProvider/sanitization.test.d.ts +1 -0
- package/dist/contexts/ObservabilityProvider/useObservability.d.ts +2 -0
- package/dist/contexts/ObservabilityProvider/useObservability.js +11 -0
- package/dist/contexts/ObservabilityProvider/useObservability.js.map +1 -0
- package/dist/contexts/ObservabilityProvider/useSanitizedObservability.d.ts +8 -0
- package/dist/contexts/ObservabilityProvider/useSanitizedObservability.js +28 -0
- package/dist/contexts/ObservabilityProvider/useSanitizedObservability.js.map +1 -0
- package/dist/contexts/index.d.ts +2 -0
- package/dist/helpers/formattedStrings.js +12 -13
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/helpers/rem.d.ts +7 -3
- package/dist/helpers/rem.js +14 -10
- package/dist/helpers/rem.js.map +1 -1
- package/dist/helpers/rem.test.d.ts +1 -0
- package/dist/helpers/retryAsync.d.ts +7 -0
- package/dist/helpers/retryAsync.js +18 -0
- package/dist/helpers/retryAsync.js.map +1 -0
- package/dist/i18n/I18n.js +15 -15
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.PaySchedule.json.js +1 -1
- package/dist/i18n/en/Payroll.GrossUpModal.json.js +24 -0
- package/dist/i18n/en/Payroll.GrossUpModal.json.js.map +1 -0
- package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js +13 -11
- package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +19 -13
- package/dist/index.js.map +1 -1
- package/dist/shared/constants.d.ts +5 -0
- package/dist/shared/constants.js +11 -8
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +26 -1
- package/dist/types/observability.d.ts +145 -0
- package/docs/reference/endpoint-inventory.json +10 -1
- package/package.json +21 -21
|
@@ -12,18 +12,17 @@ import { Form as $ } from "../../../Common/Form/Form.js";
|
|
|
12
12
|
import { Flex as m } from "../../../Common/Flex/Flex.js";
|
|
13
13
|
import "classnames";
|
|
14
14
|
import { componentEvents as f } from "../../../../shared/constants.js";
|
|
15
|
-
import {
|
|
16
|
-
import { TextInputField as z } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
17
|
-
import { ActionsLayout as H } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
18
|
-
import { NumberInputField as c } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
15
|
+
import { ActionsLayout as z } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
19
16
|
import "react-error-boundary";
|
|
20
17
|
import "@gusto/embedded-api/models/errors/gustoembeddederror";
|
|
21
18
|
import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
22
19
|
import "@tanstack/react-query";
|
|
23
|
-
import { useBase as
|
|
20
|
+
import { useBase as H } from "../../../Base/useBase.js";
|
|
24
21
|
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
25
22
|
import "dompurify";
|
|
26
|
-
import "
|
|
23
|
+
import { TextInputField as Y } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
24
|
+
import { RadioGroupField as h } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
25
|
+
import { NumberInputField as c } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
27
26
|
const p = "Number must be greater than or equal to 0", k = r.object({
|
|
28
27
|
active: r.boolean(),
|
|
29
28
|
amount: r.number().min(0, { error: p }).transform(String),
|
|
@@ -36,14 +35,14 @@ const p = "Number must be greater than or equal to 0", k = r.object({
|
|
|
36
35
|
deductAsPercentage: r.boolean(),
|
|
37
36
|
garnishmentType: r.enum(w)
|
|
38
37
|
});
|
|
39
|
-
function
|
|
38
|
+
function De({
|
|
40
39
|
deduction: e,
|
|
41
40
|
employeeId: A,
|
|
42
41
|
selectedGarnishmentType: D,
|
|
43
42
|
selectedGarnishmentTitle: y,
|
|
44
43
|
onCancel: x
|
|
45
44
|
}) {
|
|
46
|
-
const { onEvent: d, baseSubmitHandler: E } =
|
|
45
|
+
const { onEvent: d, baseSubmitHandler: E } = H(), { t: n } = N("Employee.Deductions"), u = j(), { mutateAsync: P, isPending: T } = B(), { mutateAsync: R, isPending: v } = U(), M = T || v, O = I(() => ({
|
|
47
46
|
amount: e?.amount ? Number(e.amount) : 0,
|
|
48
47
|
description: e?.description ?? "",
|
|
49
48
|
times: e?.times ?? null,
|
|
@@ -88,7 +87,7 @@ function ye({
|
|
|
88
87
|
/* @__PURE__ */ t(u.Heading, { as: "h3", children: y }),
|
|
89
88
|
/* @__PURE__ */ o(m, { flexDirection: "column", gap: 20, children: [
|
|
90
89
|
/* @__PURE__ */ o(m, { flexDirection: "column", gap: 20, children: [
|
|
91
|
-
/* @__PURE__ */ t(
|
|
90
|
+
/* @__PURE__ */ t(Y, { name: "description", label: n("descriptionLabelV2"), isRequired: !0 }),
|
|
92
91
|
/* @__PURE__ */ t(
|
|
93
92
|
h,
|
|
94
93
|
{
|
|
@@ -152,7 +151,7 @@ function ye({
|
|
|
152
151
|
)
|
|
153
152
|
] })
|
|
154
153
|
] }),
|
|
155
|
-
/* @__PURE__ */ o(
|
|
154
|
+
/* @__PURE__ */ o(z, { children: [
|
|
156
155
|
/* @__PURE__ */ t(u.Button, { variant: "secondary", onClick: F, children: n("cancelCta") }),
|
|
157
156
|
/* @__PURE__ */ t(u.Button, { type: "submit", isLoading: M, children: n("saveCta") })
|
|
158
157
|
] })
|
|
@@ -160,6 +159,6 @@ function ye({
|
|
|
160
159
|
}
|
|
161
160
|
export {
|
|
162
161
|
k as DeductionSchema,
|
|
163
|
-
|
|
162
|
+
De as default
|
|
164
163
|
};
|
|
165
164
|
//# sourceMappingURL=GarnishmentForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GarnishmentForm.js","sources":["../../../../../src/components/Employee/Deductions/DeductionsForm/GarnishmentForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { FormProvider, useForm, useWatch, type SubmitHandler } from 'react-hook-form'\nimport { useMemo } from 'react'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { type Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { GarnishmentType } from '@gusto/embedded-api/models/operations/postv1employeesemployeeidgarnishments'\nimport { useGarnishmentsCreateMutation } from '@gusto/embedded-api/react-query/garnishmentsCreate'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api/react-query/garnishmentsUpdate'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { NumberInputField, TextInputField, RadioGroupField } from '@/components/Common'\nimport { type CommonComponentInterface, useBase } from '@/components/Base'\nimport { componentEvents } from '@/shared/constants'\n\nconst NON_NEGATIVE_ERROR = 'Number must be greater than or equal to 0'\n\nexport const DeductionSchema = z.object({\n active: z.boolean(),\n amount: z.number().min(0, { error: NON_NEGATIVE_ERROR }).transform(String),\n description: z.string().min(1),\n courtOrdered: z.boolean(),\n times: z.number().nullable(),\n recurring: z.boolean(),\n annualMaximum: z\n .number()\n .min(0, { error: NON_NEGATIVE_ERROR })\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n totalAmount: z\n .number()\n .min(0, { error: NON_NEGATIVE_ERROR })\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n deductAsPercentage: z.boolean(),\n garnishmentType: z.enum(GarnishmentType),\n})\n\nexport type DeductionInputs = z.input<typeof DeductionSchema>\nexport type DeductionPayload = z.output<typeof DeductionSchema>\n\ninterface GarnishmentFormProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n deduction?: Garnishment | null\n selectedGarnishmentType: GarnishmentType\n selectedGarnishmentTitle: string\n onCancel: () => void\n}\n\nfunction GarnishmentForm({\n deduction,\n employeeId,\n selectedGarnishmentType,\n selectedGarnishmentTitle,\n onCancel,\n}: GarnishmentFormProps) {\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n const { mutateAsync: createDeduction, isPending: isPendingCreate } =\n useGarnishmentsCreateMutation()\n const { mutateAsync: updateDeduction, isPending: isPendingUpdate } =\n useGarnishmentsUpdateMutation()\n const isPending = isPendingCreate || isPendingUpdate\n\n const defaultValues: DeductionInputs = useMemo(() => {\n return {\n amount: deduction?.amount ? Number(deduction.amount) : 0,\n description: deduction?.description ?? '',\n times: deduction?.times ?? null,\n recurring: deduction?.recurring ?? true,\n annualMaximum: deduction?.annualMaximum ? Number(deduction.annualMaximum) : null,\n totalAmount: deduction?.totalAmount ? Number(deduction.totalAmount) : null,\n deductAsPercentage: deduction?.deductAsPercentage ?? true,\n active: true,\n courtOrdered: true,\n garnishmentType: deduction?.garnishmentType ?? selectedGarnishmentType,\n }\n }, [deduction])\n\n const formMethods = useForm<DeductionInputs, unknown, DeductionPayload>({\n resolver: zodResolver(DeductionSchema),\n defaultValues,\n })\n const { control } = formMethods\n const watchedRecurring = useWatch({ control, name: 'recurring' })\n const watchedAmountPercentage = useWatch({ control, name: 'deductAsPercentage' })\n\n const onSubmit: SubmitHandler<DeductionPayload> = async data => {\n await baseSubmitHandler(data, async payload => {\n if (!deduction) {\n const { garnishment: createDeductionResponse } = await createDeduction({\n request: {\n employeeId: employeeId,\n requestBody: { ...payload, times: payload.recurring ? null : 1 },\n },\n })\n\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CREATED, createDeductionResponse)\n } else {\n const { garnishment: updateDeductionResponse } = await updateDeduction({\n request: {\n garnishmentId: deduction.uuid,\n requestBody: {\n ...payload,\n version: deduction.version as string,\n times: payload.recurring ? null : 1,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_UPDATED, updateDeductionResponse)\n }\n })\n }\n\n const handleCancel = () => {\n onCancel()\n }\n\n return (\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n <>\n <Components.Heading as=\"h3\">{selectedGarnishmentTitle}</Components.Heading>\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={20}>\n <TextInputField name=\"description\" label={t('descriptionLabelV2')} isRequired />\n <RadioGroupField\n name=\"recurring\"\n label={t('frequencyLabel')}\n isRequired\n options={[\n { value: true, label: t('frequencyRecurringOptionV2') },\n { value: false, label: t('frequencyOneTimeOptionV2') },\n ]}\n />\n <RadioGroupField\n name=\"deductAsPercentage\"\n label={t('deductionTypeLabelV2')}\n isRequired\n options={[\n { value: true, label: t('deductionTypePercentageOptionV2') },\n { value: false, label: t('deductionTypeFixedAmountOption') },\n ]}\n />\n <NumberInputField\n name=\"amount\"\n adornmentStart={!watchedAmountPercentage && '$'}\n adornmentEnd={watchedAmountPercentage && '%'}\n label={t('deductionAmountLabel')}\n isRequired\n min={0}\n format={watchedAmountPercentage ? 'percent' : 'currency'}\n description={\n watchedAmountPercentage\n ? t('deductionAmountDescriptionPercentage')\n : t('deductionAmountDescriptionFixed')\n }\n />\n </Flex>\n {watchedRecurring && (\n <Flex flexDirection=\"column\" gap={20}>\n <NumberInputField\n name=\"totalAmount\"\n adornmentStart=\"$\"\n format=\"currency\"\n label={t('totalAmountLabel')}\n description={t('totalAmountDescription')}\n min={0}\n />\n <NumberInputField\n name=\"annualMaximum\"\n adornmentStart=\"$\"\n format=\"currency\"\n label={t('annualMaxLabel')}\n min={0}\n description={t('annualMaxDescription')}\n />\n </Flex>\n )}\n </Flex>\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n </>\n </Flex>\n </Form>\n </FormProvider>\n )\n}\n\nexport default GarnishmentForm\n"],"names":["NON_NEGATIVE_ERROR","DeductionSchema","z","val","GarnishmentType","GarnishmentForm","deduction","employeeId","selectedGarnishmentType","selectedGarnishmentTitle","onCancel","onEvent","baseSubmitHandler","useBase","t","useTranslation","Components","useComponentContext","createDeduction","isPendingCreate","useGarnishmentsCreateMutation","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","isPending","defaultValues","useMemo","formMethods","useForm","zodResolver","control","watchedRecurring","useWatch","watchedAmountPercentage","onSubmit","data","payload","updateDeductionResponse","componentEvents","createDeductionResponse","handleCancel","FormProvider","jsx","Form","Flex","jsxs","Fragment","TextInputField","RadioGroupField","NumberInputField","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAMA,IAAqB,6CAEdC,IAAkBC,EAAE,OAAO;AAAA,EACtC,QAAQA,EAAE,QAAA;AAAA,EACV,QAAQA,EAAE,OAAA,EAAS,IAAI,GAAG,EAAE,OAAOF,EAAA,CAAoB,EAAE,UAAU,MAAM;AAAA,EACzE,aAAaE,EAAE,SAAS,IAAI,CAAC;AAAA,EAC7B,cAAcA,EAAE,QAAA;AAAA,EAChB,OAAOA,EAAE,OAAA,EAAS,SAAA;AAAA,EAClB,WAAWA,EAAE,QAAA;AAAA,EACb,eAAeA,EACZ,SACA,IAAI,GAAG,EAAE,OAAOF,GAAoB,EACpC,UAAU,CAAAG,MAAQA,IAAM,IAAIA,EAAI,aAAa,IAAK,EAClD,SAAA;AAAA,EACH,aAAaD,EAC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,MAAK;AAAA,YACL,gBAAe;AAAA,YACf,QAAO;AAAA,YACP,OAAOnC,EAAE,gBAAgB;AAAA,YACzB,KAAK;AAAA,YACL,aAAaA,EAAE,sBAAsB;AAAA,UAAA;AAAA,QAAA;AAAA,MACvC,EAAA,CACF;AAAA,IAAA,GAEJ;AAAA,sBACCoC,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAR,EAAC1B,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASwB,GAC7C,UAAA1B,EAAE,WAAW,EAAA,CAChB;AAAA,MACA,gBAAA4B,EAAC1B,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWQ,GACzC,UAAAV,EAAE,SAAS,EAAA,CACd;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"GarnishmentForm.js","sources":["../../../../../src/components/Employee/Deductions/DeductionsForm/GarnishmentForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { FormProvider, useForm, useWatch, type SubmitHandler } from 'react-hook-form'\nimport { useMemo } from 'react'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { type Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { GarnishmentType } from '@gusto/embedded-api/models/operations/postv1employeesemployeeidgarnishments'\nimport { useGarnishmentsCreateMutation } from '@gusto/embedded-api/react-query/garnishmentsCreate'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api/react-query/garnishmentsUpdate'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { NumberInputField, TextInputField, RadioGroupField } from '@/components/Common'\nimport { type CommonComponentInterface, useBase } from '@/components/Base'\nimport { componentEvents } from '@/shared/constants'\n\nconst NON_NEGATIVE_ERROR = 'Number must be greater than or equal to 0'\n\nexport const DeductionSchema = z.object({\n active: z.boolean(),\n amount: z.number().min(0, { error: NON_NEGATIVE_ERROR }).transform(String),\n description: z.string().min(1),\n courtOrdered: z.boolean(),\n times: z.number().nullable(),\n recurring: z.boolean(),\n annualMaximum: z\n .number()\n .min(0, { error: NON_NEGATIVE_ERROR })\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n totalAmount: z\n .number()\n .min(0, { error: NON_NEGATIVE_ERROR })\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n deductAsPercentage: z.boolean(),\n garnishmentType: z.enum(GarnishmentType),\n})\n\nexport type DeductionInputs = z.input<typeof DeductionSchema>\nexport type DeductionPayload = z.output<typeof DeductionSchema>\n\ninterface GarnishmentFormProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n deduction?: Garnishment | null\n selectedGarnishmentType: GarnishmentType\n selectedGarnishmentTitle: string\n onCancel: () => void\n}\n\nfunction GarnishmentForm({\n deduction,\n employeeId,\n selectedGarnishmentType,\n selectedGarnishmentTitle,\n onCancel,\n}: GarnishmentFormProps) {\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n const { mutateAsync: createDeduction, isPending: isPendingCreate } =\n useGarnishmentsCreateMutation()\n const { mutateAsync: updateDeduction, isPending: isPendingUpdate } =\n useGarnishmentsUpdateMutation()\n const isPending = isPendingCreate || isPendingUpdate\n\n const defaultValues: DeductionInputs = useMemo(() => {\n return {\n amount: deduction?.amount ? Number(deduction.amount) : 0,\n description: deduction?.description ?? '',\n times: deduction?.times ?? null,\n recurring: deduction?.recurring ?? true,\n annualMaximum: deduction?.annualMaximum ? Number(deduction.annualMaximum) : null,\n totalAmount: deduction?.totalAmount ? Number(deduction.totalAmount) : null,\n deductAsPercentage: deduction?.deductAsPercentage ?? true,\n active: true,\n courtOrdered: true,\n garnishmentType: deduction?.garnishmentType ?? selectedGarnishmentType,\n }\n }, [deduction])\n\n const formMethods = useForm<DeductionInputs, unknown, DeductionPayload>({\n resolver: zodResolver(DeductionSchema),\n defaultValues,\n })\n const { control } = formMethods\n const watchedRecurring = useWatch({ control, name: 'recurring' })\n const watchedAmountPercentage = useWatch({ control, name: 'deductAsPercentage' })\n\n const onSubmit: SubmitHandler<DeductionPayload> = async data => {\n await baseSubmitHandler(data, async payload => {\n if (!deduction) {\n const { garnishment: createDeductionResponse } = await createDeduction({\n request: {\n employeeId: employeeId,\n requestBody: { ...payload, times: payload.recurring ? null : 1 },\n },\n })\n\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CREATED, createDeductionResponse)\n } else {\n const { garnishment: updateDeductionResponse } = await updateDeduction({\n request: {\n garnishmentId: deduction.uuid,\n requestBody: {\n ...payload,\n version: deduction.version as string,\n times: payload.recurring ? null : 1,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_UPDATED, updateDeductionResponse)\n }\n })\n }\n\n const handleCancel = () => {\n onCancel()\n }\n\n return (\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n <>\n <Components.Heading as=\"h3\">{selectedGarnishmentTitle}</Components.Heading>\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={20}>\n <TextInputField name=\"description\" label={t('descriptionLabelV2')} isRequired />\n <RadioGroupField\n name=\"recurring\"\n label={t('frequencyLabel')}\n isRequired\n options={[\n { value: true, label: t('frequencyRecurringOptionV2') },\n { value: false, label: t('frequencyOneTimeOptionV2') },\n ]}\n />\n <RadioGroupField\n name=\"deductAsPercentage\"\n label={t('deductionTypeLabelV2')}\n isRequired\n options={[\n { value: true, label: t('deductionTypePercentageOptionV2') },\n { value: false, label: t('deductionTypeFixedAmountOption') },\n ]}\n />\n <NumberInputField\n name=\"amount\"\n adornmentStart={!watchedAmountPercentage && '$'}\n adornmentEnd={watchedAmountPercentage && '%'}\n label={t('deductionAmountLabel')}\n isRequired\n min={0}\n format={watchedAmountPercentage ? 'percent' : 'currency'}\n description={\n watchedAmountPercentage\n ? t('deductionAmountDescriptionPercentage')\n : t('deductionAmountDescriptionFixed')\n }\n />\n </Flex>\n {watchedRecurring && (\n <Flex flexDirection=\"column\" gap={20}>\n <NumberInputField\n name=\"totalAmount\"\n adornmentStart=\"$\"\n format=\"currency\"\n label={t('totalAmountLabel')}\n description={t('totalAmountDescription')}\n min={0}\n />\n <NumberInputField\n name=\"annualMaximum\"\n adornmentStart=\"$\"\n format=\"currency\"\n label={t('annualMaxLabel')}\n min={0}\n description={t('annualMaxDescription')}\n />\n </Flex>\n )}\n </Flex>\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n </>\n </Flex>\n </Form>\n </FormProvider>\n )\n}\n\nexport default GarnishmentForm\n"],"names":["NON_NEGATIVE_ERROR","DeductionSchema","z","val","GarnishmentType","GarnishmentForm","deduction","employeeId","selectedGarnishmentType","selectedGarnishmentTitle","onCancel","onEvent","baseSubmitHandler","useBase","t","useTranslation","Components","useComponentContext","createDeduction","isPendingCreate","useGarnishmentsCreateMutation","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","isPending","defaultValues","useMemo","formMethods","useForm","zodResolver","control","watchedRecurring","useWatch","watchedAmountPercentage","onSubmit","data","payload","updateDeductionResponse","componentEvents","createDeductionResponse","handleCancel","FormProvider","jsx","Form","Flex","jsxs","Fragment","TextInputField","RadioGroupField","NumberInputField","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAMA,IAAqB,6CAEdC,IAAkBC,EAAE,OAAO;AAAA,EACtC,QAAQA,EAAE,QAAA;AAAA,EACV,QAAQA,EAAE,OAAA,EAAS,IAAI,GAAG,EAAE,OAAOF,EAAA,CAAoB,EAAE,UAAU,MAAM;AAAA,EACzE,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Ac,UAAS,KAAK,IAChC,UAAA;AAAA,QAAA,gBAAAF;AAAA,UAACO;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,gBAAe;AAAA,YACf,QAAO;AAAA,YACP,OAAOnC,EAAE,kBAAkB;AAAA,YAC3B,aAAaA,EAAE,wBAAwB;AAAA,YACvC,KAAK;AAAA,UAAA;AAAA,QAAA;AAAA,QAEP,gBAAA4B;AAAA,UAACO;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,gBAAe;AAAA,YACf,QAAO;AAAA,YACP,OAAOnC,EAAE,gBAAgB;AAAA,YACzB,KAAK;AAAA,YACL,aAAaA,EAAE,sBAAsB;AAAA,UAAA;AAAA,QAAA;AAAA,MACvC,EAAA,CACF;AAAA,IAAA,GAEJ;AAAA,sBACCoC,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAR,EAAC1B,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASwB,GAC7C,UAAA1B,EAAE,WAAW,EAAA,CAChB;AAAA,MACA,gBAAA4B,EAAC1B,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWQ,GACzC,UAAAV,EAAE,SAAS,EAAA,CACd;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
@@ -11,11 +11,10 @@ import "classnames";
|
|
|
11
11
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
12
|
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
13
13
|
import "dompurify";
|
|
14
|
-
import "../../../../contexts/LocaleProvider/useLocale.js";
|
|
15
14
|
import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
15
|
+
const [d, a] = t("DocumentListContext");
|
|
17
16
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
a as DocumentListProvider,
|
|
18
|
+
d as useDocumentList
|
|
20
19
|
};
|
|
21
20
|
//# sourceMappingURL=useDocumentList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDocumentList.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n employeeForms: Form[]\n hasSignedAllForms: boolean\n handleContinue: () => void\n handleRequestFormToSign: (form: Form) => void\n documentListError: Error | null\n formToSign?: Form\n}\n\nconst [useDocumentList, DocumentListProvider] =\n createCompoundContext<DocumentListContextType>('DocumentListContext')\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDocumentList.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n employeeForms: Form[]\n hasSignedAllForms: boolean\n handleContinue: () => void\n handleRequestFormToSign: (form: Form) => void\n documentListError: Error | null\n formToSign?: Form\n}\n\nconst [useDocumentList, DocumentListProvider] =\n createCompoundContext<DocumentListContextType>('DocumentListContext')\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAYA,MAAM,CAACA,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
|
|
@@ -9,15 +9,15 @@ import { COUNTRIES as P } from "./countries.js";
|
|
|
9
9
|
import { Flex as b } from "../../../Common/Flex/Flex.js";
|
|
10
10
|
import "classnames";
|
|
11
11
|
import "../../../../shared/constants.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
12
|
+
import { ActionsLayout as V } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
13
|
+
import { useComponentContext as B } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
+
import { ComboBoxField as H } from "../../../Common/Fields/ComboBoxField/ComboBoxField.js";
|
|
15
|
+
import { Form as K } from "../../../Common/Form/Form.js";
|
|
16
|
+
import { useI18n as M } from "../../../../i18n/I18n.js";
|
|
17
|
+
import { SelectField as G } from "../../../Common/Fields/SelectField/SelectField.js";
|
|
18
|
+
import { RadioGroupField as U } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
19
|
+
import { TextInputField as W } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
20
|
+
import { DatePickerField as J } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
|
|
21
21
|
const Q = {
|
|
22
22
|
citizen: "statusDescriptions.citizen",
|
|
23
23
|
permanent_resident: "statusDescriptions.permanent_resident",
|
|
@@ -29,8 +29,8 @@ const Q = {
|
|
|
29
29
|
hasDocumentNumber: y,
|
|
30
30
|
isPending: g
|
|
31
31
|
}) => {
|
|
32
|
-
|
|
33
|
-
const { Heading: D, Text: x, Alert: z, Button: E, Link: N } =
|
|
32
|
+
M("Employee.EmploymentEligibility");
|
|
33
|
+
const { Heading: D, Text: x, Alert: z, Button: E, Link: N } = B(), { t: e } = L("Employee.EmploymentEligibility"), [m, a] = I(!!y), r = O({
|
|
34
34
|
resolver: j(k(m)),
|
|
35
35
|
defaultValues: f
|
|
36
36
|
}), { control: l, setValue: u, clearErrors: c } = r, o = d({ control: l, name: "authorizationStatus" }), s = d({ control: l, name: "documentType" }), _ = Object.values(q).map((n) => ({
|
|
@@ -47,7 +47,7 @@ const Q = {
|
|
|
47
47
|
uscis_alien_registration_number: 9,
|
|
48
48
|
form_i94: 11
|
|
49
49
|
};
|
|
50
|
-
return /* @__PURE__ */ t($, { ...r, children: /* @__PURE__ */ t(
|
|
50
|
+
return /* @__PURE__ */ t($, { ...r, children: /* @__PURE__ */ t(K, { onSubmit: r.handleSubmit(h), children: /* @__PURE__ */ p(b, { flexDirection: "column", gap: 16, children: [
|
|
51
51
|
/* @__PURE__ */ p(b, { flexDirection: "column", gap: 2, children: [
|
|
52
52
|
/* @__PURE__ */ t(D, { as: "h2", children: e("title") }),
|
|
53
53
|
/* @__PURE__ */ t(x, { variant: "supporting", children: /* @__PURE__ */ t(
|
|
@@ -62,7 +62,7 @@ const Q = {
|
|
|
62
62
|
) })
|
|
63
63
|
] }),
|
|
64
64
|
/* @__PURE__ */ t(
|
|
65
|
-
|
|
65
|
+
G,
|
|
66
66
|
{
|
|
67
67
|
name: "authorizationStatus",
|
|
68
68
|
label: e("select.label"),
|
|
@@ -81,9 +81,9 @@ const Q = {
|
|
|
81
81
|
disableScrollIntoView: !0
|
|
82
82
|
}
|
|
83
83
|
),
|
|
84
|
-
o === "alien" && /* @__PURE__ */ t(
|
|
84
|
+
o === "alien" && /* @__PURE__ */ t(J, { name: "expirationDate", label: e("expirationDate.label") }),
|
|
85
85
|
F && /* @__PURE__ */ t(
|
|
86
|
-
|
|
86
|
+
U,
|
|
87
87
|
{
|
|
88
88
|
name: "documentType",
|
|
89
89
|
label: e("authorizationDocument.label"),
|
|
@@ -93,7 +93,7 @@ const Q = {
|
|
|
93
93
|
}
|
|
94
94
|
),
|
|
95
95
|
R && i && /* @__PURE__ */ t(
|
|
96
|
-
|
|
96
|
+
W,
|
|
97
97
|
{
|
|
98
98
|
name: "documentNumber",
|
|
99
99
|
label: e(`documentNumber.${i}.label`),
|
|
@@ -104,7 +104,7 @@ const Q = {
|
|
|
104
104
|
}
|
|
105
105
|
),
|
|
106
106
|
s === "foreign_passport" && o === "alien" && /* @__PURE__ */ t(
|
|
107
|
-
|
|
107
|
+
H,
|
|
108
108
|
{
|
|
109
109
|
name: "country",
|
|
110
110
|
label: e("country.label"),
|
|
@@ -115,7 +115,7 @@ const Q = {
|
|
|
115
115
|
isRequired: !0
|
|
116
116
|
}
|
|
117
117
|
),
|
|
118
|
-
/* @__PURE__ */ t(
|
|
118
|
+
/* @__PURE__ */ t(V, { children: /* @__PURE__ */ t(E, { type: "submit", isLoading: g, children: e("submit") }) })
|
|
119
119
|
] }) }) });
|
|
120
120
|
};
|
|
121
121
|
export {
|
|
@@ -14,13 +14,13 @@ import { useI18n as Y } from "../../../../i18n/I18n.js";
|
|
|
14
14
|
import { componentEvents as C, STATES_ABBR as K } from "../../../../shared/constants.js";
|
|
15
15
|
import { Flex as f } from "../../../Common/Flex/Flex.js";
|
|
16
16
|
import "classnames";
|
|
17
|
-
import {
|
|
18
|
-
import { TextInputField as c } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
19
|
-
import { ActionsLayout as Z } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
17
|
+
import { ActionsLayout as U } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
20
18
|
import { useComponentContext as S } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
21
19
|
import "react";
|
|
22
|
-
import { Form as
|
|
20
|
+
import { Form as Z } from "../../../Common/Form/Form.js";
|
|
21
|
+
import { TextInputField as c } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
23
22
|
import { CheckboxField as P } from "../../../Common/Fields/CheckboxField/CheckboxField.js";
|
|
23
|
+
import { RadioGroupField as Q } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
24
24
|
import { SelectField as X } from "../../../Common/Fields/SelectField/SelectField.js";
|
|
25
25
|
import { DocumentViewer as J } from "../../../Common/DocumentViewer/DocumentViewer.js";
|
|
26
26
|
const W = 4, ee = l.object({
|
|
@@ -73,7 +73,7 @@ function te({ employeeId: i, formId: a, className: o }) {
|
|
|
73
73
|
n(C.EMPLOYEE_SIGN_FORM, z);
|
|
74
74
|
});
|
|
75
75
|
};
|
|
76
|
-
return /* @__PURE__ */ e("section", { className: o, children: /* @__PURE__ */ e(q, { ...A, children: /* @__PURE__ */ e(
|
|
76
|
+
return /* @__PURE__ */ e("section", { className: o, children: /* @__PURE__ */ e(q, { ...A, children: /* @__PURE__ */ e(Z, { onSubmit: A.handleSubmit(_), children: /* @__PURE__ */ m(f, { flexDirection: "column", gap: 20, children: [
|
|
77
77
|
/* @__PURE__ */ m("section", { children: [
|
|
78
78
|
/* @__PURE__ */ e(p.Heading, { as: "h2", children: t("title") }),
|
|
79
79
|
/* @__PURE__ */ e(p.Text, { children: /* @__PURE__ */ e(
|
|
@@ -133,7 +133,7 @@ function te({ employeeId: i, formId: a, className: o }) {
|
|
|
133
133
|
)
|
|
134
134
|
] }),
|
|
135
135
|
/* @__PURE__ */ e(ne, {}),
|
|
136
|
-
/* @__PURE__ */ m(
|
|
136
|
+
/* @__PURE__ */ m(U, { children: [
|
|
137
137
|
/* @__PURE__ */ e(p.Button, { variant: "secondary", type: "button", onClick: $, children: t("cancelCta") }),
|
|
138
138
|
/* @__PURE__ */ e(p.Button, { type: "submit", isLoading: R, children: t("signCta") })
|
|
139
139
|
] })
|
|
@@ -186,7 +186,7 @@ function ne() {
|
|
|
186
186
|
};
|
|
187
187
|
return /* @__PURE__ */ m(f, { flexDirection: "column", gap: 20, children: [
|
|
188
188
|
/* @__PURE__ */ e(
|
|
189
|
-
|
|
189
|
+
Q,
|
|
190
190
|
{
|
|
191
191
|
name: "usedPreparer",
|
|
192
192
|
label: i("preparerQuestion"),
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { SignatureFormFields as
|
|
2
|
+
import { useTranslation as e } from "react-i18next";
|
|
3
|
+
import { SignatureFormFields as o } from "../../../Common/SignatureForm/SignatureFormFields.js";
|
|
4
4
|
function m() {
|
|
5
|
-
const { t: r } =
|
|
5
|
+
const { t: r } = e("Employee.DocumentSigner");
|
|
6
6
|
return /* @__PURE__ */ i(
|
|
7
|
-
|
|
7
|
+
o,
|
|
8
8
|
{
|
|
9
|
-
signatureLabel: "
|
|
9
|
+
signatureLabel: r("signatureFieldLabel"),
|
|
10
10
|
signatureDescription: r("signatureFieldDescription"),
|
|
11
11
|
signatureError: r("signatureFieldError"),
|
|
12
12
|
confirmationLabel: r("confirmSignatureCheckboxLabel"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/Form.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { SignatureFormFields } from '@/components/Common/SignatureForm'\n\nexport function Form() {\n const { t } = useTranslation('Employee.DocumentSigner')\n return (\n <SignatureFormFields\n signatureLabel
|
|
1
|
+
{"version":3,"file":"Form.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/Form.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { SignatureFormFields } from '@/components/Common/SignatureForm'\n\nexport function Form() {\n const { t } = useTranslation('Employee.DocumentSigner')\n return (\n <SignatureFormFields\n signatureLabel={t('signatureFieldLabel')}\n signatureDescription={t('signatureFieldDescription')}\n signatureError={t('signatureFieldError')}\n confirmationLabel={t('confirmSignatureCheckboxLabel')}\n confirmationError={t('confirmSignatureError')}\n />\n )\n}\n"],"names":["Form","t","useTranslation","jsx","SignatureFormFields"],"mappings":";;;AAGO,SAASA,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB;AACtD,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,gBAAgBH,EAAE,qBAAqB;AAAA,MACvC,sBAAsBA,EAAE,2BAA2B;AAAA,MACnD,gBAAgBA,EAAE,qBAAqB;AAAA,MACvC,mBAAmBA,EAAE,+BAA+B;AAAA,MACpD,mBAAmBA,EAAE,uBAAuB;AAAA,IAAA;AAAA,EAAA;AAGlD;"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useTranslation as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as n } from "react-i18next";
|
|
3
3
|
import { useSignatureForm as i } from "./useSignatureForm.js";
|
|
4
4
|
import { DocumentViewer as m } from "../../../Common/DocumentViewer/DocumentViewer.js";
|
|
5
|
-
function
|
|
6
|
-
const { form: t, pdfUrl:
|
|
7
|
-
return /* @__PURE__ */
|
|
5
|
+
function a() {
|
|
6
|
+
const { form: t, pdfUrl: e } = i(), { t: o } = n("Employee.DocumentSigner");
|
|
7
|
+
return /* @__PURE__ */ r(
|
|
8
8
|
m,
|
|
9
9
|
{
|
|
10
|
-
url:
|
|
10
|
+
url: e,
|
|
11
11
|
title: t.title,
|
|
12
|
-
downloadInstructions: o("
|
|
12
|
+
downloadInstructions: o("downloadAndReviewInstructions"),
|
|
13
13
|
viewDocumentLabel: o("viewDocumentCta")
|
|
14
14
|
}
|
|
15
15
|
);
|
|
16
16
|
}
|
|
17
17
|
export {
|
|
18
|
-
|
|
18
|
+
a as Preview
|
|
19
19
|
};
|
|
20
20
|
//# sourceMappingURL=Preview.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Preview.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/Preview.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useSignatureForm } from './useSignatureForm'\nimport { DocumentViewer } from '@/components/Common/DocumentViewer'\n\nexport function Preview() {\n const { form, pdfUrl } = useSignatureForm()\n const { t } = useTranslation('
|
|
1
|
+
{"version":3,"file":"Preview.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/Preview.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useSignatureForm } from './useSignatureForm'\nimport { DocumentViewer } from '@/components/Common/DocumentViewer'\n\nexport function Preview() {\n const { form, pdfUrl } = useSignatureForm()\n const { t } = useTranslation('Employee.DocumentSigner')\n\n return (\n <DocumentViewer\n url={pdfUrl}\n title={form.title}\n downloadInstructions={t('downloadAndReviewInstructions')}\n viewDocumentLabel={t('viewDocumentCta')}\n />\n )\n}\n"],"names":["Preview","form","pdfUrl","useSignatureForm","t","useTranslation","jsx","DocumentViewer"],"mappings":";;;;AAIO,SAASA,IAAU;AACxB,QAAM,EAAE,MAAAC,GAAM,QAAAC,EAAA,IAAWC,EAAA,GACnB,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB;AAEtD,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAKL;AAAA,MACL,OAAOD,EAAK;AAAA,MACZ,sBAAsBG,EAAE,+BAA+B;AAAA,MACvD,mBAAmBA,EAAE,iBAAiB;AAAA,IAAA;AAAA,EAAA;AAG5C;"}
|
|
@@ -11,11 +11,10 @@ import "classnames";
|
|
|
11
11
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
12
|
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
13
13
|
import "dompurify";
|
|
14
|
-
import "../../../../contexts/LocaleProvider/useLocale.js";
|
|
15
14
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
15
|
+
const [c, d] = o("SignatureFormContext");
|
|
17
16
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
d as SignatureFormProvider,
|
|
18
|
+
c as useSignatureForm
|
|
20
19
|
};
|
|
21
20
|
//# sourceMappingURL=useSignatureForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignatureForm.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype SignatureFormContextType = {\n form: Form\n pdfUrl?: string | null\n handleBack: () => void\n isPending: boolean\n}\n\nconst [useSignatureForm, SignatureFormProvider] =\n createCompoundContext<SignatureFormContextType>('SignatureFormContext')\nexport { useSignatureForm, SignatureFormProvider }\n"],"names":["useSignatureForm","SignatureFormProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSignatureForm.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype SignatureFormContextType = {\n form: Form\n pdfUrl?: string | null\n handleBack: () => void\n isPending: boolean\n}\n\nconst [useSignatureForm, SignatureFormProvider] =\n createCompoundContext<SignatureFormContextType>('SignatureFormContext')\nexport { useSignatureForm, SignatureFormProvider }\n"],"names":["useSignatureForm","SignatureFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAkBC,CAAqB,IAC5CC,EAAgD,sBAAsB;"}
|
|
@@ -11,11 +11,10 @@ import "classnames";
|
|
|
11
11
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
12
|
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
13
13
|
import "dompurify";
|
|
14
|
-
import "../../../contexts/LocaleProvider/useLocale.js";
|
|
15
14
|
import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
15
|
+
const [c, d] = o("EmployeeListContext");
|
|
17
16
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
d as EmployeeListProvider,
|
|
18
|
+
c as useEmployeeList
|
|
20
19
|
};
|
|
21
20
|
//# sourceMappingURL=useEmployeeList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEmployeeList.js","sources":["../../../../src/components/Employee/EmployeeList/useEmployeeList.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { OnboardingStatus } from '@gusto/embedded-api/models/operations/putv1employeesemployeeidonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\nimport type { PaginationItemsPerPage } from '@/components/Common/PaginationControl/PaginationControlTypes'\n\n//Interface for context passed down to component slots\ntype EmployeeListContextType = {\n handleEdit: (uuid: string, onboardingStatus?: OnboardingStatus) => void\n handleDelete: (uuid: string) => Promise<void>\n handleCancelSelfOnboarding: (employeeId: string) => Promise<void>\n handleReview: (employeeId: string) => Promise<void>\n handleNew: () => void\n handleSkip: () => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleItemsPerPageChange: (newCount: PaginationItemsPerPage) => void\n currentPage: number\n totalPages: number\n totalCount: number\n employees: Employee[]\n itemsPerPage: PaginationItemsPerPage\n isFetching: boolean\n}\n\nconst [useEmployeeList, EmployeeListProvider] =\n createCompoundContext<EmployeeListContextType>('EmployeeListContext')\nexport { useEmployeeList, EmployeeListProvider }\n"],"names":["useEmployeeList","EmployeeListProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useEmployeeList.js","sources":["../../../../src/components/Employee/EmployeeList/useEmployeeList.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { OnboardingStatus } from '@gusto/embedded-api/models/operations/putv1employeesemployeeidonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\nimport type { PaginationItemsPerPage } from '@/components/Common/PaginationControl/PaginationControlTypes'\n\n//Interface for context passed down to component slots\ntype EmployeeListContextType = {\n handleEdit: (uuid: string, onboardingStatus?: OnboardingStatus) => void\n handleDelete: (uuid: string) => Promise<void>\n handleCancelSelfOnboarding: (employeeId: string) => Promise<void>\n handleReview: (employeeId: string) => Promise<void>\n handleNew: () => void\n handleSkip: () => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleItemsPerPageChange: (newCount: PaginationItemsPerPage) => void\n currentPage: number\n totalPages: number\n totalCount: number\n employees: Employee[]\n itemsPerPage: PaginationItemsPerPage\n isFetching: boolean\n}\n\nconst [useEmployeeList, EmployeeListProvider] =\n createCompoundContext<EmployeeListContextType>('EmployeeListContext')\nexport { useEmployeeList, EmployeeListProvider }\n"],"names":["useEmployeeList","EmployeeListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AA0BA,MAAM,CAACA,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
|
|
@@ -4,12 +4,12 @@ import { useFormContext as m } from "react-hook-form";
|
|
|
4
4
|
import { z as i } from "zod";
|
|
5
5
|
import "../../../shared/constants.js";
|
|
6
6
|
import "classnames";
|
|
7
|
-
import {
|
|
8
|
-
import { TextInputField as f } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
9
|
-
import { NumberInputField as r } from "../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
10
|
-
import { useComponentContext as c } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
7
|
+
import { useComponentContext as g } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
8
|
import "react";
|
|
12
9
|
import { SelectField as s } from "../../Common/Fields/SelectField/SelectField.js";
|
|
10
|
+
import { RadioGroupField as f } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
11
|
+
import { NumberInputField as r } from "../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
12
|
+
import { TextInputField as c } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
13
13
|
const p = i.object({
|
|
14
14
|
w4DataType: i.literal("rev_2020_w4"),
|
|
15
15
|
filingStatus: i.string().min(1),
|
|
@@ -29,7 +29,7 @@ function A() {
|
|
|
29
29
|
return e("w4DataType") === "rev_2020_w4" ? /* @__PURE__ */ t(b, {}) : /* @__PURE__ */ t(S, {});
|
|
30
30
|
}
|
|
31
31
|
function b() {
|
|
32
|
-
const { t: e } = o("Employee.FederalTaxes"), l =
|
|
32
|
+
const { t: e } = o("Employee.FederalTaxes"), l = g(), d = [
|
|
33
33
|
{ value: "Single", label: e("filingStatusSingle") },
|
|
34
34
|
{ value: "Married", label: e("filingStatusMarried") },
|
|
35
35
|
{ value: "Head of Household", label: e("filingStatusHeadOfHousehold") },
|
|
@@ -49,7 +49,7 @@ function b() {
|
|
|
49
49
|
}
|
|
50
50
|
),
|
|
51
51
|
/* @__PURE__ */ t(
|
|
52
|
-
|
|
52
|
+
f,
|
|
53
53
|
{
|
|
54
54
|
name: "twoJobs",
|
|
55
55
|
isRequired: !0,
|
|
@@ -150,7 +150,7 @@ function S() {
|
|
|
150
150
|
}
|
|
151
151
|
),
|
|
152
152
|
/* @__PURE__ */ t(
|
|
153
|
-
|
|
153
|
+
c,
|
|
154
154
|
{
|
|
155
155
|
name: "additionalWithholding",
|
|
156
156
|
label: e("additionalWithholding"),
|
|
@@ -11,11 +11,10 @@ import "classnames";
|
|
|
11
11
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
12
|
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
13
13
|
import "dompurify";
|
|
14
|
-
import "../../../contexts/LocaleProvider/useLocale.js";
|
|
15
14
|
import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
15
|
+
const [T, c] = o("FederalTaxesContext");
|
|
17
16
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
c as FederalTaxesProvider,
|
|
18
|
+
T as useFederalTaxes
|
|
20
19
|
};
|
|
21
20
|
//# sourceMappingURL=useFederalTaxes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFederalTaxes.js","sources":["../../../../src/components/Employee/FederalTaxes/useFederalTaxes.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\n\ntype FederalTaxesContextType = {\n isPending: boolean\n}\n\nconst [useFederalTaxes, FederalTaxesProvider] =\n createCompoundContext<FederalTaxesContextType>('FederalTaxesContext')\nexport { useFederalTaxes, FederalTaxesProvider }\n"],"names":["useFederalTaxes","FederalTaxesProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useFederalTaxes.js","sources":["../../../../src/components/Employee/FederalTaxes/useFederalTaxes.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\n\ntype FederalTaxesContextType = {\n isPending: boolean\n}\n\nconst [useFederalTaxes, FederalTaxesProvider] =\n createCompoundContext<FederalTaxesContextType>('FederalTaxesContext')\nexport { useFederalTaxes, FederalTaxesProvider }\n"],"names":["useFederalTaxes","FederalTaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAMA,MAAM,CAACA,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
|
|
@@ -4,10 +4,10 @@ import { useTranslation as s } from "react-i18next";
|
|
|
4
4
|
import { usePaymentMethod as c } from "./usePaymentMethod.js";
|
|
5
5
|
import { PAYMENT_METHODS as l } from "../../../shared/constants.js";
|
|
6
6
|
import "classnames";
|
|
7
|
-
import { RadioGroupField as p } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
8
|
-
import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
9
7
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
8
|
import "react";
|
|
9
|
+
import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
10
|
+
import { RadioGroupField as p } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
11
11
|
const k = () => {
|
|
12
12
|
const { mode: t, watchedType: a } = c(), { t: e } = s("Employee.PaymentMethod"), { setValue: n } = m();
|
|
13
13
|
if (!(t !== "ADD" && t !== "INITIAL" || a === l.check))
|
|
@@ -4,9 +4,9 @@ import { z as o } from "zod";
|
|
|
4
4
|
import { usePaymentMethod as c } from "./usePaymentMethod.js";
|
|
5
5
|
import { PAYMENT_METHODS as r } from "../../../shared/constants.js";
|
|
6
6
|
import "classnames";
|
|
7
|
-
import { RadioGroupField as n } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
8
7
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
8
|
import "react";
|
|
9
|
+
import { RadioGroupField as n } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
10
10
|
o.object({
|
|
11
11
|
type: o.enum(["Check", "Direct Deposit"])
|
|
12
12
|
});
|
|
@@ -7,11 +7,11 @@ import { useMemo as j, useEffect as D } from "react";
|
|
|
7
7
|
import { usePaymentMethod as N } from "./usePaymentMethod.js";
|
|
8
8
|
import { SPLIT_BY as h } from "../../../shared/constants.js";
|
|
9
9
|
import "classnames";
|
|
10
|
-
import {
|
|
10
|
+
import { useComponentContext as q } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
|
+
import { useLocale as w } from "../../../contexts/LocaleProvider/useLocale.js";
|
|
12
|
+
import { ReorderableList as I } from "../../Common/ReorderableList/ReorderableList.js";
|
|
13
|
+
import { RadioGroupField as W } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
11
14
|
import { NumberInputField as F } from "../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
12
|
-
import { useComponentContext as w } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
-
import { useLocale as I } from "../../../contexts/LocaleProvider/useLocale.js";
|
|
14
|
-
import { ReorderableList as W } from "../../Common/ReorderableList/ReorderableList.js";
|
|
15
15
|
function ie() {
|
|
16
16
|
const { paymentMethod: r, bankAccounts: m, mode: c } = N(), {
|
|
17
17
|
control: s,
|
|
@@ -22,7 +22,7 @@ function ie() {
|
|
|
22
22
|
} = B(), { t: u } = g("Employee.PaymentMethod"), d = A("splitBy"), L = A("priority"), a = j(() => r.splits ?? [], [r.splits]), l = Object.entries(L).reduce(
|
|
23
23
|
(e, [t, i]) => !e || (L[e] ?? 0) < i ? t : e,
|
|
24
24
|
""
|
|
25
|
-
), { currency: $ } =
|
|
25
|
+
), { currency: $ } = w();
|
|
26
26
|
D(() => {
|
|
27
27
|
if (a.length)
|
|
28
28
|
if (d === h.amount) {
|
|
@@ -33,7 +33,7 @@ function ie() {
|
|
|
33
33
|
o("splitAmount", e);
|
|
34
34
|
}
|
|
35
35
|
}, [d, a, l, o]);
|
|
36
|
-
const f =
|
|
36
|
+
const f = q();
|
|
37
37
|
if (c !== "SPLIT" || m.length < 2 || r.splits === null) return null;
|
|
38
38
|
o("isSplit", !0);
|
|
39
39
|
const b = (e, t) => {
|
|
@@ -50,7 +50,7 @@ function ie() {
|
|
|
50
50
|
const p = a[i];
|
|
51
51
|
p && (o("priority", t), l && l !== p.uuid && (S(`splitAmount.${l}`), b(l, 0)), b(p.uuid, null));
|
|
52
52
|
}, R = () => d === h.amount ? /* @__PURE__ */ n(
|
|
53
|
-
|
|
53
|
+
I,
|
|
54
54
|
{
|
|
55
55
|
label: u("draggableListLabel"),
|
|
56
56
|
items: a.map((e) => ({
|
|
@@ -106,7 +106,7 @@ function ie() {
|
|
|
106
106
|
/* @__PURE__ */ n(f.Heading, { as: "h2", children: u("title") }),
|
|
107
107
|
/* @__PURE__ */ n(V, { t: u, i18nKey: "splitDescription", components: { p: /* @__PURE__ */ n(f.Text, {}) } }),
|
|
108
108
|
/* @__PURE__ */ n(
|
|
109
|
-
|
|
109
|
+
W,
|
|
110
110
|
{
|
|
111
111
|
name: "splitBy",
|
|
112
112
|
label: u("splitByLabel"),
|
|
@@ -13,9 +13,8 @@ import "classnames";
|
|
|
13
13
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
14
|
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
15
15
|
import "dompurify";
|
|
16
|
-
import "../../../contexts/LocaleProvider/useLocale.js";
|
|
17
16
|
import { createCompoundContext as n } from "../../Base/createCompoundContext.js";
|
|
18
|
-
const
|
|
17
|
+
const C = t.union([
|
|
19
18
|
a.extend({
|
|
20
19
|
type: t.literal("Direct Deposit"),
|
|
21
20
|
isSplit: t.literal(!1)
|
|
@@ -56,10 +55,10 @@ const S = t.union([
|
|
|
56
55
|
remainder: t.string()
|
|
57
56
|
})
|
|
58
57
|
])
|
|
59
|
-
]), [
|
|
58
|
+
]), [S, k] = n("PaymentMethodContext");
|
|
60
59
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
C as CombinedSchema,
|
|
61
|
+
k as PaymentMethodProvider,
|
|
62
|
+
S as usePaymentMethod
|
|
64
63
|
};
|
|
65
64
|
//# sourceMappingURL=usePaymentMethod.js.map
|