@gusto/embedded-react-sdk 0.13.0 → 0.13.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 +6 -0
- package/dist/_virtual/dynamic-import-helper.js +8 -1
- package/dist/_virtual/dynamic-import-helper.js.map +1 -1
- package/dist/components/Base/Base.js +4 -4
- package/dist/components/Common/FieldDescription/FieldDescription.js +7 -14
- package/dist/components/Common/FieldDescription/FieldDescription.js.map +1 -1
- package/dist/components/Common/Fields/hooks/useField.d.ts +4 -1
- package/dist/components/Common/Fields/hooks/useField.js +31 -24
- package/dist/components/Common/Fields/hooks/useField.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +3 -4
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +6 -7
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +7 -8
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/CalendarPreview/CalendarPreview.js +1 -1
- package/dist/components/Common/UI/DatePicker/DatePicker.js +1 -1
- package/dist/components/Common/UI/Tabs/Tabs.d.ts +7 -0
- package/dist/components/Common/UI/Tabs/Tabs.js +25 -0
- package/dist/components/Common/UI/Tabs/Tabs.js.map +1 -0
- package/dist/components/Common/UI/Tabs/Tabs.module.scss.js +8 -0
- package/dist/components/Common/UI/Tabs/Tabs.module.scss.js.map +1 -0
- package/dist/components/Common/UI/Tabs/TabsTypes.d.ts +51 -0
- package/dist/components/Common/UI/Tabs/index.d.ts +3 -0
- package/dist/components/Common/hooks/useNumberFormatter.js +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +6 -7
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +7 -8
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +2 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +8 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +9 -10
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +9 -10
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +8 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +10 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccount.js +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +2 -2
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +8 -3
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js +2 -2
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +10 -11
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +8 -3
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentSigner.js +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +9 -10
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +8 -3
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +15 -16
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +14 -9
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +11 -6
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Industry.js +2 -2
- package/dist/components/Company/Locations/LocationForm/Form.js +4 -5
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +13 -14
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +8 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +7 -8
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +8 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +3 -4
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +8 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +37 -38
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +2 -3
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +11 -6
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +3 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +8 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +8 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +7 -8
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +2 -3
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +10 -5
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +1 -1
- package/dist/components/Contractor/ContractorList/useContractorList.js +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +3 -3
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +7 -7
- package/dist/components/Contractor/Profile/ContractorProfile.js +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +39 -34
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +3 -3
- package/dist/components/Employee/Compensation/Compensation.js +10 -10
- package/dist/components/Employee/Deductions/Deductions.js +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +4 -4
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +2 -2
- package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +8 -9
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +8 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +12 -13
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +8 -3
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +4 -4
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +8 -3
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js +3 -3
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +8 -3
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +2 -2
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +2 -2
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js +8 -8
- package/dist/components/Employee/PaymentMethod/Split.js +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +14 -9
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +4 -5
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +20 -21
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/Profile.js +13 -13
- package/dist/components/Employee/Profile/useProfile.js +8 -3
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/StateTaxes.js +3 -3
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +8 -3
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.js +5 -5
- package/dist/components/Employee/Taxes/useTaxes.js +8 -3
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +60 -65
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +60 -57
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.d.ts +5 -2
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +64 -13
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +18 -2
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +117 -19
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +3 -3
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +8 -8
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +42 -36
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/helpers.d.ts +7 -6
- package/dist/components/Payroll/helpers.js +44 -43
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.d.ts +14 -0
- package/dist/components/Payroll/usePreparedPayrollData.js +39 -0
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -0
- package/dist/contexts/ApiProvider/ApiProvider.js +4 -4
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +28 -26
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
- package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/i18n/I18n.js +5 -5
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +20 -18
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +20 -0
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -0
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +18 -0
- package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -0
- package/dist/shared/constants.d.ts +6 -0
- package/dist/shared/constants.js +43 -34
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +52 -1
- package/package.json +14 -13
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as l } from "react-i18next";
|
|
3
3
|
import { createMachine as D } from "robot3";
|
|
4
|
-
import { useGarnishmentsListSuspense as f } from "
|
|
4
|
+
import { useGarnishmentsListSuspense as f } from "@gusto/embedded-api/react-query/garnishmentsList";
|
|
5
5
|
import { useMemo as d } from "react";
|
|
6
6
|
import { DeductionsListContextual as h, IncludeDeductionsFormContextual as F } from "./DeductionsComponents.js";
|
|
7
7
|
import { deductionsStateMachine as w } from "./stateMachine.js";
|
|
@@ -3,10 +3,10 @@ import { useTranslation as N } from "react-i18next";
|
|
|
3
3
|
import { useMemo as B, useEffect as U } from "react";
|
|
4
4
|
import { z as i } from "zod";
|
|
5
5
|
import { useForm as _, useWatch as I, FormProvider as w } from "react-hook-form";
|
|
6
|
-
import { zodResolver as G } from "
|
|
7
|
-
import { useGarnishmentsCreateMutation as j } from "
|
|
8
|
-
import { useGarnishmentsUpdateMutation as Y } from "
|
|
9
|
-
import { useGarnishmentsListSuspense as k } from "
|
|
6
|
+
import { zodResolver as G } from "@hookform/resolvers/zod";
|
|
7
|
+
import { useGarnishmentsCreateMutation as j } from "@gusto/embedded-api/react-query/garnishmentsCreate";
|
|
8
|
+
import { useGarnishmentsUpdateMutation as Y } from "@gusto/embedded-api/react-query/garnishmentsUpdate";
|
|
9
|
+
import { useGarnishmentsListSuspense as k } from "@gusto/embedded-api/react-query/garnishmentsList";
|
|
10
10
|
import { BaseComponent as z } from "../../../Base/Base.js";
|
|
11
11
|
import { useBase as H } from "../../../Base/useBase.js";
|
|
12
12
|
import { Form as V } from "../../../Common/Form/Form.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as n, jsxs as c, Fragment as A } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as O } from "react-i18next";
|
|
3
|
-
import { useGarnishmentsListSuspense as x } from "
|
|
4
|
-
import { useGarnishmentsUpdateMutation as N } from "
|
|
3
|
+
import { useGarnishmentsListSuspense as x } from "@gusto/embedded-api/react-query/garnishmentsList";
|
|
4
|
+
import { useGarnishmentsUpdateMutation as N } from "@gusto/embedded-api/react-query/garnishmentsUpdate";
|
|
5
5
|
import { BaseComponent as _ } from "../../../Base/Base.js";
|
|
6
6
|
import { useBase as k } from "../../../Base/useBase.js";
|
|
7
7
|
import { Flex as w } from "../../../Common/Flex/Flex.js";
|
|
@@ -2,7 +2,7 @@ import { jsx as e, jsxs as p, Fragment as a } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTranslation as D } from "react-i18next";
|
|
3
3
|
import { z as m } from "zod";
|
|
4
4
|
import { useForm as f, FormProvider as E } from "react-hook-form";
|
|
5
|
-
import { zodResolver as h } from "
|
|
5
|
+
import { zodResolver as h } from "@hookform/resolvers/zod";
|
|
6
6
|
import { BaseComponent as C } from "../../../Base/Base.js";
|
|
7
7
|
import { useBase as b } from "../../../Base/useBase.js";
|
|
8
8
|
import { Form as N } from "../../../Common/Form/Form.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as o, jsxs as l } from "react/jsx-runtime";
|
|
2
|
-
import { useEmployeeFormsListSuspense as f } from "
|
|
2
|
+
import { useEmployeeFormsListSuspense as f } from "@gusto/embedded-api/react-query/employeeFormsList";
|
|
3
3
|
import { Head as d } from "./Head.js";
|
|
4
4
|
import { List as E } from "./List.js";
|
|
5
5
|
import { Actions as a } from "./Actions.js";
|
|
@@ -10,13 +10,12 @@ import { useI18n as S } from "../../../../i18n/I18n.js";
|
|
|
10
10
|
import { componentEvents as m } from "../../../../shared/constants.js";
|
|
11
11
|
import { Flex as g } from "../../../Common/Flex/Flex.js";
|
|
12
12
|
import "classnames";
|
|
13
|
-
|
|
14
|
-
function N(e) {
|
|
13
|
+
function B(e) {
|
|
15
14
|
return /* @__PURE__ */ o(F, { ...e, children: /* @__PURE__ */ o(O, { ...e }) });
|
|
16
15
|
}
|
|
17
|
-
function O({ employeeId: e, className: s, children:
|
|
16
|
+
function O({ employeeId: e, className: s, children: n }) {
|
|
18
17
|
S("Employee.DocumentSigner");
|
|
19
|
-
const { onEvent:
|
|
18
|
+
const { onEvent: t } = L(), { data: u, error: c } = f({ employeeId: e }), i = u.formList, p = i.every((r) => !r.requiresSigning);
|
|
20
19
|
return /* @__PURE__ */ o("section", { className: s, children: /* @__PURE__ */ o(
|
|
21
20
|
h,
|
|
22
21
|
{
|
|
@@ -24,14 +23,14 @@ function O({ employeeId: e, className: s, children: t }) {
|
|
|
24
23
|
employeeForms: i,
|
|
25
24
|
hasSignedAllForms: p,
|
|
26
25
|
handleContinue: () => {
|
|
27
|
-
|
|
26
|
+
t(m.EMPLOYEE_FORMS_DONE);
|
|
28
27
|
},
|
|
29
28
|
handleRequestFormToSign: (r) => {
|
|
30
|
-
|
|
29
|
+
t(m.EMPLOYEE_VIEW_FORM_TO_SIGN, { uuid: r.uuid });
|
|
31
30
|
},
|
|
32
31
|
documentListError: c
|
|
33
32
|
},
|
|
34
|
-
children:
|
|
33
|
+
children: n || /* @__PURE__ */ l(g, { flexDirection: "column", children: [
|
|
35
34
|
/* @__PURE__ */ o(d, {}),
|
|
36
35
|
/* @__PURE__ */ o(E, {}),
|
|
37
36
|
/* @__PURE__ */ o(a, {})
|
|
@@ -40,6 +39,6 @@ function O({ employeeId: e, className: s, children: t }) {
|
|
|
40
39
|
) });
|
|
41
40
|
}
|
|
42
41
|
export {
|
|
43
|
-
|
|
42
|
+
B as DocumentList
|
|
44
43
|
};
|
|
45
44
|
//# sourceMappingURL=DocumentList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentList.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/DocumentList.tsx"],"sourcesContent":["import { useEmployeeFormsListSuspense } from '@gusto/embedded-api/react-query/employeeFormsList'\nimport { type Form } from '@gusto/embedded-api/models/components/form'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { DocumentListProvider } from './useDocumentList'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Flex } from '@/components/Common'\n\ninterface DocumentListProps extends CommonComponentInterface {\n employeeId: string\n}\n\nexport function DocumentList(props: DocumentListProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, className, children }: DocumentListProps) {\n useI18n('Employee.DocumentSigner')\n const { onEvent } = useBase()\n\n const { data, error: documentListError } = useEmployeeFormsListSuspense({ employeeId })\n const employeeForms = data.formList!\n\n const hasSignedAllForms = employeeForms.every(employeeForm => !employeeForm.requiresSigning)\n\n const handleRequestFormToSign = (data: Form) => {\n onEvent(componentEvents.EMPLOYEE_VIEW_FORM_TO_SIGN, { uuid: data.uuid })\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.EMPLOYEE_FORMS_DONE)\n }\n\n return (\n <section className={className}>\n <DocumentListProvider\n value={{\n employeeForms,\n hasSignedAllForms,\n handleContinue,\n handleRequestFormToSign,\n documentListError,\n }}\n >\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Actions />\n </Flex>\n )}\n </DocumentListProvider>\n </section>\n )\n}\n"],"names":["DocumentList","props","jsx","BaseComponent","Root","employeeId","className","children","useI18n","onEvent","useBase","data","documentListError","useEmployeeFormsListSuspense","employeeForms","hasSignedAllForms","employeeForm","DocumentListProvider","componentEvents","jsxs","Flex","Head","List","Actions"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DocumentList.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/DocumentList.tsx"],"sourcesContent":["import { useEmployeeFormsListSuspense } from '@gusto/embedded-api/react-query/employeeFormsList'\nimport { type Form } from '@gusto/embedded-api/models/components/form'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { DocumentListProvider } from './useDocumentList'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Flex } from '@/components/Common'\n\ninterface DocumentListProps extends CommonComponentInterface {\n employeeId: string\n}\n\nexport function DocumentList(props: DocumentListProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, className, children }: DocumentListProps) {\n useI18n('Employee.DocumentSigner')\n const { onEvent } = useBase()\n\n const { data, error: documentListError } = useEmployeeFormsListSuspense({ employeeId })\n const employeeForms = data.formList!\n\n const hasSignedAllForms = employeeForms.every(employeeForm => !employeeForm.requiresSigning)\n\n const handleRequestFormToSign = (data: Form) => {\n onEvent(componentEvents.EMPLOYEE_VIEW_FORM_TO_SIGN, { uuid: data.uuid })\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.EMPLOYEE_FORMS_DONE)\n }\n\n return (\n <section className={className}>\n <DocumentListProvider\n value={{\n employeeForms,\n hasSignedAllForms,\n handleContinue,\n handleRequestFormToSign,\n documentListError,\n }}\n >\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Actions />\n </Flex>\n )}\n </DocumentListProvider>\n </section>\n )\n}\n"],"names":["DocumentList","props","jsx","BaseComponent","Root","employeeId","className","children","useI18n","onEvent","useBase","data","documentListError","useEmployeeFormsListSuspense","employeeForms","hasSignedAllForms","employeeForm","DocumentListProvider","componentEvents","jsxs","Flex","Head","List","Actions"],"mappings":";;;;;;;;;;;;AAoBO,SAASA,EAAaC,GAAmD;AAC9E,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,WAAAC,GAAW,UAAAC,KAA+B;AACpE,EAAAC,EAAQ,yBAAyB;AACjC,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEd,EAAE,MAAAC,GAAM,OAAOC,EAAA,IAAsBC,EAA6B,EAAE,YAAAR,GAAY,GAChFS,IAAgBH,EAAK,UAErBI,IAAoBD,EAAc,MAAM,CAAAE,MAAgB,CAACA,EAAa,eAAe;AAU3F,SACE,gBAAAd,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACe;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,eAAAH;AAAA,QACA,mBAAAC;AAAA,QACA,gBAVe,MAAM;AAC3B,UAAAN,EAAQS,EAAgB,mBAAmB;AAAA,QAC7C;AAAA,QASQ,yBAfwB,CAACP,MAAe;AAC9C,UAAAF,EAAQS,EAAgB,4BAA4B,EAAE,MAAMP,EAAK,MAAM;AAAA,QACzE;AAAA,QAcQ,mBAAAC;AAAA,MAAA;AAAA,MAGD,UAAAL,KAGC,gBAAAY,EAACC,GAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAAlB,EAACmB,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ;"}
|
|
@@ -2,16 +2,21 @@ import "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-error-boundary";
|
|
4
4
|
import "react-i18next";
|
|
5
|
+
import "@gusto/embedded-api/models/errors/apierror";
|
|
6
|
+
import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
7
|
+
import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
8
|
+
import "@tanstack/react-query";
|
|
5
9
|
import "../../../Base/useBase.js";
|
|
6
10
|
import "../../../../shared/constants.js";
|
|
7
11
|
import "classnames";
|
|
8
12
|
import "dompurify";
|
|
9
13
|
import "../../../../contexts/LocaleProvider/useLocale.js";
|
|
10
14
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
15
|
+
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
11
16
|
import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
|
|
12
|
-
const [
|
|
17
|
+
const [f, v] = t("DocumentListContext");
|
|
13
18
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
v as DocumentListProvider,
|
|
20
|
+
f as useDocumentList
|
|
16
21
|
};
|
|
17
22
|
//# 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;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o, jsxs as F, Fragment as E } from "react/jsx-runtime";
|
|
2
|
-
import { useEmployeeFormsGetPdfSuspense as h } from "
|
|
3
|
-
import { useEmployeeFormsSignMutation as P } from "
|
|
4
|
-
import { useEmployeeFormsGetSuspense as x } from "
|
|
2
|
+
import { useEmployeeFormsGetPdfSuspense as h } from "@gusto/embedded-api/react-query/employeeFormsGetPdf";
|
|
3
|
+
import { useEmployeeFormsSignMutation as P } from "@gusto/embedded-api/react-query/employeeFormsSign";
|
|
4
|
+
import { useEmployeeFormsGetSuspense as x } from "@gusto/embedded-api/react-query/employeeFormsGet";
|
|
5
5
|
import { Form as b } from "./Form.js";
|
|
6
6
|
import { Head as v } from "./Head.js";
|
|
7
7
|
import { Actions as y } from "./Actions.js";
|
|
@@ -13,16 +13,15 @@ import { useI18n as G } from "../../../../i18n/I18n.js";
|
|
|
13
13
|
import { componentEvents as i } from "../../../../shared/constants.js";
|
|
14
14
|
import { Flex as M } from "../../../Common/Flex/Flex.js";
|
|
15
15
|
import "classnames";
|
|
16
|
-
import "react-i18next";
|
|
17
16
|
import { SignatureForm as R } from "../../../Common/SignatureForm/SignatureForm.js";
|
|
18
|
-
function
|
|
17
|
+
function W(r) {
|
|
19
18
|
return /* @__PURE__ */ o(A, { ...r, children: /* @__PURE__ */ o(j, { ...r }) });
|
|
20
19
|
}
|
|
21
|
-
function j({ employeeId: r, formId: s, className: u, children:
|
|
20
|
+
function j({ employeeId: r, formId: s, className: u, children: t }) {
|
|
22
21
|
G("Employee.DocumentSigner");
|
|
23
|
-
const { onEvent: e, baseSubmitHandler: a } = C(), { data: c } = x({ employeeId: r, formId: s }),
|
|
22
|
+
const { onEvent: e, baseSubmitHandler: a } = C(), { data: c } = x({ employeeId: r, formId: s }), n = c.form, {
|
|
24
23
|
data: { formPdf: f }
|
|
25
|
-
} = h({ employeeId: r, formId:
|
|
24
|
+
} = h({ employeeId: r, formId: n.uuid }), d = f.documentUrl, { mutateAsync: p, isPending: l } = P();
|
|
26
25
|
return /* @__PURE__ */ o("section", { className: u, children: /* @__PURE__ */ o(
|
|
27
26
|
w,
|
|
28
27
|
{
|
|
@@ -31,16 +30,16 @@ function j({ employeeId: r, formId: s, className: u, children: n }) {
|
|
|
31
30
|
handleBack: () => {
|
|
32
31
|
e(i.CANCEL);
|
|
33
32
|
},
|
|
34
|
-
form:
|
|
33
|
+
form: n,
|
|
35
34
|
isPending: l
|
|
36
35
|
},
|
|
37
36
|
children: /* @__PURE__ */ o(R, { onSubmit: async (g) => {
|
|
38
37
|
await a(g, async (m) => {
|
|
39
|
-
if (
|
|
38
|
+
if (n.uuid) {
|
|
40
39
|
const { form: S } = await p({
|
|
41
40
|
request: {
|
|
42
41
|
employeeId: r,
|
|
43
|
-
formId:
|
|
42
|
+
formId: n.uuid,
|
|
44
43
|
requestBody: {
|
|
45
44
|
signatureText: m.signature,
|
|
46
45
|
agree: m.confirmSignature
|
|
@@ -50,7 +49,7 @@ function j({ employeeId: r, formId: s, className: u, children: n }) {
|
|
|
50
49
|
e(i.EMPLOYEE_SIGN_FORM, S);
|
|
51
50
|
}
|
|
52
51
|
});
|
|
53
|
-
}, children: /* @__PURE__ */ o(M, { flexDirection: "column", children:
|
|
52
|
+
}, children: /* @__PURE__ */ o(M, { flexDirection: "column", children: t || /* @__PURE__ */ F(E, { children: [
|
|
54
53
|
/* @__PURE__ */ o(v, {}),
|
|
55
54
|
/* @__PURE__ */ o(B, {}),
|
|
56
55
|
/* @__PURE__ */ o(b, {}),
|
|
@@ -60,6 +59,6 @@ function j({ employeeId: r, formId: s, className: u, children: n }) {
|
|
|
60
59
|
) });
|
|
61
60
|
}
|
|
62
61
|
export {
|
|
63
|
-
|
|
62
|
+
W as SignatureForm
|
|
64
63
|
};
|
|
65
64
|
//# sourceMappingURL=SignatureForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignatureForm.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { useEmployeeFormsGetPdfSuspense } from '@gusto/embedded-api/react-query/employeeFormsGetPdf'\nimport { useEmployeeFormsSignMutation } from '@gusto/embedded-api/react-query/employeeFormsSign'\nimport { useEmployeeFormsGetSuspense } from '@gusto/embedded-api/react-query/employeeFormsGet'\nimport { Form as FormComponent } from './Form'\nimport { Head } from './Head'\nimport { Actions } from './Actions'\nimport { Preview } from './Preview'\nimport { SignatureFormProvider } from './useSignatureForm'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Flex } from '@/components/Common'\nimport type { SignatureFormInputs } from '@/components/Common/SignatureForm'\nimport { SignatureForm as SharedSignatureForm } from '@/components/Common/SignatureForm'\n\ninterface SignatureFormProps extends CommonComponentInterface {\n employeeId: string\n formId: string\n}\n\nexport function SignatureForm(props: SignatureFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, formId, className, children }: SignatureFormProps) {\n useI18n('Employee.DocumentSigner')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useEmployeeFormsGetSuspense({ employeeId, formId })\n const form = data.form!\n\n const {\n data: { formPdf },\n } = useEmployeeFormsGetPdfSuspense({ employeeId, formId: form.uuid })\n const pdfUrl = formPdf!.documentUrl\n\n const { mutateAsync: signForm, isPending: isSignFormPending } = useEmployeeFormsSignMutation()\n\n const handleBack = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n const handleSubmit = async (data: SignatureFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n if (form.uuid) {\n const { form: signFormResult } = await signForm({\n request: {\n employeeId,\n formId: form.uuid,\n requestBody: {\n signatureText: payload.signature,\n agree: payload.confirmSignature,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_SIGN_FORM, signFormResult)\n }\n })\n }\n\n return (\n <section className={className}>\n <SignatureFormProvider\n value={{\n pdfUrl,\n handleBack,\n form,\n isPending: isSignFormPending,\n }}\n >\n <SharedSignatureForm onSubmit={handleSubmit}>\n <Flex flexDirection=\"column\">\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Preview />\n <FormComponent />\n <Actions />\n </>\n )}\n </Flex>\n </SharedSignatureForm>\n </SignatureFormProvider>\n </section>\n )\n}\n"],"names":["SignatureForm","props","jsx","BaseComponent","Root","employeeId","formId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","data","useEmployeeFormsGetSuspense","form","formPdf","useEmployeeFormsGetPdfSuspense","pdfUrl","signForm","isSignFormPending","useEmployeeFormsSignMutation","SignatureFormProvider","componentEvents","SharedSignatureForm","payload","signFormResult","Flex","jsxs","Fragment","Head","Preview","FormComponent","Actions"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SignatureForm.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { useEmployeeFormsGetPdfSuspense } from '@gusto/embedded-api/react-query/employeeFormsGetPdf'\nimport { useEmployeeFormsSignMutation } from '@gusto/embedded-api/react-query/employeeFormsSign'\nimport { useEmployeeFormsGetSuspense } from '@gusto/embedded-api/react-query/employeeFormsGet'\nimport { Form as FormComponent } from './Form'\nimport { Head } from './Head'\nimport { Actions } from './Actions'\nimport { Preview } from './Preview'\nimport { SignatureFormProvider } from './useSignatureForm'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Flex } from '@/components/Common'\nimport type { SignatureFormInputs } from '@/components/Common/SignatureForm'\nimport { SignatureForm as SharedSignatureForm } from '@/components/Common/SignatureForm'\n\ninterface SignatureFormProps extends CommonComponentInterface {\n employeeId: string\n formId: string\n}\n\nexport function SignatureForm(props: SignatureFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, formId, className, children }: SignatureFormProps) {\n useI18n('Employee.DocumentSigner')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useEmployeeFormsGetSuspense({ employeeId, formId })\n const form = data.form!\n\n const {\n data: { formPdf },\n } = useEmployeeFormsGetPdfSuspense({ employeeId, formId: form.uuid })\n const pdfUrl = formPdf!.documentUrl\n\n const { mutateAsync: signForm, isPending: isSignFormPending } = useEmployeeFormsSignMutation()\n\n const handleBack = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n const handleSubmit = async (data: SignatureFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n if (form.uuid) {\n const { form: signFormResult } = await signForm({\n request: {\n employeeId,\n formId: form.uuid,\n requestBody: {\n signatureText: payload.signature,\n agree: payload.confirmSignature,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_SIGN_FORM, signFormResult)\n }\n })\n }\n\n return (\n <section className={className}>\n <SignatureFormProvider\n value={{\n pdfUrl,\n handleBack,\n form,\n isPending: isSignFormPending,\n }}\n >\n <SharedSignatureForm onSubmit={handleSubmit}>\n <Flex flexDirection=\"column\">\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Preview />\n <FormComponent />\n <Actions />\n </>\n )}\n </Flex>\n </SharedSignatureForm>\n </SignatureFormProvider>\n </section>\n )\n}\n"],"names":["SignatureForm","props","jsx","BaseComponent","Root","employeeId","formId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","data","useEmployeeFormsGetSuspense","form","formPdf","useEmployeeFormsGetPdfSuspense","pdfUrl","signForm","isSignFormPending","useEmployeeFormsSignMutation","SignatureFormProvider","componentEvents","SharedSignatureForm","payload","signFormResult","Flex","jsxs","Fragment","Head","Preview","FormComponent","Actions"],"mappings":";;;;;;;;;;;;;;;;AAyBO,SAASA,EAAcC,GAAoD;AAChF,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,QAAAC,GAAQ,WAAAC,GAAW,UAAAC,KAAgC;AAC7E,EAAAC,EAAQ,yBAAyB;AACjC,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GAEjC,EAAE,MAAAC,EAAA,IAASC,EAA4B,EAAE,YAAAT,GAAY,QAAAC,GAAQ,GAC7DS,IAAOF,EAAK,MAEZ;AAAA,IACJ,MAAM,EAAE,SAAAG,EAAA;AAAA,EAAQ,IACdC,EAA+B,EAAE,YAAAZ,GAAY,QAAQU,EAAK,MAAM,GAC9DG,IAASF,EAAS,aAElB,EAAE,aAAaG,GAAU,WAAWC,EAAA,IAAsBC,EAAA;AAwBhE,SACE,gBAAAnB,EAAC,aAAQ,WAAAK,GACP,UAAA,gBAAAL;AAAA,IAACoB;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,QAAAJ;AAAA,QACA,YA3BW,MAAM;AACvB,UAAAR,EAAQa,EAAgB,MAAM;AAAA,QAChC;AAAA,QA0BQ,MAAAR;AAAA,QACA,WAAWK;AAAA,MAAA;AAAA,MAGb,UAAA,gBAAAlB,EAACsB,GAAA,EAAoB,UA5BN,OAAOX,MAA8B;AACxD,cAAMF,EAAkBE,GAAM,OAAMY,MAAW;AAC7C,cAAIV,EAAK,MAAM;AACb,kBAAM,EAAE,MAAMW,EAAA,IAAmB,MAAMP,EAAS;AAAA,cAC9C,SAAS;AAAA,gBACP,YAAAd;AAAA,gBACA,QAAQU,EAAK;AAAA,gBACb,aAAa;AAAA,kBACX,eAAeU,EAAQ;AAAA,kBACvB,OAAOA,EAAQ;AAAA,gBAAA;AAAA,cACjB;AAAA,YACF,CACD;AACD,YAAAf,EAAQa,EAAgB,oBAAoBG,CAAc;AAAA,UAC5D;AAAA,QACF,CAAC;AAAA,MACH,GAaQ,UAAA,gBAAAxB,EAACyB,KAAK,eAAc,UACjB,UAAAnB,KAGC,gBAAAoB,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAA3B,EAAC4B,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAQ;AAAA,0BACRC,GAAA,EAAc;AAAA,0BACdC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,GAEJ,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -2,16 +2,21 @@ import "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-error-boundary";
|
|
4
4
|
import "react-i18next";
|
|
5
|
+
import "@gusto/embedded-api/models/errors/apierror";
|
|
6
|
+
import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
7
|
+
import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
8
|
+
import "@tanstack/react-query";
|
|
5
9
|
import "../../../Base/useBase.js";
|
|
6
10
|
import "../../../../shared/constants.js";
|
|
7
11
|
import "classnames";
|
|
8
12
|
import "dompurify";
|
|
9
13
|
import "../../../../contexts/LocaleProvider/useLocale.js";
|
|
10
14
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
15
|
+
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
11
16
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
12
|
-
const [
|
|
17
|
+
const [s, f] = o("SignatureFormContext");
|
|
13
18
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
f as SignatureFormProvider,
|
|
20
|
+
s as useSignatureForm
|
|
16
21
|
};
|
|
17
22
|
//# 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;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as o, jsxs as C } from "react/jsx-runtime";
|
|
2
2
|
import { useState as y } from "react";
|
|
3
|
-
import { useEmployeesList as G } from "
|
|
4
|
-
import { useEmployeesDeleteMutation as F } from "
|
|
5
|
-
import { useEmployeesUpdateOnboardingStatusMutation as Y } from "
|
|
6
|
-
import { keepPreviousData as U } from "
|
|
3
|
+
import { useEmployeesList as G } from "@gusto/embedded-api/react-query/employeesList";
|
|
4
|
+
import { useEmployeesDeleteMutation as F } from "@gusto/embedded-api/react-query/employeesDelete";
|
|
5
|
+
import { useEmployeesUpdateOnboardingStatusMutation as Y } from "@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus";
|
|
6
|
+
import { keepPreviousData as U } from "@tanstack/react-query";
|
|
7
7
|
import { EmployeeListProvider as W } from "./useEmployeeList.js";
|
|
8
8
|
import { Actions as k } from "./Actions.js";
|
|
9
9
|
import { BaseComponent as q } from "../../Base/Base.js";
|
|
@@ -2,16 +2,21 @@ import "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-error-boundary";
|
|
4
4
|
import "react-i18next";
|
|
5
|
+
import "@gusto/embedded-api/models/errors/apierror";
|
|
6
|
+
import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
7
|
+
import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
8
|
+
import "@tanstack/react-query";
|
|
5
9
|
import "../../Base/useBase.js";
|
|
6
10
|
import "../../../shared/constants.js";
|
|
7
11
|
import "classnames";
|
|
8
12
|
import "dompurify";
|
|
9
13
|
import "../../../contexts/LocaleProvider/useLocale.js";
|
|
10
14
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
15
|
+
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
11
16
|
import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
|
|
12
|
-
const [
|
|
17
|
+
const [u, a] = o("EmployeeListContext");
|
|
13
18
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
a as EmployeeListProvider,
|
|
20
|
+
u as useEmployeeList
|
|
16
21
|
};
|
|
17
22
|
//# 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'\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: number) => void\n currentPage: number\n totalPages: number\n employees: Employee[]\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'\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: number) => void\n currentPage: number\n totalPages: number\n employees: Employee[]\n isFetching: boolean\n}\n\nconst [useEmployeeList, EmployeeListProvider] =\n createCompoundContext<EmployeeListContextType>('EmployeeListContext')\nexport { useEmployeeList, EmployeeListProvider }\n"],"names":["useEmployeeList","EmployeeListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;AAuBA,MAAM,CAACA,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as o, jsxs as b, Fragment as S } from "react/jsx-runtime";
|
|
2
|
-
import { zodResolver as v } from "
|
|
2
|
+
import { zodResolver as v } from "@hookform/resolvers/zod";
|
|
3
3
|
import { useForm as A, FormProvider as g } from "react-hook-form";
|
|
4
4
|
import { useEffect as D } from "react";
|
|
5
|
-
import { useEmployeeTaxSetupGetFederalTaxesSuspense as w } from "
|
|
6
|
-
import { useEmployeeTaxSetupUpdateFederalTaxesMutation as _ } from "
|
|
5
|
+
import { useEmployeeTaxSetupGetFederalTaxesSuspense as w } from "@gusto/embedded-api/react-query/employeeTaxSetupGetFederalTaxes";
|
|
6
|
+
import { useEmployeeTaxSetupUpdateFederalTaxesMutation as _ } from "@gusto/embedded-api/react-query/employeeTaxSetupUpdateFederalTaxes";
|
|
7
7
|
import { FederalFormSchema as N, FederalForm as P } from "./FederalForm.js";
|
|
8
8
|
import { Head as I } from "./Head.js";
|
|
9
9
|
import { Actions as R } from "./Actions.js";
|
|
@@ -2,16 +2,21 @@ import "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-error-boundary";
|
|
4
4
|
import "react-i18next";
|
|
5
|
+
import "@gusto/embedded-api/models/errors/apierror";
|
|
6
|
+
import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
7
|
+
import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
8
|
+
import "@tanstack/react-query";
|
|
5
9
|
import "../../Base/useBase.js";
|
|
6
10
|
import "../../../shared/constants.js";
|
|
7
11
|
import "classnames";
|
|
8
12
|
import "dompurify";
|
|
9
13
|
import "../../../contexts/LocaleProvider/useLocale.js";
|
|
10
14
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
15
|
+
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
11
16
|
import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
|
|
12
|
-
const [
|
|
17
|
+
const [u, f] = o("FederalTaxesContext");
|
|
13
18
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
f as FederalTaxesProvider,
|
|
20
|
+
u as useFederalTaxes
|
|
16
21
|
};
|
|
17
22
|
//# 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;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as u } from "react-i18next";
|
|
3
|
-
import { useEmployeesGetSuspense as h } from "
|
|
4
|
-
import { useCompaniesGetSuspense as g } from "
|
|
3
|
+
import { useEmployeesGetSuspense as h } from "@gusto/embedded-api/react-query/employeesGet";
|
|
4
|
+
import { useCompaniesGetSuspense as g } from "@gusto/embedded-api/react-query/companiesGet";
|
|
5
5
|
import s from "./Landing.module.scss.js";
|
|
6
6
|
import { BaseComponent as x } from "../../Base/Base.js";
|
|
7
7
|
import { useBase as y } from "../../Base/useBase.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as e, jsxs as s, Fragment as g } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as b } from "react-i18next";
|
|
3
3
|
import A from "classnames";
|
|
4
|
-
import { useEmployeesGetSuspense as B } from "
|
|
5
|
-
import { useEmployeesGetOnboardingStatusSuspense as L } from "
|
|
4
|
+
import { useEmployeesGetSuspense as B } from "@gusto/embedded-api/react-query/employeesGet";
|
|
5
|
+
import { useEmployeesGetOnboardingStatusSuspense as L } from "@gusto/embedded-api/react-query/employeesGetOnboardingStatus";
|
|
6
6
|
import y from "dompurify";
|
|
7
7
|
import { useMemo as S } from "react";
|
|
8
8
|
import r from "./OnboardingSummary.module.scss.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as n, jsxs as U } from "react/jsx-runtime";
|
|
2
|
-
import { zodResolver as x } from "
|
|
3
|
-
import { useEmployeePaymentMethodCreateMutation as H } from "
|
|
4
|
-
import { useEmployeePaymentMethodDeleteBankAccountMutation as R } from "
|
|
5
|
-
import { useEmployeePaymentMethodsGetBankAccountsSuspense as V } from "
|
|
6
|
-
import { useEmployeePaymentMethodGetSuspense as j } from "
|
|
7
|
-
import { useEmployeePaymentMethodUpdateBankAccountMutation as G } from "
|
|
8
|
-
import { useEmployeePaymentMethodUpdateMutation as K } from "
|
|
9
|
-
import { useQueryClient as z } from "
|
|
2
|
+
import { zodResolver as x } from "@hookform/resolvers/zod";
|
|
3
|
+
import { useEmployeePaymentMethodCreateMutation as H } from "@gusto/embedded-api/react-query/employeePaymentMethodCreate";
|
|
4
|
+
import { useEmployeePaymentMethodDeleteBankAccountMutation as R } from "@gusto/embedded-api/react-query/employeePaymentMethodDeleteBankAccount";
|
|
5
|
+
import { useEmployeePaymentMethodsGetBankAccountsSuspense as V } from "@gusto/embedded-api/react-query/employeePaymentMethodsGetBankAccounts";
|
|
6
|
+
import { useEmployeePaymentMethodGetSuspense as j } from "@gusto/embedded-api/react-query/employeePaymentMethodGet";
|
|
7
|
+
import { useEmployeePaymentMethodUpdateBankAccountMutation as G } from "@gusto/embedded-api/react-query/employeePaymentMethodUpdateBankAccount";
|
|
8
|
+
import { useEmployeePaymentMethodUpdateMutation as K } from "@gusto/embedded-api/react-query/employeePaymentMethodUpdate";
|
|
9
|
+
import { useQueryClient as z } from "@tanstack/react-query";
|
|
10
10
|
import { useState as Q, useMemo as T, useEffect as S } from "react";
|
|
11
11
|
import { useForm as J, FormProvider as W } from "react-hook-form";
|
|
12
12
|
import { useTranslation as X } from "react-i18next";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as x, Fragment as E, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { useFormContext as B } from "react-hook-form";
|
|
3
3
|
import { useTranslation as g, Trans as V } from "react-i18next";
|
|
4
|
-
import { ErrorMessage as z } from "
|
|
4
|
+
import { ErrorMessage as z } from "@hookform/error-message";
|
|
5
5
|
import y from "dompurify";
|
|
6
6
|
import { useMemo as j, useEffect as D } from "react";
|
|
7
7
|
import { usePaymentMethod as N } from "./usePaymentMethod.js";
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { z as t } from "zod";
|
|
2
|
-
import { BankAccountSchema as
|
|
2
|
+
import { BankAccountSchema as l } from "./BankAccount.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "react-error-boundary";
|
|
6
6
|
import "react-i18next";
|
|
7
|
+
import "@gusto/embedded-api/models/errors/apierror";
|
|
8
|
+
import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
9
|
+
import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
10
|
+
import "@tanstack/react-query";
|
|
7
11
|
import "../../Base/useBase.js";
|
|
8
12
|
import "../../../shared/constants.js";
|
|
9
13
|
import "classnames";
|
|
10
14
|
import "dompurify";
|
|
11
15
|
import "../../../contexts/LocaleProvider/useLocale.js";
|
|
12
16
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
17
|
+
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
13
18
|
import { createCompoundContext as a } from "../../Base/createCompoundContext.js";
|
|
14
|
-
const
|
|
15
|
-
|
|
19
|
+
const k = t.union([
|
|
20
|
+
l.extend({
|
|
16
21
|
type: t.literal("Direct Deposit"),
|
|
17
22
|
isSplit: t.literal(!1)
|
|
18
23
|
}),
|
|
@@ -33,7 +38,7 @@ const P = t.union([
|
|
|
33
38
|
splitAmount: t.record(t.string(), t.number().max(100).min(0)).refine(
|
|
34
39
|
(e) => Object.values(e).reduce((r, i) => r + i, 0) === 100,
|
|
35
40
|
(e) => ({
|
|
36
|
-
message: `percentage_split_total_error:${Object.values(e).reduce((i,
|
|
41
|
+
message: `percentage_split_total_error:${Object.values(e).reduce((i, o) => i + o, 0)}`
|
|
37
42
|
})
|
|
38
43
|
),
|
|
39
44
|
priority: t.record(t.string(), t.number())
|
|
@@ -45,16 +50,16 @@ const P = t.union([
|
|
|
45
50
|
splitBy: t.literal("Amount"),
|
|
46
51
|
priority: t.record(t.string(), t.number()).refine((e) => {
|
|
47
52
|
const r = Object.values(e);
|
|
48
|
-
return r.filter((i,
|
|
53
|
+
return r.filter((i, o) => r.indexOf(i) !== o).length === 0;
|
|
49
54
|
}),
|
|
50
55
|
splitAmount: t.record(t.string(), t.number().min(0).nullable()),
|
|
51
56
|
remainder: t.string()
|
|
52
57
|
})
|
|
53
58
|
])
|
|
54
|
-
]), [
|
|
59
|
+
]), [C, v] = a("PaymentMethodContext");
|
|
55
60
|
export {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
k as CombinedSchema,
|
|
62
|
+
v as PaymentMethodProvider,
|
|
63
|
+
C as usePaymentMethod
|
|
59
64
|
};
|
|
60
65
|
//# sourceMappingURL=usePaymentMethod.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePaymentMethod.js","sources":["../../../../src/components/Employee/PaymentMethod/usePaymentMethod.ts"],"sourcesContent":["import type { EmployeeBankAccount } from '@gusto/embedded-api/models/components/employeebankaccount'\nimport type { EmployeePaymentMethod } from '@gusto/embedded-api/models/components/employeepaymentmethod'\nimport { z } from 'zod'\nimport { BankAccountSchema } from './BankAccount'\nimport { createCompoundContext } from '@/components/Base'\n\nexport const CombinedSchema = z.union([\n BankAccountSchema.extend({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(false),\n }),\n z.object({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(false),\n hasBankPayload: z.literal(false),\n }),\n z.object({\n type: z.literal('Check'),\n }),\n z.discriminatedUnion('splitBy', [\n z.object({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(true),\n hasBankPayload: z.literal(false),\n splitBy: z.literal('Percentage'),\n splitAmount: z.record(z.string(), z.number().max(100).min(0)).refine(\n input => Object.values(input).reduce((acc, curr) => acc + curr, 0) === 100,\n input => {\n const total = Object.values(input).reduce((acc, curr) => acc + curr, 0)\n return {\n message: `percentage_split_total_error:${total}`,\n }\n },\n ),\n priority: z.record(z.string(), z.number()),\n }),\n z.object({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(true),\n hasBankPayload: z.literal(false),\n splitBy: z.literal('Amount'),\n priority: z.record(z.string(), z.number()).refine(input => {\n const arr = Object.values(input)\n return arr.filter((item, index) => arr.indexOf(item) !== index).length === 0\n }),\n splitAmount: z.record(z.string(), z.number().min(0).nullable()),\n remainder: z.string(),\n }),\n ]),\n])\n\nexport type CombinedSchemaInputs = z.input<typeof CombinedSchema>\nexport type CombinedSchemaOutputs = z.output<typeof CombinedSchema>\n\ntype PaymentMethodContextType = {\n bankAccounts: EmployeeBankAccount[]\n isPending: boolean\n watchedType?: string\n mode: MODE\n paymentMethod: EmployeePaymentMethod\n handleAdd: () => void\n handleSplit: () => void\n handleCancel: () => void\n handleDelete: (uuid: string) => void\n}\n\nexport type MODE = 'ADD' | 'LIST' | 'SPLIT' | 'INITIAL'\n\nconst [usePaymentMethod, PaymentMethodProvider] =\n createCompoundContext<PaymentMethodContextType>('PaymentMethodContext')\nexport { usePaymentMethod, PaymentMethodProvider }\n"],"names":["CombinedSchema","z","BankAccountSchema","input","acc","curr","arr","item","index","usePaymentMethod","PaymentMethodProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"usePaymentMethod.js","sources":["../../../../src/components/Employee/PaymentMethod/usePaymentMethod.ts"],"sourcesContent":["import type { EmployeeBankAccount } from '@gusto/embedded-api/models/components/employeebankaccount'\nimport type { EmployeePaymentMethod } from '@gusto/embedded-api/models/components/employeepaymentmethod'\nimport { z } from 'zod'\nimport { BankAccountSchema } from './BankAccount'\nimport { createCompoundContext } from '@/components/Base'\n\nexport const CombinedSchema = z.union([\n BankAccountSchema.extend({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(false),\n }),\n z.object({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(false),\n hasBankPayload: z.literal(false),\n }),\n z.object({\n type: z.literal('Check'),\n }),\n z.discriminatedUnion('splitBy', [\n z.object({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(true),\n hasBankPayload: z.literal(false),\n splitBy: z.literal('Percentage'),\n splitAmount: z.record(z.string(), z.number().max(100).min(0)).refine(\n input => Object.values(input).reduce((acc, curr) => acc + curr, 0) === 100,\n input => {\n const total = Object.values(input).reduce((acc, curr) => acc + curr, 0)\n return {\n message: `percentage_split_total_error:${total}`,\n }\n },\n ),\n priority: z.record(z.string(), z.number()),\n }),\n z.object({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(true),\n hasBankPayload: z.literal(false),\n splitBy: z.literal('Amount'),\n priority: z.record(z.string(), z.number()).refine(input => {\n const arr = Object.values(input)\n return arr.filter((item, index) => arr.indexOf(item) !== index).length === 0\n }),\n splitAmount: z.record(z.string(), z.number().min(0).nullable()),\n remainder: z.string(),\n }),\n ]),\n])\n\nexport type CombinedSchemaInputs = z.input<typeof CombinedSchema>\nexport type CombinedSchemaOutputs = z.output<typeof CombinedSchema>\n\ntype PaymentMethodContextType = {\n bankAccounts: EmployeeBankAccount[]\n isPending: boolean\n watchedType?: string\n mode: MODE\n paymentMethod: EmployeePaymentMethod\n handleAdd: () => void\n handleSplit: () => void\n handleCancel: () => void\n handleDelete: (uuid: string) => void\n}\n\nexport type MODE = 'ADD' | 'LIST' | 'SPLIT' | 'INITIAL'\n\nconst [usePaymentMethod, PaymentMethodProvider] =\n createCompoundContext<PaymentMethodContextType>('PaymentMethodContext')\nexport { usePaymentMethod, PaymentMethodProvider }\n"],"names":["CombinedSchema","z","BankAccountSchema","input","acc","curr","arr","item","index","usePaymentMethod","PaymentMethodProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;;;AAMO,MAAMA,IAAiBC,EAAE,MAAM;AAAA,EACpCC,EAAkB,OAAO;AAAA,IACvB,MAAMD,EAAE,QAAQ,gBAAgB;AAAA,IAChC,SAASA,EAAE,QAAQ,EAAK;AAAA,EAAA,CACzB;AAAA,EACDA,EAAE,OAAO;AAAA,IACP,MAAMA,EAAE,QAAQ,gBAAgB;AAAA,IAChC,SAASA,EAAE,QAAQ,EAAK;AAAA,IACxB,gBAAgBA,EAAE,QAAQ,EAAK;AAAA,EAAA,CAChC;AAAA,EACDA,EAAE,OAAO;AAAA,IACP,MAAMA,EAAE,QAAQ,OAAO;AAAA,EAAA,CACxB;AAAA,EACDA,EAAE,mBAAmB,WAAW;AAAA,IAC9BA,EAAE,OAAO;AAAA,MACP,MAAMA,EAAE,QAAQ,gBAAgB;AAAA,MAChC,SAASA,EAAE,QAAQ,EAAI;AAAA,MACvB,gBAAgBA,EAAE,QAAQ,EAAK;AAAA,MAC/B,SAASA,EAAE,QAAQ,YAAY;AAAA,MAC/B,aAAaA,EAAE,OAAOA,EAAE,UAAUA,EAAE,OAAA,EAAS,IAAI,GAAG,EAAE,IAAI,CAAC,CAAC,EAAE;AAAA,QAC5D,CAAAE,MAAS,OAAO,OAAOA,CAAK,EAAE,OAAO,CAACC,GAAKC,MAASD,IAAMC,GAAM,CAAC,MAAM;AAAA,QACvE,CAAAF,OAES;AAAA,UACL,SAAS,gCAFG,OAAO,OAAOA,CAAK,EAAE,OAAO,CAACC,GAAKC,MAASD,IAAMC,GAAM,CAAC,CAEtB;AAAA,QAAA;AAAA,MAElD;AAAA,MAEF,UAAUJ,EAAE,OAAOA,EAAE,UAAUA,EAAE,QAAQ;AAAA,IAAA,CAC1C;AAAA,IACDA,EAAE,OAAO;AAAA,MACP,MAAMA,EAAE,QAAQ,gBAAgB;AAAA,MAChC,SAASA,EAAE,QAAQ,EAAI;AAAA,MACvB,gBAAgBA,EAAE,QAAQ,EAAK;AAAA,MAC/B,SAASA,EAAE,QAAQ,QAAQ;AAAA,MAC3B,UAAUA,EAAE,OAAOA,EAAE,OAAA,GAAUA,EAAE,OAAA,CAAQ,EAAE,OAAO,CAAAE,MAAS;AACzD,cAAMG,IAAM,OAAO,OAAOH,CAAK;AAC/B,eAAOG,EAAI,OAAO,CAACC,GAAMC,MAAUF,EAAI,QAAQC,CAAI,MAAMC,CAAK,EAAE,WAAW;AAAA,MAC7E,CAAC;AAAA,MACD,aAAaP,EAAE,OAAOA,EAAE,OAAA,GAAUA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,UAAU;AAAA,MAC9D,WAAWA,EAAE,OAAA;AAAA,IAAO,CACrB;AAAA,EAAA,CACF;AACH,CAAC,GAmBK,CAACQ,GAAkBC,CAAqB,IAC5CC,EAAgD,sBAAsB;"}
|
|
@@ -5,12 +5,11 @@ import { z as t } from "zod";
|
|
|
5
5
|
import { useProfile as g } from "./useProfile.js";
|
|
6
6
|
import { STATES_ABBR as f } from "../../../shared/constants.js";
|
|
7
7
|
import { Grid as b } from "../../Common/Grid/Grid.js";
|
|
8
|
-
import "classnames";
|
|
9
8
|
import { TextInputField as n } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
10
9
|
import { useComponentContext as y } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
10
|
import { SelectField as T } from "../../Common/Fields/SelectField/SelectField.js";
|
|
12
11
|
import { CheckboxField as x } from "../../Common/Fields/CheckboxField/CheckboxField.js";
|
|
13
|
-
const
|
|
12
|
+
const j = t.union([
|
|
14
13
|
// Case 1: selfOnboarding is false or undefined
|
|
15
14
|
t.object({
|
|
16
15
|
street1: t.string().min(1),
|
|
@@ -25,7 +24,7 @@ const q = t.union([
|
|
|
25
24
|
t.object({
|
|
26
25
|
selfOnboarding: t.literal(!0)
|
|
27
26
|
})
|
|
28
|
-
]),
|
|
27
|
+
]), q = () => {
|
|
29
28
|
const { t: e } = u("Employee.HomeAddress"), i = y(), { isSelfOnboardingIntended: d, isAdmin: m } = g(), { watch: c } = p(), h = c("courtesyWithholding");
|
|
30
29
|
return m && d ? null : /* @__PURE__ */ o(l, { children: [
|
|
31
30
|
/* @__PURE__ */ o("div", { children: [
|
|
@@ -101,7 +100,7 @@ const q = t.union([
|
|
|
101
100
|
] });
|
|
102
101
|
};
|
|
103
102
|
export {
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
q as HomeAddress,
|
|
104
|
+
j as HomeAddressSchema
|
|
106
105
|
};
|
|
107
106
|
//# sourceMappingURL=HomeAddress.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HomeAddress.js","sources":["../../../../src/components/Employee/Profile/HomeAddress.tsx"],"sourcesContent":["import { useFormContext } from 'react-hook-form'\nimport { Trans, useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { useProfile } from './useProfile'\nimport { STATES_ABBR } from '@/shared/constants'\nimport { CheckboxField, Grid, SelectField, TextInputField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const HomeAddressSchema = z.union([\n // Case 1: selfOnboarding is false or undefined\n z.object({\n street1: z.string().min(1),\n street2: z.string().optional(),\n city: z.string().min(1),\n state: z.string().min(1),\n zip: z.string().refine(zip => /(^\\d{5}$)|(^\\d{5}-\\d{4}$)/.test(zip)),\n courtesyWithholding: z.boolean(),\n selfOnboarding: z.union([z.literal(false), z.undefined()]),\n }),\n // Case 2: selfOnboarding is true\n z.object({\n selfOnboarding: z.literal(true),\n }),\n])\n\nexport type HomeAddressInputs = z.infer<typeof HomeAddressSchema>\n\nexport const HomeAddress = () => {\n const { t } = useTranslation('Employee.HomeAddress')\n const Components = useComponentContext()\n const { isSelfOnboardingIntended, isAdmin } = useProfile()\n\n const { watch } = useFormContext<HomeAddressInputs>()\n const watchedCourtesyWithholding = watch('courtesyWithholding')\n\n if (isAdmin && isSelfOnboardingIntended) {\n return null\n }\n\n return (\n <>\n <div>\n <Components.Heading as=\"h2\">{t('formTitle')}</Components.Heading>\n <Components.Text>{t('desc')}</Components.Text>\n </div>\n <Grid\n gridTemplateColumns={{\n base: '1fr',\n small: ['1fr', '1fr'],\n }}\n gap={20}\n >\n <TextInputField\n name=\"street1\"\n label={t('street1')}\n isRequired\n errorMessage={t('validations.street1')}\n />\n <TextInputField name=\"street2\" label={t('street2')} />\n <TextInputField\n name=\"city\"\n isRequired\n label={t('city')}\n errorMessage={t('validations.city')}\n />\n <SelectField\n name=\"state\"\n options={STATES_ABBR.map((stateAbbr: (typeof STATES_ABBR)[number]) => ({\n label: t(`statesHash.${stateAbbr}`, { ns: 'common' }),\n value: stateAbbr,\n }))}\n label={t('state')}\n placeholder={t('statePlaceholder')}\n errorMessage={t('validations.state')}\n isRequired\n />\n <TextInputField\n name=\"zip\"\n isRequired\n label={t('zip')}\n errorMessage={t('validations.zip')}\n />\n </Grid>\n <CheckboxField\n name=\"courtesyWithholding\"\n label={t('courtesyWithholdingLabel')}\n description={\n <>\n {t('courtesyWhithholdingDescription')}\n <Trans t={t} i18nKey=\"learnMoreCta\" components={{ learnMore: <Components.Link /> }} />\n </>\n }\n />\n {watchedCourtesyWithholding && (\n <Components.Alert label={t('withholdingTitle')} status=\"warning\">\n <Trans t={t} i18nKey=\"withholdingNote\" />\n </Components.Alert>\n )}\n </>\n )\n}\n"],"names":["HomeAddressSchema","z","zip","HomeAddress","t","useTranslation","Components","useComponentContext","isSelfOnboardingIntended","isAdmin","useProfile","watch","useFormContext","watchedCourtesyWithholding","jsxs","Fragment","jsx","Grid","TextInputField","SelectField","STATES_ABBR","stateAbbr","CheckboxField","Trans"],"mappings":"
|
|
1
|
+
{"version":3,"file":"HomeAddress.js","sources":["../../../../src/components/Employee/Profile/HomeAddress.tsx"],"sourcesContent":["import { useFormContext } from 'react-hook-form'\nimport { Trans, useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { useProfile } from './useProfile'\nimport { STATES_ABBR } from '@/shared/constants'\nimport { CheckboxField, Grid, SelectField, TextInputField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const HomeAddressSchema = z.union([\n // Case 1: selfOnboarding is false or undefined\n z.object({\n street1: z.string().min(1),\n street2: z.string().optional(),\n city: z.string().min(1),\n state: z.string().min(1),\n zip: z.string().refine(zip => /(^\\d{5}$)|(^\\d{5}-\\d{4}$)/.test(zip)),\n courtesyWithholding: z.boolean(),\n selfOnboarding: z.union([z.literal(false), z.undefined()]),\n }),\n // Case 2: selfOnboarding is true\n z.object({\n selfOnboarding: z.literal(true),\n }),\n])\n\nexport type HomeAddressInputs = z.infer<typeof HomeAddressSchema>\n\nexport const HomeAddress = () => {\n const { t } = useTranslation('Employee.HomeAddress')\n const Components = useComponentContext()\n const { isSelfOnboardingIntended, isAdmin } = useProfile()\n\n const { watch } = useFormContext<HomeAddressInputs>()\n const watchedCourtesyWithholding = watch('courtesyWithholding')\n\n if (isAdmin && isSelfOnboardingIntended) {\n return null\n }\n\n return (\n <>\n <div>\n <Components.Heading as=\"h2\">{t('formTitle')}</Components.Heading>\n <Components.Text>{t('desc')}</Components.Text>\n </div>\n <Grid\n gridTemplateColumns={{\n base: '1fr',\n small: ['1fr', '1fr'],\n }}\n gap={20}\n >\n <TextInputField\n name=\"street1\"\n label={t('street1')}\n isRequired\n errorMessage={t('validations.street1')}\n />\n <TextInputField name=\"street2\" label={t('street2')} />\n <TextInputField\n name=\"city\"\n isRequired\n label={t('city')}\n errorMessage={t('validations.city')}\n />\n <SelectField\n name=\"state\"\n options={STATES_ABBR.map((stateAbbr: (typeof STATES_ABBR)[number]) => ({\n label: t(`statesHash.${stateAbbr}`, { ns: 'common' }),\n value: stateAbbr,\n }))}\n label={t('state')}\n placeholder={t('statePlaceholder')}\n errorMessage={t('validations.state')}\n isRequired\n />\n <TextInputField\n name=\"zip\"\n isRequired\n label={t('zip')}\n errorMessage={t('validations.zip')}\n />\n </Grid>\n <CheckboxField\n name=\"courtesyWithholding\"\n label={t('courtesyWithholdingLabel')}\n description={\n <>\n {t('courtesyWhithholdingDescription')}\n <Trans t={t} i18nKey=\"learnMoreCta\" components={{ learnMore: <Components.Link /> }} />\n </>\n }\n />\n {watchedCourtesyWithholding && (\n <Components.Alert label={t('withholdingTitle')} status=\"warning\">\n <Trans t={t} i18nKey=\"withholdingNote\" />\n </Components.Alert>\n )}\n </>\n )\n}\n"],"names":["HomeAddressSchema","z","zip","HomeAddress","t","useTranslation","Components","useComponentContext","isSelfOnboardingIntended","isAdmin","useProfile","watch","useFormContext","watchedCourtesyWithholding","jsxs","Fragment","jsx","Grid","TextInputField","SelectField","STATES_ABBR","stateAbbr","CheckboxField","Trans"],"mappings":";;;;;;;;;;;AAQO,MAAMA,IAAoBC,EAAE,MAAM;AAAA;AAAA,EAEvCA,EAAE,OAAO;AAAA,IACP,SAASA,EAAE,SAAS,IAAI,CAAC;AAAA,IACzB,SAASA,EAAE,OAAA,EAAS,SAAA;AAAA,IACpB,MAAMA,EAAE,SAAS,IAAI,CAAC;AAAA,IACtB,OAAOA,EAAE,SAAS,IAAI,CAAC;AAAA,IACvB,KAAKA,EAAE,OAAA,EAAS,OAAO,CAAAC,MAAO,4BAA4B,KAAKA,CAAG,CAAC;AAAA,IACnE,qBAAqBD,EAAE,QAAA;AAAA,IACvB,gBAAgBA,EAAE,MAAM,CAACA,EAAE,QAAQ,EAAK,GAAGA,EAAE,WAAW,CAAC;AAAA,EAAA,CAC1D;AAAA;AAAA,EAEDA,EAAE,OAAO;AAAA,IACP,gBAAgBA,EAAE,QAAQ,EAAI;AAAA,EAAA,CAC/B;AACH,CAAC,GAIYE,IAAc,MAAM;AAC/B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,sBAAsB,GAC7CC,IAAaC,EAAA,GACb,EAAE,0BAAAC,GAA0B,SAAAC,EAAA,IAAYC,EAAA,GAExC,EAAE,OAAAC,EAAA,IAAUC,EAAA,GACZC,IAA6BF,EAAM,qBAAqB;AAE9D,SAAIF,KAAWD,IACN,OAIP,gBAAAM,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAD,EAAC,OAAA,EACC,UAAA;AAAA,MAAA,gBAAAE,EAACV,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAF,EAAE,WAAW,GAAE;AAAA,wBAC3CE,EAAW,MAAX,EAAiB,UAAAF,EAAE,MAAM,EAAA,CAAE;AAAA,IAAA,GAC9B;AAAA,IACA,gBAAAU;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,qBAAqB;AAAA,UACnB,MAAM;AAAA,UACN,OAAO,CAAC,OAAO,KAAK;AAAA,QAAA;AAAA,QAEtB,KAAK;AAAA,QAEL,UAAA;AAAA,UAAA,gBAAAD;AAAA,YAACE;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,OAAOd,EAAE,SAAS;AAAA,cAClB,YAAU;AAAA,cACV,cAAcA,EAAE,qBAAqB;AAAA,YAAA;AAAA,UAAA;AAAA,4BAEtCc,GAAA,EAAe,MAAK,WAAU,OAAOd,EAAE,SAAS,GAAG;AAAA,UACpD,gBAAAY;AAAA,YAACE;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,YAAU;AAAA,cACV,OAAOd,EAAE,MAAM;AAAA,cACf,cAAcA,EAAE,kBAAkB;AAAA,YAAA;AAAA,UAAA;AAAA,UAEpC,gBAAAY;AAAA,YAACG;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,SAASC,EAAY,IAAI,CAACC,OAA6C;AAAA,gBACrE,OAAOjB,EAAE,cAAciB,CAAS,IAAI,EAAE,IAAI,UAAU;AAAA,gBACpD,OAAOA;AAAA,cAAA,EACP;AAAA,cACF,OAAOjB,EAAE,OAAO;AAAA,cAChB,aAAaA,EAAE,kBAAkB;AAAA,cACjC,cAAcA,EAAE,mBAAmB;AAAA,cACnC,YAAU;AAAA,YAAA;AAAA,UAAA;AAAA,UAEZ,gBAAAY;AAAA,YAACE;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,YAAU;AAAA,cACV,OAAOd,EAAE,KAAK;AAAA,cACd,cAAcA,EAAE,iBAAiB;AAAA,YAAA;AAAA,UAAA;AAAA,QACnC;AAAA,MAAA;AAAA,IAAA;AAAA,IAEF,gBAAAY;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOlB,EAAE,0BAA0B;AAAA,QACnC,aACE,gBAAAU,EAAAC,GAAA,EACG,UAAA;AAAA,UAAAX,EAAE,iCAAiC;AAAA,UACpC,gBAAAY,EAACO,GAAA,EAAM,GAAAnB,GAAM,SAAQ,gBAAe,YAAY,EAAE,WAAW,gBAAAY,EAACV,EAAW,MAAX,CAAA,CAAgB,IAAG,CAAG;AAAA,QAAA,EAAA,CACtF;AAAA,MAAA;AAAA,IAAA;AAAA,IAGHO,KACC,gBAAAG,EAACV,EAAW,OAAX,EAAiB,OAAOF,EAAE,kBAAkB,GAAG,QAAO,WACrD,UAAA,gBAAAY,EAACO,GAAA,EAAM,GAAAnB,GAAM,SAAQ,mBAAkB,EAAA,CACzC;AAAA,EAAA,GAEJ;AAEJ;"}
|