@gusto/embedded-react-sdk 0.11.3-rc.1 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +181 -0
- package/dist/components/Common/SignatureForm/SignatureForm.js +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +7 -6
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +2 -3
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +2 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +3 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +14 -13
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +2 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +6 -5
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +11 -10
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +6 -6
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +8 -9
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +8 -9
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -8
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -5
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +2 -3
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +9 -8
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +7 -6
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +5 -6
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +13 -12
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +3 -4
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +5 -6
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +2 -3
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +6 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +4 -5
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +6 -7
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +6 -5
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +11 -10
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +6 -7
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +2 -3
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +7 -6
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +10 -11
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +6 -7
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +3 -2
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +3 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +34 -33
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +9 -10
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +17 -16
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +6 -7
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +11 -12
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +5 -6
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +2 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +2 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +2 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +5 -4
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +4 -3
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +5 -6
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.d.ts +16 -0
- package/dist/components/Contractor/ContractorList/index.js +125 -0
- package/dist/components/Contractor/ContractorList/index.js.map +1 -0
- package/dist/components/Contractor/{List → ContractorList}/useContractorList.d.ts +1 -3
- package/dist/components/Contractor/{List → ContractorList}/useContractorList.js +9 -10
- package/dist/components/Contractor/ContractorList/useContractorList.js.map +1 -0
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.d.ts +2 -0
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js +25 -0
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js.map +1 -0
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.d.ts +26 -0
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js +71 -0
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js.map +1 -0
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.d.ts +9 -0
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js +119 -0
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +5 -6
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfile.js +31 -17
- package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.d.ts +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +40 -44
- package/dist/components/Contractor/Profile/ContractorProfileForm.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.d.ts +13 -12
- package/dist/components/Contractor/Profile/useContractorProfile.js +144 -145
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.d.ts +7 -0
- package/dist/components/Contractor/Submit/Submit.js +77 -0
- package/dist/components/Contractor/Submit/Submit.js.map +1 -0
- package/dist/components/Contractor/Submit/SubmitDone.js +11 -11
- package/dist/components/Contractor/Submit/SubmitDone.js.map +1 -1
- package/dist/components/Contractor/index.d.ts +3 -2
- package/dist/components/Contractor/index.js +10 -8
- package/dist/components/Contractor/index.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +1 -1
- package/dist/components/Employee/Compensation/Edit.js +12 -12
- package/dist/components/Employee/Compensation/List.js +22 -23
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +8 -8
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +8 -8
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +6 -7
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +8 -7
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +10 -9
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +2 -3
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +4 -3
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +5 -6
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +12 -12
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +3 -4
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +8 -8
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +8 -9
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +8 -8
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +5 -6
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/Actions.js +6 -7
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +6 -5
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +22 -21
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +3 -4
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +8 -9
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +12 -13
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +3 -4
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +2 -3
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/i18n/I18n.js +1 -1
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Contractor.ContractorList.json.js +14 -10
- package/dist/i18n/en/Contractor.ContractorList.json.js.map +1 -1
- package/dist/i18n/en/Contractor.Submit.json.js +22 -0
- package/dist/i18n/en/Contractor.Submit.json.js.map +1 -0
- package/dist/shared/constants.d.ts +12 -2
- package/dist/shared/constants.js +12 -6
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +25 -13
- package/package.json +2 -1
- package/dist/components/Contractor/List/index.d.ts +0 -25
- package/dist/components/Contractor/List/index.js +0 -81
- package/dist/components/Contractor/List/index.js.map +0 -1
- package/dist/components/Contractor/List/useContractorList.js.map +0 -1
- package/dist/components/Contractor/Submit/ContractorSubmitWithApi.d.ts +0 -6
- package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js +0 -27
- package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js.map +0 -1
- package/dist/components/Contractor/Submit/index.d.ts +0 -6
- package/dist/components/Contractor/Submit/index.js +0 -20
- package/dist/components/Contractor/Submit/index.js.map +0 -1
- package/dist/components/Contractor/Submit/index.module.scss.js +0 -8
- package/dist/components/Contractor/Submit/index.module.scss.js.map +0 -1
- package/dist/i18n/en/Contractor.ContractorSubmit.json.js +0 -18
- package/dist/i18n/en/Contractor.ContractorSubmit.json.js.map +0 -1
|
@@ -12,9 +12,10 @@ import { BaseComponent as x } from "../../../Base/Base.js";
|
|
|
12
12
|
import { useBase as A } from "../../../Base/useBase.js";
|
|
13
13
|
import { SignatureForm as v } from "../../../Common/SignatureForm/SignatureForm.js";
|
|
14
14
|
import { Flex as G } from "../../../Common/Flex/Flex.js";
|
|
15
|
+
import "react-i18next";
|
|
15
16
|
import "classnames";
|
|
16
17
|
import { companyEvents as t } from "../../../../shared/constants.js";
|
|
17
|
-
function
|
|
18
|
+
function X(r) {
|
|
18
19
|
return /* @__PURE__ */ o(x, { ...r, children: /* @__PURE__ */ o(R, { ...r, children: r.children }) });
|
|
19
20
|
}
|
|
20
21
|
function R({ formId: r, children: e, dictionary: i }) {
|
|
@@ -23,11 +24,11 @@ function R({ formId: r, children: e, dictionary: i }) {
|
|
|
23
24
|
data: { form: s }
|
|
24
25
|
} = C({
|
|
25
26
|
formId: r
|
|
26
|
-
}), u = s, { isPending: c, mutateAsync:
|
|
27
|
-
data: { formPdf:
|
|
27
|
+
}), u = s, { isPending: c, mutateAsync: p } = h(), {
|
|
28
|
+
data: { formPdf: f }
|
|
28
29
|
} = y({
|
|
29
30
|
formId: r
|
|
30
|
-
}), l =
|
|
31
|
+
}), l = f.documentUrl;
|
|
31
32
|
return /* @__PURE__ */ o(
|
|
32
33
|
M,
|
|
33
34
|
{
|
|
@@ -41,7 +42,7 @@ function R({ formId: r, children: e, dictionary: i }) {
|
|
|
41
42
|
},
|
|
42
43
|
children: /* @__PURE__ */ o(v, { onSubmit: async (d) => {
|
|
43
44
|
await a(d, async (m) => {
|
|
44
|
-
const F = await
|
|
45
|
+
const F = await p({
|
|
45
46
|
request: {
|
|
46
47
|
formId: r,
|
|
47
48
|
requestBody: {
|
|
@@ -63,6 +64,6 @@ function R({ formId: r, children: e, dictionary: i }) {
|
|
|
63
64
|
}
|
|
64
65
|
export {
|
|
65
66
|
R as Root,
|
|
66
|
-
|
|
67
|
+
X as SignatureForm
|
|
67
68
|
};
|
|
68
69
|
//# sourceMappingURL=SignatureForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignatureForm.js","sources":["../../../../../src/components/Company/DocumentSigner/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { useCompanyFormsGetSuspense } from '@gusto/embedded-api/react-query/companyFormsGet'\nimport { useCompanyFormsSignMutation } from '@gusto/embedded-api/react-query/companyFormsSign'\nimport { useCompanyFormsGetPdfSuspense } from '@gusto/embedded-api/react-query/companyFormsGetPdf'\nimport { Head } from './Head'\nimport { Preview } from './Preview'\nimport { Form } from './Form'\nimport { Actions } from './Actions'\nimport { SignatureFormProvider } from './useSignatureForm'\nimport { useI18n, useComponentDictionary } 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 extends BaseComponentInterface<'Company.SignatureForm'> {\n formId: string\n companyId: string\n}\n\nexport function SignatureForm(props: SignatureFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport function Root({ formId, children, dictionary }: SignatureFormProps) {\n useComponentDictionary('Company.SignatureForm', dictionary)\n useI18n('Company.SignatureForm')\n const { onEvent, baseSubmitHandler } = useBase()\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\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"],"names":["SignatureForm","props","jsx","BaseComponent","Root","formId","children","dictionary","useComponentDictionary","useI18n","onEvent","baseSubmitHandler","useBase","formNullable","useCompanyFormsGetSuspense","form","isPending","signForm","useCompanyFormsSignMutation","formPdf","useCompanyFormsGetPdfSuspense","pdfUrl","SignatureFormProvider","companyEvents","SharedSignatureForm","data","payload","signFormResponse","Flex","jsxs","Fragment","Head","Preview","Form","Actions"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SignatureForm.js","sources":["../../../../../src/components/Company/DocumentSigner/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { useCompanyFormsGetSuspense } from '@gusto/embedded-api/react-query/companyFormsGet'\nimport { useCompanyFormsSignMutation } from '@gusto/embedded-api/react-query/companyFormsSign'\nimport { useCompanyFormsGetPdfSuspense } from '@gusto/embedded-api/react-query/companyFormsGetPdf'\nimport { Head } from './Head'\nimport { Preview } from './Preview'\nimport { Form } from './Form'\nimport { Actions } from './Actions'\nimport { SignatureFormProvider } from './useSignatureForm'\nimport { useI18n, useComponentDictionary } 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 extends BaseComponentInterface<'Company.SignatureForm'> {\n formId: string\n companyId: string\n}\n\nexport function SignatureForm(props: SignatureFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport function Root({ formId, children, dictionary }: SignatureFormProps) {\n useComponentDictionary('Company.SignatureForm', dictionary)\n useI18n('Company.SignatureForm')\n const { onEvent, baseSubmitHandler } = useBase()\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\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"],"names":["SignatureForm","props","jsx","BaseComponent","Root","formId","children","dictionary","useComponentDictionary","useI18n","onEvent","baseSubmitHandler","useBase","formNullable","useCompanyFormsGetSuspense","form","isPending","signForm","useCompanyFormsSignMutation","formPdf","useCompanyFormsGetPdfSuspense","pdfUrl","SignatureFormProvider","companyEvents","SharedSignatureForm","data","payload","signFormResponse","Flex","jsxs","Fragment","Head","Preview","Form","Actions"],"mappings":";;;;;;;;;;;;;;;;;AAwBO,SAASA,EAAcC,GAA2B;AACvD,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEO,SAASG,EAAK,EAAE,QAAAC,GAAQ,UAAAC,GAAU,YAAAC,KAAkC;AACzE,EAAAC,EAAuB,yBAAyBD,CAAU,GAC1DE,EAAQ,uBAAuB;AAC/B,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GAEjC;AAAA,IACJ,MAAM,EAAE,MAAMC,EAAA;AAAA,EAAa,IACzBC,EAA2B;AAAA,IAC7B,QAAAT;AAAA,EAAA,CACD,GACKU,IAAOF,GAEP,EAAE,WAAAG,GAAW,aAAaC,EAAA,IAAaC,EAAA,GAEvC;AAAA,IACJ,MAAM,EAAE,SAAAC,EAAA;AAAA,EAAQ,IACdC,EAA8B;AAAA,IAChC,QAAAf;AAAA,EAAA,CACD,GACKgB,IAASF,EAAS;AAwBxB,SACE,gBAAAjB;AAAA,IAACoB;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,MAAAP;AAAA,QACA,QAAAM;AAAA,QACA,WAAAL;AAAA,QACA,QAVa,MAAM;AACvB,UAAAN,EAAQa,EAAc,sBAAsB;AAAA,QAC9C;AAAA,MAQc;AAAA,MAGV,UAAA,gBAAArB,EAACsB,GAAA,EAAoB,UA/BJ,OAAOC,MAA8B;AACxD,cAAMd,EAAkBc,GAAM,OAAMC,MAAW;AAC7C,gBAAMC,IAAmB,MAAMV,EAAS;AAAA,YACtC,SAAS;AAAA,cACP,QAAAZ;AAAA,cACA,aAAa;AAAA,gBACX,eAAeqB,EAAQ;AAAA,gBACvB,OAAOA,EAAQ;AAAA,cAAA;AAAA,YACjB;AAAA,UACF,CACD;AAED,UAAAhB,EAAQa,EAAc,mBAAmBI,EAAiB,IAAI,GAE9DjB,EAAQa,EAAc,sBAAsB;AAAA,QAC9C,CAAC;AAAA,MACH,GAgBM,UAAA,gBAAArB,EAAC0B,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAAtB,KAGC,gBAAAuB,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAA5B,EAAC6B,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAQ;AAAA,0BACRC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,GAEJ,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -11,13 +11,12 @@ import "../../../../shared/constants.js";
|
|
|
11
11
|
import "classnames";
|
|
12
12
|
import "dompurify";
|
|
13
13
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
-
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
15
14
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
15
|
+
const [c, d] = o(
|
|
17
16
|
"CompanySignatureFormContext"
|
|
18
17
|
);
|
|
19
18
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
d as SignatureFormProvider,
|
|
20
|
+
c as useSignatureForm
|
|
22
21
|
};
|
|
23
22
|
//# sourceMappingURL=useSignatureForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignatureForm.js","sources":["../../../../../src/components/Company/DocumentSigner/SignatureForm/useSignatureForm.ts"],"sourcesContent":["import { type Form as FormSchema } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype SignatureFormContextType = {\n form: FormSchema\n pdfUrl?: string | null\n isPending: boolean\n onBack: () => void\n}\n\nconst [useSignatureForm, SignatureFormProvider] = createCompoundContext<SignatureFormContextType>(\n 'CompanySignatureFormContext',\n)\n\nexport { useSignatureForm, SignatureFormProvider }\n"],"names":["useSignatureForm","SignatureFormProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSignatureForm.js","sources":["../../../../../src/components/Company/DocumentSigner/SignatureForm/useSignatureForm.ts"],"sourcesContent":["import { type Form as FormSchema } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype SignatureFormContextType = {\n form: FormSchema\n pdfUrl?: string | null\n isPending: boolean\n onBack: () => void\n}\n\nconst [useSignatureForm, SignatureFormProvider] = createCompoundContext<SignatureFormContextType>(\n 'CompanySignatureFormContext',\n)\n\nexport { useSignatureForm, SignatureFormProvider }\n"],"names":["useSignatureForm","SignatureFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as
|
|
2
|
+
import { useTranslation as r } from "react-i18next";
|
|
3
3
|
import { useFederalTaxes as i } from "./useFederalTaxes.js";
|
|
4
4
|
import "classnames";
|
|
5
|
-
import "../../../shared/constants.js";
|
|
6
5
|
import { ActionsLayout as s } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
7
6
|
import { useComponentContext as m } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
|
-
const
|
|
9
|
-
const { t } =
|
|
10
|
-
return /* @__PURE__ */ o(s, { children: /* @__PURE__ */ o(
|
|
7
|
+
const l = () => {
|
|
8
|
+
const { t } = r("Company.FederalTaxes"), { isPending: n } = i(), e = m();
|
|
9
|
+
return /* @__PURE__ */ o(s, { children: /* @__PURE__ */ o(e.Button, { type: "submit", isLoading: n, children: t("continueCta") }) });
|
|
11
10
|
};
|
|
12
11
|
export {
|
|
13
|
-
|
|
12
|
+
l as Actions
|
|
14
13
|
};
|
|
15
14
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../src/components/Company/FederalTaxes/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useFederalTaxes } from './useFederalTaxes'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.FederalTaxes')\n const { isPending } = useFederalTaxes()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","useFederalTaxes","Components","useComponentContext","jsx","ActionsLayout"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../src/components/Company/FederalTaxes/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useFederalTaxes } from './useFederalTaxes'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.FederalTaxes')\n const { isPending } = useFederalTaxes()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","useFederalTaxes","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,EAAA,IAAMC,EAAe,sBAAsB,GAC7C,EAAE,WAAAC,EAAA,IAAcC,EAAA,GAChBC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAA,EAAE,aAAa,GAClB,GACF;AAEJ;"}
|
|
@@ -12,14 +12,15 @@ import { useI18n as R, useComponentDictionary as M } from "../../../i18n/I18n.js
|
|
|
12
12
|
import { BaseComponent as B } from "../../Base/Base.js";
|
|
13
13
|
import { useBase as O } from "../../Base/useBase.js";
|
|
14
14
|
import { Flex as j } from "../../Common/Flex/Flex.js";
|
|
15
|
+
import "react-i18next";
|
|
15
16
|
import "classnames";
|
|
16
17
|
import { companyEvents as l } from "../../../shared/constants.js";
|
|
17
|
-
function
|
|
18
|
-
return /* @__PURE__ */ e(B, { ...
|
|
18
|
+
function ee(o) {
|
|
19
|
+
return /* @__PURE__ */ e(B, { ...o, children: /* @__PURE__ */ e(q, { ...o, children: o.children }) });
|
|
19
20
|
}
|
|
20
|
-
function q({ companyId:
|
|
21
|
+
function q({ companyId: o, children: t, className: s, defaultValues: i, dictionary: d }) {
|
|
21
22
|
R("Company.FederalTaxes"), M("Company.FederalTaxes", d);
|
|
22
|
-
const { onEvent: m, baseSubmitHandler: f } = O(), { data:
|
|
23
|
+
const { onEvent: m, baseSubmitHandler: f } = O(), { data: p } = h({ companyId: o }), r = p.federalTaxDetails, { mutateAsync: c, isPending: F } = D(), n = E({
|
|
23
24
|
resolver: v(A),
|
|
24
25
|
defaultValues: {
|
|
25
26
|
federalEin: r.hasEin ? void 0 : "",
|
|
@@ -28,15 +29,15 @@ function q({ companyId: a, children: t, className: s, defaultValues: i, dictiona
|
|
|
28
29
|
legalName: r.legalName ?? i?.legalName
|
|
29
30
|
}
|
|
30
31
|
}), x = async (u) => {
|
|
31
|
-
await f(u, async (
|
|
32
|
-
const T = await
|
|
32
|
+
await f(u, async (a) => {
|
|
33
|
+
const T = await c({
|
|
33
34
|
request: {
|
|
34
|
-
companyId:
|
|
35
|
+
companyId: o,
|
|
35
36
|
requestBody: {
|
|
36
|
-
ein:
|
|
37
|
-
taxPayerType:
|
|
38
|
-
filingForm:
|
|
39
|
-
legalName:
|
|
37
|
+
ein: a.federalEin,
|
|
38
|
+
taxPayerType: a.taxPayerType,
|
|
39
|
+
filingForm: a.filingForm,
|
|
40
|
+
legalName: a.legalName,
|
|
40
41
|
version: r.version
|
|
41
42
|
}
|
|
42
43
|
}
|
|
@@ -63,6 +64,6 @@ function q({ companyId: a, children: t, className: s, defaultValues: i, dictiona
|
|
|
63
64
|
) });
|
|
64
65
|
}
|
|
65
66
|
export {
|
|
66
|
-
|
|
67
|
+
ee as FederalTaxes
|
|
67
68
|
};
|
|
68
69
|
//# sourceMappingURL=FederalTaxes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/FederalTaxes.tsx"],"sourcesContent":["import { 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'\nimport { useComponentDictionary } from '@/i18n'\n\ninterface FederalTaxesProps extends CommonComponentInterface<'Company.FederalTaxes'> {\n companyId: 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, dictionary }: FederalTaxesProps) {\n useI18n('Company.FederalTaxes')\n useComponentDictionary('Company.FederalTaxes', dictionary)\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","dictionary","useI18n","useComponentDictionary","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":"
|
|
1
|
+
{"version":3,"file":"FederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/FederalTaxes.tsx"],"sourcesContent":["import { 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'\nimport { useComponentDictionary } from '@/i18n'\n\ninterface FederalTaxesProps extends CommonComponentInterface<'Company.FederalTaxes'> {\n companyId: 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, dictionary }: FederalTaxesProps) {\n useI18n('Company.FederalTaxes')\n useComponentDictionary('Company.FederalTaxes', dictionary)\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","dictionary","useI18n","useComponentDictionary","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":";;;;;;;;;;;;;;;;;AA+BO,SAASA,GAAaC,GAAmD;AAC9E,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,UAAAC,GAAU,WAAAC,GAAW,eAAAC,GAAe,YAAAC,KAAiC;AAC9F,EAAAC,EAAQ,sBAAsB,GAC9BC,EAAuB,wBAAwBF,CAAU;AACzD,QAAM,EAAE,SAAAG,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GAEjC,EAAE,MAAAC,EAAA,IAASC,EAAgC,EAAE,WAAAX,GAAW,GACxDY,IAAoBF,EAAK,mBAEzB,EAAE,aAAaG,GAAyB,WAAAC,EAAA,IAAcC,EAAA,GAEtDC,IAAcC,EAA8B;AAAA,IAChD,UAAUC,EAAYC,CAAoB;AAAA,IAC1C,eAAe;AAAA,MACb,YAAYP,EAAkB,SAAS,SAAY;AAAA,MACnD,cAAcA,EAAkB,eAC3BA,EAAkB,eACnBT,GAAe;AAAA,MACnB,YAAYS,EAAkB,aACzBA,EAAkB,aACnBT,GAAe;AAAA,MACnB,WAAWS,EAAkB,aAAaT,GAAe;AAAA,IAAA;AAAA,EAC3D,CACD,GAEKiB,IAAe,OAAOV,MAA+B;AACzD,UAAMF,EAAkBE,GAAM,OAAMW,MAAW;AAC7C,YAAMC,IAAkC,MAAMT,EAAwB;AAAA,QACpE,SAAS;AAAA,UACP,WAAAb;AAAA,UACA,aAAa;AAAA,YACX,KAAKqB,EAAQ;AAAA,YACb,cAAcA,EAAQ;AAAA,YACtB,YAAYA,EAAQ;AAAA,YACpB,WAAWA,EAAQ;AAAA,YACnB,SAAST,EAAkB;AAAA,UAAA;AAAA,QAC7B;AAAA,MACF,CACD;AAED,MAAAL;AAAA,QACEgB,EAAc;AAAA,QACdD,EAAgC;AAAA,MAAA,GAElCf,EAAQgB,EAAc,0BAA0B;AAAA,IAClD,CAAC;AAAA,EACH;AAEA,SACE,gBAAA1B,EAAC,aAAQ,WAAAK,GACP,UAAA,gBAAAL;AAAA,IAAC2B;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,WAAAV;AAAA,QACA,mBAAAF;AAAA,MAAA;AAAA,MAGF,4BAACa,GAAA,EAAc,GAAGT,GAChB,UAAA,gBAAAnB,EAAC6B,GAAA,EAAS,UAAUV,EAAY,aAAaI,CAAY,GACvD,UAAA,gBAAAvB,EAAC8B,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAA1B,KAGC,gBAAA2B,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAhC,EAACiC,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,GACX,EAAA,CAEJ,GACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -5,12 +5,11 @@ import { TaxPayerType as _, FilingForm as y } from "@gusto/embedded-api/models/o
|
|
|
5
5
|
import { useFederalTaxes as u } from "./useFederalTaxes.js";
|
|
6
6
|
import { Flex as b } from "../../Common/Flex/Flex.js";
|
|
7
7
|
import "classnames";
|
|
8
|
-
import "../../../shared/constants.js";
|
|
9
|
-
import { TextInputField as l } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
10
8
|
import { usePlaceholderEin as g, normalizeEin as x } from "../../../helpers/federalEin.js";
|
|
11
9
|
import { useComponentContext as F } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
|
+
import { TextInputField as l } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
12
11
|
import { SelectField as a } from "../../Common/Fields/SelectField/SelectField.js";
|
|
13
|
-
function
|
|
12
|
+
function R() {
|
|
14
13
|
const { t: e } = c("Company.FederalTaxes"), { federalTaxDetails: s } = u(), i = F(), m = g(s?.hasEin), p = n(
|
|
15
14
|
() => Object.values(_).map((o) => ({
|
|
16
15
|
value: o,
|
|
@@ -101,6 +100,6 @@ function v() {
|
|
|
101
100
|
] });
|
|
102
101
|
}
|
|
103
102
|
export {
|
|
104
|
-
|
|
103
|
+
R as Form
|
|
105
104
|
};
|
|
106
105
|
//# sourceMappingURL=Form.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","sources":["../../../../src/components/Company/FederalTaxes/Form.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation, Trans } from 'react-i18next'\nimport {\n TaxPayerType,\n FilingForm,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { useFederalTaxes } from './useFederalTaxes'\nimport { TextInputField, SelectField, Flex } from '@/components/Common'\nimport { usePlaceholderEin, normalizeEin } from '@/helpers/federalEin'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Form() {\n const { t } = useTranslation('Company.FederalTaxes')\n const { federalTaxDetails } = useFederalTaxes()\n const Components = useComponentContext()\n\n const placeholderEin = usePlaceholderEin(federalTaxDetails?.hasEin)\n\n const taxPayerTypeOptions = useMemo(\n () =>\n Object.values(TaxPayerType).map(value => ({\n value: value,\n label: t(`taxPayerType.${value}`),\n })),\n [t],\n )\n\n const filingFormOptions = useMemo(\n () =>\n Object.values(FilingForm).map(value => ({\n value: value,\n label: t(`filingForm.${value}`),\n })),\n [t],\n )\n\n return (\n <Flex flexDirection=\"column\" gap={28}>\n <TextInputField\n name=\"federalEin\"\n label={t('federal_ein_label')}\n description={\n <Trans\n t={t}\n i18nKey=\"federal_ein_description\"\n components={{\n applyLink: (\n <Components.Link\n href=\"https://www.irs.gov/businesses/employer-identification-number\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n isRequired\n transform={normalizeEin}\n placeholder={placeholderEin}\n />\n <SelectField\n name=\"taxPayerType\"\n label={t('taxpayer_type_label')}\n description={t('taxpayer_type_description')}\n options={taxPayerTypeOptions}\n isRequired\n />\n <SelectField\n name=\"filingForm\"\n label={t('federal_filing_form_label')}\n description={\n <Trans\n t={t}\n i18nKey=\"federal_filing_form_description\"\n components={{\n irsLink: (\n <Components.Link\n href=\"https://www.irs.gov/newsroom/employers-should-you-file-form-944-or-941\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n options={filingFormOptions}\n isRequired\n />\n <TextInputField\n name=\"legalName\"\n label={t('legal_entity_name_label')}\n description={t('legal_entity_name_description')}\n isRequired\n errorMessage={t('legal_entity_name_error')}\n />\n </Flex>\n )\n}\n"],"names":["Form","t","useTranslation","federalTaxDetails","useFederalTaxes","Components","useComponentContext","placeholderEin","usePlaceholderEin","taxPayerTypeOptions","useMemo","TaxPayerType","value","filingFormOptions","FilingForm","jsxs","Flex","jsx","TextInputField","Trans","normalizeEin","SelectField"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Form.js","sources":["../../../../src/components/Company/FederalTaxes/Form.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation, Trans } from 'react-i18next'\nimport {\n TaxPayerType,\n FilingForm,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { useFederalTaxes } from './useFederalTaxes'\nimport { TextInputField, SelectField, Flex } from '@/components/Common'\nimport { usePlaceholderEin, normalizeEin } from '@/helpers/federalEin'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Form() {\n const { t } = useTranslation('Company.FederalTaxes')\n const { federalTaxDetails } = useFederalTaxes()\n const Components = useComponentContext()\n\n const placeholderEin = usePlaceholderEin(federalTaxDetails?.hasEin)\n\n const taxPayerTypeOptions = useMemo(\n () =>\n Object.values(TaxPayerType).map(value => ({\n value: value,\n label: t(`taxPayerType.${value}`),\n })),\n [t],\n )\n\n const filingFormOptions = useMemo(\n () =>\n Object.values(FilingForm).map(value => ({\n value: value,\n label: t(`filingForm.${value}`),\n })),\n [t],\n )\n\n return (\n <Flex flexDirection=\"column\" gap={28}>\n <TextInputField\n name=\"federalEin\"\n label={t('federal_ein_label')}\n description={\n <Trans\n t={t}\n i18nKey=\"federal_ein_description\"\n components={{\n applyLink: (\n <Components.Link\n href=\"https://www.irs.gov/businesses/employer-identification-number\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n isRequired\n transform={normalizeEin}\n placeholder={placeholderEin}\n />\n <SelectField\n name=\"taxPayerType\"\n label={t('taxpayer_type_label')}\n description={t('taxpayer_type_description')}\n options={taxPayerTypeOptions}\n isRequired\n />\n <SelectField\n name=\"filingForm\"\n label={t('federal_filing_form_label')}\n description={\n <Trans\n t={t}\n i18nKey=\"federal_filing_form_description\"\n components={{\n irsLink: (\n <Components.Link\n href=\"https://www.irs.gov/newsroom/employers-should-you-file-form-944-or-941\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n options={filingFormOptions}\n isRequired\n />\n <TextInputField\n name=\"legalName\"\n label={t('legal_entity_name_label')}\n description={t('legal_entity_name_description')}\n isRequired\n errorMessage={t('legal_entity_name_error')}\n />\n </Flex>\n )\n}\n"],"names":["Form","t","useTranslation","federalTaxDetails","useFederalTaxes","Components","useComponentContext","placeholderEin","usePlaceholderEin","taxPayerTypeOptions","useMemo","TaxPayerType","value","filingFormOptions","FilingForm","jsxs","Flex","jsx","TextInputField","Trans","normalizeEin","SelectField"],"mappings":";;;;;;;;;;;AAWO,SAASA,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,sBAAsB,GAC7C,EAAE,mBAAAC,EAAA,IAAsBC,EAAA,GACxBC,IAAaC,EAAA,GAEbC,IAAiBC,EAAkBL,GAAmB,MAAM,GAE5DM,IAAsBC;AAAA,IAC1B,MACE,OAAO,OAAOC,CAAY,EAAE,IAAI,CAAAC,OAAU;AAAA,MACxC,OAAAA;AAAA,MACA,OAAOX,EAAE,gBAAgBW,CAAK,EAAE;AAAA,IAAA,EAChC;AAAA,IACJ,CAACX,CAAC;AAAA,EAAA,GAGEY,IAAoBH;AAAA,IACxB,MACE,OAAO,OAAOI,CAAU,EAAE,IAAI,CAAAF,OAAU;AAAA,MACtC,OAAAA;AAAA,MACA,OAAOX,EAAE,cAAcW,CAAK,EAAE;AAAA,IAAA,EAC9B;AAAA,IACJ,CAACX,CAAC;AAAA,EAAA;AAGJ,SACE,gBAAAc,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOjB,EAAE,mBAAmB;AAAA,QAC5B,aACE,gBAAAgB;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,GAAAlB;AAAA,YACA,SAAQ;AAAA,YACR,YAAY;AAAA,cACV,WACE,gBAAAgB;AAAA,gBAACZ,EAAW;AAAA,gBAAX;AAAA,kBACC,MAAK;AAAA,kBACL,QAAO;AAAA,kBACP,KAAI;AAAA,gBAAA;AAAA,cAAA;AAAA,YACN;AAAA,UAEJ;AAAA,QAAA;AAAA,QAGJ,YAAU;AAAA,QACV,WAAWe;AAAA,QACX,aAAab;AAAA,MAAA;AAAA,IAAA;AAAA,IAEf,gBAAAU;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOpB,EAAE,qBAAqB;AAAA,QAC9B,aAAaA,EAAE,2BAA2B;AAAA,QAC1C,SAASQ;AAAA,QACT,YAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAEZ,gBAAAQ;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOpB,EAAE,2BAA2B;AAAA,QACpC,aACE,gBAAAgB;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,GAAAlB;AAAA,YACA,SAAQ;AAAA,YACR,YAAY;AAAA,cACV,SACE,gBAAAgB;AAAA,gBAACZ,EAAW;AAAA,gBAAX;AAAA,kBACC,MAAK;AAAA,kBACL,QAAO;AAAA,kBACP,KAAI;AAAA,gBAAA;AAAA,cAAA;AAAA,YACN;AAAA,UAEJ;AAAA,QAAA;AAAA,QAGJ,SAASQ;AAAA,QACT,YAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAEZ,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOjB,EAAE,yBAAyB;AAAA,QAClC,aAAaA,EAAE,+BAA+B;AAAA,QAC9C,YAAU;AAAA,QACV,cAAcA,EAAE,yBAAyB;AAAA,MAAA;AAAA,IAAA;AAAA,EAC3C,GACF;AAEJ;"}
|
|
@@ -13,19 +13,18 @@ import "../../../shared/constants.js";
|
|
|
13
13
|
import "classnames";
|
|
14
14
|
import "dompurify";
|
|
15
15
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
16
|
-
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
17
16
|
import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
|
|
18
|
-
const
|
|
17
|
+
const C = o.object({
|
|
19
18
|
federalEin: o.string().optional(),
|
|
20
19
|
taxPayerType: o.enum(Object.values(e)).optional(),
|
|
21
20
|
filingForm: o.enum(Object.values(r)).optional(),
|
|
22
21
|
legalName: o.string().min(1)
|
|
23
|
-
}), [
|
|
22
|
+
}), [b, j] = t(
|
|
24
23
|
"CompanyFederalTaxesContext"
|
|
25
24
|
);
|
|
26
25
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
C as FederalTaxFormSchema,
|
|
27
|
+
j as FederalTaxesProvider,
|
|
28
|
+
b as useFederalTaxes
|
|
30
29
|
};
|
|
31
30
|
//# sourceMappingURL=useFederalTaxes.js.map
|
|
@@ -1 +1 @@
|
|
|
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":"
|
|
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":";;;;;;;;;;;;;;;;AASO,MAAMA,IAAuBC,EAAE,OAAO;AAAA,EAC3C,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,cAAcA,EAAE,KAAK,OAAO,OAAOC,CAAY,CAA0B,EAAE,SAAA;AAAA,EAC3E,YAAYD,EAAE,KAAK,OAAO,OAAOE,CAAU,CAA0B,EAAE,SAAA;AAAA,EACvE,WAAWF,EAAE,OAAA,EAAS,IAAI,CAAC;AAC7B,CAAC,GAeK,CAACG,GAAiBC,CAAoB,IAAIC;AAAA,EAC9C;AACF;"}
|
|
@@ -2,14 +2,13 @@ import { jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTranslation as i } from "react-i18next";
|
|
3
3
|
import { useIndustryApiState as s } from "./Context.js";
|
|
4
4
|
import "classnames";
|
|
5
|
-
import "../../../shared/constants.js";
|
|
6
5
|
import { ActionsLayout as m } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
7
6
|
import { useComponentContext as e } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
|
-
const
|
|
7
|
+
const y = () => {
|
|
9
8
|
const { t: o } = i("Company.Industry"), { isPending: n } = s(), r = e();
|
|
10
9
|
return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(r.Button, { type: "submit", isLoading: n, children: o("submitCta") }) });
|
|
11
10
|
};
|
|
12
11
|
export {
|
|
13
|
-
|
|
12
|
+
y as Actions
|
|
14
13
|
};
|
|
15
14
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../src/components/Company/Industry/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIndustryApiState } from './Context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.Industry')\n const { isPending } = useIndustryApiState()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","isPending","useIndustryApiState","Components","useComponentContext","jsx","ActionsLayout"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../src/components/Company/Industry/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIndustryApiState } from './Context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.Industry')\n const { isPending } = useIndustryApiState()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","isPending","useIndustryApiState","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kBAAkB,GACzC,EAAE,WAAAC,EAAA,IAAcC,EAAA,GAChBC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAAF,EAAE,WAAW,GAChB,GACF;AAEJ;"}
|
|
@@ -11,17 +11,16 @@ import "../../../shared/constants.js";
|
|
|
11
11
|
import "classnames";
|
|
12
12
|
import "dompurify";
|
|
13
13
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
-
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
15
14
|
import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
15
|
+
const [A, P] = t("IndustryItems", {
|
|
17
16
|
items: []
|
|
18
|
-
}), [
|
|
17
|
+
}), [f, v] = t("IndustryApi", {
|
|
19
18
|
isPending: !1
|
|
20
19
|
});
|
|
21
20
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
v as IndustryApiStateProvider,
|
|
22
|
+
P as IndustryItemsProvider,
|
|
23
|
+
f as useIndustryApiState,
|
|
24
|
+
A as useIndustryItems
|
|
26
25
|
};
|
|
27
26
|
//# sourceMappingURL=Context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Context.js","sources":["../../../../src/components/Company/Industry/Context.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\nimport type { ComboBoxOption } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\n\nconst [useIndustryItems, IndustryItemsProvider] = createCompoundContext('IndustryItems', {\n items: [] as ComboBoxOption[],\n})\n\nconst [useIndustryApiState, IndustryApiStateProvider] = createCompoundContext('IndustryApi', {\n isPending: false,\n})\n\nexport { IndustryApiStateProvider, IndustryItemsProvider, useIndustryItems, useIndustryApiState }\n"],"names":["useIndustryItems","IndustryItemsProvider","createCompoundContext","useIndustryApiState","IndustryApiStateProvider"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Context.js","sources":["../../../../src/components/Company/Industry/Context.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\nimport type { ComboBoxOption } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\n\nconst [useIndustryItems, IndustryItemsProvider] = createCompoundContext('IndustryItems', {\n items: [] as ComboBoxOption[],\n})\n\nconst [useIndustryApiState, IndustryApiStateProvider] = createCompoundContext('IndustryApi', {\n isPending: false,\n})\n\nexport { IndustryApiStateProvider, IndustryItemsProvider, useIndustryItems, useIndustryApiState }\n"],"names":["useIndustryItems","IndustryItemsProvider","createCompoundContext","useIndustryApiState","IndustryApiStateProvider"],"mappings":";;;;;;;;;;;;;;AAGA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC,EAAsB,iBAAiB;AAAA,EACvF,OAAO,CAAA;AACT,CAAC,GAEK,CAACC,GAAqBC,CAAwB,IAAIF,EAAsB,eAAe;AAAA,EAC3F,WAAW;AACb,CAAC;"}
|
|
@@ -2,12 +2,11 @@ import { jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTranslation as e } from "react-i18next";
|
|
3
3
|
import { useIndustryItems as m } from "./Context.js";
|
|
4
4
|
import "classnames";
|
|
5
|
-
import "
|
|
6
|
-
|
|
7
|
-
const c = () => {
|
|
5
|
+
import { ComboBoxField as s } from "../../Common/Fields/ComboBoxField/ComboBoxField.js";
|
|
6
|
+
const d = () => {
|
|
8
7
|
const { t: o } = e("Company.Industry"), { items: r } = m();
|
|
9
8
|
return /* @__PURE__ */ t(
|
|
10
|
-
|
|
9
|
+
s,
|
|
11
10
|
{
|
|
12
11
|
isRequired: !0,
|
|
13
12
|
options: r,
|
|
@@ -18,6 +17,6 @@ const c = () => {
|
|
|
18
17
|
);
|
|
19
18
|
};
|
|
20
19
|
export {
|
|
21
|
-
|
|
20
|
+
d as Edit
|
|
22
21
|
};
|
|
23
22
|
//# sourceMappingURL=Edit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Edit.js","sources":["../../../../src/components/Company/Industry/Edit.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIndustryItems } from './Context'\nimport { ComboBoxField } from '@/components/Common'\n\nexport interface IndustryFormFields {\n naics_code: string\n}\n\nexport const Edit = () => {\n const { t } = useTranslation('Company.Industry')\n const { items } = useIndustryItems()\n\n return (\n <ComboBoxField\n isRequired\n options={items}\n label={t('label')}\n name=\"naics_code\"\n placeholder={t('placeholder')}\n />\n )\n}\n"],"names":["Edit","t","useTranslation","items","useIndustryItems","jsx","ComboBoxField"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Edit.js","sources":["../../../../src/components/Company/Industry/Edit.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIndustryItems } from './Context'\nimport { ComboBoxField } from '@/components/Common'\n\nexport interface IndustryFormFields {\n naics_code: string\n}\n\nexport const Edit = () => {\n const { t } = useTranslation('Company.Industry')\n const { items } = useIndustryItems()\n\n return (\n <ComboBoxField\n isRequired\n options={items}\n label={t('label')}\n name=\"naics_code\"\n placeholder={t('placeholder')}\n />\n )\n}\n"],"names":["Edit","t","useTranslation","items","useIndustryItems","jsx","ComboBoxField"],"mappings":";;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kBAAkB,GACzC,EAAE,OAAAC,EAAA,IAAUC,EAAA;AAElB,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,YAAU;AAAA,MACV,SAASH;AAAA,MACT,OAAOF,EAAE,OAAO;AAAA,MAChB,MAAK;AAAA,MACL,aAAaA,EAAE,aAAa;AAAA,IAAA;AAAA,EAAA;AAGlC;"}
|
|
@@ -2,17 +2,16 @@ import { jsxs as r, jsx as n } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTranslation as a } from "react-i18next";
|
|
3
3
|
import { useLocationsForm as e } from "./useLocationForm.js";
|
|
4
4
|
import "classnames";
|
|
5
|
-
import "
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
return /* @__PURE__ */ r(m, { children: [
|
|
5
|
+
import { ActionsLayout as c } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
6
|
+
import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
7
|
+
const h = () => {
|
|
8
|
+
const { t: o } = a("Company.Locations"), { handleCancel: i, isPending: s } = e(), t = m();
|
|
9
|
+
return /* @__PURE__ */ r(c, { children: [
|
|
11
10
|
/* @__PURE__ */ n(t.Button, { variant: "secondary", onClick: i, children: o("cancelCta") }),
|
|
12
11
|
/* @__PURE__ */ n(t.Button, { type: "submit", isLoading: s, "data-testid": "location-submit", children: o("saveCta") })
|
|
13
12
|
] });
|
|
14
13
|
};
|
|
15
14
|
export {
|
|
16
|
-
|
|
15
|
+
h as Actions
|
|
17
16
|
};
|
|
18
17
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsForm } from './useLocationForm'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.Locations')\n const { handleCancel, isPending } = useLocationsForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending} data-testid=\"location-submit\">\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","handleCancel","isPending","useLocationsForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsForm } from './useLocationForm'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.Locations')\n const { handleCancel, isPending } = useLocationsForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending} data-testid=\"location-submit\">\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","handleCancel","isPending","useLocationsForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,cAAAC,GAAc,WAAAC,EAAA,IAAcC,EAAA,GAC9BC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAAF,EAAE,WAAW,EAAA,CAChB;AAAA,IACA,gBAAAQ,EAACH,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GAAW,eAAY,mBAChE,UAAAH,EAAE,SAAS,EAAA,CACd;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -4,12 +4,13 @@ import { useTranslation as l } from "react-i18next";
|
|
|
4
4
|
import { zipValidation as n, phoneValidation as m } from "../../../../helpers/validations.js";
|
|
5
5
|
import { Flex as d } from "../../../Common/Flex/Flex.js";
|
|
6
6
|
import { Grid as p } from "../../../Common/Grid/Grid.js";
|
|
7
|
-
import
|
|
7
|
+
import "classnames";
|
|
8
8
|
import { STATES_ABBR as c } from "../../../../shared/constants.js";
|
|
9
9
|
import { useMaskedTransform as u, commonMasks as b } from "../../../../helpers/mask.js";
|
|
10
|
+
import { TextInputField as s } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
10
11
|
import { SelectField as f } from "../../../Common/Fields/SelectField/SelectField.js";
|
|
11
12
|
import { CheckboxGroupField as g } from "../../../Common/Fields/CheckboxGroupField/CheckboxGroupField.js";
|
|
12
|
-
const
|
|
13
|
+
const k = i.object({
|
|
13
14
|
phoneNumber: m,
|
|
14
15
|
street1: i.string().min(1),
|
|
15
16
|
street2: i.string().optional(),
|
|
@@ -18,7 +19,7 @@ const q = i.object({
|
|
|
18
19
|
zip: n,
|
|
19
20
|
addressType: i.array(i.enum(["mailingAddress", "filingAddress"])).optional()
|
|
20
21
|
});
|
|
21
|
-
function
|
|
22
|
+
function S() {
|
|
22
23
|
const { t: e } = l("Company.Locations"), o = u(b.phoneMask);
|
|
23
24
|
return /* @__PURE__ */ t(d, { flexDirection: "column", gap: 20, children: [
|
|
24
25
|
/* @__PURE__ */ t(
|
|
@@ -104,7 +105,7 @@ function k() {
|
|
|
104
105
|
] });
|
|
105
106
|
}
|
|
106
107
|
export {
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
S as Form,
|
|
109
|
+
k as LocationFormSchema
|
|
109
110
|
};
|
|
110
111
|
//# sourceMappingURL=Form.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Form.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { phoneValidation, zipValidation } from '@/helpers/validations'\nimport { CheckboxGroupField, Flex, Grid, SelectField, TextInputField } from '@/components/Common'\nimport { STATES_ABBR } from '@/shared/constants'\nimport { commonMasks, useMaskedTransform } from '@/helpers/mask'\n\nexport const LocationFormSchema = z.object({\n phoneNumber: phoneValidation,\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: zipValidation,\n addressType: z.array(z.enum(['mailingAddress', 'filingAddress'])).optional(),\n})\n\nexport type LocationFormInputs = z.infer<typeof LocationFormSchema>\n\nexport function Form() {\n const { t } = useTranslation('Company.Locations')\n const transform = useMaskedTransform(commonMasks.phoneMask)\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Grid\n gap={{ base: 20, small: 8 }}\n gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }}\n >\n <TextInputField\n name=\"street1\"\n isRequired\n label={t('street1Label')}\n errorMessage={t('validations.street1')}\n />\n <TextInputField name=\"street2\" label={t('street2Label')} />\n <TextInputField\n name=\"city\"\n label={t('cityLabel')}\n isRequired\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('stateLabel')}\n placeholder={t('statePlaceholder')}\n errorMessage={t('validations.state')}\n isRequired\n />\n <TextInputField\n name=\"zip\"\n isRequired\n label={t('zipLabel')}\n errorMessage={t('validations.zip')}\n />\n <TextInputField\n name=\"phoneNumber\"\n isRequired\n label={t('phoneNumberLabel')}\n errorMessage={t('validations.phone')}\n transform={transform}\n />\n </Grid>\n <CheckboxGroupField\n name=\"addressType\"\n label={t('addressTypeLabel')}\n options={[\n {\n value: 'mailingAddress',\n label: t('mailingAddressLabel'),\n description: t('mailingAddressDescription'),\n },\n {\n value: 'filingAddress',\n label: t('filingAddressLabel'),\n description: t('filingAddressDescription'),\n },\n ]}\n />\n </Flex>\n )\n}\n"],"names":["LocationFormSchema","z","phoneValidation","zipValidation","Form","t","useTranslation","transform","useMaskedTransform","commonMasks","jsxs","Flex","Grid","jsx","TextInputField","SelectField","STATES_ABBR","stateAbbr","CheckboxGroupField"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Form.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Form.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { phoneValidation, zipValidation } from '@/helpers/validations'\nimport { CheckboxGroupField, Flex, Grid, SelectField, TextInputField } from '@/components/Common'\nimport { STATES_ABBR } from '@/shared/constants'\nimport { commonMasks, useMaskedTransform } from '@/helpers/mask'\n\nexport const LocationFormSchema = z.object({\n phoneNumber: phoneValidation,\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: zipValidation,\n addressType: z.array(z.enum(['mailingAddress', 'filingAddress'])).optional(),\n})\n\nexport type LocationFormInputs = z.infer<typeof LocationFormSchema>\n\nexport function Form() {\n const { t } = useTranslation('Company.Locations')\n const transform = useMaskedTransform(commonMasks.phoneMask)\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Grid\n gap={{ base: 20, small: 8 }}\n gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }}\n >\n <TextInputField\n name=\"street1\"\n isRequired\n label={t('street1Label')}\n errorMessage={t('validations.street1')}\n />\n <TextInputField name=\"street2\" label={t('street2Label')} />\n <TextInputField\n name=\"city\"\n label={t('cityLabel')}\n isRequired\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('stateLabel')}\n placeholder={t('statePlaceholder')}\n errorMessage={t('validations.state')}\n isRequired\n />\n <TextInputField\n name=\"zip\"\n isRequired\n label={t('zipLabel')}\n errorMessage={t('validations.zip')}\n />\n <TextInputField\n name=\"phoneNumber\"\n isRequired\n label={t('phoneNumberLabel')}\n errorMessage={t('validations.phone')}\n transform={transform}\n />\n </Grid>\n <CheckboxGroupField\n name=\"addressType\"\n label={t('addressTypeLabel')}\n options={[\n {\n value: 'mailingAddress',\n label: t('mailingAddressLabel'),\n description: t('mailingAddressDescription'),\n },\n {\n value: 'filingAddress',\n label: t('filingAddressLabel'),\n description: t('filingAddressDescription'),\n },\n ]}\n />\n </Flex>\n )\n}\n"],"names":["LocationFormSchema","z","phoneValidation","zipValidation","Form","t","useTranslation","transform","useMaskedTransform","commonMasks","jsxs","Flex","Grid","jsx","TextInputField","SelectField","STATES_ABBR","stateAbbr","CheckboxGroupField"],"mappings":";;;;;;;;;;;;AAOO,MAAMA,IAAqBC,EAAE,OAAO;AAAA,EACzC,aAAaC;AAAA,EACb,SAASD,EAAE,SAAS,IAAI,CAAC;AAAA,EACzB,SAASA,EAAE,OAAA,EAAS,SAAA;AAAA,EACpB,MAAMA,EAAE,SAAS,IAAI,CAAC;AAAA,EACtB,OAAOA,EAAE,SAAS,IAAI,CAAC;AAAA,EACvB,KAAKE;AAAA,EACL,aAAaF,EAAE,MAAMA,EAAE,KAAK,CAAC,kBAAkB,eAAe,CAAC,CAAC,EAAE,SAAA;AACpE,CAAC;AAIM,SAASG,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1CC,IAAYC,EAAmBC,EAAY,SAAS;AAE1D,SACE,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,KAAK,EAAE,MAAM,IAAI,OAAO,EAAA;AAAA,QACxB,qBAAqB,EAAE,MAAM,OAAO,OAAO,CAAC,OAAO,KAAK,EAAA;AAAA,QAExD,UAAA;AAAA,UAAA,gBAAAC;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,YAAU;AAAA,cACV,OAAOT,EAAE,cAAc;AAAA,cACvB,cAAcA,EAAE,qBAAqB;AAAA,YAAA;AAAA,UAAA;AAAA,4BAEtCS,GAAA,EAAe,MAAK,WAAU,OAAOT,EAAE,cAAc,GAAG;AAAA,UACzD,gBAAAQ;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,OAAOT,EAAE,WAAW;AAAA,cACpB,YAAU;AAAA,cACV,cAAcA,EAAE,kBAAkB;AAAA,YAAA;AAAA,UAAA;AAAA,UAEpC,gBAAAQ;AAAA,YAACE;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,SAASC,EAAY,IAAI,CAACC,OAA6C;AAAA,gBACrE,OAAOZ,EAAE,cAAcY,CAAS,IAAI,EAAE,IAAI,UAAU;AAAA,gBACpD,OAAOA;AAAA,cAAA,EACP;AAAA,cACF,OAAOZ,EAAE,YAAY;AAAA,cACrB,aAAaA,EAAE,kBAAkB;AAAA,cACjC,cAAcA,EAAE,mBAAmB;AAAA,cACnC,YAAU;AAAA,YAAA;AAAA,UAAA;AAAA,UAEZ,gBAAAQ;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,YAAU;AAAA,cACV,OAAOT,EAAE,UAAU;AAAA,cACnB,cAAcA,EAAE,iBAAiB;AAAA,YAAA;AAAA,UAAA;AAAA,UAEnC,gBAAAQ;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,YAAU;AAAA,cACV,OAAOT,EAAE,kBAAkB;AAAA,cAC3B,cAAcA,EAAE,mBAAmB;AAAA,cACnC,WAAAE;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,IAEF,gBAAAM;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOb,EAAE,kBAAkB;AAAA,QAC3B,SAAS;AAAA,UACP;AAAA,YACE,OAAO;AAAA,YACP,OAAOA,EAAE,qBAAqB;AAAA,YAC9B,aAAaA,EAAE,2BAA2B;AAAA,UAAA;AAAA,UAE5C;AAAA,YACE,OAAO;AAAA,YACP,OAAOA,EAAE,oBAAoB;AAAA,YAC7B,aAAaA,EAAE,0BAA0B;AAAA,UAAA;AAAA,QAC3C;AAAA,MACF;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
|
|
@@ -10,11 +10,12 @@ import { Actions as I } from "./Actions.js";
|
|
|
10
10
|
import { LocationsFormProvider as M } from "./useLocationForm.js";
|
|
11
11
|
import { Form as _ } from "../../../Common/Form/Form.js";
|
|
12
12
|
import { Flex as w } from "../../../Common/Flex/Flex.js";
|
|
13
|
+
import "react-i18next";
|
|
13
14
|
import "classnames";
|
|
14
|
-
import { componentEvents as a } from "../../../../shared/constants.js";
|
|
15
15
|
import { BaseComponent as z } from "../../../Base/Base.js";
|
|
16
16
|
import { useBase as U } from "../../../Base/useBase.js";
|
|
17
17
|
import { useI18n as j } from "../../../../i18n/I18n.js";
|
|
18
|
+
import { componentEvents as a } from "../../../../shared/constants.js";
|
|
18
19
|
function H(t) {
|
|
19
20
|
const {
|
|
20
21
|
data: { location: e }
|
|
@@ -24,7 +25,7 @@ function H(t) {
|
|
|
24
25
|
function p({
|
|
25
26
|
companyId: t,
|
|
26
27
|
location: e,
|
|
27
|
-
className:
|
|
28
|
+
className: i,
|
|
28
29
|
children: r
|
|
29
30
|
}) {
|
|
30
31
|
j("Company.Locations");
|
|
@@ -37,12 +38,12 @@ function p({
|
|
|
37
38
|
street2: e?.street2 ?? "",
|
|
38
39
|
state: e?.state ?? "",
|
|
39
40
|
zip: e?.zip ?? "",
|
|
40
|
-
addressType: L.filter((
|
|
41
|
+
addressType: L.filter((n) => e?.[n] ?? !1)
|
|
41
42
|
}
|
|
42
43
|
}), v = () => {
|
|
43
44
|
s(a.CANCEL);
|
|
44
|
-
}, C = async (
|
|
45
|
-
await f(
|
|
45
|
+
}, C = async (n) => {
|
|
46
|
+
await f(n, async (F) => {
|
|
46
47
|
const { addressType: c, ...P } = F, u = {
|
|
47
48
|
...P,
|
|
48
49
|
mailingAddress: c?.includes("mailingAddress"),
|
|
@@ -67,7 +68,7 @@ function p({
|
|
|
67
68
|
}
|
|
68
69
|
});
|
|
69
70
|
};
|
|
70
|
-
return /* @__PURE__ */ o("section", { className:
|
|
71
|
+
return /* @__PURE__ */ o("section", { className: i, children: /* @__PURE__ */ o(E, { ...d, control: h, children: /* @__PURE__ */ o(_, { onSubmit: d.handleSubmit(C), children: /* @__PURE__ */ o(
|
|
71
72
|
M,
|
|
72
73
|
{
|
|
73
74
|
value: { handleCancel: v, isPending: A || y },
|
|
@@ -79,16 +80,16 @@ function p({
|
|
|
79
80
|
}
|
|
80
81
|
) }) }) });
|
|
81
82
|
}
|
|
82
|
-
function
|
|
83
|
+
function me({
|
|
83
84
|
companyId: t,
|
|
84
85
|
locationId: e,
|
|
85
|
-
className:
|
|
86
|
+
className: i,
|
|
86
87
|
children: r,
|
|
87
88
|
...s
|
|
88
89
|
}) {
|
|
89
|
-
return /* @__PURE__ */ o(z, { ...s, children: e ? /* @__PURE__ */ o(H, { companyId: t, locationId: e, className:
|
|
90
|
+
return /* @__PURE__ */ o(z, { ...s, children: e ? /* @__PURE__ */ o(H, { companyId: t, locationId: e, className: i, children: r }) : /* @__PURE__ */ o(p, { companyId: t, className: i, children: r }) });
|
|
90
91
|
}
|
|
91
92
|
export {
|
|
92
|
-
|
|
93
|
+
me as LocationForm
|
|
93
94
|
};
|
|
94
95
|
//# sourceMappingURL=LocationForm.js.map
|