@gusto/embedded-react-sdk 0.45.0 → 0.46.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/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +20 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +20 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +22 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +20 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +20 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js +4 -4
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +28 -12
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +23 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +20 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +20 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +20 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js +5 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +20 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +20 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +22 -6
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +52 -42
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.d.ts +11 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js +230 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js.map +1 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.module.scss.js +8 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.module.scss.js.map +1 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/index.d.ts +3 -0
- package/dist/components/Employee/Compensation/management/index.d.ts +3 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js +6 -6
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js +4 -4
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js +114 -111
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/fields.js +6 -6
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.d.ts +8 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js +22 -17
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.d.ts +12 -2
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js +115 -110
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
- package/dist/components/Employee/Dashboard/BasicDetailsView.d.ts +8 -3
- package/dist/components/Employee/Dashboard/BasicDetailsView.js +108 -84
- package/dist/components/Employee/Dashboard/BasicDetailsView.js.map +1 -1
- package/dist/components/Employee/Dashboard/Dashboard.d.ts +2 -0
- package/dist/components/Employee/Dashboard/Dashboard.js +64 -58
- package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +5 -1
- package/dist/components/Employee/Dashboard/DashboardComponents.js +82 -65
- package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -1
- package/dist/components/Employee/Dashboard/DocumentsView.js +18 -11
- package/dist/components/Employee/Dashboard/DocumentsView.js.map +1 -1
- package/dist/components/Employee/Dashboard/JobAndPayView.js +358 -338
- package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -1
- package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js +8 -0
- package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js.map +1 -0
- package/dist/components/Employee/Dashboard/TaxesView.d.ts +7 -2
- package/dist/components/Employee/Dashboard/TaxesView.js +68 -54
- package/dist/components/Employee/Dashboard/TaxesView.js.map +1 -1
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js +16 -5
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.d.ts +12 -5
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js +21 -21
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +13 -3
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +55 -56
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.d.ts +10 -4
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js +10 -12
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.d.ts +10 -3
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js +19 -14
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +8 -8
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +4 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +20 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js +1 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js +4 -4
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js +4 -4
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js +8 -8
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +5 -5
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js +4 -4
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js +8 -8
- package/dist/components/Employee/Taxes/useTaxes.js +20 -4
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +34 -26
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +36 -22
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js +52 -40
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js.map +1 -1
- package/dist/i18n/en/Employee.Compensation.json.js +48 -44
- package/dist/i18n/en/Employee.Compensation.json.js.map +1 -1
- package/dist/i18n/en/Employee.Dashboard.json.js +1 -1
- package/dist/i18n/en/Employee.DocumentManager.json.js +1 -1
- package/dist/i18n/en/common.json.d.ts +7 -0
- package/dist/shared/constants.d.ts +2 -0
- package/dist/shared/constants.js +19 -18
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +22 -2
- package/package.json +1 -1
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { Dashboard as
|
|
4
|
-
import { HomeAddress as
|
|
5
|
-
import { WorkAddress as
|
|
6
|
-
import { FederalTaxes as
|
|
1
|
+
import { jsxs as I, Fragment as y, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as u } from "react-i18next";
|
|
3
|
+
import { Dashboard as C } from "./Dashboard.js";
|
|
4
|
+
import { HomeAddress as D } from "../HomeAddress/management/HomeAddress.js";
|
|
5
|
+
import { WorkAddress as b } from "../WorkAddress/management/WorkAddress.js";
|
|
6
|
+
import { FederalTaxes as A } from "../FederalTaxes/management/FederalTaxes.js";
|
|
7
7
|
import { StateTaxes as x } from "../StateTaxes/management/StateTaxes.js";
|
|
8
|
-
import { Profile as
|
|
8
|
+
import { Profile as h } from "../Profile/management/Profile.js";
|
|
9
9
|
import { BankForm as v } from "../PaymentMethod/onboarding/BankForm.js";
|
|
10
10
|
import { SplitView as T } from "../PaymentMethod/onboarding/SplitView.js";
|
|
11
11
|
import { DocumentManager as g } from "../Documents/management/DocumentManager.js";
|
|
12
12
|
import { DeductionsForm as F } from "../Deductions/DeductionsForm/DeductionsForm.js";
|
|
13
|
-
import { useDeductionsList as
|
|
13
|
+
import { useDeductionsList as L } from "../Deductions/shared/useDeductionsList.js";
|
|
14
14
|
import { useFlow as r } from "../../Flow/useFlow.js";
|
|
15
|
-
import { useComponentContext as
|
|
16
|
-
import { BaseComponent as
|
|
15
|
+
import { useComponentContext as c } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
16
|
+
import { BaseComponent as E, BaseLayout as f } from "../../Base/Base.js";
|
|
17
17
|
import "../../Base/useBase.js";
|
|
18
18
|
import { ensureRequired as n } from "../../../helpers/ensureRequired.js";
|
|
19
|
-
import { useI18n as
|
|
20
|
-
import { componentEvents as
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
import { useI18n as p } from "../../../i18n/I18n.js";
|
|
20
|
+
import { componentEvents as a } from "../../../shared/constants.js";
|
|
21
|
+
import { EditCompensation as P } from "../Compensation/management/EditCompensation/EditCompensation.js";
|
|
22
|
+
function X() {
|
|
23
|
+
p("Employee.Dashboard");
|
|
24
|
+
const { t: e } = u("Employee.Dashboard"), { employeeId: o, onEvent: d, successAlert: l, selectedTab: s } = r(), m = c(), i = {
|
|
24
25
|
bankAccountAdded: e("alerts.bankAccountAdded"),
|
|
25
26
|
bankAccountDeleted: e("alerts.bankAccountDeleted"),
|
|
26
27
|
splitUpdated: e("alerts.splitUpdated"),
|
|
@@ -28,36 +29,35 @@ function K() {
|
|
|
28
29
|
deductionUpdated: e("alerts.deductionUpdated"),
|
|
29
30
|
deductionDeleted: e("alerts.deductionDeleted")
|
|
30
31
|
};
|
|
31
|
-
return /* @__PURE__ */ y
|
|
32
|
+
return /* @__PURE__ */ I(y, { children: [
|
|
32
33
|
l && /* @__PURE__ */ t(
|
|
33
|
-
|
|
34
|
+
m.Alert,
|
|
34
35
|
{
|
|
35
36
|
status: "success",
|
|
36
|
-
label:
|
|
37
|
+
label: i[l],
|
|
37
38
|
onDismiss: () => {
|
|
38
|
-
d(
|
|
39
|
+
d(a.EMPLOYEE_DISMISS, null);
|
|
39
40
|
},
|
|
40
41
|
disableScrollIntoView: !0
|
|
41
42
|
}
|
|
42
43
|
),
|
|
43
|
-
/* @__PURE__ */ t(
|
|
44
|
+
/* @__PURE__ */ t(
|
|
45
|
+
C,
|
|
46
|
+
{
|
|
47
|
+
employeeId: n(o),
|
|
48
|
+
onEvent: d,
|
|
49
|
+
selectedTab: s
|
|
50
|
+
}
|
|
51
|
+
)
|
|
44
52
|
] });
|
|
45
53
|
}
|
|
46
|
-
function Q() {
|
|
47
|
-
const { employeeId: e, onEvent: o } = r();
|
|
48
|
-
return /* @__PURE__ */ t(C, { employeeId: n(e), onEvent: o });
|
|
49
|
-
}
|
|
50
|
-
function X() {
|
|
51
|
-
const { employeeId: e, onEvent: o } = r();
|
|
52
|
-
return /* @__PURE__ */ t(h, { employeeId: n(e), onEvent: o });
|
|
53
|
-
}
|
|
54
54
|
function Z() {
|
|
55
55
|
const { employeeId: e, onEvent: o } = r();
|
|
56
|
-
return /* @__PURE__ */ t(
|
|
56
|
+
return /* @__PURE__ */ t(D, { employeeId: n(e), onEvent: o });
|
|
57
57
|
}
|
|
58
58
|
function $() {
|
|
59
59
|
const { employeeId: e, onEvent: o } = r();
|
|
60
|
-
return /* @__PURE__ */ t(
|
|
60
|
+
return /* @__PURE__ */ t(b, { employeeId: n(e), onEvent: o });
|
|
61
61
|
}
|
|
62
62
|
function ee() {
|
|
63
63
|
const { employeeId: e, onEvent: o } = r();
|
|
@@ -65,13 +65,21 @@ function ee() {
|
|
|
65
65
|
}
|
|
66
66
|
function oe() {
|
|
67
67
|
const { employeeId: e, onEvent: o } = r();
|
|
68
|
-
return /* @__PURE__ */ t(
|
|
68
|
+
return /* @__PURE__ */ t(x, { employeeId: n(e), onEvent: o });
|
|
69
69
|
}
|
|
70
70
|
function te() {
|
|
71
71
|
const { employeeId: e, onEvent: o } = r();
|
|
72
|
-
return /* @__PURE__ */ t(
|
|
72
|
+
return /* @__PURE__ */ t(h, { employeeId: n(e), onEvent: o });
|
|
73
73
|
}
|
|
74
74
|
function ne() {
|
|
75
|
+
const { employeeId: e, onEvent: o } = r();
|
|
76
|
+
return /* @__PURE__ */ t(E, { onEvent: o, children: /* @__PURE__ */ t(v, { employeeId: n(e), onEvent: o }) });
|
|
77
|
+
}
|
|
78
|
+
function re() {
|
|
79
|
+
const { employeeId: e, onEvent: o } = r();
|
|
80
|
+
return /* @__PURE__ */ t(E, { onEvent: o, children: /* @__PURE__ */ t(T, { employeeId: n(e), onEvent: o }) });
|
|
81
|
+
}
|
|
82
|
+
function de() {
|
|
75
83
|
const { employeeId: e, formId: o, onEvent: d } = r();
|
|
76
84
|
return /* @__PURE__ */ t(
|
|
77
85
|
g,
|
|
@@ -82,56 +90,65 @@ function ne() {
|
|
|
82
90
|
}
|
|
83
91
|
);
|
|
84
92
|
}
|
|
85
|
-
function
|
|
86
|
-
const { employeeId: e, editingDeductionId: o, onEvent: d } = r(), l =
|
|
93
|
+
function le() {
|
|
94
|
+
const { employeeId: e, editingDeductionId: o, onEvent: d } = r(), l = L({ employeeId: n(e) });
|
|
87
95
|
if (l.isLoading)
|
|
88
|
-
return /* @__PURE__ */ t(
|
|
89
|
-
const
|
|
90
|
-
return /* @__PURE__ */ t(
|
|
96
|
+
return /* @__PURE__ */ t(f, { isLoading: !0, error: l.errorHandling.errors });
|
|
97
|
+
const s = o ? l.data.deductions.find((m) => m.uuid === o) ?? null : null;
|
|
98
|
+
return /* @__PURE__ */ t(f, { error: l.errorHandling.errors, children: /* @__PURE__ */ t(
|
|
91
99
|
F,
|
|
92
100
|
{
|
|
93
101
|
employeeId: n(e),
|
|
94
|
-
deduction:
|
|
95
|
-
onSaved: (
|
|
102
|
+
deduction: s,
|
|
103
|
+
onSaved: (m, i) => {
|
|
96
104
|
d(
|
|
97
|
-
|
|
98
|
-
|
|
105
|
+
i === "create" ? a.EMPLOYEE_DEDUCTION_CREATED : a.EMPLOYEE_DEDUCTION_UPDATED,
|
|
106
|
+
m
|
|
99
107
|
);
|
|
100
108
|
},
|
|
101
109
|
onCancel: () => {
|
|
102
|
-
d(
|
|
110
|
+
d(a.CANCEL);
|
|
103
111
|
}
|
|
104
112
|
}
|
|
105
113
|
) });
|
|
106
114
|
}
|
|
107
|
-
function
|
|
108
|
-
|
|
109
|
-
const { t: e } =
|
|
115
|
+
function me() {
|
|
116
|
+
p("Employee.Dashboard");
|
|
117
|
+
const { t: e } = u("Employee.Dashboard"), o = c();
|
|
110
118
|
return /* @__PURE__ */ t(o.Heading, { as: "h2", children: e("compensationFlow.addJobTitle") });
|
|
111
119
|
}
|
|
112
|
-
function le() {
|
|
113
|
-
c("Employee.Dashboard");
|
|
114
|
-
const { t: e } = m("Employee.Dashboard"), o = i();
|
|
115
|
-
return /* @__PURE__ */ t(o.Heading, { as: "h2", children: e("compensationFlow.editTitle") });
|
|
116
|
-
}
|
|
117
120
|
function ae() {
|
|
118
|
-
|
|
119
|
-
|
|
121
|
+
const { employeeId: e, currentJob: o, onEvent: d } = r();
|
|
122
|
+
return /* @__PURE__ */ t(
|
|
123
|
+
P,
|
|
124
|
+
{
|
|
125
|
+
employeeId: n(e),
|
|
126
|
+
jobId: n(o?.uuid),
|
|
127
|
+
onEvent: d,
|
|
128
|
+
onCancel: () => {
|
|
129
|
+
d(a.CANCEL, null);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
function se() {
|
|
135
|
+
p("Employee.Dashboard");
|
|
136
|
+
const { t: e } = u("Employee.Dashboard"), o = c();
|
|
120
137
|
return /* @__PURE__ */ t(o.Heading, { as: "h2", children: e("compensationFlow.addAnotherJobTitle") });
|
|
121
138
|
}
|
|
122
139
|
export {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
140
|
+
se as AddAnotherJobPlaceholderContextual,
|
|
141
|
+
me as AddJobPlaceholderContextual,
|
|
142
|
+
X as DashboardViewContextual,
|
|
143
|
+
le as DeductionFormContextual,
|
|
144
|
+
de as DocumentManagerContextual,
|
|
145
|
+
ae as EditCompensationContextual,
|
|
146
|
+
ee as FederalTaxesContextual,
|
|
147
|
+
Z as HomeAddressContextual,
|
|
148
|
+
ne as PaymentBankFormContextual,
|
|
149
|
+
re as PaymentSplitViewContextual,
|
|
150
|
+
te as ProfileContextual,
|
|
151
|
+
oe as StateTaxesContextual,
|
|
152
|
+
$ as WorkAddressContextual
|
|
136
153
|
};
|
|
137
154
|
//# sourceMappingURL=DashboardComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardComponents.js","sources":["../../../../src/components/Employee/Dashboard/DashboardComponents.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Job } from '@gusto/embedded-api/models/components/job'\nimport { Dashboard } from './Dashboard'\nimport { HomeAddress } from '@/components/Employee/HomeAddress/management/HomeAddress'\nimport { WorkAddress } from '@/components/Employee/WorkAddress/management/WorkAddress'\nimport { FederalTaxes } from '@/components/Employee/FederalTaxes/management/FederalTaxes'\nimport { StateTaxes } from '@/components/Employee/StateTaxes/management/StateTaxes'\nimport { Profile } from '@/components/Employee/Profile/management/Profile'\nimport { BankForm } from '@/components/Employee/PaymentMethod/onboarding/BankForm'\nimport { SplitView } from '@/components/Employee/PaymentMethod/onboarding/SplitView'\nimport { DocumentManager } from '@/components/Employee/Documents/management/DocumentManager'\nimport { DeductionsForm } from '@/components/Employee/Deductions/DeductionsForm/DeductionsForm'\nimport { useDeductionsList } from '@/components/Employee/Deductions/shared'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { BaseComponent, BaseLayout } from '@/components/Base'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\nexport type DashboardSuccessAlert =\n | 'bankAccountAdded'\n | 'bankAccountDeleted'\n | 'splitUpdated'\n | 'deductionAdded'\n | 'deductionUpdated'\n | 'deductionDeleted'\n\nexport interface DashboardContextInterface extends FlowContextInterface {\n employeeId: string\n formId?: string\n currentJob?: Job | null\n successAlert?: DashboardSuccessAlert | null\n /** Set by the EMPLOYEE_DEDUCTION_EDIT transition; consumed by\n * DeductionFormContextual to pre-populate the form. */\n editingDeductionId?: string\n}\n\nexport function DashboardViewContextual() {\n useI18n('Employee.Dashboard')\n const { t } = useTranslation('Employee.Dashboard')\n const { employeeId, onEvent, successAlert } = useFlow<DashboardContextInterface>()\n const Components = useComponentContext()\n\n const alertLabels: Record<DashboardSuccessAlert, string> = {\n bankAccountAdded: t('alerts.bankAccountAdded'),\n bankAccountDeleted: t('alerts.bankAccountDeleted'),\n splitUpdated: t('alerts.splitUpdated'),\n deductionAdded: t('alerts.deductionAdded'),\n deductionUpdated: t('alerts.deductionUpdated'),\n deductionDeleted: t('alerts.deductionDeleted'),\n }\n\n return (\n <>\n {successAlert && (\n <Components.Alert\n status=\"success\"\n label={alertLabels[successAlert]}\n onDismiss={() => {\n onEvent(componentEvents.EMPLOYEE_DISMISS, null)\n }}\n disableScrollIntoView\n />\n )}\n <Dashboard employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n </>\n )\n}\n\nexport function HomeAddressContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return <HomeAddress employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\nexport function WorkAddressContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return <WorkAddress employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\nexport function FederalTaxesContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return <FederalTaxes employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\nexport function StateTaxesContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return <StateTaxes employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\nexport function ProfileContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return <Profile employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\nexport function PaymentBankFormContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return (\n <BaseComponent onEvent={onEvent}>\n <BankForm employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n </BaseComponent>\n )\n}\n\nexport function PaymentSplitViewContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return (\n <BaseComponent onEvent={onEvent}>\n <SplitView employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n </BaseComponent>\n )\n}\n\nexport function DocumentManagerContextual() {\n const { employeeId, formId, onEvent } = useFlow<DashboardContextInterface>()\n return (\n <DocumentManager\n employeeId={ensureRequired(employeeId)}\n formId={ensureRequired(formId)}\n onEvent={onEvent}\n />\n )\n}\n\nexport function DeductionFormContextual() {\n const { employeeId, editingDeductionId, onEvent } = useFlow<DashboardContextInterface>()\n // The same list query the form hooks use internally — React Query dedupes,\n // so this just looks up the loaded row to pre-populate edit mode.\n const list = useDeductionsList({ employeeId: ensureRequired(employeeId) })\n\n if (list.isLoading) {\n return <BaseLayout isLoading error={list.errorHandling.errors} />\n }\n\n const deduction = editingDeductionId\n ? (list.data.deductions.find(d => d.uuid === editingDeductionId) ?? null)\n : null\n\n return (\n <BaseLayout error={list.errorHandling.errors}>\n <DeductionsForm\n employeeId={ensureRequired(employeeId)}\n deduction={deduction}\n onSaved={(saved, mode) => {\n onEvent(\n mode === 'create'\n ? componentEvents.EMPLOYEE_DEDUCTION_CREATED\n : componentEvents.EMPLOYEE_DEDUCTION_UPDATED,\n saved,\n )\n }}\n onCancel={() => {\n onEvent(componentEvents.CANCEL)\n }}\n />\n </BaseLayout>\n )\n}\n\nexport function AddJobPlaceholderContextual() {\n useI18n('Employee.Dashboard')\n const { t } = useTranslation('Employee.Dashboard')\n const Components = useComponentContext()\n return <Components.Heading as=\"h2\">{t('compensationFlow.addJobTitle')}</Components.Heading>\n}\n\nexport function EditCompensationPlaceholderContextual() {\n useI18n('Employee.Dashboard')\n const { t } = useTranslation('Employee.Dashboard')\n const Components = useComponentContext()\n return <Components.Heading as=\"h2\">{t('compensationFlow.editTitle')}</Components.Heading>\n}\n\nexport function AddAnotherJobPlaceholderContextual() {\n useI18n('Employee.Dashboard')\n const { t } = useTranslation('Employee.Dashboard')\n const Components = useComponentContext()\n return <Components.Heading as=\"h2\">{t('compensationFlow.addAnotherJobTitle')}</Components.Heading>\n}\n"],"names":["DashboardViewContextual","useI18n","t","useTranslation","employeeId","onEvent","successAlert","useFlow","Components","useComponentContext","alertLabels","jsxs","Fragment","jsx","componentEvents","Dashboard","ensureRequired","HomeAddressContextual","HomeAddress","WorkAddressContextual","WorkAddress","FederalTaxesContextual","FederalTaxes","StateTaxesContextual","StateTaxes","ProfileContextual","Profile","PaymentBankFormContextual","BaseComponent","BankForm","PaymentSplitViewContextual","SplitView","DocumentManagerContextual","formId","DocumentManager","DeductionFormContextual","editingDeductionId","list","useDeductionsList","BaseLayout","deduction","d","DeductionsForm","saved","mode","AddJobPlaceholderContextual","EditCompensationPlaceholderContextual","AddAnotherJobPlaceholderContextual"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsCO,SAASA,IAA0B;AACxC,EAAAC,EAAQ,oBAAoB;AAC5B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB,GAC3C,EAAE,YAAAC,GAAY,SAAAC,GAAS,cAAAC,EAAA,IAAiBC,EAAA,GACxCC,IAAaC,EAAA,GAEbC,IAAqD;AAAA,IACzD,kBAAkBR,EAAE,yBAAyB;AAAA,IAC7C,oBAAoBA,EAAE,2BAA2B;AAAA,IACjD,cAAcA,EAAE,qBAAqB;AAAA,IACrC,gBAAgBA,EAAE,uBAAuB;AAAA,IACzC,kBAAkBA,EAAE,yBAAyB;AAAA,IAC7C,kBAAkBA,EAAE,yBAAyB;AAAA,EAAA;AAG/C,SACE,gBAAAS,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAN,KACC,gBAAAO;AAAA,MAACL,EAAW;AAAA,MAAX;AAAA,QACC,QAAO;AAAA,QACP,OAAOE,EAAYJ,CAAY;AAAA,QAC/B,WAAW,MAAM;AACf,UAAAD,EAAQS,EAAgB,kBAAkB,IAAI;AAAA,QAChD;A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AE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB,GAC3CK,IAAaC,EAAA;AACnB,SAAO,gBAAAI,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAN,EAAE,8BAA8B,GAAE;AACxE;AAEO,SAAS4C,KAAwC;AACtD,EAAA7C,EAAQ,oBAAoB;AAC5B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB,GAC3CK,IAAaC,EAAA;AACnB,SAAO,gBAAAI,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAN,EAAE,4BAA4B,GAAE;AACtE;AAEO,SAAS6C,KAAqC;AACnD,EAAA9C,EAAQ,oBAAoB;AAC5B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB,GAC3CK,IAAaC,EAAA;AACnB,SAAO,gBAAAI,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAN,EAAE,qCAAqC,GAAE;AAC/E;"}
|
|
1
|
+
{"version":3,"file":"DashboardComponents.js","sources":["../../../../src/components/Employee/Dashboard/DashboardComponents.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Job } from '@gusto/embedded-api/models/components/job'\nimport { Dashboard, type DashboardTab } from './Dashboard'\nimport { HomeAddress } from '@/components/Employee/HomeAddress/management/HomeAddress'\nimport { WorkAddress } from '@/components/Employee/WorkAddress/management/WorkAddress'\nimport { FederalTaxes } from '@/components/Employee/FederalTaxes/management/FederalTaxes'\nimport { StateTaxes } from '@/components/Employee/StateTaxes/management/StateTaxes'\nimport { Profile } from '@/components/Employee/Profile/management/Profile'\nimport { BankForm } from '@/components/Employee/PaymentMethod/onboarding/BankForm'\nimport { SplitView } from '@/components/Employee/PaymentMethod/onboarding/SplitView'\nimport { DocumentManager } from '@/components/Employee/Documents/management/DocumentManager'\nimport { DeductionsForm } from '@/components/Employee/Deductions/DeductionsForm/DeductionsForm'\nimport { ManagementEditCompensation } from '@/components/Employee/Compensation/management'\nimport { useDeductionsList } from '@/components/Employee/Deductions/shared'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { BaseComponent, BaseLayout } from '@/components/Base'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\nexport type DashboardSuccessAlert =\n | 'bankAccountAdded'\n | 'bankAccountDeleted'\n | 'splitUpdated'\n | 'deductionAdded'\n | 'deductionUpdated'\n | 'deductionDeleted'\n\nexport interface DashboardContextInterface extends FlowContextInterface {\n employeeId: string\n formId?: string\n currentJob?: Job | null\n successAlert?: DashboardSuccessAlert | null\n /** Set by the EMPLOYEE_DEDUCTION_EDIT transition; consumed by\n * DeductionFormContextual to pre-populate the form. */\n editingDeductionId?: string\n /** Persists the active Dashboard tab across sub-flows so Cancel/Back\n * returns to the originating tab instead of resetting to basic details. */\n selectedTab?: DashboardTab\n}\n\nexport function DashboardViewContextual() {\n useI18n('Employee.Dashboard')\n const { t } = useTranslation('Employee.Dashboard')\n const { employeeId, onEvent, successAlert, selectedTab } = useFlow<DashboardContextInterface>()\n const Components = useComponentContext()\n\n const alertLabels: Record<DashboardSuccessAlert, string> = {\n bankAccountAdded: t('alerts.bankAccountAdded'),\n bankAccountDeleted: t('alerts.bankAccountDeleted'),\n splitUpdated: t('alerts.splitUpdated'),\n deductionAdded: t('alerts.deductionAdded'),\n deductionUpdated: t('alerts.deductionUpdated'),\n deductionDeleted: t('alerts.deductionDeleted'),\n }\n\n return (\n <>\n {successAlert && (\n <Components.Alert\n status=\"success\"\n label={alertLabels[successAlert]}\n onDismiss={() => {\n onEvent(componentEvents.EMPLOYEE_DISMISS, null)\n }}\n disableScrollIntoView\n />\n )}\n <Dashboard\n employeeId={ensureRequired(employeeId)}\n onEvent={onEvent}\n selectedTab={selectedTab}\n />\n </>\n )\n}\n\nexport function HomeAddressContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return <HomeAddress employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\nexport function WorkAddressContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return <WorkAddress employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\nexport function FederalTaxesContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return <FederalTaxes employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\nexport function StateTaxesContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return <StateTaxes employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\nexport function ProfileContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return <Profile employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\nexport function PaymentBankFormContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return (\n <BaseComponent onEvent={onEvent}>\n <BankForm employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n </BaseComponent>\n )\n}\n\nexport function PaymentSplitViewContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return (\n <BaseComponent onEvent={onEvent}>\n <SplitView employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n </BaseComponent>\n )\n}\n\nexport function DocumentManagerContextual() {\n const { employeeId, formId, onEvent } = useFlow<DashboardContextInterface>()\n return (\n <DocumentManager\n employeeId={ensureRequired(employeeId)}\n formId={ensureRequired(formId)}\n onEvent={onEvent}\n />\n )\n}\n\nexport function DeductionFormContextual() {\n const { employeeId, editingDeductionId, onEvent } = useFlow<DashboardContextInterface>()\n // The same list query the form hooks use internally — React Query dedupes,\n // so this just looks up the loaded row to pre-populate edit mode.\n const list = useDeductionsList({ employeeId: ensureRequired(employeeId) })\n\n if (list.isLoading) {\n return <BaseLayout isLoading error={list.errorHandling.errors} />\n }\n\n const deduction = editingDeductionId\n ? (list.data.deductions.find(d => d.uuid === editingDeductionId) ?? null)\n : null\n\n return (\n <BaseLayout error={list.errorHandling.errors}>\n <DeductionsForm\n employeeId={ensureRequired(employeeId)}\n deduction={deduction}\n onSaved={(saved, mode) => {\n onEvent(\n mode === 'create'\n ? componentEvents.EMPLOYEE_DEDUCTION_CREATED\n : componentEvents.EMPLOYEE_DEDUCTION_UPDATED,\n saved,\n )\n }}\n onCancel={() => {\n onEvent(componentEvents.CANCEL)\n }}\n />\n </BaseLayout>\n )\n}\n\nexport function AddJobPlaceholderContextual() {\n useI18n('Employee.Dashboard')\n const { t } = useTranslation('Employee.Dashboard')\n const Components = useComponentContext()\n return <Components.Heading as=\"h2\">{t('compensationFlow.addJobTitle')}</Components.Heading>\n}\n\nexport function EditCompensationContextual() {\n const { employeeId, currentJob, onEvent } = useFlow<DashboardContextInterface>()\n return (\n <ManagementEditCompensation\n employeeId={ensureRequired(employeeId)}\n jobId={ensureRequired(currentJob?.uuid)}\n onEvent={onEvent}\n onCancel={() => {\n onEvent(componentEvents.CANCEL, null)\n }}\n />\n )\n}\n\nexport function AddAnotherJobPlaceholderContextual() {\n useI18n('Employee.Dashboard')\n const { t } = useTranslation('Employee.Dashboard')\n const Components = useComponentContext()\n return <Components.Heading as=\"h2\">{t('compensationFlow.addAnotherJobTitle')}</Components.Heading>\n}\n"],"names":["DashboardViewContextual","useI18n","t","useTranslation","employeeId","onEvent","successAlert","selectedTab","useFlow","Components","useComponentContext","alertLabels","jsxs","Fragment","jsx","componentEvents","Dashboard","ensureRequired","HomeAddressContextual","HomeAddress","WorkAddressContextual","WorkAddress","FederalTaxesContextual","FederalTaxes","StateTaxesContextual","StateTaxes","ProfileContextual","Profile","PaymentBankFormContextual","BaseComponent","BankForm","PaymentSplitViewContextual","SplitView","DocumentManagerContextual","formId","DocumentManager","DeductionFormContextual","editingDeductionId","list","useDeductionsList","BaseLayout","deduction","d","DeductionsForm","saved","mode","AddJobPlaceholderContextual","EditCompensationContextual","currentJob","ManagementEditCompensation","AddAnotherJobPlaceholderContextual"],"mappings":";;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AA;AAGN;AAEO,SAASmC,KAAqC;AACnD,EAAAjD,EAAQ,oBAAoB;AAC5B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB,GAC3CM,IAAaC,EAAA;AACnB,SAAO,gBAAAI,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAP,EAAE,qCAAqC,GAAE;AAC/E;"}
|
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as
|
|
2
|
+
import { useTranslation as c } from "react-i18next";
|
|
3
3
|
import { Flex as m } from "../../Common/Flex/Flex.js";
|
|
4
|
-
import { useComponentContext as
|
|
4
|
+
import { useComponentContext as d } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
5
5
|
import "classnames";
|
|
6
6
|
import "../../../shared/constants.js";
|
|
7
|
-
import { Loading as
|
|
8
|
-
import { EmptyData as
|
|
9
|
-
import { BaseLayout as
|
|
7
|
+
import { Loading as l } from "../../Common/Loading/Loading.js";
|
|
8
|
+
import { EmptyData as f } from "../../Common/EmptyData/EmptyData.js";
|
|
9
|
+
import { BaseLayout as p } from "../../Base/Base.js";
|
|
10
10
|
import { useEmployeeForms as g } from "./hooks/useEmployeeForms.js";
|
|
11
11
|
import { useDataView as y } from "../../Common/DataView/useDataView.js";
|
|
12
12
|
import { DataView as h } from "../../Common/DataView/DataView.js";
|
|
13
13
|
function v({ employeeId: i, onViewForm: s }) {
|
|
14
14
|
const n = g({ employeeId: i });
|
|
15
|
-
return
|
|
15
|
+
return /* @__PURE__ */ e(p, { error: n.errorHandling.errors, children: /* @__PURE__ */ e(
|
|
16
|
+
D,
|
|
17
|
+
{
|
|
18
|
+
forms: n.data.formList,
|
|
19
|
+
isLoading: n.status.isFormsLoading,
|
|
20
|
+
onViewForm: s
|
|
21
|
+
}
|
|
22
|
+
) });
|
|
16
23
|
}
|
|
17
24
|
function D({ forms: i = [], isLoading: s = !1, onViewForm: n }) {
|
|
18
|
-
const { t } =
|
|
25
|
+
const { t } = c("Employee.Dashboard"), o = d(), a = [
|
|
19
26
|
{
|
|
20
27
|
key: "title",
|
|
21
28
|
title: t("documents.columns.title"),
|
|
@@ -36,19 +43,19 @@ function D({ forms: i = [], isLoading: s = !1, onViewForm: n }) {
|
|
|
36
43
|
title: t("documents.columns.requiresSigning"),
|
|
37
44
|
render: (r) => r.requiresSigning ? /* @__PURE__ */ e(o.Badge, { status: "warning", children: t("documents.signingStatus.notSigned") }) : /* @__PURE__ */ e(o.Badge, { status: "success", children: t("documents.signingStatus.signed") })
|
|
38
45
|
}
|
|
39
|
-
],
|
|
46
|
+
], u = y({
|
|
40
47
|
data: i,
|
|
41
|
-
columns:
|
|
48
|
+
columns: a,
|
|
42
49
|
itemMenu: (r) => /* @__PURE__ */ e(o.Button, { variant: "secondary", onClick: () => n?.(r.uuid), children: t("documents.viewCta") }),
|
|
43
50
|
emptyState: () => /* @__PURE__ */ e(
|
|
44
|
-
|
|
51
|
+
f,
|
|
45
52
|
{
|
|
46
53
|
title: t("documents.emptyState.title"),
|
|
47
54
|
description: t("documents.emptyState.description")
|
|
48
55
|
}
|
|
49
56
|
)
|
|
50
57
|
});
|
|
51
|
-
return
|
|
58
|
+
return /* @__PURE__ */ e(m, { flexDirection: "column", gap: 24, children: /* @__PURE__ */ e(o.Box, { header: /* @__PURE__ */ e(o.BoxHeader, { title: t("documents.title") }), children: /* @__PURE__ */ e(m, { flexDirection: "column", gap: 16, children: s ? /* @__PURE__ */ e(l, {}) : /* @__PURE__ */ e(h, { label: t("documents.listLabel"), ...u }) }) }) });
|
|
52
59
|
}
|
|
53
60
|
export {
|
|
54
61
|
D as DocumentsView,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentsView.js","sources":["../../../../src/components/Employee/Dashboard/DocumentsView.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Form } from '@gusto/embedded-api/models/components/form'\nimport { useEmployeeForms } from './hooks'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { DataView, useDataView, EmptyData, Loading } from '@/components/Common'\nimport { BaseLayout } from '@/components/Base/Base'\n\nexport interface DocumentsViewProps {\n forms?: Form[]\n isLoading?: boolean\n onViewForm?: (formUuid: string) => void\n}\n\nexport interface DocumentsViewWithDataProps {\n employeeId: string\n onViewForm?: (formUuid: string) => void\n}\n\n/**\n * Tab-mounted container for the Documents tab. Owns the\n * `useEmployeeForms` fetch so the request only fires when the user\n * actually opens this tab (or whatever the parent chooses to mount).\n * The presentational `DocumentsView` stays pure for testing/stories.\n */\nexport function DocumentsViewWithData({ employeeId, onViewForm }: DocumentsViewWithDataProps) {\n const forms = useEmployeeForms({ employeeId })\n\n
|
|
1
|
+
{"version":3,"file":"DocumentsView.js","sources":["../../../../src/components/Employee/Dashboard/DocumentsView.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Form } from '@gusto/embedded-api/models/components/form'\nimport { useEmployeeForms } from './hooks'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { DataView, useDataView, EmptyData, Loading } from '@/components/Common'\nimport { BaseLayout } from '@/components/Base/Base'\n\nexport interface DocumentsViewProps {\n forms?: Form[]\n isLoading?: boolean\n onViewForm?: (formUuid: string) => void\n}\n\nexport interface DocumentsViewWithDataProps {\n employeeId: string\n onViewForm?: (formUuid: string) => void\n}\n\n/**\n * Tab-mounted container for the Documents tab. Owns the\n * `useEmployeeForms` fetch so the request only fires when the user\n * actually opens this tab (or whatever the parent chooses to mount).\n * The presentational `DocumentsView` stays pure for testing/stories.\n */\nexport function DocumentsViewWithData({ employeeId, onViewForm }: DocumentsViewWithDataProps) {\n const forms = useEmployeeForms({ employeeId })\n\n return (\n <BaseLayout error={forms.errorHandling.errors}>\n <DocumentsView\n forms={forms.data.formList}\n isLoading={forms.status.isFormsLoading}\n onViewForm={onViewForm}\n />\n </BaseLayout>\n )\n}\n\nexport function DocumentsView({ forms = [], isLoading = false, onViewForm }: DocumentsViewProps) {\n const { t } = useTranslation('Employee.Dashboard')\n const Components = useComponentContext()\n\n const formsColumns = [\n {\n key: 'title',\n title: t('documents.columns.title'),\n render: (form: Form) => form.title || '-',\n },\n {\n key: 'year',\n title: t('documents.columns.year'),\n render: (form: Form) => {\n if (form.year) return String(form.year)\n return '-'\n },\n },\n {\n key: 'status',\n title: t('documents.columns.status'),\n render: (form: Form) => {\n if (form.draft) return t('documents.status.draft')\n return t('documents.status.final')\n },\n },\n {\n key: 'requiresSigning',\n title: t('documents.columns.requiresSigning'),\n render: (form: Form) => {\n if (form.requiresSigning) {\n return (\n <Components.Badge status=\"warning\">\n {t('documents.signingStatus.notSigned')}\n </Components.Badge>\n )\n }\n return (\n <Components.Badge status=\"success\">\n {t('documents.signingStatus.signed')}\n </Components.Badge>\n )\n },\n },\n ]\n\n const formsDataView = useDataView({\n data: forms,\n columns: formsColumns,\n itemMenu: (form: Form) => (\n <Components.Button variant=\"secondary\" onClick={() => onViewForm?.(form.uuid)}>\n {t('documents.viewCta')}\n </Components.Button>\n ),\n emptyState: () => (\n <EmptyData\n title={t('documents.emptyState.title')}\n description={t('documents.emptyState.description')}\n />\n ),\n })\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <Components.Box header={<Components.BoxHeader title={t('documents.title')} />}>\n <Flex flexDirection=\"column\" gap={16}>\n {isLoading ? (\n <Loading />\n ) : (\n <DataView label={t('documents.listLabel')} {...formsDataView} />\n )}\n </Flex>\n </Components.Box>\n </Flex>\n )\n}\n"],"names":["DocumentsViewWithData","employeeId","onViewForm","forms","useEmployeeForms","jsx","BaseLayout","DocumentsView","isLoading","useTranslation","Components","useComponentContext","formsColumns","form","formsDataView","useDataView","EmptyData","Flex","Loading","DataView"],"mappings":";;;;;;;;;;;;AAyBO,SAASA,EAAsB,EAAE,YAAAC,GAAY,YAAAC,KAA0C;AA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