@gusto/embedded-react-sdk 0.10.6 → 0.10.7
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 +7 -0
- package/dist/components/Base/Base.js +19 -18
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +6 -4
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +7 -6
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +8 -7
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/TaxInputs/TaxInputs.d.ts +5 -1
- package/dist/components/Common/TaxInputs/TaxInputs.js +64 -56
- package/dist/components/Common/TaxInputs/TaxInputs.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +13 -11
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -0
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +3 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +10 -9
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +8 -7
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +8 -7
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +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 +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +17 -15
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +9 -7
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +17 -15
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +3 -2
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +1 -1
- package/dist/components/Company/Industry/Actions.js +1 -1
- package/dist/components/Company/Industry/Context.js +1 -1
- package/dist/components/Company/Industry/Edit.js +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +5 -4
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +9 -7
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +11 -9
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +6 -5
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +3 -2
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +4 -2
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +18 -16
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +26 -25
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +3 -2
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +6 -5
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +65 -59
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +1 -1
- package/dist/components/Contractor/Address/Address.js +2 -0
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +7 -6
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +1 -1
- package/dist/components/Contractor/List/index.js +3 -2
- package/dist/components/Contractor/List/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +17 -16
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -2
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +6 -5
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +3 -2
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +1 -1
- package/dist/components/Employee/Deductions/Actions.js +1 -1
- package/dist/components/Employee/Deductions/DeductionForm.js +1 -1
- package/dist/components/Employee/Deductions/DeductionsList.js +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +1 -1
- package/dist/components/Employee/Deductions/useDeductions.js +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +12 -10
- 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/DocumentList/useDocumentList.js +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +10 -8
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +4 -2
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +3 -2
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +15 -14
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +1 -1
- package/dist/components/Employee/Landing/Landing.js +7 -6
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Actions.js +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +3 -2
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +3 -2
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +4 -3
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +1 -1
- package/dist/components/Employee/Profile/Actions.js +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +10 -9
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +5 -4
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +1 -1
- package/dist/components/Employee/Profile/useProfile.js +1 -1
- package/dist/components/Employee/Taxes/Actions.js +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +1 -1
- package/dist/i18n/en/Company.StateTaxes.json.js +2 -1
- package/dist/i18n/en/Company.StateTaxes.json.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +1 -0
- package/package.json +2 -2
|
@@ -2,7 +2,7 @@ import { jsxs as l, Fragment as m, jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { useFormContext as s, useWatch as i } from "react-hook-form";
|
|
3
3
|
import { useTranslation as p } from "react-i18next";
|
|
4
4
|
import { useDeductions as b } from "./useDeductions.js";
|
|
5
|
-
import "
|
|
5
|
+
import "classnames";
|
|
6
6
|
import { useI18n as f } from "../../../i18n/I18n.js";
|
|
7
7
|
import { useComponentContext as D } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
8
|
import { TextInputField as g } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as p } from "react-i18next";
|
|
3
3
|
import { useDeductions as g } from "./useDeductions.js";
|
|
4
|
-
import "
|
|
4
|
+
import "classnames";
|
|
5
5
|
import o from "../../Common/hooks/useNumberFormatter.js";
|
|
6
6
|
import b from "../../../assets/icons/pencil.svg.js";
|
|
7
7
|
import C from "../../../assets/icons/trashcan.svg.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as n } from "react-i18next";
|
|
3
3
|
import { useDeductions as t } from "./useDeductions.js";
|
|
4
|
-
import "
|
|
4
|
+
import "classnames";
|
|
5
5
|
import { RadioGroupField as u } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
6
6
|
const m = () => {
|
|
7
7
|
const { mode: o } = t(), { t: e } = n("Employee.Deductions");
|
|
@@ -9,9 +9,9 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
|
9
9
|
import "@tanstack/react-query";
|
|
10
10
|
import "../../Base/useBase.js";
|
|
11
11
|
import "../../../shared/constants.js";
|
|
12
|
+
import "classnames";
|
|
12
13
|
import "dompurify";
|
|
13
14
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
-
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
15
15
|
import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
|
|
16
16
|
const D = r.object({
|
|
17
17
|
active: r.boolean(),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as r } from "react-i18next";
|
|
3
3
|
import { useDocumentList as s } from "./useDocumentList.js";
|
|
4
|
-
import "
|
|
4
|
+
import "classnames";
|
|
5
5
|
import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
6
6
|
import { useComponentContext as c } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
7
7
|
function C() {
|
|
@@ -2,20 +2,22 @@ import { jsx as o, jsxs as a } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEmployeeFormsListSuspense as L } from "@gusto/embedded-api/react-query/employeeFormsList";
|
|
3
3
|
import { Head as u } from "./Head.js";
|
|
4
4
|
import { List as c } from "./List.js";
|
|
5
|
-
import { Actions as
|
|
5
|
+
import { Actions as p } from "./Actions.js";
|
|
6
6
|
import { DocumentListProvider as h } from "./useDocumentList.js";
|
|
7
7
|
import { BaseComponent as F } from "../../../Base/Base.js";
|
|
8
8
|
import { useBase as S } from "../../../Base/useBase.js";
|
|
9
9
|
import { useI18n as g } from "../../../../i18n/I18n.js";
|
|
10
10
|
import { componentEvents as s } from "../../../../shared/constants.js";
|
|
11
11
|
import { Flex as O } from "../../../Common/Flex/Flex.js";
|
|
12
|
-
|
|
12
|
+
import "react-i18next";
|
|
13
|
+
import "classnames";
|
|
14
|
+
function t(e) {
|
|
13
15
|
return /* @__PURE__ */ o(F, { ...e, children: /* @__PURE__ */ o(_, { ...e }) });
|
|
14
16
|
}
|
|
15
|
-
function _({ employeeId: e, className:
|
|
17
|
+
function _({ employeeId: e, className: l, children: n }) {
|
|
16
18
|
g("Employee.DocumentSigner");
|
|
17
19
|
const { onEvent: i } = S(), { data: d, error: f } = L({ employeeId: e }), m = d.formList, E = m.every((r) => !r.requiresSigning);
|
|
18
|
-
return /* @__PURE__ */ o("section", { className:
|
|
20
|
+
return /* @__PURE__ */ o("section", { className: l, children: /* @__PURE__ */ o(
|
|
19
21
|
h,
|
|
20
22
|
{
|
|
21
23
|
value: {
|
|
@@ -29,18 +31,18 @@ function _({ employeeId: e, className: p, children: t }) {
|
|
|
29
31
|
},
|
|
30
32
|
documentListError: f
|
|
31
33
|
},
|
|
32
|
-
children:
|
|
34
|
+
children: n || /* @__PURE__ */ a(O, { flexDirection: "column", children: [
|
|
33
35
|
/* @__PURE__ */ o(u, {}),
|
|
34
36
|
/* @__PURE__ */ o(c, {}),
|
|
35
|
-
/* @__PURE__ */ o(
|
|
37
|
+
/* @__PURE__ */ o(p, {})
|
|
36
38
|
] })
|
|
37
39
|
}
|
|
38
40
|
) });
|
|
39
41
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
t.Head = u;
|
|
43
|
+
t.List = c;
|
|
44
|
+
t.Actions = p;
|
|
43
45
|
export {
|
|
44
|
-
|
|
46
|
+
t as DocumentList
|
|
45
47
|
};
|
|
46
48
|
//# sourceMappingURL=DocumentList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentList.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/DocumentList.tsx"],"sourcesContent":["import { useEmployeeFormsListSuspense } from '@gusto/embedded-api/react-query/employeeFormsList'\nimport { type Form } from '@gusto/embedded-api/models/components/form'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { DocumentListProvider } from './useDocumentList'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Flex } from '@/components/Common'\n\ninterface DocumentListProps extends CommonComponentInterface {\n employeeId: string\n}\n\nexport function DocumentList(props: DocumentListProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, className, children }: DocumentListProps) {\n useI18n('Employee.DocumentSigner')\n const { onEvent } = useBase()\n\n const { data, error: documentListError } = useEmployeeFormsListSuspense({ employeeId })\n const employeeForms = data.formList!\n\n const hasSignedAllForms = employeeForms.every(employeeForm => !employeeForm.requiresSigning)\n\n const handleRequestFormToSign = (data: Form) => {\n onEvent(componentEvents.EMPLOYEE_VIEW_FORM_TO_SIGN, { uuid: data.uuid })\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.EMPLOYEE_FORMS_DONE)\n }\n\n return (\n <section className={className}>\n <DocumentListProvider\n value={{\n employeeForms,\n hasSignedAllForms,\n handleContinue,\n handleRequestFormToSign,\n documentListError,\n }}\n >\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Actions />\n </Flex>\n )}\n </DocumentListProvider>\n </section>\n )\n}\n\nDocumentList.Head = Head\nDocumentList.List = List\nDocumentList.Actions = Actions\n"],"names":["DocumentList","props","jsx","BaseComponent","Root","employeeId","className","children","useI18n","onEvent","useBase","data","documentListError","useEmployeeFormsListSuspense","employeeForms","hasSignedAllForms","employeeForm","DocumentListProvider","componentEvents","jsxs","Flex","Head","List","Actions"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DocumentList.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/DocumentList.tsx"],"sourcesContent":["import { useEmployeeFormsListSuspense } from '@gusto/embedded-api/react-query/employeeFormsList'\nimport { type Form } from '@gusto/embedded-api/models/components/form'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { DocumentListProvider } from './useDocumentList'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Flex } from '@/components/Common'\n\ninterface DocumentListProps extends CommonComponentInterface {\n employeeId: string\n}\n\nexport function DocumentList(props: DocumentListProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, className, children }: DocumentListProps) {\n useI18n('Employee.DocumentSigner')\n const { onEvent } = useBase()\n\n const { data, error: documentListError } = useEmployeeFormsListSuspense({ employeeId })\n const employeeForms = data.formList!\n\n const hasSignedAllForms = employeeForms.every(employeeForm => !employeeForm.requiresSigning)\n\n const handleRequestFormToSign = (data: Form) => {\n onEvent(componentEvents.EMPLOYEE_VIEW_FORM_TO_SIGN, { uuid: data.uuid })\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.EMPLOYEE_FORMS_DONE)\n }\n\n return (\n <section className={className}>\n <DocumentListProvider\n value={{\n employeeForms,\n hasSignedAllForms,\n handleContinue,\n handleRequestFormToSign,\n documentListError,\n }}\n >\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Actions />\n </Flex>\n )}\n </DocumentListProvider>\n </section>\n )\n}\n\nDocumentList.Head = Head\nDocumentList.List = List\nDocumentList.Actions = Actions\n"],"names":["DocumentList","props","jsx","BaseComponent","Root","employeeId","className","children","useI18n","onEvent","useBase","data","documentListError","useEmployeeFormsListSuspense","employeeForms","hasSignedAllForms","employeeForm","DocumentListProvider","componentEvents","jsxs","Flex","Head","List","Actions"],"mappings":";;;;;;;;;;;;;AAoBO,SAASA,EAAaC,GAAmD;AAE5E,SAAA,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAM,EAAA,GAAGH,GAAO,EACnB,CAAA;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,WAAAC,GAAW,UAAAC,KAA+B;AACpE,EAAAC,EAAQ,yBAAyB;AAC3B,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAQ,GAEtB,EAAE,MAAAC,GAAM,OAAOC,MAAsBC,EAA6B,EAAE,YAAAR,GAAY,GAChFS,IAAgBH,EAAK,UAErBI,IAAoBD,EAAc,MAAM,CAAgBE,MAAA,CAACA,EAAa,eAAe;AAWzF,SAAA,gBAAAd,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACe;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,eAAAH;AAAA,QACA,mBAAAC;AAAA,QACA,gBAVe,MAAM;AAC3B,UAAAN,EAAQS,EAAgB,mBAAmB;AAAA,QAC7C;AAAA,QASQ,yBAfwB,CAACP,MAAe;AAC9C,UAAAF,EAAQS,EAAgB,4BAA4B,EAAE,MAAMP,EAAK,MAAM;AAAA,QACzE;AAAA,QAcQ,mBAAAC;AAAA,MACF;AAAA,MAEC,UACCL,KAEC,gBAAAY,EAAAC,GAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAAlB,EAACmB,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,EACX,CAAA;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ;AAEAvB,EAAa,OAAOqB;AACpBrB,EAAa,OAAOsB;AACpBtB,EAAa,UAAUuB;"}
|
|
@@ -2,8 +2,9 @@ import { jsx as o } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTranslation as m } from "react-i18next";
|
|
3
3
|
import { useDocumentList as s } from "./useDocumentList.js";
|
|
4
4
|
import { Flex as l } from "../../../Common/Flex/Flex.js";
|
|
5
|
+
import "classnames";
|
|
5
6
|
import { DocumentList as u } from "../../../Common/DocumentList/DocumentList.js";
|
|
6
|
-
function
|
|
7
|
+
function b() {
|
|
7
8
|
const { employeeForms: i, handleRequestFormToSign: n, documentListError: r } = s(), { t: e } = m("Employee.DocumentSigner");
|
|
8
9
|
return /* @__PURE__ */ o("section", { style: { width: "100%" }, children: /* @__PURE__ */ o(l, { flexDirection: "column", gap: 32, children: /* @__PURE__ */ o(
|
|
9
10
|
u,
|
|
@@ -32,6 +33,6 @@ function L() {
|
|
|
32
33
|
) }) });
|
|
33
34
|
}
|
|
34
35
|
export {
|
|
35
|
-
|
|
36
|
+
b as List
|
|
36
37
|
};
|
|
37
38
|
//# sourceMappingURL=List.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDocumentList } from './useDocumentList'\nimport { Flex, DocumentList as SharedDocumentList } from '@/components/Common'\n\nexport function List() {\n const { employeeForms, handleRequestFormToSign, documentListError } = useDocumentList()\n const { t } = useTranslation('Employee.DocumentSigner')\n\n return (\n <section style={{ width: '100%' }}>\n <Flex flexDirection=\"column\" gap={32}>\n <SharedDocumentList\n forms={employeeForms.map(form => ({\n uuid: form.uuid,\n title: form.title,\n description: form.description,\n requires_signing: form.requiresSigning,\n }))}\n onRequestSign={handleRequestFormToSign}\n withError={!!documentListError}\n label={t('documentListLabel')}\n columnLabels={{\n form: t('formColumnLabel'),\n action: t('actionColumnLabel'),\n }}\n statusLabels={{\n signCta: t('signDocumentCta'),\n notSigned: t('notSigned'),\n complete: t('signDocumentComplete'),\n }}\n emptyStateLabel={t('emptyTableTitle')}\n errorLabel={t('documentListError')}\n />\n </Flex>\n </section>\n )\n}\n"],"names":["List","employeeForms","handleRequestFormToSign","documentListError","useDocumentList","t","useTranslation","jsx","Flex","SharedDocumentList","form"],"mappings":"
|
|
1
|
+
{"version":3,"file":"List.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDocumentList } from './useDocumentList'\nimport { Flex, DocumentList as SharedDocumentList } from '@/components/Common'\n\nexport function List() {\n const { employeeForms, handleRequestFormToSign, documentListError } = useDocumentList()\n const { t } = useTranslation('Employee.DocumentSigner')\n\n return (\n <section style={{ width: '100%' }}>\n <Flex flexDirection=\"column\" gap={32}>\n <SharedDocumentList\n forms={employeeForms.map(form => ({\n uuid: form.uuid,\n title: form.title,\n description: form.description,\n requires_signing: form.requiresSigning,\n }))}\n onRequestSign={handleRequestFormToSign}\n withError={!!documentListError}\n label={t('documentListLabel')}\n columnLabels={{\n form: t('formColumnLabel'),\n action: t('actionColumnLabel'),\n }}\n statusLabels={{\n signCta: t('signDocumentCta'),\n notSigned: t('notSigned'),\n complete: t('signDocumentComplete'),\n }}\n emptyStateLabel={t('emptyTableTitle')}\n errorLabel={t('documentListError')}\n />\n </Flex>\n </section>\n )\n}\n"],"names":["List","employeeForms","handleRequestFormToSign","documentListError","useDocumentList","t","useTranslation","jsx","Flex","SharedDocumentList","form"],"mappings":";;;;;;AAIO,SAASA,IAAO;AACrB,QAAM,EAAE,eAAAC,GAAe,yBAAAC,GAAyB,mBAAAC,EAAA,IAAsBC,EAAgB,GAChF,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB;AAEtD,SACG,gBAAAC,EAAA,WAAA,EAAQ,OAAO,EAAE,OAAO,UACvB,UAAA,gBAAAA,EAACC,GAAK,EAAA,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAD;AAAA,IAACE;AAAAA,IAAA;AAAA,MACC,OAAOR,EAAc,IAAI,CAASS,OAAA;AAAA,QAChC,MAAMA,EAAK;AAAA,QACX,OAAOA,EAAK;AAAA,QACZ,aAAaA,EAAK;AAAA,QAClB,kBAAkBA,EAAK;AAAA,MAAA,EACvB;AAAA,MACF,eAAeR;AAAA,MACf,WAAW,CAAC,CAACC;AAAA,MACb,OAAOE,EAAE,mBAAmB;AAAA,MAC5B,cAAc;AAAA,QACZ,MAAMA,EAAE,iBAAiB;AAAA,QACzB,QAAQA,EAAE,mBAAmB;AAAA,MAC/B;AAAA,MACA,cAAc;AAAA,QACZ,SAASA,EAAE,iBAAiB;AAAA,QAC5B,WAAWA,EAAE,WAAW;AAAA,QACxB,UAAUA,EAAE,sBAAsB;AAAA,MACpC;AAAA,MACA,iBAAiBA,EAAE,iBAAiB;AAAA,MACpC,YAAYA,EAAE,mBAAmB;AAAA,IAAA;AAAA,KAErC,EACF,CAAA;AAEJ;"}
|
|
@@ -8,9 +8,9 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
|
8
8
|
import "@tanstack/react-query";
|
|
9
9
|
import "../../../Base/useBase.js";
|
|
10
10
|
import "../../../../shared/constants.js";
|
|
11
|
+
import "classnames";
|
|
11
12
|
import "dompurify";
|
|
12
13
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
-
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
14
|
import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
|
|
15
15
|
const [d, a] = t("DocumentListContext");
|
|
16
16
|
export {
|
|
@@ -12,11 +12,13 @@ import { useBase as G } from "../../../Base/useBase.js";
|
|
|
12
12
|
import { useI18n as H } from "../../../../i18n/I18n.js";
|
|
13
13
|
import { componentEvents as s } from "../../../../shared/constants.js";
|
|
14
14
|
import { Flex as M } from "../../../Common/Flex/Flex.js";
|
|
15
|
+
import "react-i18next";
|
|
16
|
+
import "classnames";
|
|
15
17
|
import { SignatureForm as R } from "../../../Common/SignatureForm/SignatureForm.js";
|
|
16
|
-
function
|
|
18
|
+
function t(r) {
|
|
17
19
|
return /* @__PURE__ */ o(C, { ...r, children: /* @__PURE__ */ o(j, { ...r }) });
|
|
18
20
|
}
|
|
19
|
-
function j({ employeeId: r, formId: d, className: p, children:
|
|
21
|
+
function j({ employeeId: r, formId: d, className: p, children: n }) {
|
|
20
22
|
H("Employee.DocumentSigner");
|
|
21
23
|
const { onEvent: m, baseSubmitHandler: l } = G(), { data: g } = w({ employeeId: r, formId: d }), e = g.form, {
|
|
22
24
|
data: { formPdf: F }
|
|
@@ -48,7 +50,7 @@ function j({ employeeId: r, formId: d, className: p, children: t }) {
|
|
|
48
50
|
m(s.EMPLOYEE_SIGN_FORM, v);
|
|
49
51
|
}
|
|
50
52
|
});
|
|
51
|
-
}, children: /* @__PURE__ */ o(M, { flexDirection: "column", children:
|
|
53
|
+
}, children: /* @__PURE__ */ o(M, { flexDirection: "column", children: n || /* @__PURE__ */ x(b, { children: [
|
|
52
54
|
/* @__PURE__ */ o(a, {}),
|
|
53
55
|
/* @__PURE__ */ o(f, {}),
|
|
54
56
|
/* @__PURE__ */ o(u, {}),
|
|
@@ -57,11 +59,11 @@ function j({ employeeId: r, formId: d, className: p, children: t }) {
|
|
|
57
59
|
}
|
|
58
60
|
) });
|
|
59
61
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
t.Head = a;
|
|
63
|
+
t.Preview = f;
|
|
64
|
+
t.Form = u;
|
|
65
|
+
t.Actions = c;
|
|
64
66
|
export {
|
|
65
|
-
|
|
67
|
+
t as SignatureForm
|
|
66
68
|
};
|
|
67
69
|
//# sourceMappingURL=SignatureForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignatureForm.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { useEmployeeFormsGetPdfSuspense } from '@gusto/embedded-api/react-query/employeeFormsGetPdf'\nimport { useEmployeeFormsSignMutation } from '@gusto/embedded-api/react-query/employeeFormsSign'\nimport { useEmployeeFormsGetSuspense } from '@gusto/embedded-api/react-query/employeeFormsGet'\nimport { Form as FormComponent } from './Form'\nimport { Head } from './Head'\nimport { Actions } from './Actions'\nimport { Preview } from './Preview'\nimport { SignatureFormProvider } from './useSignatureForm'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Flex } from '@/components/Common'\nimport type { SignatureFormInputs } from '@/components/Common/SignatureForm'\nimport { SignatureForm as SharedSignatureForm } from '@/components/Common/SignatureForm'\n\ninterface SignatureFormProps extends CommonComponentInterface {\n employeeId: string\n formId: string\n}\n\nexport function SignatureForm(props: SignatureFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, formId, className, children }: SignatureFormProps) {\n useI18n('Employee.DocumentSigner')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useEmployeeFormsGetSuspense({ employeeId, formId })\n const form = data.form!\n\n const {\n data: { formPdf },\n } = useEmployeeFormsGetPdfSuspense({ employeeId, formId: form.uuid })\n const pdfUrl = formPdf!.documentUrl\n\n const { mutateAsync: signForm, isPending: isSignFormPending } = useEmployeeFormsSignMutation()\n\n const handleBack = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n const handleSubmit = async (data: SignatureFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n if (form.uuid) {\n const { form: signFormResult } = await signForm({\n request: {\n employeeId,\n formId: form.uuid,\n requestBody: {\n signatureText: payload.signature,\n agree: payload.confirmSignature,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_SIGN_FORM, signFormResult)\n }\n })\n }\n\n return (\n <section className={className}>\n <SignatureFormProvider\n value={{\n pdfUrl,\n handleBack,\n form,\n isPending: isSignFormPending,\n }}\n >\n <SharedSignatureForm onSubmit={handleSubmit}>\n <Flex flexDirection=\"column\">\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Preview />\n <FormComponent />\n <Actions />\n </>\n )}\n </Flex>\n </SharedSignatureForm>\n </SignatureFormProvider>\n </section>\n )\n}\n\nSignatureForm.Head = Head\nSignatureForm.Preview = Preview\nSignatureForm.Form = FormComponent\nSignatureForm.Actions = Actions\n"],"names":["SignatureForm","props","jsx","BaseComponent","Root","employeeId","formId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","data","useEmployeeFormsGetSuspense","form","formPdf","useEmployeeFormsGetPdfSuspense","pdfUrl","signForm","isSignFormPending","useEmployeeFormsSignMutation","SignatureFormProvider","componentEvents","SharedSignatureForm","payload","signFormResult","Flex","jsxs","Fragment","Head","Preview","FormComponent","Actions"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SignatureForm.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { useEmployeeFormsGetPdfSuspense } from '@gusto/embedded-api/react-query/employeeFormsGetPdf'\nimport { useEmployeeFormsSignMutation } from '@gusto/embedded-api/react-query/employeeFormsSign'\nimport { useEmployeeFormsGetSuspense } from '@gusto/embedded-api/react-query/employeeFormsGet'\nimport { Form as FormComponent } from './Form'\nimport { Head } from './Head'\nimport { Actions } from './Actions'\nimport { Preview } from './Preview'\nimport { SignatureFormProvider } from './useSignatureForm'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Flex } from '@/components/Common'\nimport type { SignatureFormInputs } from '@/components/Common/SignatureForm'\nimport { SignatureForm as SharedSignatureForm } from '@/components/Common/SignatureForm'\n\ninterface SignatureFormProps extends CommonComponentInterface {\n employeeId: string\n formId: string\n}\n\nexport function SignatureForm(props: SignatureFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, formId, className, children }: SignatureFormProps) {\n useI18n('Employee.DocumentSigner')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useEmployeeFormsGetSuspense({ employeeId, formId })\n const form = data.form!\n\n const {\n data: { formPdf },\n } = useEmployeeFormsGetPdfSuspense({ employeeId, formId: form.uuid })\n const pdfUrl = formPdf!.documentUrl\n\n const { mutateAsync: signForm, isPending: isSignFormPending } = useEmployeeFormsSignMutation()\n\n const handleBack = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n const handleSubmit = async (data: SignatureFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n if (form.uuid) {\n const { form: signFormResult } = await signForm({\n request: {\n employeeId,\n formId: form.uuid,\n requestBody: {\n signatureText: payload.signature,\n agree: payload.confirmSignature,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_SIGN_FORM, signFormResult)\n }\n })\n }\n\n return (\n <section className={className}>\n <SignatureFormProvider\n value={{\n pdfUrl,\n handleBack,\n form,\n isPending: isSignFormPending,\n }}\n >\n <SharedSignatureForm onSubmit={handleSubmit}>\n <Flex flexDirection=\"column\">\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Preview />\n <FormComponent />\n <Actions />\n </>\n )}\n </Flex>\n </SharedSignatureForm>\n </SignatureFormProvider>\n </section>\n )\n}\n\nSignatureForm.Head = Head\nSignatureForm.Preview = Preview\nSignatureForm.Form = FormComponent\nSignatureForm.Actions = Actions\n"],"names":["SignatureForm","props","jsx","BaseComponent","Root","employeeId","formId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","data","useEmployeeFormsGetSuspense","form","formPdf","useEmployeeFormsGetPdfSuspense","pdfUrl","signForm","isSignFormPending","useEmployeeFormsSignMutation","SignatureFormProvider","componentEvents","SharedSignatureForm","payload","signFormResult","Flex","jsxs","Fragment","Head","Preview","FormComponent","Actions"],"mappings":";;;;;;;;;;;;;;;;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AAAA,UAAA;AAAA,QAC5D,CACD;AAAA,MACH,GAaQ,UAAA,gBAAAxB,EAACyB,KAAK,eAAc,UACjB,UACCnB,KAGE,gBAAAoB,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAA3B,EAAC4B,GAAK,EAAA;AAAA,0BACLC,GAAQ,EAAA;AAAA,0BACRC,GAAc,EAAA;AAAA,0BACdC,GAAQ,CAAA,CAAA;AAAA,MAAA,EACX,CAAA,EAEJ,CAAA,EACF,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEAjC,EAAc,OAAO8B;AACrB9B,EAAc,UAAU+B;AACxB/B,EAAc,OAAOgC;AACrBhC,EAAc,UAAUiC;"}
|
|
@@ -8,9 +8,9 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
|
8
8
|
import "@tanstack/react-query";
|
|
9
9
|
import "../../../Base/useBase.js";
|
|
10
10
|
import "../../../../shared/constants.js";
|
|
11
|
+
import "classnames";
|
|
11
12
|
import "dompurify";
|
|
12
13
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
-
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
14
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
15
15
|
const [c, d] = o("SignatureFormContext");
|
|
16
16
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as r } from "react-i18next";
|
|
3
3
|
import { useEmployeeList as m } from "./useEmployeeList.js";
|
|
4
|
-
import "
|
|
4
|
+
import "classnames";
|
|
5
5
|
import { ActionsLayout as s } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
6
6
|
import { useComponentContext as p } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
7
7
|
function C() {
|
|
@@ -8,6 +8,8 @@ import { Actions as h } from "./Actions.js";
|
|
|
8
8
|
import { BaseComponent as H } from "../../Base/Base.js";
|
|
9
9
|
import { useBase as j } from "../../Base/useBase.js";
|
|
10
10
|
import { Flex as k } from "../../Common/Flex/Flex.js";
|
|
11
|
+
import "react-i18next";
|
|
12
|
+
import "classnames";
|
|
11
13
|
import { useI18n as V, useComponentDictionary as z } from "../../../i18n/I18n.js";
|
|
12
14
|
import { componentEvents as s, EmployeeOnboardingStatus as l } from "../../../shared/constants.js";
|
|
13
15
|
import { Head as P } from "./Head.js";
|
|
@@ -95,12 +97,12 @@ function K({ companyId: n, className: E, children: p, dictionary: g }) {
|
|
|
95
97
|
m.Head = P;
|
|
96
98
|
m.List = O;
|
|
97
99
|
m.Actions = h;
|
|
98
|
-
const
|
|
100
|
+
const he = () => {
|
|
99
101
|
const { companyId: n, onEvent: E } = J();
|
|
100
102
|
return /* @__PURE__ */ o(m, { companyId: n, onEvent: E });
|
|
101
103
|
};
|
|
102
104
|
export {
|
|
103
105
|
m as EmployeeList,
|
|
104
|
-
|
|
106
|
+
he as EmployeeListContextual
|
|
105
107
|
};
|
|
106
108
|
//# sourceMappingURL=EmployeeList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmployeeList.js","sources":["../../../../src/components/Employee/EmployeeList/EmployeeList.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { useEmployeesListSuspense } from '@gusto/embedded-api/react-query/employeesList'\nimport type { OnboardingStatus } from '@gusto/embedded-api/models/operations/putv1employeesemployeeidonboardingstatus'\nimport { useEmployeesDeleteMutation } from '@gusto/embedded-api/react-query/employeesDelete'\nimport { useEmployeesUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlow'\nimport { EmployeeListProvider } from './useEmployeeList'\nimport { Actions } from './Actions'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { componentEvents, EmployeeOnboardingStatus } from '@/shared/constants'\nimport { Head } from '@/components/Employee/EmployeeList/Head'\nimport { List } from '@/components/Employee/EmployeeList/List'\nimport { useFlow } from '@/components/Flow/useFlow'\n\n//Interface for component specific props\ninterface EmployeeListProps extends CommonComponentInterface<'Employee.EmployeeList'> {\n companyId: string\n}\n\nexport function EmployeeList(props: EmployeeListProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\nfunction Root({ companyId, className, children, dictionary }: EmployeeListProps) {\n //Using i18n hook to directly load necessary namespace\n useI18n('Employee.EmployeeList')\n useComponentDictionary('Employee.EmployeeList', dictionary)\n //Getting props from base context\n const { onEvent, baseSubmitHandler } = useBase()\n const [currentPage, setCurrentPage] = useState(1)\n const [itemsPerPage, setItemsPerPage] = useState(5)\n\n const { data } = useEmployeesListSuspense({ companyId, page: currentPage, per: itemsPerPage })\n const { httpMeta, showEmployees: employeeList } = data\n const employees = employeeList!\n\n const { mutateAsync: deleteEmployeeMutation } = useEmployeesDeleteMutation()\n const { mutateAsync: updateEmployeeOnboardingStatusMutation } =\n useEmployeesUpdateOnboardingStatusMutation()\n\n const totalPages = Number(httpMeta.response.headers.get('x-total-pages') ?? 1)\n\n const handleItemsPerPageChange = (newCount: number) => {\n setItemsPerPage(newCount)\n }\n const handleFirstPage = () => {\n setCurrentPage(1)\n }\n const handlePreviousPage = () => {\n setCurrentPage(prevPage => Math.max(prevPage - 1, 1))\n }\n const handleNextPage = () => {\n setCurrentPage(prevPage => Math.min(prevPage + 1, totalPages))\n }\n const handleLastPage = () => {\n setCurrentPage(totalPages)\n }\n const handleDelete = async (uuid: string) => {\n await baseSubmitHandler(uuid, async payload => {\n await deleteEmployeeMutation({\n request: { employeeId: payload },\n })\n\n onEvent(componentEvents.EMPLOYEE_DELETED, { employeeId: payload })\n })\n }\n /**Set onboarding status to self_onboarding_awaiting_admin_review and proceed to edit */\n const handleReview = async (data: string) => {\n await baseSubmitHandler(data, async employeeId => {\n await updateOnboardingStatus({\n employeeId,\n status: EmployeeOnboardingStatus.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW,\n })\n onEvent(componentEvents.EMPLOYEE_UPDATE, {\n employeeId,\n onboardingStatus: EmployeeOnboardingStatus.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW,\n })\n })\n }\n /**Update employee onboarding status reverting it back to admin_onboarding_incomplete */\n const handleCancelSelfOnboarding = async (data: string) => {\n await baseSubmitHandler(data, async employeeId => {\n await updateOnboardingStatus({\n employeeId,\n status: EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE,\n })\n })\n }\n const updateOnboardingStatus = async (data: { employeeId: string; status: OnboardingStatus }) => {\n await baseSubmitHandler(data, async ({ employeeId, status }) => {\n const { employeeOnboardingStatus: responseData } =\n await updateEmployeeOnboardingStatusMutation({\n request: { employeeId, requestBody: { onboardingStatus: status } },\n })\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_STATUS_UPDATED, responseData)\n })\n }\n const handleNew = () => {\n onEvent(componentEvents.EMPLOYEE_CREATE)\n }\n const handleSkip = () => {\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_DONE)\n }\n\n const handleEdit = (uuid: string, onboardingStatus?: OnboardingStatus) => {\n onEvent(componentEvents.EMPLOYEE_UPDATE, { employeeId: uuid, onboardingStatus })\n }\n return (\n <section className={className}>\n <EmployeeListProvider\n value={{\n handleEdit,\n handleNew,\n handleReview,\n handleDelete,\n employees,\n currentPage,\n totalPages,\n handleFirstPage,\n handlePreviousPage,\n handleNextPage,\n handleLastPage,\n handleCancelSelfOnboarding,\n handleItemsPerPageChange,\n handleSkip,\n }}\n >\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Actions />\n </Flex>\n )}\n </EmployeeListProvider>\n </section>\n )\n}\n\nEmployeeList.Head = Head\nEmployeeList.List = List\nEmployeeList.Actions = Actions\n\n/**\n * Wrapper used inside Flows -> exposes flow context for required parameters\n */\nexport const EmployeeListContextual = () => {\n const { companyId, onEvent } = useFlow<OnboardingContextInterface>()\n return <EmployeeList companyId={companyId} onEvent={onEvent} />\n}\n"],"names":["EmployeeList","props","jsx","BaseComponent","Root","companyId","className","children","dictionary","useI18n","useComponentDictionary","onEvent","baseSubmitHandler","useBase","currentPage","setCurrentPage","useState","itemsPerPage","setItemsPerPage","data","useEmployeesListSuspense","httpMeta","employeeList","employees","deleteEmployeeMutation","useEmployeesDeleteMutation","updateEmployeeOnboardingStatusMutation","useEmployeesUpdateOnboardingStatusMutation","totalPages","handleItemsPerPageChange","newCount","handleFirstPage","handlePreviousPage","prevPage","handleNextPage","handleLastPage","handleDelete","uuid","payload","componentEvents","handleReview","employeeId","updateOnboardingStatus","EmployeeOnboardingStatus","handleCancelSelfOnboarding","status","responseData","EmployeeListProvider","onboardingStatus","jsxs","Flex","Head","List","Actions","EmployeeListContextual","useFlow"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EmployeeList.js","sources":["../../../../src/components/Employee/EmployeeList/EmployeeList.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { useEmployeesListSuspense } from '@gusto/embedded-api/react-query/employeesList'\nimport type { OnboardingStatus } from '@gusto/embedded-api/models/operations/putv1employeesemployeeidonboardingstatus'\nimport { useEmployeesDeleteMutation } from '@gusto/embedded-api/react-query/employeesDelete'\nimport { useEmployeesUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlow'\nimport { EmployeeListProvider } from './useEmployeeList'\nimport { Actions } from './Actions'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { componentEvents, EmployeeOnboardingStatus } from '@/shared/constants'\nimport { Head } from '@/components/Employee/EmployeeList/Head'\nimport { List } from '@/components/Employee/EmployeeList/List'\nimport { useFlow } from '@/components/Flow/useFlow'\n\n//Interface for component specific props\ninterface EmployeeListProps extends CommonComponentInterface<'Employee.EmployeeList'> {\n companyId: string\n}\n\nexport function EmployeeList(props: EmployeeListProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\nfunction Root({ companyId, className, children, dictionary }: EmployeeListProps) {\n //Using i18n hook to directly load necessary namespace\n useI18n('Employee.EmployeeList')\n useComponentDictionary('Employee.EmployeeList', dictionary)\n //Getting props from base context\n const { onEvent, baseSubmitHandler } = useBase()\n const [currentPage, setCurrentPage] = useState(1)\n const [itemsPerPage, setItemsPerPage] = useState(5)\n\n const { data } = useEmployeesListSuspense({ companyId, page: currentPage, per: itemsPerPage })\n const { httpMeta, showEmployees: employeeList } = data\n const employees = employeeList!\n\n const { mutateAsync: deleteEmployeeMutation } = useEmployeesDeleteMutation()\n const { mutateAsync: updateEmployeeOnboardingStatusMutation } =\n useEmployeesUpdateOnboardingStatusMutation()\n\n const totalPages = Number(httpMeta.response.headers.get('x-total-pages') ?? 1)\n\n const handleItemsPerPageChange = (newCount: number) => {\n setItemsPerPage(newCount)\n }\n const handleFirstPage = () => {\n setCurrentPage(1)\n }\n const handlePreviousPage = () => {\n setCurrentPage(prevPage => Math.max(prevPage - 1, 1))\n }\n const handleNextPage = () => {\n setCurrentPage(prevPage => Math.min(prevPage + 1, totalPages))\n }\n const handleLastPage = () => {\n setCurrentPage(totalPages)\n }\n const handleDelete = async (uuid: string) => {\n await baseSubmitHandler(uuid, async payload => {\n await deleteEmployeeMutation({\n request: { employeeId: payload },\n })\n\n onEvent(componentEvents.EMPLOYEE_DELETED, { employeeId: payload })\n })\n }\n /**Set onboarding status to self_onboarding_awaiting_admin_review and proceed to edit */\n const handleReview = async (data: string) => {\n await baseSubmitHandler(data, async employeeId => {\n await updateOnboardingStatus({\n employeeId,\n status: EmployeeOnboardingStatus.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW,\n })\n onEvent(componentEvents.EMPLOYEE_UPDATE, {\n employeeId,\n onboardingStatus: EmployeeOnboardingStatus.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW,\n })\n })\n }\n /**Update employee onboarding status reverting it back to admin_onboarding_incomplete */\n const handleCancelSelfOnboarding = async (data: string) => {\n await baseSubmitHandler(data, async employeeId => {\n await updateOnboardingStatus({\n employeeId,\n status: EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE,\n })\n })\n }\n const updateOnboardingStatus = async (data: { employeeId: string; status: OnboardingStatus }) => {\n await baseSubmitHandler(data, async ({ employeeId, status }) => {\n const { employeeOnboardingStatus: responseData } =\n await updateEmployeeOnboardingStatusMutation({\n request: { employeeId, requestBody: { onboardingStatus: status } },\n })\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_STATUS_UPDATED, responseData)\n })\n }\n const handleNew = () => {\n onEvent(componentEvents.EMPLOYEE_CREATE)\n }\n const handleSkip = () => {\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_DONE)\n }\n\n const handleEdit = (uuid: string, onboardingStatus?: OnboardingStatus) => {\n onEvent(componentEvents.EMPLOYEE_UPDATE, { employeeId: uuid, onboardingStatus })\n }\n return (\n <section className={className}>\n <EmployeeListProvider\n value={{\n handleEdit,\n handleNew,\n handleReview,\n handleDelete,\n employees,\n currentPage,\n totalPages,\n handleFirstPage,\n handlePreviousPage,\n handleNextPage,\n handleLastPage,\n handleCancelSelfOnboarding,\n handleItemsPerPageChange,\n handleSkip,\n }}\n >\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Actions />\n </Flex>\n )}\n </EmployeeListProvider>\n </section>\n )\n}\n\nEmployeeList.Head = Head\nEmployeeList.List = List\nEmployeeList.Actions = Actions\n\n/**\n * Wrapper used inside Flows -> exposes flow context for required parameters\n */\nexport const EmployeeListContextual = () => {\n const { companyId, onEvent } = useFlow<OnboardingContextInterface>()\n return <EmployeeList companyId={companyId} onEvent={onEvent} />\n}\n"],"names":["EmployeeList","props","jsx","BaseComponent","Root","companyId","className","children","dictionary","useI18n","useComponentDictionary","onEvent","baseSubmitHandler","useBase","currentPage","setCurrentPage","useState","itemsPerPage","setItemsPerPage","data","useEmployeesListSuspense","httpMeta","employeeList","employees","deleteEmployeeMutation","useEmployeesDeleteMutation","updateEmployeeOnboardingStatusMutation","useEmployeesUpdateOnboardingStatusMutation","totalPages","handleItemsPerPageChange","newCount","handleFirstPage","handlePreviousPage","prevPage","handleNextPage","handleLastPage","handleDelete","uuid","payload","componentEvents","handleReview","employeeId","updateOnboardingStatus","EmployeeOnboardingStatus","handleCancelSelfOnboarding","status","responseData","EmployeeListProvider","onboardingStatus","jsxs","Flex","Head","List","Actions","EmployeeListContextual","useFlow"],"mappings":";;;;;;;;;;;;;;;;;AA0BO,SAASA,EAAaC,GAAmD;AAE5E,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,YAAAC,KAAiC;AAE/E,EAAAC,EAAQ,uBAAuB,GAC/BC,EAAuB,yBAAyBF,CAAU;AAE1D,QAAM,EAAE,SAAAG,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GACzC,CAACC,GAAaC,CAAc,IAAIC,EAAS,CAAC,GAC1C,CAACC,GAAcC,CAAe,IAAIF,EAAS,CAAC,GAE5C,EAAE,MAAAG,MAASC,EAAyB,EAAE,WAAAf,GAAW,MAAMS,GAAa,KAAKG,GAAc,GACvF,EAAE,UAAAI,GAAU,eAAeC,EAAiB,IAAAH,GAC5CI,IAAYD,GAEZ,EAAE,aAAaE,EAAuB,IAAIC,EAA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D,GAAW,SAAAM,EAAQ,IAAI4C,EAAoC;AAC5D,SAAA,gBAAArD,EAACF,GAAa,EAAA,WAAAK,GAAsB,SAAAM,EAAkB,CAAA;AAC/D;"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as n } from "react-i18next";
|
|
3
3
|
import { Flex as r } from "../../Common/Flex/Flex.js";
|
|
4
|
+
import "classnames";
|
|
4
5
|
import { useComponentContext as m } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
5
|
-
const
|
|
6
|
+
const c = () => {
|
|
6
7
|
const { t } = n("Employee.EmployeeList"), o = m();
|
|
7
8
|
return /* @__PURE__ */ e(r, { justifyContent: "space-between", alignItems: "center", children: /* @__PURE__ */ e(o.Heading, { as: "h2", children: t("title") }) });
|
|
8
9
|
};
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
+
c as Head
|
|
11
12
|
};
|
|
12
13
|
//# sourceMappingURL=Head.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Head.js","sources":["../../../../src/components/Employee/EmployeeList/Head.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n// Head slot for EmployeeList component\nexport const Head = () => {\n const { t } = useTranslation('Employee.EmployeeList')\n const Components = useComponentContext()\n\n return (\n <Flex justifyContent=\"space-between\" alignItems=\"center\">\n <Components.Heading as=\"h2\">{t('title')}</Components.Heading>\n </Flex>\n )\n}\n"],"names":["Head","useTranslation","Components","useComponentContext","jsx","Flex"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Head.js","sources":["../../../../src/components/Employee/EmployeeList/Head.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n// Head slot for EmployeeList component\nexport const Head = () => {\n const { t } = useTranslation('Employee.EmployeeList')\n const Components = useComponentContext()\n\n return (\n <Flex justifyContent=\"space-between\" alignItems=\"center\">\n <Components.Heading as=\"h2\">{t('title')}</Components.Heading>\n </Flex>\n )\n}\n"],"names":["Head","useTranslation","Components","useComponentContext","jsx","Flex"],"mappings":";;;;;AAKO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,uBAAuB,GAC9CC,IAAaC,EAAoB;AAEvC,SACG,gBAAAC,EAAAC,GAAA,EAAK,gBAAe,iBAAgB,YAAW,UAC9C,UAAA,gBAAAD,EAACF,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAE,EAAA,OAAO,EAAE,CAAA,GAC1C;AAEJ;"}
|
|
@@ -3,18 +3,19 @@ import { useTranslation as A } from "react-i18next";
|
|
|
3
3
|
import { useState as T } from "react";
|
|
4
4
|
import k from "./List.module.scss.js";
|
|
5
5
|
import { useEmployeeList as w } from "./useEmployeeList.js";
|
|
6
|
-
import
|
|
7
|
-
import { EmptyData as
|
|
6
|
+
import "classnames";
|
|
7
|
+
import { EmptyData as B } from "../../Common/EmptyData/EmptyData.js";
|
|
8
8
|
import { ActionsLayout as h } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
9
|
-
import { useComponentContext as
|
|
10
|
-
import { HamburgerMenu as
|
|
11
|
-
import { EmployeeOnboardingStatusBadge as
|
|
9
|
+
import { useComponentContext as M } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
|
+
import { HamburgerMenu as y } from "../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
11
|
+
import { EmployeeOnboardingStatusBadge as G } from "../../Common/OnboardingStatusBadge/index.js";
|
|
12
12
|
import s from "../../../assets/icons/pencil.svg.js";
|
|
13
|
-
import
|
|
13
|
+
import R from "../../../assets/icons/trashcan.svg.js";
|
|
14
|
+
import { EmployeeOnboardingStatus as i, EmployeeSelfOnboardingStatuses as x } from "../../../shared/constants.js";
|
|
14
15
|
import { firstLastName as F } from "../../../helpers/formattedStrings.js";
|
|
15
16
|
import { useDataView as V } from "../../Common/DataView/useDataView.js";
|
|
16
17
|
import { DataView as j } from "../../Common/DataView/DataView.js";
|
|
17
|
-
const
|
|
18
|
+
const rt = () => {
|
|
18
19
|
const {
|
|
19
20
|
handleDelete: g,
|
|
20
21
|
employees: d,
|
|
@@ -30,7 +31,7 @@ const it = () => {
|
|
|
30
31
|
currentPage: O,
|
|
31
32
|
totalPages: _,
|
|
32
33
|
handleSkip: D
|
|
33
|
-
} = w(), r =
|
|
34
|
+
} = w(), r = M(), { t: a } = A("Employee.EmployeeList"), [I, u] = T(/* @__PURE__ */ new Set()), { ...P } = V({
|
|
34
35
|
data: d,
|
|
35
36
|
columns: [
|
|
36
37
|
{
|
|
@@ -45,7 +46,7 @@ const it = () => {
|
|
|
45
46
|
key: "status",
|
|
46
47
|
title: a("statusLabel"),
|
|
47
48
|
render: ({ onboarded: t, onboardingStatus: n }) => /* @__PURE__ */ e(
|
|
48
|
-
|
|
49
|
+
G,
|
|
49
50
|
{
|
|
50
51
|
onboarded: t,
|
|
51
52
|
onboardingStatus: n
|
|
@@ -61,7 +62,7 @@ const it = () => {
|
|
|
61
62
|
p(t.uuid, t.onboardingStatus ?? void 0);
|
|
62
63
|
},
|
|
63
64
|
icon: /* @__PURE__ */ e(s, { "aria-hidden": !0 })
|
|
64
|
-
}),
|
|
65
|
+
}), x.has(t.onboarding_status ?? "") && n.push({
|
|
65
66
|
label: a("cancelSelfOnboardingCta"),
|
|
66
67
|
onClick: async () => {
|
|
67
68
|
await b(t.uuid);
|
|
@@ -83,9 +84,9 @@ const it = () => {
|
|
|
83
84
|
});
|
|
84
85
|
});
|
|
85
86
|
},
|
|
86
|
-
icon: /* @__PURE__ */ e(
|
|
87
|
+
icon: /* @__PURE__ */ e(R, { "aria-hidden": !0 })
|
|
87
88
|
}), /* @__PURE__ */ e(
|
|
88
|
-
|
|
89
|
+
y,
|
|
89
90
|
{
|
|
90
91
|
items: n,
|
|
91
92
|
triggerLabel: a("hamburgerTitle"),
|
|
@@ -102,7 +103,7 @@ const it = () => {
|
|
|
102
103
|
currentPage: O,
|
|
103
104
|
totalPages: _
|
|
104
105
|
},
|
|
105
|
-
emptyState: () => /* @__PURE__ */ e(
|
|
106
|
+
emptyState: () => /* @__PURE__ */ e(B, { title: a("emptyTableTitle"), description: a("emptyTableDescription"), children: /* @__PURE__ */ c(h, { justifyContent: "center", children: [
|
|
106
107
|
/* @__PURE__ */ e(r.Button, { variant: "secondary", onClick: D, children: a("skipCta") }),
|
|
107
108
|
/* @__PURE__ */ e(r.Button, { variant: "primary", onClick: l, children: a("addEmployeeCTA") })
|
|
108
109
|
] }) })
|
|
@@ -113,6 +114,6 @@ const it = () => {
|
|
|
113
114
|
] });
|
|
114
115
|
};
|
|
115
116
|
export {
|
|
116
|
-
|
|
117
|
+
rt as List
|
|
117
118
|
};
|
|
118
119
|
//# sourceMappingURL=List.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sources":["../../../../src/components/Employee/EmployeeList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useState } from 'react'\nimport style from './List.module.scss'\nimport { useEmployeeList } from './useEmployeeList'\nimport { DataView, EmptyData, ActionsLayout, useDataView } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { EmployeeOnboardingStatusBadge } from '@/components/Common/OnboardingStatusBadge'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { EmployeeOnboardingStatus, EmployeeSelfOnboardingStatuses } from '@/shared/constants'\nimport { firstLastName } from '@/helpers/formattedStrings'\n\n/**List of employees slot for EmployeeList component */\nexport const List = () => {\n const {\n handleDelete,\n employees,\n handleEdit,\n handleReview,\n handleNew,\n handleCancelSelfOnboarding,\n handleFirstPage,\n handlePreviousPage,\n handleNextPage,\n handleLastPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n handleSkip,\n } = useEmployeeList()\n const Components = useComponentContext()\n\n const { t } = useTranslation('Employee.EmployeeList')\n const [deleting, setDeleting] = useState<Set<string>>(new Set())\n const { ...dataViewProps } = useDataView({\n data: employees,\n columns: [\n {\n key: 'name',\n title: t('nameLabel'),\n render: employee => {\n return firstLastName({\n first_name: employee.firstName,\n last_name: employee.lastName,\n })\n },\n },\n {\n key: 'status',\n title: t('statusLabel'),\n render: ({ onboarded, onboardingStatus }) => (\n <EmployeeOnboardingStatusBadge\n onboarded={onboarded}\n onboardingStatus={onboardingStatus}\n />\n ),\n },\n ],\n itemMenu: employee => {\n const menuItems = []\n\n // Edit item\n if (\n employee.onboardingStatus === EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE ||\n employee.onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE ||\n employee.onboardingStatus ===\n EmployeeOnboardingStatus.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW ||\n employee.onboardingStatus === EmployeeOnboardingStatus.ONBOARDING_COMPLETED\n ) {\n menuItems.push({\n label: t('editCta'),\n onClick: () => {\n handleEdit(employee.uuid, employee.onboardingStatus ?? undefined)\n },\n icon: <PencilSvg aria-hidden />,\n })\n }\n\n // Cancel self onboarding item\n /* @ts-expect-error: onboarding_status during runtime can be one of self onboarding statuses */\n if (EmployeeSelfOnboardingStatuses.has(employee.onboarding_status ?? '')) {\n menuItems.push({\n label: t('cancelSelfOnboardingCta'),\n onClick: async () => {\n await handleCancelSelfOnboarding(employee.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n })\n }\n\n // Review item\n if (\n employee.onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_COMPLETED_BY_EMPLOYEE\n ) {\n menuItems.push({\n label: t('reviewCta'),\n onClick: () => {\n void handleReview(employee.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n })\n }\n\n // Delete item\n if (!employee.onboarded) {\n menuItems.push({\n label: t('deleteCta'),\n onClick: () => {\n setDeleting(prev => new Set(prev).add(employee.uuid))\n void handleDelete(employee.uuid).then(() => {\n setDeleting(prev => {\n const newSet = new Set(prev)\n newSet.delete(employee.uuid)\n return newSet\n })\n })\n },\n icon: <TrashCanSvg aria-hidden />,\n })\n }\n\n return (\n <HamburgerMenu\n items={menuItems}\n triggerLabel={t('hamburgerTitle')}\n isLoading={deleting.has(employee.uuid)}\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 <ActionsLayout justifyContent=\"center\">\n <Components.Button variant=\"secondary\" onClick={handleSkip}>\n {t('skipCta')}\n </Components.Button>\n <Components.Button variant=\"primary\" onClick={handleNew}>\n {t('addEmployeeCTA')}\n </Components.Button>\n </ActionsLayout>\n </EmptyData>\n ),\n })\n return (\n <>\n {employees.length > 0 && (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleNew}>\n {t('addAnotherCta')}\n </Components.Button>\n </ActionsLayout>\n )}\n <div className={style.container}>\n <DataView label={t('employeeListLabel')} {...dataViewProps} />\n </div>\n </>\n )\n}\n"],"names":["List","handleDelete","employees","handleEdit","handleReview","handleNew","handleCancelSelfOnboarding","handleFirstPage","handlePreviousPage","handleNextPage","handleLastPage","handleItemsPerPageChange","currentPage","totalPages","handleSkip","useEmployeeList","Components","useComponentContext","t","useTranslation","deleting","setDeleting","useState","dataViewProps","useDataView","employee","firstLastName","onboarded","onboardingStatus","jsx","EmployeeOnboardingStatusBadge","menuItems","EmployeeOnboardingStatus","PencilSvg","EmployeeSelfOnboardingStatuses","prev","newSet","TrashCanSvg","HamburgerMenu","EmptyData","jsxs","ActionsLayout","Fragment","style","DataView"],"mappings":"
|
|
1
|
+
{"version":3,"file":"List.js","sources":["../../../../src/components/Employee/EmployeeList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useState } from 'react'\nimport style from './List.module.scss'\nimport { useEmployeeList } from './useEmployeeList'\nimport { DataView, EmptyData, ActionsLayout, useDataView } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { EmployeeOnboardingStatusBadge } from '@/components/Common/OnboardingStatusBadge'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { EmployeeOnboardingStatus, EmployeeSelfOnboardingStatuses } from '@/shared/constants'\nimport { firstLastName } from '@/helpers/formattedStrings'\n\n/**List of employees slot for EmployeeList component */\nexport const List = () => {\n const {\n handleDelete,\n employees,\n handleEdit,\n handleReview,\n handleNew,\n handleCancelSelfOnboarding,\n handleFirstPage,\n handlePreviousPage,\n handleNextPage,\n handleLastPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n handleSkip,\n } = useEmployeeList()\n const Components = useComponentContext()\n\n const { t } = useTranslation('Employee.EmployeeList')\n const [deleting, setDeleting] = useState<Set<string>>(new Set())\n const { ...dataViewProps } = useDataView({\n data: employees,\n columns: [\n {\n key: 'name',\n title: t('nameLabel'),\n render: employee => {\n return firstLastName({\n first_name: employee.firstName,\n last_name: employee.lastName,\n })\n },\n },\n {\n key: 'status',\n title: t('statusLabel'),\n render: ({ onboarded, onboardingStatus }) => (\n <EmployeeOnboardingStatusBadge\n onboarded={onboarded}\n onboardingStatus={onboardingStatus}\n />\n ),\n },\n ],\n itemMenu: employee => {\n const menuItems = []\n\n // Edit item\n if (\n employee.onboardingStatus === EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE ||\n employee.onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE ||\n employee.onboardingStatus ===\n EmployeeOnboardingStatus.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW ||\n employee.onboardingStatus === EmployeeOnboardingStatus.ONBOARDING_COMPLETED\n ) {\n menuItems.push({\n label: t('editCta'),\n onClick: () => {\n handleEdit(employee.uuid, employee.onboardingStatus ?? undefined)\n },\n icon: <PencilSvg aria-hidden />,\n })\n }\n\n // Cancel self onboarding item\n /* @ts-expect-error: onboarding_status during runtime can be one of self onboarding statuses */\n if (EmployeeSelfOnboardingStatuses.has(employee.onboarding_status ?? '')) {\n menuItems.push({\n label: t('cancelSelfOnboardingCta'),\n onClick: async () => {\n await handleCancelSelfOnboarding(employee.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n })\n }\n\n // Review item\n if (\n employee.onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_COMPLETED_BY_EMPLOYEE\n ) {\n menuItems.push({\n label: t('reviewCta'),\n onClick: () => {\n void handleReview(employee.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n })\n }\n\n // Delete item\n if (!employee.onboarded) {\n menuItems.push({\n label: t('deleteCta'),\n onClick: () => {\n setDeleting(prev => new Set(prev).add(employee.uuid))\n void handleDelete(employee.uuid).then(() => {\n setDeleting(prev => {\n const newSet = new Set(prev)\n newSet.delete(employee.uuid)\n return newSet\n })\n })\n },\n icon: <TrashCanSvg aria-hidden />,\n })\n }\n\n return (\n <HamburgerMenu\n items={menuItems}\n triggerLabel={t('hamburgerTitle')}\n isLoading={deleting.has(employee.uuid)}\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 <ActionsLayout justifyContent=\"center\">\n <Components.Button variant=\"secondary\" onClick={handleSkip}>\n {t('skipCta')}\n </Components.Button>\n <Components.Button variant=\"primary\" onClick={handleNew}>\n {t('addEmployeeCTA')}\n </Components.Button>\n </ActionsLayout>\n </EmptyData>\n ),\n })\n return (\n <>\n {employees.length > 0 && (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleNew}>\n {t('addAnotherCta')}\n </Components.Button>\n </ActionsLayout>\n )}\n <div className={style.container}>\n <DataView label={t('employeeListLabel')} {...dataViewProps} />\n </div>\n </>\n )\n}\n"],"names":["List","handleDelete","employees","handleEdit","handleReview","handleNew","handleCancelSelfOnboarding","handleFirstPage","handlePreviousPage","handleNextPage","handleLastPage","handleItemsPerPageChange","currentPage","totalPages","handleSkip","useEmployeeList","Components","useComponentContext","t","useTranslation","deleting","setDeleting","useState","dataViewProps","useDataView","employee","firstLastName","onboarded","onboardingStatus","jsx","EmployeeOnboardingStatusBadge","menuItems","EmployeeOnboardingStatus","PencilSvg","EmployeeSelfOnboardingStatuses","prev","newSet","TrashCanSvg","HamburgerMenu","EmptyData","jsxs","ActionsLayout","Fragment","style","DataView"],"mappings":";;;;;;;;;;;;;;;;;AAcO,MAAMA,KAAO,MAAM;AAClB,QAAA;AAAA,IACJ,cAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,WAAAC;AAAA,IACA,4BAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,MACEC,EAAgB,GACdC,IAAaC,EAAoB,GAEjC,EAAE,GAAAC,EAAA,IAAMC,EAAe,uBAAuB,GAC9C,CAACC,GAAUC,CAAW,IAAIC,EAAsB,oBAAI,KAAK,GACzD,EAAE,GAAGC,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAMtB;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAOgB,EAAE,WAAW;AAAA,QACpB,QAAQ,CAAYO,MACXC,EAAc;AAAA,UACnB,YAAYD,EAAS;AAAA,UACrB,WAAWA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EAAAY,GAAA,EACC,4BAACzB,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASX,GAC7C,UAAEa,EAAA,eAAe,EACpB,CAAA,GACF;AAAA,IAED,gBAAAW,EAAA,OAAA,EAAI,WAAWc,EAAM,WACpB,UAAA,gBAAAd,EAACe,GAAS,EAAA,OAAO1B,EAAE,mBAAmB,GAAI,GAAGK,GAAe,EAC9D,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -8,9 +8,9 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
|
8
8
|
import "@tanstack/react-query";
|
|
9
9
|
import "../../Base/useBase.js";
|
|
10
10
|
import "../../../shared/constants.js";
|
|
11
|
+
import "classnames";
|
|
11
12
|
import "dompurify";
|
|
12
13
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
-
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
14
|
import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
|
|
15
15
|
const [c, d] = o("EmployeeListContext");
|
|
16
16
|
export {
|
|
@@ -6,20 +6,21 @@ import s from "./Landing.module.scss.js";
|
|
|
6
6
|
import { BaseComponent as x } from "../../Base/Base.js";
|
|
7
7
|
import { useBase as y } from "../../Base/useBase.js";
|
|
8
8
|
import { Flex as r } from "../../Common/Flex/Flex.js";
|
|
9
|
+
import "classnames";
|
|
9
10
|
import { ActionsLayout as E } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
10
11
|
import { useComponentContext as C } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
12
|
import { useI18n as D, useComponentDictionary as I } from "../../../i18n/I18n.js";
|
|
12
13
|
import { componentEvents as S } from "../../../shared/constants.js";
|
|
13
|
-
function
|
|
14
|
+
function H(t) {
|
|
14
15
|
return D("Employee.Landing"), I("Employee.Landing", t.dictionary), /* @__PURE__ */ e(x, { ...t, children: /* @__PURE__ */ e(L, { ...t, children: t.children }) });
|
|
15
16
|
}
|
|
16
|
-
const L = ({ employeeId: t, companyId: c, className:
|
|
17
|
-
const { onEvent:
|
|
17
|
+
const L = ({ employeeId: t, companyId: c, className: m }) => {
|
|
18
|
+
const { onEvent: l } = y(), o = C(), {
|
|
18
19
|
data: { employee: a }
|
|
19
20
|
} = h({ employeeId: t }), p = a.firstName, {
|
|
20
21
|
data: { company: d }
|
|
21
22
|
} = g({ companyId: c }), f = d?.name, { t: n } = u("Employee.Landing");
|
|
22
|
-
return /* @__PURE__ */ e("section", { className:
|
|
23
|
+
return /* @__PURE__ */ e("section", { className: m, children: /* @__PURE__ */ i(r, { alignItems: "center", flexDirection: "column", gap: 32, children: [
|
|
23
24
|
/* @__PURE__ */ i(r, { alignItems: "center", flexDirection: "column", gap: 8, children: [
|
|
24
25
|
/* @__PURE__ */ e(o.Heading, { as: "h2", textAlign: "center", children: n("landingSubtitle", { firstName: p, companyName: f }) }),
|
|
25
26
|
/* @__PURE__ */ e(o.Text, { className: s.description, children: n("landingDescription") })
|
|
@@ -38,7 +39,7 @@ const L = ({ employeeId: t, companyId: c, className: l }) => {
|
|
|
38
39
|
{
|
|
39
40
|
variant: "secondary",
|
|
40
41
|
onClick: () => {
|
|
41
|
-
|
|
42
|
+
l(S.EMPLOYEE_SELF_ONBOARDING_START);
|
|
42
43
|
},
|
|
43
44
|
children: n("getStartedCta")
|
|
44
45
|
}
|
|
@@ -48,6 +49,6 @@ const L = ({ employeeId: t, companyId: c, className: l }) => {
|
|
|
48
49
|
] }) });
|
|
49
50
|
};
|
|
50
51
|
export {
|
|
51
|
-
|
|
52
|
+
H as Landing
|
|
52
53
|
};
|
|
53
54
|
//# sourceMappingURL=Landing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Landing.js","sources":["../../../../src/components/Employee/Landing/Landing.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { useCompaniesGetSuspense } from '@gusto/embedded-api/react-query/companiesGet'\nimport styles from './Landing.module.scss'\nimport {\n BaseComponent,\n useBase,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { Flex, ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface SummaryProps extends CommonComponentInterface<'Employee.Landing'> {\n employeeId: string\n companyId: string\n}\n\nexport function Landing(props: SummaryProps & BaseComponentInterface) {\n useI18n('Employee.Landing')\n useComponentDictionary('Employee.Landing', props.dictionary)\n\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ employeeId, companyId, className }: SummaryProps) => {\n const { onEvent } = useBase()\n const Components = useComponentContext()\n\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n const firstName = employee!.firstName\n\n const {\n data: { company },\n } = useCompaniesGetSuspense({ companyId })\n const companyName = company?.name\n\n const { t } = useTranslation('Employee.Landing')\n\n return (\n <section className={className}>\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={32}>\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('landingSubtitle', { firstName, companyName })}\n </Components.Heading>\n <Components.Text className={styles.description}>\n {t('landingDescription')}\n </Components.Text>\n </Flex>\n <Flex flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h3\">{t('stepsSubtitle')}</Components.Heading>\n <ul>\n <li>{t('steps.personalInfo')}</li>\n <li>{t('steps.taxInfo')}</li>\n <li>{t('steps.bankInfo')}</li>\n </ul>\n </Flex>\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={8}>\n <ActionsLayout justifyContent=\"center\">\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.EMPLOYEE_SELF_ONBOARDING_START)\n }}\n >\n {t('getStartedCta')}\n </Components.Button>\n </ActionsLayout>\n <Components.Text className={styles.description}>\n {t('getStartedDescription')}\n </Components.Text>\n </Flex>\n </Flex>\n </section>\n )\n}\n"],"names":["Landing","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","employeeId","companyId","className","onEvent","useBase","Components","useComponentContext","employee","useEmployeesGetSuspense","firstName","company","useCompaniesGetSuspense","companyName","t","useTranslation","jsxs","Flex","styles","ActionsLayout","componentEvents"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Landing.js","sources":["../../../../src/components/Employee/Landing/Landing.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { useCompaniesGetSuspense } from '@gusto/embedded-api/react-query/companiesGet'\nimport styles from './Landing.module.scss'\nimport {\n BaseComponent,\n useBase,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { Flex, ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface SummaryProps extends CommonComponentInterface<'Employee.Landing'> {\n employeeId: string\n companyId: string\n}\n\nexport function Landing(props: SummaryProps & BaseComponentInterface) {\n useI18n('Employee.Landing')\n useComponentDictionary('Employee.Landing', props.dictionary)\n\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ employeeId, companyId, className }: SummaryProps) => {\n const { onEvent } = useBase()\n const Components = useComponentContext()\n\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n const firstName = employee!.firstName\n\n const {\n data: { company },\n } = useCompaniesGetSuspense({ companyId })\n const companyName = company?.name\n\n const { t } = useTranslation('Employee.Landing')\n\n return (\n <section className={className}>\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={32}>\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('landingSubtitle', { firstName, companyName })}\n </Components.Heading>\n <Components.Text className={styles.description}>\n {t('landingDescription')}\n </Components.Text>\n </Flex>\n <Flex flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h3\">{t('stepsSubtitle')}</Components.Heading>\n <ul>\n <li>{t('steps.personalInfo')}</li>\n <li>{t('steps.taxInfo')}</li>\n <li>{t('steps.bankInfo')}</li>\n </ul>\n </Flex>\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={8}>\n <ActionsLayout justifyContent=\"center\">\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.EMPLOYEE_SELF_ONBOARDING_START)\n }}\n >\n {t('getStartedCta')}\n </Components.Button>\n </ActionsLayout>\n <Components.Text className={styles.description}>\n {t('getStartedDescription')}\n </Components.Text>\n </Flex>\n </Flex>\n </section>\n )\n}\n"],"names":["Landing","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","employeeId","companyId","className","onEvent","useBase","Components","useComponentContext","employee","useEmployeesGetSuspense","firstName","company","useCompaniesGetSuspense","companyName","t","useTranslation","jsxs","Flex","styles","ActionsLayout","componentEvents"],"mappings":";;;;;;;;;;;;;AAqBO,SAASA,EAAQC,GAA8C;AACpE,SAAAC,EAAQ,kBAAkB,GACHC,EAAA,oBAAoBF,EAAM,UAAU,GAGzD,gBAAAG,EAACC,GAAe,EAAA,GAAGJ,GACjB,UAAA,gBAAAG,EAACE,KAAM,GAAGL,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEA,MAAMK,IAAO,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,WAAAC,QAA8B;AAC7D,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAQ,GACtBC,IAAaC,EAAoB,GAEjC;AAAA,IACJ,MAAM,EAAE,UAAAC,EAAS;AAAA,E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,GAAA,EAAc,gBAAe,UAC5B,UAAA,gBAAArB;AAAA,QAACQ,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACb,YAAAF,EAAQgB,EAAgB,8BAA8B;AAAA,UACxD;AAAA,UAEC,YAAE,eAAe;AAAA,QAAA;AAAA,MAAA,GAEtB;AAAA,MACA,gBAAAtB,EAACQ,EAAW,MAAX,EAAgB,WAAWY,EAAO,aAChC,UAAEJ,EAAA,uBAAuB,EAC5B,CAAA;AAAA,IAAA,EACF,CAAA;AAAA,EAAA,EAAA,CACF,EACF,CAAA;AAEJ;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as m } from "react-i18next";
|
|
3
3
|
import { usePaymentMethod as l } from "./usePaymentMethod.js";
|
|
4
|
-
import "
|
|
4
|
+
import "classnames";
|
|
5
5
|
import { ActionsLayout as p } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
6
6
|
import { useComponentContext as u } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
7
7
|
const f = () => {
|