@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":"Actions.js","sources":["../../../../src/components/Employee/EmployeeList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEmployeeList } from './useEmployeeList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Employee.EmployeeList')\n const { handleSkip, employees } = useEmployeeList()\n const Components = useComponentContext()\n\n if (employees.length === 0) {\n return null\n }\n\n return (\n <ActionsLayout>\n <Components.Button onClick={handleSkip} isLoading={false}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleSkip","employees","useEmployeeList","Components","useComponentContext","jsx","ActionsLayout"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/EmployeeList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEmployeeList } from './useEmployeeList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Employee.EmployeeList')\n const { handleSkip, employees } = useEmployeeList()\n const Components = useComponentContext()\n\n if (employees.length === 0) {\n return null\n }\n\n return (\n <ActionsLayout>\n <Components.Button onClick={handleSkip} isLoading={false}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleSkip","employees","useEmployeeList","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,uBAAuB,GAC9C,EAAE,YAAAC,GAAY,WAAAC,EAAU,IAAIC,EAAgB,GAC5CC,IAAaC,EAAoB;AAEnC,SAAAH,EAAU,WAAW,IAChB,OAIN,gBAAAI,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAF,EAAW,QAAX,EAAkB,SAASH,GAAY,WAAW,IAChD,UAAE,EAAA,aAAa,EAClB,CAAA,GACF;AAEJ;"}
|
|
@@ -3,11 +3,6 @@ interface EmployeeListProps extends CommonComponentInterface<'Employee.EmployeeL
|
|
|
3
3
|
companyId: string;
|
|
4
4
|
}
|
|
5
5
|
export declare function EmployeeList(props: EmployeeListProps & BaseComponentInterface): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export declare namespace EmployeeList {
|
|
7
|
-
var Head: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
var List: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
var Actions: typeof import("./Actions").Actions;
|
|
10
|
-
}
|
|
11
6
|
/**
|
|
12
7
|
* Wrapper used inside Flows -> exposes flow context for required parameters
|
|
13
8
|
*/
|
|
@@ -1,42 +1,41 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useEmployeesListSuspense as
|
|
4
|
-
import { useEmployeesDeleteMutation as
|
|
5
|
-
import { useEmployeesUpdateOnboardingStatusMutation as
|
|
6
|
-
import { EmployeeListProvider as
|
|
7
|
-
import { Actions as
|
|
8
|
-
import { BaseComponent as
|
|
9
|
-
import { useBase as
|
|
10
|
-
import { Flex as
|
|
11
|
-
import "react-i18next";
|
|
1
|
+
import { jsx as o, jsxs as B } from "react/jsx-runtime";
|
|
2
|
+
import { useState as d } from "react";
|
|
3
|
+
import { useEmployeesListSuspense as C } from "@gusto/embedded-api/react-query/employeesList";
|
|
4
|
+
import { useEmployeesDeleteMutation as v } from "@gusto/embedded-api/react-query/employeesDelete";
|
|
5
|
+
import { useEmployeesUpdateOnboardingStatusMutation as G } from "@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus";
|
|
6
|
+
import { EmployeeListProvider as Y } from "./useEmployeeList.js";
|
|
7
|
+
import { Actions as F } from "./Actions.js";
|
|
8
|
+
import { BaseComponent as U } from "../../Base/Base.js";
|
|
9
|
+
import { useBase as W } from "../../Base/useBase.js";
|
|
10
|
+
import { Flex as q } from "../../Common/Flex/Flex.js";
|
|
12
11
|
import "classnames";
|
|
13
|
-
import { useI18n as V, useComponentDictionary as z } from "../../../i18n/I18n.js";
|
|
14
12
|
import { componentEvents as s, EmployeeOnboardingStatus as l } from "../../../shared/constants.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
import { useI18n as j, useComponentDictionary as k } from "../../../i18n/I18n.js";
|
|
14
|
+
import { Head as H } from "./Head.js";
|
|
15
|
+
import { List as V } from "./List.js";
|
|
16
|
+
import { useFlow as z } from "../../Flow/useFlow.js";
|
|
17
|
+
function J(n) {
|
|
18
|
+
return /* @__PURE__ */ o(U, { ...n, children: /* @__PURE__ */ o(K, { ...n, children: n.children }) });
|
|
20
19
|
}
|
|
21
|
-
function K({ companyId: n, className:
|
|
22
|
-
|
|
23
|
-
const { onEvent: a, baseSubmitHandler: r } =
|
|
24
|
-
|
|
25
|
-
},
|
|
20
|
+
function K({ companyId: n, className: m, children: c, dictionary: y }) {
|
|
21
|
+
j("Employee.EmployeeList"), k("Employee.EmployeeList", y);
|
|
22
|
+
const { onEvent: a, baseSubmitHandler: r } = W(), [p, i] = d(1), [h, P] = d(5), { data: O } = C({ companyId: n, page: p, per: h }), { httpMeta: g, showEmployees: I } = O, N = I, { mutateAsync: A } = v(), { mutateAsync: D } = G(), E = Number(g.response.headers.get("x-total-pages") ?? 1), f = (e) => {
|
|
23
|
+
P(e);
|
|
24
|
+
}, L = () => {
|
|
26
25
|
i(1);
|
|
27
|
-
},
|
|
26
|
+
}, _ = () => {
|
|
28
27
|
i((e) => Math.max(e - 1, 1));
|
|
29
|
-
},
|
|
30
|
-
i((e) => Math.min(e + 1,
|
|
31
|
-
},
|
|
32
|
-
i(
|
|
33
|
-
},
|
|
28
|
+
}, M = () => {
|
|
29
|
+
i((e) => Math.min(e + 1, E));
|
|
30
|
+
}, S = () => {
|
|
31
|
+
i(E);
|
|
32
|
+
}, w = async (e) => {
|
|
34
33
|
await r(e, async (t) => {
|
|
35
|
-
await
|
|
34
|
+
await A({
|
|
36
35
|
request: { employeeId: t }
|
|
37
36
|
}), a(s.EMPLOYEE_DELETED, { employeeId: t });
|
|
38
37
|
});
|
|
39
|
-
},
|
|
38
|
+
}, b = async (e) => {
|
|
40
39
|
await r(e, async (t) => {
|
|
41
40
|
await u({
|
|
42
41
|
employeeId: t,
|
|
@@ -46,7 +45,7 @@ function K({ companyId: n, className: E, children: p, dictionary: g }) {
|
|
|
46
45
|
onboardingStatus: l.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW
|
|
47
46
|
});
|
|
48
47
|
});
|
|
49
|
-
},
|
|
48
|
+
}, R = async (e) => {
|
|
50
49
|
await r(e, async (t) => {
|
|
51
50
|
await u({
|
|
52
51
|
employeeId: t,
|
|
@@ -54,15 +53,15 @@ function K({ companyId: n, className: E, children: p, dictionary: g }) {
|
|
|
54
53
|
});
|
|
55
54
|
});
|
|
56
55
|
}, u = async (e) => {
|
|
57
|
-
await r(e, async ({ employeeId: t, status:
|
|
58
|
-
const { employeeOnboardingStatus:
|
|
59
|
-
request: { employeeId: t, requestBody: { onboardingStatus:
|
|
56
|
+
await r(e, async ({ employeeId: t, status: T }) => {
|
|
57
|
+
const { employeeOnboardingStatus: x } = await D({
|
|
58
|
+
request: { employeeId: t, requestBody: { onboardingStatus: T } }
|
|
60
59
|
});
|
|
61
|
-
a(s.EMPLOYEE_ONBOARDING_STATUS_UPDATED,
|
|
60
|
+
a(s.EMPLOYEE_ONBOARDING_STATUS_UPDATED, x);
|
|
62
61
|
});
|
|
63
62
|
};
|
|
64
|
-
return /* @__PURE__ */ o("section", { className:
|
|
65
|
-
|
|
63
|
+
return /* @__PURE__ */ o("section", { className: m, children: /* @__PURE__ */ o(
|
|
64
|
+
Y,
|
|
66
65
|
{
|
|
67
66
|
value: {
|
|
68
67
|
handleEdit: (e, t) => {
|
|
@@ -71,38 +70,35 @@ function K({ companyId: n, className: E, children: p, dictionary: g }) {
|
|
|
71
70
|
handleNew: () => {
|
|
72
71
|
a(s.EMPLOYEE_CREATE);
|
|
73
72
|
},
|
|
74
|
-
handleReview:
|
|
75
|
-
handleDelete:
|
|
76
|
-
employees:
|
|
77
|
-
currentPage:
|
|
78
|
-
totalPages:
|
|
79
|
-
handleFirstPage:
|
|
80
|
-
handlePreviousPage:
|
|
81
|
-
handleNextPage:
|
|
82
|
-
handleLastPage:
|
|
83
|
-
handleCancelSelfOnboarding:
|
|
84
|
-
handleItemsPerPageChange:
|
|
73
|
+
handleReview: b,
|
|
74
|
+
handleDelete: w,
|
|
75
|
+
employees: N,
|
|
76
|
+
currentPage: p,
|
|
77
|
+
totalPages: E,
|
|
78
|
+
handleFirstPage: L,
|
|
79
|
+
handlePreviousPage: _,
|
|
80
|
+
handleNextPage: M,
|
|
81
|
+
handleLastPage: S,
|
|
82
|
+
handleCancelSelfOnboarding: R,
|
|
83
|
+
handleItemsPerPageChange: f,
|
|
85
84
|
handleSkip: () => {
|
|
86
85
|
a(s.EMPLOYEE_ONBOARDING_DONE);
|
|
87
86
|
}
|
|
88
87
|
},
|
|
89
|
-
children:
|
|
90
|
-
/* @__PURE__ */ o(
|
|
91
|
-
/* @__PURE__ */ o(
|
|
92
|
-
/* @__PURE__ */ o(
|
|
88
|
+
children: c || /* @__PURE__ */ B(q, { flexDirection: "column", children: [
|
|
89
|
+
/* @__PURE__ */ o(H, {}),
|
|
90
|
+
/* @__PURE__ */ o(V, {}),
|
|
91
|
+
/* @__PURE__ */ o(F, {})
|
|
93
92
|
] })
|
|
94
93
|
}
|
|
95
94
|
) });
|
|
96
95
|
}
|
|
97
|
-
|
|
98
|
-
m
|
|
99
|
-
m
|
|
100
|
-
const he = () => {
|
|
101
|
-
const { companyId: n, onEvent: E } = J();
|
|
102
|
-
return /* @__PURE__ */ o(m, { companyId: n, onEvent: E });
|
|
96
|
+
const ye = () => {
|
|
97
|
+
const { companyId: n, onEvent: m } = z();
|
|
98
|
+
return /* @__PURE__ */ o(J, { companyId: n, onEvent: m });
|
|
103
99
|
};
|
|
104
100
|
export {
|
|
105
|
-
|
|
106
|
-
|
|
101
|
+
J as EmployeeList,
|
|
102
|
+
ye as EmployeeListContextual
|
|
107
103
|
};
|
|
108
104
|
//# 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\
|
|
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\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,EAA2B,GACrE,EAAE,aAAaC,EAAuC,IAC1DC,EAA2C,GAEvCC,IAAa,OAAOP,EAAS,SAAS,QAAQ,IAAI,eAAe,KAAK,CAAC,GAEvEQ,IAA2B,CAACC,MAAqB;AACrD,IAAAZ,EAAgBY,CAAQ;AAAA,EAC1B,GACMC,IAAkB,MAAM;AAC5B,IAAAhB,EAAe,CAAC;AAAA,EAClB,GACMiB,IAAqB,MAAM;AAC/B,IAAAjB,EAAe,OAAY,KAAK,IAAIkB,IAAW,GAAG,CAAC,CAAC;AAAA,EACtD,GACMC,IAAiB,MAAM;AAC3B,IAAAnB,EAAe,OAAY,KAAK,IAAIkB,IAAW,GAAGL,CAAU,CAAC;AAAA,EAC/D,GACMO,IAAiB,MAAM;AAC3B,IAAApB,EAAea,CAAU;AAAA,EAC3B,GACMQ,IAAe,OAAOC,MAAiB;AACrC,UAAAzB,EAAkByB,GAAM,OAAMC,MAAW;AAC7C,YAAMd,EAAuB;AAAA,QAC3B,SAAS,EAAE,YAAYc,EAAQ;AAAA,MAAA,CAChC,GAED3B,EAAQ4B,EAAgB,kBAAkB,EAAE,YAAYD,GAAS;AAAA,IAAA,CAClE;AAAA,EACH,GAEME,IAAe,OAAOrB,MAAiB;AACrC,UAAAP,EAAkBO,GAAM,OAAMsB,MAAc;AAChD,YAAMC,EAAuB;AAAA,QAC3B,YAAAD;AAAA,QACA,QAAQE,EAAyB;AAAA,MAAA,CAClC,GACDhC,EAAQ4B,EAAgB,iBAAiB;AAAA,QACvC,YAAAE;AAAA,QACA,kBAAkBE,EAAyB;AAAA,MAAA,CAC5C;AAAA,IAAA,CACF;AAAA,EACH,GAEMC,IAA6B,OAAOzB,MAAiB;AACnD,UAAAP,EAAkBO,GAAM,OAAMsB,MAAc;AAChD,YAAMC,EAAuB;AAAA,QAC3B,YAAAD;AAAA,QACA,QAAQE,EAAyB;AAAA,MAAA,CAClC;AAAA,IAAA,CACF;AAAA,EACH,GACMD,IAAyB,OAAOvB,MAA2D;AAC/F,UAAMP,EAAkBO,GAAM,OAAO,EAAE,YAAAsB,GAAY,QAAAI,QAAa;AAC9D,YAAM,EAAE,0BAA0BC,EAAa,IAC7C,MAAMpB,EAAuC;AAAA,QAC3C,SAAS,EAAE,YAAAe,GAAY,aAAa,EAAE,kBAAkBI,EAAS,EAAA;AAAA,MAAA,CAClE;AACK,MAAAlC,EAAA4B,EAAgB,oCAAoCO,CAAY;AAAA,IAAA,CACzE;AAAA,EACH;AAYE,SAAA,gBAAA5C,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAAC6C;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,YAPW,CAACV,GAAcW,MAAwC;AACxE,UAAArC,EAAQ4B,EAAgB,iBAAiB,EAAE,YAAYF,GAAM,kBAAAW,GAAkB;AAAA,QACjF;AAAA,QAMQ,WAfU,MAAM;AACtB,UAAArC,EAAQ4B,EAAgB,eAAe;AAAA,QACzC;AAAA,QAcQ,cAAAC;AAAA,QACA,cAAAJ;AAAA,QACA,WAAAb;AAAA,QACA,aAAAT;AAAA,QACA,YAAAc;AAAA,QACA,iBAAAG;AAAA,QACA,oBAAAC;AAAA,QACA,gBAAAE;AAAA,QACA,gBAAAC;AAAA,QACA,4BAAAS;AAAA,QACA,0BAAAf;AAAA,QACA,YAxBW,MAAM;AACvB,UAAAlB,EAAQ4B,EAAgB,wBAAwB;AAAA,QAClD;AAAA,MAuBM;AAAA,MAEC,UACChC,KAEC,gBAAA0C,EAAAC,GAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAAhD,EAACiD,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,EACX,CAAA;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ;AAKO,MAAMC,KAAyB,MAAM;AAC1C,QAAM,EAAE,WAAAjD,GAAW,SAAAM,EAAQ,IAAI4C,EAAoC;AAC5D,SAAA,gBAAArD,EAACF,GAAa,EAAA,WAAAK,GAAsB,SAAAM,EAAkB,CAAA;AAC/D;"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as t } 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
4
|
import "classnames";
|
|
5
|
+
import "../../../shared/constants.js";
|
|
5
6
|
import { useComponentContext as m } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
-
const
|
|
7
|
-
const { t } = n("Employee.EmployeeList"), o = m();
|
|
8
|
-
return /* @__PURE__ */
|
|
7
|
+
const f = () => {
|
|
8
|
+
const { t: e } = n("Employee.EmployeeList"), o = m();
|
|
9
|
+
return /* @__PURE__ */ t(r, { justifyContent: "space-between", alignItems: "center", children: /* @__PURE__ */ t(o.Heading, { as: "h2", children: e("title") }) });
|
|
9
10
|
};
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
f as Head
|
|
12
13
|
};
|
|
13
14
|
//# 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","t","useTranslation","Components","useComponentContext","jsx","Flex"],"mappings":";;;;;;AAKO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,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,UAAEF,EAAA,OAAO,EAAE,CAAA,GAC1C;AAEJ;"}
|
|
@@ -4,14 +4,14 @@ 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
6
|
import "classnames";
|
|
7
|
-
import {
|
|
7
|
+
import { EmployeeOnboardingStatus as i, EmployeeSelfOnboardingStatuses as B } from "../../../shared/constants.js";
|
|
8
|
+
import { EmptyData as M } from "../../Common/EmptyData/EmptyData.js";
|
|
8
9
|
import { ActionsLayout as h } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
9
|
-
import { useComponentContext as
|
|
10
|
-
import { HamburgerMenu as
|
|
11
|
-
import { EmployeeOnboardingStatusBadge as
|
|
10
|
+
import { useComponentContext as y } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
|
+
import { HamburgerMenu as G } from "../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
12
|
+
import { EmployeeOnboardingStatusBadge as R } from "../../Common/OnboardingStatusBadge/index.js";
|
|
12
13
|
import s from "../../../assets/icons/pencil.svg.js";
|
|
13
|
-
import
|
|
14
|
-
import { EmployeeOnboardingStatus as i, EmployeeSelfOnboardingStatuses as x } from "../../../shared/constants.js";
|
|
14
|
+
import x from "../../../assets/icons/trashcan.svg.js";
|
|
15
15
|
import { firstLastName as F } from "../../../helpers/formattedStrings.js";
|
|
16
16
|
import { useDataView as V } from "../../Common/DataView/useDataView.js";
|
|
17
17
|
import { DataView as j } from "../../Common/DataView/DataView.js";
|
|
@@ -31,7 +31,7 @@ const rt = () => {
|
|
|
31
31
|
currentPage: O,
|
|
32
32
|
totalPages: _,
|
|
33
33
|
handleSkip: D
|
|
34
|
-
} = w(), r =
|
|
34
|
+
} = w(), r = y(), { t: a } = A("Employee.EmployeeList"), [I, u] = T(/* @__PURE__ */ new Set()), { ...P } = V({
|
|
35
35
|
data: d,
|
|
36
36
|
columns: [
|
|
37
37
|
{
|
|
@@ -46,7 +46,7 @@ const rt = () => {
|
|
|
46
46
|
key: "status",
|
|
47
47
|
title: a("statusLabel"),
|
|
48
48
|
render: ({ onboarded: t, onboardingStatus: n }) => /* @__PURE__ */ e(
|
|
49
|
-
|
|
49
|
+
R,
|
|
50
50
|
{
|
|
51
51
|
onboarded: t,
|
|
52
52
|
onboardingStatus: n
|
|
@@ -62,7 +62,7 @@ const rt = () => {
|
|
|
62
62
|
p(t.uuid, t.onboardingStatus ?? void 0);
|
|
63
63
|
},
|
|
64
64
|
icon: /* @__PURE__ */ e(s, { "aria-hidden": !0 })
|
|
65
|
-
}),
|
|
65
|
+
}), B.has(t.onboarding_status ?? "") && n.push({
|
|
66
66
|
label: a("cancelSelfOnboardingCta"),
|
|
67
67
|
onClick: async () => {
|
|
68
68
|
await b(t.uuid);
|
|
@@ -84,9 +84,9 @@ const rt = () => {
|
|
|
84
84
|
});
|
|
85
85
|
});
|
|
86
86
|
},
|
|
87
|
-
icon: /* @__PURE__ */ e(
|
|
87
|
+
icon: /* @__PURE__ */ e(x, { "aria-hidden": !0 })
|
|
88
88
|
}), /* @__PURE__ */ e(
|
|
89
|
-
|
|
89
|
+
G,
|
|
90
90
|
{
|
|
91
91
|
items: n,
|
|
92
92
|
triggerLabel: a("hamburgerTitle"),
|
|
@@ -103,7 +103,7 @@ const rt = () => {
|
|
|
103
103
|
currentPage: O,
|
|
104
104
|
totalPages: _
|
|
105
105
|
},
|
|
106
|
-
emptyState: () => /* @__PURE__ */ e(
|
|
106
|
+
emptyState: () => /* @__PURE__ */ e(M, { title: a("emptyTableTitle"), description: a("emptyTableDescription"), children: /* @__PURE__ */ c(h, { justifyContent: "center", children: [
|
|
107
107
|
/* @__PURE__ */ e(r.Button, { variant: "secondary", onClick: D, children: a("skipCta") }),
|
|
108
108
|
/* @__PURE__ */ e(r.Button, { variant: "primary", onClick: l, children: a("addEmployeeCTA") })
|
|
109
109
|
] }) })
|
|
@@ -7,15 +7,15 @@ 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
9
|
import "classnames";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
10
|
+
import { componentEvents as E } from "../../../shared/constants.js";
|
|
11
|
+
import { ActionsLayout as C } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
12
|
+
import { useComponentContext as D } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
+
import { useI18n as I, useComponentDictionary as S } from "../../../i18n/I18n.js";
|
|
14
14
|
function H(t) {
|
|
15
|
-
return
|
|
15
|
+
return I("Employee.Landing"), S("Employee.Landing", t.dictionary), /* @__PURE__ */ e(x, { ...t, children: /* @__PURE__ */ e(L, { ...t, children: t.children }) });
|
|
16
16
|
}
|
|
17
17
|
const L = ({ employeeId: t, companyId: c, className: m }) => {
|
|
18
|
-
const { onEvent: l } = y(), o =
|
|
18
|
+
const { onEvent: l } = y(), o = D(), {
|
|
19
19
|
data: { employee: a }
|
|
20
20
|
} = h({ employeeId: t }), p = a.firstName, {
|
|
21
21
|
data: { company: d }
|
|
@@ -34,12 +34,12 @@ const L = ({ employeeId: t, companyId: c, className: m }) => {
|
|
|
34
34
|
] })
|
|
35
35
|
] }),
|
|
36
36
|
/* @__PURE__ */ i(r, { flexDirection: "column", alignItems: "center", gap: 8, children: [
|
|
37
|
-
/* @__PURE__ */ e(
|
|
37
|
+
/* @__PURE__ */ e(C, { justifyContent: "center", children: /* @__PURE__ */ e(
|
|
38
38
|
o.Button,
|
|
39
39
|
{
|
|
40
40
|
variant: "secondary",
|
|
41
41
|
onClick: () => {
|
|
42
|
-
l(
|
|
42
|
+
l(E.EMPLOYEE_SELF_ONBOARDING_START);
|
|
43
43
|
},
|
|
44
44
|
children: n("getStartedCta")
|
|
45
45
|
}
|
|
@@ -9,10 +9,10 @@ import r from "./OnboardingSummary.module.scss.js";
|
|
|
9
9
|
import { BaseComponent as P } from "../../Base/Base.js";
|
|
10
10
|
import { useBase as R } from "../../Base/useBase.js";
|
|
11
11
|
import { Flex as d } from "../../Common/Flex/Flex.js";
|
|
12
|
-
import {
|
|
12
|
+
import { componentEvents as E, EmployeeOnboardingStatus as N } from "../../../shared/constants.js";
|
|
13
|
+
import { ActionsLayout as O } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
13
14
|
import { useComponentContext as T } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
15
|
import { useI18n as _, useComponentDictionary as w } from "../../../i18n/I18n.js";
|
|
15
|
-
import { componentEvents as N, EmployeeOnboardingStatus as O } from "../../../shared/constants.js";
|
|
16
16
|
import F from "../../../assets/icons/success_check.svg.js";
|
|
17
17
|
import G from "../../../assets/icons/unchecked_circular.svg.js";
|
|
18
18
|
import { useFlow as M } from "../../Flow/useFlow.js";
|
|
@@ -22,7 +22,7 @@ function j(n) {
|
|
|
22
22
|
const k = ({ employeeId: n, className: c, isAdmin: m = !1 }) => {
|
|
23
23
|
const { onEvent: a } = R(), { t } = b("Employee.OnboardingSummary"), o = T(), {
|
|
24
24
|
data: { employee: x }
|
|
25
|
-
} = B({ employeeId: n }), { firstName: u, lastName: p } = x, { data: C } = L({ employeeId: n }), { onboardingStatus: h, onboardingSteps: l } = C.employeeOnboardingStatus, I = l?.length && l.findIndex((i) => i.required && !i.completed) > -1, f = h ===
|
|
25
|
+
} = B({ employeeId: n }), { firstName: u, lastName: p } = x, { data: C } = L({ employeeId: n }), { onboardingStatus: h, onboardingSteps: l } = C.employeeOnboardingStatus, I = l?.length && l.findIndex((i) => i.required && !i.completed) > -1, f = h === N.ONBOARDING_COMPLETED || !I && h === N.SELF_ONBOARDING_PENDING_INVITE, D = S(() => y.sanitize(u), [u]), v = S(() => y.sanitize(p), [p]);
|
|
26
26
|
return /* @__PURE__ */ e("section", { className: c, children: /* @__PURE__ */ s(d, { flexDirection: "column", gap: 32, children: [
|
|
27
27
|
/* @__PURE__ */ e(d, { alignItems: "center", flexDirection: "column", gap: 8, children: m ? f ? /* @__PURE__ */ s(g, { children: [
|
|
28
28
|
/* @__PURE__ */ e(o.Heading, { as: "h2", textAlign: "center", children: t("onboardedAdminSubtitle", {
|
|
@@ -47,23 +47,23 @@ const k = ({ employeeId: n, className: c, isAdmin: m = !1 }) => {
|
|
|
47
47
|
] }) : /* @__PURE__ */ s(g, { children: [
|
|
48
48
|
/* @__PURE__ */ e(o.Heading, { as: "h2", textAlign: "center", children: t("onboardedSelfSubtitle") }),
|
|
49
49
|
/* @__PURE__ */ e(o.Text, { className: r.description, children: t("onboardedSelfDescription") }),
|
|
50
|
-
/* @__PURE__ */ e(
|
|
50
|
+
/* @__PURE__ */ e(O, { justifyContent: f ? "center" : "start", children: /* @__PURE__ */ e(
|
|
51
51
|
o.Button,
|
|
52
52
|
{
|
|
53
53
|
variant: "secondary",
|
|
54
54
|
onClick: () => {
|
|
55
|
-
a(
|
|
55
|
+
a(E.EMPLOYEE_ONBOARDING_DONE);
|
|
56
56
|
},
|
|
57
57
|
children: t("doneCta")
|
|
58
58
|
}
|
|
59
59
|
) })
|
|
60
60
|
] }) }),
|
|
61
|
-
m && /* @__PURE__ */ e(
|
|
61
|
+
m && /* @__PURE__ */ e(O, { justifyContent: "center", children: /* @__PURE__ */ e(
|
|
62
62
|
o.Button,
|
|
63
63
|
{
|
|
64
64
|
variant: "secondary",
|
|
65
65
|
onClick: () => {
|
|
66
|
-
a(
|
|
66
|
+
a(E.EMPLOYEES_LIST);
|
|
67
67
|
},
|
|
68
68
|
children: t("doneCta")
|
|
69
69
|
}
|
|
@@ -2,18 +2,19 @@ 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
4
|
import "classnames";
|
|
5
|
+
import "../../../shared/constants.js";
|
|
5
6
|
import { ActionsLayout as p } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
6
7
|
import { useComponentContext as u } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
7
|
-
const
|
|
8
|
-
const { handleAdd:
|
|
8
|
+
const P = () => {
|
|
9
|
+
const { handleAdd: i, handleCancel: a, isPending: r, bankAccounts: s, handleSplit: c, mode: t } = l(), { t: n } = m("Employee.PaymentMethod"), o = u();
|
|
9
10
|
return /* @__PURE__ */ d(p, { children: [
|
|
10
|
-
(t === "ADD" || t === "SPLIT") && /* @__PURE__ */ e(o.Button, { variant: "secondary", type: "button", onClick:
|
|
11
|
+
(t === "ADD" || t === "SPLIT") && /* @__PURE__ */ e(o.Button, { variant: "secondary", type: "button", onClick: a, children: n("cancelAddCta") }),
|
|
11
12
|
t === "LIST" && s.length > 1 && /* @__PURE__ */ e(o.Button, { variant: "secondary", type: "button", onClick: c, children: n("splitCta") }),
|
|
12
|
-
t === "LIST" && /* @__PURE__ */ e(o.Button, { variant: "secondary", type: "button", onClick:
|
|
13
|
+
t === "LIST" && /* @__PURE__ */ e(o.Button, { variant: "secondary", type: "button", onClick: i, children: n("addAnotherCta") }),
|
|
13
14
|
/* @__PURE__ */ e(o.Button, { type: "submit", isLoading: r, children: n(t === "ADD" || t === "SPLIT" ? "saveCta" : "submitCta") })
|
|
14
15
|
] });
|
|
15
16
|
};
|
|
16
17
|
export {
|
|
17
|
-
|
|
18
|
+
P as Actions
|
|
18
19
|
};
|
|
19
20
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/PaymentMethod/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaymentMethod } from './usePaymentMethod'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { handleAdd, handleCancel, isPending, bankAccounts, handleSplit, mode } = usePaymentMethod()\n const { t } = useTranslation('Employee.PaymentMethod')\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {(mode === 'ADD' || mode === 'SPLIT') && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleCancel}>\n {t('cancelAddCta')}\n </Components.Button>\n )}\n {mode === 'LIST' && bankAccounts.length > 1 && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleSplit}>\n {t('splitCta')}\n </Components.Button>\n )}\n {mode === 'LIST' && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleAdd}>\n {t('addAnotherCta')}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t(mode === 'ADD' || mode === 'SPLIT' ? 'saveCta' : 'submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","handleAdd","handleCancel","isPending","bankAccounts","handleSplit","mode","usePaymentMethod","t","useTranslation","Components","useComponentContext","ActionsLayout","jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/PaymentMethod/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaymentMethod } from './usePaymentMethod'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { handleAdd, handleCancel, isPending, bankAccounts, handleSplit, mode } = usePaymentMethod()\n const { t } = useTranslation('Employee.PaymentMethod')\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {(mode === 'ADD' || mode === 'SPLIT') && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleCancel}>\n {t('cancelAddCta')}\n </Components.Button>\n )}\n {mode === 'LIST' && bankAccounts.length > 1 && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleSplit}>\n {t('splitCta')}\n </Components.Button>\n )}\n {mode === 'LIST' && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleAdd}>\n {t('addAnotherCta')}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t(mode === 'ADD' || mode === 'SPLIT' ? 'saveCta' : 'submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","handleAdd","handleCancel","isPending","bankAccounts","handleSplit","mode","usePaymentMethod","t","useTranslation","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;;AAKO,MAAMA,IAAU,MAAM;AACrB,QAAA,EAAE,WAAAC,GAAW,cAAAC,GAAc,WAAAC,GAAW,cAAAC,GAAc,aAAAC,GAAa,MAAAC,MAASC,EAAiB,GAC3F,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB,GAC/CC,IAAaC,EAAoB;AAEvC,2BACGC,GACG,EAAA,UAAA;AAAA,KAAAN,MAAS,SAASA,MAAS,YAC3B,gBAAAO,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASR,GAC3D,UAAAM,EAAE,cAAc,GACnB;AAAA,IAEDF,MAAS,UAAUF,EAAa,SAAS,uBACvCM,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASL,GAC3D,UAAAG,EAAE,UAAU,GACf;AAAA,IAEDF,MAAS,UACP,gBAAAO,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAAST,GAC3D,UAAAO,EAAE,eAAe,GACpB;AAAA,IAED,gBAAAK,EAAAH,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWP,GACzC,UAAAK,EAAEF,MAAS,SAASA,MAAS,UAAU,YAAY,WAAW,EACjE,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -4,8 +4,8 @@ import { useTranslation as c } from "react-i18next";
|
|
|
4
4
|
import { usePaymentMethod as s } from "./usePaymentMethod.js";
|
|
5
5
|
import "classnames";
|
|
6
6
|
import { PAYMENT_METHODS as l } from "../../../shared/constants.js";
|
|
7
|
-
import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
8
7
|
import { RadioGroupField as p } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
8
|
+
import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
9
9
|
const v = () => {
|
|
10
10
|
const { mode: a, watchedType: t } = s(), { t: e } = c("Employee.PaymentMethod"), { setValue: n } = m();
|
|
11
11
|
if (!(a !== "ADD" && a !== "INITIAL" || t === l.check))
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as s } from "react-i18next";
|
|
3
3
|
import { usePaymentMethod as p } from "./usePaymentMethod.js";
|
|
4
4
|
import d from "../../../assets/icons/trashcan.svg.js";
|
|
5
5
|
import "classnames";
|
|
6
|
+
import "../../../shared/constants.js";
|
|
6
7
|
import f from "../../Common/hooks/useNumberFormatter.js";
|
|
7
8
|
import { HamburgerMenu as y } from "../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
8
9
|
import { useDataView as b } from "../../Common/DataView/useDataView.js";
|
|
9
10
|
import { DataView as k } from "../../Common/DataView/DataView.js";
|
|
10
|
-
function
|
|
11
|
-
const { bankAccounts: r, paymentMethod:
|
|
11
|
+
function D() {
|
|
12
|
+
const { bankAccounts: r, paymentMethod: n, mode: i, handleDelete: m, isPending: u } = p(), { t } = s("Employee.PaymentMethod"), a = f(n.splitBy === "Amount" ? "currency" : "percent"), { ...l } = b({
|
|
12
13
|
data: r,
|
|
13
14
|
columns: [
|
|
14
15
|
{ key: "name", title: t("nicknameColumn") },
|
|
@@ -18,11 +19,11 @@ function B() {
|
|
|
18
19
|
key: "splitAmount",
|
|
19
20
|
title: t("allocationColumn"),
|
|
20
21
|
render: (e) => a(
|
|
21
|
-
|
|
22
|
+
n.splits?.find((c) => c.uuid === e.uuid)?.splitAmount ?? 0
|
|
22
23
|
)
|
|
23
24
|
}
|
|
24
25
|
],
|
|
25
|
-
itemMenu: (e) => /* @__PURE__ */
|
|
26
|
+
itemMenu: (e) => /* @__PURE__ */ o(
|
|
26
27
|
y,
|
|
27
28
|
{
|
|
28
29
|
items: [
|
|
@@ -31,7 +32,7 @@ function B() {
|
|
|
31
32
|
onClick: () => {
|
|
32
33
|
m(e.uuid);
|
|
33
34
|
},
|
|
34
|
-
icon: /* @__PURE__ */
|
|
35
|
+
icon: /* @__PURE__ */ o(d, { "aria-hidden": !0 })
|
|
35
36
|
}
|
|
36
37
|
],
|
|
37
38
|
triggerLabel: t("hamburgerTitle"),
|
|
@@ -40,9 +41,9 @@ function B() {
|
|
|
40
41
|
)
|
|
41
42
|
});
|
|
42
43
|
if (i === "LIST")
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ o(k, { label: t("bankAccountsListLabel"), ...l });
|
|
44
45
|
}
|
|
45
46
|
export {
|
|
46
|
-
|
|
47
|
+
D as BankAccountsList
|
|
47
48
|
};
|
|
48
49
|
//# sourceMappingURL=BankAccountsList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BankAccountsList.js","sources":["../../../../src/components/Employee/PaymentMethod/BankAccountsList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaymentMethod } from './usePaymentMethod'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { DataView, useDataView } from '@/components/Common'\nimport useNumberFormatter from '@/components/Common/hooks/useNumberFormatter'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport function BankAccountsList() {\n const { bankAccounts, paymentMethod, mode, handleDelete, isPending } = usePaymentMethod()\n const { t } = useTranslation('Employee.PaymentMethod')\n const format = useNumberFormatter(paymentMethod.splitBy === 'Amount' ? 'currency' : 'percent')\n\n const { ...dataViewProps } = useDataView({\n data: bankAccounts,\n columns: [\n { key: 'name', title: t('nicknameColumn') },\n { key: 'routingNumber', title: t('routingNumberColumn') },\n { key: 'accountType', title: t('accountTypeColumn') },\n {\n key: 'splitAmount',\n title: t('allocationColumn'),\n render: bankAccount => {\n return format(\n paymentMethod.splits?.find(split => split.uuid === bankAccount.uuid)?.splitAmount ?? 0,\n )\n },\n },\n ],\n itemMenu: bankAccount => {\n return (\n <HamburgerMenu\n items={[\n {\n label: t('deleteBankAccountCTA'),\n onClick: () => {\n handleDelete(bankAccount.uuid)\n },\n icon: <TrashCanSvg aria-hidden />,\n },\n ]}\n triggerLabel={t('hamburgerTitle')}\n isLoading={isPending}\n />\n )\n },\n })\n\n if (mode !== 'LIST') return\n\n return <DataView label={t('bankAccountsListLabel')} {...dataViewProps} />\n}\n"],"names":["BankAccountsList","bankAccounts","paymentMethod","mode","handleDelete","isPending","usePaymentMethod","useTranslation","format","useNumberFormatter","dataViewProps","useDataView","bankAccount","split","jsx","HamburgerMenu","TrashCanSvg","DataView"],"mappings":"
|
|
1
|
+
{"version":3,"file":"BankAccountsList.js","sources":["../../../../src/components/Employee/PaymentMethod/BankAccountsList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaymentMethod } from './usePaymentMethod'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { DataView, useDataView } from '@/components/Common'\nimport useNumberFormatter from '@/components/Common/hooks/useNumberFormatter'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport function BankAccountsList() {\n const { bankAccounts, paymentMethod, mode, handleDelete, isPending } = usePaymentMethod()\n const { t } = useTranslation('Employee.PaymentMethod')\n const format = useNumberFormatter(paymentMethod.splitBy === 'Amount' ? 'currency' : 'percent')\n\n const { ...dataViewProps } = useDataView({\n data: bankAccounts,\n columns: [\n { key: 'name', title: t('nicknameColumn') },\n { key: 'routingNumber', title: t('routingNumberColumn') },\n { key: 'accountType', title: t('accountTypeColumn') },\n {\n key: 'splitAmount',\n title: t('allocationColumn'),\n render: bankAccount => {\n return format(\n paymentMethod.splits?.find(split => split.uuid === bankAccount.uuid)?.splitAmount ?? 0,\n )\n },\n },\n ],\n itemMenu: bankAccount => {\n return (\n <HamburgerMenu\n items={[\n {\n label: t('deleteBankAccountCTA'),\n onClick: () => {\n handleDelete(bankAccount.uuid)\n },\n icon: <TrashCanSvg aria-hidden />,\n },\n ]}\n triggerLabel={t('hamburgerTitle')}\n isLoading={isPending}\n />\n )\n },\n })\n\n if (mode !== 'LIST') return\n\n return <DataView label={t('bankAccountsListLabel')} {...dataViewProps} />\n}\n"],"names":["BankAccountsList","bankAccounts","paymentMethod","mode","handleDelete","isPending","usePaymentMethod","useTranslation","format","useNumberFormatter","dataViewProps","useDataView","bankAccount","split","jsx","HamburgerMenu","TrashCanSvg","DataView"],"mappings":";;;;;;;;;;AAOO,SAASA,IAAmB;AACjC,QAAM,EAAE,cAAAC,GAAc,eAAAC,GAAe,MAAAC,GAAM,cAAAC,GAAc,WAAAC,MAAcC,EAAiB,GAClF,EAAE,EAAA,IAAMC,EAAe,wBAAwB,GAC/CC,IAASC,EAAmBP,EAAc,YAAY,WAAW,aAAa,SAAS,GAEvF,EAAE,GAAGQ,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAMV;AAAA,IACN,SAAS;AAAA,MACP,EAAE,KAAK,QAAQ,OAAO,EAAE,gBAAgB,EAAE;AAAA,MAC1C,EAAE,KAAK,iBAAiB,OAAO,EAAE,qBAAqB,EAAE;AAAA,MACxD,EAAE,KAAK,eAAe,OAAO,EAAE,mBAAmB,EAAE;AAAA,MACpD;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,kBAAkB;AAAA,QAC3B,QAAQ,CAAeW,MACdJ;AAAA,UACLN,EAAc,QAAQ,KAAK,CAAAW,MAASA,EAAM,SAASD,EAAY,IAAI,GAAG,eAAe;AAAA,QACvF;AAAA,MACF;AAAA,IAEJ;AAAA,IACA,UAAU,CAAeA,MAErB,gBAAAE;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,OAAO;AAAA,UACL;AAAA,YACE,OAAO,EAAE,sBAAsB;AAAA,YAC/B,SAAS,MAAM;AACb,cAAAX,EAAaQ,EAAY,IAAI;AAAA,YAC/B;AAAA,YACA,MAAM,gBAAAE,EAACE,GAAY,EAAA,eAAW,GAAC,CAAA;AAAA,UAAA;AAAA,QAEnC;AAAA,QACA,cAAc,EAAE,gBAAgB;AAAA,QAChC,WAAWX;AAAA,MAAA;AAAA,IACb;AAAA,EAEJ,CACD;AAED,MAAIF,MAAS;AAEb,6BAAQc,GAAS,EAAA,OAAO,EAAE,uBAAuB,GAAI,GAAGP,GAAe;AACzE;"}
|
|
@@ -6,12 +6,12 @@ import y from "dompurify";
|
|
|
6
6
|
import { useMemo as j, useEffect as D } from "react";
|
|
7
7
|
import { usePaymentMethod as N } from "./usePaymentMethod.js";
|
|
8
8
|
import "classnames";
|
|
9
|
-
import { useLocale as q } from "../../../contexts/LocaleProvider/useLocale.js";
|
|
10
|
-
import { useComponentContext as w } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
|
-
import { ReorderableList as I } from "../../Common/ReorderableList/ReorderableList.js";
|
|
12
9
|
import { SPLIT_BY as h } from "../../../shared/constants.js";
|
|
13
|
-
import { RadioGroupField as
|
|
10
|
+
import { RadioGroupField as q } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
14
11
|
import { NumberInputField as F } from "../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
12
|
+
import { useLocale as w } from "../../../contexts/LocaleProvider/useLocale.js";
|
|
13
|
+
import { useComponentContext as I } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
+
import { ReorderableList as W } from "../../Common/ReorderableList/ReorderableList.js";
|
|
15
15
|
function ie() {
|
|
16
16
|
const { paymentMethod: r, bankAccounts: m, mode: c } = N(), {
|
|
17
17
|
control: s,
|
|
@@ -22,7 +22,7 @@ function ie() {
|
|
|
22
22
|
} = B(), { t: u } = g("Employee.PaymentMethod"), d = A("splitBy"), L = A("priority"), a = j(() => r.splits ?? [], [r.splits]), l = Object.entries(L).reduce(
|
|
23
23
|
(e, [t, i]) => !e || (L[e] ?? 0) < i ? t : e,
|
|
24
24
|
""
|
|
25
|
-
), { currency: $ } =
|
|
25
|
+
), { currency: $ } = w();
|
|
26
26
|
D(() => {
|
|
27
27
|
if (a.length)
|
|
28
28
|
if (d === h.amount) {
|
|
@@ -33,7 +33,7 @@ function ie() {
|
|
|
33
33
|
o("splitAmount", e);
|
|
34
34
|
}
|
|
35
35
|
}, [d, a, l, o]);
|
|
36
|
-
const f =
|
|
36
|
+
const f = I();
|
|
37
37
|
if (c !== "SPLIT" || m.length < 2 || r.splits === null) return null;
|
|
38
38
|
o("isSplit", !0);
|
|
39
39
|
const b = (e, t) => {
|
|
@@ -50,7 +50,7 @@ function ie() {
|
|
|
50
50
|
const p = a[i];
|
|
51
51
|
p && (o("priority", t), l && l !== p.uuid && (S(`splitAmount.${l}`), b(l, 0)), b(p.uuid, null));
|
|
52
52
|
}, R = () => d === h.amount ? /* @__PURE__ */ n(
|
|
53
|
-
|
|
53
|
+
W,
|
|
54
54
|
{
|
|
55
55
|
label: u("draggableListLabel"),
|
|
56
56
|
items: a.map((e) => ({
|
|
@@ -106,7 +106,7 @@ function ie() {
|
|
|
106
106
|
/* @__PURE__ */ n(f.Heading, { as: "h2", children: u("title") }),
|
|
107
107
|
/* @__PURE__ */ n(V, { t: u, i18nKey: "splitDescription", components: { p: /* @__PURE__ */ n(f.Text, {}) } }),
|
|
108
108
|
/* @__PURE__ */ n(
|
|
109
|
-
|
|
109
|
+
q,
|
|
110
110
|
{
|
|
111
111
|
name: "splitBy",
|
|
112
112
|
label: u("splitByLabel"),
|