@gusto/embedded-react-sdk 0.11.3-rc.1 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +181 -0
- package/dist/components/Common/SignatureForm/SignatureForm.js +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +7 -6
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +2 -3
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +2 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +3 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +14 -13
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +2 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +6 -5
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +11 -10
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +6 -6
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +8 -9
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +8 -9
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -8
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -5
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +2 -3
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +9 -8
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +7 -6
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +5 -6
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +13 -12
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +3 -4
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +5 -6
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +2 -3
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +6 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +4 -5
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +6 -7
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +6 -5
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +11 -10
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +6 -7
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +2 -3
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +7 -6
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +10 -11
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +6 -7
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +3 -2
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +3 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +34 -33
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +9 -10
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +17 -16
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +6 -7
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +11 -12
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +5 -6
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +2 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +2 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +2 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +5 -4
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +4 -3
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +5 -6
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.d.ts +16 -0
- package/dist/components/Contractor/ContractorList/index.js +125 -0
- package/dist/components/Contractor/ContractorList/index.js.map +1 -0
- package/dist/components/Contractor/{List → ContractorList}/useContractorList.d.ts +1 -3
- package/dist/components/Contractor/{List → ContractorList}/useContractorList.js +9 -10
- package/dist/components/Contractor/ContractorList/useContractorList.js.map +1 -0
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.d.ts +2 -0
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js +25 -0
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js.map +1 -0
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.d.ts +26 -0
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js +71 -0
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js.map +1 -0
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.d.ts +9 -0
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js +119 -0
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +5 -6
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfile.js +31 -17
- package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.d.ts +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +40 -44
- package/dist/components/Contractor/Profile/ContractorProfileForm.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.d.ts +13 -12
- package/dist/components/Contractor/Profile/useContractorProfile.js +144 -145
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.d.ts +7 -0
- package/dist/components/Contractor/Submit/Submit.js +77 -0
- package/dist/components/Contractor/Submit/Submit.js.map +1 -0
- package/dist/components/Contractor/Submit/SubmitDone.js +11 -11
- package/dist/components/Contractor/Submit/SubmitDone.js.map +1 -1
- package/dist/components/Contractor/index.d.ts +3 -2
- package/dist/components/Contractor/index.js +10 -8
- package/dist/components/Contractor/index.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +1 -1
- package/dist/components/Employee/Compensation/Edit.js +12 -12
- package/dist/components/Employee/Compensation/List.js +22 -23
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +8 -8
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +8 -8
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +6 -7
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +8 -7
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +10 -9
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +2 -3
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +4 -3
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +5 -6
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +12 -12
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +3 -4
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +8 -8
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +8 -9
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +8 -8
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +5 -6
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/Actions.js +6 -7
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +6 -5
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +22 -21
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +3 -4
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +8 -9
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +12 -13
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +3 -4
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +2 -3
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/i18n/I18n.js +1 -1
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Contractor.ContractorList.json.js +14 -10
- package/dist/i18n/en/Contractor.ContractorList.json.js.map +1 -1
- package/dist/i18n/en/Contractor.Submit.json.js +22 -0
- package/dist/i18n/en/Contractor.Submit.json.js.map +1 -0
- package/dist/shared/constants.d.ts +12 -2
- package/dist/shared/constants.js +12 -6
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +25 -13
- package/package.json +2 -1
- package/dist/components/Contractor/List/index.d.ts +0 -25
- package/dist/components/Contractor/List/index.js +0 -81
- package/dist/components/Contractor/List/index.js.map +0 -1
- package/dist/components/Contractor/List/useContractorList.js.map +0 -1
- package/dist/components/Contractor/Submit/ContractorSubmitWithApi.d.ts +0 -6
- package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js +0 -27
- package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js.map +0 -1
- package/dist/components/Contractor/Submit/index.d.ts +0 -6
- package/dist/components/Contractor/Submit/index.js +0 -20
- package/dist/components/Contractor/Submit/index.js.map +0 -1
- package/dist/components/Contractor/Submit/index.module.scss.js +0 -8
- package/dist/components/Contractor/Submit/index.module.scss.js.map +0 -1
- package/dist/i18n/en/Contractor.ContractorSubmit.json.js +0 -18
- package/dist/i18n/en/Contractor.ContractorSubmit.json.js.map +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import "./types/i18next.d.ts"
|
|
2
2
|
export { PaymentMethod } from './PaymentMethod/PaymentMethod';
|
|
3
3
|
export { Address } from './Address';
|
|
4
|
-
export {
|
|
4
|
+
export { ContractorList } from './ContractorList';
|
|
5
5
|
export { NewHireReport } from './NewHireReport/NewHireReport';
|
|
6
|
-
export {
|
|
6
|
+
export { ContractorSubmit } from './Submit/Submit';
|
|
7
7
|
export { ContractorProfile } from './Profile';
|
|
8
|
+
export { OnboardingFlow } from './OnboardingFlow/OnboardingFlow';
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { PaymentMethod as t } from "./PaymentMethod/PaymentMethod.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ContractorList as m } from "./ContractorList/index.js";
|
|
3
3
|
import { NewHireReport as p } from "./NewHireReport/NewHireReport.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { ContractorSubmit as n } from "./Submit/Submit.js";
|
|
5
|
+
import { OnboardingFlow as i } from "./OnboardingFlow/OnboardingFlow.js";
|
|
6
|
+
import { Address as c } from "./Address/Address.js";
|
|
7
|
+
import { ContractorProfile as C } from "./Profile/ContractorProfile.js";
|
|
7
8
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
c as Address,
|
|
10
|
+
m as ContractorList,
|
|
11
|
+
C as ContractorProfile,
|
|
12
|
+
n as ContractorSubmit,
|
|
12
13
|
p as NewHireReport,
|
|
14
|
+
i as OnboardingFlow,
|
|
13
15
|
t as PaymentMethod
|
|
14
16
|
};
|
|
15
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -3,8 +3,8 @@ import { useFormContext as l, useWatch as d } from "react-hook-form";
|
|
|
3
3
|
import { useTranslation as T } from "react-i18next";
|
|
4
4
|
import { useCompensation as O } from "./useCompensation.js";
|
|
5
5
|
import "classnames";
|
|
6
|
-
import { FlsaStatus as a } from "../../../shared/constants.js";
|
|
7
6
|
import { ActionsLayout as u } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
7
|
+
import { FlsaStatus as a } from "../../../shared/constants.js";
|
|
8
8
|
import { useComponentContext as C } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
9
|
const h = () => {
|
|
10
10
|
const { isPending: s, mode: t, submitWithEffect: o, handleAdd: D, handleCancelAddJob: m, primaryFlsaStatus: r } = O(), { t: n } = T("Employee.Compensation"), { control: I } = l(), c = d({ control: I, name: "flsaStatus" }), e = C();
|
|
@@ -6,17 +6,17 @@ import { useCompensation as R, rateMinimumError as Y, rateExemptThresholdError a
|
|
|
6
6
|
import { FlsaStatus as a, PAY_PERIODS as r, FLSA_OVERTIME_SALARY_LIMIT as N } from "../../../shared/constants.js";
|
|
7
7
|
import x from "../../Common/hooks/useNumberFormatter.js";
|
|
8
8
|
import "classnames";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { SwitchField as J } from "../../Common/Fields/SwitchField/SwitchField.js";
|
|
13
|
-
import { useComponentContext as K } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
-
import { WA_RISK_CLASS_CODES as q } from "../../../models/WA_RISK_CODES.js";
|
|
9
|
+
import { useComponentContext as j } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
|
+
import { WA_RISK_CLASS_CODES as X } from "../../../models/WA_RISK_CODES.js";
|
|
11
|
+
import { TextInputField as B } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
15
12
|
import { SelectField as b } from "../../Common/Fields/SelectField/SelectField.js";
|
|
13
|
+
import { NumberInputField as J } from "../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
14
|
+
import { SwitchField as K } from "../../Common/Fields/SwitchField/SwitchField.js";
|
|
15
|
+
import { RadioGroupField as q } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
16
16
|
import { ComboBoxField as H } from "../../Common/Fields/ComboBoxField/ComboBoxField.js";
|
|
17
17
|
const pe = () => {
|
|
18
|
-
const { t: e } = P("Employee.Compensation"), l = x("currency"), m =
|
|
19
|
-
() =>
|
|
18
|
+
const { t: e } = P("Employee.Compensation"), l = x("currency"), m = j(), S = F(
|
|
19
|
+
() => X.map(({ code: o, description: D }) => ({ value: o, label: D })),
|
|
20
20
|
[]
|
|
21
21
|
), {
|
|
22
22
|
control: f,
|
|
@@ -45,7 +45,7 @@ const pe = () => {
|
|
|
45
45
|
limit: l(N)
|
|
46
46
|
})), /* @__PURE__ */ d(O, { children: [
|
|
47
47
|
/* @__PURE__ */ t(
|
|
48
|
-
|
|
48
|
+
B,
|
|
49
49
|
{
|
|
50
50
|
name: "jobTitle",
|
|
51
51
|
label: e("jobTitle"),
|
|
@@ -77,7 +77,7 @@ const pe = () => {
|
|
|
77
77
|
}
|
|
78
78
|
),
|
|
79
79
|
/* @__PURE__ */ t(
|
|
80
|
-
|
|
80
|
+
J,
|
|
81
81
|
{
|
|
82
82
|
name: "rate",
|
|
83
83
|
label: e("amount"),
|
|
@@ -90,7 +90,7 @@ const pe = () => {
|
|
|
90
90
|
),
|
|
91
91
|
A && /* @__PURE__ */ d(O, { children: [
|
|
92
92
|
/* @__PURE__ */ t(
|
|
93
|
-
|
|
93
|
+
K,
|
|
94
94
|
{
|
|
95
95
|
name: "adjustForMinimumWage",
|
|
96
96
|
label: e("adjustForMinimumWage"),
|
|
@@ -126,7 +126,7 @@ const pe = () => {
|
|
|
126
126
|
v && /* @__PURE__ */ t(m.Checkbox, { label: e("twoPercentStakeholderLabel"), name: "twoPercentShareholder" }),
|
|
127
127
|
W === "WA" && /* @__PURE__ */ d(O, { children: [
|
|
128
128
|
/* @__PURE__ */ t(
|
|
129
|
-
|
|
129
|
+
q,
|
|
130
130
|
{
|
|
131
131
|
name: "stateWcCovered",
|
|
132
132
|
label: e("stateWcCoveredLabel"),
|
|
@@ -4,58 +4,57 @@ import { useCompensation as d } from "./useCompensation.js";
|
|
|
4
4
|
import C from "../../../assets/icons/pencil.svg.js";
|
|
5
5
|
import c from "../../../assets/icons/trashcan.svg.js";
|
|
6
6
|
import "classnames";
|
|
7
|
-
import "../../../shared/constants.js";
|
|
8
7
|
import { HamburgerMenu as f } from "../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
9
8
|
import { useDataView as y } from "../../Common/DataView/useDataView.js";
|
|
10
9
|
import { DataView as g } from "../../Common/DataView/DataView.js";
|
|
11
|
-
const
|
|
12
|
-
const { employeeJobs: i, mode: o, isPending: r, handleEdit: l, handleDelete: s } = d(), { t
|
|
10
|
+
const P = () => {
|
|
11
|
+
const { employeeJobs: i, mode: o, isPending: r, handleEdit: l, handleDelete: s } = d(), { t } = p("Employee.Compensation"), { ...m } = y({
|
|
13
12
|
data: i,
|
|
14
13
|
columns: [
|
|
15
14
|
{
|
|
16
15
|
key: "title",
|
|
17
|
-
title:
|
|
18
|
-
render: (
|
|
16
|
+
title: t("allCompensations.jobColumn"),
|
|
17
|
+
render: (e) => e.title || ""
|
|
19
18
|
},
|
|
20
19
|
{
|
|
21
20
|
key: "flsaStatus",
|
|
22
|
-
title:
|
|
23
|
-
render: (
|
|
24
|
-
const n =
|
|
25
|
-
(u) => u.uuid ===
|
|
21
|
+
title: t("allCompensations.typeColumn"),
|
|
22
|
+
render: (e) => {
|
|
23
|
+
const n = e.compensations?.find(
|
|
24
|
+
(u) => u.uuid === e.currentCompensationUuid
|
|
26
25
|
)?.flsaStatus;
|
|
27
|
-
return n !== void 0 ?
|
|
26
|
+
return n !== void 0 ? t(`flsaStatusLabels.${n}`) : null;
|
|
28
27
|
}
|
|
29
28
|
},
|
|
30
29
|
{
|
|
31
30
|
key: "rate",
|
|
32
|
-
title:
|
|
33
|
-
render: (
|
|
31
|
+
title: t("allCompensations.amountColumn"),
|
|
32
|
+
render: (e) => e.rate?.toString() || ""
|
|
34
33
|
},
|
|
35
34
|
{
|
|
36
35
|
key: "paymentUnit",
|
|
37
|
-
title:
|
|
38
|
-
render: (
|
|
36
|
+
title: t("allCompensations.perColumn"),
|
|
37
|
+
render: (e) => e.paymentUnit || ""
|
|
39
38
|
}
|
|
40
39
|
],
|
|
41
|
-
itemMenu: (
|
|
40
|
+
itemMenu: (e) => /* @__PURE__ */ a(
|
|
42
41
|
f,
|
|
43
42
|
{
|
|
44
|
-
triggerLabel:
|
|
43
|
+
triggerLabel: t("hamburgerTitle"),
|
|
45
44
|
items: [
|
|
46
45
|
{
|
|
47
|
-
label:
|
|
46
|
+
label: t("allCompensations.editCta"),
|
|
48
47
|
icon: /* @__PURE__ */ a(C, { "aria-hidden": !0 }),
|
|
49
48
|
onClick: () => {
|
|
50
|
-
l(
|
|
49
|
+
l(e.uuid);
|
|
51
50
|
}
|
|
52
51
|
},
|
|
53
|
-
...
|
|
52
|
+
...e.primary ? [] : [
|
|
54
53
|
{
|
|
55
|
-
label:
|
|
54
|
+
label: t("allCompensations.deleteCta"),
|
|
56
55
|
icon: /* @__PURE__ */ a(c, { "aria-hidden": !0 }),
|
|
57
56
|
onClick: () => {
|
|
58
|
-
s(
|
|
57
|
+
s(e.uuid);
|
|
59
58
|
}
|
|
60
59
|
}
|
|
61
60
|
]
|
|
@@ -65,9 +64,9 @@ const U = () => {
|
|
|
65
64
|
)
|
|
66
65
|
});
|
|
67
66
|
if (o === "LIST")
|
|
68
|
-
return /* @__PURE__ */ a(g, { "data-testid": "data-view", label:
|
|
67
|
+
return /* @__PURE__ */ a(g, { "data-testid": "data-view", label: t("allCompensations.tableLabel"), ...m });
|
|
69
68
|
};
|
|
70
69
|
export {
|
|
71
|
-
|
|
70
|
+
P as List
|
|
72
71
|
};
|
|
73
72
|
//# sourceMappingURL=List.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sources":["../../../../src/components/Employee/Compensation/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type Job } from '@gusto/embedded-api/models/components/job'\nimport { useCompensation } from './useCompensation'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { DataView, useDataView } from '@/components/Common'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { employeeJobs, mode, isPending, handleEdit, handleDelete } = useCompensation()\n const { t } = useTranslation('Employee.Compensation')\n\n const { ...dataViewProps } = useDataView({\n data: employeeJobs,\n columns: [\n {\n key: 'title',\n title: t('allCompensations.jobColumn'),\n render: (job: Job) => job.title || '',\n },\n {\n key: 'flsaStatus',\n title: t('allCompensations.typeColumn'),\n render: (job: Job) => {\n const flsaStatus = job.compensations?.find(\n comp => comp.uuid === job.currentCompensationUuid,\n )?.flsaStatus\n return flsaStatus !== undefined ? t(`flsaStatusLabels.${flsaStatus}`) : null\n },\n },\n {\n key: 'rate',\n title: t('allCompensations.amountColumn'),\n render: (job: Job) => job.rate?.toString() || '',\n },\n {\n key: 'paymentUnit',\n title: t('allCompensations.perColumn'),\n render: (job: Job) => job.paymentUnit || '',\n },\n ],\n itemMenu: (job: Job) => (\n <HamburgerMenu\n triggerLabel={t('hamburgerTitle')}\n items={[\n {\n label: t('allCompensations.editCta'),\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n handleEdit(job.uuid)\n },\n },\n ...(!job.primary\n ? [\n {\n label: t('allCompensations.deleteCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n handleDelete(job.uuid)\n },\n },\n ]\n : []),\n ]}\n isLoading={isPending}\n />\n ),\n })\n\n if (mode !== 'LIST') {\n return\n }\n\n return (\n <DataView data-testid=\"data-view\" label={t('allCompensations.tableLabel')} {...dataViewProps} />\n )\n}\n"],"names":["List","employeeJobs","mode","isPending","handleEdit","handleDelete","useCompensation","
|
|
1
|
+
{"version":3,"file":"List.js","sources":["../../../../src/components/Employee/Compensation/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type Job } from '@gusto/embedded-api/models/components/job'\nimport { useCompensation } from './useCompensation'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { DataView, useDataView } from '@/components/Common'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { employeeJobs, mode, isPending, handleEdit, handleDelete } = useCompensation()\n const { t } = useTranslation('Employee.Compensation')\n\n const { ...dataViewProps } = useDataView({\n data: employeeJobs,\n columns: [\n {\n key: 'title',\n title: t('allCompensations.jobColumn'),\n render: (job: Job) => job.title || '',\n },\n {\n key: 'flsaStatus',\n title: t('allCompensations.typeColumn'),\n render: (job: Job) => {\n const flsaStatus = job.compensations?.find(\n comp => comp.uuid === job.currentCompensationUuid,\n )?.flsaStatus\n return flsaStatus !== undefined ? t(`flsaStatusLabels.${flsaStatus}`) : null\n },\n },\n {\n key: 'rate',\n title: t('allCompensations.amountColumn'),\n render: (job: Job) => job.rate?.toString() || '',\n },\n {\n key: 'paymentUnit',\n title: t('allCompensations.perColumn'),\n render: (job: Job) => job.paymentUnit || '',\n },\n ],\n itemMenu: (job: Job) => (\n <HamburgerMenu\n triggerLabel={t('hamburgerTitle')}\n items={[\n {\n label: t('allCompensations.editCta'),\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n handleEdit(job.uuid)\n },\n },\n ...(!job.primary\n ? [\n {\n label: t('allCompensations.deleteCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n handleDelete(job.uuid)\n },\n },\n ]\n : []),\n ]}\n isLoading={isPending}\n />\n ),\n })\n\n if (mode !== 'LIST') {\n return\n }\n\n return (\n <DataView data-testid=\"data-view\" label={t('allCompensations.tableLabel')} {...dataViewProps} />\n )\n}\n"],"names":["List","employeeJobs","mode","isPending","handleEdit","handleDelete","useCompensation","useTranslation","dataViewProps","useDataView","job","flsaStatus","comp","jsx","HamburgerMenu","PencilSvg","TrashCanSvg","DataView"],"mappings":";;;;;;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,cAAAC,GAAc,MAAAC,GAAM,WAAAC,GAAW,YAAAC,GAAY,cAAAC,EAAA,IAAiBC,EAAA,GAC9D,EAAE,EAAA,IAAMC,EAAe,uBAAuB,GAE9C,EAAE,GAAGC,EAAA,IAAkBC,EAAY;AAAA,IACvC,MAAMR;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,4BAA4B;AAAA,QACrC,QAAQ,CAACS,MAAaA,EAAI,SAAS;AAAA,MAAA;AAAA,MAErC;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,6BAA6B;AAAA,QACtC,QAAQ,CAACA,MAAa;AACpB,gBAAMC,IAAaD,EAAI,eAAe;AAAA,YACpC,CAAAE,MAAQA,EAAK,SAASF,EAAI;AAAA,UAAA,GACzB;AACH,iBAAOC,MAAe,SAAY,EAAE,oBAAoBA,CAAU,EAAE,IAAI;AAAA,QAC1E;AAAA,MAAA;AAAA,MAEF;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,+BAA+B;AAAA,QACxC,QAAQ,CAACD,MAAaA,EAAI,MAAM,cAAc;AAAA,MAAA;AAAA,MAEhD;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,4BAA4B;AAAA,QACrC,QAAQ,CAACA,MAAaA,EAAI,eAAe;AAAA,MAAA;AAAA,IAC3C;AAAA,IAEF,UAAU,CAACA,MACT,gBAAAG;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,cAAc,EAAE,gBAAgB;AAAA,QAChC,OAAO;AAAA,UACL;AAAA,YACE,OAAO,EAAE,0BAA0B;AAAA,YACnC,MAAM,gBAAAD,EAACE,GAAA,EAAU,eAAW,GAAA,CAAC;AAAA,YAC7B,SAAS,MAAM;AACb,cAAAX,EAAWM,EAAI,IAAI;AAAA,YACrB;AAAA,UAAA;AAAA,UAEF,GAAKA,EAAI,UAUL,CAAA,IATA;AAAA,YACE;AAAA,cACE,OAAO,EAAE,4BAA4B;AAAA,cACrC,MAAM,gBAAAG,EAACG,GAAA,EAAY,eAAW,GAAA,CAAC;AAAA,cAC/B,SAAS,MAAM;AACb,gBAAAX,EAAaK,EAAI,IAAI;AAAA,cACvB;AAAA,YAAA;AAAA,UACF;AAAA,QAED;AAAA,QAEP,WAAWP;AAAA,MAAA;AAAA,IAAA;AAAA,EACb,CAEH;AAED,MAAID,MAAS;AAIb,WACE,gBAAAW,EAACI,KAAS,eAAY,aAAY,OAAO,EAAE,6BAA6B,GAAI,GAAGT,GAAe;AAElG;"}
|
|
@@ -12,13 +12,13 @@ import { useBase as H } from "../../../Base/useBase.js";
|
|
|
12
12
|
import { Form as V } from "../../../Common/Form/Form.js";
|
|
13
13
|
import { Flex as W } from "../../../Common/Flex/Flex.js";
|
|
14
14
|
import "classnames";
|
|
15
|
+
import { ActionsLayout as J } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
16
|
+
import { useComponentDictionary as K, useI18n as Q } from "../../../../i18n/I18n.js";
|
|
15
17
|
import { componentEvents as p } from "../../../../shared/constants.js";
|
|
18
|
+
import { useComponentContext as X } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
19
|
+
import { TextInputField as Z } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
16
20
|
import { RadioGroupField as x } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
17
|
-
import { TextInputField as J } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
18
|
-
import { ActionsLayout as K } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
19
21
|
import { NumberInputField as f } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
20
|
-
import { useComponentDictionary as Q, useI18n as X } from "../../../../i18n/I18n.js";
|
|
21
|
-
import { useComponentContext as Z } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
22
22
|
import { CheckboxField as $ } from "../../../Common/Fields/CheckboxField/CheckboxField.js";
|
|
23
23
|
const ee = i.object({
|
|
24
24
|
active: i.boolean(),
|
|
@@ -35,8 +35,8 @@ function Me(t) {
|
|
|
35
35
|
return /* @__PURE__ */ n(z, { ...t, children: /* @__PURE__ */ n(ne, { ...t, children: t.children }) });
|
|
36
36
|
}
|
|
37
37
|
function ne({ className: t, children: b, employeeId: g, deductionId: h, dictionary: y }) {
|
|
38
|
-
const { onEvent: u, baseSubmitHandler: P } = H(), { t: r } = N("Employee.Deductions"), m =
|
|
39
|
-
|
|
38
|
+
const { onEvent: u, baseSubmitHandler: P } = H(), { t: r } = N("Employee.Deductions"), m = X();
|
|
39
|
+
K("Employee.Deductions", y), Q("Employee.Deductions");
|
|
40
40
|
const { data: C } = k({ employeeId: g }), e = h ? C.garnishmentList?.find((c) => c.uuid === h) ?? null : null, { mutateAsync: M, isPending: O } = j(), { mutateAsync: L, isPending: T } = Y(), a = B(() => ({
|
|
41
41
|
amount: e?.amount ? Number(e.amount) : 0,
|
|
42
42
|
description: e?.description ?? "",
|
|
@@ -83,7 +83,7 @@ function ne({ className: t, children: b, employeeId: g, deductionId: h, dictiona
|
|
|
83
83
|
}, S = r(e ? "editDeductionTitle" : "addDeductionTitle");
|
|
84
84
|
return /* @__PURE__ */ n("section", { className: t, children: /* @__PURE__ */ n(w, { ...s, children: /* @__PURE__ */ n(V, { onSubmit: s.handleSubmit(R), children: /* @__PURE__ */ n(W, { flexDirection: "column", gap: 32, children: b || /* @__PURE__ */ d(E, { children: [
|
|
85
85
|
/* @__PURE__ */ n(m.Heading, { as: "h2", children: S }),
|
|
86
|
-
/* @__PURE__ */ n(
|
|
86
|
+
/* @__PURE__ */ n(Z, { name: "description", label: r("descriptionLabel"), isRequired: !0 }),
|
|
87
87
|
/* @__PURE__ */ n(
|
|
88
88
|
x,
|
|
89
89
|
{
|
|
@@ -122,7 +122,7 @@ function ne({ className: t, children: b, employeeId: g, deductionId: h, dictiona
|
|
|
122
122
|
/* @__PURE__ */ n(f, { name: "payPeriodMaximum", label: "Pay period maximum", min: 0 })
|
|
123
123
|
] }),
|
|
124
124
|
/* @__PURE__ */ n($, { name: "courtOrdered", label: r("courtOrderedLabel") }),
|
|
125
|
-
/* @__PURE__ */ d(
|
|
125
|
+
/* @__PURE__ */ d(J, { children: [
|
|
126
126
|
/* @__PURE__ */ n(m.Button, { variant: "secondary", onClick: q, children: r("cancelCta") }),
|
|
127
127
|
/* @__PURE__ */ n(m.Button, { type: "submit", isLoading: F, children: r(e ? "continueCta" : "addDeductionCta") })
|
|
128
128
|
] })
|
|
@@ -6,13 +6,13 @@ import { BaseComponent as _ } from "../../../Base/Base.js";
|
|
|
6
6
|
import { useBase as k } from "../../../Base/useBase.js";
|
|
7
7
|
import { Flex as w } from "../../../Common/Flex/Flex.js";
|
|
8
8
|
import "classnames";
|
|
9
|
-
import { componentEvents as a } from "../../../../shared/constants.js";
|
|
10
9
|
import { ActionsLayout as I } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
11
10
|
import u from "../../../Common/hooks/useNumberFormatter.js";
|
|
12
11
|
import M from "../../../../assets/icons/pencil.svg.js";
|
|
13
12
|
import U from "../../../../assets/icons/trashcan.svg.js";
|
|
14
13
|
import { HamburgerMenu as B } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
15
14
|
import { useComponentDictionary as S, useI18n as Y } from "../../../../i18n/I18n.js";
|
|
15
|
+
import { componentEvents as a } from "../../../../shared/constants.js";
|
|
16
16
|
import { useComponentContext as q } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
17
17
|
import { useDataView as F } from "../../../Common/DataView/useDataView.js";
|
|
18
18
|
import { DataView as H } from "../../../Common/DataView/DataView.js";
|
|
@@ -7,18 +7,18 @@ import { BaseComponent as C } from "../../../Base/Base.js";
|
|
|
7
7
|
import { useBase as b } from "../../../Base/useBase.js";
|
|
8
8
|
import { Form as N } from "../../../Common/Form/Form.js";
|
|
9
9
|
import "classnames";
|
|
10
|
+
import { ActionsLayout as v } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
11
|
+
import { useComponentDictionary as F, useI18n as I } from "../../../../i18n/I18n.js";
|
|
10
12
|
import { componentEvents as s } from "../../../../shared/constants.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { useComponentDictionary as I, useI18n as Y } from "../../../../i18n/I18n.js";
|
|
14
|
-
import { useComponentContext as y } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
+
import { useComponentContext as Y } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
+
import { RadioGroupField as y } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
15
15
|
const L = m.object({ includeDeductions: m.enum(["Yes", "No"]) });
|
|
16
16
|
function G(n) {
|
|
17
17
|
return /* @__PURE__ */ e(C, { ...n, children: /* @__PURE__ */ e(_, { ...n, children: n.children }) });
|
|
18
18
|
}
|
|
19
19
|
function _({ className: n, children: t, dictionary: u }) {
|
|
20
|
-
const { onEvent: i } = b(), { t: o } = D("Employee.Deductions"), r =
|
|
21
|
-
|
|
20
|
+
const { onEvent: i } = b(), { t: o } = D("Employee.Deductions"), r = Y();
|
|
21
|
+
F("Employee.Deductions", u), I("Employee.Deductions");
|
|
22
22
|
const c = f({
|
|
23
23
|
resolver: h(L),
|
|
24
24
|
defaultValues: { includeDeductions: "No" }
|
|
@@ -28,7 +28,7 @@ function _({ className: n, children: t, dictionary: u }) {
|
|
|
28
28
|
return /* @__PURE__ */ e("section", { className: n, children: /* @__PURE__ */ e(E, { ...c, children: /* @__PURE__ */ e(N, { onSubmit: c.handleSubmit(d), children: t || /* @__PURE__ */ p(a, { children: [
|
|
29
29
|
/* @__PURE__ */ e(r.Heading, { as: "h2", children: o("pageTitle") }),
|
|
30
30
|
/* @__PURE__ */ e(
|
|
31
|
-
|
|
31
|
+
y,
|
|
32
32
|
{
|
|
33
33
|
name: "includeDeductions",
|
|
34
34
|
isRequired: !0,
|
|
@@ -40,7 +40,7 @@ function _({ className: n, children: t, dictionary: u }) {
|
|
|
40
40
|
]
|
|
41
41
|
}
|
|
42
42
|
),
|
|
43
|
-
/* @__PURE__ */ e(
|
|
43
|
+
/* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(r.Button, { type: "submit", children: o("continueCta") }) })
|
|
44
44
|
] }) }) }) });
|
|
45
45
|
}
|
|
46
46
|
export {
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as r } from "react-i18next";
|
|
3
|
-
import { useDocumentList as
|
|
3
|
+
import { useDocumentList as s } from "./useDocumentList.js";
|
|
4
4
|
import "classnames";
|
|
5
|
-
import "
|
|
6
|
-
import { ActionsLayout as s } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
5
|
+
import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
7
6
|
import { useComponentContext as c } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
|
-
function
|
|
9
|
-
const { t } = r("Employee.DocumentSigner"), { handleContinue:
|
|
10
|
-
return /* @__PURE__ */ o(
|
|
7
|
+
function C() {
|
|
8
|
+
const { t: n } = r("Employee.DocumentSigner"), { handleContinue: t, hasSignedAllForms: i } = s(), e = c();
|
|
9
|
+
return /* @__PURE__ */ o(m, { children: /* @__PURE__ */ o(e.Button, { onClick: t, isLoading: !1, isDisabled: !i, children: n("continueCta") }) });
|
|
11
10
|
}
|
|
12
11
|
export {
|
|
13
|
-
|
|
12
|
+
C as Actions
|
|
14
13
|
};
|
|
15
14
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDocumentList } from './useDocumentList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Employee.DocumentSigner')\n const { handleContinue, hasSignedAllForms } = useDocumentList()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button onClick={handleContinue} isLoading={false} isDisabled={!hasSignedAllForms}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleContinue","hasSignedAllForms","useDocumentList","Components","useComponentContext","ActionsLayout","jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDocumentList } from './useDocumentList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Employee.DocumentSigner')\n const { handleContinue, hasSignedAllForms } = useDocumentList()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button onClick={handleContinue} isLoading={false} isDisabled={!hasSignedAllForms}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","handleContinue","hasSignedAllForms","useDocumentList","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAChD,EAAE,gBAAAC,GAAgB,mBAAAC,EAAA,IAAsBC,EAAA,GACxCC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACC,UAAA,gBAAAC,EAACH,EAAW,QAAX,EAAkB,SAASH,GAAgB,WAAW,IAAO,YAAY,CAACC,GACxE,UAAAH,EAAE,aAAa,GAClB,GACF;AAEJ;"}
|
|
@@ -9,13 +9,14 @@ import { useBase as L } from "../../../Base/useBase.js";
|
|
|
9
9
|
import { useI18n as S } from "../../../../i18n/I18n.js";
|
|
10
10
|
import { componentEvents as m } from "../../../../shared/constants.js";
|
|
11
11
|
import { Flex as g } from "../../../Common/Flex/Flex.js";
|
|
12
|
+
import "react-i18next";
|
|
12
13
|
import "classnames";
|
|
13
|
-
function
|
|
14
|
+
function N(e) {
|
|
14
15
|
return /* @__PURE__ */ o(F, { ...e, children: /* @__PURE__ */ o(O, { ...e }) });
|
|
15
16
|
}
|
|
16
|
-
function O({ employeeId: e, className: s, children:
|
|
17
|
+
function O({ employeeId: e, className: s, children: t }) {
|
|
17
18
|
S("Employee.DocumentSigner");
|
|
18
|
-
const { onEvent:
|
|
19
|
+
const { onEvent: n } = L(), { data: u, error: c } = f({ employeeId: e }), i = u.formList, p = i.every((r) => !r.requiresSigning);
|
|
19
20
|
return /* @__PURE__ */ o("section", { className: s, children: /* @__PURE__ */ o(
|
|
20
21
|
h,
|
|
21
22
|
{
|
|
@@ -23,14 +24,14 @@ function O({ employeeId: e, className: s, children: n }) {
|
|
|
23
24
|
employeeForms: i,
|
|
24
25
|
hasSignedAllForms: p,
|
|
25
26
|
handleContinue: () => {
|
|
26
|
-
|
|
27
|
+
n(m.EMPLOYEE_FORMS_DONE);
|
|
27
28
|
},
|
|
28
29
|
handleRequestFormToSign: (r) => {
|
|
29
|
-
|
|
30
|
+
n(m.EMPLOYEE_VIEW_FORM_TO_SIGN, { uuid: r.uuid });
|
|
30
31
|
},
|
|
31
32
|
documentListError: c
|
|
32
33
|
},
|
|
33
|
-
children:
|
|
34
|
+
children: t || /* @__PURE__ */ l(g, { flexDirection: "column", children: [
|
|
34
35
|
/* @__PURE__ */ o(d, {}),
|
|
35
36
|
/* @__PURE__ */ o(E, {}),
|
|
36
37
|
/* @__PURE__ */ o(a, {})
|
|
@@ -39,6 +40,6 @@ function O({ employeeId: e, className: s, children: n }) {
|
|
|
39
40
|
) });
|
|
40
41
|
}
|
|
41
42
|
export {
|
|
42
|
-
|
|
43
|
+
N as DocumentList
|
|
43
44
|
};
|
|
44
45
|
//# 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"],"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"],"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;AAC9E,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,WAAAC,GAAW,UAAAC,KAA+B;AACpE,EAAAC,EAAQ,yBAAyB;AACjC,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEd,EAAE,MAAAC,GAAM,OAAOC,EAAA,IAAsBC,EAA6B,EAAE,YAAAR,GAAY,GAChFS,IAAgBH,EAAK,UAErBI,IAAoBD,EAAc,MAAM,CAAAE,MAAgB,CAACA,EAAa,eAAe;AAU3F,SACE,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,MAAA;AAAA,MAGD,UAAAL,KAGC,gBAAAY,EAACC,GAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAAlB,EAACmB,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ;"}
|
|
@@ -3,9 +3,8 @@ 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
5
|
import "classnames";
|
|
6
|
-
import "../../../../shared/constants.js";
|
|
7
6
|
import { DocumentList as u } from "../../../Common/DocumentList/DocumentList.js";
|
|
8
|
-
function
|
|
7
|
+
function b() {
|
|
9
8
|
const { employeeForms: i, handleRequestFormToSign: n, documentListError: r } = s(), { t: e } = m("Employee.DocumentSigner");
|
|
10
9
|
return /* @__PURE__ */ o("section", { style: { width: "100%" }, children: /* @__PURE__ */ o(l, { flexDirection: "column", gap: 32, children: /* @__PURE__ */ o(
|
|
11
10
|
u,
|
|
@@ -34,6 +33,6 @@ function f() {
|
|
|
34
33
|
) }) });
|
|
35
34
|
}
|
|
36
35
|
export {
|
|
37
|
-
|
|
36
|
+
b as List
|
|
38
37
|
};
|
|
39
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,EAAA,GAChE,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB;AAEtD,SACE,gBAAAC,EAAC,WAAA,EAAQ,OAAO,EAAE,OAAO,UACvB,UAAA,gBAAAA,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAD;AAAA,IAACE;AAAAA,IAAA;AAAA,MACC,OAAOR,EAAc,IAAI,CAAAS,OAAS;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,MAAA;AAAA,MAE/B,cAAc;AAAA,QACZ,SAASA,EAAE,iBAAiB;AAAA,QAC5B,WAAWA,EAAE,WAAW;AAAA,QACxB,UAAUA,EAAE,sBAAsB;AAAA,MAAA;AAAA,MAEpC,iBAAiBA,EAAE,iBAAiB;AAAA,MACpC,YAAYA,EAAE,mBAAmB;AAAA,IAAA;AAAA,EAAA,GAErC,EAAA,CACF;AAEJ;"}
|
|
@@ -11,11 +11,10 @@ import "../../../../shared/constants.js";
|
|
|
11
11
|
import "classnames";
|
|
12
12
|
import "dompurify";
|
|
13
13
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
-
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
15
14
|
import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
15
|
+
const [d, a] = t("DocumentListContext");
|
|
17
16
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
a as DocumentListProvider,
|
|
18
|
+
d as useDocumentList
|
|
20
19
|
};
|
|
21
20
|
//# sourceMappingURL=useDocumentList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDocumentList.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n employeeForms: Form[]\n hasSignedAllForms: boolean\n handleContinue: () => void\n handleRequestFormToSign: (form: Form) => void\n documentListError: Error | null\n formToSign?: Form\n}\n\nconst [useDocumentList, DocumentListProvider] =\n createCompoundContext<DocumentListContextType>('DocumentListContext')\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDocumentList.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n employeeForms: Form[]\n hasSignedAllForms: boolean\n handleContinue: () => void\n handleRequestFormToSign: (form: Form) => void\n documentListError: Error | null\n formToSign?: Form\n}\n\nconst [useDocumentList, DocumentListProvider] =\n createCompoundContext<DocumentListContextType>('DocumentListContext')\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAYA,MAAM,CAACA,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
|
|
@@ -12,16 +12,17 @@ import { useBase as C } from "../../../Base/useBase.js";
|
|
|
12
12
|
import { useI18n as G } from "../../../../i18n/I18n.js";
|
|
13
13
|
import { componentEvents as i } from "../../../../shared/constants.js";
|
|
14
14
|
import { Flex as M } from "../../../Common/Flex/Flex.js";
|
|
15
|
+
import "react-i18next";
|
|
15
16
|
import "classnames";
|
|
16
17
|
import { SignatureForm as R } from "../../../Common/SignatureForm/SignatureForm.js";
|
|
17
|
-
function
|
|
18
|
+
function X(r) {
|
|
18
19
|
return /* @__PURE__ */ o(A, { ...r, children: /* @__PURE__ */ o(j, { ...r }) });
|
|
19
20
|
}
|
|
20
|
-
function j({ employeeId: r, formId: s, className: u, children:
|
|
21
|
+
function j({ employeeId: r, formId: s, className: u, children: n }) {
|
|
21
22
|
G("Employee.DocumentSigner");
|
|
22
|
-
const { onEvent: e, baseSubmitHandler: a } = C(), { data: c } = x({ employeeId: r, formId: s }),
|
|
23
|
+
const { onEvent: e, baseSubmitHandler: a } = C(), { data: c } = x({ employeeId: r, formId: s }), t = c.form, {
|
|
23
24
|
data: { formPdf: f }
|
|
24
|
-
} = h({ employeeId: r, formId:
|
|
25
|
+
} = h({ employeeId: r, formId: t.uuid }), d = f.documentUrl, { mutateAsync: p, isPending: l } = P();
|
|
25
26
|
return /* @__PURE__ */ o("section", { className: u, children: /* @__PURE__ */ o(
|
|
26
27
|
w,
|
|
27
28
|
{
|
|
@@ -30,16 +31,16 @@ function j({ employeeId: r, formId: s, className: u, children: t }) {
|
|
|
30
31
|
handleBack: () => {
|
|
31
32
|
e(i.CANCEL);
|
|
32
33
|
},
|
|
33
|
-
form:
|
|
34
|
+
form: t,
|
|
34
35
|
isPending: l
|
|
35
36
|
},
|
|
36
37
|
children: /* @__PURE__ */ o(R, { onSubmit: async (g) => {
|
|
37
38
|
await a(g, async (m) => {
|
|
38
|
-
if (
|
|
39
|
+
if (t.uuid) {
|
|
39
40
|
const { form: S } = await p({
|
|
40
41
|
request: {
|
|
41
42
|
employeeId: r,
|
|
42
|
-
formId:
|
|
43
|
+
formId: t.uuid,
|
|
43
44
|
requestBody: {
|
|
44
45
|
signatureText: m.signature,
|
|
45
46
|
agree: m.confirmSignature
|
|
@@ -49,7 +50,7 @@ function j({ employeeId: r, formId: s, className: u, children: t }) {
|
|
|
49
50
|
e(i.EMPLOYEE_SIGN_FORM, S);
|
|
50
51
|
}
|
|
51
52
|
});
|
|
52
|
-
}, children: /* @__PURE__ */ o(M, { flexDirection: "column", children:
|
|
53
|
+
}, children: /* @__PURE__ */ o(M, { flexDirection: "column", children: n || /* @__PURE__ */ F(E, { children: [
|
|
53
54
|
/* @__PURE__ */ o(v, {}),
|
|
54
55
|
/* @__PURE__ */ o(B, {}),
|
|
55
56
|
/* @__PURE__ */ o(b, {}),
|
|
@@ -59,6 +60,6 @@ function j({ employeeId: r, formId: s, className: u, children: t }) {
|
|
|
59
60
|
) });
|
|
60
61
|
}
|
|
61
62
|
export {
|
|
62
|
-
|
|
63
|
+
X as SignatureForm
|
|
63
64
|
};
|
|
64
65
|
//# 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"],"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"],"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":";;;;;;;;;;;;;;;;;AAyBO,SAASA,EAAcC,GAAoD;AAChF,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,QAAAC,GAAQ,WAAAC,GAAW,UAAAC,KAAgC;AAC7E,EAAAC,EAAQ,yBAAyB;AACjC,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GAEjC,EAAE,MAAAC,EAAA,IAASC,EAA4B,EAAE,YAAAT,GAAY,QAAAC,GAAQ,GAC7DS,IAAOF,EAAK,MAEZ;AAAA,IACJ,MAAM,EAAE,SAAAG,EAAA;AAAA,EAAQ,IACdC,EAA+B,EAAE,YAAAZ,GAAY,QAAQU,EAAK,MAAM,GAC9DG,IAASF,EAAS,aAElB,EAAE,aAAaG,GAAU,WAAWC,EAAA,IAAsBC,EAAA;AAwBhE,SACE,gBAAAnB,EAAC,aAAQ,WAAAK,GACP,UAAA,gBAAAL;AAAA,IAACoB;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,QAAAJ;AAAA,QACA,YA3BW,MAAM;AACvB,UAAAR,EAAQa,EAAgB,MAAM;AAAA,QAChC;AAAA,QA0BQ,MAAAR;AAAA,QACA,WAAWK;AAAA,MAAA;AAAA,MAGb,UAAA,gBAAAlB,EAACsB,GAAA,EAAoB,UA5BN,OAAOX,MAA8B;AACxD,cAAMF,EAAkBE,GAAM,OAAMY,MAAW;AAC7C,cAAIV,EAAK,MAAM;AACb,kBAAM,EAAE,MAAMW,EAAA,IAAmB,MAAMP,EAAS;AAAA,cAC9C,SAAS;AAAA,gBACP,YAAAd;AAAA,gBACA,QAAQU,EAAK;AAAA,gBACb,aAAa;AAAA,kBACX,eAAeU,EAAQ;AAAA,kBACvB,OAAOA,EAAQ;AAAA,gBAAA;AAAA,cACjB;AAAA,YACF,CACD;AACD,YAAAf,EAAQa,EAAgB,oBAAoBG,CAAc;AAAA,UAC5D;AAAA,QACF,CAAC;AAAA,MACH,GAaQ,UAAA,gBAAAxB,EAACyB,KAAK,eAAc,UACjB,UAAAnB,KAGC,gBAAAoB,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAA3B,EAAC4B,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAQ;AAAA,0BACRC,GAAA,EAAc;AAAA,0BACdC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,GAEJ,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -11,11 +11,10 @@ import "../../../../shared/constants.js";
|
|
|
11
11
|
import "classnames";
|
|
12
12
|
import "dompurify";
|
|
13
13
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
-
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
15
14
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
16
|
-
const [
|
|
15
|
+
const [c, d] = o("SignatureFormContext");
|
|
17
16
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
d as SignatureFormProvider,
|
|
18
|
+
c as useSignatureForm
|
|
20
19
|
};
|
|
21
20
|
//# sourceMappingURL=useSignatureForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignatureForm.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype SignatureFormContextType = {\n form: Form\n pdfUrl?: string | null\n handleBack: () => void\n isPending: boolean\n}\n\nconst [useSignatureForm, SignatureFormProvider] =\n createCompoundContext<SignatureFormContextType>('SignatureFormContext')\nexport { useSignatureForm, SignatureFormProvider }\n"],"names":["useSignatureForm","SignatureFormProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSignatureForm.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype SignatureFormContextType = {\n form: Form\n pdfUrl?: string | null\n handleBack: () => void\n isPending: boolean\n}\n\nconst [useSignatureForm, SignatureFormProvider] =\n createCompoundContext<SignatureFormContextType>('SignatureFormContext')\nexport { useSignatureForm, SignatureFormProvider }\n"],"names":["useSignatureForm","SignatureFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAkBC,CAAqB,IAC5CC,EAAgD,sBAAsB;"}
|