@gusto/embedded-react-sdk 0.10.1 → 0.10.3
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 +21 -0
- package/dist/components/Base/Base.d.ts +3 -2
- package/dist/components/Base/Base.js +56 -50
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/InternalError/InternalError.js.map +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBox.js +31 -33
- package/dist/components/Common/UI/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +1 -1
- package/dist/components/Common/UI/Text/TextTypes.d.ts +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccount.d.ts +2 -2
- package/dist/components/Company/BankAccount/BankAccount.js +25 -20
- package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountComponents.js +16 -9
- package/dist/components/Company/BankAccount/BankAccountComponents.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +22 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.d.ts +1 -0
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +30 -30
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.d.ts +4 -0
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/AccountView.js +14 -13
- package/dist/components/Company/BankAccount/BankAccountList/AccountView.js.map +1 -1
- package/dist/components/Company/BankAccount/stateMachine.d.ts +1 -1
- package/dist/components/Company/BankAccount/stateMachine.js +13 -5
- package/dist/components/Company/BankAccount/stateMachine.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentSigner.d.ts +5 -7
- package/dist/components/Company/DocumentSigner/DocumentSigner.js +24 -24
- package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +41 -42
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +6 -5
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +7 -6
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Industry.js +30 -31
- package/dist/components/Company/Industry/Industry.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +34 -37
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +4 -1
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +4 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +70 -71
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +37 -38
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +6 -5
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +57 -58
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/Compensation/Compensation.js +123 -132
- package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
- package/dist/components/Employee/Deductions/Deductions.js +74 -79
- package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/useDeductions.js +6 -5
- package/dist/components/Employee/Deductions/useDeductions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +36 -42
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +57 -58
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -3
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js +95 -97
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/Profile.js +118 -124
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +4 -3
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +4 -4
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.js +59 -60
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +4 -3
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/contexts/ApiProvider/ApiProvider.js +16 -14
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
- package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +5 -0
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +2 -0
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +19 -17
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/LoadingIndicatorProvider/LoadingIndicatorProvider.d.ts +7 -0
- package/dist/contexts/LoadingIndicatorProvider/LoadingIndicatorProvider.js +10 -0
- package/dist/contexts/LoadingIndicatorProvider/LoadingIndicatorProvider.js.map +1 -0
- package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.d.ts +6 -0
- package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.js +11 -0
- package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.js.map +1 -0
- package/dist/shared/constants.d.ts +2 -0
- package/dist/shared/constants.js +10 -9
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { BankAccountList as e } from "./BankAccountList/BankAccountList.js";
|
|
3
|
-
import { BankAccountForm as
|
|
4
|
-
import { BankAccountVerify as
|
|
3
|
+
import { BankAccountForm as i } from "./BankAccountForm/BankAccountForm.js";
|
|
4
|
+
import { BankAccountVerify as m } from "./BankAccountVerify/BankAccountVerify.js";
|
|
5
5
|
import { useFlow as r } from "../../Flow/useFlow.js";
|
|
6
6
|
import { ensureRequired as u } from "../../../helpers/ensureRequired.js";
|
|
7
|
-
function
|
|
7
|
+
function A() {
|
|
8
8
|
const { companyId: n, showVerifiedMessage: o, onEvent: t } = r();
|
|
9
9
|
return /* @__PURE__ */ c(
|
|
10
10
|
e,
|
|
@@ -15,14 +15,21 @@ function y() {
|
|
|
15
15
|
}
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
const { companyId: n, onEvent: o } = r();
|
|
20
|
-
return /* @__PURE__ */ c(
|
|
18
|
+
function y() {
|
|
19
|
+
const { companyId: n, onEvent: o, bankAccount: t } = r();
|
|
20
|
+
return /* @__PURE__ */ c(
|
|
21
|
+
i,
|
|
22
|
+
{
|
|
23
|
+
companyId: u(n),
|
|
24
|
+
onEvent: o,
|
|
25
|
+
isEditing: !!t
|
|
26
|
+
}
|
|
27
|
+
);
|
|
21
28
|
}
|
|
22
29
|
function I() {
|
|
23
30
|
const { bankAccount: n, companyId: o, onEvent: t } = r();
|
|
24
31
|
return n ? /* @__PURE__ */ c(
|
|
25
|
-
|
|
32
|
+
m,
|
|
26
33
|
{
|
|
27
34
|
companyId: u(o),
|
|
28
35
|
bankAccountId: n.uuid,
|
|
@@ -31,8 +38,8 @@ function I() {
|
|
|
31
38
|
) : null;
|
|
32
39
|
}
|
|
33
40
|
export {
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
y as BankAccountFormContextual,
|
|
42
|
+
A as BankAccountListContextual,
|
|
36
43
|
I as BankAccountVerifyContextual
|
|
37
44
|
};
|
|
38
45
|
//# sourceMappingURL=BankAccountComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BankAccountComponents.js","sources":["../../../../src/components/Company/BankAccount/BankAccountComponents.tsx"],"sourcesContent":["import type { CompanyBankAccount } from '@gusto/embedded-api/models/components/companybankaccount'\nimport { BankAccountList } from './BankAccountList/BankAccountList'\nimport { BankAccountForm } from './BankAccountForm/BankAccountForm'\nimport { BankAccountVerify } from './BankAccountVerify/BankAccountVerify'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { componentEvents } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\nexport type EventPayloads = {\n [componentEvents.COMPANY_BANK_ACCOUNT_CREATED]: CompanyBankAccount\n [componentEvents.COMPANY_BANK_ACCOUNT_VERIFIED]: CompanyBankAccount\n [componentEvents.COMPANY_BANK_ACCOUNT_CHANGE]: undefined\n}\n\nexport interface BankAccountContextInterface extends FlowContextInterface {\n companyId: string\n bankAccount: CompanyBankAccount | null\n showVerifiedMessage?: boolean\n}\n\nexport function BankAccountListContextual() {\n const { companyId, showVerifiedMessage, onEvent } = useFlow<BankAccountContextInterface>()\n return (\n <BankAccountList\n onEvent={onEvent}\n companyId={ensureRequired(companyId)}\n showVerifiedMessage={showVerifiedMessage}\n />\n )\n}\nexport function BankAccountFormContextual() {\n const { companyId, onEvent } = useFlow<BankAccountContextInterface>()\n return <BankAccountForm
|
|
1
|
+
{"version":3,"file":"BankAccountComponents.js","sources":["../../../../src/components/Company/BankAccount/BankAccountComponents.tsx"],"sourcesContent":["import type { CompanyBankAccount } from '@gusto/embedded-api/models/components/companybankaccount'\nimport { BankAccountList } from './BankAccountList/BankAccountList'\nimport { BankAccountForm } from './BankAccountForm/BankAccountForm'\nimport { BankAccountVerify } from './BankAccountVerify/BankAccountVerify'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { componentEvents } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\nexport type EventPayloads = {\n [componentEvents.COMPANY_BANK_ACCOUNT_CREATED]: CompanyBankAccount\n [componentEvents.COMPANY_BANK_ACCOUNT_VERIFIED]: CompanyBankAccount\n [componentEvents.COMPANY_BANK_ACCOUNT_CHANGE]: undefined\n}\n\nexport interface BankAccountContextInterface extends FlowContextInterface {\n companyId: string\n bankAccount: CompanyBankAccount | null\n showVerifiedMessage?: boolean\n}\n\nexport function BankAccountListContextual() {\n const { companyId, showVerifiedMessage, onEvent } = useFlow<BankAccountContextInterface>()\n return (\n <BankAccountList\n onEvent={onEvent}\n companyId={ensureRequired(companyId)}\n showVerifiedMessage={showVerifiedMessage}\n />\n )\n}\nexport function BankAccountFormContextual() {\n const { companyId, onEvent, bankAccount } = useFlow<BankAccountContextInterface>()\n return (\n <BankAccountForm\n companyId={ensureRequired(companyId)}\n onEvent={onEvent}\n isEditing={!!bankAccount}\n />\n )\n}\nexport function BankAccountVerifyContextual() {\n const { bankAccount, companyId, onEvent } = useFlow<BankAccountContextInterface>()\n if (!bankAccount) return null\n return (\n <BankAccountVerify\n companyId={ensureRequired(companyId)}\n bankAccountId={bankAccount.uuid}\n onEvent={onEvent}\n />\n )\n}\n"],"names":["BankAccountListContextual","companyId","showVerifiedMessage","onEvent","useFlow","jsx","BankAccountList","ensureRequired","BankAccountFormContextual","bankAccount","BankAccountForm","BankAccountVerifyContextual","BankAccountVerify"],"mappings":";;;;;;AAoBO,SAASA,IAA4B;AAC1C,QAAM,EAAE,WAAAC,GAAW,qBAAAC,GAAqB,SAAAC,EAAA,IAAYC,EAAqC;AAEvF,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAAAH;AAAA,MACA,WAAWI,EAAeN,CAAS;AAAA,MACnC,qBAAAC;AAAA,IAAA;AAAA,EACF;AAEJ;AACO,SAASM,IAA4B;AAC1C,QAAM,EAAE,WAAAP,GAAW,SAAAE,GAAS,aAAAM,EAAA,IAAgBL,EAAqC;AAE/E,SAAA,gBAAAC;AAAA,IAACK;AAAA,IAAA;AAAA,MACC,WAAWH,EAAeN,CAAS;AAAA,MACnC,SAAAE;AAAA,MACA,WAAW,CAAC,CAACM;AAAA,IAAA;AAAA,EACf;AAEJ;AACO,SAASE,IAA8B;AAC5C,QAAM,EAAE,aAAAF,GAAa,WAAAR,GAAW,SAAAE,EAAA,IAAYC,EAAqC;AAC7E,SAACK,IAEH,gBAAAJ;AAAA,IAACO;AAAA,IAAA;AAAA,MACC,WAAWL,EAAeN,CAAS;AAAA,MACnC,eAAeQ,EAAY;AAAA,MAC3B,SAAAN;AAAA,IAAA;AAAA,EACF,IANuB;AAQ3B;"}
|
|
@@ -1,13 +1,27 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useTranslation as
|
|
1
|
+
import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as s } from "react-i18next";
|
|
3
3
|
import { useBankAccountForm as m } from "./context.js";
|
|
4
|
-
import { ActionsLayout as
|
|
5
|
-
import { useComponentContext as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import { ActionsLayout as a } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
5
|
+
import { useComponentContext as u } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
+
import { componentEvents as p } from "../../../../shared/constants.js";
|
|
7
|
+
function B() {
|
|
8
|
+
const { t } = s("Company.BankAccount"), { isPending: i, isEditing: r, onEvent: c } = m(), n = u();
|
|
9
|
+
return /* @__PURE__ */ e(a, { children: [
|
|
10
|
+
r && /* @__PURE__ */ o(
|
|
11
|
+
n.Button,
|
|
12
|
+
{
|
|
13
|
+
type: "button",
|
|
14
|
+
variant: "secondary",
|
|
15
|
+
onClick: () => {
|
|
16
|
+
c(p.COMPANY_BANK_ACCOUNT_CANCEL);
|
|
17
|
+
},
|
|
18
|
+
children: t("cancelCta")
|
|
19
|
+
}
|
|
20
|
+
),
|
|
21
|
+
/* @__PURE__ */ o(n.Button, { type: "submit", isLoading: i, "data-testid": "bank-account-submit", children: t("continueCta") })
|
|
22
|
+
] });
|
|
9
23
|
}
|
|
10
24
|
export {
|
|
11
|
-
|
|
25
|
+
B as Actions
|
|
12
26
|
};
|
|
13
27
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useBankAccountForm } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.BankAccount')\n const { isPending } = useBankAccountForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending} data-testid=\"bank-account-submit\">\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useBankAccountForm } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { componentEvents } from '@/shared/constants'\n\nexport function Actions() {\n const { t } = useTranslation('Company.BankAccount')\n const { isPending, isEditing, onEvent } = useBankAccountForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {isEditing && (\n <Components.Button\n type=\"button\"\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.COMPANY_BANK_ACCOUNT_CANCEL)\n }}\n >\n {t('cancelCta')}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isPending} data-testid=\"bank-account-submit\">\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","isEditing","onEvent","useBankAccountForm","Components","useComponentContext","ActionsLayout","jsx","componentEvents"],"mappings":";;;;;;AAMO,SAASA,IAAU;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,WAAAC,GAAW,WAAAC,GAAW,SAAAC,EAAA,IAAYC,EAAmB,GACvDC,IAAaC,EAAoB;AAEvC,2BACGC,GACE,EAAA,UAAA;AAAA,IACCL,KAAA,gBAAAM;AAAA,MAACH,EAAW;AAAA,MAAX;AAAA,QACC,MAAK;AAAA,QACL,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAF,EAAQM,EAAgB,2BAA2B;AAAA,QACrD;AAAA,QAEC,YAAE,WAAW;AAAA,MAAA;AAAA,IAChB;AAAA,IAED,gBAAAD,EAAAH,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWJ,GAAW,eAAY,uBAChE,UAAE,EAAA,aAAa,EAClB,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseComponentInterface, CommonComponentInterface } from '../../../Base/Base';
|
|
2
2
|
interface BankAccountFormProps extends CommonComponentInterface {
|
|
3
3
|
companyId: string;
|
|
4
|
+
isEditing?: boolean;
|
|
4
5
|
}
|
|
5
6
|
export declare function BankAccountForm(props: BankAccountFormProps & BaseComponentInterface): import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
export declare namespace BankAccountForm {
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { useBankAccountsCreateMutation as
|
|
3
|
-
import { useForm as
|
|
4
|
-
import { zodResolver as
|
|
5
|
-
import { Head as
|
|
6
|
-
import { BankAccountFormSchema as
|
|
7
|
-
import { Actions as
|
|
8
|
-
import { BankAccountFormProvider as
|
|
9
|
-
import { Form as
|
|
10
|
-
import { BaseComponent as
|
|
11
|
-
import { useBase as
|
|
12
|
-
import { useI18n as
|
|
13
|
-
import { Flex as
|
|
14
|
-
import { componentEvents as
|
|
1
|
+
import { jsx as o, jsxs as C, Fragment as k } from "react/jsx-runtime";
|
|
2
|
+
import { useBankAccountsCreateMutation as b } from "@gusto/embedded-api/react-query/bankAccountsCreate";
|
|
3
|
+
import { useForm as g, FormProvider as v } from "react-hook-form";
|
|
4
|
+
import { zodResolver as y } from "@hookform/resolvers/zod";
|
|
5
|
+
import { Head as c } from "./Head.js";
|
|
6
|
+
import { BankAccountFormSchema as P, Form as i } from "./Form.js";
|
|
7
|
+
import { Actions as a } from "./Actions.js";
|
|
8
|
+
import { BankAccountFormProvider as x } from "./context.js";
|
|
9
|
+
import { Form as N } from "../../../Common/Form/Form.js";
|
|
10
|
+
import { BaseComponent as S } from "../../../Base/Base.js";
|
|
11
|
+
import { useBase as E } from "../../../Base/useBase.js";
|
|
12
|
+
import { useI18n as H } from "../../../../i18n/I18n.js";
|
|
13
|
+
import { Flex as R } from "../../../Common/Flex/Flex.js";
|
|
14
|
+
import { componentEvents as T } from "../../../../shared/constants.js";
|
|
15
15
|
function r(n) {
|
|
16
|
-
return /* @__PURE__ */ o(
|
|
16
|
+
return /* @__PURE__ */ o(S, { ...n, children: /* @__PURE__ */ o(_, { ...n, children: n.children }) });
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
const { onEvent:
|
|
21
|
-
resolver:
|
|
18
|
+
function _({ companyId: n, className: s, children: t, isEditing: u = !1 }) {
|
|
19
|
+
H("Company.BankAccount");
|
|
20
|
+
const { onEvent: e, baseSubmitHandler: d } = E(), { mutateAsync: l, isPending: f } = b(), { control: p, ...m } = g({
|
|
21
|
+
resolver: y(P),
|
|
22
22
|
defaultValues: { accountNumber: "", routingNumber: "" }
|
|
23
|
-
}),
|
|
24
|
-
await
|
|
25
|
-
const { companyBankAccount:
|
|
23
|
+
}), A = async (h) => {
|
|
24
|
+
await d(h, async (B) => {
|
|
25
|
+
const { companyBankAccount: F } = await l({
|
|
26
26
|
//Account type is always checking for company bank accounts
|
|
27
|
-
request: { companyId: n, requestBody: { ...
|
|
27
|
+
request: { companyId: n, requestBody: { ...B, accountType: "Checking" } }
|
|
28
28
|
});
|
|
29
|
-
|
|
29
|
+
e(T.COMPANY_BANK_ACCOUNT_CREATED, F);
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
|
-
return /* @__PURE__ */ o("section", { className:
|
|
33
|
-
/* @__PURE__ */ o(m, {}),
|
|
32
|
+
return /* @__PURE__ */ o("section", { className: s, children: /* @__PURE__ */ o(v, { ...m, control: p, children: /* @__PURE__ */ o(N, { onSubmit: m.handleSubmit(A), children: /* @__PURE__ */ o(x, { value: { isPending: f, isEditing: u, onEvent: e }, children: /* @__PURE__ */ o(R, { flexDirection: "column", gap: 32, children: t || /* @__PURE__ */ C(k, { children: [
|
|
34
33
|
/* @__PURE__ */ o(c, {}),
|
|
35
|
-
/* @__PURE__ */ o(i, {})
|
|
34
|
+
/* @__PURE__ */ o(i, {}),
|
|
35
|
+
/* @__PURE__ */ o(a, {})
|
|
36
36
|
] }) }) }) }) }) });
|
|
37
37
|
}
|
|
38
|
-
r.Head =
|
|
39
|
-
r.Form =
|
|
40
|
-
r.Actions =
|
|
38
|
+
r.Head = c;
|
|
39
|
+
r.Form = i;
|
|
40
|
+
r.Actions = a;
|
|
41
41
|
export {
|
|
42
42
|
r as BankAccountForm
|
|
43
43
|
};
|
|
@@ -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 { 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":";;;;;;;;;;;;;;
|
|
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 isEditing?: boolean\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, isEditing = false }: 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\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, isEditing, onEvent }}>\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","isEditing","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":";;;;;;;;;;;;;;AAqBO,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,GAAU,WAAAC,IAAY,MAA+B;AACzF,EAAAC,EAAQ,qBAAqB;AAC7B,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GAEzC,EAAE,aAAaC,GAAmB,WAAWC,EAAA,IACjDC,EAA8B,GAE1B,EAAE,SAAAC,GAAS,GAAGC,EAAA,IAAYC,EAA+B;AAAA,IAC7D,UAAUC,EAAYC,CAAqB;AAAA,IAC3C,eAAe,EAAE,eAAe,IAAI,eAAe,GAAG;AAAA,EAAA,CACvD,GAEKC,IAAW,OAAOC,MAAgC;AAChD,UAAAX,EAAkBW,GAAM,OAAMC,MAAW;AAC7C,YAAM,EAAE,oBAAAC,MAAuB,MAAMX,EAAkB;AAAA;AAAA,QAErD,SAAS,EAAE,WAAAR,GAAW,aAAa,EAAE,GAAGkB,GAAS,aAAa,WAAa,EAAA;AAAA,MAAA,CAC5E;AAEO,MAAAb,EAAAe,EAAgB,8BAA8BD,CAAkB;AAAA,IAAA,CACzE;AAAA,EACH;AACA,SACG,gBAAAtB,EAAA,WAAA,EAAQ,WAAAI,GACP,UAAA,gBAAAJ,EAACwB,KAAc,GAAGT,GAAS,SAAAD,GACzB,UAAA,gBAAAd,EAACyB,GAAS,EAAA,UAAUV,EAAQ,aAAaI,CAAQ,GAC/C,UAAA,gBAAAnB,EAAC0B,GAAwB,EAAA,OAAO,EAAE,WAAWd,GAAiB,WAAAN,GAAW,SAAAE,KACvE,UAAA,gBAAAR,EAAC2B,GAAK,EAAA,eAAc,UAAS,KAAK,IAC/B,UAAAtB,KAIG,gBAAAuB,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAA7B,EAAC8B,GAAK,EAAA;AAAA,sBACLC,GAAK,EAAA;AAAA,sBACLC,GAAQ,CAAA,CAAA;AAAA,EAAA,EAAA,CACX,EAEJ,CAAA,EAAA,CACF,EACF,CAAA,EAAA,CACF,EACF,CAAA;AAEJ;AACAlC,EAAgB,OAAOgC;AACvBhC,EAAgB,OAAOiC;AACvBjC,EAAgB,UAAUkC;"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { OnEventType } from '../../../Base/useBase';
|
|
2
|
+
import { EventType } from '../../../../shared/constants';
|
|
1
3
|
type BankAccountFormContextType = {
|
|
2
4
|
isPending: boolean;
|
|
5
|
+
isEditing: boolean;
|
|
6
|
+
onEvent: OnEventType<EventType, unknown>;
|
|
3
7
|
};
|
|
4
8
|
declare const useBankAccountForm: () => BankAccountFormContextType, BankAccountFormProvider: import('react').Provider<BankAccountFormContextType | null>;
|
|
5
9
|
export { useBankAccountForm, BankAccountFormProvider };
|
|
@@ -5,14 +5,15 @@ import "react-i18next";
|
|
|
5
5
|
import "@gusto/embedded-api/models/errors/apierror";
|
|
6
6
|
import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
7
7
|
import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
8
|
+
import "@tanstack/react-query";
|
|
8
9
|
import "../../../Base/useBase.js";
|
|
9
10
|
import "../../../../shared/constants.js";
|
|
10
11
|
import "dompurify";
|
|
11
12
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
13
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
13
|
-
const [
|
|
14
|
+
const [B, C] = o("BankAccountContext");
|
|
14
15
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
C as BankAccountFormProvider,
|
|
17
|
+
B as useBankAccountForm
|
|
17
18
|
};
|
|
18
19
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountForm/context.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\n\ntype BankAccountFormContextType = {\n isPending: boolean\n}\n\nconst [useBankAccountForm, BankAccountFormProvider] =\n createCompoundContext<BankAccountFormContextType>('BankAccountContext')\n\nexport { useBankAccountForm, BankAccountFormProvider }\n"],"names":["useBankAccountForm","BankAccountFormProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountForm/context.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\nimport { type OnEventType } from '@/components/Base/useBase'\nimport { type EventType } from '@/shared/constants'\n\ntype BankAccountFormContextType = {\n isPending: boolean\n isEditing: boolean\n onEvent: OnEventType<EventType, unknown>\n}\n\nconst [useBankAccountForm, BankAccountFormProvider] =\n createCompoundContext<BankAccountFormContextType>('BankAccountContext')\n\nexport { useBankAccountForm, BankAccountFormProvider }\n"],"names":["useBankAccountForm","BankAccountFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAoBC,CAAuB,IAChDC,EAAkD,oBAAoB;"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { useBankAccount as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/* @__PURE__ */ n("
|
|
1
|
+
import { jsxs as t, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as c } from "react-i18next";
|
|
3
|
+
import { useBankAccount as i } from "./context.js";
|
|
4
|
+
import { useComponentContext as d } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
5
|
+
function s() {
|
|
6
|
+
const { bankAccount: r } = i(), { t: o } = c("Company.BankAccount"), e = d();
|
|
7
|
+
return /* @__PURE__ */ t("dl", { children: [
|
|
8
|
+
/* @__PURE__ */ t("div", { children: [
|
|
9
|
+
/* @__PURE__ */ n("dt", { children: /* @__PURE__ */ n(e.Text, { children: o("routingNumberLabel") }) }),
|
|
10
|
+
/* @__PURE__ */ n("dd", { children: /* @__PURE__ */ n(e.Text, { children: r?.routingNumber }) })
|
|
10
11
|
] }),
|
|
11
|
-
/* @__PURE__ */
|
|
12
|
-
/* @__PURE__ */ n("dt", { children: o("accountNumberLabel") }),
|
|
13
|
-
/* @__PURE__ */ n("dd", { children:
|
|
12
|
+
/* @__PURE__ */ t("div", { children: [
|
|
13
|
+
/* @__PURE__ */ n("dt", { children: /* @__PURE__ */ n(e.Text, { children: o("accountNumberLabel") }) }),
|
|
14
|
+
/* @__PURE__ */ n("dd", { children: /* @__PURE__ */ n(e.Text, { children: r?.hiddenAccountNumber }) })
|
|
14
15
|
] })
|
|
15
16
|
] });
|
|
16
17
|
}
|
|
17
18
|
export {
|
|
18
|
-
|
|
19
|
+
s as AccountView
|
|
19
20
|
};
|
|
20
21
|
//# sourceMappingURL=AccountView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountView.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountList/AccountView.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useBankAccount } from './context'\n\nexport function AccountView() {\n const { bankAccount } = useBankAccount()\n const { t } = useTranslation('Company.BankAccount')\n\n return (\n <dl>\n <div>\n <dt>{t('routingNumberLabel')}</dt>\n <dd>{bankAccount?.routingNumber}</dd>\n </div>\n <div>\n <dt>{t('accountNumberLabel')}</dt>\n <dd>{bankAccount?.hiddenAccountNumber}</dd>\n </div>\n </dl>\n )\n}\n"],"names":["AccountView","bankAccount","useBankAccount","t","useTranslation","jsxs","jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AccountView.js","sources":["../../../../../src/components/Company/BankAccount/BankAccountList/AccountView.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useBankAccount } from './context'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function AccountView() {\n const { bankAccount } = useBankAccount()\n const { t } = useTranslation('Company.BankAccount')\n const Components = useComponentContext()\n\n return (\n <dl>\n <div>\n <dt>\n <Components.Text>{t('routingNumberLabel')}</Components.Text>\n </dt>\n <dd>\n <Components.Text>{bankAccount?.routingNumber}</Components.Text>\n </dd>\n </div>\n <div>\n <dt>\n <Components.Text>{t('accountNumberLabel')}</Components.Text>\n </dt>\n <dd>\n <Components.Text>{bankAccount?.hiddenAccountNumber}</Components.Text>\n </dd>\n </div>\n </dl>\n )\n}\n"],"names":["AccountView","bankAccount","useBankAccount","t","useTranslation","Components","useComponentContext","jsxs","jsx"],"mappings":";;;;AAIO,SAASA,IAAc;AACtB,QAAA,EAAE,aAAAC,EAAY,IAAIC,EAAe,GACjC,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAoB;AAEvC,2BACG,MACC,EAAA,UAAA;AAAA,IAAA,gBAAAC,EAAC,OACC,EAAA,UAAA;AAAA,MAAC,gBAAAC,EAAA,MAAA,EACC,4BAACH,EAAW,MAAX,EAAiB,UAAEF,EAAA,oBAAoB,GAAE,EAC5C,CAAA;AAAA,MACA,gBAAAK,EAAC,QACC,UAAC,gBAAAA,EAAAH,EAAW,MAAX,EAAiB,UAAAJ,GAAa,cAAc,CAAA,EAC/C,CAAA;AAAA,IAAA,GACF;AAAA,sBACC,OACC,EAAA,UAAA;AAAA,MAAC,gBAAAO,EAAA,MAAA,EACC,4BAACH,EAAW,MAAX,EAAiB,UAAEF,EAAA,oBAAoB,GAAE,EAC5C,CAAA;AAAA,MACA,gBAAAK,EAAC,QACC,UAAC,gBAAAA,EAAAH,EAAW,MAAX,EAAiB,UAAAJ,GAAa,oBAAoB,CAAA,EACrD,CAAA;AAAA,IAAA,EACF,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const bankAccountStateMachine: {
|
|
2
2
|
viewBankAccount: import('robot3').MachineState<"company/bankAccount/change" | "company/bankAccount/verify" | "company/bankAccount/done">;
|
|
3
|
-
addBankAccount: import('robot3').MachineState<"company/bankAccount/created">;
|
|
3
|
+
addBankAccount: import('robot3').MachineState<"company/bankAccount/cancel" | "company/bankAccount/created">;
|
|
4
4
|
verifyBankAccount: import('robot3').MachineState<"company/bankAccount/verified" | "CANCEL">;
|
|
5
5
|
done: import('robot3').MachineState<string>;
|
|
6
6
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { state as a, transition as o, reduce as e } from "robot3";
|
|
2
|
-
import { BankAccountListContextual as A, BankAccountFormContextual as
|
|
2
|
+
import { BankAccountListContextual as A, BankAccountFormContextual as C, BankAccountVerifyContextual as i } from "./BankAccountComponents.js";
|
|
3
3
|
import { componentEvents as t } from "../../../shared/constants.js";
|
|
4
|
-
const
|
|
4
|
+
const B = {
|
|
5
5
|
viewBankAccount: a(
|
|
6
6
|
o(
|
|
7
7
|
t.COMPANY_BANK_ACCOUNT_CHANGE,
|
|
8
8
|
"addBankAccount",
|
|
9
9
|
e((n) => ({
|
|
10
10
|
...n,
|
|
11
|
-
component:
|
|
11
|
+
component: C,
|
|
12
12
|
showVerifiedMessage: !1
|
|
13
13
|
}))
|
|
14
14
|
),
|
|
@@ -17,7 +17,7 @@ const s = {
|
|
|
17
17
|
"verifyBankAccount",
|
|
18
18
|
e((n) => ({
|
|
19
19
|
...n,
|
|
20
|
-
component:
|
|
20
|
+
component: i,
|
|
21
21
|
showVerifiedMessage: !1
|
|
22
22
|
}))
|
|
23
23
|
),
|
|
@@ -34,6 +34,14 @@ const s = {
|
|
|
34
34
|
bankAccount: c.payload
|
|
35
35
|
})
|
|
36
36
|
)
|
|
37
|
+
),
|
|
38
|
+
o(
|
|
39
|
+
t.COMPANY_BANK_ACCOUNT_CANCEL,
|
|
40
|
+
"viewBankAccount",
|
|
41
|
+
e((n) => ({
|
|
42
|
+
...n,
|
|
43
|
+
component: A
|
|
44
|
+
}))
|
|
37
45
|
)
|
|
38
46
|
),
|
|
39
47
|
verifyBankAccount: a(
|
|
@@ -61,6 +69,6 @@ const s = {
|
|
|
61
69
|
done: a()
|
|
62
70
|
};
|
|
63
71
|
export {
|
|
64
|
-
|
|
72
|
+
B as bankAccountStateMachine
|
|
65
73
|
};
|
|
66
74
|
//# sourceMappingURL=stateMachine.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stateMachine.js","sources":["../../../../src/components/Company/BankAccount/stateMachine.ts"],"sourcesContent":["import { state, transition, reduce, state as final } from 'robot3'\nimport type { BankAccountContextInterface, EventPayloads } from './BankAccountComponents'\nimport {\n BankAccountFormContextual,\n BankAccountVerifyContextual,\n BankAccountListContextual,\n} from './BankAccountComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineEventType } from '@/types/Helpers'\n\nexport const bankAccountStateMachine = {\n viewBankAccount: state(\n transition(\n componentEvents.COMPANY_BANK_ACCOUNT_CHANGE,\n 'addBankAccount',\n reduce((ctx: BankAccountContextInterface) => ({\n ...ctx,\n component: BankAccountFormContextual,\n showVerifiedMessage: false,\n })),\n ),\n transition(\n componentEvents.COMPANY_BANK_ACCOUNT_VERIFY,\n 'verifyBankAccount',\n reduce((ctx: BankAccountContextInterface) => ({\n ...ctx,\n component: BankAccountVerifyContextual,\n showVerifiedMessage: false,\n })),\n ),\n transition(componentEvents.COMPANY_BANK_ACCOUNT_DONE, 'done'),\n ),\n addBankAccount: state(\n transition(\n componentEvents.COMPANY_BANK_ACCOUNT_CREATED,\n 'viewBankAccount',\n reduce(\n (\n ctx: BankAccountContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.COMPANY_BANK_ACCOUNT_CREATED>,\n ) => ({\n ...ctx,\n component: BankAccountListContextual,\n bankAccount: ev.payload,\n }),\n ),\n ),\n ),\n verifyBankAccount: state(\n transition(\n componentEvents.COMPANY_BANK_ACCOUNT_VERIFIED,\n 'viewBankAccount',\n reduce(\n (\n ctx: BankAccountContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.COMPANY_BANK_ACCOUNT_VERIFIED>,\n ): BankAccountContextInterface => ({\n ...ctx,\n component: BankAccountListContextual,\n bankAccount: ev.payload,\n showVerifiedMessage: ev.payload.verificationStatus === 'verified',\n }),\n ),\n ),\n transition(\n componentEvents.CANCEL,\n 'viewBankAccount',\n reduce((ctx: BankAccountContextInterface) => ({\n ...ctx,\n component: BankAccountListContextual,\n })),\n ),\n ),\n done: final(),\n}\n"],"names":["bankAccountStateMachine","state","transition","componentEvents","reduce","ctx","BankAccountFormContextual","BankAccountVerifyContextual","ev","BankAccountListContextual","final"],"mappings":";;;AAUO,MAAMA,IAA0B;AAAA,EACrC,iBAAiBC;AAAA,IACfC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACC,OAAsC;AAAA,QAC5C,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,qBAAqB;AAAA,MAAA,EACrB;AAAA,IACJ;AAAA,IACAJ;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACC,OAAsC;AAAA,QAC5C,GAAGA;AAAA,QACH,WAAWE;AAAA,QACX,qBAAqB;AAAA,MAAA,EACrB;AAAA,IACJ;AAAA,IACAL,EAAWC,EAAgB,2BAA2B,MAAM;AAAA,EAC9D;AAAA,EACA,gBAAgBF;AAAA,IACdC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CACEC,GACAG,OACI;AAAA,UACJ,GAAGH;AAAA,UACH,WAAWI;AAAA,UACX,aAAaD,EAAG;AAAA,QAClB;AAAA,MAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"stateMachine.js","sources":["../../../../src/components/Company/BankAccount/stateMachine.ts"],"sourcesContent":["import { state, transition, reduce, state as final } from 'robot3'\nimport type { BankAccountContextInterface, EventPayloads } from './BankAccountComponents'\nimport {\n BankAccountFormContextual,\n BankAccountVerifyContextual,\n BankAccountListContextual,\n} from './BankAccountComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineEventType } from '@/types/Helpers'\n\nexport const bankAccountStateMachine = {\n viewBankAccount: state(\n transition(\n componentEvents.COMPANY_BANK_ACCOUNT_CHANGE,\n 'addBankAccount',\n reduce((ctx: BankAccountContextInterface) => ({\n ...ctx,\n component: BankAccountFormContextual,\n showVerifiedMessage: false,\n })),\n ),\n transition(\n componentEvents.COMPANY_BANK_ACCOUNT_VERIFY,\n 'verifyBankAccount',\n reduce((ctx: BankAccountContextInterface) => ({\n ...ctx,\n component: BankAccountVerifyContextual,\n showVerifiedMessage: false,\n })),\n ),\n transition(componentEvents.COMPANY_BANK_ACCOUNT_DONE, 'done'),\n ),\n addBankAccount: state(\n transition(\n componentEvents.COMPANY_BANK_ACCOUNT_CREATED,\n 'viewBankAccount',\n reduce(\n (\n ctx: BankAccountContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.COMPANY_BANK_ACCOUNT_CREATED>,\n ) => ({\n ...ctx,\n component: BankAccountListContextual,\n bankAccount: ev.payload,\n }),\n ),\n ),\n transition(\n componentEvents.COMPANY_BANK_ACCOUNT_CANCEL,\n 'viewBankAccount',\n reduce((ctx: BankAccountContextInterface) => ({\n ...ctx,\n component: BankAccountListContextual,\n })),\n ),\n ),\n verifyBankAccount: state(\n transition(\n componentEvents.COMPANY_BANK_ACCOUNT_VERIFIED,\n 'viewBankAccount',\n reduce(\n (\n ctx: BankAccountContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.COMPANY_BANK_ACCOUNT_VERIFIED>,\n ): BankAccountContextInterface => ({\n ...ctx,\n component: BankAccountListContextual,\n bankAccount: ev.payload,\n showVerifiedMessage: ev.payload.verificationStatus === 'verified',\n }),\n ),\n ),\n transition(\n componentEvents.CANCEL,\n 'viewBankAccount',\n reduce((ctx: BankAccountContextInterface) => ({\n ...ctx,\n component: BankAccountListContextual,\n })),\n ),\n ),\n done: final(),\n}\n"],"names":["bankAccountStateMachine","state","transition","componentEvents","reduce","ctx","BankAccountFormContextual","BankAccountVerifyContextual","ev","BankAccountListContextual","final"],"mappings":";;;AAUO,MAAMA,IAA0B;AAAA,EACrC,iBAAiBC;AAAA,IACfC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACC,OAAsC;AAAA,QAC5C,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,qBAAqB;AAAA,MAAA,EACrB;AAAA,IACJ;AAAA,IACAJ;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACC,OAAsC;AAAA,QAC5C,GAAGA;AAAA,QACH,WAAWE;AAAA,QACX,qBAAqB;AAAA,MAAA,EACrB;AAAA,IACJ;AAAA,IACAL,EAAWC,EAAgB,2BAA2B,MAAM;AAAA,EAC9D;AAAA,EACA,gBAAgBF;AAAA,IACdC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CACEC,GACAG,OACI;AAAA,UACJ,GAAGH;AAAA,UACH,WAAWI;AAAA,UACX,aAAaD,EAAG;AAAA,QAClB;AAAA,MAAA;AAAA,IAEJ;AAAA,IACAN;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACC,OAAsC;AAAA,QAC5C,GAAGA;AAAA,QACH,WAAWI;AAAA,MAAA,EACX;AAAA,IAAA;AAAA,EAEN;AAAA,EACA,mBAAmBR;AAAA,IACjBC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CACEC,GACAG,OACiC;AAAA,UACjC,GAAGH;AAAA,UACH,WAAWI;AAAA,UACX,aAAaD,EAAG;AAAA,UAChB,qBAAqBA,EAAG,QAAQ,uBAAuB;AAAA,QACzD;AAAA,MAAA;AAAA,IAEJ;AAAA,IACAN;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACC,OAAsC;AAAA,QAC5C,GAAGA;AAAA,QACH,WAAWI;AAAA,MAAA,EACX;AAAA,IAAA;AAAA,EAEN;AAAA,EACA,MAAMC,EAAM;AACd;"}
|
|
@@ -5,16 +5,17 @@ import "react-i18next";
|
|
|
5
5
|
import "@gusto/embedded-api/models/errors/apierror";
|
|
6
6
|
import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
7
7
|
import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
8
|
+
import "@tanstack/react-query";
|
|
8
9
|
import "../../../Base/useBase.js";
|
|
9
10
|
import "../../../../shared/constants.js";
|
|
10
11
|
import "dompurify";
|
|
11
12
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
13
|
import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
|
|
13
|
-
const [
|
|
14
|
+
const [L, a] = t(
|
|
14
15
|
"CompanyDocumentListContext"
|
|
15
16
|
);
|
|
16
17
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
a as DocumentListProvider,
|
|
19
|
+
L as useDocumentList
|
|
19
20
|
};
|
|
20
21
|
//# sourceMappingURL=useDocumentList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDocumentList.js","sources":["../../../../../src/components/Company/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import { type Signatory } from '@gusto/embedded-api/models/components/signatory'\nimport { type Form as FormSchema } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n companyForms: FormSchema[]\n documentListError: Error | null\n handleRequestFormToSign: (form: FormSchema) => void\n handleChangeSignatory: () => void\n handleContinue: () => void\n isSelfSignatory: boolean\n signatory?: Signatory\n}\n\nconst [useDocumentList, DocumentListProvider] = createCompoundContext<DocumentListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDocumentList.js","sources":["../../../../../src/components/Company/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import { type Signatory } from '@gusto/embedded-api/models/components/signatory'\nimport { type Form as FormSchema } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n companyForms: FormSchema[]\n documentListError: Error | null\n handleRequestFormToSign: (form: FormSchema) => void\n handleChangeSignatory: () => void\n handleContinue: () => void\n isSelfSignatory: boolean\n signatory?: Signatory\n}\n\nconst [useDocumentList, DocumentListProvider] = createCompoundContext<DocumentListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAcM,MAAA,CAACA,GAAiBC,CAAoB,IAAIC;AAAA,EAC9C;AACF;"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { DocumentList } from './documentSignerStateMachine';
|
|
2
|
-
import { SignatureForm } from './SignatureForm';
|
|
3
1
|
import { BaseComponentInterface } from '../../Base';
|
|
4
2
|
export interface DocumentSignerProps extends BaseComponentInterface<'Company.DocumentList'> {
|
|
5
3
|
companyId: string;
|
|
6
4
|
signatoryId?: string;
|
|
7
5
|
}
|
|
8
|
-
export declare
|
|
9
|
-
|
|
10
|
-
DocumentList: typeof DocumentList;
|
|
11
|
-
SignatureForm: typeof SignatureForm;
|
|
12
|
-
}
|
|
6
|
+
export declare function DocumentSigner(props: DocumentSignerProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare namespace DocumentSigner {
|
|
8
|
+
var DocumentList: typeof import("./documentSignerStateMachine").DocumentList;
|
|
9
|
+
var SignatureForm: typeof import("./SignatureForm").SignatureForm;
|
|
10
|
+
}
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { createMachine as p } from "robot3";
|
|
3
3
|
import { useSignatoriesListSuspense as g } from "@gusto/embedded-api/react-query/signatoriesList";
|
|
4
4
|
import { useMemo as f } from "react";
|
|
5
|
-
import { DocumentList as
|
|
6
|
-
import { documentSignerMachine as
|
|
7
|
-
import { Flow as
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
dictionary: m
|
|
15
|
-
}) => {
|
|
16
|
-
d("Company.DocumentList", m);
|
|
5
|
+
import { DocumentList as r, AssignSignatory as S } from "./documentSignerStateMachine.js";
|
|
6
|
+
import { documentSignerMachine as D } from "./stateMachine.js";
|
|
7
|
+
import { Flow as L } from "../../Flow/Flow.js";
|
|
8
|
+
import { BaseComponent as d } from "../../Base/Base.js";
|
|
9
|
+
import "../../Base/useBase.js";
|
|
10
|
+
import { useComponentDictionary as h } from "../../../i18n/I18n.js";
|
|
11
|
+
import { SignatureForm as l } from "./SignatureForm/SignatureForm.js";
|
|
12
|
+
function x({ companyId: o, signatoryId: i, onEvent: m, dictionary: s }) {
|
|
13
|
+
h("Company.DocumentList", s);
|
|
17
14
|
const {
|
|
18
|
-
data: { signatoryList:
|
|
15
|
+
data: { signatoryList: c }
|
|
19
16
|
} = g({
|
|
20
17
|
companyUuid: o
|
|
21
|
-
}), t =
|
|
18
|
+
}), t = c.length > 0, u = f(
|
|
22
19
|
() => p(
|
|
23
20
|
t ? "documentList" : "index",
|
|
24
|
-
|
|
25
|
-
(
|
|
26
|
-
...
|
|
27
|
-
component: t ?
|
|
21
|
+
D,
|
|
22
|
+
(a) => ({
|
|
23
|
+
...a,
|
|
24
|
+
component: t ? r : S,
|
|
28
25
|
companyId: o,
|
|
29
26
|
signatoryId: i
|
|
30
27
|
})
|
|
31
28
|
),
|
|
32
29
|
[o, i, t]
|
|
33
30
|
);
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
return /* @__PURE__ */ n(L, { machine: u, onEvent: m });
|
|
32
|
+
}
|
|
33
|
+
function e(o) {
|
|
34
|
+
return /* @__PURE__ */ n(d, { ...o, children: /* @__PURE__ */ n(x, { ...o }) });
|
|
35
|
+
}
|
|
36
|
+
e.DocumentList = r;
|
|
37
|
+
e.SignatureForm = l;
|
|
38
38
|
export {
|
|
39
|
-
|
|
39
|
+
e as DocumentSigner
|
|
40
40
|
};
|
|
41
41
|
//# sourceMappingURL=DocumentSigner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentSigner.js","sources":["../../../../src/components/Company/DocumentSigner/DocumentSigner.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useSignatoriesListSuspense } from '@gusto/embedded-api/react-query/signatoriesList'\nimport { useMemo } from 'react'\nimport { AssignSignatory, DocumentList } from './documentSignerStateMachine'\nimport { documentSignerMachine } from './stateMachine'\nimport type { DocumentSignerContextInterface } from './useDocumentSigner'\nimport { SignatureForm } from './SignatureForm'\nimport { Flow } from '@/components/Flow/Flow'\nimport type
|
|
1
|
+
{"version":3,"file":"DocumentSigner.js","sources":["../../../../src/components/Company/DocumentSigner/DocumentSigner.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useSignatoriesListSuspense } from '@gusto/embedded-api/react-query/signatoriesList'\nimport { useMemo } from 'react'\nimport { AssignSignatory, DocumentList } from './documentSignerStateMachine'\nimport { documentSignerMachine } from './stateMachine'\nimport type { DocumentSignerContextInterface } from './useDocumentSigner'\nimport { SignatureForm } from './SignatureForm'\nimport { Flow } from '@/components/Flow/Flow'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport interface DocumentSignerProps extends BaseComponentInterface<'Company.DocumentList'> {\n companyId: string\n signatoryId?: string\n}\n\nfunction DocumentSignerFlow({ companyId, signatoryId, onEvent, dictionary }: DocumentSignerProps) {\n useComponentDictionary('Company.DocumentList', dictionary)\n const {\n data: { signatoryList },\n } = useSignatoriesListSuspense({\n companyUuid: companyId,\n })\n const signatories = signatoryList!\n const doesSignatoryExist = signatories.length > 0\n\n const documentSigner = useMemo(\n () =>\n createMachine(\n doesSignatoryExist ? 'documentList' : 'index',\n documentSignerMachine,\n (initialContext: DocumentSignerContextInterface) => ({\n ...initialContext,\n component: doesSignatoryExist ? DocumentList : AssignSignatory,\n companyId,\n signatoryId,\n }),\n ),\n [companyId, signatoryId, doesSignatoryExist],\n )\n return <Flow machine={documentSigner} onEvent={onEvent} />\n}\n\nexport function DocumentSigner(props: DocumentSignerProps) {\n return (\n <BaseComponent {...props}>\n <DocumentSignerFlow {...props} />\n </BaseComponent>\n )\n}\n\nDocumentSigner.DocumentList = DocumentList\nDocumentSigner.SignatureForm = SignatureForm\n"],"names":["DocumentSignerFlow","companyId","signatoryId","onEvent","dictionary","useComponentDictionary","signatoryList","useSignatoriesListSuspense","doesSignatoryExist","documentSigner","useMemo","createMachine","documentSignerMachine","initialContext","DocumentList","AssignSignatory","jsx","Flow","DocumentSigner","props","BaseComponent","SignatureForm"],"mappings":";;;;;;;;;;;AAgBA,SAASA,EAAmB,EAAE,WAAAC,GAAW,aAAAC,GAAa,SAAAC,GAAS,YAAAC,KAAmC;AAChG,EAAAC,EAAuB,wBAAwBD,CAAU;AACnD,QAAA;AAAA,IACJ,MAAM,EAAE,eAAAE,EAAc;AAAA,MACpBC,EAA2B;AAAA,IAC7B,aAAaN;AAAA,EAAA,CACd,GAEKO,IADcF,EACmB,SAAS,GAE1CG,IAAiBC;AAAA,IACrB,MACEC;AAAA,MACEH,IAAqB,iBAAiB;AAAA,MACtCI;AAAA,MACA,CAACC,OAAoD;AAAA,QACnD,GAAGA;AAAA,QACH,WAAWL,IAAqBM,IAAeC;AAAA,QAC/C,WAAAd;AAAA,QACA,aAAAC;AAAA,MACF;AAAA,IACF;AAAA,IACF,CAACD,GAAWC,GAAaM,CAAkB;AAAA,EAC7C;AACA,SAAQ,gBAAAQ,EAAAC,GAAA,EAAK,SAASR,GAAgB,SAAAN,EAAkB,CAAA;AAC1D;AAEO,SAASe,EAAeC,GAA4B;AAEvD,SAAA,gBAAAH,EAACI,KAAe,GAAGD,GACjB,4BAACnB,GAAoB,EAAA,GAAGmB,GAAO,EACjC,CAAA;AAEJ;AAEAD,EAAe,eAAeJ;AAC9BI,EAAe,gBAAgBG;"}
|