@gusto/embedded-react-sdk 0.10.7 → 0.11.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 +14 -0
- package/dist/components/Common/HamburgerMenu/HamburgerMenu.js +20 -19
- package/dist/components/Common/HamburgerMenu/HamburgerMenu.js.map +1 -1
- package/dist/components/Common/ReorderableList/ReorderableItem.js +1 -1
- package/dist/components/Common/ReorderableList/ReorderableItem.js.map +1 -1
- 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/Common/UI/Button/Button.d.ts +1 -1
- package/dist/components/Common/UI/Button/Button.js +4 -4
- package/dist/components/Common/UI/Button/Button.js.map +1 -1
- package/dist/components/Common/UI/Button/ButtonTypes.d.ts +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.d.ts +0 -5
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +34 -38
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +3 -2
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +3 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.d.ts +0 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +51 -54
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +13 -14
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +3 -2
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.d.ts +0 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +40 -43
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +10 -11
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/index.d.ts +0 -1
- package/dist/components/Company/BankAccount/BankAccount.d.ts +0 -5
- package/dist/components/Company/BankAccount/BankAccount.js +17 -23
- package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +6 -6
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.d.ts +0 -5
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +28 -31
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +9 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +9 -8
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.d.ts +0 -5
- package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js +25 -28
- package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +8 -7
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.d.ts +0 -5
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js +33 -36
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -4
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +3 -2
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.d.ts +0 -6
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +38 -43
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentSigner.d.ts +0 -4
- package/dist/components/Company/DocumentSigner/DocumentSigner.js +23 -26
- package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.d.ts +0 -6
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +41 -46
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +6 -5
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +12 -13
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +4 -3
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +3 -2
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +5 -4
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Industry/Industry.d.ts +0 -5
- package/dist/components/Company/Industry/Industry.js +23 -29
- package/dist/components/Company/Industry/Industry.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +7 -6
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +5 -6
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.d.ts +0 -5
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +44 -48
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/Locations.d.ts +0 -4
- package/dist/components/Company/Locations/Locations.js +14 -18
- package/dist/components/Company/Locations/Locations.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +7 -6
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +3 -2
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.d.ts +0 -5
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +28 -32
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +11 -10
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +7 -6
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -3
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.d.ts +1 -7
- package/dist/components/Company/PaySchedule/PaySchedule.js +72 -77
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +10 -9
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +37 -38
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +7 -6
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +12 -11
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxes.d.ts +0 -4
- package/dist/components/Company/StateTaxes/StateTaxes.js +16 -20
- package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.d.ts +0 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +44 -47
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +0 -5
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +26 -29
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
- package/dist/components/Contractor/Address/Address.d.ts +0 -5
- package/dist/components/Contractor/Address/Address.js +35 -39
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +3 -4
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/List/index.js +2 -3
- package/dist/components/Contractor/List/index.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +6 -5
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfile.d.ts +11 -0
- package/dist/components/Contractor/Profile/ContractorProfile.js +24 -0
- package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -0
- package/dist/components/Contractor/Profile/ContractorProfileForm.d.ts +5 -0
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +140 -0
- package/dist/components/Contractor/Profile/ContractorProfileForm.js.map +1 -0
- package/dist/components/Contractor/Profile/index.d.ts +3 -0
- package/dist/components/Contractor/Profile/useContractorProfile.d.ts +254 -0
- package/dist/components/Contractor/Profile/useContractorProfile.js +223 -0
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -0
- package/dist/components/Contractor/Submit/ContractorSubmitWithApi.d.ts +6 -0
- package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js +27 -0
- package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js.map +1 -0
- package/dist/components/Contractor/Submit/SubmitDone.d.ts +5 -0
- package/dist/components/Contractor/Submit/SubmitDone.js +18 -0
- package/dist/components/Contractor/Submit/SubmitDone.js.map +1 -0
- package/dist/components/Contractor/Submit/index.d.ts +6 -0
- package/dist/components/Contractor/Submit/index.js +20 -0
- package/dist/components/Contractor/Submit/index.js.map +1 -0
- package/dist/components/Contractor/Submit/index.module.scss.js +8 -0
- package/dist/components/Contractor/Submit/index.module.scss.js.map +1 -0
- package/dist/components/Contractor/index.d.ts +2 -0
- package/dist/components/Contractor/index.js +10 -6
- package/dist/components/Contractor/index.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +1 -1
- package/dist/components/Employee/Compensation/Compensation.d.ts +0 -6
- package/dist/components/Employee/Compensation/Compensation.js +97 -102
- package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +12 -12
- package/dist/components/Employee/Compensation/List.js +23 -22
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/Actions.js +8 -7
- package/dist/components/Employee/Deductions/Actions.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionForm.js +11 -10
- package/dist/components/Employee/Deductions/DeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList.js +6 -5
- package/dist/components/Employee/Deductions/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +11 -10
- package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +7 -6
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.d.ts +0 -5
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +25 -29
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +3 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentSigner.d.ts +1 -7
- package/dist/components/Employee/DocumentSigner/DocumentSigner.js +16 -20
- package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.d.ts +0 -7
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +40 -45
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +3 -2
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.d.ts +0 -5
- package/dist/components/Employee/EmployeeList/EmployeeList.js +56 -60
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +6 -5
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +12 -12
- 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 +6 -5
- 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 +9 -8
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +8 -8
- package/dist/components/Employee/Profile/Actions.js +7 -6
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +3 -3
- package/dist/components/Employee/Profile/HomeAddress.js +5 -6
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +2 -2
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +10 -11
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/Profile.d.ts +0 -8
- package/dist/components/Employee/Profile/Profile.js +131 -138
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +9 -8
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +11 -10
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.d.ts +0 -6
- package/dist/components/Employee/Taxes/Taxes.js +76 -81
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
- 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.ContractorSubmit.json.js +22 -0
- package/dist/i18n/en/Contractor.ContractorSubmit.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Profile.json.js +73 -0
- package/dist/i18n/en/Contractor.Profile.json.js.map +1 -0
- package/dist/shared/constants.d.ts +14 -0
- package/dist/shared/constants.js +33 -26
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +77 -1
- package/package.json +3 -3
|
@@ -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,EAAM,IAAIC,EAAiB;AAGjC,SAAA,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,EAC9B;AAEJ;"}
|
|
@@ -4,8 +4,3 @@ export type IndustryProps<T> = Pick<BaseComponentInterface<'Company.Industry'>,
|
|
|
4
4
|
companyId: string;
|
|
5
5
|
};
|
|
6
6
|
export declare function Industry<T>(props: IndustryProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export declare namespace Industry {
|
|
8
|
-
var Actions: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
var Edit: () => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
var Head: () => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
}
|
|
@@ -1,40 +1,34 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback as
|
|
3
|
-
import { useIndustrySelectionGetSuspense as
|
|
4
|
-
import { useIndustrySelectionUpdateMutation as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} = C({ companyId: n }), { isPending: d, mutateAsync: s } = I(), c = l(
|
|
19
|
-
async (p) => {
|
|
20
|
-
await e(p, async ({ naics_code: f }) => {
|
|
2
|
+
import { useCallback as f } from "react";
|
|
3
|
+
import { useIndustrySelectionGetSuspense as l } from "@gusto/embedded-api/react-query/industrySelectionGet";
|
|
4
|
+
import { useIndustrySelectionUpdateMutation as C } from "@gusto/embedded-api/react-query/industrySelectionUpdate";
|
|
5
|
+
import { IndustryApiStateProvider as I } from "./Context.js";
|
|
6
|
+
import { IndustrySelect as S } from "./IndustrySelect.js";
|
|
7
|
+
import { componentEvents as E } from "../../../shared/constants.js";
|
|
8
|
+
import { BaseComponent as v } from "../../Base/Base.js";
|
|
9
|
+
import { useBase as b } from "../../Base/useBase.js";
|
|
10
|
+
import { useI18n as h, useComponentDictionary as A } from "../../../i18n/I18n.js";
|
|
11
|
+
function B({ children: n, className: i, companyId: o, dictionary: u }) {
|
|
12
|
+
A("Company.Industry", u);
|
|
13
|
+
const { baseSubmitHandler: e, onEvent: r } = b(), {
|
|
14
|
+
data: { industry: m }
|
|
15
|
+
} = l({ companyId: o }), { isPending: a, mutateAsync: s } = C(), c = f(
|
|
16
|
+
async (d) => {
|
|
17
|
+
await e(d, async ({ naics_code: p }) => {
|
|
21
18
|
const y = await s({
|
|
22
|
-
request: { companyId:
|
|
19
|
+
request: { companyId: o, requestBody: { naicsCode: p } }
|
|
23
20
|
});
|
|
24
|
-
|
|
21
|
+
r(E.COMPANY_INDUSTRY_SELECTED, y.industry);
|
|
25
22
|
});
|
|
26
23
|
},
|
|
27
|
-
[e,
|
|
24
|
+
[e, o, s, r]
|
|
28
25
|
);
|
|
29
|
-
return /* @__PURE__ */ t("section", { className:
|
|
26
|
+
return /* @__PURE__ */ t("section", { className: i, children: /* @__PURE__ */ t(I, { value: { isPending: a }, children: /* @__PURE__ */ t(S, { naics_code: m?.naicsCode, onValid: c, children: n }) }) });
|
|
30
27
|
}
|
|
31
|
-
function
|
|
32
|
-
return
|
|
28
|
+
function U(n) {
|
|
29
|
+
return h("Company.Industry"), /* @__PURE__ */ t(v, { ...n, children: /* @__PURE__ */ t(B, { ...n }) });
|
|
33
30
|
}
|
|
34
|
-
r.Actions = S;
|
|
35
|
-
r.Edit = A;
|
|
36
|
-
r.Head = E;
|
|
37
31
|
export {
|
|
38
|
-
|
|
32
|
+
U as Industry
|
|
39
33
|
};
|
|
40
34
|
//# sourceMappingURL=Industry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Industry.js","sources":["../../../../src/components/Company/Industry/Industry.tsx"],"sourcesContent":["import { useCallback, type HTMLAttributes } from 'react'\nimport { useIndustrySelectionGetSuspense } from '@gusto/embedded-api/react-query/industrySelectionGet'\nimport { useIndustrySelectionUpdateMutation } from '@gusto/embedded-api/react-query/industrySelectionUpdate'\nimport
|
|
1
|
+
{"version":3,"file":"Industry.js","sources":["../../../../src/components/Company/Industry/Industry.tsx"],"sourcesContent":["import { useCallback, type HTMLAttributes } from 'react'\nimport { useIndustrySelectionGetSuspense } from '@gusto/embedded-api/react-query/industrySelectionGet'\nimport { useIndustrySelectionUpdateMutation } from '@gusto/embedded-api/react-query/industrySelectionUpdate'\nimport type { IndustryFormFields } from './Edit'\nimport { IndustryApiStateProvider } from './Context'\nimport { IndustrySelect } from './IndustrySelect'\nimport { componentEvents } from '@/shared/constants'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { useI18n, useComponentDictionary } from '@/i18n'\n\nexport type IndustryProps<T> = Pick<\n BaseComponentInterface<'Company.Industry'>,\n 'onEvent' | 'dictionary'\n> &\n Partial<Pick<HTMLAttributes<T>, 'children' | 'className'>> & {\n companyId: string\n }\n\nfunction Root<T>({ children, className, companyId, dictionary }: IndustryProps<T>) {\n useComponentDictionary('Company.Industry', dictionary)\n const { baseSubmitHandler, onEvent } = useBase()\n\n const {\n data: { industry },\n } = useIndustrySelectionGetSuspense({ companyId })\n\n const { isPending, mutateAsync: mutateIndustry } = useIndustrySelectionUpdateMutation()\n\n const onValid = useCallback(\n async (data: IndustryFormFields) => {\n await baseSubmitHandler(data, async ({ naics_code }) => {\n const response = await mutateIndustry({\n request: { companyId, requestBody: { naicsCode: naics_code } },\n })\n onEvent(componentEvents.COMPANY_INDUSTRY_SELECTED, response.industry)\n })\n },\n [baseSubmitHandler, companyId, mutateIndustry, onEvent],\n )\n\n return (\n <section className={className}>\n <IndustryApiStateProvider value={{ isPending }}>\n <IndustrySelect naics_code={industry?.naicsCode} onValid={onValid}>\n {children}\n </IndustrySelect>\n </IndustryApiStateProvider>\n </section>\n )\n}\n\nexport function Industry<T>(props: IndustryProps<T>) {\n useI18n('Company.Industry')\n\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n"],"names":["Root","children","className","companyId","dictionary","useComponentDictionary","baseSubmitHandler","onEvent","useBase","industry","useIndustrySelectionGetSuspense","isPending","mutateIndustry","useIndustrySelectionUpdateMutation","onValid","useCallback","data","naics_code","response","componentEvents","jsx","IndustryApiStateProvider","IndustrySelect","Industry","props","useI18n","BaseComponent"],"mappings":";;;;;;;;;;AAkBA,SAASA,EAAQ,EAAE,UAAAC,GAAU,WAAAC,GAAW,WAAAC,GAAW,YAAAC,KAAgC;AACjF,EAAAC,EAAuB,oBAAoBD,CAAU;AACrD,QAAM,EAAE,mBAAAE,GAAmB,SAAAC,EAAQ,IAAIC,EAAQ,GAEzC;AAAA,IACJ,MAAM,EAAE,UAAAC,EAAS;AAAA,EAAA,IACfC,EAAgC,EAAE,WAAAP,GAAW,GAE3C,EAAE,WAAAQ,GAAW,aAAaC,EAAA,IAAmBC,EAAmC,GAEhFC,IAAUC;AAAA,IACd,OAAOC,MAA6B;AAClC,YAAMV,EAAkBU,GAAM,OAAO,EAAE,YAAAC,QAAiB;AAChD,cAAAC,IAAW,MAAMN,EAAe;AAAA,UACpC,SAAS,EAAE,WAAAT,GAAW,aAAa,EAAE,WAAWc,EAAa,EAAA;AAAA,QAAA,CAC9D;AACO,QAAAV,EAAAY,EAAgB,2BAA2BD,EAAS,QAAQ;AAAA,MAAA,CACrE;AAAA,IACH;AAAA,IACA,CAACZ,GAAmBH,GAAWS,GAAgBL,CAAO;AAAA,EACxD;AAEA,2BACG,WAAQ,EAAA,WAAAL,GACP,UAAC,gBAAAkB,EAAAC,GAAA,EAAyB,OAAO,EAAE,WAAAV,EACjC,GAAA,UAAA,gBAAAS,EAACE,KAAe,YAAYb,GAAU,WAAW,SAAAK,GAC9C,UAAAb,EAAA,CACH,EACF,CAAA,GACF;AAEJ;AAEO,SAASsB,EAAYC,GAAyB;AACnD,SAAAC,EAAQ,kBAAkB,GAGxB,gBAAAL,EAACM,KAAe,GAAGF,GACjB,4BAACxB,GAAM,EAAA,GAAGwB,GAAO,EACnB,CAAA;AAEJ;"}
|
|
@@ -2,16 +2,17 @@ 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
|
-
|
|
9
|
-
|
|
5
|
+
import "../../../../shared/constants.js";
|
|
6
|
+
import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
7
|
+
import { useComponentContext as c } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
|
+
const x = () => {
|
|
9
|
+
const { t: o } = a("Company.Locations"), { handleCancel: i, isPending: s } = e(), t = c();
|
|
10
|
+
return /* @__PURE__ */ r(m, { children: [
|
|
10
11
|
/* @__PURE__ */ n(t.Button, { variant: "secondary", onClick: i, children: o("cancelCta") }),
|
|
11
12
|
/* @__PURE__ */ n(t.Button, { type: "submit", isLoading: s, "data-testid": "location-submit", children: o("saveCta") })
|
|
12
13
|
] });
|
|
13
14
|
};
|
|
14
15
|
export {
|
|
15
|
-
|
|
16
|
+
x as Actions
|
|
16
17
|
};
|
|
17
18
|
//# 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,EAAU,IAAIC,EAAiB,GAC/CC,IAAaC,EAAoB;AAEvC,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAEF,EAAA,WAAW,EAChB,CAAA;AAAA,IACC,gBAAAQ,EAAAH,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GAAW,eAAY,mBAChE,UAAEH,EAAA,SAAS,EACd,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -4,13 +4,12 @@ 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 { TextInputField as s } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
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";
|
|
11
10
|
import { SelectField as f } from "../../../Common/Fields/SelectField/SelectField.js";
|
|
12
11
|
import { CheckboxGroupField as g } from "../../../Common/Fields/CheckboxGroupField/CheckboxGroupField.js";
|
|
13
|
-
const
|
|
12
|
+
const q = i.object({
|
|
14
13
|
phoneNumber: m,
|
|
15
14
|
street1: i.string().min(1),
|
|
16
15
|
street2: i.string().optional(),
|
|
@@ -19,7 +18,7 @@ const k = i.object({
|
|
|
19
18
|
zip: n,
|
|
20
19
|
addressType: i.array(i.enum(["mailingAddress", "filingAddress"])).optional()
|
|
21
20
|
});
|
|
22
|
-
function
|
|
21
|
+
function k() {
|
|
23
22
|
const { t: e } = l("Company.Locations"), o = u(b.phoneMask);
|
|
24
23
|
return /* @__PURE__ */ t(d, { flexDirection: "column", gap: 20, children: [
|
|
25
24
|
/* @__PURE__ */ t(
|
|
@@ -105,7 +104,7 @@ function S() {
|
|
|
105
104
|
] });
|
|
106
105
|
}
|
|
107
106
|
export {
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
k as Form,
|
|
108
|
+
q as LocationFormSchema
|
|
110
109
|
};
|
|
111
110
|
//# 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":";;;;;;;;;;;AAOa,MAAAA,IAAqBC,EAAE,OAAO;AAAA,EACzC,aAAaC;AAAA,EACb,SAASD,EAAE,SAAS,IAAI,CAAC;AAAA,EACzB,SAASA,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,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,SAAS;AAC7E,CAAC;AAIM,SAASG,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1CC,IAAYC,EAAmBC,EAAY,SAAS;AAE1D,SACG,gBAAAC,EAAAC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,KAAK,EAAE,MAAM,IAAI,OAAO,EAAE;AAAA,QAC1B,qBAAqB,EAAE,MAAM,OAAO,OAAO,CAAC,OAAO,KAAK,EAAE;AAAA,QAE1D,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,UACvC;AAAA,4BACCS,GAAe,EAAA,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,UACpC;AAAA,UACA,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,UACZ;AAAA,UACA,gBAAAQ;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,YAAU;AAAA,cACV,OAAOT,EAAE,UAAU;AAAA,cACnB,cAAcA,EAAE,iBAAiB;AAAA,YAAA;AAAA,UACnC;AAAA,UACA,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,IACF;AAAA,IACA,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,UAC5C;AAAA,UACA;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;"}
|
|
@@ -4,9 +4,4 @@ interface LocationFormProps extends CommonComponentInterface {
|
|
|
4
4
|
locationId?: string;
|
|
5
5
|
}
|
|
6
6
|
export declare function LocationForm({ companyId, locationId, className, children, ...props }: LocationFormProps & BaseComponentInterface): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export declare namespace LocationForm {
|
|
8
|
-
var Head: typeof import("./Head").Head;
|
|
9
|
-
var Form: typeof import("./Form").Form;
|
|
10
|
-
var Actions: () => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
}
|
|
12
7
|
export {};
|
|
@@ -1,36 +1,35 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { useForm as
|
|
3
|
-
import { zodResolver as
|
|
4
|
-
import { useLocationsUpdateMutation as
|
|
5
|
-
import { useLocationsRetrieveSuspense as
|
|
6
|
-
import { useLocationsCreateMutation as
|
|
7
|
-
import { Head as
|
|
8
|
-
import { LocationFormSchema as
|
|
9
|
-
import { Actions as
|
|
10
|
-
import { LocationsFormProvider as
|
|
11
|
-
import { Form as
|
|
12
|
-
import { Flex as
|
|
13
|
-
import "react-i18next";
|
|
1
|
+
import { jsx as o, jsxs as T, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import { useForm as D, FormProvider as E } from "react-hook-form";
|
|
3
|
+
import { zodResolver as N } from "@hookform/resolvers/zod";
|
|
4
|
+
import { useLocationsUpdateMutation as O } from "@gusto/embedded-api/react-query/locationsUpdate";
|
|
5
|
+
import { useLocationsRetrieveSuspense as S } from "@gusto/embedded-api/react-query/locationsRetrieve";
|
|
6
|
+
import { useLocationsCreateMutation as x } from "@gusto/embedded-api/react-query/locationsCreate";
|
|
7
|
+
import { Head as R } from "./Head.js";
|
|
8
|
+
import { LocationFormSchema as q, Form as B } from "./Form.js";
|
|
9
|
+
import { Actions as I } from "./Actions.js";
|
|
10
|
+
import { LocationsFormProvider as M } from "./useLocationForm.js";
|
|
11
|
+
import { Form as _ } from "../../../Common/Form/Form.js";
|
|
12
|
+
import { Flex as w } from "../../../Common/Flex/Flex.js";
|
|
14
13
|
import "classnames";
|
|
15
|
-
import {
|
|
14
|
+
import { componentEvents as a } from "../../../../shared/constants.js";
|
|
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
|
-
|
|
19
|
-
function Y(t) {
|
|
18
|
+
function H(t) {
|
|
20
19
|
const {
|
|
21
20
|
data: { location: e }
|
|
22
|
-
} =
|
|
23
|
-
return /* @__PURE__ */ o(
|
|
21
|
+
} = S({ locationId: t.locationId });
|
|
22
|
+
return /* @__PURE__ */ o(p, { ...t, location: e });
|
|
24
23
|
}
|
|
25
|
-
function
|
|
24
|
+
function p({
|
|
26
25
|
companyId: t,
|
|
27
26
|
location: e,
|
|
28
|
-
className:
|
|
27
|
+
className: n,
|
|
29
28
|
children: r
|
|
30
29
|
}) {
|
|
31
30
|
j("Company.Locations");
|
|
32
|
-
const { onEvent: s, baseSubmitHandler:
|
|
33
|
-
resolver:
|
|
31
|
+
const { onEvent: s, baseSubmitHandler: f } = U(), { mutateAsync: l, isPending: A } = x(), { mutateAsync: g, isPending: y } = O(), L = ["mailingAddress", "filingAddress"], { control: h, ...d } = D({
|
|
32
|
+
resolver: N(q),
|
|
34
33
|
defaultValues: {
|
|
35
34
|
city: e?.city ?? "",
|
|
36
35
|
phoneNumber: e?.phoneNumber ?? "",
|
|
@@ -38,61 +37,58 @@ function g({
|
|
|
38
37
|
street2: e?.street2 ?? "",
|
|
39
38
|
state: e?.state ?? "",
|
|
40
39
|
zip: e?.zip ?? "",
|
|
41
|
-
addressType:
|
|
40
|
+
addressType: L.filter((i) => e?.[i] ?? !1)
|
|
42
41
|
}
|
|
43
|
-
}),
|
|
42
|
+
}), v = () => {
|
|
44
43
|
s(a.CANCEL);
|
|
45
|
-
},
|
|
46
|
-
await
|
|
47
|
-
const { addressType:
|
|
48
|
-
...
|
|
49
|
-
mailingAddress:
|
|
50
|
-
filingAddress:
|
|
44
|
+
}, C = async (i) => {
|
|
45
|
+
await f(i, async (F) => {
|
|
46
|
+
const { addressType: c, ...P } = F, u = {
|
|
47
|
+
...P,
|
|
48
|
+
mailingAddress: c?.includes("mailingAddress"),
|
|
49
|
+
filingAddress: c?.includes("filingAddress")
|
|
51
50
|
};
|
|
52
51
|
if (e && e.version !== void 0) {
|
|
53
|
-
const { location: m } = await
|
|
52
|
+
const { location: m } = await g({
|
|
54
53
|
request: {
|
|
55
54
|
locationId: e.uuid,
|
|
56
|
-
requestBody: { ...
|
|
55
|
+
requestBody: { ...u, version: e.version }
|
|
57
56
|
}
|
|
58
57
|
});
|
|
59
58
|
s(a.COMPANY_LOCATION_UPDATED, m);
|
|
60
59
|
} else {
|
|
61
|
-
const { location: m } = await
|
|
60
|
+
const { location: m } = await l({
|
|
62
61
|
request: {
|
|
63
62
|
companyId: t,
|
|
64
|
-
requestBody:
|
|
63
|
+
requestBody: u
|
|
65
64
|
}
|
|
66
65
|
});
|
|
67
66
|
s(a.COMPANY_LOCATION_CREATED, m);
|
|
68
67
|
}
|
|
69
68
|
});
|
|
70
69
|
};
|
|
71
|
-
return /* @__PURE__ */ o("section", { className:
|
|
72
|
-
|
|
70
|
+
return /* @__PURE__ */ o("section", { className: n, children: /* @__PURE__ */ o(E, { ...d, control: h, children: /* @__PURE__ */ o(_, { onSubmit: d.handleSubmit(C), children: /* @__PURE__ */ o(
|
|
71
|
+
M,
|
|
73
72
|
{
|
|
74
|
-
value: { handleCancel:
|
|
75
|
-
children: /* @__PURE__ */ o(
|
|
76
|
-
/* @__PURE__ */ o(
|
|
77
|
-
/* @__PURE__ */ o(
|
|
78
|
-
/* @__PURE__ */ o(
|
|
73
|
+
value: { handleCancel: v, isPending: A || y },
|
|
74
|
+
children: /* @__PURE__ */ o(w, { flexDirection: "column", gap: 32, children: r || /* @__PURE__ */ T(b, { children: [
|
|
75
|
+
/* @__PURE__ */ o(R, {}),
|
|
76
|
+
/* @__PURE__ */ o(B, {}),
|
|
77
|
+
/* @__PURE__ */ o(I, {})
|
|
79
78
|
] }) })
|
|
80
79
|
}
|
|
81
80
|
) }) }) });
|
|
82
81
|
}
|
|
83
|
-
function
|
|
82
|
+
function ie({
|
|
84
83
|
companyId: t,
|
|
85
84
|
locationId: e,
|
|
86
|
-
className:
|
|
85
|
+
className: n,
|
|
87
86
|
children: r,
|
|
88
87
|
...s
|
|
89
88
|
}) {
|
|
90
|
-
return /* @__PURE__ */ o(
|
|
89
|
+
return /* @__PURE__ */ o(z, { ...s, children: e ? /* @__PURE__ */ o(H, { companyId: t, locationId: e, className: n, children: r }) : /* @__PURE__ */ o(p, { companyId: t, className: n, children: r }) });
|
|
91
90
|
}
|
|
92
|
-
d.Head = f;
|
|
93
|
-
d.Form = l;
|
|
94
|
-
d.Actions = A;
|
|
95
91
|
export {
|
|
96
|
-
|
|
92
|
+
ie as LocationForm
|
|
97
93
|
};
|
|
98
94
|
//# sourceMappingURL=LocationForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/LocationForm.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useLocationsUpdateMutation } from '@gusto/embedded-api/react-query/locationsUpdate'\nimport { useLocationsRetrieveSuspense } from '@gusto/embedded-api/react-query/locationsRetrieve'\nimport { useLocationsCreateMutation } from '@gusto/embedded-api/react-query/locationsCreate'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { Head } from './Head'\nimport type { LocationFormInputs } from './Form'\nimport { Form, LocationFormSchema } from './Form'\nimport { Actions } from './Actions'\nimport { LocationsFormProvider } from './useLocationForm'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport type { WithRequired } from '@/types/Helpers'\n\ninterface LocationFormProps extends CommonComponentInterface {\n companyId: string\n locationId?: string\n}\n\n/**Accounting for conditional logic where location data needs to be fetched only if locationId is present */\nfunction RootWithLocation(props: WithRequired<LocationFormProps, 'locationId'>) {\n const {\n data: { location },\n } = useLocationsRetrieveSuspense({ locationId: props.locationId })\n return <Root {...props} location={location} />\n}\n\nfunction Root({\n companyId,\n location,\n className,\n children,\n}: LocationFormProps & { location?: Location }) {\n useI18n('Company.Locations')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { mutateAsync: createLocation, isPending: isPendingCreate } = useLocationsCreateMutation()\n const { mutateAsync: updateLocation, isPending: isPendingUpdate } = useLocationsUpdateMutation()\n const addressType = ['mailingAddress', 'filingAddress'] as const\n\n const { control, ...methods } = useForm<LocationFormInputs>({\n resolver: zodResolver(LocationFormSchema),\n defaultValues: {\n city: location?.city ?? '',\n phoneNumber: location?.phoneNumber ?? '',\n street1: location?.street1 ?? '',\n street2: location?.street2 ?? '',\n state: location?.state ?? '',\n zip: location?.zip ?? '',\n addressType: addressType.filter(key => location?.[key] ?? false),\n },\n })\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n const onSubmit = async (data: LocationFormInputs) => {\n await baseSubmitHandler(data, async innerData => {\n const { addressType, ...payload } = innerData\n\n const requestBody = {\n ...payload,\n mailingAddress: addressType?.includes('mailingAddress'),\n filingAddress: addressType?.includes('filingAddress'),\n }\n\n if (location && location.version !== undefined) {\n // Edit existing location\n const { location: responseData } = await updateLocation({\n request: {\n locationId: location.uuid,\n requestBody: { ...requestBody, version: location.version },\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_UPDATED, responseData)\n } else {\n // Add new location\n const { location: responseData } = await createLocation({\n request: {\n companyId,\n requestBody,\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_CREATED, responseData)\n }\n })\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <LocationsFormProvider\n value={{ handleCancel, isPending: isPendingCreate || isPendingUpdate }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n\nexport function LocationForm({\n companyId,\n locationId,\n className,\n children,\n ...props\n}: LocationFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n {locationId ? (\n <RootWithLocation companyId={companyId} locationId={locationId} className={className}>\n {children}\n </RootWithLocation>\n ) : (\n <Root companyId={companyId} className={className}>\n {children}\n </Root>\n )}\n </BaseComponent>\n )\n}\n
|
|
1
|
+
{"version":3,"file":"LocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/LocationForm.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useLocationsUpdateMutation } from '@gusto/embedded-api/react-query/locationsUpdate'\nimport { useLocationsRetrieveSuspense } from '@gusto/embedded-api/react-query/locationsRetrieve'\nimport { useLocationsCreateMutation } from '@gusto/embedded-api/react-query/locationsCreate'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { Head } from './Head'\nimport type { LocationFormInputs } from './Form'\nimport { Form, LocationFormSchema } from './Form'\nimport { Actions } from './Actions'\nimport { LocationsFormProvider } from './useLocationForm'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport type { WithRequired } from '@/types/Helpers'\n\ninterface LocationFormProps extends CommonComponentInterface {\n companyId: string\n locationId?: string\n}\n\n/**Accounting for conditional logic where location data needs to be fetched only if locationId is present */\nfunction RootWithLocation(props: WithRequired<LocationFormProps, 'locationId'>) {\n const {\n data: { location },\n } = useLocationsRetrieveSuspense({ locationId: props.locationId })\n return <Root {...props} location={location} />\n}\n\nfunction Root({\n companyId,\n location,\n className,\n children,\n}: LocationFormProps & { location?: Location }) {\n useI18n('Company.Locations')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { mutateAsync: createLocation, isPending: isPendingCreate } = useLocationsCreateMutation()\n const { mutateAsync: updateLocation, isPending: isPendingUpdate } = useLocationsUpdateMutation()\n const addressType = ['mailingAddress', 'filingAddress'] as const\n\n const { control, ...methods } = useForm<LocationFormInputs>({\n resolver: zodResolver(LocationFormSchema),\n defaultValues: {\n city: location?.city ?? '',\n phoneNumber: location?.phoneNumber ?? '',\n street1: location?.street1 ?? '',\n street2: location?.street2 ?? '',\n state: location?.state ?? '',\n zip: location?.zip ?? '',\n addressType: addressType.filter(key => location?.[key] ?? false),\n },\n })\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n const onSubmit = async (data: LocationFormInputs) => {\n await baseSubmitHandler(data, async innerData => {\n const { addressType, ...payload } = innerData\n\n const requestBody = {\n ...payload,\n mailingAddress: addressType?.includes('mailingAddress'),\n filingAddress: addressType?.includes('filingAddress'),\n }\n\n if (location && location.version !== undefined) {\n // Edit existing location\n const { location: responseData } = await updateLocation({\n request: {\n locationId: location.uuid,\n requestBody: { ...requestBody, version: location.version },\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_UPDATED, responseData)\n } else {\n // Add new location\n const { location: responseData } = await createLocation({\n request: {\n companyId,\n requestBody,\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_CREATED, responseData)\n }\n })\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <LocationsFormProvider\n value={{ handleCancel, isPending: isPendingCreate || isPendingUpdate }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n\nexport function LocationForm({\n companyId,\n locationId,\n className,\n children,\n ...props\n}: LocationFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n {locationId ? (\n <RootWithLocation companyId={companyId} locationId={locationId} className={className}>\n {children}\n </RootWithLocation>\n ) : (\n <Root companyId={companyId} className={className}>\n {children}\n </Root>\n )}\n </BaseComponent>\n )\n}\n"],"names":["RootWithLocation","props","location","useLocationsRetrieveSuspense","jsx","Root","companyId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","createLocation","isPendingCreate","useLocationsCreateMutation","updateLocation","isPendingUpdate","useLocationsUpdateMutation","addressType","control","methods","useForm","zodResolver","LocationFormSchema","key","handleCancel","componentEvents","onSubmit","data","innerData","payload","requestBody","responseData","FormProvider","HtmlForm","LocationsFormProvider","Flex","jsxs","Fragment","Head","Form","Actions","LocationForm","locationId","BaseComponent"],"mappings":";;;;;;;;;;;;;;;;;AAyBA,SAASA,EAAiBC,GAAsD;AACxE,QAAA;AAAA,IACJ,MAAM,EAAE,UAAAC,EAAS;AAAA,MACfC,EAA6B,EAAE,YAAYF,EAAM,YAAY;AACjE,SAAQ,gBAAAG,EAAAC,GAAA,EAAM,GAAGJ,GAAO,UAAAC,EAAoB,CAAA;AAC9C;AAEA,SAASG,EAAK;AAAA,EACZ,WAAAC;AAAA,EACA,UAAAJ;AAAA,EACA,WAAAK;AAAA,EACA,UAAAC;AACF,GAAgD;AAC9C,EAAAC,EAAQ,mBAAmB;AAC3B,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GAEzC,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAAoBC,EAA2B,GACzF,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAAoBC,EAA2B,GACzFC,IAAc,CAAC,kBAAkB,eAAe,GAEhD,EAAE,SAAAC,GAAS,GAAGC,EAAA,IAAYC,EAA4B;AAAA,IAC1D,UAAUC,EAAYC,CAAkB;AAAA,IACxC,eAAe;AAAA,MACb,MAAMtB,GAAU,QAAQ;AAAA,MACxB,aAAaA,GAAU,eAAe;AAAA,MACtC,SAASA,GAAU,WAAW;AAAA,MAC9B,SAASA,GAAU,WAAW;AAAA,MAC9B,OAAOA,GAAU,SAAS;AAAA,MAC1B,KAAKA,GAAU,OAAO;AAAA,MACtB,aAAaiB,EAAY,OAAO,OAAOjB,IAAWuB,CAAG,KAAK,EAAK;AAAA,IAAA;AAAA,EACjE,CACD,GAEKC,IAAe,MAAM;AACzB,IAAAhB,EAAQiB,EAAgB,MAAM;AAAA,EAChC,GACMC,IAAW,OAAOC,MAA6B;AAC7C,UAAAlB,EAAkBkB,GAAM,OAAMC,MAAa;AAC/C,YAAM,EAAE,aAAAX,GAAa,GAAGY,EAAY,IAAAD,GAE9BE,IAAc;AAAA,QAClB,GAAGD;AAAA,QACH,gBAAgBZ,GAAa,SAAS,gBAAgB;AAAA,QACtD,eAAeA,GAAa,SAAS,eAAe;AAAA,MACtD;AAEI,UAAAjB,KAAYA,EAAS,YAAY,QAAW;AAE9C,cAAM,EAAE,UAAU+B,EAAa,IAAI,MAAMjB,EAAe;AAAA,UACtD,SAAS;AAAA,YACP,YAAYd,EAAS;AAAA,YACrB,aAAa,EAAE,GAAG8B,GAAa,SAAS9B,EAAS,QAAQ;AAAA,UAAA;AAAA,QAC3D,CACD;AACO,QAAAQ,EAAAiB,EAAgB,0BAA0BM,CAAY;AAAA,MAAA,OACzD;AAEL,cAAM,EAAE,UAAUA,EAAa,IAAI,MAAMpB,EAAe;AAAA,UACtD,SAAS;AAAA,YACP,WAAAP;AAAA,YACA,aAAA0B;AAAA,UAAA;AAAA,QACF,CACD;AACO,QAAAtB,EAAAiB,EAAgB,0BAA0BM,CAAY;AAAA,MAAA;AAAA,IAChE,CACD;AAAA,EACH;AAEA,SACG,gBAAA7B,EAAA,WAAA,EAAQ,WAAAG,GACP,UAAA,gBAAAH,EAAC8B,KAAc,GAAGb,GAAS,SAAAD,GACzB,UAAA,gBAAAhB,EAAC+B,GAAS,EAAA,UAAUd,EAAQ,aAAaO,CAAQ,GAC/C,UAAA,gBAAAxB;AAAA,IAACgC;AAAA,IAAA;AAAA,MACC,OAAO,EAAE,cAAAV,GAAc,WAAWZ,KAAmBG,EAAgB;AAAA,MAErE,UAAA,gBAAAb,EAACiC,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAA7B,KAIG,gBAAA8B,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAnC,EAACoC,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,EAAA,CACX,EAEJ,CAAA;AAAA,IAAA;AAAA,EAAA,EAEJ,CAAA,EACF,CAAA,GACF;AAEJ;AAEO,SAASC,GAAa;AAAA,EAC3B,WAAArC;AAAA,EACA,YAAAsC;AAAA,EACA,WAAArC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGP;AACL,GAA+C;AAC7C,2BACG4C,GAAe,EAAA,GAAG5C,GAChB,UAAA2C,sBACE5C,GAAiB,EAAA,WAAAM,GAAsB,YAAAsC,GAAwB,WAAArC,GAC7D,UAAAC,GACH,IAEA,gBAAAJ,EAACC,KAAK,WAAAC,GAAsB,WAAAC,GACzB,UAAAC,EACH,CAAA,GAEJ;AAEJ;"}
|
|
@@ -3,7 +3,3 @@ export interface LocationsProps extends BaseComponentInterface<'Company.Location
|
|
|
3
3
|
companyId: string;
|
|
4
4
|
}
|
|
5
5
|
export declare function Locations({ companyId, onEvent, dictionary }: LocationsProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export declare namespace Locations {
|
|
7
|
-
var LocationsList: typeof import("./LocationsList").LocationsList;
|
|
8
|
-
var LocationForm: typeof import("./LocationForm/LocationForm").LocationForm;
|
|
9
|
-
}
|
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createMachine as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { createMachine as a } from "robot3";
|
|
3
3
|
import { locationsStateMachine as e } from "./stateMachine.js";
|
|
4
|
-
import { LocationsListContextual as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
f("Company.Locations", n);
|
|
11
|
-
const m = c(
|
|
4
|
+
import { LocationsListContextual as c } from "./locationsStateMachine.js";
|
|
5
|
+
import { Flow as p } from "../../Flow/Flow.js";
|
|
6
|
+
import { useComponentDictionary as s } from "../../../i18n/I18n.js";
|
|
7
|
+
function C({ companyId: o, onEvent: t, dictionary: n }) {
|
|
8
|
+
s("Company.Locations", n);
|
|
9
|
+
const i = a(
|
|
12
10
|
"index",
|
|
13
11
|
e,
|
|
14
|
-
(
|
|
15
|
-
...
|
|
16
|
-
component:
|
|
17
|
-
companyId:
|
|
12
|
+
(m) => ({
|
|
13
|
+
...m,
|
|
14
|
+
component: c,
|
|
15
|
+
companyId: o
|
|
18
16
|
})
|
|
19
17
|
);
|
|
20
|
-
return /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ r(p, { machine: i, onEvent: t });
|
|
21
19
|
}
|
|
22
|
-
o.LocationsList = u;
|
|
23
|
-
o.LocationForm = p;
|
|
24
20
|
export {
|
|
25
|
-
|
|
21
|
+
C as Locations
|
|
26
22
|
};
|
|
27
23
|
//# sourceMappingURL=Locations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Locations.js","sources":["../../../../src/components/Company/Locations/Locations.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { type LocationsContextInterface } from './locationsStateMachine'\nimport { locationsStateMachine } from './stateMachine'\nimport { LocationsListContextual } from './locationsStateMachine'\nimport {
|
|
1
|
+
{"version":3,"file":"Locations.js","sources":["../../../../src/components/Company/Locations/Locations.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { type LocationsContextInterface } from './locationsStateMachine'\nimport { locationsStateMachine } from './stateMachine'\nimport { LocationsListContextual } from './locationsStateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport interface LocationsProps extends BaseComponentInterface<'Company.Locations'> {\n companyId: string\n}\n\nexport function Locations({ companyId, onEvent, dictionary }: LocationsProps) {\n useComponentDictionary('Company.Locations', dictionary)\n\n const manageLocations = createMachine(\n 'index',\n locationsStateMachine,\n (initialContext: LocationsContextInterface) => ({\n ...initialContext,\n component: LocationsListContextual,\n companyId,\n }),\n )\n return <Flow machine={manageLocations} onEvent={onEvent} />\n}\n"],"names":["Locations","companyId","onEvent","dictionary","useComponentDictionary","manageLocations","createMachine","locationsStateMachine","initialContext","LocationsListContextual","jsx","Flow"],"mappings":";;;;;;AAYO,SAASA,EAAU,EAAE,WAAAC,GAAW,SAAAC,GAAS,YAAAC,KAA8B;AAC5E,EAAAC,EAAuB,qBAAqBD,CAAU;AAEtD,QAAME,IAAkBC;AAAA,IACtB;AAAA,IACAC;AAAA,IACA,CAACC,OAA+C;AAAA,MAC9C,GAAGA;AAAA,MACH,WAAWC;AAAA,MACX,WAAAR;AAAA,IACF;AAAA,EACF;AACA,SAAQ,gBAAAS,EAAAC,GAAA,EAAK,SAASN,GAAiB,SAAAH,EAAkB,CAAA;AAC3D;"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { jsxs as c, jsx as
|
|
1
|
+
import { jsxs as c, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as s } from "react-i18next";
|
|
3
3
|
import { useLocationsList as a } from "./useLocationsList.js";
|
|
4
4
|
import "classnames";
|
|
5
|
+
import "../../../../shared/constants.js";
|
|
5
6
|
import { ActionsLayout as e } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
6
7
|
import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
7
|
-
function
|
|
8
|
-
const { t: o } = s("Company.Locations"), { handleAddLocation: i, handleContinue: r } = a(),
|
|
8
|
+
function h() {
|
|
9
|
+
const { t: o } = s("Company.Locations"), { handleAddLocation: i, handleContinue: r } = a(), t = m();
|
|
9
10
|
return /* @__PURE__ */ c(e, { children: [
|
|
10
|
-
/* @__PURE__ */ t
|
|
11
|
-
/* @__PURE__ */ t
|
|
11
|
+
/* @__PURE__ */ n(t.Button, { variant: "secondary", onClick: i, children: o("addLocationCta") }),
|
|
12
|
+
/* @__PURE__ */ n(t.Button, { onClick: r, children: o("continueCta") })
|
|
12
13
|
] });
|
|
13
14
|
}
|
|
14
15
|
export {
|
|
15
|
-
|
|
16
|
+
h as Actions
|
|
16
17
|
};
|
|
17
18
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/Locations/LocationsList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.Locations')\n const { handleAddLocation, handleContinue } = useLocationsList()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addLocationCta')}\n </Components.Button>\n <Components.Button onClick={handleContinue}>{t('continueCta')}</Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","handleAddLocation","handleContinue","useLocationsList","Components","useComponentContext","ActionsLayout","jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/Locations/LocationsList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.Locations')\n const { handleAddLocation, handleContinue } = useLocationsList()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addLocationCta')}\n </Components.Button>\n <Components.Button onClick={handleContinue}>{t('continueCta')}</Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","handleAddLocation","handleContinue","useLocationsList","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,mBAAAC,GAAmB,gBAAAC,EAAe,IAAIC,EAAiB,GACzDC,IAAaC,EAAoB;AAEvC,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAEF,EAAA,gBAAgB,EACrB,CAAA;AAAA,IACA,gBAAAQ,EAACH,EAAW,QAAX,EAAkB,SAASF,GAAiB,UAAAH,EAAE,aAAa,EAAE,CAAA;AAAA,EAAA,GAChE;AAEJ;"}
|
|
@@ -3,6 +3,7 @@ import { useTranslation as L } from "react-i18next";
|
|
|
3
3
|
import { useLocationsList as C } from "./useLocationsList.js";
|
|
4
4
|
import P from "../../../../assets/icons/pencil.svg.js";
|
|
5
5
|
import "classnames";
|
|
6
|
+
import "../../../../shared/constants.js";
|
|
6
7
|
import { EmptyData as b } from "../../../Common/EmptyData/EmptyData.js";
|
|
7
8
|
import { useComponentContext as y } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
9
|
import { HamburgerMenu as x } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
@@ -10,7 +11,7 @@ import { getStreet as T, getCityStateZip as A } from "../../../../helpers/format
|
|
|
10
11
|
import { VisuallyHidden as k } from "../../../Common/VisuallyHidden/VisuallyHidden.js";
|
|
11
12
|
import { useDataView as D } from "../../../Common/DataView/useDataView.js";
|
|
12
13
|
import { DataView as S } from "../../../Common/DataView/DataView.js";
|
|
13
|
-
const
|
|
14
|
+
const q = () => {
|
|
14
15
|
const a = y(), {
|
|
15
16
|
locationList: o,
|
|
16
17
|
handleEditLocation: s,
|
|
@@ -77,6 +78,6 @@ const Z = () => {
|
|
|
77
78
|
return /* @__PURE__ */ t(S, { label: e("locationListLabel"), ...f });
|
|
78
79
|
};
|
|
79
80
|
export {
|
|
80
|
-
|
|
81
|
+
q as List
|
|
81
82
|
};
|
|
82
83
|
//# sourceMappingURL=List.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sources":["../../../../../src/components/Company/Locations/LocationsList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { DataView, EmptyData, useDataView, VisuallyHidden } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { getCityStateZip, getStreet } from '@/helpers/formattedStrings'\n\n/**List of employees slot for EmployeeList component */\nexport const List = () => {\n const Components = useComponentContext()\n const {\n locationList,\n handleEditLocation,\n currentPage,\n totalPages,\n handleFirstPage,\n handleItemsPerPageChange,\n handleLastPage,\n handleNextPage,\n handlePreviousPage,\n handleAddLocation,\n } = useLocationsList()\n\n const { t } = useTranslation('Company.Locations')\n const { ...dataViewProps } = useDataView({\n data: locationList,\n columns: [\n {\n key: 'name',\n title: t('locationListCol1'),\n render: location => {\n return (\n <>\n <address>\n <Components.Text as=\"span\">{getStreet(location)}</Components.Text>\n <br />\n <Components.Text as=\"span\" size=\"sm\">\n {getCityStateZip(location)}\n </Components.Text>\n </address>\n </>\n )\n },\n },\n {\n key: 'status',\n title: <VisuallyHidden>{t('locationListCol2')}</VisuallyHidden>,\n render: location => {\n return (\n <>\n {location.mailingAddress && (\n <Components.Badge status={'info'}>{t('mailingAddress')}</Components.Badge>\n )}\n {location.filingAddress && (\n <>\n {' '}\n <Components.Badge status={'info'}>{t('filingAddress')}</Components.Badge>\n </>\n )}\n </>\n )\n },\n },\n ],\n itemMenu: location => {\n return (\n <HamburgerMenu\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEditLocation(location.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n 'data-testid': 'edit-location',\n },\n ]}\n data-testid=\"location-hamburger\"\n triggerLabel={t('hamburgerTitle')}\n />\n )\n },\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n },\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addFirstLocationCta')}\n </Components.Button>\n </EmptyData>\n ),\n })\n return <DataView label={t('locationListLabel')} {...dataViewProps} />\n}\n"],"names":["List","Components","useComponentContext","locationList","handleEditLocation","currentPage","totalPages","handleFirstPage","handleItemsPerPageChange","handleLastPage","handleNextPage","handlePreviousPage","handleAddLocation","useLocationsList","t","useTranslation","dataViewProps","useDataView","location","jsx","Fragment","getStreet","getCityStateZip","VisuallyHidden","jsxs","HamburgerMenu","PencilSvg","EmptyData","DataView"],"mappings":"
|
|
1
|
+
{"version":3,"file":"List.js","sources":["../../../../../src/components/Company/Locations/LocationsList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { DataView, EmptyData, useDataView, VisuallyHidden } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { getCityStateZip, getStreet } from '@/helpers/formattedStrings'\n\n/**List of employees slot for EmployeeList component */\nexport const List = () => {\n const Components = useComponentContext()\n const {\n locationList,\n handleEditLocation,\n currentPage,\n totalPages,\n handleFirstPage,\n handleItemsPerPageChange,\n handleLastPage,\n handleNextPage,\n handlePreviousPage,\n handleAddLocation,\n } = useLocationsList()\n\n const { t } = useTranslation('Company.Locations')\n const { ...dataViewProps } = useDataView({\n data: locationList,\n columns: [\n {\n key: 'name',\n title: t('locationListCol1'),\n render: location => {\n return (\n <>\n <address>\n <Components.Text as=\"span\">{getStreet(location)}</Components.Text>\n <br />\n <Components.Text as=\"span\" size=\"sm\">\n {getCityStateZip(location)}\n </Components.Text>\n </address>\n </>\n )\n },\n },\n {\n key: 'status',\n title: <VisuallyHidden>{t('locationListCol2')}</VisuallyHidden>,\n render: location => {\n return (\n <>\n {location.mailingAddress && (\n <Components.Badge status={'info'}>{t('mailingAddress')}</Components.Badge>\n )}\n {location.filingAddress && (\n <>\n {' '}\n <Components.Badge status={'info'}>{t('filingAddress')}</Components.Badge>\n </>\n )}\n </>\n )\n },\n },\n ],\n itemMenu: location => {\n return (\n <HamburgerMenu\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEditLocation(location.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n 'data-testid': 'edit-location',\n },\n ]}\n data-testid=\"location-hamburger\"\n triggerLabel={t('hamburgerTitle')}\n />\n )\n },\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n },\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addFirstLocationCta')}\n </Components.Button>\n </EmptyData>\n ),\n })\n return <DataView label={t('locationListLabel')} {...dataViewProps} />\n}\n"],"names":["List","Components","useComponentContext","locationList","handleEditLocation","currentPage","totalPages","handleFirstPage","handleItemsPerPageChange","handleLastPage","handleNextPage","handlePreviousPage","handleAddLocation","useLocationsList","t","useTranslation","dataViewProps","useDataView","location","jsx","Fragment","getStreet","getCityStateZip","VisuallyHidden","jsxs","HamburgerMenu","PencilSvg","EmptyData","DataView"],"mappings":";;;;;;;;;;;;;AASO,MAAMA,IAAO,MAAM;AACxB,QAAMC,IAAaC,EAAoB,GACjC;AAAA,IACJ,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,mBAAAC;AAAA,MACEC,EAAiB,GAEf,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,GAAGC,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAMd;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAOW,EAAE,kBAAkB;AAAA,QAC3B,QAAQ,CAAYI,MAEhB,gBAAAC,EAAAC,GAAA,EACE,4BAAC,WACC,EAAA,UAAA;AAAA,UAAA,gBAAAD,EAAClB,EAAW,MAAX,EAAgB,IAAG,QAAQ,UAAAoB,EAAUH,CAAQ,GAAE;AAAA,4BAC/C,MAAG,EAAA;AAAA,UACJ,gBAAAC,EAAClB,EAAW,MAAX,EAAgB,IAAG,QAAO,MAAK,MAC7B,UAAgBqB,EAAAJ,CAAQ,EAC3B,CAAA;AAAA,QAAA,EAAA,CACF,EACF,CAAA;AAAA,MAGN;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,OAAO,gBAAAC,EAACI,GAAgB,EAAA,UAAAT,EAAE,kBAAkB,GAAE;AAAA,QAC9C,QAAQ,CAAYI,MAGb,gBAAAM,EAAAJ,GAAA,EAAA,UAAA;AAAA,UAASF,EAAA,oCACPjB,EAAW,OAAX,EAAiB,QAAQ,QAAS,UAAEa,EAAA,gBAAgB,EAAE,CAAA;AAAA,UAExDI,EAAS,iBAEL,gBAAAM,EAAAJ,GAAA,EAAA,UAAA;AAAA,YAAA;AAAA,YACD,gBAAAD,EAAClB,EAAW,OAAX,EAAiB,QAAQ,QAAS,UAAAa,EAAE,eAAe,EAAE,CAAA;AAAA,UAAA,EACxD,CAAA;AAAA,QAAA,GAEJ;AAAA,MAEJ;AAAA,IAEJ;AAAA,IACA,UAAU,CAAYI,MAElB,gBAAAC;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,OAAO;AAAA,UACL;AAAA,YACE,OAAOX,EAAE,SAAS;AAAA,YAClB,SAAS,MAAM;AACb,cAAAV,EAAmBc,EAAS,IAAI;AAAA,YAClC;AAAA,YACA,MAAM,gBAAAC,EAACO,GAAU,EAAA,eAAW,GAAC,CAAA;AAAA,YAC7B,eAAe;AAAA,UAAA;AAAA,QAEnB;AAAA,QACA,eAAY;AAAA,QACZ,cAAcZ,EAAE,gBAAgB;AAAA,MAAA;AAAA,IAClC;AAAA,IAGJ,YAAY;AAAA,MACV,gBAAAJ;AAAA,MACA,iBAAAH;AAAA,MACA,gBAAAE;AAAA,MACA,oBAAAE;AAAA,MACA,0BAAAH;AAAA,MACA,aAAAH;AAAA,MACA,YAAAC;AAAA,IACF;AAAA,IACA,YAAY,MACT,gBAAAa,EAAAQ,GAAA,EAAU,OAAOb,EAAE,iBAAiB,GAAG,aAAaA,EAAE,uBAAuB,GAC5E,UAAC,gBAAAK,EAAAlB,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASW,GAC7C,UAAAE,EAAE,qBAAqB,EAC1B,CAAA,EACF,CAAA;AAAA,EAAA,CAEH;AACD,2BAAQc,GAAS,EAAA,OAAOd,EAAE,mBAAmB,GAAI,GAAGE,GAAe;AACrE;"}
|
|
@@ -3,9 +3,4 @@ interface LocationsListProps extends BaseComponentInterface {
|
|
|
3
3
|
companyId: string;
|
|
4
4
|
}
|
|
5
5
|
export declare function LocationsList(props: LocationsListProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export declare namespace LocationsList {
|
|
7
|
-
var Head: typeof import("./Head").Head;
|
|
8
|
-
var List: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
var Actions: typeof import("./Actions").Actions;
|
|
10
|
-
}
|
|
11
6
|
export {};
|