@gusto/embedded-react-sdk 0.56.4 → 0.56.5

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.
Files changed (101) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/components/Common/DocumentEmbed/DocumentEmbed.js +18 -0
  3. package/dist/components/Common/DocumentEmbed/DocumentEmbed.js.map +1 -0
  4. package/dist/components/Common/DocumentViewer/DocumentViewer.js +35 -29
  5. package/dist/components/Common/DocumentViewer/DocumentViewer.js.map +1 -1
  6. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +6 -3
  7. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  8. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +6 -3
  9. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  10. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +8 -5
  11. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  12. package/dist/components/Company/BankAccount/BankAccountForm/context.js +6 -3
  13. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  14. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +6 -3
  15. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  16. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +11 -8
  17. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  18. package/dist/components/Company/Industry/Context.js +9 -6
  19. package/dist/components/Company/Industry/Context.js.map +1 -1
  20. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +6 -3
  21. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  22. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +6 -3
  23. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  24. package/dist/components/Company/OnboardingOverview/context.js +6 -3
  25. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  26. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +6 -3
  27. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  28. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +6 -3
  29. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  30. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +6 -3
  31. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
  32. package/dist/components/Contractor/ContractorList/management/ManagementContractorList.js +64 -61
  33. package/dist/components/Contractor/ContractorList/management/ManagementContractorList.js.map +1 -1
  34. package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js +133 -134
  35. package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js.map +1 -1
  36. package/dist/components/Contractor/ContractorListFlow/ContractorListFlow.js.map +1 -1
  37. package/dist/components/Contractor/ContractorListFlow/ContractorListFlowComponents.js +22 -9
  38. package/dist/components/Contractor/ContractorListFlow/ContractorListFlowComponents.js.map +1 -1
  39. package/dist/components/Contractor/ContractorListFlow/contractorListStateMachine.js +51 -20
  40. package/dist/components/Contractor/ContractorListFlow/contractorListStateMachine.js.map +1 -1
  41. package/dist/components/Contractor/Dismissal/Dismissal.js +77 -0
  42. package/dist/components/Contractor/Dismissal/Dismissal.js.map +1 -0
  43. package/dist/components/Contractor/Dismissal/DismissalPresentation.js +57 -0
  44. package/dist/components/Contractor/Dismissal/DismissalPresentation.js.map +1 -0
  45. package/dist/components/Contractor/Dismissal/useDismissal/useDismissal.js +44 -0
  46. package/dist/components/Contractor/Dismissal/useDismissal/useDismissal.js.map +1 -0
  47. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +45 -41
  48. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
  49. package/dist/components/Contractor/exports/contractorManagement.js +56 -54
  50. package/dist/components/Contractor/exports/contractorManagement.js.map +1 -1
  51. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +6 -3
  52. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  53. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +3 -2
  54. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  55. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +201 -196
  56. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  57. package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/fields.js +55 -52
  58. package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/fields.js.map +1 -1
  59. package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeSchema.js +38 -29
  60. package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeSchema.js.map +1 -1
  61. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +17 -14
  62. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
  63. package/dist/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.js +72 -68
  64. package/dist/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.js.map +1 -1
  65. package/dist/components/Payroll/usePreparedPayrollData.js +10 -7
  66. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  67. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  68. package/dist/i18n/I18n.js +1 -0
  69. package/dist/i18n/I18n.js.map +1 -1
  70. package/dist/i18n/en/Contractor.Dismissal.json.js +20 -0
  71. package/dist/i18n/en/Contractor.Dismissal.json.js.map +1 -0
  72. package/dist/i18n/en/Contractor.Payments.PaymentStatement.json.js +2 -2
  73. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +38 -38
  74. package/dist/i18n/en/Payroll.UNSTABLE_PayrollEditEmployee.json.js +31 -31
  75. package/dist/i18n/en/common.json.js +37 -35
  76. package/dist/i18n/en/common.json.js.map +1 -1
  77. package/dist/package.json.js +1 -1
  78. package/dist/shared/constants.js +1 -0
  79. package/dist/shared/constants.js.map +1 -1
  80. package/dist/src/components/Common/DocumentEmbed/DocumentEmbed.d.ts +3 -0
  81. package/dist/src/components/Common/DocumentEmbed/DocumentEmbedTypes.d.ts +25 -0
  82. package/dist/src/components/Common/DocumentEmbed/index.d.ts +2 -0
  83. package/dist/src/components/Contractor/ContractorList/management/ManagementContractorList.d.ts +2 -0
  84. package/dist/src/components/Contractor/ContractorList/management/ManagementContractorListView.d.ts +3 -1
  85. package/dist/src/components/Contractor/ContractorListFlow/ContractorListFlow.d.ts +6 -4
  86. package/dist/src/components/Contractor/ContractorListFlow/ContractorListFlowComponents.d.ts +2 -0
  87. package/dist/src/components/Contractor/ContractorListFlow/contractorListStateMachine.d.ts +1 -0
  88. package/dist/src/components/Contractor/ContractorListFlow/contractorListStateMachine.test.d.ts +1 -0
  89. package/dist/src/components/Contractor/Dismissal/Dismissal.d.ts +45 -0
  90. package/dist/src/components/Contractor/Dismissal/DismissalPresentation.d.ts +17 -0
  91. package/dist/src/components/Contractor/Dismissal/useDismissal/useDismissal.d.ts +41 -0
  92. package/dist/src/components/Contractor/Dismissal/useDismissal/useDismissal.test.d.ts +1 -0
  93. package/dist/src/components/Contractor/exports/contractorManagement.d.ts +1 -0
  94. package/dist/src/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeSchema.d.ts +19 -0
  95. package/dist/src/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
  96. package/dist/src/contexts/ComponentAdapter/useComponentContext.d.ts +5 -2
  97. package/dist/src/i18n/en/common.json.d.ts +3 -0
  98. package/dist/src/i18n/types.d.ts +47 -0
  99. package/dist/src/shared/constants.d.ts +2 -0
  100. package/docs/guides/endpoint-inventory.json +18 -0
  101. package/package.json +1 -1
@@ -1,192 +1,194 @@
1
- import { jsx as t, jsxs as a } from "react/jsx-runtime";
2
- import { useForm as ne, useFieldArray as Me, useWatch as Oe, FormProvider as te } from "react-hook-form";
3
- import { useRef as ve, useMemo as V, useState as Re } from "react";
4
- import xe from "classnames";
5
- import { PayrollEmployeeCompensationsTypePaymentMethod as M } from "@gusto/embedded-api/models/components/payrollemployeecompensationstype";
6
- import { useTranslation as Se } from "react-i18next";
1
+ import { jsx as t, jsxs as m } from "react/jsx-runtime";
2
+ import { useForm as ne, useFieldArray as Oe, useWatch as Re, FormProvider as te } from "react-hook-form";
3
+ import { useRef as xe, useMemo as B, useState as Se } from "react";
4
+ import Fe from "classnames";
5
+ import { PayrollEmployeeCompensationsTypePaymentMethod as P } from "@gusto/embedded-api/models/components/payrollemployeecompensationstype";
6
+ import { useTranslation as Ie } from "react-i18next";
7
7
  import { z as s } from "zod";
8
8
  import { zodResolver as ie } from "@hookform/resolvers/zod";
9
9
  import c from "./PayrollEditEmployeePresentation.module.scss.js";
10
- import { TimeOffField as Ie, PayoutTimeOffField as Fe } from "./TimeOffField.js";
11
- import { Flex as P } from "../../Common/Flex/Flex.js";
10
+ import { TimeOffField as _e, PayoutTimeOffField as De } from "./TimeOffField.js";
11
+ import { Flex as E } from "../../Common/Flex/Flex.js";
12
12
  import { Grid as x } from "../../Common/Grid/Grid.js";
13
- import { EmptyData as De } from "../../Common/EmptyData/EmptyData.js";
14
- import { useComponentContext as _e } from "../../../contexts/ComponentAdapter/useComponentContext.js";
15
- import { useI18n as Le } from "../../../i18n/I18n.js";
16
- import { Form as ke } from "../../Common/Form/Form.js";
17
- import { formatNumberAsCurrency as re, firstLastName as Ue, stripLeadingZeros as k } from "../../../helpers/formattedStrings.js";
18
- import { getAdditionalEarningsCompensations as je, calculateGrossPay as se } from "../helpers.js";
19
- import { PayrollCategory as F, isOffCyclePayroll as ue } from "../payrollTypes.js";
20
- import { COMPENSATION_NAME_REIMBURSEMENT as S, HOURS_COMPENSATION_NAMES as oe, EXCLUDED_ADDITIONAL_EARNINGS as Ge, COMPENSATION_NAME_DOUBLE_OVERTIME as He, COMPENSATION_NAME_OVERTIME as we, COMPENSATION_NAME_REGULAR_HOURS as $e, COMPENSATION_NAME_CASH_TIPS as Ve, COMPENSATION_NAME_COMMISSION as Be, COMPENSATION_NAME_CORRECTION_PAYMENT as ze, COMPENSATION_NAME_PAYCHECK_TIPS as We, COMPENSATION_NAME_BONUS as qe } from "../../../shared/constants.js";
21
- import Ye from "../../../hooks/useContainerBreakpoints/useContainerBreakpoints.js";
22
- import ae from "../../../assets/icons/plus-circle.svg.js";
23
- import Ke from "../../../assets/icons/trashcan.svg.js";
24
- import { TextInputField as I } from "../../Common/Fields/TextInputField/TextInputField.js";
25
- import { RadioGroupField as Xe } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
26
- import { useDataView as Ze } from "../../Common/DataView/useDataView.js";
27
- import { DataView as Qe } from "../../Common/DataView/DataView.js";
28
- const Je = s.object({
13
+ import { EmptyData as Le } from "../../Common/EmptyData/EmptyData.js";
14
+ import { useComponentContext as Ue } from "../../../contexts/ComponentAdapter/useComponentContext.js";
15
+ import { useI18n as ke } from "../../../i18n/I18n.js";
16
+ import { Form as je } from "../../Common/Form/Form.js";
17
+ import { formatNumberAsCurrency as re, firstLastName as He, stripLeadingZeros as k } from "../../../helpers/formattedStrings.js";
18
+ import { getAdditionalEarningsCompensations as Ge, calculateGrossPay as se } from "../helpers.js";
19
+ import { PayrollCategory as I, isOffCyclePayroll as ue } from "../payrollTypes.js";
20
+ import { COMPENSATION_NAME_REIMBURSEMENT as S, HOURS_COMPENSATION_NAMES as ae, EXCLUDED_ADDITIONAL_EARNINGS as we, COMPENSATION_NAME_DOUBLE_OVERTIME as $e, COMPENSATION_NAME_OVERTIME as Be, COMPENSATION_NAME_REGULAR_HOURS as Ve, COMPENSATION_NAME_CASH_TIPS as ze, COMPENSATION_NAME_COMMISSION as We, COMPENSATION_NAME_CORRECTION_PAYMENT as Xe, COMPENSATION_NAME_PAYCHECK_TIPS as qe, COMPENSATION_NAME_BONUS as Ye } from "../../../shared/constants.js";
21
+ import Ke from "../../../hooks/useContainerBreakpoints/useContainerBreakpoints.js";
22
+ import oe from "../../../assets/icons/plus-circle.svg.js";
23
+ import Ze from "../../../assets/icons/trashcan.svg.js";
24
+ import { TextInputField as F } from "../../Common/Fields/TextInputField/TextInputField.js";
25
+ import { RadioGroupField as Qe } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
26
+ import { useDataView as Je } from "../../Common/DataView/useDataView.js";
27
+ import { DataView as en } from "../../Common/DataView/DataView.js";
28
+ const nn = s.object({
29
29
  uuid: s.string().nullable().optional(),
30
30
  description: s.string(),
31
31
  amount: s.string(),
32
32
  recurring: s.boolean().optional()
33
- }), en = s.object({
33
+ }), le = 1e6, tn = s.object({
34
34
  description: s.string(),
35
35
  amount: s.string().refine(
36
- (l) => {
37
- const C = parseFloat(l);
36
+ (a) => {
37
+ const C = parseFloat(a);
38
38
  return !Number.isNaN(C) && C > 0;
39
39
  },
40
40
  { message: "validations.reimbursementAmount" }
41
- )
42
- }), nn = s.string().optional().refine((l) => !l || parseFloat(l) >= 0, { message: "validations.negativeAmount" }), tn = s.object({
43
- hourlyCompensations: s.record(s.string(), s.record(s.string(), s.string().optional())),
41
+ ).refine((a) => parseFloat(a) <= le, {
42
+ message: "validations.maxReimbursementAmount"
43
+ })
44
+ }), rn = s.string().optional().refine((a) => !a || parseFloat(a) >= 0, { message: "validations.negativeAmount" }), de = 99999, sn = s.string().optional().refine((a) => !a || parseFloat(a) <= de, { message: "validations.maxHours" }), an = s.object({
45
+ hourlyCompensations: s.record(s.string(), s.record(s.string(), sn)),
44
46
  timeOffCompensations: s.record(s.string(), s.string().optional()),
45
47
  finalPayoutCompensations: s.record(s.string(), s.string().optional()),
46
- fixedCompensations: s.record(s.string(), nn),
47
- reimbursements: s.array(Je),
48
- paymentMethod: s.enum(M).optional()
49
- }), me = (l, C, U, p, o = F.Regular) => {
48
+ fixedCompensations: s.record(s.string(), rn),
49
+ reimbursements: s.array(nn),
50
+ paymentMethod: s.enum(P).optional()
51
+ }), me = (a, C, j, p, o = I.Regular) => {
50
52
  const y = {
51
53
  ...C,
52
- paymentMethod: l.paymentMethod
54
+ paymentMethod: a.paymentMethod
53
55
  };
54
56
  y.hourlyCompensations = C?.hourlyCompensations?.map(
55
57
  (r) => {
56
- const m = r.jobUuid && r.name ? l.hourlyCompensations[r.jobUuid]?.[r.name] : void 0;
57
- return m ? {
58
+ const u = r.jobUuid && r.name ? a.hourlyCompensations[r.jobUuid]?.[r.name] : void 0;
59
+ return u ? {
58
60
  ...r,
59
- hours: m
61
+ hours: u
60
62
  } : r;
61
63
  }
62
- ), y.paidTimeOff = U.map((r) => {
63
- const m = o === F.Dismissal, { finalPayoutUnusedHoursInput: O, ...h } = r;
64
- if (m) {
65
- const u = l.finalPayoutCompensations[r.name] ?? r.finalPayoutUnusedHoursInput;
64
+ ), y.paidTimeOff = j.map((r) => {
65
+ const u = o === I.Dismissal, { finalPayoutUnusedHoursInput: v, ...h } = r;
66
+ if (u) {
67
+ const l = a.finalPayoutCompensations[r.name] ?? r.finalPayoutUnusedHoursInput;
66
68
  return {
67
69
  ...r,
68
- hours: l.timeOffCompensations[r.name] || "0",
69
- ...u != null ? { finalPayoutUnusedHoursInput: u || "0" } : {}
70
+ hours: a.timeOffCompensations[r.name] || "0",
71
+ ...l != null ? { finalPayoutUnusedHoursInput: l || "0" } : {}
70
72
  };
71
73
  }
72
74
  return {
73
75
  ...h,
74
- hours: l.timeOffCompensations[r.name] || "0"
76
+ hours: a.timeOffCompensations[r.name] || "0"
75
77
  };
76
78
  });
77
- const D = !ue(o), T = [];
78
- return Object.entries(l.fixedCompensations).forEach(([r, m]) => {
79
- if (r.toLowerCase() === S.toLowerCase() && D)
79
+ const _ = !ue(o), M = [];
80
+ return Object.entries(a.fixedCompensations).forEach(([r, u]) => {
81
+ if (r.toLowerCase() === S.toLowerCase() && _)
80
82
  return;
81
83
  const h = C?.fixedCompensations?.find(
82
- (j) => j.name?.toLowerCase() === r.toLowerCase()
83
- ), u = m === "" && h ? "0" : m;
84
- u !== void 0 && u !== "" && (h ? T.push({
84
+ (H) => H.name?.toLowerCase() === r.toLowerCase()
85
+ ), l = u === "" && h ? "0" : u;
86
+ l !== void 0 && l !== "" && (h ? M.push({
85
87
  name: h.name,
86
88
  jobUuid: h.jobUuid,
87
- amount: u
88
- }) : parseFloat(u) !== 0 && T.push({
89
+ amount: l
90
+ }) : parseFloat(l) !== 0 && M.push({
89
91
  name: r,
90
92
  jobUuid: p,
91
- amount: u
93
+ amount: l
92
94
  }));
93
- }), y.fixedCompensations = T, D ? y.reimbursements = l.reimbursements.map((r) => ({
95
+ }), y.fixedCompensations = M, _ ? y.reimbursements = a.reimbursements.map((r) => ({
94
96
  amount: r.amount,
95
97
  description: r.description.trim() === "" ? null : r.description.trim(),
96
98
  uuid: r.uuid ?? null,
97
99
  recurring: r.recurring
98
100
  })) : y.reimbursements = [], y;
99
- }, Fn = ({
100
- className: l,
101
+ }, Ln = ({
102
+ className: a,
101
103
  onSave: C,
102
- onCancel: U,
104
+ onCancel: j,
103
105
  employee: p,
104
106
  employeeCompensation: o,
105
107
  isPending: y = !1,
106
- fixedCompensationTypes: D,
107
- payPeriodStartDate: T,
108
+ fixedCompensationTypes: _,
109
+ payPeriodStartDate: M,
108
110
  paySchedule: r,
109
- payrollCategory: m = F.Regular,
110
- withReimbursements: O = !0,
111
+ payrollCategory: u = I.Regular,
112
+ withReimbursements: v = !0,
111
113
  hasDirectDepositSetup: h = !0
112
114
  }) => {
113
- const { Button: u, ButtonIcon: j, Heading: f, Text: B } = _e(), { t: n } = Se("Payroll.PayrollEditEmployee");
114
- Le("Payroll.PayrollEditEmployee");
115
- const b = p.jobs?.find((e) => e.primary), le = o?.hourlyCompensations?.some(
115
+ const { Button: l, ButtonIcon: H, Heading: f, Text: V } = Ue(), { t: n } = Ie("Payroll.PayrollEditEmployee");
116
+ ke("Payroll.PayrollEditEmployee");
117
+ const b = p.jobs?.find((e) => e.primary), ce = o?.hourlyCompensations?.some(
116
118
  (e) => e.jobUuid === b?.uuid
117
- ), v = b && le ? [b] : [], z = ve(null), g = Ye({
119
+ ), O = b && ce ? [b] : [], z = xe(null), g = Ke({
118
120
  ref: z
119
121
  }).includes("small");
120
122
  o?.hourlyCompensations?.forEach((e) => {
121
123
  const i = p.jobs?.find((d) => d.uuid === e.jobUuid);
122
- i && !v.find((d) => d.uuid === i.uuid) && v.push(i);
124
+ i && !O.find((d) => d.uuid === i.uuid) && O.push(i);
123
125
  });
124
- const A = (o?.paidTimeOff || []).filter((e) => e.name), G = je({
126
+ const T = (o?.paidTimeOff || []).filter((e) => e.name), G = Ge({
125
127
  flsaStatus: b?.compensations?.[0]?.flsaStatus,
126
128
  existingFixedCompensations: o?.fixedCompensations || [],
127
129
  primaryJobUuid: b?.uuid,
128
- fixedCompensationTypes: D,
129
- excludedTypes: Ge
130
- }), _ = !ue(m), de = V(
131
- () => O && _ ? o?.reimbursements ?? [] : [],
132
- [O, _, o?.reimbursements]
133
- ), ce = V(
130
+ fixedCompensationTypes: _,
131
+ excludedTypes: we
132
+ }), D = !ue(u), pe = B(
133
+ () => v && D ? o?.reimbursements ?? [] : [],
134
+ [v, D, o?.reimbursements]
135
+ ), fe = B(
134
136
  () => o?.fixedCompensations?.find(
135
137
  (e) => e.name?.toLowerCase() === S.toLowerCase()
136
138
  ),
137
139
  [o?.fixedCompensations]
138
- ), W = O && !_ && !!b?.uuid, q = (e, i) => o?.hourlyCompensations?.find(
140
+ ), W = v && !D && !!b?.uuid, X = (e, i) => o?.hourlyCompensations?.find(
139
141
  (d) => d.jobUuid === e && d.name?.toLowerCase() === i.toLowerCase()
140
- ), pe = (e) => {
142
+ ), he = (e) => {
141
143
  switch (e) {
142
- case $e:
144
+ case Ve:
143
145
  return n("compensationNames.regularHours");
144
- case we:
146
+ case Be:
145
147
  return n("compensationNames.overtime");
146
- case He:
148
+ case $e:
147
149
  return n("compensationNames.doubleOvertime");
148
150
  default:
149
151
  return e;
150
152
  }
151
- }, Y = (e) => {
153
+ }, q = (e) => {
152
154
  switch (e) {
153
- case qe:
155
+ case Ye:
154
156
  return n("fixedCompensationNames.bonus");
155
- case We:
157
+ case qe:
156
158
  return n("fixedCompensationNames.paycheckTips");
157
- case ze:
159
+ case Xe:
158
160
  return n("fixedCompensationNames.correctionPayment");
159
- case Be:
161
+ case We:
160
162
  return n("fixedCompensationNames.commission");
161
- case Ve:
163
+ case ze:
162
164
  return n("fixedCompensationNames.cashTips");
163
165
  case S:
164
166
  return n("fixedCompensationNames.reimbursement");
165
167
  default:
166
168
  return e;
167
169
  }
168
- }, fe = () => {
170
+ }, be = () => {
169
171
  const e = o?.paymentMethod;
170
- return e ? !h && e === M.DirectDeposit ? M.Check : e : h ? M.DirectDeposit : M.Check;
171
- }, he = {
172
+ return e ? !h && e === P.DirectDeposit ? P.Check : e : h ? P.DirectDeposit : P.Check;
173
+ }, ge = {
172
174
  hourlyCompensations: (() => {
173
175
  const e = {};
174
- return v.forEach((i) => {
175
- oe.forEach((d) => {
176
- const R = q(i.uuid, d);
176
+ return O.forEach((i) => {
177
+ ae.forEach((d) => {
178
+ const R = X(i.uuid, d);
177
179
  R && (e[i.uuid] || (e[i.uuid] = {}), e[i.uuid][R.name] = R.hours ? parseFloat(R.hours).toString() : "");
178
180
  });
179
181
  }), e;
180
182
  })(),
181
183
  timeOffCompensations: (() => {
182
184
  const e = {};
183
- return A.forEach((i) => {
185
+ return T.forEach((i) => {
184
186
  e[i.name] = i.hours ? parseFloat(i.hours).toString() : "";
185
187
  }), e;
186
188
  })(),
187
189
  finalPayoutCompensations: (() => {
188
190
  const e = {};
189
- return A.forEach((i) => {
191
+ return T.forEach((i) => {
190
192
  e[i.name] = i.finalPayoutUnusedHoursInput ?? "0";
191
193
  }), e;
192
194
  })(),
@@ -194,44 +196,44 @@ const Je = s.object({
194
196
  const e = {};
195
197
  return G.forEach((i) => {
196
198
  e[i.name] = i.amount ?? "";
197
- }), W && (e[S] = ce?.amount ?? "0.00"), e;
199
+ }), W && (e[S] = fe?.amount ?? "0.00"), e;
198
200
  })(),
199
- reimbursements: de.map((e) => ({
201
+ reimbursements: pe.map((e) => ({
200
202
  uuid: e.uuid ?? null,
201
203
  description: e.description ?? "",
202
204
  amount: e.amount,
203
205
  recurring: e.recurring ?? !1
204
206
  })),
205
- paymentMethod: fe()
207
+ paymentMethod: be()
206
208
  }, L = ne({
207
- resolver: ie(tn),
208
- defaultValues: he
209
+ resolver: ie(an),
210
+ defaultValues: ge
209
211
  }), {
210
- fields: K,
211
- append: be,
212
- remove: ge,
213
- update: Ce
214
- } = Me({
212
+ fields: Y,
213
+ append: Ce,
214
+ remove: ye,
215
+ update: Ne
216
+ } = Oe({
215
217
  control: L.control,
216
218
  name: "reimbursements"
217
- }), ye = (e) => {
218
- const i = K[e];
219
- i && (i.uuid ? Ce(e, { ...i, amount: "0" }) : ge(e));
220
- }, H = K.map((e, i) => ({ ...e, originalIndex: i })).filter((e) => parseFloat(e.amount || "0") !== 0), [X, w] = Re(!1), $ = ne({
221
- resolver: ie(en),
219
+ }), Ae = (e) => {
220
+ const i = Y[e];
221
+ i && (i.uuid ? Ne(e, { ...i, amount: "0" }) : ye(e));
222
+ }, w = Y.map((e, i) => ({ ...e, originalIndex: i })).filter((e) => parseFloat(e.amount || "0") !== 0), [K, $] = Se(!1), U = ne({
223
+ resolver: ie(tn),
222
224
  defaultValues: { description: "", amount: "" }
223
225
  }), Z = () => {
224
- w(!1), $.reset();
225
- }, Ne = (e) => {
226
+ $(!1), U.reset();
227
+ }, Ee = (e) => {
226
228
  const i = parseFloat(e.amount);
227
- be({
229
+ Ce({
228
230
  uuid: null,
229
231
  description: e.description.trim(),
230
232
  amount: i.toFixed(2),
231
233
  recurring: !1
232
234
  }), Z();
233
- }, Ee = Ze({
234
- data: H,
235
+ }, Me = Je({
236
+ data: w,
235
237
  columns: [
236
238
  {
237
239
  key: "description",
@@ -254,41 +256,41 @@ const Je = s.object({
254
256
  if (e.recurring) return null;
255
257
  const i = e.description.trim() || n("reimbursementUnnamedFallback");
256
258
  return /* @__PURE__ */ t(
257
- j,
259
+ H,
258
260
  {
259
261
  variant: "tertiary",
260
262
  onClick: () => {
261
- ye(e.originalIndex);
263
+ Ae(e.originalIndex);
262
264
  },
263
265
  "aria-label": n("removeReimbursementLabel", { description: i }),
264
- children: /* @__PURE__ */ t(Ke, { "aria-hidden": !0 })
266
+ children: /* @__PURE__ */ t(Ze, { "aria-hidden": !0 })
265
267
  }
266
268
  );
267
269
  },
268
- emptyState: () => /* @__PURE__ */ t(De, { title: n("reimbursementEmptyTitle"), children: /* @__PURE__ */ t(
269
- u,
270
+ emptyState: () => /* @__PURE__ */ t(Le, { title: n("reimbursementEmptyTitle"), children: /* @__PURE__ */ t(
271
+ l,
270
272
  {
271
273
  variant: "secondary",
272
274
  onClick: () => {
273
- w(!0);
275
+ $(!0);
274
276
  },
275
- icon: /* @__PURE__ */ t(ae, { "aria-hidden": !0 }),
277
+ icon: /* @__PURE__ */ t(oe, { "aria-hidden": !0 }),
276
278
  children: n("addReimbursementCta")
277
279
  }
278
280
  ) })
279
- }), N = Oe({
281
+ }), N = Re({
280
282
  control: L.control
281
- }), Pe = V(() => {
283
+ }), Te = B(() => {
282
284
  try {
283
285
  const e = {};
284
- N.hourlyCompensations && Object.entries(N.hourlyCompensations).forEach(([E, ee]) => {
285
- ee && (e[E] = ee);
286
+ N.hourlyCompensations && Object.entries(N.hourlyCompensations).forEach(([A, ee]) => {
287
+ ee && (e[A] = ee);
286
288
  });
287
- const i = (N.reimbursements ?? []).map((E) => ({
288
- uuid: E.uuid ?? null,
289
- description: E.description ?? "",
290
- amount: E.amount ?? "0",
291
- recurring: E.recurring
289
+ const i = (N.reimbursements ?? []).map((A) => ({
290
+ uuid: A.uuid ?? null,
291
+ description: A.description ?? "",
292
+ amount: A.amount ?? "0",
293
+ recurring: A.recurring
292
294
  })), d = {
293
295
  hourlyCompensations: e,
294
296
  timeOffCompensations: N.timeOffCompensations || {},
@@ -299,24 +301,24 @@ const Je = s.object({
299
301
  }, R = me(
300
302
  d,
301
303
  o,
302
- (o?.paidTimeOff || []).filter((E) => E.name),
304
+ (o?.paidTimeOff || []).filter((A) => A.name),
303
305
  b?.uuid,
304
- m
306
+ u
305
307
  );
306
308
  return se(
307
309
  R,
308
310
  p,
309
- T,
311
+ M,
310
312
  r,
311
- m
313
+ u
312
314
  );
313
315
  } catch {
314
316
  return o ? se(
315
317
  o,
316
318
  p,
317
- T,
319
+ M,
318
320
  r,
319
- m
321
+ u
320
322
  ) : 0;
321
323
  }
322
324
  }, [
@@ -324,34 +326,34 @@ const Je = s.object({
324
326
  o,
325
327
  b?.uuid,
326
328
  p,
327
- T,
329
+ M,
328
330
  r,
329
- m
330
- ]), Te = Ue({
331
+ u
332
+ ]), Pe = He({
331
333
  first_name: p.firstName,
332
334
  last_name: p.lastName
333
- }), Ae = (e) => {
335
+ }), ve = (e) => {
334
336
  const i = me(
335
337
  e,
336
338
  o,
337
- A,
339
+ T,
338
340
  b?.uuid,
339
- m
341
+ u
340
342
  );
341
343
  C(i);
342
- }, Q = re(Pe || 0), J = /* @__PURE__ */ a(
343
- P,
344
+ }, Q = re(Te || 0), J = /* @__PURE__ */ m(
345
+ E,
344
346
  {
345
347
  flexDirection: g ? "row" : "column",
346
348
  justifyContent: g ? "flex-end" : "normal",
347
349
  alignItems: g ? "flex-start" : "stretch",
348
350
  gap: 12,
349
351
  children: [
350
- /* @__PURE__ */ t(u, { variant: "secondary", onClick: U, title: n("cancelCta"), children: n("cancelCta") }),
352
+ /* @__PURE__ */ t(l, { variant: "secondary", onClick: j, title: n("cancelCta"), children: n("cancelCta") }),
351
353
  /* @__PURE__ */ t(
352
- u,
354
+ l,
353
355
  {
354
- onClick: L.handleSubmit(Ae),
356
+ onClick: L.handleSubmit(ve),
355
357
  title: n("saveCta"),
356
358
  isLoading: y,
357
359
  children: n("saveCta")
@@ -360,54 +362,56 @@ const Je = s.object({
360
362
  ]
361
363
  }
362
364
  );
363
- return /* @__PURE__ */ a("div", { ref: z, className: xe(c.container, l), children: [
365
+ return /* @__PURE__ */ m("div", { ref: z, className: Fe(c.container, a), children: [
364
366
  /* @__PURE__ */ t(
365
367
  "div",
366
368
  {
367
369
  className: `${c.headerSection} ${g ? "" : c.headerSectionSticky}`,
368
- children: /* @__PURE__ */ a(P, { justifyContent: "space-between", children: [
369
- /* @__PURE__ */ a(P, { flexDirection: "column", alignItems: "stretch", gap: g ? 8 : 2, children: [
370
- /* @__PURE__ */ t(f, { as: "h1", styledAs: g ? "h2" : "h4", children: n("pageTitle", { employeeName: Te }) }),
371
- g ? /* @__PURE__ */ a(P, { flexDirection: "column", gap: 6, children: [
370
+ children: /* @__PURE__ */ m(E, { justifyContent: "space-between", children: [
371
+ /* @__PURE__ */ m(E, { flexDirection: "column", alignItems: "stretch", gap: g ? 8 : 2, children: [
372
+ /* @__PURE__ */ t(f, { as: "h1", styledAs: g ? "h2" : "h4", children: n("pageTitle", { employeeName: Pe }) }),
373
+ g ? /* @__PURE__ */ m(E, { flexDirection: "column", gap: 6, children: [
372
374
  /* @__PURE__ */ t(f, { as: "h2", styledAs: "h3", children: Q }),
373
- /* @__PURE__ */ t(B, { className: c.grossPayLabel, children: n("grossPayLabel") })
375
+ /* @__PURE__ */ t(V, { className: c.grossPayLabel, children: n("grossPayLabel") })
374
376
  ] }) : /* @__PURE__ */ t(f, { as: "h2", styledAs: "h6", className: c.grossPayLabel, children: n("grossPayLabelMobile", { grossPay: Q }) })
375
377
  ] }),
376
378
  g && J
377
379
  ] })
378
380
  }
379
381
  ),
380
- /* @__PURE__ */ a(te, { ...L, children: [
381
- /* @__PURE__ */ a(ke, { children: [
382
- v.length > 0 && /* @__PURE__ */ a("div", { className: c.fieldGroup, children: [
382
+ /* @__PURE__ */ m(te, { ...L, children: [
383
+ /* @__PURE__ */ m(je, { children: [
384
+ O.length > 0 && /* @__PURE__ */ m("div", { className: c.fieldGroup, children: [
383
385
  /* @__PURE__ */ t(f, { as: "h3", children: n("regularHoursTitle") }),
384
- v.map((e) => /* @__PURE__ */ a(P, { flexDirection: "column", gap: 8, children: [
385
- v.length > 1 && /* @__PURE__ */ t(f, { as: "h4", children: e.title }),
386
- /* @__PURE__ */ t(x, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: oe.map((i) => {
387
- const d = q(
386
+ O.map((e) => /* @__PURE__ */ m(E, { flexDirection: "column", gap: 8, children: [
387
+ O.length > 1 && /* @__PURE__ */ t(f, { as: "h4", children: e.title }),
388
+ /* @__PURE__ */ t(x, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: ae.map((i) => {
389
+ const d = X(
388
390
  e.uuid,
389
391
  i
390
392
  );
391
393
  if (d)
392
394
  return /* @__PURE__ */ t(
393
- I,
395
+ F,
394
396
  {
395
397
  type: "number",
396
398
  min: 0,
399
+ max: de,
397
400
  transform: k,
398
401
  adornmentEnd: n("hoursUnit"),
399
- label: pe(i),
400
- name: `hourlyCompensations.${e.uuid}.${d.name}`
402
+ label: he(i),
403
+ name: `hourlyCompensations.${e.uuid}.${d.name}`,
404
+ errorMessage: n("validations.maxHours")
401
405
  },
402
406
  i
403
407
  );
404
408
  }) })
405
409
  ] }, e.uuid))
406
410
  ] }),
407
- A.length > 0 && /* @__PURE__ */ a("div", { className: c.fieldGroup, children: [
408
- /* @__PURE__ */ t(f, { as: "h3", styledAs: "h4", children: m === F.Dismissal ? n("timeOffTitleDismissal") : n("timeOffTitle") }),
409
- /* @__PURE__ */ t(x, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: A.map((e) => /* @__PURE__ */ t(
410
- Ie,
411
+ T.length > 0 && /* @__PURE__ */ m("div", { className: c.fieldGroup, children: [
412
+ /* @__PURE__ */ t(f, { as: "h3", styledAs: "h4", children: u === I.Dismissal ? n("timeOffTitleDismissal") : n("timeOffTitle") }),
413
+ /* @__PURE__ */ t(x, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: T.map((e) => /* @__PURE__ */ t(
414
+ _e,
411
415
  {
412
416
  timeOff: e,
413
417
  employee: p
@@ -415,13 +419,13 @@ const Je = s.object({
415
419
  e.name
416
420
  )) })
417
421
  ] }),
418
- m === F.Dismissal && A.length > 0 && /* @__PURE__ */ a("div", { className: c.fieldGroup, children: [
419
- /* @__PURE__ */ a(P, { flexDirection: "column", gap: 4, children: [
422
+ u === I.Dismissal && T.length > 0 && /* @__PURE__ */ m("div", { className: c.fieldGroup, children: [
423
+ /* @__PURE__ */ m(E, { flexDirection: "column", gap: 4, children: [
420
424
  /* @__PURE__ */ t(f, { as: "h3", styledAs: "h4", children: n("finalPayoutTitle") }),
421
- /* @__PURE__ */ t(B, { variant: "supporting", children: n("finalPayoutDescription") })
425
+ /* @__PURE__ */ t(V, { variant: "supporting", children: n("finalPayoutDescription") })
422
426
  ] }),
423
- /* @__PURE__ */ t(x, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: A.map((e) => /* @__PURE__ */ t(
424
- Fe,
427
+ /* @__PURE__ */ t(x, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: T.map((e) => /* @__PURE__ */ t(
428
+ De,
425
429
  {
426
430
  timeOff: e,
427
431
  employee: p
@@ -429,7 +433,7 @@ const Je = s.object({
429
433
  `payout-${e.name}`
430
434
  )) })
431
435
  ] }),
432
- G.length > 0 && /* @__PURE__ */ a("div", { className: c.fieldGroup, children: [
436
+ G.length > 0 && /* @__PURE__ */ m("div", { className: c.fieldGroup, children: [
433
437
  /* @__PURE__ */ t(f, { as: "h3", styledAs: "h4", children: n("additionalEarningsTitle") }),
434
438
  /* @__PURE__ */ t(
435
439
  x,
@@ -437,13 +441,13 @@ const Je = s.object({
437
441
  gridTemplateColumns: { base: "1fr", small: [320, 320], large: [320, 320, 320] },
438
442
  gap: 20,
439
443
  children: G.map((e) => /* @__PURE__ */ t(
440
- I,
444
+ F,
441
445
  {
442
446
  type: "number",
443
447
  min: 0,
444
448
  transform: k,
445
449
  adornmentStart: "$",
446
- label: Y(e.name),
450
+ label: q(e.name),
447
451
  name: `fixedCompensations.${e.name}`,
448
452
  errorMessage: n("validations.negativeAmount")
449
453
  },
@@ -452,28 +456,28 @@ const Je = s.object({
452
456
  }
453
457
  )
454
458
  ] }),
455
- W && /* @__PURE__ */ a("div", { className: c.fieldGroup, children: [
459
+ W && /* @__PURE__ */ m("div", { className: c.fieldGroup, children: [
456
460
  /* @__PURE__ */ t(f, { as: "h3", styledAs: "h4", children: n("reimbursementTitle") }),
457
461
  /* @__PURE__ */ t(x, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: /* @__PURE__ */ t(
458
- I,
462
+ F,
459
463
  {
460
464
  type: "number",
461
465
  min: 0,
462
466
  transform: k,
463
467
  adornmentStart: "$",
464
- label: Y(S),
468
+ label: q(S),
465
469
  name: `fixedCompensations.${S}`,
466
470
  errorMessage: n("validations.negativeAmount")
467
471
  }
468
472
  ) })
469
473
  ] }),
470
- O && _ && /* @__PURE__ */ a("div", { className: c.fieldGroup, children: [
474
+ v && D && /* @__PURE__ */ m("div", { className: c.fieldGroup, children: [
471
475
  /* @__PURE__ */ t(f, { as: "h3", styledAs: "h4", children: n("reimbursementTitle") }),
472
- !(H.length === 0 && X) && /* @__PURE__ */ t(Qe, { label: n("reimbursementsTableLabel"), ...Ee }),
473
- X ? /* @__PURE__ */ t(te, { ...$, children: /* @__PURE__ */ a(P, { flexDirection: "column", gap: 12, children: [
474
- /* @__PURE__ */ a(x, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: [
476
+ !(w.length === 0 && K) && /* @__PURE__ */ t(en, { label: n("reimbursementsTableLabel"), ...Me }),
477
+ K ? /* @__PURE__ */ t(te, { ...U, children: /* @__PURE__ */ m(E, { flexDirection: "column", gap: 12, children: [
478
+ /* @__PURE__ */ m(x, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: [
475
479
  /* @__PURE__ */ t(
476
- I,
480
+ F,
477
481
  {
478
482
  name: "description",
479
483
  label: n("reimbursementDescriptionLabel"),
@@ -481,40 +485,41 @@ const Je = s.object({
481
485
  }
482
486
  ),
483
487
  /* @__PURE__ */ t(
484
- I,
488
+ F,
485
489
  {
486
490
  name: "amount",
487
491
  type: "number",
488
492
  min: 0,
493
+ max: le,
489
494
  transform: k,
490
495
  adornmentStart: "$",
491
496
  isRequired: !0,
492
497
  label: n("reimbursementAmountLabel"),
493
- errorMessage: n("validations.reimbursementAmount")
498
+ errorMessage: U.formState.errors.amount?.message === "validations.maxReimbursementAmount" ? n("validations.maxReimbursementAmount") : n("validations.reimbursementAmount")
494
499
  }
495
500
  )
496
501
  ] }),
497
- /* @__PURE__ */ a(P, { gap: 12, children: [
498
- /* @__PURE__ */ t(u, { onClick: $.handleSubmit(Ne), children: n("saveReimbursementCta") }),
499
- /* @__PURE__ */ t(u, { variant: "secondary", onClick: Z, children: n("cancelReimbursementCta") })
502
+ /* @__PURE__ */ m(E, { gap: 12, children: [
503
+ /* @__PURE__ */ t(l, { onClick: U.handleSubmit(Ee), children: n("saveReimbursementCta") }),
504
+ /* @__PURE__ */ t(l, { variant: "secondary", onClick: Z, children: n("cancelReimbursementCta") })
500
505
  ] })
501
- ] }) }) : H.length > 0 && /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
502
- u,
506
+ ] }) }) : w.length > 0 && /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
507
+ l,
503
508
  {
504
509
  variant: "secondary",
505
510
  onClick: () => {
506
- w(!0);
511
+ $(!0);
507
512
  },
508
513
  title: n("addReimbursementLink"),
509
- icon: /* @__PURE__ */ t(ae, { "aria-hidden": !0 }),
514
+ icon: /* @__PURE__ */ t(oe, { "aria-hidden": !0 }),
510
515
  children: n("addReimbursementLink")
511
516
  }
512
517
  ) })
513
518
  ] }),
514
- h && /* @__PURE__ */ a("div", { className: c.fieldGroup, children: [
519
+ h && /* @__PURE__ */ m("div", { className: c.fieldGroup, children: [
515
520
  /* @__PURE__ */ t(f, { as: "h3", styledAs: "h4", children: n("paymentMethodTitle") }),
516
521
  /* @__PURE__ */ t(
517
- Xe,
522
+ Qe,
518
523
  {
519
524
  name: "paymentMethod",
520
525
  isRequired: !0,
@@ -522,11 +527,11 @@ const Je = s.object({
522
527
  description: n("paymentMethodDescription"),
523
528
  options: [
524
529
  {
525
- value: M.DirectDeposit,
530
+ value: P.DirectDeposit,
526
531
  label: n("paymentMethodOptions.directDeposit")
527
532
  },
528
533
  {
529
- value: M.Check,
534
+ value: P.Check,
530
535
  label: n("paymentMethodOptions.check")
531
536
  }
532
537
  ]
@@ -539,6 +544,6 @@ const Je = s.object({
539
544
  ] });
540
545
  };
541
546
  export {
542
- Fn as PayrollEditEmployeePresentation
547
+ Ln as PayrollEditEmployeePresentation
543
548
  };
544
549
  //# sourceMappingURL=PayrollEditEmployeePresentation.js.map