@gusto/embedded-react-sdk 0.46.0 → 0.46.2
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 +50 -0
- package/dist/components/Common/DataView/DataCards/DataCards.d.ts +2 -1
- package/dist/components/Common/DataView/DataCards/DataCards.js +14 -13
- package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
- package/dist/components/Common/DataView/DataTable/DataTable.d.ts +2 -1
- package/dist/components/Common/DataView/DataTable/DataTable.js +51 -50
- package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
- package/dist/components/Common/DataView/DataView.d.ts +1 -0
- package/dist/components/Common/DataView/DataView.js.map +1 -1
- package/dist/components/Common/DataView/useDataView.d.ts +8 -1
- package/dist/components/Common/DataView/useDataView.js +20 -17
- package/dist/components/Common/DataView/useDataView.js.map +1 -1
- package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.d.ts +9 -0
- package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.js +76 -0
- package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.js.map +1 -0
- package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.module.scss.js +8 -0
- package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.module.scss.js.map +1 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js +57 -202
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js.map +1 -1
- package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.d.ts +25 -0
- package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.js +81 -0
- package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.js.map +1 -0
- package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.module.scss.js +8 -0
- package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.module.scss.js.map +1 -0
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.d.ts +18 -0
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js +171 -0
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js.map +1 -0
- package/dist/components/Employee/Compensation/management/index.d.ts +3 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.d.ts +6 -1
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js +67 -209
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.d.ts +18 -0
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js +169 -0
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js.map +1 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +16 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js +36 -30
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.d.ts +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js +213 -191
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
- package/dist/components/Employee/Dashboard/Dashboard.js +65 -53
- package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +3 -3
- package/dist/components/Employee/Dashboard/DashboardComponents.js +138 -101
- package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -1
- package/dist/components/Employee/Dashboard/JobAndPayView.js +340 -320
- package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -1
- package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js +5 -3
- package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js.map +1 -1
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js +147 -148
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.d.ts +6 -0
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js +13 -12
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +2 -2
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +34 -35
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -1
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js +37 -40
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.d.ts +1 -2
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js +64 -71
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js.map +1 -1
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.d.ts +2 -0
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js +25 -0
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js.map +1 -0
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.d.ts +13 -0
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js +37 -0
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js.map +1 -0
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.d.ts +6 -0
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js +69 -0
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js.map +1 -0
- package/dist/components/Employee/EmployeeListFlow/index.d.ts +3 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js +15 -12
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.d.ts +2 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js +86 -83
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js +14 -11
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.d.ts +2 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js +92 -89
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
- package/dist/components/Employee/exports/employeeManagement.d.ts +2 -0
- package/dist/components/Employee/exports/employeeManagement.js +18 -16
- package/dist/components/Employee/exports/employeeManagement.js.map +1 -1
- package/dist/components/Employee/index.d.ts +2 -0
- package/dist/components/Employee/index.js +32 -30
- package/dist/components/Employee/index.js.map +1 -1
- package/dist/components/Flow/FlowHeader.js +34 -31
- package/dist/components/Flow/FlowHeader.js.map +1 -1
- package/dist/components/Flow/useFlow.d.ts +12 -0
- package/dist/components/Flow/useFlow.js.map +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyList.js +92 -69
- package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js +23 -23
- package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +1 -1
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js +73 -56
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js +58 -58
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.d.ts +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +91 -87
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormTypes.d.ts +2 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js +91 -124
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.d.ts +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js +72 -87
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentationTypes.d.ts +1 -6
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js +160 -220
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.d.ts +7 -3
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js +77 -54
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.test.d.ts +1 -0
- package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js +12 -11
- package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js +177 -147
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js.map +1 -1
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.d.ts +1 -1
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js +38 -36
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js.map +1 -1
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTableTypes.d.ts +2 -0
- package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js +10 -10
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js +17 -15
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicyDetails.json.js +9 -9
- package/dist/i18n/en/Employee.Compensation.json.js +64 -56
- package/dist/i18n/en/Employee.Compensation.json.js.map +1 -1
- package/dist/i18n/en/Employee.Dashboard.json.js +26 -24
- package/dist/i18n/en/Employee.Dashboard.json.js.map +1 -1
- package/dist/i18n/en/Employee.HomeAddress.Management.json.js +12 -10
- package/dist/i18n/en/Employee.HomeAddress.Management.json.js.map +1 -1
- package/dist/i18n/en/Employee.ManagementEmployeeList.json.js +32 -30
- package/dist/i18n/en/Employee.ManagementEmployeeList.json.js.map +1 -1
- package/dist/i18n/en/Employee.WorkAddress.Management.json.js +16 -14
- package/dist/i18n/en/Employee.WorkAddress.Management.json.js.map +1 -1
- package/dist/i18n/en/common.json.d.ts +14 -0
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.js +33 -32
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.js.map +1 -1
- package/dist/partner-hook-utils/types.d.ts +4 -0
- package/dist/shared/constants.d.ts +2 -0
- package/dist/shared/constants.js +13 -12
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +26 -12
- package/docs/reference/endpoint-inventory.json +24 -8
- package/package.json +1 -1
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e, Fragment as V } from "react/jsx-runtime";
|
|
2
|
-
import { useState as I, useRef as
|
|
3
|
-
import { useTranslation as O, Trans as
|
|
4
|
-
import { useWatch as
|
|
5
|
-
import { getPendingFutureHomeAddress as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
2
|
+
import { useState as I, useRef as ke, useLayoutEffect as Te, useMemo as A } from "react";
|
|
3
|
+
import { useTranslation as O, Trans as L } from "react-i18next";
|
|
4
|
+
import { useWatch as Pe } from "react-hook-form";
|
|
5
|
+
import { getPendingFutureHomeAddress as Ie, formatPendingHomeAddressLine as z } from "./getPendingFutureHomeAddress.js";
|
|
6
|
+
import Ae from "../../../../assets/icons/house.svg.js";
|
|
7
|
+
import Le from "../../../../assets/icons/pencil.svg.js";
|
|
8
8
|
import we from "../../../../assets/icons/trashcan.svg.js";
|
|
9
9
|
import { HomeAddressErrorCodes as a } from "../../Profile/shared/useHomeAddressForm/homeAddressSchema.js";
|
|
10
10
|
import { SDKFormProvider as Z } from "../../../../partner-hook-utils/form/SDKFormProvider.js";
|
|
11
|
-
import { Flex as s, FlexItem as
|
|
11
|
+
import { Flex as s, FlexItem as Fe } from "../../../Common/Flex/Flex.js";
|
|
12
12
|
import { Grid as j } from "../../../Common/Grid/Grid.js";
|
|
13
|
-
import { EmptyData as
|
|
13
|
+
import { EmptyData as Ue } from "../../../Common/EmptyData/EmptyData.js";
|
|
14
|
+
import { ActionsLayout as We } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
14
15
|
import { useComponentContext as Y } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
15
|
-
import { formatDateLongWithYear as E, normalizeToDate as
|
|
16
|
+
import { formatDateLongWithYear as E, normalizeToDate as Be, addDays as He } from "../../../../helpers/dateFormatting.js";
|
|
16
17
|
import { formatStreetForDisplay as K, getCityStateZip as $ } from "../../../../helpers/formattedStrings.js";
|
|
17
|
-
import { HamburgerMenu as
|
|
18
|
-
import { useDataView as
|
|
19
|
-
import { DataView as
|
|
18
|
+
import { HamburgerMenu as Qe } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
19
|
+
import { useDataView as Ve } from "../../../Common/DataView/useDataView.js";
|
|
20
|
+
import { DataView as Oe } from "../../../Common/DataView/DataView.js";
|
|
20
21
|
function q({
|
|
21
22
|
CourtesyWithholding: u,
|
|
22
23
|
formHook: m,
|
|
23
24
|
tHa: c
|
|
24
25
|
}) {
|
|
25
|
-
const y = Y(), { control:
|
|
26
|
+
const y = Y(), { control: w } = m.form.hookFormInternals.formMethods, f = Pe({ control: w, name: "courtesyWithholding" });
|
|
26
27
|
return /* @__PURE__ */ r(V, { children: [
|
|
27
28
|
/* @__PURE__ */ e(
|
|
28
29
|
u,
|
|
@@ -31,7 +32,7 @@ function q({
|
|
|
31
32
|
description: /* @__PURE__ */ r(V, { children: [
|
|
32
33
|
c("courtesyWithholdingDescription"),
|
|
33
34
|
/* @__PURE__ */ e(
|
|
34
|
-
|
|
35
|
+
L,
|
|
35
36
|
{
|
|
36
37
|
t: c,
|
|
37
38
|
i18nKey: "learnMoreCta",
|
|
@@ -43,22 +44,23 @@ function q({
|
|
|
43
44
|
] })
|
|
44
45
|
}
|
|
45
46
|
),
|
|
46
|
-
f ? /* @__PURE__ */ e(y.Alert, { label: c("withholdingTitle"), status: "warning", children: /* @__PURE__ */ e(
|
|
47
|
+
f ? /* @__PURE__ */ e(y.Alert, { label: c("withholdingTitle"), status: "warning", children: /* @__PURE__ */ e(L, { t: c, i18nKey: "withholdingNote" }) }) : null
|
|
47
48
|
] });
|
|
48
49
|
}
|
|
49
|
-
function
|
|
50
|
+
function dt({
|
|
50
51
|
editHomeAddressForm: u,
|
|
51
52
|
createHomeAddressForm: m,
|
|
52
53
|
employeeHomeAddresses: c,
|
|
53
54
|
employeeDisplayName: y,
|
|
54
|
-
editingHomeAddressUuid:
|
|
55
|
+
editingHomeAddressUuid: w,
|
|
55
56
|
onEditAddressTargetChange: f,
|
|
56
57
|
onSaved: G,
|
|
57
58
|
onConfirmDelete: N,
|
|
58
|
-
|
|
59
|
+
onBack: _,
|
|
60
|
+
isDeletePending: J = !1
|
|
59
61
|
}) {
|
|
60
|
-
const { t } = O("Employee.HomeAddress.Management"), { t: o } = O("Employee.HomeAddress"), n = Y(), [l, C] = I(null), [h, S] = I(null), R =
|
|
61
|
-
|
|
62
|
+
const { t } = O("Employee.HomeAddress.Management"), { t: o } = O("Employee.HomeAddress"), n = Y(), [l, C] = I(null), [h, S] = I(null), R = ke(null), [k, F] = I(void 0);
|
|
63
|
+
Te(() => {
|
|
62
64
|
if (!l) {
|
|
63
65
|
F(void 0);
|
|
64
66
|
return;
|
|
@@ -76,59 +78,59 @@ function at({
|
|
|
76
78
|
const {
|
|
77
79
|
data: { homeAddress: g },
|
|
78
80
|
status: U,
|
|
79
|
-
actions: { onSubmit:
|
|
80
|
-
form:
|
|
81
|
+
actions: { onSubmit: X },
|
|
82
|
+
form: ee
|
|
81
83
|
} = u, p = c, {
|
|
82
84
|
status: W,
|
|
83
|
-
actions: { onSubmit:
|
|
84
|
-
form:
|
|
85
|
+
actions: { onSubmit: te },
|
|
86
|
+
form: ie
|
|
85
87
|
} = m, {
|
|
86
88
|
Fields: {
|
|
87
|
-
Street1:
|
|
88
|
-
Street2:
|
|
89
|
-
City:
|
|
90
|
-
State:
|
|
91
|
-
Zip:
|
|
92
|
-
CourtesyWithholding:
|
|
89
|
+
Street1: ne,
|
|
90
|
+
Street2: oe,
|
|
91
|
+
City: re,
|
|
92
|
+
State: ae,
|
|
93
|
+
Zip: se,
|
|
94
|
+
CourtesyWithholding: le
|
|
93
95
|
}
|
|
94
|
-
} =
|
|
96
|
+
} = ee, {
|
|
95
97
|
Fields: {
|
|
96
|
-
Street1:
|
|
97
|
-
Street2:
|
|
98
|
-
City:
|
|
99
|
-
State:
|
|
100
|
-
Zip:
|
|
101
|
-
CourtesyWithholding:
|
|
102
|
-
EffectiveDate:
|
|
98
|
+
Street1: de,
|
|
99
|
+
Street2: ce,
|
|
100
|
+
City: ue,
|
|
101
|
+
State: me,
|
|
102
|
+
Zip: fe,
|
|
103
|
+
CourtesyWithholding: he,
|
|
104
|
+
EffectiveDate: B
|
|
103
105
|
}
|
|
104
|
-
} =
|
|
106
|
+
} = ie, H = {
|
|
105
107
|
[a.REQUIRED]: o("validations.zip"),
|
|
106
108
|
[a.INVALID_ZIP]: o("validations.zip")
|
|
107
|
-
},
|
|
109
|
+
}, ge = {
|
|
108
110
|
[a.REQUIRED]: t("form.startDateRequired")
|
|
109
111
|
}, M = A(
|
|
110
|
-
() =>
|
|
112
|
+
() => Ie(p),
|
|
111
113
|
[p]
|
|
112
114
|
), Q = A(() => {
|
|
113
115
|
if (!(!h || !p))
|
|
114
116
|
return p.find((i) => i.uuid === h);
|
|
115
|
-
}, [h, p]),
|
|
117
|
+
}, [h, p]), pe = A(() => {
|
|
116
118
|
const i = y.trim();
|
|
117
119
|
return i ? `${i}'s` : t("changePendingPossessiveFallback");
|
|
118
120
|
}, [y, t]), b = [...p ?? []].sort((i, d) => {
|
|
119
121
|
const v = i.effectiveDate?.toString() ?? "", D = d.effectiveDate?.toString() ?? "";
|
|
120
122
|
return !v && !D ? 0 : v ? D ? v.localeCompare(D) : -1 : 1;
|
|
121
|
-
}),
|
|
122
|
-
const d = b.findIndex((
|
|
123
|
+
}), ve = [...b.filter((i) => i.active !== !0)].reverse(), De = (i) => {
|
|
124
|
+
const d = b.findIndex((Re) => Re.uuid === i.uuid);
|
|
123
125
|
if (d === -1 || d >= b.length - 1) return "—";
|
|
124
126
|
const v = b[d + 1]?.effectiveDate;
|
|
125
127
|
if (!v) return "—";
|
|
126
|
-
const D =
|
|
128
|
+
const D = Be(v.toString());
|
|
127
129
|
if (!D) return "—";
|
|
128
|
-
const P =
|
|
129
|
-
return E(`${
|
|
130
|
-
},
|
|
131
|
-
data:
|
|
130
|
+
const P = He(D, -1), be = P.getFullYear(), xe = String(P.getMonth() + 1).padStart(2, "0"), Ee = String(P.getDate()).padStart(2, "0");
|
|
131
|
+
return E(`${be}-${xe}-${Ee}`);
|
|
132
|
+
}, ye = Ve({
|
|
133
|
+
data: ve,
|
|
132
134
|
columns: [
|
|
133
135
|
{
|
|
134
136
|
title: t("columns.address"),
|
|
@@ -143,11 +145,11 @@ function at({
|
|
|
143
145
|
},
|
|
144
146
|
{
|
|
145
147
|
title: t("columns.endDate"),
|
|
146
|
-
render: (i) =>
|
|
148
|
+
render: (i) => De(i)
|
|
147
149
|
}
|
|
148
150
|
],
|
|
149
151
|
itemMenu: (i) => /* @__PURE__ */ e(
|
|
150
|
-
|
|
152
|
+
Qe,
|
|
151
153
|
{
|
|
152
154
|
triggerLabel: t("rowMenuAriaLabel"),
|
|
153
155
|
items: [
|
|
@@ -156,7 +158,7 @@ function at({
|
|
|
156
158
|
onClick: () => {
|
|
157
159
|
f(i.uuid), C("edit");
|
|
158
160
|
},
|
|
159
|
-
icon: /* @__PURE__ */ e(
|
|
161
|
+
icon: /* @__PURE__ */ e(Le, { "aria-hidden": !0 })
|
|
160
162
|
},
|
|
161
163
|
{
|
|
162
164
|
label: t("rowDelete"),
|
|
@@ -169,35 +171,35 @@ function at({
|
|
|
169
171
|
}
|
|
170
172
|
),
|
|
171
173
|
emptyState: () => /* @__PURE__ */ e("div", { "data-testid": "home-address-history-empty", children: /* @__PURE__ */ e(
|
|
172
|
-
|
|
174
|
+
Ue,
|
|
173
175
|
{
|
|
174
|
-
icon: /* @__PURE__ */ e(
|
|
176
|
+
icon: /* @__PURE__ */ e(Ae, { "aria-hidden": !0 }),
|
|
175
177
|
title: t("historyEmptyTitle"),
|
|
176
178
|
description: t("historyEmptyDescription")
|
|
177
179
|
}
|
|
178
180
|
) })
|
|
179
181
|
}), T = () => {
|
|
180
182
|
C(null), f(void 0);
|
|
181
|
-
},
|
|
183
|
+
}, Ce = async () => {
|
|
182
184
|
if (!h)
|
|
183
185
|
return;
|
|
184
186
|
await N(h) && S(null);
|
|
185
187
|
}, x = l === "edit" ? {
|
|
186
|
-
onSubmit:
|
|
188
|
+
onSubmit: X,
|
|
187
189
|
formMethods: u.form.hookFormInternals.formMethods,
|
|
188
190
|
isPending: U.isPending
|
|
189
191
|
} : l === "create" ? {
|
|
190
|
-
onSubmit:
|
|
192
|
+
onSubmit: te,
|
|
191
193
|
formMethods: m.form.hookFormInternals.formMethods,
|
|
192
194
|
isPending: W.isPending
|
|
193
|
-
} : null,
|
|
195
|
+
} : null, Se = async () => {
|
|
194
196
|
if (!x)
|
|
195
197
|
return;
|
|
196
198
|
const i = await x.onSubmit();
|
|
197
199
|
i && G(i);
|
|
198
200
|
const d = Object.keys(x.formMethods.formState.errors).length > 0;
|
|
199
201
|
(i || !d) && T();
|
|
200
|
-
},
|
|
202
|
+
}, Me = x?.isPending ?? !1;
|
|
201
203
|
return /* @__PURE__ */ r(s, { flexDirection: "column", gap: 24, children: [
|
|
202
204
|
/* @__PURE__ */ r(s, { flexDirection: "column", gap: 4, alignItems: "flex-start", children: [
|
|
203
205
|
/* @__PURE__ */ e(n.Heading, { as: "h1", styledAs: "h2", children: t("title") }),
|
|
@@ -236,7 +238,7 @@ function at({
|
|
|
236
238
|
),
|
|
237
239
|
children: /* @__PURE__ */ r(s, { flexDirection: "column", gap: 16, children: [
|
|
238
240
|
g ? /* @__PURE__ */ r(s, { flexDirection: "column", gap: 4, children: [
|
|
239
|
-
/* @__PURE__ */ r(
|
|
241
|
+
/* @__PURE__ */ r(Fe, { children: [
|
|
240
242
|
/* @__PURE__ */ e(n.Text, { weight: "medium", children: K(g) }),
|
|
241
243
|
/* @__PURE__ */ e(n.Text, { weight: "medium", children: $(g) })
|
|
242
244
|
] }),
|
|
@@ -245,7 +247,7 @@ function at({
|
|
|
245
247
|
}) }) : null
|
|
246
248
|
] }) : /* @__PURE__ */ e(n.Text, { children: o("formTitle") }),
|
|
247
249
|
M ? /* @__PURE__ */ e(n.Alert, { status: "warning", label: t("changePendingTitle"), children: /* @__PURE__ */ e(n.Text, { variant: "supporting", children: t("changePendingDescription", {
|
|
248
|
-
possessiveLabel:
|
|
250
|
+
possessiveLabel: pe,
|
|
249
251
|
newAddress: z(M),
|
|
250
252
|
effectiveDate: M.effectiveDate ? E(M.effectiveDate.toString()) : "—",
|
|
251
253
|
interpolation: { escapeValue: !1 }
|
|
@@ -255,8 +257,9 @@ function at({
|
|
|
255
257
|
),
|
|
256
258
|
/* @__PURE__ */ r(s, { flexDirection: "column", gap: 12, children: [
|
|
257
259
|
/* @__PURE__ */ e(n.Heading, { as: "h2", styledAs: "h4", children: t("historySectionTitle") }),
|
|
258
|
-
/* @__PURE__ */ e(
|
|
260
|
+
/* @__PURE__ */ e(Oe, { label: t("historySectionTitle"), ...ye })
|
|
259
261
|
] }),
|
|
262
|
+
/* @__PURE__ */ e(We, { children: /* @__PURE__ */ e(n.Button, { variant: "secondary", onClick: _, children: t("backCta") }) }),
|
|
260
263
|
/* @__PURE__ */ e(
|
|
261
264
|
n.Modal,
|
|
262
265
|
{
|
|
@@ -280,9 +283,9 @@ function at({
|
|
|
280
283
|
{
|
|
281
284
|
variant: "primary",
|
|
282
285
|
onClick: () => {
|
|
283
|
-
|
|
286
|
+
Se();
|
|
284
287
|
},
|
|
285
|
-
isLoading:
|
|
288
|
+
isLoading: Me,
|
|
286
289
|
children: t("submitCta")
|
|
287
290
|
}
|
|
288
291
|
)
|
|
@@ -302,7 +305,7 @@ function at({
|
|
|
302
305
|
gap: 20,
|
|
303
306
|
children: [
|
|
304
307
|
/* @__PURE__ */ e(
|
|
305
|
-
|
|
308
|
+
ne,
|
|
306
309
|
{
|
|
307
310
|
label: o("street1"),
|
|
308
311
|
validationMessages: {
|
|
@@ -311,7 +314,7 @@ function at({
|
|
|
311
314
|
}
|
|
312
315
|
),
|
|
313
316
|
/* @__PURE__ */ e(
|
|
314
|
-
|
|
317
|
+
oe,
|
|
315
318
|
{
|
|
316
319
|
label: o("street2"),
|
|
317
320
|
validationMessages: {
|
|
@@ -320,7 +323,7 @@ function at({
|
|
|
320
323
|
}
|
|
321
324
|
),
|
|
322
325
|
/* @__PURE__ */ e(
|
|
323
|
-
|
|
326
|
+
re,
|
|
324
327
|
{
|
|
325
328
|
label: o("city"),
|
|
326
329
|
validationMessages: {
|
|
@@ -329,7 +332,7 @@ function at({
|
|
|
329
332
|
}
|
|
330
333
|
),
|
|
331
334
|
/* @__PURE__ */ e(
|
|
332
|
-
|
|
335
|
+
ae,
|
|
333
336
|
{
|
|
334
337
|
label: o("state"),
|
|
335
338
|
validationMessages: {
|
|
@@ -338,11 +341,11 @@ function at({
|
|
|
338
341
|
portalContainer: k
|
|
339
342
|
}
|
|
340
343
|
),
|
|
341
|
-
/* @__PURE__ */ e(
|
|
344
|
+
/* @__PURE__ */ e(se, { label: o("zip"), validationMessages: H }),
|
|
342
345
|
/* @__PURE__ */ e(
|
|
343
346
|
q,
|
|
344
347
|
{
|
|
345
|
-
CourtesyWithholding:
|
|
348
|
+
CourtesyWithholding: le,
|
|
346
349
|
formHook: u,
|
|
347
350
|
tHa: o
|
|
348
351
|
}
|
|
@@ -359,17 +362,17 @@ function at({
|
|
|
359
362
|
},
|
|
360
363
|
gap: 20,
|
|
361
364
|
children: [
|
|
362
|
-
|
|
363
|
-
|
|
365
|
+
B ? /* @__PURE__ */ e(
|
|
366
|
+
B,
|
|
364
367
|
{
|
|
365
368
|
label: t("columns.startDate"),
|
|
366
369
|
description: t("startDateHelper"),
|
|
367
|
-
validationMessages:
|
|
370
|
+
validationMessages: ge,
|
|
368
371
|
portalContainer: k
|
|
369
372
|
}
|
|
370
373
|
) : null,
|
|
371
374
|
/* @__PURE__ */ e(
|
|
372
|
-
|
|
375
|
+
de,
|
|
373
376
|
{
|
|
374
377
|
label: o("street1"),
|
|
375
378
|
validationMessages: {
|
|
@@ -378,7 +381,7 @@ function at({
|
|
|
378
381
|
}
|
|
379
382
|
),
|
|
380
383
|
/* @__PURE__ */ e(
|
|
381
|
-
|
|
384
|
+
ce,
|
|
382
385
|
{
|
|
383
386
|
label: o("street2"),
|
|
384
387
|
validationMessages: {
|
|
@@ -387,7 +390,7 @@ function at({
|
|
|
387
390
|
}
|
|
388
391
|
),
|
|
389
392
|
/* @__PURE__ */ e(
|
|
390
|
-
|
|
393
|
+
ue,
|
|
391
394
|
{
|
|
392
395
|
label: o("city"),
|
|
393
396
|
validationMessages: {
|
|
@@ -396,7 +399,7 @@ function at({
|
|
|
396
399
|
}
|
|
397
400
|
),
|
|
398
401
|
/* @__PURE__ */ e(
|
|
399
|
-
|
|
402
|
+
me,
|
|
400
403
|
{
|
|
401
404
|
label: o("state"),
|
|
402
405
|
validationMessages: {
|
|
@@ -405,11 +408,11 @@ function at({
|
|
|
405
408
|
portalContainer: k
|
|
406
409
|
}
|
|
407
410
|
),
|
|
408
|
-
/* @__PURE__ */ e(
|
|
411
|
+
/* @__PURE__ */ e(fe, { label: o("zip"), validationMessages: H }),
|
|
409
412
|
/* @__PURE__ */ e(
|
|
410
413
|
q,
|
|
411
414
|
{
|
|
412
|
-
CourtesyWithholding:
|
|
415
|
+
CourtesyWithholding: he,
|
|
413
416
|
formHook: m,
|
|
414
417
|
tHa: o
|
|
415
418
|
}
|
|
@@ -444,9 +447,9 @@ function at({
|
|
|
444
447
|
{
|
|
445
448
|
variant: "error",
|
|
446
449
|
onClick: () => {
|
|
447
|
-
|
|
450
|
+
Ce();
|
|
448
451
|
},
|
|
449
|
-
isLoading:
|
|
452
|
+
isLoading: J,
|
|
450
453
|
children: t("deleteModalConfirmCta")
|
|
451
454
|
}
|
|
452
455
|
)
|
|
@@ -454,7 +457,7 @@ function at({
|
|
|
454
457
|
children: /* @__PURE__ */ r(s, { flexDirection: "column", gap: 16, children: [
|
|
455
458
|
/* @__PURE__ */ e(n.Heading, { as: "h2", children: t("deleteModalTitle") }),
|
|
456
459
|
/* @__PURE__ */ e(n.Text, { variant: "supporting", children: Q ? /* @__PURE__ */ e(
|
|
457
|
-
|
|
460
|
+
L,
|
|
458
461
|
{
|
|
459
462
|
t,
|
|
460
463
|
i18nKey: "deleteModalDescription",
|
|
@@ -473,6 +476,6 @@ function at({
|
|
|
473
476
|
] });
|
|
474
477
|
}
|
|
475
478
|
export {
|
|
476
|
-
|
|
479
|
+
dt as HomeAddressView
|
|
477
480
|
};
|
|
478
481
|
//# sourceMappingURL=HomeAddressView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HomeAddressView.js","sources":["../../../../../src/components/Employee/HomeAddress/management/HomeAddressView.tsx"],"sourcesContent":["import { useLayoutEffect, useMemo, useRef, useState } from 'react'\nimport { Trans, useTranslation } from 'react-i18next'\nimport { useWatch } from 'react-hook-form'\nimport type { EmployeeAddress } from '@gusto/embedded-api/models/components/employeeaddress'\nimport type { TFunction } from 'i18next'\nimport {\n formatPendingHomeAddressLine,\n getPendingFutureHomeAddress,\n} from './getPendingFutureHomeAddress'\nimport HouseIcon from '@/assets/icons/house.svg?react'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { HomeAddressErrorCodes } from '@/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema'\nimport type { UseHomeAddressFormReady } from '@/components/Employee/Profile/shared/useHomeAddressForm'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport type { HookSubmitResult } from '@/partner-hook-utils/types'\nimport { DataView, EmptyData, HamburgerMenu, useDataView } from '@/components/Common'\nimport { Flex, FlexItem } from '@/components/Common/Flex/Flex'\nimport { Grid } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { addDays, formatDateLongWithYear, normalizeToDate } from '@/helpers/dateFormatting'\nimport { formatStreetForDisplay, getCityStateZip } from '@/helpers/formattedStrings'\n\nfunction HomeAddressCourtesyWithholdingBlock({\n CourtesyWithholding,\n formHook,\n tHa,\n}: {\n CourtesyWithholding: UseHomeAddressFormReady['form']['Fields']['CourtesyWithholding']\n formHook: UseHomeAddressFormReady\n tHa: TFunction<'Employee.HomeAddress'>\n}) {\n const Components = useComponentContext()\n const { control } = formHook.form.hookFormInternals.formMethods\n const courtesyWithholdingEnabled = useWatch({ control, name: 'courtesyWithholding' })\n\n return (\n <>\n <CourtesyWithholding\n label={tHa('courtesyWithholdingLabel')}\n description={\n <>\n {tHa('courtesyWithholdingDescription')}\n <Trans\n t={tHa}\n i18nKey=\"learnMoreCta\"\n components={{\n LearnMoreLink: <Components.Link />,\n }}\n />\n </>\n }\n />\n {courtesyWithholdingEnabled ? (\n <Components.Alert label={tHa('withholdingTitle')} status=\"warning\">\n <Trans t={tHa} i18nKey=\"withholdingNote\" />\n </Components.Alert>\n ) : null}\n </>\n )\n}\n\nexport interface HomeAddressViewProps {\n editHomeAddressForm: UseHomeAddressFormReady\n createHomeAddressForm: UseHomeAddressFormReady\n /** Full list for history, pending future row, and delete confirmation (from management list query). */\n employeeHomeAddresses: EmployeeAddress[] | undefined\n employeeDisplayName: string\n /** Resolved UUID passed to the edit form (`homeAddressUuid`); active row when not editing history. */\n editingHomeAddressUuid: string | undefined\n /** `undefined` = edit active/current address; otherwise set to a history row’s UUID. */\n onEditAddressTargetChange: (homeAddressUuid: string | undefined) => void\n onSaved: (result: HookSubmitResult<EmployeeAddress>) => void\n onConfirmDelete: (homeAddressUuid: string) => Promise<boolean>\n isDeletePending?: boolean\n}\n\nexport function HomeAddressView({\n editHomeAddressForm,\n createHomeAddressForm,\n employeeHomeAddresses,\n employeeDisplayName,\n editingHomeAddressUuid,\n onEditAddressTargetChange,\n onSaved,\n onConfirmDelete,\n isDeletePending = false,\n}: HomeAddressViewProps) {\n const { t } = useTranslation('Employee.HomeAddress.Management')\n const { t: tHa } = useTranslation('Employee.HomeAddress')\n const Components = useComponentContext()\n const [addressModal, setAddressModal] = useState<'edit' | 'create' | null>(null)\n const [deleteConfirmUuid, setDeleteConfirmUuid] = useState<string | null>(null)\n const addressModalContainerRef = useRef<HTMLDivElement>(null)\n const [addressModalPortal, setAddressModalPortal] = useState<HTMLElement | undefined>(undefined)\n\n useLayoutEffect(() => {\n if (!addressModal) {\n setAddressModalPortal(undefined)\n return\n }\n const syncPortal = () => {\n setAddressModalPortal(addressModalContainerRef.current ?? undefined)\n }\n syncPortal()\n if (addressModalContainerRef.current == null) {\n const id = requestAnimationFrame(syncPortal)\n return () => {\n cancelAnimationFrame(id)\n }\n }\n }, [addressModal])\n\n const {\n data: { homeAddress },\n status: editStatus,\n actions: { onSubmit: editOnSubmit },\n form: editForm,\n } = editHomeAddressForm\n\n const homeAddresses = employeeHomeAddresses\n\n const {\n status: createStatus,\n actions: { onSubmit: createOnSubmit },\n form: createForm,\n } = createHomeAddressForm\n\n const {\n Fields: {\n Street1: EditStreet1,\n Street2: EditStreet2,\n City: EditCity,\n State: EditState,\n Zip: EditZip,\n CourtesyWithholding: EditCourtesyWithholding,\n },\n } = editForm\n\n const {\n Fields: {\n Street1: CreateStreet1,\n Street2: CreateStreet2,\n City: CreateCity,\n State: CreateState,\n Zip: CreateZip,\n CourtesyWithholding: CreateCourtesyWithholding,\n EffectiveDate: CreateEffectiveDate,\n },\n } = createForm\n\n const zipValidation = {\n [HomeAddressErrorCodes.REQUIRED]: tHa('validations.zip'),\n [HomeAddressErrorCodes.INVALID_ZIP]: tHa('validations.zip'),\n }\n\n const startDateValidation = {\n [HomeAddressErrorCodes.REQUIRED]: t('form.startDateRequired'),\n }\n\n const pendingFutureAddress = useMemo(\n () => getPendingFutureHomeAddress(homeAddresses),\n [homeAddresses],\n )\n\n const addressForDeleteModal = useMemo(() => {\n if (!deleteConfirmUuid || !homeAddresses) {\n return undefined\n }\n return homeAddresses.find(a => a.uuid === deleteConfirmUuid)\n }, [deleteConfirmUuid, homeAddresses])\n\n const changePendingPossessiveLabel = useMemo(() => {\n const trimmed = employeeDisplayName.trim()\n return trimmed ? `${trimmed}'s` : t('changePendingPossessiveFallback')\n }, [employeeDisplayName, t])\n\n const chronologicalAsc = [...(homeAddresses ?? [])].sort((a, b) => {\n const aDate = a.effectiveDate?.toString() ?? ''\n const bDate = b.effectiveDate?.toString() ?? ''\n if (!aDate && !bDate) return 0\n if (!aDate) return 1\n if (!bDate) return -1\n return aDate.localeCompare(bDate)\n })\n\n const historyAddresses = chronologicalAsc.filter(address => address.active !== true)\n const sortedHistory = [...historyAddresses].reverse()\n\n const historyEndDate = (row: EmployeeAddress) => {\n const idx = chronologicalAsc.findIndex(a => a.uuid === row.uuid)\n if (idx === -1 || idx >= chronologicalAsc.length - 1) return '—'\n const nextStart = chronologicalAsc[idx + 1]?.effectiveDate\n if (!nextStart) return '—'\n const nextDate = normalizeToDate(nextStart.toString())\n if (!nextDate) return '—'\n const endDate = addDays(nextDate, -1)\n const y = endDate.getFullYear()\n const m = String(endDate.getMonth() + 1).padStart(2, '0')\n const d = String(endDate.getDate()).padStart(2, '0')\n return formatDateLongWithYear(`${y}-${m}-${d}`)\n }\n\n const historyDataView = useDataView({\n data: sortedHistory,\n columns: [\n {\n title: t('columns.address'),\n render: (row: EmployeeAddress) => (\n <Flex flexDirection=\"column\" gap={0}>\n <Components.Text weight=\"medium\">{formatStreetForDisplay(row)}</Components.Text>\n <Components.Text variant=\"supporting\">{getCityStateZip(row)}</Components.Text>\n </Flex>\n ),\n },\n {\n title: t('columns.startDate'),\n render: (row: EmployeeAddress) =>\n row.effectiveDate ? formatDateLongWithYear(row.effectiveDate.toString()) : '—',\n },\n {\n title: t('columns.endDate'),\n render: (row: EmployeeAddress) => historyEndDate(row),\n },\n ],\n itemMenu: (row: EmployeeAddress) => (\n <HamburgerMenu\n triggerLabel={t('rowMenuAriaLabel')}\n items={[\n {\n label: t('rowEdit'),\n onClick: () => {\n onEditAddressTargetChange(row.uuid)\n setAddressModal('edit')\n },\n icon: <PencilSvg aria-hidden />,\n },\n {\n label: t('rowDelete'),\n onClick: () => {\n if (row.active === true) {\n return\n }\n setDeleteConfirmUuid(row.uuid)\n },\n icon: <TrashCanSvg aria-hidden />,\n },\n ]}\n />\n ),\n emptyState: () => (\n <div data-testid=\"home-address-history-empty\">\n <EmptyData\n icon={<HouseIcon aria-hidden />}\n title={t('historyEmptyTitle')}\n description={t('historyEmptyDescription')}\n />\n </div>\n ),\n })\n\n const closeAddressModal = () => {\n setAddressModal(null)\n onEditAddressTargetChange(undefined)\n }\n\n const handleDeleteModalConfirm = async () => {\n if (!deleteConfirmUuid) {\n return\n }\n const deleted = await onConfirmDelete(deleteConfirmUuid)\n if (deleted) {\n setDeleteConfirmUuid(null)\n }\n }\n\n const addressModalSession =\n addressModal === 'edit'\n ? {\n onSubmit: editOnSubmit,\n formMethods: editHomeAddressForm.form.hookFormInternals.formMethods,\n isPending: editStatus.isPending,\n }\n : addressModal === 'create'\n ? {\n onSubmit: createOnSubmit,\n formMethods: createHomeAddressForm.form.hookFormInternals.formMethods,\n isPending: createStatus.isPending,\n }\n : null\n\n const handleSave = async () => {\n if (!addressModalSession) {\n return\n }\n\n const submitResult = await addressModalSession.onSubmit()\n\n if (submitResult) {\n onSaved(submitResult)\n }\n\n const hasFieldErrors = Object.keys(addressModalSession.formMethods.formState.errors).length > 0\n if (submitResult || !hasFieldErrors) {\n closeAddressModal()\n }\n }\n\n const modalPending = addressModalSession?.isPending ?? false\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <Flex flexDirection=\"column\" gap={4} alignItems=\"flex-start\">\n <Components.Heading as=\"h1\" styledAs=\"h2\">\n {t('title')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">{t('description')}</Components.Text>\n </Flex>\n\n <Components.Box\n header={\n <Components.BoxHeader\n title={t('currentSectionTitle')}\n action={\n homeAddress ? (\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEditAddressTargetChange(undefined)\n setAddressModal('edit')\n }}\n isLoading={editStatus.isPending}\n >\n {t('editCta')}\n </Components.Button>\n ) : undefined\n }\n />\n }\n footer={\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEditAddressTargetChange(undefined)\n setAddressModal('create')\n }}\n isLoading={createStatus.isPending}\n >\n {t('changeCta')}\n </Components.Button>\n }\n >\n <Flex flexDirection=\"column\" gap={16}>\n {homeAddress ? (\n <Flex flexDirection=\"column\" gap={4}>\n <FlexItem>\n <Components.Text weight=\"medium\">\n {formatStreetForDisplay(homeAddress)}\n </Components.Text>\n <Components.Text weight=\"medium\">{getCityStateZip(homeAddress)}</Components.Text>\n </FlexItem>\n {homeAddress.effectiveDate ? (\n <Components.Text variant=\"supporting\">\n {t('currentSince', {\n date: formatDateLongWithYear(homeAddress.effectiveDate.toString()),\n })}\n </Components.Text>\n ) : null}\n </Flex>\n ) : (\n <Components.Text>{tHa('formTitle')}</Components.Text>\n )}\n {pendingFutureAddress ? (\n <Components.Alert status=\"warning\" label={t('changePendingTitle')}>\n <Components.Text variant=\"supporting\">\n {t('changePendingDescription', {\n possessiveLabel: changePendingPossessiveLabel,\n newAddress: formatPendingHomeAddressLine(pendingFutureAddress),\n effectiveDate: pendingFutureAddress.effectiveDate\n ? formatDateLongWithYear(pendingFutureAddress.effectiveDate.toString())\n : '—',\n interpolation: { escapeValue: false },\n })}\n </Components.Text>\n </Components.Alert>\n ) : null}\n </Flex>\n </Components.Box>\n\n <Flex flexDirection=\"column\" gap={12}>\n <Components.Heading as=\"h2\" styledAs=\"h4\">\n {t('historySectionTitle')}\n </Components.Heading>\n <DataView label={t('historySectionTitle')} {...historyDataView} />\n </Flex>\n\n <Components.Modal\n isOpen={addressModal !== null}\n onClose={closeAddressModal}\n shouldCloseOnBackdropClick={false}\n containerRef={addressModalContainerRef}\n footer={\n <Flex flexDirection=\"row\" gap={12} justifyContent=\"flex-end\">\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n closeAddressModal()\n }}\n >\n {t('cancelCta')}\n </Components.Button>\n <Components.Button\n variant=\"primary\"\n onClick={() => {\n void handleSave()\n }}\n isLoading={modalPending}\n >\n {t('submitCta')}\n </Components.Button>\n </Flex>\n }\n >\n <Flex flexDirection=\"column\" gap={32}>\n <Flex flexDirection=\"column\" gap={4}>\n <Components.Heading as=\"h2\">\n {addressModal === 'edit' ? t('editModalTitle') : t('createModalTitle')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {addressModal === 'edit' ? t('editModalDescription') : t('createModalDescription')}\n </Components.Text>\n </Flex>\n {addressModal === 'edit' ? (\n <SDKFormProvider formHookResult={editHomeAddressForm}>\n <Grid\n gridTemplateColumns={{\n base: '1fr',\n small: '1fr',\n }}\n gap={20}\n >\n <EditStreet1\n label={tHa('street1')}\n validationMessages={{\n [HomeAddressErrorCodes.REQUIRED]: tHa('validations.street1'),\n }}\n />\n <EditStreet2\n label={tHa('street2')}\n validationMessages={{\n [HomeAddressErrorCodes.REQUIRED]: tHa('validations.street1'),\n }}\n />\n <EditCity\n label={tHa('city')}\n validationMessages={{\n [HomeAddressErrorCodes.REQUIRED]: tHa('validations.city'),\n }}\n />\n <EditState\n label={tHa('state')}\n validationMessages={{\n [HomeAddressErrorCodes.REQUIRED]: tHa('validations.state'),\n }}\n portalContainer={addressModalPortal}\n />\n <EditZip label={tHa('zip')} validationMessages={zipValidation} />\n <HomeAddressCourtesyWithholdingBlock\n CourtesyWithholding={EditCourtesyWithholding}\n formHook={editHomeAddressForm}\n tHa={tHa}\n />\n </Grid>\n </SDKFormProvider>\n ) : null}\n {addressModal === 'create' ? (\n <SDKFormProvider formHookResult={createHomeAddressForm}>\n <Grid\n gridTemplateColumns={{\n base: '1fr',\n small: '1fr',\n }}\n gap={20}\n >\n {CreateEffectiveDate ? (\n <CreateEffectiveDate\n label={t('columns.startDate')}\n description={t('startDateHelper')}\n validationMessages={startDateValidation}\n portalContainer={addressModalPortal}\n />\n ) : null}\n <CreateStreet1\n label={tHa('street1')}\n validationMessages={{\n [HomeAddressErrorCodes.REQUIRED]: tHa('validations.street1'),\n }}\n />\n <CreateStreet2\n label={tHa('street2')}\n validationMessages={{\n [HomeAddressErrorCodes.REQUIRED]: tHa('validations.street1'),\n }}\n />\n <CreateCity\n label={tHa('city')}\n validationMessages={{\n [HomeAddressErrorCodes.REQUIRED]: tHa('validations.city'),\n }}\n />\n <CreateState\n label={tHa('state')}\n validationMessages={{\n [HomeAddressErrorCodes.REQUIRED]: tHa('validations.state'),\n }}\n portalContainer={addressModalPortal}\n />\n <CreateZip label={tHa('zip')} validationMessages={zipValidation} />\n <HomeAddressCourtesyWithholdingBlock\n CourtesyWithholding={CreateCourtesyWithholding}\n formHook={createHomeAddressForm}\n tHa={tHa}\n />\n </Grid>\n </SDKFormProvider>\n ) : null}\n </Flex>\n </Components.Modal>\n\n <Components.Modal\n isOpen={deleteConfirmUuid !== null}\n onClose={() => {\n setDeleteConfirmUuid(null)\n }}\n shouldCloseOnBackdropClick={false}\n footer={\n <Flex flexDirection=\"row\" gap={12} justifyContent=\"flex-end\">\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n setDeleteConfirmUuid(null)\n }}\n >\n {t('cancelCta')}\n </Components.Button>\n <Components.Button\n variant=\"error\"\n onClick={() => {\n void handleDeleteModalConfirm()\n }}\n isLoading={isDeletePending}\n >\n {t('deleteModalConfirmCta')}\n </Components.Button>\n </Flex>\n }\n >\n <Flex flexDirection=\"column\" gap={16}>\n <Components.Heading as=\"h2\">{t('deleteModalTitle')}</Components.Heading>\n <Components.Text variant=\"supporting\">\n {addressForDeleteModal ? (\n <Trans\n t={t}\n i18nKey=\"deleteModalDescription\"\n values={{\n address: formatPendingHomeAddressLine(addressForDeleteModal),\n }}\n components={{\n strong: <Components.Text weight=\"medium\" as=\"span\" />,\n }}\n tOptions={{ interpolation: { escapeValue: false } }}\n />\n ) : null}\n </Components.Text>\n </Flex>\n </Components.Modal>\n </Flex>\n )\n}\n"],"names":["HomeAddressCourtesyWithholdingBlock","CourtesyWithholding","formHook","tHa","Components","useComponentContext","control","courtesyWithholdingEnabled","useWatch","jsxs","Fragment","jsx","Trans","HomeAddressView","editHomeAddressForm","createHomeAddressForm","employeeHomeAddresses","employeeDisplayName","editingHomeAddressUuid","onEditAddressTargetChange","onSaved","onConfirmDelete","isDeletePending","useTranslation","addressModal","setAddressModal","useState","deleteConfirmUuid","setDeleteConfirmUuid","addressModalContainerRef","useRef","addressModalPortal","setAddressModalPortal","useLayoutEffect","syncPortal","id","homeAddress","editStatus","editOnSubmit","editForm","homeAddresses","createStatus","createOnSubmit","createForm","EditStreet1","EditStreet2","EditCity","EditState","EditZip","EditCourtesyWithholding","CreateStreet1","CreateStreet2","CreateCity","CreateState","CreateZip","CreateCourtesyWithholding","CreateEffectiveDate","zipValidation","HomeAddressErrorCodes","startDateValidation","pendingFutureAddress","useMemo","getPendingFutureHomeAddress","addressForDeleteModal","a","changePendingPossessiveLabel","trimmed","chronologicalAsc","b","aDate","bDate","sortedHistory","address","historyEndDate","row","idx","nextStart","nextDate","normalizeToDate","endDate","addDays","y","m","d","formatDateLongWithYear","historyDataView","useDataView","Flex","formatStreetForDisplay","getCityStateZip","HamburgerMenu","PencilSvg","TrashCanSvg","EmptyData","HouseIcon","closeAddressModal","handleDeleteModalConfirm","addressModalSession","handleSave","submitResult","hasFieldErrors","modalPending","FlexItem","formatPendingHomeAddressLine","DataView","SDKFormProvider","Grid"],"mappings":";;;;;;;;;;;;;;;;;;;AAuBA,SAASA,EAAoC;AAAA,EAC3C,qBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,KAAAC;AACF,GAIG;AACD,QAAMC,IAAaC,EAAA,GACb,EAAE,SAAAC,EAAA,IAAYJ,EAAS,KAAK,kBAAkB,aAC9CK,IAA6BC,GAAS,EAAE,SAAAF,GAAS,MAAM,uBAAuB;AAEpF,SACE,gBAAAG,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACV;AAAA,MAAA;AAAA,QACC,OAAOE,EAAI,0BAA0B;AAAA,QACrC,aACE,gBAAAM,EAAAC,GAAA,EACG,UAAA;AAAA,UAAAP,EAAI,gCAAgC;AAAA,UACrC,gBAAAQ;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,GAAGT;AAAA,cACH,SAAQ;AAAA,cACR,YAAY;AAAA,gBACV,eAAe,gBAAAQ,EAACP,EAAW,MAAX,CAAA,CAAgB;AAAA,cAAA;AAAA,YAClC;AAAA,UAAA;AAAA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AEV,YAAE,uBAAuB;AAAA,YAAA;AAAA,UAAA;AAAA,QAC5B,GACF;AAAA,QAGF,UAAA,gBAAAb,EAAC8E,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,UAAA,gBAAA5E,EAACP,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,kBAAkB,GAAE;AAAA,4BAClDA,EAAW,MAAX,EAAgB,SAAQ,cACtB,UAAA2D,IACC,gBAAApD;AAAA,YAACC;AAAA,YAAA;AAAA,cACC;AAAA,cACA,SAAQ;AAAA,cACR,QAAQ;AAAA,gBACN,SAAS2F,EAA6BxC,CAAqB;AAAA,cAAA;AAAA,cAE7D,YAAY;AAAA,gBACV,0BAAS3D,EAAW,MAAX,EAAgB,QAAO,UAAS,IAAG,OAAA,CAAO;AAAA,cAAA;AAAA,cAErD,UAAU,EAAE,eAAe,EAAE,aAAa,KAAM;AAAA,YAAE;AAAA,UAAA,IAElD,KAAA,CACN;AAAA,QAAA,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"HomeAddressView.js","sources":["../../../../../src/components/Employee/HomeAddress/management/HomeAddressView.tsx"],"sourcesContent":["import { useLayoutEffect, useMemo, useRef, useState } from 'react'\nimport { Trans, useTranslation } from 'react-i18next'\nimport { useWatch } from 'react-hook-form'\nimport type { EmployeeAddress } from '@gusto/embedded-api/models/components/employeeaddress'\nimport type { TFunction } from 'i18next'\nimport {\n formatPendingHomeAddressLine,\n getPendingFutureHomeAddress,\n} from './getPendingFutureHomeAddress'\nimport HouseIcon from '@/assets/icons/house.svg?react'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { HomeAddressErrorCodes } from '@/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema'\nimport type { UseHomeAddressFormReady } from '@/components/Employee/Profile/shared/useHomeAddressForm'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport type { HookSubmitResult } from '@/partner-hook-utils/types'\nimport { ActionsLayout, DataView, EmptyData, HamburgerMenu, useDataView } from '@/components/Common'\nimport { Flex, FlexItem } from '@/components/Common/Flex/Flex'\nimport { Grid } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { addDays, formatDateLongWithYear, normalizeToDate } from '@/helpers/dateFormatting'\nimport { formatStreetForDisplay, getCityStateZip } from '@/helpers/formattedStrings'\n\nfunction HomeAddressCourtesyWithholdingBlock({\n CourtesyWithholding,\n formHook,\n tHa,\n}: {\n CourtesyWithholding: UseHomeAddressFormReady['form']['Fields']['CourtesyWithholding']\n formHook: UseHomeAddressFormReady\n tHa: TFunction<'Employee.HomeAddress'>\n}) {\n const Components = useComponentContext()\n const { control } = formHook.form.hookFormInternals.formMethods\n const courtesyWithholdingEnabled = useWatch({ control, name: 'courtesyWithholding' })\n\n return (\n <>\n <CourtesyWithholding\n label={tHa('courtesyWithholdingLabel')}\n description={\n <>\n {tHa('courtesyWithholdingDescription')}\n <Trans\n t={tHa}\n i18nKey=\"learnMoreCta\"\n components={{\n LearnMoreLink: <Components.Link />,\n }}\n />\n </>\n }\n />\n {courtesyWithholdingEnabled ? (\n <Components.Alert label={tHa('withholdingTitle')} status=\"warning\">\n <Trans t={tHa} i18nKey=\"withholdingNote\" />\n </Components.Alert>\n ) : null}\n </>\n )\n}\n\nexport interface HomeAddressViewProps {\n editHomeAddressForm: UseHomeAddressFormReady\n createHomeAddressForm: UseHomeAddressFormReady\n /** Full list for history, pending future row, and delete confirmation (from management list query). */\n employeeHomeAddresses: EmployeeAddress[] | undefined\n employeeDisplayName: string\n /** Resolved UUID passed to the edit form (`homeAddressUuid`); active row when not editing history. */\n editingHomeAddressUuid: string | undefined\n /** `undefined` = edit active/current address; otherwise set to a history row’s UUID. */\n onEditAddressTargetChange: (homeAddressUuid: string | undefined) => void\n onSaved: (result: HookSubmitResult<EmployeeAddress>) => void\n onConfirmDelete: (homeAddressUuid: string) => Promise<boolean>\n onBack: () => void\n isDeletePending?: boolean\n}\n\nexport function HomeAddressView({\n editHomeAddressForm,\n createHomeAddressForm,\n employeeHomeAddresses,\n employeeDisplayName,\n editingHomeAddressUuid,\n onEditAddressTargetChange,\n onSaved,\n onConfirmDelete,\n onBack,\n isDeletePending = false,\n}: HomeAddressViewProps) {\n const { t } = useTranslation('Employee.HomeAddress.Management')\n const { t: tHa } = useTranslation('Employee.HomeAddress')\n const Components = useComponentContext()\n const [addressModal, setAddressModal] = useState<'edit' | 'create' | null>(null)\n const [deleteConfirmUuid, setDeleteConfirmUuid] = useState<string | null>(null)\n const addressModalContainerRef = useRef<HTMLDivElement>(null)\n const [addressModalPortal, setAddressModalPortal] = useState<HTMLElement | undefined>(undefined)\n\n useLayoutEffect(() => {\n if (!addressModal) {\n setAddressModalPortal(undefined)\n return\n }\n const syncPortal = () => {\n setAddressModalPortal(addressModalContainerRef.current ?? undefined)\n }\n syncPortal()\n if (addressModalContainerRef.current == null) {\n const id = requestAnimationFrame(syncPortal)\n return () => {\n cancelAnimationFrame(id)\n }\n }\n }, [addressModal])\n\n const {\n data: { homeAddress },\n status: editStatus,\n actions: { onSubmit: editOnSubmit },\n form: editForm,\n } = editHomeAddressForm\n\n const homeAddresses = employeeHomeAddresses\n\n const {\n status: createStatus,\n actions: { onSubmit: createOnSubmit },\n form: createForm,\n } = createHomeAddressForm\n\n const {\n Fields: {\n Street1: EditStreet1,\n Street2: EditStreet2,\n City: EditCity,\n State: EditState,\n Zip: EditZip,\n CourtesyWithholding: EditCourtesyWithholding,\n },\n } = editForm\n\n const {\n Fields: {\n Street1: CreateStreet1,\n Street2: CreateStreet2,\n City: CreateCity,\n State: CreateState,\n Zip: CreateZip,\n CourtesyWithholding: CreateCourtesyWithholding,\n EffectiveDate: CreateEffectiveDate,\n },\n } = createForm\n\n const zipValidation = {\n [HomeAddressErrorCodes.REQUIRED]: tHa('validations.zip'),\n [HomeAddressErrorCodes.INVALID_ZIP]: tHa('validations.zip'),\n }\n\n const startDateValidation = {\n [HomeAddressErrorCodes.REQUIRED]: t('form.startDateRequired'),\n }\n\n const pendingFutureAddress = useMemo(\n () => getPendingFutureHomeAddress(homeAddresses),\n [homeAddresses],\n )\n\n const addressForDeleteModal = useMemo(() => {\n if (!deleteConfirmUuid || !homeAddresses) {\n return undefined\n }\n return homeAddresses.find(a => a.uuid === deleteConfirmUuid)\n }, [deleteConfirmUuid, homeAddresses])\n\n const changePendingPossessiveLabel = useMemo(() => {\n const trimmed = employeeDisplayName.trim()\n return trimmed ? `${trimmed}'s` : t('changePendingPossessiveFallback')\n }, [employeeDisplayName, t])\n\n const chronologicalAsc = [...(homeAddresses ?? [])].sort((a, b) => {\n const aDate = a.effectiveDate?.toString() ?? ''\n const bDate = b.effectiveDate?.toString() ?? ''\n if (!aDate && !bDate) return 0\n if (!aDate) return 1\n if (!bDate) return -1\n return aDate.localeCompare(bDate)\n })\n\n const historyAddresses = chronologicalAsc.filter(address => address.active !== true)\n const sortedHistory = [...historyAddresses].reverse()\n\n const historyEndDate = (row: EmployeeAddress) => {\n const idx = chronologicalAsc.findIndex(a => a.uuid === row.uuid)\n if (idx === -1 || idx >= chronologicalAsc.length - 1) return '—'\n const nextStart = chronologicalAsc[idx + 1]?.effectiveDate\n if (!nextStart) return '—'\n const nextDate = normalizeToDate(nextStart.toString())\n if (!nextDate) return '—'\n const endDate = addDays(nextDate, -1)\n const y = endDate.getFullYear()\n const m = String(endDate.getMonth() + 1).padStart(2, '0')\n const d = String(endDate.getDate()).padStart(2, '0')\n return formatDateLongWithYear(`${y}-${m}-${d}`)\n }\n\n const historyDataView = useDataView({\n data: sortedHistory,\n columns: [\n {\n title: t('columns.address'),\n render: (row: EmployeeAddress) => (\n <Flex flexDirection=\"column\" gap={0}>\n <Components.Text weight=\"medium\">{formatStreetForDisplay(row)}</Components.Text>\n <Components.Text variant=\"supporting\">{getCityStateZip(row)}</Components.Text>\n </Flex>\n ),\n },\n {\n title: t('columns.startDate'),\n render: (row: EmployeeAddress) =>\n row.effectiveDate ? formatDateLongWithYear(row.effectiveDate.toString()) : '—',\n },\n {\n title: t('columns.endDate'),\n render: (row: EmployeeAddress) => historyEndDate(row),\n },\n ],\n itemMenu: (row: EmployeeAddress) => (\n <HamburgerMenu\n triggerLabel={t('rowMenuAriaLabel')}\n items={[\n {\n label: t('rowEdit'),\n onClick: () => {\n onEditAddressTargetChange(row.uuid)\n setAddressModal('edit')\n },\n icon: <PencilSvg aria-hidden />,\n },\n {\n label: t('rowDelete'),\n onClick: () => {\n if (row.active === true) {\n return\n }\n setDeleteConfirmUuid(row.uuid)\n },\n icon: <TrashCanSvg aria-hidden />,\n },\n ]}\n />\n ),\n emptyState: () => (\n <div data-testid=\"home-address-history-empty\">\n <EmptyData\n icon={<HouseIcon aria-hidden />}\n title={t('historyEmptyTitle')}\n description={t('historyEmptyDescription')}\n />\n </div>\n ),\n })\n\n const closeAddressModal = () => {\n setAddressModal(null)\n onEditAddressTargetChange(undefined)\n }\n\n const handleDeleteModalConfirm = async () => {\n if (!deleteConfirmUuid) {\n return\n }\n const deleted = await onConfirmDelete(deleteConfirmUuid)\n if (deleted) {\n setDeleteConfirmUuid(null)\n }\n }\n\n const addressModalSession =\n addressModal === 'edit'\n ? {\n onSubmit: editOnSubmit,\n formMethods: editHomeAddressForm.form.hookFormInternals.formMethods,\n isPending: editStatus.isPending,\n }\n : addressModal === 'create'\n ? {\n onSubmit: createOnSubmit,\n formMethods: createHomeAddressForm.form.hookFormInternals.formMethods,\n isPending: createStatus.isPending,\n }\n : null\n\n const handleSave = async () => {\n if (!addressModalSession) {\n return\n }\n\n const submitResult = await addressModalSession.onSubmit()\n\n if (submitResult) {\n onSaved(submitResult)\n }\n\n const hasFieldErrors = Object.keys(addressModalSession.formMethods.formState.errors).length > 0\n if (submitResult || !hasFieldErrors) {\n closeAddressModal()\n }\n }\n\n const modalPending = addressModalSession?.isPending ?? false\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <Flex flexDirection=\"column\" gap={4} alignItems=\"flex-start\">\n <Components.Heading as=\"h1\" styledAs=\"h2\">\n {t('title')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">{t('description')}</Components.Text>\n </Flex>\n\n <Components.Box\n header={\n <Components.BoxHeader\n title={t('currentSectionTitle')}\n action={\n homeAddress ? (\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEditAddressTargetChange(undefined)\n setAddressModal('edit')\n }}\n isLoading={editStatus.isPending}\n >\n {t('editCta')}\n </Components.Button>\n ) : undefined\n }\n />\n }\n footer={\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEditAddressTargetChange(undefined)\n setAddressModal('create')\n }}\n isLoading={createStatus.isPending}\n >\n {t('changeCta')}\n </Components.Button>\n }\n >\n <Flex flexDirection=\"column\" gap={16}>\n {homeAddress ? (\n <Flex flexDirection=\"column\" gap={4}>\n <FlexItem>\n <Components.Text weight=\"medium\">\n {formatStreetForDisplay(homeAddress)}\n </Components.Text>\n <Components.Text weight=\"medium\">{getCityStateZip(homeAddress)}</Components.Text>\n </FlexItem>\n {homeAddress.effectiveDate ? (\n <Components.Text variant=\"supporting\">\n {t('currentSince', {\n date: formatDateLongWithYear(homeAddress.effectiveDate.toString()),\n })}\n </Components.Text>\n ) : null}\n </Flex>\n ) : (\n <Components.Text>{tHa('formTitle')}</Components.Text>\n )}\n {pendingFutureAddress ? (\n <Components.Alert status=\"warning\" label={t('changePendingTitle')}>\n <Components.Text variant=\"supporting\">\n {t('changePendingDescription', {\n possessiveLabel: changePendingPossessiveLabel,\n newAddress: formatPendingHomeAddressLine(pendingFutureAddress),\n effectiveDate: pendingFutureAddress.effectiveDate\n ? formatDateLongWithYear(pendingFutureAddress.effectiveDate.toString())\n : '—',\n interpolation: { escapeValue: false },\n })}\n </Components.Text>\n </Components.Alert>\n ) : null}\n </Flex>\n </Components.Box>\n\n <Flex flexDirection=\"column\" gap={12}>\n <Components.Heading as=\"h2\" styledAs=\"h4\">\n {t('historySectionTitle')}\n </Components.Heading>\n <DataView label={t('historySectionTitle')} {...historyDataView} />\n </Flex>\n\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={onBack}>\n {t('backCta')}\n </Components.Button>\n </ActionsLayout>\n\n <Components.Modal\n isOpen={addressModal !== null}\n onClose={closeAddressModal}\n shouldCloseOnBackdropClick={false}\n containerRef={addressModalContainerRef}\n footer={\n <Flex flexDirection=\"row\" gap={12} justifyContent=\"flex-end\">\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n closeAddressModal()\n }}\n >\n {t('cancelCta')}\n </Components.Button>\n <Components.Button\n variant=\"primary\"\n onClick={() => {\n void handleSave()\n }}\n isLoading={modalPending}\n >\n {t('submitCta')}\n </Components.Button>\n </Flex>\n }\n >\n <Flex flexDirection=\"column\" gap={32}>\n <Flex flexDirection=\"column\" gap={4}>\n <Components.Heading as=\"h2\">\n {addressModal === 'edit' ? t('editModalTitle') : t('createModalTitle')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {addressModal === 'edit' ? t('editModalDescription') : t('createModalDescription')}\n </Components.Text>\n </Flex>\n {addressModal === 'edit' ? (\n <SDKFormProvider formHookResult={editHomeAddressForm}>\n <Grid\n gridTemplateColumns={{\n base: '1fr',\n small: '1fr',\n }}\n gap={20}\n >\n <EditStreet1\n label={tHa('street1')}\n validationMessages={{\n [HomeAddressErrorCodes.REQUIRED]: tHa('validations.street1'),\n }}\n />\n <EditStreet2\n label={tHa('street2')}\n validationMessages={{\n [HomeAddressErrorCodes.REQUIRED]: tHa('validations.street1'),\n }}\n />\n <EditCity\n label={tHa('city')}\n validationMessages={{\n [HomeAddressErrorCodes.REQUIRED]: tHa('validations.city'),\n }}\n />\n <EditState\n label={tHa('state')}\n validationMessages={{\n [HomeAddressErrorCodes.REQUIRED]: tHa('validations.state'),\n }}\n portalContainer={addressModalPortal}\n />\n <EditZip label={tHa('zip')} validationMessages={zipValidation} />\n <HomeAddressCourtesyWithholdingBlock\n CourtesyWithholding={EditCourtesyWithholding}\n formHook={editHomeAddressForm}\n tHa={tHa}\n />\n </Grid>\n </SDKFormProvider>\n ) : null}\n {addressModal === 'create' ? (\n <SDKFormProvider formHookResult={createHomeAddressForm}>\n <Grid\n gridTemplateColumns={{\n base: '1fr',\n small: '1fr',\n }}\n gap={20}\n >\n {CreateEffectiveDate ? (\n <CreateEffectiveDate\n label={t('columns.startDate')}\n description={t('startDateHelper')}\n validationMessages={startDateValidation}\n portalContainer={addressModalPortal}\n />\n ) : null}\n <CreateStreet1\n label={tHa('street1')}\n validationMessages={{\n [HomeAddressErrorCodes.REQUIRED]: tHa('validations.street1'),\n }}\n />\n <CreateStreet2\n label={tHa('street2')}\n validationMessages={{\n [HomeAddressErrorCodes.REQUIRED]: tHa('validations.street1'),\n }}\n />\n <CreateCity\n label={tHa('city')}\n validationMessages={{\n [HomeAddressErrorCodes.REQUIRED]: tHa('validations.city'),\n }}\n />\n <CreateState\n label={tHa('state')}\n validationMessages={{\n [HomeAddressErrorCodes.REQUIRED]: tHa('validations.state'),\n }}\n portalContainer={addressModalPortal}\n />\n <CreateZip label={tHa('zip')} validationMessages={zipValidation} />\n <HomeAddressCourtesyWithholdingBlock\n CourtesyWithholding={CreateCourtesyWithholding}\n formHook={createHomeAddressForm}\n tHa={tHa}\n />\n </Grid>\n </SDKFormProvider>\n ) : null}\n </Flex>\n </Components.Modal>\n\n <Components.Modal\n isOpen={deleteConfirmUuid !== null}\n onClose={() => {\n setDeleteConfirmUuid(null)\n }}\n shouldCloseOnBackdropClick={false}\n footer={\n <Flex flexDirection=\"row\" gap={12} justifyContent=\"flex-end\">\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n setDeleteConfirmUuid(null)\n }}\n >\n {t('cancelCta')}\n </Components.Button>\n <Components.Button\n variant=\"error\"\n onClick={() => {\n void handleDeleteModalConfirm()\n }}\n isLoading={isDeletePending}\n >\n {t('deleteModalConfirmCta')}\n </Components.Button>\n </Flex>\n }\n >\n <Flex flexDirection=\"column\" gap={16}>\n <Components.Heading as=\"h2\">{t('deleteModalTitle')}</Components.Heading>\n <Components.Text variant=\"supporting\">\n {addressForDeleteModal ? (\n <Trans\n t={t}\n i18nKey=\"deleteModalDescription\"\n values={{\n address: formatPendingHomeAddressLine(addressForDeleteModal),\n }}\n components={{\n strong: <Components.Text weight=\"medium\" as=\"span\" />,\n }}\n tOptions={{ interpolation: { escapeValue: false } }}\n />\n ) : null}\n </Components.Text>\n </Flex>\n </Components.Modal>\n </Flex>\n )\n}\n"],"names":["HomeAddressCourtesyWithholdingBlock","CourtesyWithholding","formHook","tHa","Components","useComponentContext","control","courtesyWithholdingEnabled","useWatch","jsxs","Fragment","jsx","Trans","HomeAddressView","editHomeAddressForm","createHomeAddressForm","employeeHomeAddresses","employeeDisplayName","editingHomeAddressUuid","onEditAddressTargetChange","onSaved","onConfirmDelete","onBack","isDeletePending","useTranslation","addressModal","setAddressModal","useState","deleteConfirmUuid","setDeleteConfirmUuid","addressModalContainerRef","useRef","addressModalPortal","setAddressModalPortal","useLayoutEffect","syncPortal","id","homeAddress","editStatus","editOnSubmit","editForm","homeAddresses","createStatus","createOnSubmit","createForm","EditStreet1","EditStreet2","EditCity","EditState","EditZip","EditCourtesyWithholding","CreateStreet1","CreateStreet2","CreateCity","CreateState","CreateZip","CreateCourtesyWithholding","CreateEffectiveDate","zipValidation","HomeAddressErrorCodes","startDateValidation","pendingFutureAddress","useMemo","getPendingFutureHomeAddress","addressForDeleteModal","a","changePendingPossessiveLabel","trimmed","chronologicalAsc","b","aDate","bDate","sortedHistory","address","historyEndDate","row","idx","nextStart","nextDate","normalizeToDate","endDate","addDays","y","m","d","formatDateLongWithYear","historyDataView","useDataView","Flex","formatStreetForDisplay","getCityStateZip","HamburgerMenu","PencilSvg","TrashCanSvg","EmptyData","HouseIcon","closeAddressModal","handleDeleteModalConfirm","addressModalSession","handleSave","submitResult","hasFieldErrors","modalPending","FlexItem","formatP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A6BxC,CAAqB;AAAA,cAAA;AAAA,cAE7D,YAAY;AAAA,gBACV,0BAAS5D,EAAW,MAAX,EAAgB,QAAO,UAAS,IAAG,OAAA,CAAO;AAAA,cAAA;AAAA,cAErD,UAAU,EAAE,eAAe,EAAE,aAAa,KAAM;AAAA,YAAE;AAAA,UAAA,IAElD,KAAA,CACN;AAAA,QAAA,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { WorkAddressView as m } from "./WorkAddressView.js";
|
|
3
3
|
import { useWorkAddressManagement as A, isUseWorkAddressManagementSuccess as g } from "./useWorkAddressManagement.js";
|
|
4
|
-
import { BaseBoundaries as
|
|
5
|
-
import { useI18n as
|
|
4
|
+
import { BaseBoundaries as c, BaseLayout as n } from "../../../Base/Base.js";
|
|
5
|
+
import { useI18n as k, useComponentDictionary as p } from "../../../../i18n/I18n.js";
|
|
6
6
|
import { componentEvents as t } from "../../../../shared/constants.js";
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
const e = A({ employeeId:
|
|
7
|
+
function W({ employeeId: d, dictionary: s, onEvent: o }) {
|
|
8
|
+
k(["Employee.WorkAddress.Management"]), p("Employee.WorkAddress.Management", s);
|
|
9
|
+
const e = A({ employeeId: d, onEvent: o });
|
|
10
10
|
if (e.isLoading)
|
|
11
11
|
return /* @__PURE__ */ r(n, { isLoading: !0, error: e.errorHandling.errors });
|
|
12
12
|
if (!g(e))
|
|
13
13
|
return /* @__PURE__ */ r(n, { error: e.errorHandling.errors });
|
|
14
14
|
const i = (a) => {
|
|
15
|
-
a.mode === "create" ?
|
|
15
|
+
a.mode === "create" ? o(t.EMPLOYEE_WORK_ADDRESS_CREATED, a.data) : o(t.EMPLOYEE_WORK_ADDRESS_UPDATED, a.data);
|
|
16
16
|
};
|
|
17
17
|
return /* @__PURE__ */ r(n, { error: e.errorHandling.errors, children: /* @__PURE__ */ r(
|
|
18
18
|
m,
|
|
@@ -25,20 +25,23 @@ function k({ employeeId: o, dictionary: d, onEvent: s }) {
|
|
|
25
25
|
employeeDisplayName: e.data.employeeDisplayName,
|
|
26
26
|
onConfirmDelete: e.actions.confirmDeleteWorkAddress,
|
|
27
27
|
onWorkAddressSaved: i,
|
|
28
|
+
onBack: () => {
|
|
29
|
+
o(t.CANCEL);
|
|
30
|
+
},
|
|
28
31
|
isDeletePending: e.status.isDeletePending
|
|
29
32
|
}
|
|
30
33
|
) });
|
|
31
34
|
}
|
|
32
35
|
function M({
|
|
33
|
-
FallbackComponent:
|
|
34
|
-
...
|
|
36
|
+
FallbackComponent: d,
|
|
37
|
+
...s
|
|
35
38
|
}) {
|
|
36
39
|
return /* @__PURE__ */ r(
|
|
37
|
-
|
|
40
|
+
c,
|
|
38
41
|
{
|
|
39
42
|
componentName: "Employee.WorkAddress.Management",
|
|
40
|
-
FallbackComponent:
|
|
41
|
-
children: /* @__PURE__ */ r(
|
|
43
|
+
FallbackComponent: d,
|
|
44
|
+
children: /* @__PURE__ */ r(W, { ...s })
|
|
42
45
|
}
|
|
43
46
|
);
|
|
44
47
|
}
|