@gusto/embedded-react-sdk 0.10.3 → 0.10.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.
- package/CHANGELOG.md +23 -0
- package/dist/components/Base/Base.js +54 -51
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/useBase.d.ts +1 -1
- package/dist/components/Base/useBase.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +6 -4
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +12 -10
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +8 -6
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +13 -11
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +7 -6
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +9 -8
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -0
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +3 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +7 -6
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +10 -9
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +8 -7
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +3 -2
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +8 -7
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +7 -6
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +8 -7
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -4
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +6 -5
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +17 -15
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +9 -7
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +7 -6
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +17 -15
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +3 -2
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Head.js +11 -11
- package/dist/components/Company/FederalTaxes/Head.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +9 -8
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +6 -5
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +7 -6
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +11 -10
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +3 -2
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +5 -4
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +9 -7
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +9 -8
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +11 -9
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +6 -5
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +3 -2
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +4 -2
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +4 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +89 -107
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +11 -10
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +65 -51
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +3 -2
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +6 -5
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +6 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +7 -6
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +6 -5
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +2 -0
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +3 -2
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +6 -5
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/List/index.js +48 -50
- package/dist/components/Contractor/List/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +17 -16
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +3 -2
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -2
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +5 -4
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +3 -2
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +6 -5
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/Actions.js +9 -8
- package/dist/components/Employee/Deductions/Actions.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionForm.js +3 -2
- package/dist/components/Employee/Deductions/DeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList.js +3 -2
- package/dist/components/Employee/Deductions/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +3 -2
- package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/useDeductions.js +6 -5
- package/dist/components/Employee/Deductions/useDeductions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +5 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +12 -10
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +3 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +10 -8
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +5 -4
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +4 -2
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +3 -2
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +3 -2
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -3
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +7 -6
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +3 -2
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -2
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +3 -2
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +3 -2
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/Actions.js +7 -6
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +10 -9
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +5 -4
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +9 -8
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +4 -3
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +8 -7
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +5 -4
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +4 -3
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/i18n/en/Company.Locations.json.js +2 -2
- package/dist/i18n/en/Company.PaySchedule.json.js +24 -19
- package/dist/i18n/en/Company.PaySchedule.json.js.map +1 -1
- package/dist/types/i18next.d.ts +5 -1
- package/package.json +4 -1
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useFormContext as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { usePaySchedule as
|
|
6
|
-
import
|
|
7
|
-
import { Flex as
|
|
8
|
-
import { Grid as
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import { jsx as r, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { useFormContext as S, useWatch as u } from "react-hook-form";
|
|
3
|
+
import { useTranslation as T } from "react-i18next";
|
|
4
|
+
import { useState as N, useEffect as h } from "react";
|
|
5
|
+
import { usePaySchedule as x } from "../usePaySchedule.js";
|
|
6
|
+
import n from "./Edit.module.scss.js";
|
|
7
|
+
import { Flex as f } from "../../../Common/Flex/Flex.js";
|
|
8
|
+
import { Grid as E } from "../../../Common/Grid/Grid.js";
|
|
9
|
+
import "classnames";
|
|
10
|
+
import { useComponentContext as R } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
|
+
import { formatDateNamedWeekdayShortPlusDate as P } from "../../../../helpers/dateFormatting.js";
|
|
12
|
+
import { TextInputField as O } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
13
|
+
import { SelectField as v } from "../../../Common/Fields/SelectField/SelectField.js";
|
|
14
|
+
import { RadioGroupField as F } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
14
15
|
import { NumberInputField as D } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
15
|
-
import { DatePickerField as
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
}, [
|
|
21
|
-
|
|
22
|
-
}, [
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
|
|
16
|
+
import { DatePickerField as w } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
|
|
17
|
+
const J = () => {
|
|
18
|
+
const d = R(), { t: e } = T("Company.PaySchedule"), { payPeriodPreview: t, mode: p, payPreviewLoading: b } = x(), { setValue: o } = S(), [a, g] = N(0), i = u({ name: "frequency" }), l = u({ name: "customTwicePerMonth" }), y = u({ name: "payPeriodPreviewRange" }), q = i === "Twice per month" && l === "custom" || i === "Monthly", C = i === "Twice per month" && l === "custom";
|
|
19
|
+
return h(() => {
|
|
20
|
+
i === "Twice per month" && l === "1st15th" && (o("day1", 15), o("day2", 31));
|
|
21
|
+
}, [i, l, o]), h(() => {
|
|
22
|
+
y === void 0 && o("payPeriodPreviewRange", a);
|
|
23
|
+
}, [a, o, y]), p !== "EDIT_PAY_SCHEDULE" && p !== "ADD_PAY_SCHEDULE" ? null : /* @__PURE__ */ r("div", { className: n.payScheduleContainer, children: /* @__PURE__ */ m(E, { gap: 32, gridTemplateColumns: { base: "1fr", small: "1fr 1fr" }, children: [
|
|
24
|
+
/* @__PURE__ */ r("div", { className: n.payScheduleForm, children: /* @__PURE__ */ m(f, { flexDirection: "column", children: [
|
|
25
|
+
/* @__PURE__ */ r(O, { name: "customName", label: "Name", isRequired: !0 }),
|
|
26
|
+
/* @__PURE__ */ r(
|
|
27
|
+
v,
|
|
27
28
|
{
|
|
28
29
|
name: "frequency",
|
|
29
30
|
label: e("labels.frequency"),
|
|
@@ -32,11 +33,12 @@ const z = () => {
|
|
|
32
33
|
{ value: "Every other week", label: e("frequencies.everyOtherWeek") },
|
|
33
34
|
{ value: "Twice per month", label: e("frequencies.twicePerMonth") },
|
|
34
35
|
{ value: "Monthly", label: e("frequencies.monthly") }
|
|
35
|
-
]
|
|
36
|
+
],
|
|
37
|
+
isRequired: !0
|
|
36
38
|
}
|
|
37
39
|
),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
i === "Twice per month" && /* @__PURE__ */ r(
|
|
41
|
+
F,
|
|
40
42
|
{
|
|
41
43
|
name: "customTwicePerMonth",
|
|
42
44
|
label: e("labels.frequencyOptions"),
|
|
@@ -47,69 +49,81 @@ const z = () => {
|
|
|
47
49
|
]
|
|
48
50
|
}
|
|
49
51
|
),
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
|
|
52
|
+
/* @__PURE__ */ r(
|
|
53
|
+
w,
|
|
52
54
|
{
|
|
53
55
|
name: "anchorPayDate",
|
|
54
56
|
label: e("labels.firstPayDate"),
|
|
55
|
-
description: e("descriptions.anchorPayDateDescription")
|
|
57
|
+
description: e("descriptions.anchorPayDateDescription"),
|
|
58
|
+
isRequired: !0
|
|
56
59
|
}
|
|
57
60
|
),
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
|
|
61
|
+
/* @__PURE__ */ r(
|
|
62
|
+
w,
|
|
60
63
|
{
|
|
61
64
|
name: "anchorEndOfPayPeriod",
|
|
62
65
|
label: e("labels.firstPayPeriodEndDate"),
|
|
63
|
-
description: e("descriptions.anchorEndOfPayPeriodDescription")
|
|
66
|
+
description: e("descriptions.anchorEndOfPayPeriodDescription"),
|
|
67
|
+
isRequired: !0
|
|
64
68
|
}
|
|
65
69
|
),
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ r("div", { className: q ? "" : n.visuallyHidden, children: /* @__PURE__ */ r(D, { name: "day1", label: e("labels.firstPayDayOfTheMonth"), isRequired: !0 }) }),
|
|
71
|
+
/* @__PURE__ */ r("div", { className: C ? "" : n.visuallyHidden, children: /* @__PURE__ */ r(D, { name: "day2", label: e("labels.lastPayDayOfTheMonth"), isRequired: !0 }) })
|
|
68
72
|
] }) }),
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
!
|
|
71
|
-
|
|
73
|
+
/* @__PURE__ */ r(f, { flexDirection: "column", gap: 4, justifyContent: "center", alignItems: "center", children: t && t[a] ? /* @__PURE__ */ m("div", { className: n.calendarContainer, children: [
|
|
74
|
+
!b && /* @__PURE__ */ r(
|
|
75
|
+
v,
|
|
72
76
|
{
|
|
73
77
|
name: "payPeriodPreviewRange",
|
|
74
78
|
label: e("labels.preview"),
|
|
75
|
-
options:
|
|
79
|
+
options: t.map((s, c) => ({
|
|
76
80
|
value: String(c),
|
|
77
|
-
label: `${
|
|
81
|
+
label: `${P(s.startDate)} – ${P(s.endDate)}`
|
|
78
82
|
})),
|
|
79
|
-
defaultValue: String(
|
|
83
|
+
defaultValue: String(a),
|
|
80
84
|
onChange: (s) => {
|
|
81
85
|
const c = Number(s);
|
|
82
86
|
isNaN(c) || g(c);
|
|
83
87
|
}
|
|
84
88
|
}
|
|
85
89
|
),
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
|
|
90
|
+
/* @__PURE__ */ r(
|
|
91
|
+
d.CalendarPreview,
|
|
88
92
|
{
|
|
89
93
|
dateRange: {
|
|
90
|
-
start: new Date(
|
|
91
|
-
end: new Date(
|
|
94
|
+
start: new Date(t[a].startDate),
|
|
95
|
+
end: new Date(t[a].endDate),
|
|
92
96
|
label: e("payPreview.payPeriod") || "Pay Period"
|
|
93
97
|
},
|
|
94
98
|
highlightDates: [
|
|
95
99
|
{
|
|
96
|
-
date: new Date(
|
|
100
|
+
date: new Date(t[a].checkDate),
|
|
97
101
|
highlightColor: "primary",
|
|
98
102
|
label: e("payPreview.payday") || "Payday"
|
|
99
103
|
},
|
|
100
104
|
{
|
|
101
|
-
date: new Date(
|
|
105
|
+
date: new Date(t[a].runPayrollBy),
|
|
102
106
|
highlightColor: "secondary",
|
|
103
107
|
label: e("payPreview.payrollDeadline") || "Payroll Deadline"
|
|
104
108
|
}
|
|
105
109
|
]
|
|
106
110
|
},
|
|
107
|
-
|
|
111
|
+
a
|
|
108
112
|
)
|
|
109
|
-
] })
|
|
113
|
+
] }) : /* @__PURE__ */ r("div", { className: n.calendarContainer, children: /* @__PURE__ */ r(
|
|
114
|
+
d.Alert,
|
|
115
|
+
{
|
|
116
|
+
status: "info",
|
|
117
|
+
label: e("previewAlert.title", "Pay Schedule Preview"),
|
|
118
|
+
children: /* @__PURE__ */ r(d.Text, { children: e(
|
|
119
|
+
"previewAlert.description",
|
|
120
|
+
"Complete all the required fields on the left to see a preview of your pay schedule."
|
|
121
|
+
) })
|
|
122
|
+
}
|
|
123
|
+
) }) })
|
|
110
124
|
] }) });
|
|
111
125
|
};
|
|
112
126
|
export {
|
|
113
|
-
|
|
127
|
+
J as Edit
|
|
114
128
|
};
|
|
115
129
|
//# sourceMappingURL=Edit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Edit.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Edit.tsx"],"sourcesContent":["import { useFormContext, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { useEffect, useState } from 'react'\nimport type { PayScheduleInputs } from '../usePaySchedule'\nimport { usePaySchedule } from '../usePaySchedule'\nimport style from './Edit.module.scss'\nimport {\n Flex,\n SelectField,\n RadioGroupField,\n Grid,\n TextInputField,\n NumberInputField,\n DatePickerField,\n} from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { formatDateNamedWeekdayShortPlusDate } from '@/helpers/dateFormatting'\n\nexport const Edit = () => {\n const Components = useComponentContext()\n const { t } = useTranslation('Company.PaySchedule')\n const { payPeriodPreview, mode, payPreviewLoading } = usePaySchedule()\n const { setValue } = useFormContext<PayScheduleInputs>()\n const [selectedPayPeriodIndex, setSelectedPayPeriodIndex] = useState<number>(0)\n\n const frequency = useWatch({ name: 'frequency' })\n const customTwicePerMonth = useWatch({ name: 'customTwicePerMonth' })\n const payPeriodPreviewRange = useWatch({ name: 'payPeriodPreviewRange' })\n\n const shouldShowDay1 =\n (frequency === 'Twice per month' && customTwicePerMonth === 'custom') || frequency === 'Monthly'\n const shouldShowDay2 = frequency === 'Twice per month' && customTwicePerMonth === 'custom'\n\n useEffect(() => {\n if (frequency === 'Twice per month' && customTwicePerMonth === '1st15th') {\n setValue('day1', 15)\n setValue('day2', 31)\n }\n }, [frequency, customTwicePerMonth, setValue])\n\n // This is a workaround to ensure that the pay period preview range is set when the selected pay period index changes\n // TODO: Once we have a RHF free select, that can be used and this effect can be removed\n useEffect(() => {\n if (payPeriodPreviewRange === undefined) {\n setValue('payPeriodPreviewRange', selectedPayPeriodIndex)\n }\n }, [selectedPayPeriodIndex, setValue, payPeriodPreviewRange])\n\n if (mode !== 'EDIT_PAY_SCHEDULE' && mode !== 'ADD_PAY_SCHEDULE') {\n return null\n }\n\n return (\n <div className={style.payScheduleContainer}>\n <Grid gap={32} gridTemplateColumns={{ base: '1fr', small: '1fr 1fr' }}>\n <div className={style.payScheduleForm}>\n <Flex flexDirection={'column'}>\n <TextInputField name=\"customName\" label=\"Name\" />\n <SelectField\n name=\"frequency\"\n label={t('labels.frequency')}\n options={[\n { value: 'Every week', label: t('frequencies.everyWeek') },\n { value: 'Every other week', label: t('frequencies.everyOtherWeek') },\n { value: 'Twice per month', label: t('frequencies.twicePerMonth') },\n { value: 'Monthly', label: t('frequencies.monthly') },\n ]}\n />\n {frequency === 'Twice per month' && (\n <RadioGroupField\n name=\"customTwicePerMonth\"\n label={t('labels.frequencyOptions')}\n description={t('descriptions.frequencyOptionsDescription')}\n options={[\n { value: '1st15th', label: t('frequencyOptions.15thAndLast') },\n { value: 'custom', label: t('frequencyOptions.custom') },\n ]}\n />\n )}\n <DatePickerField\n name=\"anchorPayDate\"\n label={t('labels.firstPayDate')}\n description={t('descriptions.anchorPayDateDescription')}\n />\n <DatePickerField\n name=\"anchorEndOfPayPeriod\"\n label={t('labels.firstPayPeriodEndDate')}\n description={t('descriptions.anchorEndOfPayPeriodDescription')}\n />\n <div className={shouldShowDay1 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day1\" label={t('labels.firstPayDayOfTheMonth')} />\n </div>\n <div className={shouldShowDay2 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day2\" label={t('labels.lastPayDayOfTheMonth')} />\n </div>\n </Flex>\n </div>\n <Flex flexDirection=\"column\" gap={4} justifyContent=\"center\" alignItems=\"center\">\n {payPeriodPreview && payPeriodPreview[selectedPayPeriodIndex] && (\n <div className={style.calendarContainer}>\n {!payPreviewLoading && (\n <SelectField\n name=\"payPeriodPreviewRange\"\n label={t('labels.preview')}\n options={payPeriodPreview.map((period, index) => {\n return {\n value: String(index),\n label: `${formatDateNamedWeekdayShortPlusDate(period.startDate)} – ${formatDateNamedWeekdayShortPlusDate(period.endDate)}`,\n }\n })}\n defaultValue={String(selectedPayPeriodIndex)}\n onChange={(value: string) => {\n const numericValue = Number(value)\n if (!isNaN(numericValue)) {\n setSelectedPayPeriodIndex(numericValue)\n }\n }}\n />\n )}\n <Components.CalendarPreview\n key={selectedPayPeriodIndex}\n dateRange={{\n start: new Date(payPeriodPreview[selectedPayPeriodIndex].startDate as string),\n end: new Date(payPeriodPreview[selectedPayPeriodIndex].endDate as string),\n label: t('payPreview.payPeriod') || 'Pay Period',\n }}\n highlightDates={[\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].checkDate as string),\n highlightColor: 'primary',\n label: t('payPreview.payday') || 'Payday',\n },\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].runPayrollBy as string),\n highlightColor: 'secondary',\n label: t('payPreview.payrollDeadline') || 'Payroll Deadline',\n },\n ]}\n />\n </div>\n )}\n </Flex>\n </Grid>\n </div>\n )\n}\n"],"names":["Edit","Components","useComponentContext","t","useTranslation","payPeriodPreview","mode","payPreviewLoading","usePaySchedule","setValue","useFormContext","selectedPayPeriodIndex","setSelectedPayPeriodIndex","useState","frequency","useWatch","customTwicePerMonth","payPeriodPreviewRange","shouldShowDay1","shouldShowDay2","useEffect","jsx","style","jsxs","Grid","Flex","TextInputField","SelectField","RadioGroupField","DatePickerField","NumberInputField","period","index","formatD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4BAA4B,KAAK;AAAA,YAAA;AAAA,UAC5C;AAAA,QACF;AAAA,QAjBKQ;AAAA,MAAA;AAAA,IAkBP,EAAA,CACF,EAEJ,CAAA;AAAA,EAAA,EAAA,CACF,EACF,CAAA;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"Edit.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Edit.tsx"],"sourcesContent":["import { useFormContext, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { useEffect, useState } from 'react'\nimport type { PayScheduleInputs } from '../usePaySchedule'\nimport { usePaySchedule } from '../usePaySchedule'\nimport style from './Edit.module.scss'\nimport {\n Flex,\n SelectField,\n RadioGroupField,\n Grid,\n TextInputField,\n NumberInputField,\n DatePickerField,\n} from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { formatDateNamedWeekdayShortPlusDate } from '@/helpers/dateFormatting'\n\nexport const Edit = () => {\n const Components = useComponentContext()\n const { t } = useTranslation('Company.PaySchedule')\n const { payPeriodPreview, mode, payPreviewLoading } = usePaySchedule()\n const { setValue } = useFormContext<PayScheduleInputs>()\n const [selectedPayPeriodIndex, setSelectedPayPeriodIndex] = useState<number>(0)\n\n const frequency = useWatch({ name: 'frequency' })\n const customTwicePerMonth = useWatch({ name: 'customTwicePerMonth' })\n const payPeriodPreviewRange = useWatch({ name: 'payPeriodPreviewRange' })\n\n const shouldShowDay1 =\n (frequency === 'Twice per month' && customTwicePerMonth === 'custom') || frequency === 'Monthly'\n const shouldShowDay2 = frequency === 'Twice per month' && customTwicePerMonth === 'custom'\n\n useEffect(() => {\n if (frequency === 'Twice per month' && customTwicePerMonth === '1st15th') {\n setValue('day1', 15)\n setValue('day2', 31)\n }\n }, [frequency, customTwicePerMonth, setValue])\n\n // This is a workaround to ensure that the pay period preview range is set when the selected pay period index changes\n // TODO: Once we have a RHF free select, that can be used and this effect can be removed\n useEffect(() => {\n if (payPeriodPreviewRange === undefined) {\n setValue('payPeriodPreviewRange', selectedPayPeriodIndex)\n }\n }, [selectedPayPeriodIndex, setValue, payPeriodPreviewRange])\n\n if (mode !== 'EDIT_PAY_SCHEDULE' && mode !== 'ADD_PAY_SCHEDULE') {\n return null\n }\n\n return (\n <div className={style.payScheduleContainer}>\n <Grid gap={32} gridTemplateColumns={{ base: '1fr', small: '1fr 1fr' }}>\n <div className={style.payScheduleForm}>\n <Flex flexDirection={'column'}>\n <TextInputField name=\"customName\" label=\"Name\" isRequired />\n <SelectField\n name=\"frequency\"\n label={t('labels.frequency')}\n options={[\n { value: 'Every week', label: t('frequencies.everyWeek') },\n { value: 'Every other week', label: t('frequencies.everyOtherWeek') },\n { value: 'Twice per month', label: t('frequencies.twicePerMonth') },\n { value: 'Monthly', label: t('frequencies.monthly') },\n ]}\n isRequired\n />\n {frequency === 'Twice per month' && (\n <RadioGroupField\n name=\"customTwicePerMonth\"\n label={t('labels.frequencyOptions')}\n description={t('descriptions.frequencyOptionsDescription')}\n options={[\n { value: '1st15th', label: t('frequencyOptions.15thAndLast') },\n { value: 'custom', label: t('frequencyOptions.custom') },\n ]}\n />\n )}\n <DatePickerField\n name=\"anchorPayDate\"\n label={t('labels.firstPayDate')}\n description={t('descriptions.anchorPayDateDescription')}\n isRequired\n />\n <DatePickerField\n name=\"anchorEndOfPayPeriod\"\n label={t('labels.firstPayPeriodEndDate')}\n description={t('descriptions.anchorEndOfPayPeriodDescription')}\n isRequired\n />\n <div className={shouldShowDay1 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day1\" label={t('labels.firstPayDayOfTheMonth')} isRequired />\n </div>\n <div className={shouldShowDay2 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day2\" label={t('labels.lastPayDayOfTheMonth')} isRequired />\n </div>\n </Flex>\n </div>\n <Flex flexDirection=\"column\" gap={4} justifyContent=\"center\" alignItems=\"center\">\n {payPeriodPreview && payPeriodPreview[selectedPayPeriodIndex] ? (\n <div className={style.calendarContainer}>\n {!payPreviewLoading && (\n <SelectField\n name=\"payPeriodPreviewRange\"\n label={t('labels.preview')}\n options={payPeriodPreview.map((period, index) => {\n return {\n value: String(index),\n label: `${formatDateNamedWeekdayShortPlusDate(period.startDate)} – ${formatDateNamedWeekdayShortPlusDate(period.endDate)}`,\n }\n })}\n defaultValue={String(selectedPayPeriodIndex)}\n onChange={(value: string) => {\n const numericValue = Number(value)\n if (!isNaN(numericValue)) {\n setSelectedPayPeriodIndex(numericValue)\n }\n }}\n />\n )}\n <Components.CalendarPreview\n key={selectedPayPeriodIndex}\n dateRange={{\n start: new Date(payPeriodPreview[selectedPayPeriodIndex].startDate as string),\n end: new Date(payPeriodPreview[selectedPayPeriodIndex].endDate as string),\n label: t('payPreview.payPeriod') || 'Pay Period',\n }}\n highlightDates={[\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].checkDate as string),\n highlightColor: 'primary',\n label: t('payPreview.payday') || 'Payday',\n },\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].runPayrollBy as string),\n highlightColor: 'secondary',\n label: t('payPreview.payrollDeadline') || 'Payroll Deadline',\n },\n ]}\n />\n </div>\n ) : (\n <div className={style.calendarContainer}>\n <Components.Alert\n status=\"info\"\n label={t('previewAlert.title', 'Pay Schedule Preview')}\n >\n <Components.Text>\n {t(\n 'previewAlert.description',\n 'Complete all the required fields on the left to see a preview of your pay schedule.',\n )}\n </Components.Text>\n </Components.Alert>\n </div>\n )}\n </Flex>\n </Grid>\n </div>\n )\n}\n"],"names":["Edit","Components","useComponentContext","t","useTranslation","payPeriodPreview","mode","payPreviewLoading","usePaySchedule","setValue","useFormContext","selectedPayPeriodIndex","setSelectedPayPeriodIndex","useState","frequency","useWatch","customTwicePerMonth","payPeriodPreviewRange","shouldShowDay1","shouldShowDay2","useEffect","jsx","style","jsxs","Grid","Flex","TextInputField","SelectField","RadioGroupField","DatePickerField","NumberInputField","period","index","formatDateNamedWeekdayShortPlusDate","value","numericValue"],"mappings":";;;;;;;;;;;;;;;;AAkB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B,KAAK;AAAA,YAAA;AAAA,UAC5C;AAAA,QACF;AAAA,QAjBKQ;AAAA,MAAA;AAAA,IAkBP,GACF,IAEA,gBAAAU,EAAC,OAAI,EAAA,WAAWC,EAAM,mBACpB,UAAA,gBAAAD;AAAA,MAACpB,EAAW;AAAA,MAAX;AAAA,QACC,QAAO;AAAA,QACP,OAAOE,EAAE,sBAAsB,sBAAsB;AAAA,QAErD,UAAA,gBAAAkB,EAACpB,EAAW,MAAX,EACE,UAAAE;AAAA,UACC;AAAA,UACA;AAAA,QAAA,EAEJ,CAAA;AAAA,MAAA;AAAA,OAEJ,EAEJ,CAAA;AAAA,EAAA,EAAA,CACF,EACF,CAAA;AAEJ;"}
|
|
@@ -2,8 +2,9 @@ import { jsx as e, jsxs as r, Fragment as o } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTranslation as c, Trans as a } from "react-i18next";
|
|
3
3
|
import { usePaySchedule as d } from "../usePaySchedule.js";
|
|
4
4
|
import { Flex as h } from "../../../Common/Flex/Flex.js";
|
|
5
|
+
import "classnames";
|
|
5
6
|
import { useComponentContext as l } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
-
const
|
|
7
|
+
const D = () => {
|
|
7
8
|
const { t } = c("Company.PaySchedule"), n = l(), { mode: s } = d();
|
|
8
9
|
let i = /* @__PURE__ */ e(o, {});
|
|
9
10
|
switch (s) {
|
|
@@ -42,6 +43,6 @@ const y = () => {
|
|
|
42
43
|
return /* @__PURE__ */ e(h, { justifyContent: "space-between", flexDirection: "column", gap: 4, children: /* @__PURE__ */ e("header", { children: i }) });
|
|
43
44
|
};
|
|
44
45
|
export {
|
|
45
|
-
|
|
46
|
+
D as Head
|
|
46
47
|
};
|
|
47
48
|
//# sourceMappingURL=Head.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Head.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Head.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n// Head slot for PaySchedule component\nexport const Head = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n\n const { mode } = usePaySchedule()\n let headingOutput: React.ReactElement = <></>\n\n switch (mode) {\n case 'LIST_PAY_SCHEDULES':\n headingOutput = (\n <>\n <Components.Heading as=\"h2\">{t('headings.pageTitle')}</Components.Heading>\n <Components.Text>\n <Trans\n i18nKey={'listDescription'}\n t={t}\n components={{\n how_to_choose_schedule: <Components.Link />,\n }}\n />\n </Components.Text>\n <Components.Text>\n <Trans\n i18nKey={'listDescription2'}\n t={t}\n components={{\n payment_law_doc: <Components.Link />,\n }}\n />\n </Components.Text>\n </>\n )\n break\n case 'ADD_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.addPaySchedule')}</Components.Heading>\n )\n break\n case 'EDIT_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.editPaySchedule')}</Components.Heading>\n )\n break\n default:\n }\n\n return (\n <Flex justifyContent=\"space-between\" flexDirection={'column'} gap={4}>\n <header>{headingOutput}</header>\n </Flex>\n )\n}\n"],"names":["Head","useTranslation","Components","useComponentContext","mode","usePaySchedule","headingOutput","jsx","Fragment","jsxs","Trans","Flex"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Head.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Head.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n// Head slot for PaySchedule component\nexport const Head = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n\n const { mode } = usePaySchedule()\n let headingOutput: React.ReactElement = <></>\n\n switch (mode) {\n case 'LIST_PAY_SCHEDULES':\n headingOutput = (\n <>\n <Components.Heading as=\"h2\">{t('headings.pageTitle')}</Components.Heading>\n <Components.Text>\n <Trans\n i18nKey={'listDescription'}\n t={t}\n components={{\n how_to_choose_schedule: <Components.Link />,\n }}\n />\n </Components.Text>\n <Components.Text>\n <Trans\n i18nKey={'listDescription2'}\n t={t}\n components={{\n payment_law_doc: <Components.Link />,\n }}\n />\n </Components.Text>\n </>\n )\n break\n case 'ADD_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.addPaySchedule')}</Components.Heading>\n )\n break\n case 'EDIT_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.editPaySchedule')}</Components.Heading>\n )\n break\n default:\n }\n\n return (\n <Flex justifyContent=\"space-between\" flexDirection={'column'} gap={4}>\n <header>{headingOutput}</header>\n </Flex>\n )\n}\n"],"names":["Head","useTranslation","Components","useComponentContext","mode","usePaySchedule","headingOutput","jsx","Fragment","jsxs","Trans","Flex"],"mappings":";;;;;;AAMO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAoB,GAEjC,EAAE,MAAAC,EAAK,IAAIC,EAAe;AAChC,MAAIC,IAAsC,gBAAAC,EAAAC,GAAA,EAAA;AAE1C,UAAQJ,GAAM;AAAA,IACZ,KAAK;AACH,MAAAE,IAEI,gBAAAG,EAAAD,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAD,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,oBAAoB,GAAE;AAAA,QACrD,gBAAAK,EAACL,EAAW,MAAX,EACC,UAAA,gBAAAK;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,SAAS;AAAA,YACT;AAAA,YACA,YAAY;AAAA,cACV,wBAAwB,gBAAAH,EAACL,EAAW,MAAX,CAAgB,CAAA;AAAA,YAAA;AAAA,UAC3C;AAAA,QAAA,GAEJ;AAAA,QACA,gBAAAK,EAACL,EAAW,MAAX,EACC,UAAA,gBAAAK;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,SAAS;AAAA,YACT;AAAA,YACA,YAAY;AAAA,cACV,iBAAiB,gBAAAH,EAACL,EAAW,MAAX,CAAgB,CAAA;AAAA,YAAA;AAAA,UACpC;AAAA,QAAA,EAEJ,CAAA;AAAA,MAAA,GACF;AAEF;AAAA,IACF,KAAK;AAED,MAAAI,IAAA,gBAAAC,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,yBAAyB,GAAE;AAE5D;AAAA,IACF,KAAK;AAED,MAAAI,IAAA,gBAAAC,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,0BAA0B,GAAE;AAE7D;AAAA,EACF;AAIA,SAAA,gBAAAK,EAACI,GAAK,EAAA,gBAAe,iBAAgB,eAAe,UAAU,KAAK,GACjE,UAAA,gBAAAJ,EAAC,UAAQ,EAAA,UAAAD,EAAc,CAAA,GACzB;AAEJ;"}
|
|
@@ -3,15 +3,16 @@ import { useTranslation as h } from "react-i18next";
|
|
|
3
3
|
import { usePaySchedule as y } from "../usePaySchedule.js";
|
|
4
4
|
import o from "./List.module.scss.js";
|
|
5
5
|
import { Flex as s } from "../../../Common/Flex/Flex.js";
|
|
6
|
+
import "classnames";
|
|
6
7
|
import f from "../../../../assets/icons/pencil.svg.js";
|
|
7
8
|
import { useComponentContext as S } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
9
|
import { HamburgerMenu as v } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
9
10
|
import { VisuallyHidden as g } from "../../../Common/VisuallyHidden/VisuallyHidden.js";
|
|
10
11
|
import { useDataView as L } from "../../../Common/DataView/useDataView.js";
|
|
11
12
|
import { DataView as C } from "../../../Common/DataView/DataView.js";
|
|
12
|
-
const
|
|
13
|
-
const { t: n } = h("Company.PaySchedule"), r = S(), { paySchedules:
|
|
14
|
-
data:
|
|
13
|
+
const B = () => {
|
|
14
|
+
const { t: n } = h("Company.PaySchedule"), r = S(), { paySchedules: m, mode: c, handleEdit: l } = y(), { ...d } = L({
|
|
15
|
+
data: m || [],
|
|
15
16
|
columns: [
|
|
16
17
|
{
|
|
17
18
|
title: n("payScheduleList.name"),
|
|
@@ -49,9 +50,9 @@ const H = () => {
|
|
|
49
50
|
}
|
|
50
51
|
)
|
|
51
52
|
});
|
|
52
|
-
return
|
|
53
|
+
return c !== "LIST_PAY_SCHEDULES" ? null : /* @__PURE__ */ e(C, { label: "test", ...d });
|
|
53
54
|
};
|
|
54
55
|
export {
|
|
55
|
-
|
|
56
|
+
B as List
|
|
56
57
|
};
|
|
57
58
|
//# sourceMappingURL=List.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport styles from './List.module.scss'\nimport { useDataView, DataView, Flex, VisuallyHidden } from '@/components/Common'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n const { paySchedules, mode, handleEdit } = usePaySchedule()\n\n const { ...dataViewProps } = useDataView({\n data: paySchedules || [],\n columns: [\n {\n title: t('payScheduleList.name'),\n key: 'customName',\n render: schedule => {\n const hasName = !!schedule.name\n let displayName = hasName ? schedule.name : schedule.customName\n if (displayName && displayName.length > 1) {\n displayName = displayName.charAt(0).toUpperCase() + displayName.slice(1)\n } else {\n displayName = schedule.customName\n }\n const displayFrequency = schedule.customName\n return (\n <Flex flexDirection={'column'} gap={0}>\n <div className={styles.content}>\n <div>{displayName}</div>\n {hasName && <div>{displayFrequency}</div>}\n </div>\n </Flex>\n )\n },\n },\n {\n title: <VisuallyHidden>{t('payScheduleList.active')}</VisuallyHidden>,\n key: 'active',\n render: schedule => (\n <Flex alignItems={'center'} justifyContent={'center'}>\n <div className={styles.content}>\n {schedule.active ? (\n <Components.Badge status=\"success\">{t('payScheduleList.active')}</Components.Badge>\n ) : (\n <Components.Badge status=\"info\">{t('payScheduleList.inactive')}</Components.Badge>\n )}\n </div>\n </Flex>\n ),\n },\n ],\n itemMenu: schedule => {\n return (\n <HamburgerMenu\n triggerLabel=\"Actions\"\n items={[\n {\n label: t('payScheduleList.edit'),\n onClick: () => {\n handleEdit(schedule)\n },\n icon: <PencilSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n if (mode !== 'LIST_PAY_SCHEDULES') {\n return null\n }\n\n return <DataView label=\"test\" {...dataViewProps} />\n}\n"],"names":["List","t","useTranslation","Components","useComponentContext","paySchedules","mode","handleEdit","usePaySchedule","dataViewProps","useDataView","schedule","hasName","displayName","displayFrequency","jsx","Flex","jsxs","styles","VisuallyHidden","HamburgerMenu","PencilSvg","DataView"],"mappings":"
|
|
1
|
+
{"version":3,"file":"List.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport styles from './List.module.scss'\nimport { useDataView, DataView, Flex, VisuallyHidden } from '@/components/Common'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n const { paySchedules, mode, handleEdit } = usePaySchedule()\n\n const { ...dataViewProps } = useDataView({\n data: paySchedules || [],\n columns: [\n {\n title: t('payScheduleList.name'),\n key: 'customName',\n render: schedule => {\n const hasName = !!schedule.name\n let displayName = hasName ? schedule.name : schedule.customName\n if (displayName && displayName.length > 1) {\n displayName = displayName.charAt(0).toUpperCase() + displayName.slice(1)\n } else {\n displayName = schedule.customName\n }\n const displayFrequency = schedule.customName\n return (\n <Flex flexDirection={'column'} gap={0}>\n <div className={styles.content}>\n <div>{displayName}</div>\n {hasName && <div>{displayFrequency}</div>}\n </div>\n </Flex>\n )\n },\n },\n {\n title: <VisuallyHidden>{t('payScheduleList.active')}</VisuallyHidden>,\n key: 'active',\n render: schedule => (\n <Flex alignItems={'center'} justifyContent={'center'}>\n <div className={styles.content}>\n {schedule.active ? (\n <Components.Badge status=\"success\">{t('payScheduleList.active')}</Components.Badge>\n ) : (\n <Components.Badge status=\"info\">{t('payScheduleList.inactive')}</Components.Badge>\n )}\n </div>\n </Flex>\n ),\n },\n ],\n itemMenu: schedule => {\n return (\n <HamburgerMenu\n triggerLabel=\"Actions\"\n items={[\n {\n label: t('payScheduleList.edit'),\n onClick: () => {\n handleEdit(schedule)\n },\n icon: <PencilSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n if (mode !== 'LIST_PAY_SCHEDULES') {\n return null\n }\n\n return <DataView label=\"test\" {...dataViewProps} />\n}\n"],"names":["List","t","useTranslation","Components","useComponentContext","paySchedules","mode","handleEdit","usePaySchedule","dataViewProps","useDataView","schedule","hasName","displayName","displayFrequency","jsx","Flex","jsxs","styles","VisuallyHidden","HamburgerMenu","PencilSvg","DataView"],"mappings":";;;;;;;;;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAoB,GACjC,EAAE,cAAAC,GAAc,MAAAC,GAAM,YAAAC,EAAA,IAAeC,EAAe,GAEpD,EAAE,GAAGC,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAML,KAAgB,CAAC;AAAA,IACvB,SAAS;AAAA,MACP;AAAA,QACE,OAAOJ,EAAE,sBAAsB;AAAA,QAC/B,KAAK;AAAA,QACL,QAAQ,CAAYU,MAAA;AACZ,gBAAAC,IAAU,CAAC,CAACD,EAA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UAAA;AAAA,QAC/B;AAAA,MACF;AAAA,IACF;AAAA,EAEJ,CACD;AAED,SAAIf,MAAS,uBACJ,OAGD,gBAAAS,EAAAO,GAAA,EAAS,OAAM,QAAQ,GAAGb,GAAe;AACnD;"}
|
|
@@ -9,10 +9,11 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
|
9
9
|
import "@tanstack/react-query";
|
|
10
10
|
import "../../Base/useBase.js";
|
|
11
11
|
import "../../../shared/constants.js";
|
|
12
|
+
import "classnames";
|
|
12
13
|
import "dompurify";
|
|
13
14
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
15
|
import { createCompoundContext as e } from "../../Base/createCompoundContext.js";
|
|
15
|
-
const
|
|
16
|
+
const w = o.object({
|
|
16
17
|
frequency: o.enum(["Every week", "Every other week", "Twice per month", "Monthly"]),
|
|
17
18
|
anchorPayDate: o.date().optional(),
|
|
18
19
|
anchorEndOfPayPeriod: o.date().optional(),
|
|
@@ -21,10 +22,10 @@ const s = o.object({
|
|
|
21
22
|
customName: o.string().optional(),
|
|
22
23
|
customTwicePerMonth: o.string().optional(),
|
|
23
24
|
payPeriodPreviewRange: o.number().optional()
|
|
24
|
-
}), [
|
|
25
|
+
}), [x, S] = e("PayScheduleContext");
|
|
25
26
|
export {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
S as PayScheduleProvider,
|
|
28
|
+
w as PayScheduleSchema,
|
|
29
|
+
x as usePaySchedule
|
|
29
30
|
};
|
|
30
31
|
//# sourceMappingURL=usePaySchedule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/usePaySchedule.ts"],"sourcesContent":["import type { PayScheduleCreateUpdate } from '@gusto/embedded-api/models/components/payschedulecreateupdate'\nimport type { PayScheduleList } from '@gusto/embedded-api/models/components/payschedulelist'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { PayPeriods } from '@gusto/embedded-api/models/operations/getv1companiescompanyidpayschedulespreview'\nimport { z } from 'zod'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\nimport { createCompoundContext } from '@/components/Base'\n\nexport type MODE =\n | 'LIST_PAY_SCHEDULES'\n | 'ADD_PAY_SCHEDULE'\n | 'EDIT_PAY_SCHEDULE'\n | 'PREVIEW_PAY_SCHEDULE'\n\ntype PayScheduleContextType = {\n companyId: string\n handleAdd: () => void\n handleEdit: (schedule: PayScheduleType) => void\n handleCancel: () => void\n handleContinue: () => void\n mode: MODE\n paySchedules: PayScheduleList[] | undefined | null\n currentPaySchedule: PayScheduleType | undefined | null\n payPeriodPreview?: PayPeriods[]\n payPreviewLoading?: boolean\n}\n\nexport const PayScheduleSchema = z.object({\n frequency: z.enum(['Every week', 'Every other week', 'Twice per month', 'Monthly']),\n anchorPayDate: z.date().optional(),\n anchorEndOfPayPeriod: z.date().optional(),\n day1: z.number().min(1).max(31).optional(),\n day2: z.number().min(1).max(31).optional(),\n customName: z.string().optional(),\n customTwicePerMonth: z.string().optional(),\n payPeriodPreviewRange: z.number().optional(),\n})\n\nexport type PayScheduleInputs = z.input<typeof PayScheduleSchema>\nexport type PayScheduleOutputs = z.output<typeof PayScheduleSchema>\n\nexport type PayScheduleDefaultValues = RequireAtLeastOne<\n Partial<\n Pick<\n PayScheduleCreateUpdate,\n 'anchorPayDate' | 'anchorEndOfPayPeriod' | 'day1' | 'day2' | 'customName' | 'frequency'\n >\n >\n>\n\nconst [usePaySchedule, PayScheduleProvider] =\n createCompoundContext<PayScheduleContextType>('PayScheduleContext')\nexport { usePaySchedule, PayScheduleProvider }\n"],"names":["PayScheduleSchema","z","usePaySchedule","PayScheduleProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"usePaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/usePaySchedule.ts"],"sourcesContent":["import type { PayScheduleCreateUpdate } from '@gusto/embedded-api/models/components/payschedulecreateupdate'\nimport type { PayScheduleList } from '@gusto/embedded-api/models/components/payschedulelist'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { PayPeriods } from '@gusto/embedded-api/models/operations/getv1companiescompanyidpayschedulespreview'\nimport { z } from 'zod'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\nimport { createCompoundContext } from '@/components/Base'\n\nexport type MODE =\n | 'LIST_PAY_SCHEDULES'\n | 'ADD_PAY_SCHEDULE'\n | 'EDIT_PAY_SCHEDULE'\n | 'PREVIEW_PAY_SCHEDULE'\n\ntype PayScheduleContextType = {\n companyId: string\n handleAdd: () => void\n handleEdit: (schedule: PayScheduleType) => void\n handleCancel: () => void\n handleContinue: () => void\n mode: MODE\n paySchedules: PayScheduleList[] | undefined | null\n currentPaySchedule: PayScheduleType | undefined | null\n payPeriodPreview?: PayPeriods[]\n payPreviewLoading?: boolean\n}\n\nexport const PayScheduleSchema = z.object({\n frequency: z.enum(['Every week', 'Every other week', 'Twice per month', 'Monthly']),\n anchorPayDate: z.date().optional(),\n anchorEndOfPayPeriod: z.date().optional(),\n day1: z.number().min(1).max(31).optional(),\n day2: z.number().min(1).max(31).optional(),\n customName: z.string().optional(),\n customTwicePerMonth: z.string().optional(),\n payPeriodPreviewRange: z.number().optional(),\n})\n\nexport type PayScheduleInputs = z.input<typeof PayScheduleSchema>\nexport type PayScheduleOutputs = z.output<typeof PayScheduleSchema>\n\nexport type PayScheduleDefaultValues = RequireAtLeastOne<\n Partial<\n Pick<\n PayScheduleCreateUpdate,\n 'anchorPayDate' | 'anchorEndOfPayPeriod' | 'day1' | 'day2' | 'customName' | 'frequency'\n >\n >\n>\n\nconst [usePaySchedule, PayScheduleProvider] =\n createCompoundContext<PayScheduleContextType>('PayScheduleContext')\nexport { usePaySchedule, PayScheduleProvider }\n"],"names":["PayScheduleSchema","z","usePaySchedule","PayScheduleProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AA2Ba,MAAAA,IAAoBC,EAAE,OAAO;AAAA,EACxC,WAAWA,EAAE,KAAK,CAAC,cAAc,oBAAoB,mBAAmB,SAAS,CAAC;AAAA,EAClF,eAAeA,EAAE,KAAK,EAAE,SAAS;AAAA,EACjC,sBAAsBA,EAAE,KAAK,EAAE,SAAS;AAAA,EACxC,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS;AAAA,EACzC,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS;AAAA,EACzC,YAAYA,EAAE,OAAO,EAAE,SAAS;AAAA,EAChC,qBAAqBA,EAAE,OAAO,EAAE,SAAS;AAAA,EACzC,uBAAuBA,EAAE,OAAO,EAAE,SAAS;AAC7C,CAAC,GAcK,CAACC,GAAgBC,CAAmB,IACxCC,EAA8C,oBAAoB;"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { jsxs as i, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as a } from "react-i18next";
|
|
3
3
|
import { useStateTaxesForm as s } from "./context.js";
|
|
4
|
+
import "classnames";
|
|
4
5
|
import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
5
6
|
import { useComponentContext as c } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
-
function
|
|
7
|
-
const { t } = a("Company.StateTaxes", { keyPrefix: "form" }), { handleCancel:
|
|
7
|
+
function x() {
|
|
8
|
+
const { t } = a("Company.StateTaxes", { keyPrefix: "form" }), { handleCancel: r, isPending: e } = s(), o = c();
|
|
8
9
|
return /* @__PURE__ */ i(m, { children: [
|
|
9
|
-
/* @__PURE__ */ n(o.Button, { variant: "secondary", onClick:
|
|
10
|
-
/* @__PURE__ */ n(o.Button, { variant: "primary", type: "submit", isDisabled:
|
|
10
|
+
/* @__PURE__ */ n(o.Button, { variant: "secondary", onClick: r, children: t("cancelCta") }),
|
|
11
|
+
/* @__PURE__ */ n(o.Button, { variant: "primary", type: "submit", isDisabled: e, children: t("saveCta") })
|
|
11
12
|
] });
|
|
12
13
|
}
|
|
13
14
|
export {
|
|
14
|
-
|
|
15
|
+
x as Actions
|
|
15
16
|
};
|
|
16
17
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesForm } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { handleCancel, isPending } = useStateTaxesForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button variant=\"primary\" type=\"submit\" isDisabled={isPending}>\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleCancel","isPending","useStateTaxesForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesForm } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { handleCancel, isPending } = useStateTaxesForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button variant=\"primary\" type=\"submit\" isDisabled={isPending}>\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleCancel","isPending","useStateTaxesForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;AAKO,SAASA,IAAU;AAClB,QAAA,EAAE,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,cAAAC,GAAc,WAAAC,EAAU,IAAIC,EAAkB,GAChDC,IAAaC,EAAoB;AAEvC,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAE,EAAA,WAAW,EAChB,CAAA;AAAA,IACC,gBAAAM,EAAAH,EAAW,QAAX,EAAkB,SAAQ,WAAU,MAAK,UAAS,YAAYF,GAC5D,UAAE,EAAA,SAAS,EACd,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -8,12 +8,13 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
|
8
8
|
import "@tanstack/react-query";
|
|
9
9
|
import "../../../Base/useBase.js";
|
|
10
10
|
import "../../../../shared/constants.js";
|
|
11
|
+
import "classnames";
|
|
11
12
|
import "dompurify";
|
|
12
13
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
14
|
import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
|
|
14
|
-
const [
|
|
15
|
+
const [c, d] = t("StateTaxesFormContext");
|
|
15
16
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
d as StateTaxesFormProvider,
|
|
18
|
+
c as useStateTaxesForm
|
|
18
19
|
};
|
|
19
20
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/context.ts"],"sourcesContent":["import type { TaxRequirementsState } from '@gusto/embedded-api/models/components/taxrequirementsstate'\nimport { createCompoundContext } from '@/components/Base'\n\ninterface StateTaxFormContext {\n isPending: boolean\n state: string\n stateTaxRequirements: TaxRequirementsState\n handleCancel: () => void\n}\n\nconst [useStateTaxesForm, StateTaxesFormProvider] =\n createCompoundContext<StateTaxFormContext>('StateTaxesFormContext')\n\nexport { useStateTaxesForm, StateTaxesFormProvider }\n"],"names":["useStateTaxesForm","StateTaxesFormProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/context.ts"],"sourcesContent":["import type { TaxRequirementsState } from '@gusto/embedded-api/models/components/taxrequirementsstate'\nimport { createCompoundContext } from '@/components/Base'\n\ninterface StateTaxFormContext {\n isPending: boolean\n state: string\n stateTaxRequirements: TaxRequirementsState\n handleCancel: () => void\n}\n\nconst [useStateTaxesForm, StateTaxesFormProvider] =\n createCompoundContext<StateTaxFormContext>('StateTaxesFormContext')\n\nexport { useStateTaxesForm, StateTaxesFormProvider }\n"],"names":["useStateTaxesForm","StateTaxesFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAA2C,uBAAuB;"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as i } from "react-i18next";
|
|
3
3
|
import { useStateTaxesList as e } from "./context.js";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import "classnames";
|
|
5
|
+
import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
6
|
+
import { useComponentContext as s } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
7
|
+
function l() {
|
|
8
|
+
const { t: o } = i("Company.StateTaxes"), n = s(), { handleContinue: r } = e();
|
|
9
|
+
return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(n.Button, { variant: "primary", onClick: r, children: o("list.continueCta") }) });
|
|
9
10
|
}
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
l as Actions
|
|
12
13
|
};
|
|
13
14
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes')\n const Components = useComponentContext()\n const { handleContinue } = useStateTaxesList()\n return (\n <ActionsLayout>\n <Components.Button variant=\"primary\" onClick={handleContinue}>\n {t('list.continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","Components","useComponentContext","handleContinue","useStateTaxesList","jsx","ActionsLayout"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes')\n const Components = useComponentContext()\n const { handleContinue } = useStateTaxesList()\n return (\n <ActionsLayout>\n <Components.Button variant=\"primary\" onClick={handleContinue}>\n {t('list.continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","Components","useComponentContext","handleContinue","useStateTaxesList","jsx","ActionsLayout"],"mappings":";;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB,GAC3CC,IAAaC,EAAoB,GACjC,EAAE,gBAAAC,EAAe,IAAIC,EAAkB;AAC7C,SACG,gBAAAC,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAJ,EAAW,QAAX,EAAkB,SAAQ,WAAU,SAASE,GAC3C,UAAEJ,EAAA,kBAAkB,EACvB,CAAA,GACF;AAEJ;"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as s, Fragment as p } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as o } from "react-i18next";
|
|
3
3
|
import { useStateTaxesList as l } from "./context.js";
|
|
4
|
+
import "classnames";
|
|
4
5
|
import { EmptyData as c } from "../../../Common/EmptyData/EmptyData.js";
|
|
5
6
|
import { useComponentContext as u } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
7
|
import { useDataView as d } from "../../../Common/DataView/useDataView.js";
|
|
7
8
|
import { DataView as C } from "../../../Common/DataView/DataView.js";
|
|
8
|
-
const
|
|
9
|
-
const { stateTaxRequirements:
|
|
10
|
-
data:
|
|
9
|
+
const k = () => {
|
|
10
|
+
const { stateTaxRequirements: r, handleChange: n } = l(), a = u(), { t } = o("Company.StateTaxes", { keyPrefix: "list" }), { t: i } = o("common", { keyPrefix: "statesHash" }), { ...m } = d({
|
|
11
|
+
data: r,
|
|
11
12
|
columns: [
|
|
12
13
|
{
|
|
13
14
|
key: "state",
|
|
@@ -25,7 +26,7 @@ const S = () => {
|
|
|
25
26
|
{
|
|
26
27
|
variant: "secondary",
|
|
27
28
|
onClick: () => {
|
|
28
|
-
|
|
29
|
+
n(e.state);
|
|
29
30
|
},
|
|
30
31
|
children: e.setupComplete ? t("editStateTaxCta") : t("continueStateTaxSetupCta")
|
|
31
32
|
}
|
|
@@ -35,6 +36,6 @@ const S = () => {
|
|
|
35
36
|
return /* @__PURE__ */ s(C, { label: t("requirementsListLabel"), ...m });
|
|
36
37
|
};
|
|
37
38
|
export {
|
|
38
|
-
|
|
39
|
+
k as List
|
|
39
40
|
};
|
|
40
41
|
//# sourceMappingURL=List.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { DataView, EmptyData, useDataView } from '@/components/Common'\nimport type { STATES_ABBR } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const List = () => {\n const { stateTaxRequirements, handleChange } = useStateTaxesList()\n const Components = useComponentContext()\n\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'list' })\n const { t: statesHash } = useTranslation('common', { keyPrefix: 'statesHash' })\n\n const { ...dataViewProps } = useDataView({\n data: stateTaxRequirements,\n columns: [\n {\n key: 'state',\n title: t('requirementsListCol1'),\n render: requirement => {\n return <span>{statesHash(requirement.state as (typeof STATES_ABBR)[number])}</span>\n },\n },\n {\n key: 'status',\n title: t('requirementsListCol2'),\n render: requirement => {\n return (\n <>\n <Components.Badge status={requirement.setupComplete ? 'success' : 'warning'}>\n {requirement.setupComplete ? t('completeBadge') : t('incompleteBadge')}\n </Components.Badge>\n </>\n )\n },\n },\n ],\n itemMenu: requirement => {\n return (\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleChange(requirement.state)\n }}\n >\n {requirement.setupComplete ? t('editStateTaxCta') : t('continueStateTaxSetupCta')}\n </Components.Button>\n )\n },\n\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')} />\n ),\n })\n return <DataView label={t('requirementsListLabel')} {...dataViewProps} />\n}\n"],"names":["List","stateTaxRequirements","handleChange","useStateTaxesList","Components","useComponentContext","useTranslation","statesHash","dataViewProps","useDataView","requirement","jsx","EmptyData","DataView"],"mappings":"
|
|
1
|
+
{"version":3,"file":"List.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { DataView, EmptyData, useDataView } from '@/components/Common'\nimport type { STATES_ABBR } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const List = () => {\n const { stateTaxRequirements, handleChange } = useStateTaxesList()\n const Components = useComponentContext()\n\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'list' })\n const { t: statesHash } = useTranslation('common', { keyPrefix: 'statesHash' })\n\n const { ...dataViewProps } = useDataView({\n data: stateTaxRequirements,\n columns: [\n {\n key: 'state',\n title: t('requirementsListCol1'),\n render: requirement => {\n return <span>{statesHash(requirement.state as (typeof STATES_ABBR)[number])}</span>\n },\n },\n {\n key: 'status',\n title: t('requirementsListCol2'),\n render: requirement => {\n return (\n <>\n <Components.Badge status={requirement.setupComplete ? 'success' : 'warning'}>\n {requirement.setupComplete ? t('completeBadge') : t('incompleteBadge')}\n </Components.Badge>\n </>\n )\n },\n },\n ],\n itemMenu: requirement => {\n return (\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleChange(requirement.state)\n }}\n >\n {requirement.setupComplete ? t('editStateTaxCta') : t('continueStateTaxSetupCta')}\n </Components.Button>\n )\n },\n\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')} />\n ),\n })\n return <DataView label={t('requirementsListLabel')} {...dataViewProps} />\n}\n"],"names":["List","stateTaxRequirements","handleChange","useStateTaxesList","Components","useComponentContext","useTranslation","statesHash","dataViewProps","useDataView","requirement","jsx","EmptyData","DataView"],"mappings":";;;;;;;;AAMO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,sBAAAC,GAAsB,cAAAC,EAAa,IAAIC,EAAkB,GAC3DC,IAAaC,EAAoB,GAEjC,EAAE,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,GAAGC,MAAeD,EAAe,UAAU,EAAE,WAAW,cAAc,GAExE,EAAE,GAAGE,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAMR;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,sBAAsB;AAAA,QAC/B,QAAQ,CAAeS,MACb,gBAAAC,EAAA,QAAA,EAAM,UAAWJ,EAAAG,EAAY,KAAqC,GAAE;AAAA,MAEhF;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,sBAAsB;AAAA,QAC/B,QAAQ,CAAeA,6BAGjB,UAAC,gBAAAC,EAAAP,EAAW,OAAX,EAAiB,QAAQM,EAAY,gBAAgB,YAAY,WAC/D,UAAAA,EAAY,gBAAgB,EAAE,eAAe,IAAI,EAAE,iBAAiB,EACvE,CAAA,GACF;AAAA,MAEJ;AAAA,IAEJ;AAAA,IACA,UAAU,CAAeA,MAErB,gBAAAC;AAAA,MAACP,EAAW;AAAA,MAAX;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAF,EAAaQ,EAAY,KAAK;AAAA,QAChC;AAAA,QAEC,YAAY,gBAAgB,EAAE,iBAAiB,IAAI,EAAE,0BAA0B;AAAA,MAAA;AAAA,IAClF;AAAA,IAIJ,YAAY,MACV,gBAAAC,EAACC,GAAU,EAAA,OAAO,EAAE,iBAAiB,GAAG,aAAa,EAAE,uBAAuB,EAAG,CAAA;AAAA,EAAA,CAEpF;AACD,2BAAQC,GAAS,EAAA,OAAO,EAAE,uBAAuB,GAAI,GAAGL,GAAe;AACzE;"}
|
|
@@ -8,12 +8,13 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
|
8
8
|
import "@tanstack/react-query";
|
|
9
9
|
import "../../../Base/useBase.js";
|
|
10
10
|
import "../../../../shared/constants.js";
|
|
11
|
+
import "classnames";
|
|
11
12
|
import "dompurify";
|
|
12
13
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
14
|
import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
|
|
14
|
-
const [
|
|
15
|
+
const [c, d] = t("StateTaxesListContext");
|
|
15
16
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
d as StateTaxesListProvider,
|
|
18
|
+
c as useStateTaxesList
|
|
18
19
|
};
|
|
19
20
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/context.ts"],"sourcesContent":["import type { ResponseBody } from '@gusto/embedded-api/models/operations/getv1companiescompanyuuidtaxrequirements'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesListContextType = {\n isPending: boolean\n stateTaxRequirements: ResponseBody[]\n handleContinue: () => void\n handleChange: (state: string) => void\n}\n\nconst [useStateTaxesList, StateTaxesListProvider] =\n createCompoundContext<StateTaxesListContextType>('StateTaxesListContext')\n\nexport { useStateTaxesList, StateTaxesListProvider }\n"],"names":["useStateTaxesList","StateTaxesListProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/context.ts"],"sourcesContent":["import type { ResponseBody } from '@gusto/embedded-api/models/operations/getv1companiescompanyuuidtaxrequirements'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesListContextType = {\n isPending: boolean\n stateTaxRequirements: ResponseBody[]\n handleContinue: () => void\n handleChange: (state: string) => void\n}\n\nconst [useStateTaxesList, StateTaxesListProvider] =\n createCompoundContext<StateTaxesListContextType>('StateTaxesListContext')\n\nexport { useStateTaxesList, StateTaxesListProvider }\n"],"names":["useStateTaxesList","StateTaxesListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAAiD,uBAAuB;"}
|
|
@@ -11,6 +11,8 @@ import { Actions as f } from "./Actions.js";
|
|
|
11
11
|
import { Form as N } from "../../Common/Form/Form.js";
|
|
12
12
|
import { useComponentDictionary as j, useI18n as q } from "../../../i18n/I18n.js";
|
|
13
13
|
import { Flex as w } from "../../Common/Flex/Flex.js";
|
|
14
|
+
import "react-i18next";
|
|
15
|
+
import "classnames";
|
|
14
16
|
import { BaseComponent as G } from "../../Base/Base.js";
|
|
15
17
|
import { useBase as M } from "../../Base/useBase.js";
|
|
16
18
|
import { contractorEvents as a } from "../../../shared/constants.js";
|