@gusto/embedded-react-sdk 0.8.0 → 0.8.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 +9 -0
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js +5 -3
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js.map +1 -1
- package/dist/components/Common/FadeIn/FadeIn.module.scss.js +4 -4
- package/dist/components/Common/{UI/FieldCaption → FieldCaption}/FieldCaption.js +1 -1
- package/dist/components/Common/FieldCaption/FieldCaption.js.map +1 -0
- package/dist/components/Common/{UI/FieldDescription → FieldDescription}/FieldDescription.js +1 -1
- package/dist/components/Common/FieldDescription/FieldDescription.js.map +1 -0
- package/dist/components/Common/{UI/FieldErrorMessage → FieldErrorMessage}/FieldErrorMessage.js +1 -1
- package/dist/components/Common/FieldErrorMessage/FieldErrorMessage.js.map +1 -0
- package/dist/components/Common/{UI/FieldLayout → FieldLayout}/FieldLayout.js +1 -1
- package/dist/components/Common/FieldLayout/FieldLayout.js.map +1 -0
- package/dist/components/Common/FieldLayout/FieldLayoutTypes.d.ts +52 -0
- package/dist/components/Common/{UI/Fieldset → Fieldset}/Fieldset.js +1 -1
- package/dist/components/Common/Fieldset/Fieldset.js.map +1 -0
- package/dist/components/Common/{UI/HorizontalFieldLayout → HorizontalFieldLayout}/HorizontalFieldLayout.js +2 -2
- package/dist/components/Common/HorizontalFieldLayout/HorizontalFieldLayout.js.map +1 -0
- package/dist/components/Common/SignatureForm/SignatureForm.d.ts +12 -6
- package/dist/components/Common/SignatureForm/SignatureForm.js +10 -10
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/UI/Alert/Alert.d.ts +1 -1
- package/dist/components/Common/UI/Alert/Alert.js +13 -12
- package/dist/components/Common/UI/Alert/Alert.js.map +1 -1
- package/dist/components/Common/UI/Alert/AlertTypes.d.ts +16 -4
- package/dist/components/Common/UI/Badge/BadgeTypes.d.ts +6 -0
- package/dist/components/Common/UI/Button/Button.js +28 -27
- package/dist/components/Common/UI/Button/Button.js.map +1 -1
- package/dist/components/Common/UI/Button/Button.module.scss.js +1 -1
- package/dist/components/Common/UI/Button/ButtonTypes.d.ts +29 -4
- package/dist/components/Common/UI/CalendarPreview/CalendarPreviewTypes.d.ts +24 -0
- package/dist/components/Common/UI/Card/Card.module.scss.js +1 -1
- package/dist/components/Common/UI/Card/CardTypes.d.ts +12 -4
- package/dist/components/Common/UI/Checkbox/Checkbox.js +4 -4
- package/dist/components/Common/UI/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Common/UI/Checkbox/CheckboxTypes.d.ts +16 -1
- package/dist/components/Common/UI/CheckboxGroup/CheckboxGroup.js +4 -4
- package/dist/components/Common/UI/CheckboxGroup/CheckboxGroup.js.map +1 -1
- package/dist/components/Common/UI/CheckboxGroup/CheckboxGroupTypes.d.ts +33 -3
- package/dist/components/Common/UI/ComboBox/ComboBox.js +8 -8
- package/dist/components/Common/UI/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBoxTypes.d.ts +31 -1
- package/dist/components/Common/UI/DatePicker/DatePicker.js +13 -13
- package/dist/components/Common/UI/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/Common/UI/DatePicker/DatePickerTypes.d.ts +25 -1
- package/dist/components/Common/UI/Heading/HeadingTypes.d.ts +12 -0
- package/dist/components/Common/UI/Link/LinkTypes.d.ts +53 -1
- package/dist/components/Common/UI/List/ListTypes.d.ts +3 -5
- package/dist/components/Common/UI/Menu/MenuTypes.d.ts +30 -0
- package/dist/components/Common/UI/NumberInput/NumberInput.js +4 -4
- package/dist/components/Common/UI/NumberInput/NumberInput.js.map +1 -1
- package/dist/components/Common/UI/NumberInput/NumberInputTypes.d.ts +34 -1
- package/dist/components/Common/UI/ProgressBar/ProgressBarTypes.d.ts +12 -0
- package/dist/components/Common/UI/Radio/Radio.js +1 -1
- package/dist/components/Common/UI/Radio/Radio.js.map +1 -1
- package/dist/components/Common/UI/Radio/RadioTypes.d.ts +16 -1
- package/dist/components/Common/UI/RadioGroup/RadioGroup.js +4 -4
- package/dist/components/Common/UI/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.d.ts +33 -3
- package/dist/components/Common/UI/Select/Select.js +8 -8
- package/dist/components/Common/UI/Select/Select.js.map +1 -1
- package/dist/components/Common/UI/Select/SelectTypes.d.ts +34 -1
- package/dist/components/Common/UI/Switch/Switch.js +1 -1
- package/dist/components/Common/UI/Switch/Switch.js.map +1 -1
- package/dist/components/Common/UI/Switch/SwitchTypes.d.ts +25 -1
- package/dist/components/Common/UI/Table/TableTypes.d.ts +21 -0
- package/dist/components/Common/UI/Text/TextTypes.d.ts +18 -0
- package/dist/components/Common/UI/TextInput/TextInput.js +1 -1
- package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
- package/dist/components/Common/UI/TextInput/TextInputTypes.d.ts +22 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +12 -12
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +7 -7
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.d.ts +2 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Schema.d.ts +41 -15
- package/dist/components/Company/AssignSignatory/CreateSignatory/Schema.js +17 -20
- package/dist/components/Company/AssignSignatory/CreateSignatory/Schema.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +10 -10
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.d.ts +17 -11
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +42 -45
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +6 -6
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.d.ts +12 -6
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +2 -2
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js +10 -10
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.d.ts +12 -6
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +17 -17
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSignerFlow/SignatureForm/SignatureForm.js +1 -1
- package/dist/components/Company/DocumentSignerFlow/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +5 -5
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.d.ts +18 -8
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +12 -16
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Industry.js +1 -1
- package/dist/components/Company/Industry/Industry.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.d.ts +27 -11
- package/dist/components/Company/Locations/LocationForm/Form.js +24 -24
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +24 -24
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +7 -7
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +28 -31
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.module.scss.js +8 -0
- package/dist/components/Company/PaySchedule/_parts/List.module.scss.js.map +1 -0
- package/dist/components/Company/PaySchedule/usePaySchedule.d.ts +31 -13
- package/dist/components/Company/PaySchedule/usePaySchedule.js +15 -20
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.d.ts +3 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js +3 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +66 -77
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Employee/Compensation/Compensation.js +5 -5
- package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +10 -10
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Compensation/useCompensation.d.ts +90 -42
- package/dist/components/Employee/Compensation/useCompensation.js +45 -69
- package/dist/components/Employee/Compensation/useCompensation.js.map +1 -1
- package/dist/components/Employee/Deductions/Deductions.d.ts +9 -5
- package/dist/components/Employee/Deductions/Deductions.js +13 -13
- package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/useDeductions.d.ts +34 -14
- package/dist/components/Employee/Deductions/useDeductions.js +14 -32
- package/dist/components/Employee/Deductions/useDeductions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccount.d.ts +22 -10
- package/dist/components/Employee/PaymentMethod/BankAccount.js +9 -9
- package/dist/components/Employee/PaymentMethod/BankAccount.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js +13 -13
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.d.ts +10 -6
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +8 -8
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.d.ts +92 -37
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +35 -42
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +68 -31
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +33 -46
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.d.ts +33 -13
- package/dist/components/Employee/Profile/HomeAddress.js +39 -38
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +81 -32
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +60 -74
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/Profile.js +51 -55
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/SelfPersonalDetails.d.ts +44 -15
- package/dist/components/Employee/Profile/SelfPersonalDetails.js +18 -21
- package/dist/components/Employee/Profile/SelfPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.d.ts +28 -12
- package/dist/components/Employee/Taxes/FederalForm.js +28 -28
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/StateForm.d.ts +9 -5
- package/dist/components/Employee/Taxes/StateForm.js +5 -5
- package/dist/components/Employee/Taxes/StateForm.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.js +31 -34
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/contexts/ApiProvider/ApiProvider.d.ts +5 -0
- package/dist/contexts/ApiProvider/ApiProvider.js +34 -0
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -0
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +16 -16
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/helpers/validations.d.ts +6 -5
- package/dist/helpers/validations.js +10 -17
- package/dist/helpers/validations.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +7 -4
- package/dist/components/Common/UI/FieldCaption/FieldCaption.js.map +0 -1
- package/dist/components/Common/UI/FieldDescription/FieldDescription.js.map +0 -1
- package/dist/components/Common/UI/FieldErrorMessage/FieldErrorMessage.js.map +0 -1
- package/dist/components/Common/UI/FieldLayout/FieldLayout.js.map +0 -1
- package/dist/components/Common/UI/FieldLayout/FieldLayoutTypes.d.ts +0 -19
- package/dist/components/Common/UI/Fieldset/Fieldset.js.map +0 -1
- package/dist/components/Common/UI/HorizontalFieldLayout/HorizontalFieldLayout.js.map +0 -1
- /package/dist/components/Common/{UI/FieldCaption → FieldCaption}/FieldCaption.d.ts +0 -0
- /package/dist/components/Common/{UI/FieldCaption → FieldCaption}/FieldCaption.module.scss.js +0 -0
- /package/dist/components/Common/{UI/FieldCaption → FieldCaption}/FieldCaption.module.scss.js.map +0 -0
- /package/dist/components/Common/{UI/FieldCaption → FieldCaption}/index.d.ts +0 -0
- /package/dist/components/Common/{UI/FieldDescription → FieldDescription}/FieldDescription.d.ts +0 -0
- /package/dist/components/Common/{UI/FieldDescription → FieldDescription}/FieldDescription.module.scss.js +0 -0
- /package/dist/components/Common/{UI/FieldDescription → FieldDescription}/FieldDescription.module.scss.js.map +0 -0
- /package/dist/components/Common/{UI/FieldDescription → FieldDescription}/index.d.ts +0 -0
- /package/dist/components/Common/{UI/FieldErrorMessage → FieldErrorMessage}/FieldErrorMessage.d.ts +0 -0
- /package/dist/components/Common/{UI/FieldErrorMessage → FieldErrorMessage}/FieldErrorMessage.module.scss.js +0 -0
- /package/dist/components/Common/{UI/FieldErrorMessage → FieldErrorMessage}/FieldErrorMessage.module.scss.js.map +0 -0
- /package/dist/components/Common/{UI/FieldErrorMessage → FieldErrorMessage}/index.d.ts +0 -0
- /package/dist/components/Common/{UI/FieldLayout → FieldLayout}/FieldLayout.d.ts +0 -0
- /package/dist/components/Common/{UI/FieldLayout → FieldLayout}/FieldLayout.module.scss.js +0 -0
- /package/dist/components/Common/{UI/FieldLayout → FieldLayout}/FieldLayout.module.scss.js.map +0 -0
- /package/dist/components/Common/{UI/FieldLayout → FieldLayout}/index.d.ts +0 -0
- /package/dist/components/Common/{UI/Fieldset → Fieldset}/Fieldset.d.ts +0 -0
- /package/dist/components/Common/{UI/Fieldset → Fieldset}/Fieldset.module.scss.js +0 -0
- /package/dist/components/Common/{UI/Fieldset → Fieldset}/Fieldset.module.scss.js.map +0 -0
- /package/dist/components/Common/{UI/Fieldset → Fieldset}/index.d.ts +0 -0
- /package/dist/components/Common/{UI/HorizontalFieldLayout → HorizontalFieldLayout}/HorizontalFieldLayout.d.ts +0 -0
- /package/dist/components/Common/{UI/HorizontalFieldLayout → HorizontalFieldLayout}/HorizontalFieldLayout.module.scss.js +0 -0
- /package/dist/components/Common/{UI/HorizontalFieldLayout → HorizontalFieldLayout}/HorizontalFieldLayout.module.scss.js.map +0 -0
- /package/dist/components/Common/{UI/HorizontalFieldLayout → HorizontalFieldLayout}/HorizontalFieldLayoutTypes.d.ts +0 -0
- /package/dist/components/Common/{UI/HorizontalFieldLayout → HorizontalFieldLayout}/index.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InviteSignatoryForm.js","sources":["../../../../../src/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"InviteSignatoryForm.js","sources":["../../../../../src/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useFormContext } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { TextInputField, Grid, Flex } from '@/components/Common'\nimport { nameValidation } from '@/helpers/validations'\nimport { TitleSelect } from '@/components/Company/AssignSignatory/TitleSelect'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nconst emailMismatchError = 'email_mismatch'\n\nexport const InviteSignatorySchema = z\n .object({\n firstName: nameValidation,\n lastName: nameValidation,\n email: z.string().min(1).email(),\n confirmEmail: z.string().min(1).email(),\n title: z.string().min(1),\n })\n .refine(data => data.email === data.confirmEmail, {\n message: emailMismatchError,\n path: ['confirmEmail'],\n })\n\nexport type InviteSignatoryInputs = z.infer<typeof InviteSignatorySchema>\n\nexport const InviteSignatoryForm = () => {\n const { t } = useTranslation('Company.AssignSignatory')\n const Components = useComponentContext()\n\n const {\n setError,\n clearErrors,\n formState: { errors, isSubmitted },\n watch,\n } = useFormContext()\n\n // Some workarounds here to also ensure that modifying the email field\n // sets and clears the confirm_email field error state\n const confirmEmail = watch('confirmEmail')\n\n const handleEmailChange = (value: string) => {\n if (isSubmitted) {\n if (value === confirmEmail) {\n clearErrors('confirmEmail')\n }\n\n if (value !== confirmEmail) {\n setError('confirmEmail', { message: emailMismatchError })\n }\n }\n }\n\n return (\n <Flex flexDirection=\"column\" gap={12}>\n <header>\n <Components.Heading as=\"h2\">{t('inviteSignatory.title')}</Components.Heading>\n <Components.Text>{t('inviteSignatory.description')}</Components.Text>\n </header>\n\n <Grid gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }} gap={20}>\n <TextInputField\n name=\"email\"\n label={t('inviteSignatory.signatoryEmail')}\n isRequired\n errorMessage={t('validations.email')}\n onChange={handleEmailChange}\n />\n <TextInputField\n name=\"confirmEmail\"\n label={t('inviteSignatory.confirmEmail')}\n isRequired\n errorMessage={\n errors.confirmEmail?.message === emailMismatchError\n ? t('validations.emailMismatch')\n : t('validations.email')\n }\n />\n <TextInputField\n name=\"firstName\"\n label={t('inviteSignatory.firstName')}\n isRequired\n errorMessage={t('validations.firstName')}\n />\n <TextInputField\n name=\"lastName\"\n label={t('inviteSignatory.lastName')}\n isRequired\n errorMessage={t('validations.lastName')}\n />\n <TitleSelect />\n </Grid>\n </Flex>\n )\n}\n"],"names":["emailMismatchError","InviteSignatorySchema","z","nameValidation","data","InviteSignatoryForm","t","useTranslation","Components","useComponentContext","setError","clearErrors","errors","isSubmitted","watch","useFormContext","confirmEmail","handleEmailChange","value","jsxs","Flex","jsx","Grid","TextInputField","TitleSelect"],"mappings":";;;;;;;;;;AAQA,MAAMA,IAAqB,kBAEdC,IAAwBC,EAClC,OAAO;AAAA,EACN,WAAWC;AAAA,EACX,UAAUA;AAAA,EACV,OAAOD,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,MAAM;AAAA,EAC/B,cAAcA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,MAAM;AAAA,EACtC,OAAOA,EAAE,OAAO,EAAE,IAAI,CAAC;AACzB,CAAC,EACA,OAAO,CAAAE,MAAQA,EAAK,UAAUA,EAAK,cAAc;AAAA,EAChD,SAASJ;AAAA,EACT,MAAM,CAAC,cAAc;AACvB,CAAC,GAIUK,IAAsB,MAAM;AACvC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAChDC,IAAaC,EAAoB,GAEjC;AAAA,IACJ,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAW,EAAE,QAAAC,GAAQ,aAAAC,EAAY;AAAA,IACjC,OAAAC;AAAA,MACEC,EAAe,GAIbC,IAAeF,EAAM,cAAc,GAEnCG,IAAoB,CAACC,MAAkB;AAC3C,IAAIL,MACEK,MAAUF,KACZL,EAAY,cAAc,GAGxBO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GAAY,CAAA,CAAA;AAAA,IAAA,EACf,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o, jsxs as F, Fragment as C } from "react/jsx-runtime";
|
|
2
|
-
import { useBankAccountsCreateMutation as
|
|
3
|
-
import { useForm as
|
|
4
|
-
import {
|
|
2
|
+
import { useBankAccountsCreateMutation as k } from "@gusto/embedded-api/react-query/bankAccountsCreate";
|
|
3
|
+
import { useForm as b, FormProvider as g } from "react-hook-form";
|
|
4
|
+
import { zodResolver as v } from "@hookform/resolvers/zod";
|
|
5
5
|
import { Head as m } from "./Head.js";
|
|
6
6
|
import { BankAccountFormSchema as y, Form as c } from "./Form.js";
|
|
7
7
|
import { Actions as i } from "./Actions.js";
|
|
@@ -17,8 +17,8 @@ function r(n) {
|
|
|
17
17
|
}
|
|
18
18
|
function T({ companyId: n, className: a, children: t }) {
|
|
19
19
|
E("Company.BankAccount");
|
|
20
|
-
const { onEvent: u, baseSubmitHandler: s } = S(), { mutateAsync: d, isPending: l } =
|
|
21
|
-
resolver:
|
|
20
|
+
const { onEvent: u, baseSubmitHandler: s } = S(), { mutateAsync: d, isPending: l } = k(), { control: f, ...e } = b({
|
|
21
|
+
resolver: v(y),
|
|
22
22
|
defaultValues: { accountNumber: "", routingNumber: "" }
|
|
23
23
|
}), p = async (A) => {
|
|
24
24
|
await s(A, async (h) => {
|
|
@@ -29,7 +29,7 @@ function T({ companyId: n, className: a, children: t }) {
|
|
|
29
29
|
u(R.COMPANY_BANK_ACCOUNT_CREATED, B);
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
|
-
return /* @__PURE__ */ o("section", { className: a, children: /* @__PURE__ */ o(
|
|
32
|
+
return /* @__PURE__ */ o("section", { className: a, children: /* @__PURE__ */ o(g, { ...e, control: f, children: /* @__PURE__ */ o(x, { onSubmit: e.handleSubmit(p), children: /* @__PURE__ */ o(P, { value: { isPending: l }, children: /* @__PURE__ */ o(H, { flexDirection: "column", gap: 32, children: t || /* @__PURE__ */ F(C, { children: [
|
|
33
33
|
/* @__PURE__ */ o(m, {}),
|
|
34
34
|
/* @__PURE__ */ o(c, {}),
|
|
35
35
|
/* @__PURE__ */ o(i, {})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BankAccountForm.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountForm/BankAccountForm.tsx"],"sourcesContent":["import { useBankAccountsCreateMutation } from '@gusto/embedded-api/react-query/bankAccountsCreate'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport {
|
|
1
|
+
{"version":3,"file":"BankAccountForm.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountForm/BankAccountForm.tsx"],"sourcesContent":["import { useBankAccountsCreateMutation } from '@gusto/embedded-api/react-query/bankAccountsCreate'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { Head } from './Head'\nimport type { BankAccountFormInputs } from './Form'\nimport { BankAccountFormSchema, Form } from './Form'\nimport { Actions } from './Actions'\nimport { BankAccountFormProvider } from './context'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n/I18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { componentEvents } from '@/shared/constants'\n\ninterface BankAccountFormProps extends CommonComponentInterface {\n companyId: string\n}\n\nexport function BankAccountForm(props: BankAccountFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\nfunction Root({ companyId, className, children }: BankAccountFormProps) {\n useI18n('Company.BankAccount')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { mutateAsync: createBankAccount, isPending: isPendingCreate } =\n useBankAccountsCreateMutation()\n\n const { control, ...methods } = useForm<BankAccountFormInputs>({\n resolver: zodResolver(BankAccountFormSchema),\n defaultValues: { accountNumber: '', routingNumber: '' },\n })\n\n const onSubmit = async (data: BankAccountFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n const { companyBankAccount } = await createBankAccount({\n //Account type is always checking for company bank accounts\n request: { companyId, requestBody: { ...payload, accountType: 'Checking' } },\n })\n onEvent(componentEvents.COMPANY_BANK_ACCOUNT_CREATED, companyBankAccount)\n })\n }\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <BankAccountFormProvider value={{ isPending: isPendingCreate }}>\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </BankAccountFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\nBankAccountForm.Head = Head\nBankAccountForm.Form = Form\nBankAccountForm.Actions = Actions\n"],"names":["BankAccountForm","props","jsx","BaseComponent","Root","companyId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","createBankAccount","isPendingCreate","useBankAccountsCreateMutation","control","methods","useForm","zodResolver","BankAccountFormSchema","onSubmit","data","payload","companyBankAccount","componentEvents","FormProvider","HtmlForm","BankAccountFormProvider","Flex","jsxs","Fragment","Head","Form","Actions"],"mappings":";;;;;;;;;;;;;;AAoBO,SAASA,EAAgBC,GAAsD;AAElF,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AACA,SAASG,EAAK,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,KAAkC;AACtE,EAAAC,EAAQ,qBAAqB;AAC7B,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GAEzC,EAAE,aAAaC,GAAmB,WAAWC,EAAA,IACjDC,EAA8B,GAE1B,EAAE,SAA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Schema: z.ZodObject<{
|
|
3
|
+
routingNumber: z.ZodString;
|
|
4
|
+
accountNumber: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
routingNumber: string;
|
|
7
|
+
accountNumber: string;
|
|
8
|
+
}, {
|
|
9
|
+
routingNumber: string;
|
|
10
|
+
accountNumber: string;
|
|
11
|
+
}>;
|
|
12
|
+
export type BankAccountFormInputs = z.infer<typeof BankAccountFormSchema>;
|
|
7
13
|
export declare function Form(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as t, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { z as n } from "zod";
|
|
3
3
|
import { useTranslation as i } from "react-i18next";
|
|
4
4
|
import { accountNumberValidation as m, routingNumberValidation as u } from "../../../../helpers/validations.js";
|
|
5
5
|
import { Flex as a } from "../../../Common/Flex/Flex.js";
|
|
6
6
|
import { TextInputField as e } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
7
|
-
const N = n({
|
|
7
|
+
const N = n.object({
|
|
8
8
|
routingNumber: u,
|
|
9
9
|
accountNumber: m
|
|
10
10
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountForm/Form.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"Form.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountForm/Form.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { accountNumberValidation, routingNumberValidation } from '@/helpers/validations'\nimport { Flex, TextInputField } from '@/components/Common'\n\nexport const BankAccountFormSchema = z.object({\n routingNumber: routingNumberValidation,\n accountNumber: accountNumberValidation,\n})\n\nexport type BankAccountFormInputs = z.infer<typeof BankAccountFormSchema>\n\nexport function Form() {\n const { t } = useTranslation('Company.BankAccount')\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <TextInputField\n name=\"routingNumber\"\n isRequired\n label={t('form.routingNumberLabel')}\n description={t('form.routingNumberDescription')}\n errorMessage={t('validations.routingNumber')}\n />\n <TextInputField\n name=\"accountNumber\"\n label={t('form.accountNumberLabel')}\n isRequired\n errorMessage={t('validations.accountNumber')}\n />\n </Flex>\n )\n}\n"],"names":["BankAccountFormSchema","z","routingNumberValidation","accountNumberValidation","Form","t","useTranslation","jsxs","Flex","jsx","TextInputField"],"mappings":";;;;;;AAKa,MAAAA,IAAwBC,EAAE,OAAO;AAAA,EAC5C,eAAeC;AAAA,EACf,eAAeC;AACjB,CAAC;AAIM,SAASC,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB;AAElD,SACG,gBAAAC,EAAAC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,YAAU;AAAA,QACV,OAAOL,EAAE,yBAAyB;AAAA,QAClC,aAAaA,EAAE,+BAA+B;AAAA,QAC9C,cAAcA,EAAE,2BAA2B;AAAA,MAAA;AAAA,IAC7C;AAAA,IACA,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOL,EAAE,yBAAyB;AAAA,QAClC,YAAU;AAAA,QACV,cAAcA,EAAE,2BAA2B;AAAA,MAAA;AAAA,IAAA;AAAA,EAC7C,GACF;AAEJ;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
1
|
+
import { jsx as o, jsxs as v, Fragment as C } from "react/jsx-runtime";
|
|
2
2
|
import { useForm as b, FormProvider as V } from "react-hook-form";
|
|
3
|
-
import {
|
|
3
|
+
import { zodResolver as x } from "@hookform/resolvers/zod";
|
|
4
4
|
import { useBankAccountsVerifyMutation as E } from "@gusto/embedded-api/react-query/bankAccountsVerify";
|
|
5
5
|
import { Head as c } from "./Head.js";
|
|
6
6
|
import { BankAccountVerifyProvider as S } from "./context.js";
|
|
@@ -15,29 +15,29 @@ import { componentEvents as m } from "../../../../shared/constants.js";
|
|
|
15
15
|
function r(n) {
|
|
16
16
|
return /* @__PURE__ */ o(g, { ...n, children: /* @__PURE__ */ o(_, { ...n, children: n.children }) });
|
|
17
17
|
}
|
|
18
|
-
function _({ companyId: n, bankAccountId: u, className:
|
|
18
|
+
function _({ companyId: n, bankAccountId: u, className: d, children: t }) {
|
|
19
19
|
I("Company.BankAccount");
|
|
20
|
-
const { onEvent: e, baseSubmitHandler:
|
|
20
|
+
const { onEvent: e, baseSubmitHandler: f } = H(), { mutateAsync: l, isPending: p } = E(), { control: A, ...i } = b({
|
|
21
21
|
resolver: x(N),
|
|
22
22
|
defaultValues: { deposit1: 0, deposit2: 0 }
|
|
23
23
|
}), h = async (B) => {
|
|
24
|
-
await
|
|
25
|
-
const { companyBankAccount:
|
|
26
|
-
request: { companyId: n, bankAccountUuid: u, requestBody:
|
|
24
|
+
await f(B, async (F) => {
|
|
25
|
+
const { companyBankAccount: k } = await l({
|
|
26
|
+
request: { companyId: n, bankAccountUuid: u, requestBody: F }
|
|
27
27
|
});
|
|
28
|
-
e(m.COMPANY_BANK_ACCOUNT_VERIFIED,
|
|
28
|
+
e(m.COMPANY_BANK_ACCOUNT_VERIFIED, k);
|
|
29
29
|
});
|
|
30
30
|
}, y = () => {
|
|
31
31
|
e(m.CANCEL);
|
|
32
32
|
};
|
|
33
|
-
return /* @__PURE__ */ o("section", { className:
|
|
33
|
+
return /* @__PURE__ */ o("section", { className: d, children: /* @__PURE__ */ o(V, { ...i, control: A, children: /* @__PURE__ */ o(P, { onSubmit: i.handleSubmit(h), children: /* @__PURE__ */ o(
|
|
34
34
|
S,
|
|
35
35
|
{
|
|
36
36
|
value: {
|
|
37
37
|
isPending: p,
|
|
38
38
|
handleCancel: y
|
|
39
39
|
},
|
|
40
|
-
children: /* @__PURE__ */ o(R, { flexDirection: "column", gap: 32, children: t || /* @__PURE__ */
|
|
40
|
+
children: /* @__PURE__ */ o(R, { flexDirection: "column", gap: 32, children: t || /* @__PURE__ */ v(C, { children: [
|
|
41
41
|
/* @__PURE__ */ o(c, {}),
|
|
42
42
|
/* @__PURE__ */ o(a, {}),
|
|
43
43
|
/* @__PURE__ */ o(s, {})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BankAccountVerify.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport {
|
|
1
|
+
{"version":3,"file":"BankAccountVerify.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useBankAccountsVerifyMutation } from '@gusto/embedded-api/react-query/bankAccountsVerify'\nimport { Head } from './Head'\nimport { BankAccountVerifyProvider } from './context'\nimport type { BankAccountVerifyInputs } from './Form'\nimport { BankAccountVerifySchema, Form } from './Form'\nimport { Actions } from './Actions'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n/I18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { componentEvents } from '@/shared/constants'\n\ninterface BankAccountVerifyProps extends CommonComponentInterface {\n companyId: string\n bankAccountId: string\n}\n\nexport function BankAccountVerify(props: BankAccountVerifyProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\nfunction Root({ companyId, bankAccountId, className, children }: BankAccountVerifyProps) {\n useI18n('Company.BankAccount')\n const { onEvent, baseSubmitHandler } = useBase()\n const { mutateAsync: verifyBankAccount, isPending } = useBankAccountsVerifyMutation()\n\n const { control, ...methods } = useForm<BankAccountVerifyInputs>({\n resolver: zodResolver(BankAccountVerifySchema),\n defaultValues: { deposit1: 0, deposit2: 0 },\n })\n\n const onSubmit = async (data: BankAccountVerifyInputs) => {\n await baseSubmitHandler(data, async payload => {\n const { companyBankAccount } = await verifyBankAccount({\n request: { companyId, bankAccountUuid: bankAccountId, requestBody: payload },\n })\n onEvent(componentEvents.COMPANY_BANK_ACCOUNT_VERIFIED, companyBankAccount)\n })\n }\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <BankAccountVerifyProvider\n value={{\n isPending,\n handleCancel,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </BankAccountVerifyProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\nBankAccountVerify.Head = Head\nBankAccountVerify.Form = Form\nBankAccountVerify.Actions = Actions\n"],"names":["BankAccountVerify","props","jsx","BaseComponent","Root","companyId","bankAccountId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","verifyBankAccount","isPending","useBankAccountsVerifyMutation","control","methods","useForm","zodResolver","BankAccountVerifySchema","onSubmit","data","payload","companyBankAccount","componentEvents","handleCancel","FormProvider","HtmlForm","BankAccountVerifyProvider","Flex","jsxs","Fragment","Head","Form","Actions"],"mappings":";;;;;;;;;;;;;;AAqBO,SAASA,EAAkBC,GAAwD;AAEtF,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AACA,SAASG,EAAK,EAAE,WAAAC,GAAW,eAAAC,GAAe,WAAAC,GAAW,UAAAC,KAAoC;AACvF,EAAAC,EAAQ,qBAAqB;AAC7B,QAAM,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AAkB,OAAOkC;AACzBlC,EAAkB,UAAUmC;"}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const BankAccountVerifySchema:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
},
|
|
6
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const BankAccountVerifySchema: z.ZodObject<{
|
|
3
|
+
deposit1: z.ZodNumber;
|
|
4
|
+
deposit2: z.ZodNumber;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
deposit1: number;
|
|
7
|
+
deposit2: number;
|
|
8
|
+
}, {
|
|
9
|
+
deposit1: number;
|
|
10
|
+
deposit2: number;
|
|
11
|
+
}>;
|
|
12
|
+
export type BankAccountVerifyInputs = z.infer<typeof BankAccountVerifySchema>;
|
|
7
13
|
export declare function Form(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { Flex as
|
|
5
|
-
import { NumberInputField as
|
|
6
|
-
const
|
|
7
|
-
deposit1:
|
|
8
|
-
deposit2:
|
|
1
|
+
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { z as o } from "zod";
|
|
3
|
+
import { useTranslation as n } from "react-i18next";
|
|
4
|
+
import { Flex as s } from "../../../Common/Flex/Flex.js";
|
|
5
|
+
import { NumberInputField as i } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
6
|
+
const u = o.object({
|
|
7
|
+
deposit1: o.number().min(0),
|
|
8
|
+
deposit2: o.number().min(0)
|
|
9
9
|
});
|
|
10
|
-
function
|
|
11
|
-
const { t: e } =
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
-
|
|
10
|
+
function l() {
|
|
11
|
+
const { t: e } = n("Company.BankAccount");
|
|
12
|
+
return /* @__PURE__ */ t(s, { flexDirection: "column", gap: 20, children: [
|
|
13
|
+
/* @__PURE__ */ r(
|
|
14
|
+
i,
|
|
15
15
|
{
|
|
16
16
|
name: "deposit1",
|
|
17
17
|
format: "currency",
|
|
@@ -21,8 +21,8 @@ function x() {
|
|
|
21
21
|
errorMessage: e("validations.deposit1")
|
|
22
22
|
}
|
|
23
23
|
),
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
|
|
24
|
+
/* @__PURE__ */ r(
|
|
25
|
+
i,
|
|
26
26
|
{
|
|
27
27
|
name: "deposit2",
|
|
28
28
|
format: "currency",
|
|
@@ -35,7 +35,7 @@ function x() {
|
|
|
35
35
|
] });
|
|
36
36
|
}
|
|
37
37
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
u as BankAccountVerifySchema,
|
|
39
|
+
l as Form
|
|
40
40
|
};
|
|
41
41
|
//# sourceMappingURL=Form.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountVerify/Form.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"Form.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountVerify/Form.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { Flex, NumberInputField } from '@/components/Common'\n\nexport const BankAccountVerifySchema = z.object({\n deposit1: z.number().min(0),\n deposit2: z.number().min(0),\n})\n\nexport type BankAccountVerifyInputs = z.infer<typeof BankAccountVerifySchema>\n\nexport function Form() {\n const { t } = useTranslation('Company.BankAccount')\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <NumberInputField\n name=\"deposit1\"\n format=\"currency\"\n isRequired\n label={t('deposit1Label')}\n description={t('deposit1Description')}\n errorMessage={t('validations.deposit1')}\n />\n <NumberInputField\n name=\"deposit2\"\n format=\"currency\"\n label={t('deposit2Label')}\n description={t('deposit2Description')}\n isRequired\n errorMessage={t('validations.deposit2')}\n />\n </Flex>\n )\n}\n"],"names":["BankAccountVerifySchema","z","Form","t","useTranslation","jsxs","Flex","jsx","NumberInputField"],"mappings":";;;;;AAIa,MAAAA,IAA0BC,EAAE,OAAO;AAAA,EAC9C,UAAUA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC1B,UAAUA,EAAE,OAAO,EAAE,IAAI,CAAC;AAC5B,CAAC;AAIM,SAASC,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB;AAElD,SACG,gBAAAC,EAAAC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,QAAO;AAAA,QACP,YAAU;AAAA,QACV,OAAOL,EAAE,eAAe;AAAA,QACxB,aAAaA,EAAE,qBAAqB;AAAA,QACpC,cAAcA,EAAE,sBAAsB;AAAA,MAAA;AAAA,IACxC;AAAA,IACA,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,QAAO;AAAA,QACP,OAAOL,EAAE,eAAe;AAAA,QACxB,aAAaA,EAAE,qBAAqB;AAAA,QACpC,YAAU;AAAA,QACV,cAAcA,EAAE,sBAAsB;AAAA,MAAA;AAAA,IAAA;AAAA,EACxC,GACF;AAEJ;"}
|
|
@@ -2,7 +2,7 @@ import { jsx as o, jsxs as h, Fragment as v } from "react/jsx-runtime";
|
|
|
2
2
|
import { useCompanyFormsGetSuspense as N, invalidateAllCompanyFormsGet as _ } from "@gusto/embedded-api/react-query/companyFormsGet";
|
|
3
3
|
import { useCompanyFormsSignMutation as B } from "@gusto/embedded-api/react-query/companyFormsSign";
|
|
4
4
|
import { useCompanyFormsGetPdfSuspense as G, invalidateAllCompanyFormsGetPdf as M } from "@gusto/embedded-api/react-query/companyFormsGetPdf";
|
|
5
|
-
import { useQueryClient as O } from "@
|
|
5
|
+
import { useQueryClient as O } from "@tanstack/react-query";
|
|
6
6
|
import { Head as c } from "./Head.js";
|
|
7
7
|
import { Preview as p } from "./Preview.js";
|
|
8
8
|
import { Form as f } from "./Form.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignatureForm.js","sources":["../../../../../src/components/Company/DocumentSignerFlow/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport {\n useCompanyFormsGetSuspense,\n invalidateAllCompanyFormsGet,\n} from '@gusto/embedded-api/react-query/companyFormsGet'\nimport { useCompanyFormsSignMutation } from '@gusto/embedded-api/react-query/companyFormsSign'\nimport {\n useCompanyFormsGetPdfSuspense,\n invalidateAllCompanyFormsGetPdf,\n} from '@gusto/embedded-api/react-query/companyFormsGetPdf'\nimport { useQueryClient } from '@
|
|
1
|
+
{"version":3,"file":"SignatureForm.js","sources":["../../../../../src/components/Company/DocumentSignerFlow/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport {\n useCompanyFormsGetSuspense,\n invalidateAllCompanyFormsGet,\n} from '@gusto/embedded-api/react-query/companyFormsGet'\nimport { useCompanyFormsSignMutation } from '@gusto/embedded-api/react-query/companyFormsSign'\nimport {\n useCompanyFormsGetPdfSuspense,\n invalidateAllCompanyFormsGetPdf,\n} from '@gusto/embedded-api/react-query/companyFormsGetPdf'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { Head } from './Head'\nimport { Preview } from './Preview'\nimport { Form } from './Form'\nimport { Actions } from './Actions'\nimport { SignatureFormProvider } from './useSignatureForm'\nimport { useI18n } from '@/i18n'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport {\n SignatureForm as SharedSignatureForm,\n type SignatureFormInputs,\n} from '@/components/Common/SignatureForm'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\n\ninterface SignatureFormProps {\n formId: string\n companyId: string\n children?: ReactNode\n className?: string\n}\n\nexport function SignatureForm({\n formId,\n companyId,\n children,\n className,\n ...props\n}: SignatureFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root formId={formId} companyId={companyId} className={className}>\n {children}\n </Root>\n </BaseComponent>\n )\n}\n\nexport function Root({ formId, companyId, children }: SignatureFormProps) {\n useI18n('Company.SignatureForm')\n const { onEvent, baseSubmitHandler } = useBase()\n const queryClient = useQueryClient()\n\n const {\n data: { form: formNullable },\n } = useCompanyFormsGetSuspense({\n formId,\n })\n const form = formNullable!\n\n const { isPending, mutateAsync: signForm } = useCompanyFormsSignMutation()\n\n const {\n data: { formPdf },\n } = useCompanyFormsGetPdfSuspense({\n formId,\n })\n const pdfUrl = formPdf!.documentUrl!\n\n const handleSubmit = async (data: SignatureFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n const signFormResponse = await signForm({\n request: {\n formId,\n requestBody: {\n signatureText: payload.signature,\n agree: payload.confirmSignature,\n },\n },\n })\n await invalidateAllCompanyFormsGet(queryClient)\n await invalidateAllCompanyFormsGetPdf(queryClient)\n\n onEvent(companyEvents.COMPANY_SIGN_FORM, signFormResponse.form)\n\n onEvent(companyEvents.COMPANY_SIGN_FORM_DONE)\n })\n }\n\n const handleBack = () => {\n onEvent(companyEvents.COMPANY_SIGN_FORM_BACK)\n }\n\n return (\n <SignatureFormProvider\n value={{\n form,\n pdfUrl,\n isPending,\n onBack: handleBack,\n }}\n >\n <SharedSignatureForm onSubmit={handleSubmit}>\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Preview />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </SharedSignatureForm>\n </SignatureFormProvider>\n )\n}\n\nSignatureForm.Head = Head\nSignatureForm.Preview = Preview\nSignatureForm.Form = Form\nSignatureForm.Actions = Actions\n"],"names":["SignatureForm","formId","companyId","children","className","props","jsx","BaseComponent","Root","useI18n","onEvent","baseSubmitHandler","useBase","queryClient","useQueryClient","formNullable","useCompanyFormsGetSuspense","form","isPending","signForm","useCompanyFormsSignMutation","formPdf","useCompanyFormsGetPdfSuspense","pdfUrl","SignatureFormProvider","companyEvents","SharedSignatureForm","data","payload","signFormResponse","invalidateAllCompanyFormsGet","invalidateAllCompanyFormsGetPdf","Flex","jsxs","Fragment","Head","Preview","Form","Actions"],"mappings":";;;;;;;;;;;;;;;;AAkCO,SAASA,EAAc;AAAA,EAC5B,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACL,GAAgD;AAE5C,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAK,QAAAP,GAAgB,WAAAC,GAAsB,WAAAE,GACzC,UAAAD,EAAA,CACH,EACF,CAAA;AAEJ;AAEO,SAASK,EAAK,EAAE,QAAAP,GAAQ,WAAAC,GAAW,UAAAC,KAAgC;AACxE,EAAAM,EAAQ,uBAAuB;AAC/B,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GACzCC,IAAcC,EAAe,GAE7B;AAAA,IACJ,MAAM,EAAE,MAAMC,EAAa;AAAA,MACzBC,EAA2B;AAAA,IAC7B,QAAAf;AAAA,EAAA,CACD,GACKgB,IAAOF,GAEP,EAAE,WAAAG,GAAW,aAAaC,EAAA,IAAaC,EAA4B,GAEnE;AAAA,IACJ,MAAM,EAAE,SAAAC,EAAQ;AAAA,MACdC,EAA8B;AAAA,IAChC,QAAArB;AAAA,EAAA,CACD,GACKsB,IAASF,EAAS;AA2BtB,SAAA,gBAAAf;AAAA,IAACkB;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,MAAAP;AAAA,QACA,QAAAM;AAAA,QACA,WAAAL;AAAA,QACA,QAVa,MAAM;AACvB,UAAAR,EAAQe,EAAc,sBAAsB;AAAA,QAC9C;AAAA,MASI;AAAA,MAEA,UAAC,gBAAAnB,EAAAoB,GAAA,EAAoB,UAjCJ,OAAOC,MAA8B;AAClD,cAAAhB,EAAkBgB,GAAM,OAAMC,MAAW;AACvC,gBAAAC,IAAmB,MAAMV,EAAS;AAAA,YACtC,SAAS;AAAA,cACP,QAAAlB;AAAA,cACA,aAAa;AAAA,gBACX,eAAe2B,EAAQ;AAAA,gBACvB,OAAOA,EAAQ;AAAA,cAAA;AAAA,YACjB;AAAA,UACF,CACD;AACD,gBAAME,EAA6BjB,CAAW,GAC9C,MAAMkB,EAAgClB,CAAW,GAEzCH,EAAAe,EAAc,mBAAmBI,EAAiB,IAAI,GAE9DnB,EAAQe,EAAc,sBAAsB;AAAA,QAAA,CAC7C;AAAA,MACH,GAgBM,UAAC,gBAAAnB,EAAA0B,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UACC7B,KAGE,gBAAA8B,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAA5B,EAAC6B,GAAK,EAAA;AAAA,0BACLC,GAAQ,EAAA;AAAA,0BACRC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,EACX,CAAA,EAEJ,CAAA,EACF,CAAA;AAAA,IAAA;AAAA,EACF;AAEJ;AAEAtC,EAAc,OAAOmC;AACrBnC,EAAc,UAAUoC;AACxBpC,EAAc,OAAOqC;AACrBrC,EAAc,UAAUsC;"}
|
|
@@ -2,12 +2,12 @@ import { jsx as e, jsxs as T, Fragment as g } from "react/jsx-runtime";
|
|
|
2
2
|
import { useFederalTaxDetailsUpdateMutation as y } from "@gusto/embedded-api/react-query/federalTaxDetailsUpdate";
|
|
3
3
|
import { useFederalTaxDetailsGetSuspense as h } from "@gusto/embedded-api/react-query/federalTaxDetailsGet";
|
|
4
4
|
import { useForm as D, FormProvider as E } from "react-hook-form";
|
|
5
|
-
import {
|
|
5
|
+
import { zodResolver as P } from "@hookform/resolvers/zod";
|
|
6
6
|
import { FederalTaxFormSchema as v, FederalTaxesProvider as A } from "./useFederalTaxes.js";
|
|
7
7
|
import { Form as N } from "../../Common/Form/Form.js";
|
|
8
8
|
import { Form as S } from "./Form.js";
|
|
9
|
-
import { Actions as
|
|
10
|
-
import { Head as
|
|
9
|
+
import { Actions as _ } from "./Actions.js";
|
|
10
|
+
import { Head as b } from "./Head.js";
|
|
11
11
|
import { useI18n as R } from "../../../i18n/I18n.js";
|
|
12
12
|
import { BaseComponent as C } from "../../Base/Base.js";
|
|
13
13
|
import { useBase as M } from "../../Base/useBase.js";
|
|
@@ -54,9 +54,9 @@ function O({ companyId: a, children: t, className: s, defaultValues: i }) {
|
|
|
54
54
|
federalTaxDetails: r
|
|
55
55
|
},
|
|
56
56
|
children: /* @__PURE__ */ e(E, { ...n, children: /* @__PURE__ */ e(N, { onSubmit: n.handleSubmit(p), children: /* @__PURE__ */ e(B, { flexDirection: "column", gap: 32, children: t || /* @__PURE__ */ T(g, { children: [
|
|
57
|
-
/* @__PURE__ */ e(
|
|
57
|
+
/* @__PURE__ */ e(b, {}),
|
|
58
58
|
/* @__PURE__ */ e(S, {}),
|
|
59
|
-
/* @__PURE__ */ e(
|
|
59
|
+
/* @__PURE__ */ e(_, {})
|
|
60
60
|
] }) }) }) })
|
|
61
61
|
}
|
|
62
62
|
) });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/FederalTaxes.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useFederalTaxDetailsUpdateMutation } from '@gusto/embedded-api/react-query/federalTaxDetailsUpdate'\nimport { useFederalTaxDetailsGetSuspense } from '@gusto/embedded-api/react-query/federalTaxDetailsGet'\nimport type {\n FilingForm,\n TaxPayerType,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport {
|
|
1
|
+
{"version":3,"file":"FederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/FederalTaxes.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useFederalTaxDetailsUpdateMutation } from '@gusto/embedded-api/react-query/federalTaxDetailsUpdate'\nimport { useFederalTaxDetailsGetSuspense } from '@gusto/embedded-api/react-query/federalTaxDetailsGet'\nimport type {\n FilingForm,\n TaxPayerType,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n FederalTaxesProvider,\n type FederalTaxFormInputs,\n FederalTaxFormSchema,\n type FederalTaxesDefaultValues,\n} from './useFederalTaxes'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { Form } from '@/components/Company/FederalTaxes/Form'\nimport { Actions } from '@/components/Company/FederalTaxes/Actions'\nimport { Head } from '@/components/Company/FederalTaxes/Head'\nimport { useI18n } from '@/i18n'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\n\ninterface FederalTaxesProps extends CommonComponentInterface {\n companyId: string\n children?: ReactNode\n className?: string\n defaultValues?: FederalTaxesDefaultValues\n}\n\nexport function FederalTaxes(props: FederalTaxesProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, children, className, defaultValues }: FederalTaxesProps) {\n useI18n('Company.FederalTaxes')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useFederalTaxDetailsGetSuspense({ companyId })\n const federalTaxDetails = data.federalTaxDetails!\n\n const { mutateAsync: updateFederalTaxDetails, isPending } = useFederalTaxDetailsUpdateMutation()\n\n const formMethods = useForm<FederalTaxFormInputs>({\n resolver: zodResolver(FederalTaxFormSchema),\n defaultValues: {\n federalEin: federalTaxDetails.hasEin ? undefined : '',\n taxPayerType: federalTaxDetails.taxPayerType\n ? (federalTaxDetails.taxPayerType as TaxPayerType)\n : defaultValues?.taxPayerType,\n filingForm: federalTaxDetails.filingForm\n ? (federalTaxDetails.filingForm as FilingForm)\n : defaultValues?.filingForm,\n legalName: federalTaxDetails.legalName ?? defaultValues?.legalName,\n },\n })\n\n const handleSubmit = async (data: FederalTaxFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n const updateFederalTaxDetailsResponse = await updateFederalTaxDetails({\n request: {\n companyId: companyId,\n requestBody: {\n ein: payload.federalEin,\n taxPayerType: payload.taxPayerType as TaxPayerType | undefined,\n filingForm: payload.filingForm as FilingForm | undefined,\n legalName: payload.legalName,\n version: federalTaxDetails.version as string,\n },\n },\n })\n\n onEvent(\n companyEvents.COMPANY_FEDERAL_TAXES_UPDATED,\n updateFederalTaxDetailsResponse.federalTaxDetails,\n )\n onEvent(companyEvents.COMPANY_FEDERAL_TAXES_DONE)\n })\n }\n\n return (\n <section className={className}>\n <FederalTaxesProvider\n value={{\n isPending,\n federalTaxDetails,\n }}\n >\n <FormProvider {...formMethods}>\n <HtmlForm onSubmit={formMethods.handleSubmit(handleSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </HtmlForm>\n </FormProvider>\n </FederalTaxesProvider>\n </section>\n )\n}\n"],"names":["FederalTaxes","props","jsx","BaseComponent","Root","companyId","children","className","defaultValues","useI18n","onEvent","baseSubmitHandler","useBase","data","useFederalTaxDetailsGetSuspense","federalTaxDetails","updateFederalTaxDetails","isPending","useFederalTaxDetailsUpdateMutation","formMethods","useForm","zodResolver","FederalTaxFormSchema","handleSubmit","payload","updateFederalTaxDetailsResponse","companyEvents","FederalTaxesProvider","FormProvider","HtmlForm","Flex","jsxs","Fragment","Head","Form","Actions"],"mappings":";;;;;;;;;;;;;;;AAiCO,SAASA,EAAaC,GAAmD;AAE5E,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,G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,QACA,mBAAAF;AAAA,MACF;AAAA,MAEA,4BAACa,GAAc,EAAA,GAAGT,GAChB,UAAC,gBAAAjB,EAAA2B,GAAA,EAAS,UAAUV,EAAY,aAAaI,CAAY,GACvD,UAAA,gBAAArB,EAAC4B,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAxB,KAIG,gBAAAyB,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAA9B,EAAC+B,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,GACX,EAAA,CAEJ,GACF,EACF,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -1,13 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
import { FederalTaxDetails } from '@gusto/embedded-api/models/components/federaltaxdetails';
|
|
2
3
|
import { RequireAtLeastOne } from '../../../types/Helpers';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
export declare const FederalTaxFormSchema: z.ZodObject<{
|
|
5
|
+
federalEin: z.ZodOptional<z.ZodString>;
|
|
6
|
+
taxPayerType: z.ZodOptional<z.ZodEnum<[string, ...string[]]>>;
|
|
7
|
+
filingForm: z.ZodOptional<z.ZodEnum<[string, ...string[]]>>;
|
|
8
|
+
legalName: z.ZodString;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
legalName: string;
|
|
11
|
+
taxPayerType?: string | undefined;
|
|
12
|
+
filingForm?: string | undefined;
|
|
13
|
+
federalEin?: string | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
legalName: string;
|
|
16
|
+
taxPayerType?: string | undefined;
|
|
17
|
+
filingForm?: string | undefined;
|
|
18
|
+
federalEin?: string | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
export type FederalTaxFormInputs = z.input<typeof FederalTaxFormSchema>;
|
|
11
21
|
export type FederalTaxesDefaultValues = RequireAtLeastOne<{
|
|
12
22
|
taxPayerType?: FederalTaxFormInputs['taxPayerType'];
|
|
13
23
|
filingForm?: FederalTaxFormInputs['filingForm'];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { FilingForm as
|
|
1
|
+
import { z as o } from "zod";
|
|
2
|
+
import { FilingForm as e, TaxPayerType as r } from "@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "react-error-boundary";
|
|
@@ -10,22 +10,18 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
|
10
10
|
import "../../Base/useBase.js";
|
|
11
11
|
import "dompurify";
|
|
12
12
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
-
import { createCompoundContext as
|
|
14
|
-
const
|
|
15
|
-
federalEin: o.
|
|
16
|
-
taxPayerType: o.optional(
|
|
17
|
-
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
o.union(Object.values(r).map((e) => o.literal(e)))
|
|
21
|
-
),
|
|
22
|
-
legalName: o.pipe(o.string(), o.nonEmpty())
|
|
23
|
-
}), [f, g] = i(
|
|
13
|
+
import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
|
|
14
|
+
const f = o.object({
|
|
15
|
+
federalEin: o.string().optional(),
|
|
16
|
+
taxPayerType: o.enum(Object.values(r)).optional(),
|
|
17
|
+
filingForm: o.enum(Object.values(e)).optional(),
|
|
18
|
+
legalName: o.string().min(1)
|
|
19
|
+
}), [g, y] = t(
|
|
24
20
|
"CompanyFederalTaxesContext"
|
|
25
21
|
);
|
|
26
22
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
f as FederalTaxFormSchema,
|
|
24
|
+
y as FederalTaxesProvider,
|
|
25
|
+
g as useFederalTaxes
|
|
30
26
|
};
|
|
31
27
|
//# sourceMappingURL=useFederalTaxes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/useFederalTaxes.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"useFederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/useFederalTaxes.ts"],"sourcesContent":["import { z } from 'zod'\nimport type { FederalTaxDetails } from '@gusto/embedded-api/models/components/federaltaxdetails'\nimport {\n FilingForm,\n TaxPayerType,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport const FederalTaxFormSchema = z.object({\n federalEin: z.string().optional(),\n taxPayerType: z.enum(Object.values(TaxPayerType) as [string, ...string[]]).optional(),\n filingForm: z.enum(Object.values(FilingForm) as [string, ...string[]]).optional(),\n legalName: z.string().min(1),\n})\n\nexport type FederalTaxFormInputs = z.input<typeof FederalTaxFormSchema>\n\nexport type FederalTaxesDefaultValues = RequireAtLeastOne<{\n taxPayerType?: FederalTaxFormInputs['taxPayerType']\n filingForm?: FederalTaxFormInputs['filingForm']\n legalName?: FederalTaxFormInputs['legalName']\n}>\n\ntype FederalTaxesContextType = {\n isPending: boolean\n federalTaxDetails?: FederalTaxDetails\n}\n\nconst [useFederalTaxes, FederalTaxesProvider] = createCompoundContext<FederalTaxesContextType>(\n 'CompanyFederalTaxesContext',\n)\n\nexport { useFederalTaxes, FederalTaxesProvider }\n"],"names":["FederalTaxFormSchema","z","TaxPayerType","FilingForm","useFederalTaxes","FederalTaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AASa,MAAAA,IAAuBC,EAAE,OAAO;AAAA,EAC3C,YAAYA,EAAE,OAAO,EAAE,SAAS;AAAA,EAChC,cAAcA,EAAE,KAAK,OAAO,OAAOC,CAAY,CAA0B,EAAE,SAAS;AAAA,EACpF,YAAYD,EAAE,KAAK,OAAO,OAAOE,CAAU,CAA0B,EAAE,SAAS;AAAA,EAChF,WAAWF,EAAE,OAAO,EAAE,IAAI,CAAC;AAC7B,CAAC,GAeK,CAACG,GAAiBC,CAAoB,IAAIC;AAAA,EAC9C;AACF;"}
|
|
@@ -2,7 +2,7 @@ import { jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { useCallback as y } from "react";
|
|
3
3
|
import { useIndustrySelectionGetSuspense as C, invalidateAllIndustrySelectionGet as S } from "@gusto/embedded-api/react-query/industrySelectionGet";
|
|
4
4
|
import { useIndustrySelectionUpdateMutation as I } from "@gusto/embedded-api/react-query/industrySelectionUpdate";
|
|
5
|
-
import { useQueryClient as E } from "@
|
|
5
|
+
import { useQueryClient as E } from "@tanstack/react-query";
|
|
6
6
|
import { Actions as A } from "./Actions.js";
|
|
7
7
|
import { Head as v } from "./Head.js";
|
|
8
8
|
import { Edit as b } from "./Edit.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Industry.js","sources":["../../../../src/components/Company/Industry/Industry.tsx"],"sourcesContent":["import { useCallback, type HTMLAttributes } from 'react'\nimport {\n useIndustrySelectionGetSuspense,\n invalidateAllIndustrySelectionGet,\n} from '@gusto/embedded-api/react-query/industrySelectionGet'\nimport { useIndustrySelectionUpdateMutation } from '@gusto/embedded-api/react-query/industrySelectionUpdate'\nimport { useQueryClient } from '@
|
|
1
|
+
{"version":3,"file":"Industry.js","sources":["../../../../src/components/Company/Industry/Industry.tsx"],"sourcesContent":["import { useCallback, type HTMLAttributes } from 'react'\nimport {\n useIndustrySelectionGetSuspense,\n invalidateAllIndustrySelectionGet,\n} from '@gusto/embedded-api/react-query/industrySelectionGet'\nimport { useIndustrySelectionUpdateMutation } from '@gusto/embedded-api/react-query/industrySelectionUpdate'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { Actions } from './Actions'\nimport { Head } from './Head'\nimport type { IndustryFormFields } from './Edit'\nimport { Edit } from './Edit'\nimport { IndustryApiStateProvider } from './Context'\nimport { IndustrySelect } from './IndustrySelect'\nimport { componentEvents } from '@/shared/constants'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { useI18n } from '@/i18n'\n\nexport type IndustryProps<T> = Pick<BaseComponentInterface, 'onEvent'> &\n Partial<Pick<HTMLAttributes<T>, 'children' | 'className'>> & {\n companyId: string\n }\n\nfunction Root<T>({ children, className, companyId }: IndustryProps<T>) {\n const { baseSubmitHandler, onEvent } = useBase()\n const queryClient = useQueryClient()\n\n const {\n data: { industry },\n } = useIndustrySelectionGetSuspense({ companyId })\n\n const { isPending, mutateAsync: mutateIndustry } = useIndustrySelectionUpdateMutation()\n\n const onValid = useCallback(\n async (data: IndustryFormFields) => {\n await baseSubmitHandler(data, async ({ naics_code }) => {\n const response = await mutateIndustry({\n request: { companyId, requestBody: { naicsCode: naics_code } },\n })\n await invalidateAllIndustrySelectionGet(queryClient)\n onEvent(componentEvents.COMPANY_INDUSTRY_SELECTED, response.industry)\n })\n },\n [baseSubmitHandler, companyId, mutateIndustry, onEvent, queryClient],\n )\n\n return (\n <section className={className}>\n <IndustryApiStateProvider value={{ isPending }}>\n <IndustrySelect naics_code={industry?.naicsCode} onValid={onValid}>\n {children}\n </IndustrySelect>\n </IndustryApiStateProvider>\n </section>\n )\n}\n\nexport function Industry<T>(props: IndustryProps<T>) {\n useI18n('Company.Industry')\n\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nIndustry.Actions = Actions\nIndustry.Edit = Edit\nIndustry.Head = Head\n"],"names":["Root","children","className","companyId","baseSubmitHandler","onEvent","useBase","queryClient","useQueryClient","industry","useIndustrySelectionGetSuspense","isPending","mutateIndustry","useIndustrySelectionUpdateMutation","onValid","useCallback","data","naics_code","response","invalidateAllIndustrySelectionGet","componentEvents","jsx","IndustryApiStateProvider","IndustrySelect","Industry","props","useI18n","BaseComponent","Actions","Edit","Head"],"mappings":";;;;;;;;;;;;;;AAsBA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
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const LocationFormSchema: z.ZodObject<{
|
|
3
|
+
phoneNumber: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
4
|
+
street1: z.ZodString;
|
|
5
|
+
street2: z.ZodOptional<z.ZodString>;
|
|
6
|
+
city: z.ZodString;
|
|
7
|
+
state: z.ZodString;
|
|
8
|
+
zip: z.ZodEffects<z.ZodString, string, string>;
|
|
9
|
+
addressType: z.ZodOptional<z.ZodArray<z.ZodEnum<["mailingAddress", "filingAddress"]>, "many">>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
street1: string;
|
|
12
|
+
city: string;
|
|
13
|
+
state: string;
|
|
14
|
+
zip: string;
|
|
15
|
+
phoneNumber: string;
|
|
16
|
+
street2?: string | undefined;
|
|
17
|
+
addressType?: ("filingAddress" | "mailingAddress")[] | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
street1: string;
|
|
20
|
+
city: string;
|
|
21
|
+
state: string;
|
|
22
|
+
zip: string;
|
|
23
|
+
phoneNumber: string;
|
|
24
|
+
street2?: string | undefined;
|
|
25
|
+
addressType?: ("filingAddress" | "mailingAddress")[] | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
export type LocationFormInputs = z.infer<typeof LocationFormSchema>;
|
|
12
28
|
export declare function Form(): import("react/jsx-runtime").JSX.Element;
|