@gusto/embedded-react-sdk 0.24.0 → 0.24.1
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 +11 -0
- package/dist/components/Common/SignatureForm/SignatureForm.js +11 -12
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +2 -2
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +12 -12
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +5 -6
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -6
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +2 -2
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +2 -2
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -2
- package/dist/components/Company/FederalTaxes/Form.js +3 -4
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +2 -2
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +2 -2
- package/dist/components/Company/OnboardingOverview/Completed.js +2 -3
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +2 -3
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -2
- package/dist/components/Company/PaySchedule/PaySchedule.js +2 -2
- package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
- package/dist/components/Company/PaySchedule/_parts/Head.js +8 -9
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +11 -12
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +2 -2
- package/dist/components/Contractor/Address/Form.js +1 -1
- package/dist/components/Contractor/ContractorList/index.js +17 -17
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -2
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +13 -14
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +10 -10
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +9 -10
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +2 -3
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +12 -13
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
- package/dist/components/Contractor/Submit/Submit.js +1 -1
- package/dist/components/Employee/Compensation/Edit.js +14 -14
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +8 -8
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +9 -9
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +9 -9
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +3 -4
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +2 -3
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +7 -7
- package/dist/components/Employee/Landing/Landing.js +8 -8
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +2 -2
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +8 -8
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
- package/dist/components/Employee/Taxes/FederalForm.js +7 -7
- package/dist/components/Flow/Flow.js +2 -3
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +9 -9
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +6 -7
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +2 -3
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +27 -27
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +8 -9
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +17 -18
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +16 -17
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +10 -10
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +2 -3
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +2 -3
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/i18n/en/common.json.d.ts +1 -0
- package/dist/i18n/en/common.json.js +1 -1
- package/dist/shared/constants.d.ts +1 -1
- package/dist/shared/constants.js +6 -5
- package/dist/shared/constants.js.map +1 -1
- package/dist/types/i18next.d.ts +1 -0
- package/package.json +3 -3
package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js
CHANGED
|
@@ -16,12 +16,12 @@ import { useComponentDictionary as z, useI18n as g } from "../../../../i18n/I18n
|
|
|
16
16
|
import { Flex as p, FlexItem as f } from "../../../Common/Flex/Flex.js";
|
|
17
17
|
import { payrollWireEvents as N } from "../../../../shared/constants.js";
|
|
18
18
|
import "classnames";
|
|
19
|
-
import { TextInputField as V } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
20
|
-
import { DatePickerField as J } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
|
|
21
|
-
import { NumberInputField as Q } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
22
19
|
import "react";
|
|
23
|
-
import { TextAreaField as
|
|
24
|
-
import { useDateFormatter as
|
|
20
|
+
import { TextAreaField as V } from "../../../Common/Fields/TextAreaField/TextAreaField.js";
|
|
21
|
+
import { useDateFormatter as J } from "../../../../hooks/useDateFormatter.js";
|
|
22
|
+
import { NumberInputField as Q } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
23
|
+
import { TextInputField as X } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
24
|
+
import { DatePickerField as Z } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
|
|
25
25
|
const $ = r.object({
|
|
26
26
|
amountSent: r.number().positive(),
|
|
27
27
|
dateSent: r.date(),
|
|
@@ -43,7 +43,7 @@ const oe = ({
|
|
|
43
43
|
modalContainerRef: y
|
|
44
44
|
}) => {
|
|
45
45
|
z("Payroll.ConfirmWireDetailsForm", i), g("Payroll.ConfirmWireDetailsForm");
|
|
46
|
-
const { onEvent: a, baseSubmitHandler: I } = Y(), { t } = F("Payroll.ConfirmWireDetailsForm"), { Heading: v, Text: b } = S(), R =
|
|
46
|
+
const { onEvent: a, baseSubmitHandler: I } = Y(), { t } = F("Payroll.ConfirmWireDetailsForm"), { Heading: v, Text: b } = S(), R = J(), { data: P } = U({
|
|
47
47
|
wireInRequestUuid: o
|
|
48
48
|
}), W = P.wireInRequest, { data: q } = G({
|
|
49
49
|
companyId: n,
|
|
@@ -95,7 +95,7 @@ const oe = ({
|
|
|
95
95
|
}
|
|
96
96
|
),
|
|
97
97
|
/* @__PURE__ */ e(
|
|
98
|
-
|
|
98
|
+
Z,
|
|
99
99
|
{
|
|
100
100
|
name: "dateSent",
|
|
101
101
|
label: t("dateLabel"),
|
|
@@ -105,7 +105,7 @@ const oe = ({
|
|
|
105
105
|
}
|
|
106
106
|
),
|
|
107
107
|
/* @__PURE__ */ e(
|
|
108
|
-
|
|
108
|
+
X,
|
|
109
109
|
{
|
|
110
110
|
name: "bankName",
|
|
111
111
|
label: t("bankNameLabel"),
|
|
@@ -115,7 +115,7 @@ const oe = ({
|
|
|
115
115
|
errorMessage: t("validations.bankName")
|
|
116
116
|
}
|
|
117
117
|
),
|
|
118
|
-
/* @__PURE__ */ e(
|
|
118
|
+
/* @__PURE__ */ e(V, { name: "additionalNotes", label: t("notesLabel"), rows: 3 })
|
|
119
119
|
] })
|
|
120
120
|
}
|
|
121
121
|
) })
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
1
|
+
import { jsx as l, jsxs as d } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as P } from "react-i18next";
|
|
3
3
|
import { getBlockerTranslationKeys as v } from "../payrollHelpers.js";
|
|
4
4
|
import { useComponentContext as A } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
5
|
-
import { Flex as
|
|
5
|
+
import { Flex as m } from "../../../Common/Flex/Flex.js";
|
|
6
6
|
import "classnames";
|
|
7
|
-
import "../../../../shared/constants.js";
|
|
8
7
|
import "react";
|
|
9
8
|
import { useI18n as C } from "../../../../i18n/I18n.js";
|
|
10
|
-
function
|
|
9
|
+
function F({
|
|
11
10
|
blockers: o,
|
|
12
11
|
onMultipleViewClick: i,
|
|
13
12
|
multipleViewLabel: h,
|
|
@@ -31,7 +30,7 @@ function H({
|
|
|
31
30
|
};
|
|
32
31
|
}), t = p[0];
|
|
33
32
|
if (!y && t)
|
|
34
|
-
return /* @__PURE__ */ l(a, { status: "error", label: t.title, className: s, children: /* @__PURE__ */ m
|
|
33
|
+
return /* @__PURE__ */ l(a, { status: "error", label: t.title, className: s, children: /* @__PURE__ */ d(m, { flexDirection: "column", gap: 8, children: [
|
|
35
34
|
/* @__PURE__ */ l(c, { children: t.description }),
|
|
36
35
|
t.helpText && t.helpText !== t.description && /* @__PURE__ */ l(c, { variant: "supporting", size: "sm", children: t.helpText })
|
|
37
36
|
] }) });
|
|
@@ -42,7 +41,7 @@ function H({
|
|
|
42
41
|
status: "error",
|
|
43
42
|
label: e("multipleIssuesTitle", { count: o.length }),
|
|
44
43
|
className: s,
|
|
45
|
-
children: /* @__PURE__ */ m
|
|
44
|
+
children: /* @__PURE__ */ d(m, { flexDirection: "column", gap: 16, children: [
|
|
46
45
|
/* @__PURE__ */ l(x, { items: g }),
|
|
47
46
|
i && /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(f, { variant: "secondary", onClick: i, title: u, children: u }) })
|
|
48
47
|
] })
|
|
@@ -50,6 +49,6 @@ function H({
|
|
|
50
49
|
);
|
|
51
50
|
}
|
|
52
51
|
export {
|
|
53
|
-
|
|
52
|
+
F as PayrollBlockerAlerts
|
|
54
53
|
};
|
|
55
54
|
//# sourceMappingURL=PayrollBlockerAlerts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayrollBlockerAlerts.js","sources":["../../../../../src/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type ApiPayrollBlocker, getBlockerTranslationKeys } from '../payrollHelpers'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex } from '@/components/Common'\nimport { useI18n } from '@/i18n'\n\ninterface PayrollBlockerAlertsProps {\n blockers: ApiPayrollBlocker[]\n className?: string\n onMultipleViewClick?: () => void\n multipleViewLabel?: string\n}\n\n/**\n * PayrollBlockerAlerts - Alert-style component for inline blocker display\n * Shows single blocker as alert, or multiple blockers as summary with \"Review\" button\n * Returns null for empty blocker arrays\n */\nexport function PayrollBlockerAlerts({\n blockers,\n onMultipleViewClick,\n multipleViewLabel,\n className,\n}: PayrollBlockerAlertsProps) {\n useI18n('Payroll.PayrollBlocker')\n const { t } = useTranslation('Payroll.PayrollBlocker')\n const { Alert, Button, Text, UnorderedList } = useComponentContext()\n\n // Return null for empty blockers array\n if (blockers.length === 0) {\n return null\n }\n\n const hasMultipleBlockers = blockers.length > 1\n\n const enrichedBlockers = blockers.map(blocker => {\n const translationKeys = getBlockerTranslationKeys(blocker.key)\n\n const title = t(translationKeys.titleKey, {\n defaultValue: blocker.key.replace(/_/g, ' ').replace(/\\b\\w/g, l => l.toUpperCase()),\n })\n const description = t(translationKeys.descriptionKey, {\n defaultValue: blocker.message || t('defaultBlockerDescription'),\n })\n const helpText = t(translationKeys.helpTextKey, { defaultValue: t('defaultBlockerHelp') })\n\n return {\n ...blocker,\n title,\n description,\n helpText,\n }\n })\n\n const singleBlocker = enrichedBlockers[0]\n\n if (!hasMultipleBlockers && singleBlocker) {\n return (\n <Alert status=\"error\" label={singleBlocker.title} className={className}>\n <Flex flexDirection=\"column\" gap={8}>\n <Text>{singleBlocker.description}</Text>\n {singleBlocker.helpText && singleBlocker.helpText !== singleBlocker.description && (\n <Text variant=\"supporting\" size=\"sm\">\n {singleBlocker.helpText}\n </Text>\n )}\n </Flex>\n </Alert>\n )\n }\n\n const listItems = enrichedBlockers.map(blocker => blocker.title)\n const defaultMultipleLabel = multipleViewLabel || t('viewAllBlockers')\n\n return (\n <Alert\n status=\"error\"\n label={t('multipleIssuesTitle', { count: blockers.length })}\n className={className}\n >\n <Flex flexDirection=\"column\" gap={16}>\n <UnorderedList items={listItems} />\n {onMultipleViewClick && (\n <div>\n <Button variant=\"secondary\" onClick={onMultipleViewClick} title={defaultMultipleLabel}>\n {defaultMultipleLabel}\n </Button>\n </div>\n )}\n </Flex>\n </Alert>\n )\n}\n"],"names":["PayrollBlockerAlerts","blockers","onMultipleViewClick","multipleViewLabel","className","useI18n","t","useTranslation","Alert","Button","Text","UnorderedList","useComponentContext","hasMultipleBlockers","enrichedBlockers","blocker","translationKeys","getBlockerTranslationKeys","title","l","description","helpText","singleBlocker","jsx","jsxs","Flex","listItems","defaultMultipleLabel"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PayrollBlockerAlerts.js","sources":["../../../../../src/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type ApiPayrollBlocker, getBlockerTranslationKeys } from '../payrollHelpers'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex } from '@/components/Common'\nimport { useI18n } from '@/i18n'\n\ninterface PayrollBlockerAlertsProps {\n blockers: ApiPayrollBlocker[]\n className?: string\n onMultipleViewClick?: () => void\n multipleViewLabel?: string\n}\n\n/**\n * PayrollBlockerAlerts - Alert-style component for inline blocker display\n * Shows single blocker as alert, or multiple blockers as summary with \"Review\" button\n * Returns null for empty blocker arrays\n */\nexport function PayrollBlockerAlerts({\n blockers,\n onMultipleViewClick,\n multipleViewLabel,\n className,\n}: PayrollBlockerAlertsProps) {\n useI18n('Payroll.PayrollBlocker')\n const { t } = useTranslation('Payroll.PayrollBlocker')\n const { Alert, Button, Text, UnorderedList } = useComponentContext()\n\n // Return null for empty blockers array\n if (blockers.length === 0) {\n return null\n }\n\n const hasMultipleBlockers = blockers.length > 1\n\n const enrichedBlockers = blockers.map(blocker => {\n const translationKeys = getBlockerTranslationKeys(blocker.key)\n\n const title = t(translationKeys.titleKey, {\n defaultValue: blocker.key.replace(/_/g, ' ').replace(/\\b\\w/g, l => l.toUpperCase()),\n })\n const description = t(translationKeys.descriptionKey, {\n defaultValue: blocker.message || t('defaultBlockerDescription'),\n })\n const helpText = t(translationKeys.helpTextKey, { defaultValue: t('defaultBlockerHelp') })\n\n return {\n ...blocker,\n title,\n description,\n helpText,\n }\n })\n\n const singleBlocker = enrichedBlockers[0]\n\n if (!hasMultipleBlockers && singleBlocker) {\n return (\n <Alert status=\"error\" label={singleBlocker.title} className={className}>\n <Flex flexDirection=\"column\" gap={8}>\n <Text>{singleBlocker.description}</Text>\n {singleBlocker.helpText && singleBlocker.helpText !== singleBlocker.description && (\n <Text variant=\"supporting\" size=\"sm\">\n {singleBlocker.helpText}\n </Text>\n )}\n </Flex>\n </Alert>\n )\n }\n\n const listItems = enrichedBlockers.map(blocker => blocker.title)\n const defaultMultipleLabel = multipleViewLabel || t('viewAllBlockers')\n\n return (\n <Alert\n status=\"error\"\n label={t('multipleIssuesTitle', { count: blockers.length })}\n className={className}\n >\n <Flex flexDirection=\"column\" gap={16}>\n <UnorderedList items={listItems} />\n {onMultipleViewClick && (\n <div>\n <Button variant=\"secondary\" onClick={onMultipleViewClick} title={defaultMultipleLabel}>\n {defaultMultipleLabel}\n </Button>\n </div>\n )}\n </Flex>\n </Alert>\n )\n}\n"],"names":["PayrollBlockerAlerts","blockers","onMultipleViewClick","multipleViewLabel","className","useI18n","t","useTranslation","Alert","Button","Text","UnorderedList","useComponentContext","hasMultipleBlockers","enrichedBlockers","blocker","translationKeys","getBlockerTranslationKeys","title","l","description","helpText","singleBlocker","jsx","jsxs","Flex","listItems","defaultMultipleLabel"],"mappings":";;;;;;;;AAkBO,SAASA,EAAqB;AAAA,EACnC,UAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,WAAAC;AACF,GAA8B;AAC5B,EAAAC,EAAQ,wBAAwB;AAChC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB,GAC/C,EAAE,OAAAC,GAAO,QAAAC,GAAQ,MAAAC,GAAM,eAAAC,EAAA,IAAkBC,EAAA;AAG/C,MAAIX,EAAS,WAAW;AACtB,WAAO;AAGT,QAAMY,IAAsBZ,EAAS,SAAS,GAExCa,IAAmBb,EAAS,IAAI,CAAAc,MAAW;AAC/C,UAAMC,IAAkBC,EAA0BF,EAAQ,GAAG,GAEvDG,IAAQZ,EAAEU,EAAgB,UAAU;AAAA,MACxC,cAAcD,EAAQ,IAAI,QAAQ,MAAM,GAAG,EAAE,QAAQ,SAAS,CAAAI,MAAKA,EAAE,YAAA,CAAa;AAAA,IAAA,CACnF,GACKC,IAAcd,EAAEU,EAAgB,gBAAgB;AAAA,MACpD,cAAcD,EAAQ,WAAWT,EAAE,2BAA2B;AAAA,IAAA,CAC/D,GACKe,IAAWf,EAAEU,EAAgB,aAAa,EAAE,cAAcV,EAAE,oBAAoB,GAAG;AAEzF,WAAO;AAAA,MACL,GAAGS;AAAA,MACH,OAAAG;AAAA,MACA,aAAAE;AAAA,MACA,UAAAC;AAAA,IAAA;AAAA,EAEJ,CAAC,GAEKC,IAAgBR,EAAiB,CAAC;AAExC,MAAI,CAACD,KAAuBS;AAC1B,WACE,gBAAAC,EAACf,GAAA,EAAM,QAAO,SAAQ,OAAOc,EAAc,OAAO,WAAAlB,GAChD,UAAA,gBAAAoB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAAF,EAACb,GAAA,EAAM,YAAc,YAAA,CAAY;AAAA,MAChCY,EAAc,YAAYA,EAAc,aAAaA,EAAc,eAClE,gBAAAC,EAACb,GAAA,EAAK,SAAQ,cAAa,MAAK,MAC7B,YAAc,SAAA,CACjB;AAAA,IAAA,EAAA,CAEJ,EAAA,CACF;AAIJ,QAAMgB,IAAYZ,EAAiB,IAAI,CAAAC,MAAWA,EAAQ,KAAK,GACzDY,IAAuBxB,KAAqBG,EAAE,iBAAiB;AAErE,SACE,gBAAAiB;AAAA,IAACf;AAAA,IAAA;AAAA,MACC,QAAO;AAAA,MACP,OAAOF,EAAE,uBAAuB,EAAE,OAAOL,EAAS,QAAQ;AAAA,MAC1D,WAAAG;AAAA,MAEA,UAAA,gBAAAoB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,QAAA,gBAAAF,EAACZ,GAAA,EAAc,OAAOe,EAAA,CAAW;AAAA,QAChCxB,KACC,gBAAAqB,EAAC,OAAA,EACC,UAAA,gBAAAA,EAACd,GAAA,EAAO,SAAQ,aAAY,SAASP,GAAqB,OAAOyB,GAC9D,UAAAA,EAAA,CACH,EAAA,CACF;AAAA,MAAA,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -4,12 +4,11 @@ import f from "classnames";
|
|
|
4
4
|
import u from "./PayrollBlockerList.module.scss.js";
|
|
5
5
|
import { useComponentContext as h } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
6
|
import { FlexItem as x, Flex as o } from "../../../Common/Flex/Flex.js";
|
|
7
|
-
import "../../../../shared/constants.js";
|
|
8
7
|
import "react";
|
|
9
8
|
import { DataView as y } from "../../../Common/DataView/DataView.js";
|
|
10
9
|
import { useDataView as g } from "../../../Common/DataView/useDataView.js";
|
|
11
10
|
import { useI18n as b } from "../../../../i18n/I18n.js";
|
|
12
|
-
function
|
|
11
|
+
function I({ blockers: i, className: s }) {
|
|
13
12
|
b("Payroll.PayrollBlocker");
|
|
14
13
|
const { t: l } = p("Payroll.PayrollBlocker"), { Button: c, Text: n, Heading: m } = h(), d = g({
|
|
15
14
|
data: i,
|
|
@@ -36,6 +35,6 @@ function V({ blockers: i, className: s }) {
|
|
|
36
35
|
] }) });
|
|
37
36
|
}
|
|
38
37
|
export {
|
|
39
|
-
|
|
38
|
+
I as PayrollBlockerList
|
|
40
39
|
};
|
|
41
40
|
//# sourceMappingURL=PayrollBlockerList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayrollBlockerList.js","sources":["../../../../../src/components/Payroll/PayrollBlocker/components/PayrollBlockerList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport styles from './PayrollBlockerList.module.scss'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex, FlexItem } from '@/components/Common'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { useI18n } from '@/i18n'\n\nexport interface PayrollBlocker {\n id: string\n title: string\n description: string\n action?: {\n label: string\n onClick: () => void\n }\n}\n\ninterface PayrollBlockerListProps {\n blockers: PayrollBlocker[]\n className?: string\n}\n\n/**\n * PayrollBlockerList - DataView-based component displaying payroll blockers\n * Shows each blocker with individual resolution buttons\n */\nexport function PayrollBlockerList({ blockers, className }: PayrollBlockerListProps) {\n useI18n('Payroll.PayrollBlocker')\n const { t } = useTranslation('Payroll.PayrollBlocker')\n const { Button, Text, Heading } = useComponentContext()\n\n const dataViewProps = useDataView({\n data: blockers,\n columns: [\n {\n title: t('blockerSectionLabel'),\n render: blocker => (\n <FlexItem flexGrow={1}>\n <Flex flexDirection=\"column\" gap={8}>\n <Text weight=\"semibold\">{blocker.title}</Text>\n <Text variant=\"supporting\">{blocker.description}</Text>\n </Flex>\n </FlexItem>\n ),\n },\n {\n title: '',\n render: blocker => {\n // For presentational purposes, just show the primary action if it exists\n const action = blocker.action\n\n if (!action) {\n return null\n }\n\n return (\n <Flex justifyContent=\"flex-end\" alignItems=\"center\">\n <Button variant=\"secondary\" onClick={action.onClick} title={action.label}>\n {action.label}\n </Button>\n </Flex>\n )\n },\n },\n ],\n })\n\n if (blockers.length === 0) {\n return null\n }\n\n return (\n <div className={classNames(styles.root, className)}>\n <Flex flexDirection=\"column\" gap={24}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('blockersListTitle')}\n </Heading>\n\n <DataView {...dataViewProps} label={t('blockersListTitle')} />\n </Flex>\n </div>\n )\n}\n"],"names":["PayrollBlockerList","blockers","className","useI18n","t","useTranslation","Button","Text","Heading","useComponentContext","dataViewProps","useDataView","blocker","jsx","FlexItem","jsxs","Flex","action","classNames","styles","DataView"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PayrollBlockerList.js","sources":["../../../../../src/components/Payroll/PayrollBlocker/components/PayrollBlockerList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport styles from './PayrollBlockerList.module.scss'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex, FlexItem } from '@/components/Common'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { useI18n } from '@/i18n'\n\nexport interface PayrollBlocker {\n id: string\n title: string\n description: string\n action?: {\n label: string\n onClick: () => void\n }\n}\n\ninterface PayrollBlockerListProps {\n blockers: PayrollBlocker[]\n className?: string\n}\n\n/**\n * PayrollBlockerList - DataView-based component displaying payroll blockers\n * Shows each blocker with individual resolution buttons\n */\nexport function PayrollBlockerList({ blockers, className }: PayrollBlockerListProps) {\n useI18n('Payroll.PayrollBlocker')\n const { t } = useTranslation('Payroll.PayrollBlocker')\n const { Button, Text, Heading } = useComponentContext()\n\n const dataViewProps = useDataView({\n data: blockers,\n columns: [\n {\n title: t('blockerSectionLabel'),\n render: blocker => (\n <FlexItem flexGrow={1}>\n <Flex flexDirection=\"column\" gap={8}>\n <Text weight=\"semibold\">{blocker.title}</Text>\n <Text variant=\"supporting\">{blocker.description}</Text>\n </Flex>\n </FlexItem>\n ),\n },\n {\n title: '',\n render: blocker => {\n // For presentational purposes, just show the primary action if it exists\n const action = blocker.action\n\n if (!action) {\n return null\n }\n\n return (\n <Flex justifyContent=\"flex-end\" alignItems=\"center\">\n <Button variant=\"secondary\" onClick={action.onClick} title={action.label}>\n {action.label}\n </Button>\n </Flex>\n )\n },\n },\n ],\n })\n\n if (blockers.length === 0) {\n return null\n }\n\n return (\n <div className={classNames(styles.root, className)}>\n <Flex flexDirection=\"column\" gap={24}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('blockersListTitle')}\n </Heading>\n\n <DataView {...dataViewProps} label={t('blockersListTitle')} />\n </Flex>\n </div>\n )\n}\n"],"names":["PayrollBlockerList","blockers","className","useI18n","t","useTranslation","Button","Text","Heading","useComponentContext","dataViewProps","useDataView","blocker","jsx","FlexItem","jsxs","Flex","action","classNames","styles","DataView"],"mappings":";;;;;;;;;;AA4BO,SAASA,EAAmB,EAAE,UAAAC,GAAU,WAAAC,KAAsC;AACnF,EAAAC,EAAQ,wBAAwB;AAChC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB,GAC/C,EAAE,QAAAC,GAAQ,MAAAC,GAAM,SAAAC,EAAA,IAAYC,EAAA,GAE5BC,IAAgBC,EAAY;AAAA,IAChC,MAAMV;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,OAAOG,EAAE,qBAAqB;AAAA,QAC9B,QAAQ,CAAAQ,MACN,gBAAAC,EAACC,GAAA,EAAS,UAAU,GAClB,UAAA,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,UAAA,gBAAAH,EAACN,GAAA,EAAK,QAAO,YAAY,UAAAK,EAAQ,OAAM;AAAA,UACvC,gBAAAC,EAACN,GAAA,EAAK,SAAQ,cAAc,YAAQ,YAAA,CAAY;AAAA,QAAA,EAAA,CAClD,EAAA,CACF;AAAA,MAAA;AAAA,MAGJ;AAAA,QACE,OAAO;AAAA,QACP,QAAQ,CAAAK,MAAW;AAEjB,gBAAMK,IAASL,EAAQ;AAEvB,iBAAKK,sBAKFD,GAAA,EAAK,gBAAe,YAAW,YAAW,UACzC,4BAACV,GAAA,EAAO,SAAQ,aAAY,SAASW,EAAO,SAAS,OAAOA,EAAO,OAChE,UAAAA,EAAO,OACV,EAAA,CACF,IARO;AAAA,QAUX;AAAA,MAAA;AAAA,IACF;AAAA,EACF,CACD;AAED,SAAIhB,EAAS,WAAW,IACf,OAIP,gBAAAY,EAAC,OAAA,EAAI,WAAWK,EAAWC,EAAO,MAAMjB,CAAS,GAC/C,UAAA,gBAAAa,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAH,EAACL,KAAQ,IAAG,MAAK,UAAS,MACvB,UAAAJ,EAAE,mBAAmB,GACxB;AAAA,sBAECgB,GAAA,EAAU,GAAGV,GAAe,OAAON,EAAE,mBAAmB,EAAA,CAAG;AAAA,EAAA,EAAA,CAC9D,EAAA,CACF;AAEJ;"}
|
|
@@ -10,15 +10,15 @@ import { TimeOffField as te } from "./TimeOffField.js";
|
|
|
10
10
|
import { Flex as y } from "../../Common/Flex/Flex.js";
|
|
11
11
|
import { Grid as P } from "../../Common/Grid/Grid.js";
|
|
12
12
|
import "classnames";
|
|
13
|
-
import {
|
|
13
|
+
import { useComponentContext as ne } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
+
import { useI18n as re } from "../../../i18n/I18n.js";
|
|
15
|
+
import { Form as ie } from "../../Common/Form/Form.js";
|
|
16
|
+
import { firstLastName as se, formatNumberAsCurrency as oe } from "../../../helpers/formattedStrings.js";
|
|
17
|
+
import { getAdditionalEarningsCompensations as ae, getReimbursementCompensation as me, calculateGrossPay as k } from "../helpers.js";
|
|
18
|
+
import { HOURS_COMPENSATION_NAMES as w, EXCLUDED_ADDITIONAL_EARNINGS as le, COMPENSATION_NAME_DOUBLE_OVERTIME as de, COMPENSATION_NAME_OVERTIME as ue, COMPENSATION_NAME_REGULAR_HOURS as ce, COMPENSATION_NAME_REIMBURSEMENT as pe, COMPENSATION_NAME_CASH_TIPS as fe, COMPENSATION_NAME_COMMISSION as he, COMPENSATION_NAME_CORRECTION_PAYMENT as Ce, COMPENSATION_NAME_PAYCHECK_TIPS as Ne, COMPENSATION_NAME_BONUS as Ee } from "../../../shared/constants.js";
|
|
19
|
+
import { useContainerBreakpoints as ge } from "../../../hooks/useContainerBreakpoints/useContainerBreakpoints.js";
|
|
14
20
|
import { TextInputField as R } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
15
|
-
import {
|
|
16
|
-
import { useI18n as ie } from "../../../i18n/I18n.js";
|
|
17
|
-
import { Form as se } from "../../Common/Form/Form.js";
|
|
18
|
-
import { firstLastName as oe, formatNumberAsCurrency as ae } from "../../../helpers/formattedStrings.js";
|
|
19
|
-
import { getAdditionalEarningsCompensations as me, getReimbursementCompensation as le, calculateGrossPay as k } from "../helpers.js";
|
|
20
|
-
import { HOURS_COMPENSATION_NAMES as w, EXCLUDED_ADDITIONAL_EARNINGS as de, COMPENSATION_NAME_DOUBLE_OVERTIME as ue, COMPENSATION_NAME_OVERTIME as ce, COMPENSATION_NAME_REGULAR_HOURS as pe, COMPENSATION_NAME_REIMBURSEMENT as fe, COMPENSATION_NAME_CASH_TIPS as he, COMPENSATION_NAME_COMMISSION as Ce, COMPENSATION_NAME_CORRECTION_PAYMENT as Ne, COMPENSATION_NAME_PAYCHECK_TIPS as Ee, COMPENSATION_NAME_BONUS as ge } from "../../../shared/constants.js";
|
|
21
|
-
import { useContainerBreakpoints as be } from "../../../hooks/useContainerBreakpoints/useContainerBreakpoints.js";
|
|
21
|
+
import { RadioGroupField as be } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
22
22
|
const Me = m.object({
|
|
23
23
|
hourlyCompensations: m.record(m.string(), m.record(m.string(), m.string().optional())),
|
|
24
24
|
timeOffCompensations: m.record(m.string(), m.string().optional()),
|
|
@@ -68,22 +68,22 @@ const Me = m.object({
|
|
|
68
68
|
isOffCycle: C = !1,
|
|
69
69
|
withReimbursements: A = !0
|
|
70
70
|
}) => {
|
|
71
|
-
const { Button: v, Heading: c, Text: $ } =
|
|
72
|
-
|
|
73
|
-
const f = d.jobs?.find((e) => e.primary), T = f ? [f] : [], F = Q(null), p =
|
|
71
|
+
const { Button: v, Heading: c, Text: $ } = ne(), { t } = J("Payroll.PayrollEditEmployee");
|
|
72
|
+
re("Payroll.PayrollEditEmployee");
|
|
73
|
+
const f = d.jobs?.find((e) => e.primary), T = f ? [f] : [], F = Q(null), p = ge({
|
|
74
74
|
ref: F
|
|
75
75
|
}).includes("small");
|
|
76
76
|
s?.hourlyCompensations?.forEach((e) => {
|
|
77
77
|
const n = d.jobs?.find((o) => o.uuid === e.jobUuid);
|
|
78
78
|
n && !T.find((o) => o.uuid === n.uuid) && T.push(n);
|
|
79
79
|
});
|
|
80
|
-
const x = (s?.paidTimeOff || []).filter((e) => e.name), _ =
|
|
80
|
+
const x = (s?.paidTimeOff || []).filter((e) => e.name), _ = ae({
|
|
81
81
|
flsaStatus: f?.compensations?.[0]?.flsaStatus,
|
|
82
82
|
existingFixedCompensations: s?.fixedCompensations || [],
|
|
83
83
|
primaryJobUuid: f?.uuid,
|
|
84
84
|
fixedCompensationTypes: b,
|
|
85
|
-
excludedTypes:
|
|
86
|
-
}), N = A ?
|
|
85
|
+
excludedTypes: le
|
|
86
|
+
}), N = A ? me(
|
|
87
87
|
s?.fixedCompensations || [],
|
|
88
88
|
b,
|
|
89
89
|
f?.uuid
|
|
@@ -91,28 +91,28 @@ const Me = m.object({
|
|
|
91
91
|
(o) => o.jobUuid === e && o.name?.toLowerCase() === n.toLowerCase()
|
|
92
92
|
), B = (e) => {
|
|
93
93
|
switch (e) {
|
|
94
|
-
case pe:
|
|
95
|
-
return t("compensationNames.regularHours");
|
|
96
94
|
case ce:
|
|
97
|
-
return t("compensationNames.
|
|
95
|
+
return t("compensationNames.regularHours");
|
|
98
96
|
case ue:
|
|
97
|
+
return t("compensationNames.overtime");
|
|
98
|
+
case de:
|
|
99
99
|
return t("compensationNames.doubleOvertime");
|
|
100
100
|
default:
|
|
101
101
|
return e;
|
|
102
102
|
}
|
|
103
103
|
}, L = (e) => {
|
|
104
104
|
switch (e) {
|
|
105
|
-
case ge:
|
|
106
|
-
return t("fixedCompensationNames.bonus");
|
|
107
105
|
case Ee:
|
|
108
|
-
return t("fixedCompensationNames.
|
|
106
|
+
return t("fixedCompensationNames.bonus");
|
|
109
107
|
case Ne:
|
|
110
|
-
return t("fixedCompensationNames.
|
|
108
|
+
return t("fixedCompensationNames.paycheckTips");
|
|
111
109
|
case Ce:
|
|
112
|
-
return t("fixedCompensationNames.
|
|
110
|
+
return t("fixedCompensationNames.correctionPayment");
|
|
113
111
|
case he:
|
|
114
|
-
return t("fixedCompensationNames.
|
|
112
|
+
return t("fixedCompensationNames.commission");
|
|
115
113
|
case fe:
|
|
114
|
+
return t("fixedCompensationNames.cashTips");
|
|
115
|
+
case pe:
|
|
116
116
|
return t("fixedCompensationNames.reimbursement");
|
|
117
117
|
default:
|
|
118
118
|
return e;
|
|
@@ -186,7 +186,7 @@ const Me = m.object({
|
|
|
186
186
|
i,
|
|
187
187
|
l,
|
|
188
188
|
C
|
|
189
|
-
]), z =
|
|
189
|
+
]), z = se({
|
|
190
190
|
first_name: d.firstName,
|
|
191
191
|
last_name: d.lastName
|
|
192
192
|
}), W = (e) => {
|
|
@@ -197,7 +197,7 @@ const Me = m.object({
|
|
|
197
197
|
f?.uuid
|
|
198
198
|
);
|
|
199
199
|
E(n);
|
|
200
|
-
}, U =
|
|
200
|
+
}, U = oe(V || 0), D = /* @__PURE__ */ a(
|
|
201
201
|
y,
|
|
202
202
|
{
|
|
203
203
|
flexDirection: p ? "row" : "column",
|
|
@@ -236,7 +236,7 @@ const Me = m.object({
|
|
|
236
236
|
}
|
|
237
237
|
),
|
|
238
238
|
/* @__PURE__ */ a(X, { ...I, children: [
|
|
239
|
-
/* @__PURE__ */ a(
|
|
239
|
+
/* @__PURE__ */ a(ie, { children: [
|
|
240
240
|
T.length > 0 && /* @__PURE__ */ a("div", { className: u.fieldGroup, children: [
|
|
241
241
|
/* @__PURE__ */ r(c, { as: "h3", children: t("regularHoursTitle") }),
|
|
242
242
|
T.map((e) => /* @__PURE__ */ a(y, { flexDirection: "column", gap: 8, children: [
|
|
@@ -309,7 +309,7 @@ const Me = m.object({
|
|
|
309
309
|
/* @__PURE__ */ a("div", { className: u.fieldGroup, children: [
|
|
310
310
|
/* @__PURE__ */ r(c, { as: "h4", children: t("paymentMethodTitle") }),
|
|
311
311
|
/* @__PURE__ */ r(
|
|
312
|
-
|
|
312
|
+
be,
|
|
313
313
|
{
|
|
314
314
|
name: "paymentMethod",
|
|
315
315
|
isRequired: !0,
|
|
@@ -4,24 +4,23 @@ import { useFormContext as d, useWatch as f } from "react-hook-form";
|
|
|
4
4
|
import { useTranslation as m } from "react-i18next";
|
|
5
5
|
import { Flex as y } from "../../Common/Flex/Flex.js";
|
|
6
6
|
import "classnames";
|
|
7
|
-
import "../../../
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { useI18n as B } from "../../../i18n/I18n.js";
|
|
7
|
+
import { useComponentContext as x } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
|
+
import { useI18n as h } from "../../../i18n/I18n.js";
|
|
9
|
+
import { TextInputField as B } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
11
10
|
const P = ({
|
|
12
11
|
accrualBalance: e,
|
|
13
12
|
accrualMethod: o,
|
|
14
13
|
hoursUsed: r,
|
|
15
14
|
id: t
|
|
16
15
|
}) => {
|
|
17
|
-
const { Text: n } =
|
|
16
|
+
const { Text: n } = x(), { t: l } = m("Payroll.PayrollEditEmployee");
|
|
18
17
|
if (o === "unlimited")
|
|
19
18
|
return null;
|
|
20
19
|
const a = parseFloat(e) - r;
|
|
21
20
|
return /* @__PURE__ */ i(n, { size: "sm", variant: "supporting", "aria-live": "polite", "aria-atomic": !0, id: t, children: l("timeOffBalance.remaining", { balance: a.toFixed(1) }) });
|
|
22
|
-
},
|
|
21
|
+
}, M = ({ timeOff: e, employee: o }) => {
|
|
23
22
|
const { t: r } = m("Payroll.PayrollEditEmployee");
|
|
24
|
-
|
|
23
|
+
h("Payroll.PayrollEditEmployee");
|
|
25
24
|
const { control: t } = d(), n = p(), l = f({
|
|
26
25
|
control: t,
|
|
27
26
|
name: `timeOffCompensations.${e.name}`
|
|
@@ -31,7 +30,7 @@ const P = ({
|
|
|
31
30
|
const c = parseFloat(l || "0"), a = o.eligiblePaidTimeOff?.find((s) => s.name === e.name);
|
|
32
31
|
return /* @__PURE__ */ u(y, { flexDirection: "column", gap: 4, children: [
|
|
33
32
|
/* @__PURE__ */ i(
|
|
34
|
-
|
|
33
|
+
B,
|
|
35
34
|
{
|
|
36
35
|
name: `timeOffCompensations.${e.name}`,
|
|
37
36
|
type: "number",
|
|
@@ -54,6 +53,6 @@ const P = ({
|
|
|
54
53
|
] });
|
|
55
54
|
};
|
|
56
55
|
export {
|
|
57
|
-
|
|
56
|
+
M as TimeOffField
|
|
58
57
|
};
|
|
59
58
|
//# sourceMappingURL=TimeOffField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeOffField.js","sources":["../../../../src/components/Payroll/PayrollEditEmployee/TimeOffField.tsx"],"sourcesContent":["import { useId } from 'react'\nimport { useWatch, useFormContext } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { PayrollEmployeeCompensationsTypePaidTimeOff } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollEditEmployeeFormValues } from './PayrollEditEmployeePresentation'\nimport { Flex, TextInputField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nexport interface TimeOffFieldProps {\n timeOff: PayrollEmployeeCompensationsTypePaidTimeOff\n employee: Employee\n}\n\nconst TimeOffBalance = ({\n accrualBalance,\n accrualMethod,\n hoursUsed,\n id,\n}: {\n accrualBalance: string\n accrualMethod?: string\n hoursUsed: number\n id: string\n}) => {\n const { Text } = useComponentContext()\n const { t } = useTranslation('Payroll.PayrollEditEmployee')\n\n if (accrualMethod === 'unlimited') {\n return null\n }\n\n const currentBalance = parseFloat(accrualBalance)\n const remainingBalance = currentBalance - hoursUsed\n\n return (\n <Text size=\"sm\" variant=\"supporting\" aria-live=\"polite\" aria-atomic={true} id={id}>\n {t('timeOffBalance.remaining', { balance: remainingBalance.toFixed(1) })}\n </Text>\n )\n}\n\nexport const TimeOffField = ({ timeOff, employee }: TimeOffFieldProps) => {\n const { t } = useTranslation('Payroll.PayrollEditEmployee')\n useI18n('Payroll.PayrollEditEmployee')\n\n const { control } = useFormContext<PayrollEditEmployeeFormValues>()\n const id = useId()\n\n const watchedValue = useWatch({\n control,\n name: `timeOffCompensations.${timeOff.name}`,\n })\n\n if (!timeOff.name) {\n return null\n }\n\n const hoursUsed = parseFloat(watchedValue || '0')\n const eligiblePolicy = employee.eligiblePaidTimeOff?.find(policy => policy.name === timeOff.name)\n\n return (\n <Flex flexDirection=\"column\" gap={4}>\n <TextInputField\n key={timeOff.name}\n name={`timeOffCompensations.${timeOff.name}`}\n type=\"number\"\n adornmentEnd={t('hoursUnit')}\n isRequired\n label={timeOff.name}\n aria-describedby={id}\n />\n {eligiblePolicy?.accrualBalance && (\n <TimeOffBalance\n accrualBalance={eligiblePolicy.accrualBalance}\n accrualMethod={eligiblePolicy.accrualMethod ?? undefined}\n hoursUsed={hoursUsed}\n id={id}\n />\n )}\n </Flex>\n )\n}\n"],"names":["TimeOffBalance","accrualBalance","accrualMethod","hoursUsed","id","Text","useComponentContext","t","useTranslation","remainingBalance","jsx","TimeOffField","timeOff","employee","useI18n","control","useFormContext","useId","watchedValue","useWatch","eligiblePolicy","policy","jsxs","Flex","TextInputField"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TimeOffField.js","sources":["../../../../src/components/Payroll/PayrollEditEmployee/TimeOffField.tsx"],"sourcesContent":["import { useId } from 'react'\nimport { useWatch, useFormContext } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { PayrollEmployeeCompensationsTypePaidTimeOff } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollEditEmployeeFormValues } from './PayrollEditEmployeePresentation'\nimport { Flex, TextInputField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nexport interface TimeOffFieldProps {\n timeOff: PayrollEmployeeCompensationsTypePaidTimeOff\n employee: Employee\n}\n\nconst TimeOffBalance = ({\n accrualBalance,\n accrualMethod,\n hoursUsed,\n id,\n}: {\n accrualBalance: string\n accrualMethod?: string\n hoursUsed: number\n id: string\n}) => {\n const { Text } = useComponentContext()\n const { t } = useTranslation('Payroll.PayrollEditEmployee')\n\n if (accrualMethod === 'unlimited') {\n return null\n }\n\n const currentBalance = parseFloat(accrualBalance)\n const remainingBalance = currentBalance - hoursUsed\n\n return (\n <Text size=\"sm\" variant=\"supporting\" aria-live=\"polite\" aria-atomic={true} id={id}>\n {t('timeOffBalance.remaining', { balance: remainingBalance.toFixed(1) })}\n </Text>\n )\n}\n\nexport const TimeOffField = ({ timeOff, employee }: TimeOffFieldProps) => {\n const { t } = useTranslation('Payroll.PayrollEditEmployee')\n useI18n('Payroll.PayrollEditEmployee')\n\n const { control } = useFormContext<PayrollEditEmployeeFormValues>()\n const id = useId()\n\n const watchedValue = useWatch({\n control,\n name: `timeOffCompensations.${timeOff.name}`,\n })\n\n if (!timeOff.name) {\n return null\n }\n\n const hoursUsed = parseFloat(watchedValue || '0')\n const eligiblePolicy = employee.eligiblePaidTimeOff?.find(policy => policy.name === timeOff.name)\n\n return (\n <Flex flexDirection=\"column\" gap={4}>\n <TextInputField\n key={timeOff.name}\n name={`timeOffCompensations.${timeOff.name}`}\n type=\"number\"\n adornmentEnd={t('hoursUnit')}\n isRequired\n label={timeOff.name}\n aria-describedby={id}\n />\n {eligiblePolicy?.accrualBalance && (\n <TimeOffBalance\n accrualBalance={eligiblePolicy.accrualBalance}\n accrualMethod={eligiblePolicy.accrualMethod ?? undefined}\n hoursUsed={hoursUsed}\n id={id}\n />\n )}\n </Flex>\n )\n}\n"],"names":["TimeOffBalance","accrualBalance","accrualMethod","hoursUsed","id","Text","useComponentContext","t","useTranslation","remainingBalance","jsx","TimeOffField","timeOff","employee","useI18n","control","useFormContext","useId","watchedValue","useWatch","eligiblePolicy","policy","jsxs","Flex","TextInputField"],"mappings":";;;;;;;;;AAeA,MAAMA,IAAiB,CAAC;AAAA,EACtB,gBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC;AAAA,EACA,IAAAC;AACF,MAKM;AACJ,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAA,GACX,EAAE,GAAAC,EAAA,IAAMC,EAAe,6BAA6B;AAE1D,MAAIN,MAAkB;AACpB,WAAO;AAIT,QAAMO,IADiB,WAAWR,CAAc,IACNE;AAE1C,SACE,gBAAAO,EAACL,KAAK,MAAK,MAAK,SAAQ,cAAa,aAAU,UAAS,eAAa,IAAM,IAAAD,GACxE,UAAAG,EAAE,4BAA4B,EAAE,SAASE,EAAiB,QAAQ,CAAC,EAAA,CAAG,GACzE;AAEJ,GAEaE,IAAe,CAAC,EAAE,SAAAC,GAAS,UAAAC,QAAkC;AACxE,QAAM,EAAE,GAAAN,EAAA,IAAMC,EAAe,6BAA6B;AAC1D,EAAAM,EAAQ,6BAA6B;AAErC,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACdZ,IAAKa,EAAA,GAELC,IAAeC,EAAS;AAAA,IAC5B,SAAAJ;AAAA,IACA,MAAM,wBAAwBH,EAAQ,IAAI;AAAA,EAAA,CAC3C;AAED,MAAI,CAACA,EAAQ;AACX,WAAO;AAGT,QAAMT,IAAY,WAAWe,KAAgB,GAAG,GAC1CE,IAAiBP,EAAS,qBAAqB,KAAK,OAAUQ,EAAO,SAAST,EAAQ,IAAI;AAEhG,SACE,gBAAAU,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,IAAA,gBAAAb;AAAA,MAACc;AAAA,MAAA;AAAA,QAEC,MAAM,wBAAwBZ,EAAQ,IAAI;AAAA,QAC1C,MAAK;AAAA,QACL,cAAcL,EAAE,WAAW;AAAA,QAC3B,YAAU;AAAA,QACV,OAAOK,EAAQ;AAAA,QACf,oBAAkBR;AAAA,MAAA;AAAA,MANbQ,EAAQ;AAAA,IAAA;AAAA,IAQdQ,GAAgB,kBACf,gBAAAV;AAAA,MAACV;AAAA,MAAA;AAAA,QACC,gBAAgBoB,EAAe;AAAA,QAC/B,eAAeA,EAAe,iBAAiB;AAAA,QAC/C,WAAAjB;AAAA,QACA,IAAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GAEJ;AAEJ;"}
|
|
@@ -4,7 +4,6 @@ import { getPayrollType as I, calculateTotalPayroll as L } from "../helpers.js";
|
|
|
4
4
|
import j from "./PayrollHistoryPresentation.module.scss.js";
|
|
5
5
|
import { Flex as c } from "../../Common/Flex/Flex.js";
|
|
6
6
|
import "classnames";
|
|
7
|
-
import "../../../shared/constants.js";
|
|
8
7
|
import { HamburgerMenu as V } from "../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
9
8
|
import { useComponentContext as Y } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
9
|
import { formatNumberAsCurrency as q } from "../../../helpers/formattedStrings.js";
|
|
@@ -15,7 +14,7 @@ import W from "../../../assets/icons/icon-file-outline.svg.js";
|
|
|
15
14
|
import _ from "../../../assets/icons/icon-receipt-outline.svg.js";
|
|
16
15
|
import { PayrollStatusBadges as z } from "../PayrollStatusBadges/PayrollStatusBadges.js";
|
|
17
16
|
import { DataView as E } from "../../Common/DataView/DataView.js";
|
|
18
|
-
const
|
|
17
|
+
const de = ({
|
|
19
18
|
payrollHistory: y,
|
|
20
19
|
wireInRequests: g,
|
|
21
20
|
selectedTimeFilter: P,
|
|
@@ -23,7 +22,7 @@ const ue = ({
|
|
|
23
22
|
onViewSummary: w,
|
|
24
23
|
onViewReceipt: b,
|
|
25
24
|
onCancelPayroll: C,
|
|
26
|
-
cancelDialogItem:
|
|
25
|
+
cancelDialogItem: a,
|
|
27
26
|
onCancelDialogOpen: F,
|
|
28
27
|
onCancelDialogClose: T,
|
|
29
28
|
isLoading: v = !1
|
|
@@ -38,7 +37,7 @@ const ue = ({
|
|
|
38
37
|
if (e.payrollStatusMeta?.cancellable === !1)
|
|
39
38
|
return !1;
|
|
40
39
|
if (e.processed && e.payrollDeadline) {
|
|
41
|
-
const o = /* @__PURE__ */ new Date(), n = new Date(e.payrollDeadline),
|
|
40
|
+
const o = /* @__PURE__ */ new Date(), n = new Date(e.payrollDeadline), i = h(o), s = new Date(o.getTime() + i * 60 * 60 * 1e3), m = new Date(
|
|
42
41
|
n.getTime() + h(n) * 60 * 60 * 1e3
|
|
43
42
|
);
|
|
44
43
|
if (s.toDateString() === m.toDateString()) {
|
|
@@ -51,27 +50,27 @@ const ue = ({
|
|
|
51
50
|
}, h = (e) => {
|
|
52
51
|
const o = e.getFullYear(), n = new Date(o, 2, 1);
|
|
53
52
|
n.setDate(1 + (7 - n.getDay()) + 7);
|
|
54
|
-
const
|
|
55
|
-
return
|
|
53
|
+
const i = new Date(o, 10, 1);
|
|
54
|
+
return i.setDate(1 + (7 - i.getDay()) % 7), e >= n && e < i ? -7 : -8;
|
|
56
55
|
}, O = (e) => {
|
|
57
56
|
const o = e.payrollDeadline;
|
|
58
57
|
if (!o) return "";
|
|
59
|
-
const n = new Date(o),
|
|
58
|
+
const n = new Date(o), i = "America/New_York", s = new Intl.DateTimeFormat("en-US", {
|
|
60
59
|
weekday: "short",
|
|
61
60
|
month: "short",
|
|
62
61
|
day: "numeric",
|
|
63
|
-
timeZone:
|
|
62
|
+
timeZone: i
|
|
64
63
|
}), m = new Intl.DateTimeFormat("en-US", {
|
|
65
64
|
hour: "numeric",
|
|
66
65
|
minute: "2-digit",
|
|
67
66
|
timeZoneName: "short",
|
|
68
|
-
timeZone:
|
|
67
|
+
timeZone: i
|
|
69
68
|
}), D = s.format(n);
|
|
70
69
|
return `${m.format(n)} on ${D}`;
|
|
71
70
|
}, R = (e) => {
|
|
72
71
|
F(e);
|
|
73
72
|
}, M = () => {
|
|
74
|
-
|
|
73
|
+
a && C(a);
|
|
75
74
|
}, N = (e) => {
|
|
76
75
|
const o = e.payrollUuid || e.uuid, n = [
|
|
77
76
|
{
|
|
@@ -168,23 +167,23 @@ const ue = ({
|
|
|
168
167
|
/* @__PURE__ */ r(
|
|
169
168
|
k,
|
|
170
169
|
{
|
|
171
|
-
isOpen: !!
|
|
170
|
+
isOpen: !!a,
|
|
172
171
|
onClose: T,
|
|
173
172
|
onPrimaryActionClick: M,
|
|
174
173
|
isDestructive: !0,
|
|
175
174
|
isPrimaryActionLoading: v,
|
|
176
175
|
primaryActionLabel: t("cancelDialog.primaryAction"),
|
|
177
176
|
closeActionLabel: t("cancelDialog.secondaryAction"),
|
|
178
|
-
title:
|
|
177
|
+
title: a ? t("cancelDialog.title", {
|
|
179
178
|
payPeriod: u.formatPayPeriodRange(
|
|
180
|
-
|
|
181
|
-
|
|
179
|
+
a.payPeriod?.startDate,
|
|
180
|
+
a.payPeriod?.endDate
|
|
182
181
|
)
|
|
183
182
|
}) : "",
|
|
184
|
-
children:
|
|
183
|
+
children: a && /* @__PURE__ */ d(c, { flexDirection: "column", gap: 16, children: [
|
|
185
184
|
/* @__PURE__ */ r(l, { children: t("cancelDialog.body") }),
|
|
186
|
-
|
|
187
|
-
deadline: O(
|
|
185
|
+
a.payrollDeadline && /* @__PURE__ */ r(l, { children: t("cancelDialog.deadline", {
|
|
186
|
+
deadline: O(a)
|
|
188
187
|
}) })
|
|
189
188
|
] })
|
|
190
189
|
}
|
|
@@ -192,6 +191,6 @@ const ue = ({
|
|
|
192
191
|
] });
|
|
193
192
|
};
|
|
194
193
|
export {
|
|
195
|
-
|
|
194
|
+
de as PayrollHistoryPresentation
|
|
196
195
|
};
|
|
197
196
|
//# sourceMappingURL=PayrollHistoryPresentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayrollHistoryPresentation.js","sources":["../../../../src/components/Payroll/PayrollHistory/PayrollHistoryPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Payroll } from '@gusto/embedded-api/models/components/payroll'\nimport type { WireInRequest } from '@gusto/embedded-api/models/components/wireinrequest'\nimport { PayrollStatusBadges } from '../PayrollStatusBadges'\nimport { getPayrollType, calculateTotalPayroll } from '../helpers'\nimport type { TimeFilterOption } from './PayrollHistory'\nimport styles from './PayrollHistoryPresentation.module.scss'\nimport type { MenuItem } from '@/components/Common/UI/Menu/MenuTypes'\nimport { DataView, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\nimport { useI18n } from '@/i18n'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport TrashcanIcon from '@/assets/icons/trashcan.svg?react'\nimport FileIcon from '@/assets/icons/icon-file-outline.svg?react'\nimport ReceiptIcon from '@/assets/icons/icon-receipt-outline.svg?react'\n\ninterface PayrollHistoryPresentationProps {\n payrollHistory: Payroll[]\n wireInRequests: WireInRequest[]\n selectedTimeFilter: TimeFilterOption\n onTimeFilterChange: (value: TimeFilterOption) => void\n onViewSummary: (payrollId: string) => void\n onViewReceipt: (payrollId: string) => void\n onCancelPayroll: (item: Payroll) => void\n cancelDialogItem: Payroll | null\n onCancelDialogOpen: (item: Payroll) => void\n onCancelDialogClose: () => void\n isLoading?: boolean\n}\n\nexport const PayrollHistoryPresentation = ({\n payrollHistory,\n wireInRequests,\n selectedTimeFilter,\n onTimeFilterChange,\n onViewSummary,\n onViewReceipt,\n onCancelPayroll,\n cancelDialogItem,\n onCancelDialogOpen,\n onCancelDialogClose,\n isLoading = false,\n}: PayrollHistoryPresentationProps) => {\n const { Heading, Text, Select, Dialog } = useComponentContext()\n useI18n('Payroll.PayrollHistory')\n const { t } = useTranslation('Payroll.PayrollHistory')\n const dateFormatter = useDateFormatter()\n\n const timeFilterOptions = [\n { value: '3months', label: t('timeFilter.options.3months') },\n { value: '6months', label: t('timeFilter.options.6months') },\n { value: 'year', label: t('timeFilter.options.year') },\n ]\n\n const canCancelPayroll = (item: Payroll) => {\n if (item.payrollStatusMeta?.cancellable === false) {\n return false\n }\n\n if (item.processed && item.payrollDeadline) {\n const now = new Date()\n const deadline = new Date(item.payrollDeadline)\n\n const ptOffset = getPacificTimeOffset(now)\n const nowInPT = new Date(now.getTime() + ptOffset * 60 * 60 * 1000)\n const deadlineInPT = new Date(\n deadline.getTime() + getPacificTimeOffset(deadline) * 60 * 60 * 1000,\n )\n\n const isSameDay = nowInPT.toDateString() === deadlineInPT.toDateString()\n if (isSameDay) {\n const cutoffTime = new Date(deadlineInPT)\n cutoffTime.setHours(15, 30, 0, 0)\n\n if (nowInPT > cutoffTime) {\n return false\n }\n }\n }\n\n return true\n }\n\n const getPacificTimeOffset = (date: Date): number => {\n const year = date.getFullYear()\n\n const secondSundayMarch = new Date(year, 2, 1)\n secondSundayMarch.setDate(1 + (7 - secondSundayMarch.getDay()) + 7)\n\n const firstSundayNovember = new Date(year, 10, 1)\n firstSundayNovember.setDate(1 + ((7 - firstSundayNovember.getDay()) % 7))\n\n const isDST = date >= secondSundayMarch && date < firstSundayNovember\n return isDST ? -7 : -8\n }\n\n const formatDeadlineForDialog = (item: Payroll): string => {\n const deadline = item.payrollDeadline\n if (!deadline) return ''\n\n const deadlineDate = new Date(deadline)\n const timeZone = 'America/New_York'\n\n const formatter = new Intl.DateTimeFormat('en-US', {\n weekday: 'short',\n month: 'short',\n day: 'numeric',\n timeZone,\n })\n\n const timeFormatter = new Intl.DateTimeFormat('en-US', {\n hour: 'numeric',\n minute: '2-digit',\n timeZoneName: 'short',\n timeZone,\n })\n\n const dateStr = formatter.format(deadlineDate)\n const timeStr = timeFormatter.format(deadlineDate)\n\n return `${timeStr} on ${dateStr}`\n }\n\n const handleCancelClick = (item: Payroll) => {\n onCancelDialogOpen(item)\n }\n\n const handleConfirmCancel = () => {\n if (cancelDialogItem) {\n onCancelPayroll(cancelDialogItem)\n }\n }\n\n const getMenuItems = (item: Payroll): MenuItem[] => {\n const payrollId = item.payrollUuid || item.uuid!\n const items: MenuItem[] = [\n {\n label: t('menu.viewSummary'),\n icon: <FileIcon aria-hidden />,\n onClick: () => {\n onViewSummary(payrollId)\n },\n },\n {\n label: t('menu.viewReceipt'),\n icon: <ReceiptIcon aria-hidden />,\n onClick: () => {\n onViewReceipt(payrollId)\n },\n },\n ]\n\n if (canCancelPayroll(item)) {\n items.push({\n label: t('menu.cancelPayroll'),\n icon: <TrashcanIcon aria-hidden />,\n onClick: () => {\n handleCancelClick(item)\n },\n 'data-destructive': 'true',\n })\n }\n\n return items\n }\n\n if (payrollHistory.length === 0) {\n return (\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={24}>\n <Heading as=\"h3\">{t('emptyState.title')}</Heading>\n <Text>{t('emptyState.description')}</Text>\n </Flex>\n )\n }\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n <Flex\n flexDirection={{ base: 'column', medium: 'row' }}\n justifyContent=\"space-between\"\n alignItems=\"flex-start\"\n gap={{ base: 12, medium: 24 }}\n >\n <Flex>\n <Heading as=\"h2\">{t('title')}</Heading>\n </Flex>\n <div className={styles.timeFilterContainer}>\n <Select\n value={selectedTimeFilter}\n onChange={(value: string) => {\n onTimeFilterChange(value as TimeFilterOption)\n }}\n options={timeFilterOptions}\n label={t('timeFilter.placeholder')}\n shouldVisuallyHideLabel\n isRequired\n />\n </div>\n </Flex>\n\n <DataView\n label={t('dataView.label')}\n columns={[\n {\n title: t('columns.payPeriod'),\n render: (item: Payroll) => (\n <Text>\n {dateFormatter.formatPayPeriodRange(\n item.payPeriod?.startDate,\n item.payPeriod?.endDate,\n )}\n </Text>\n ),\n },\n {\n title: t('columns.type'),\n render: (item: Payroll) => <Text>{getPayrollType(item)}</Text>,\n },\n {\n title: t('columns.payDate'),\n render: (item: Payroll) => (\n <Text>{dateFormatter.formatShortWithYear(item.checkDate)}</Text>\n ),\n },\n {\n title: t('columns.status'),\n render: (item: Payroll) => {\n const wireInRequest = wireInRequests.find(\n wire => wire.paymentUuid === item.payrollUuid,\n )\n return <PayrollStatusBadges payroll={item} wireInRequest={wireInRequest} />\n },\n },\n {\n title: t('columns.totalPayroll'),\n render: (item: Payroll) => (\n <Text weight=\"semibold\">{formatNumberAsCurrency(calculateTotalPayroll(item))}</Text>\n ),\n },\n ]}\n data={payrollHistory}\n itemMenu={(item: Payroll) => <HamburgerMenu items={getMenuItems(item)} />}\n />\n\n <Dialog\n isOpen={!!cancelDialogItem}\n onClose={onCancelDialogClose}\n onPrimaryActionClick={handleConfirmCancel}\n isDestructive\n isPrimaryActionLoading={isLoading}\n primaryActionLabel={t('cancelDialog.primaryAction')}\n closeActionLabel={t('cancelDialog.secondaryAction')}\n title={\n cancelDialogItem\n ? t('cancelDialog.title', {\n payPeriod: dateFormatter.formatPayPeriodRange(\n cancelDialogItem.payPeriod?.startDate,\n cancelDialogItem.payPeriod?.endDate,\n ),\n })\n : ''\n }\n >\n {cancelDialogItem && (\n <Flex flexDirection=\"column\" gap={16}>\n <Text>{t('cancelDialog.body')}</Text>\n {cancelDialogItem.payrollDeadline && (\n <Text>\n {t('cancelDialog.deadline', {\n deadline: formatDeadlineForDialog(cancelDialogItem),\n })}\n </Text>\n )}\n </Flex>\n )}\n </Dialog>\n </Flex>\n )\n}\n"],"names":["PayrollHistoryPresentation","payrollHistory","wireInRequests","selectedTimeFilter","onTimeFilterChange","onViewSummary","onViewReceipt","onCancelPayroll","cancelDialogItem","onCancelDialogOpen","onCancelDialogClose","isLoading","Heading","Text","Select","Dialog","useComponentContext","useI18n","useTranslation","dateFormatter","useDateFormatter","timeFilterOptions","canCancelPayroll","item","now","deadline","ptOffset","getPacificTimeOffset","nowInPT","deadlineInPT","cutoffTime","date","year","secondSundayMarch","firstSundayNovember","formatDeadlineForDialog","deadlineDate","timeZone","formatter","timeFormatter","dateStr","handleCancelClick","handleConfirmCancel","getMenuItems","payrollId","items","jsx","FileIcon","ReceiptIcon","TrashcanIcon","Flex","jsxs","styles","value","DataView","getPayrollType","wireInRequest","wire","PayrollStatusBadges","formatNumberAsCurrency","calculateTotalPayroll","HamburgerMenu"],"mappings":";;;;;;;;;;;;;;;;;AAgCO,MAAMA,KAA6B,CAAC;AAAA,EACzC,gBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,WAAAC,IAAY;AACd,MAAuC;AACrC,QAAM,EAAE,SAAAC,GAAS,MAAAC,GAAM,QAAAC,GAAQ,QAAAC,EAAA,IAAWC,EAAA;AAC1C,EAAAC,EAAQ,wBAAwB;AAChC,QAAM,EAAE,EAA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kBAAkB,EAAE,8BAA8B;AAAA,QAClD,OACEH,IACI,EAAE,sBAAsB;AAAA,UACtB,WAAWW,EAAc;AAAA,YACvBX,EAAiB,WAAW;AAAA,YAC5BA,EAAiB,WAAW;AAAA,UAAA;AAAA,QAC9B,CACD,IACD;AAAA,QAGL,eACC,gBAAA2C,EAACD,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,UAAA,gBAAAJ,EAACjC,GAAA,EAAM,UAAA,EAAE,mBAAmB,EAAA,CAAE;AAAA,UAC7BL,EAAiB,mBAChB,gBAAAsC,EAACjC,GAAA,EACE,YAAE,yBAAyB;AAAA,YAC1B,UAAUsB,EAAwB3B,CAAgB;AAAA,UAAA,CACnD,EAAA,CACH;AAAA,QAAA,EAAA,CAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAEJ,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"PayrollHistoryPresentation.js","sources":["../../../../src/components/Payroll/PayrollHistory/PayrollHistoryPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Payroll } from '@gusto/embedded-api/models/components/payroll'\nimport type { WireInRequest } from '@gusto/embedded-api/models/components/wireinrequest'\nimport { PayrollStatusBadges } from '../PayrollStatusBadges'\nimport { getPayrollType, calculateTotalPayroll } from '../helpers'\nimport type { TimeFilterOption } from './PayrollHistory'\nimport styles from './PayrollHistoryPresentation.module.scss'\nimport type { MenuItem } from '@/components/Common/UI/Menu/MenuTypes'\nimport { DataView, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\nimport { useI18n } from '@/i18n'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport TrashcanIcon from '@/assets/icons/trashcan.svg?react'\nimport FileIcon from '@/assets/icons/icon-file-outline.svg?react'\nimport ReceiptIcon from '@/assets/icons/icon-receipt-outline.svg?react'\n\ninterface PayrollHistoryPresentationProps {\n payrollHistory: Payroll[]\n wireInRequests: WireInRequest[]\n selectedTimeFilter: TimeFilterOption\n onTimeFilterChange: (value: TimeFilterOption) => void\n onViewSummary: (payrollId: string) => void\n onViewReceipt: (payrollId: string) => void\n onCancelPayroll: (item: Payroll) => void\n cancelDialogItem: Payroll | null\n onCancelDialogOpen: (item: Payroll) => void\n onCancelDialogClose: () => void\n isLoading?: boolean\n}\n\nexport const PayrollHistoryPresentation = ({\n payrollHistory,\n wireInRequests,\n selectedTimeFilter,\n onTimeFilterChange,\n onViewSummary,\n onViewReceipt,\n onCancelPayroll,\n cancelDialogItem,\n onCancelDialogOpen,\n onCancelDialogClose,\n isLoading = false,\n}: PayrollHistoryPresentationProps) => {\n const { Heading, Text, Select, Dialog } = useComponentContext()\n useI18n('Payroll.PayrollHistory')\n const { t } = useTranslation('Payroll.PayrollHistory')\n const dateFormatter = useDateFormatter()\n\n const timeFilterOptions = [\n { value: '3months', label: t('timeFilter.options.3months') },\n { value: '6months', label: t('timeFilter.options.6months') },\n { value: 'year', label: t('timeFilter.options.year') },\n ]\n\n const canCancelPayroll = (item: Payroll) => {\n if (item.payrollStatusMeta?.cancellable === false) {\n return false\n }\n\n if (item.processed && item.payrollDeadline) {\n const now = new Date()\n const deadline = new Date(item.payrollDeadline)\n\n const ptOffset = getPacificTimeOffset(now)\n const nowInPT = new Date(now.getTime() + ptOffset * 60 * 60 * 1000)\n const deadlineInPT = new Date(\n deadline.getTime() + getPacificTimeOffset(deadline) * 60 * 60 * 1000,\n )\n\n const isSameDay = nowInPT.toDateString() === deadlineInPT.toDateString()\n if (isSameDay) {\n const cutoffTime = new Date(deadlineInPT)\n cutoffTime.setHours(15, 30, 0, 0)\n\n if (nowInPT > cutoffTime) {\n return false\n }\n }\n }\n\n return true\n }\n\n const getPacificTimeOffset = (date: Date): number => {\n const year = date.getFullYear()\n\n const secondSundayMarch = new Date(year, 2, 1)\n secondSundayMarch.setDate(1 + (7 - secondSundayMarch.getDay()) + 7)\n\n const firstSundayNovember = new Date(year, 10, 1)\n firstSundayNovember.setDate(1 + ((7 - firstSundayNovember.getDay()) % 7))\n\n const isDST = date >= secondSundayMarch && date < firstSundayNovember\n return isDST ? -7 : -8\n }\n\n const formatDeadlineForDialog = (item: Payroll): string => {\n const deadline = item.payrollDeadline\n if (!deadline) return ''\n\n const deadlineDate = new Date(deadline)\n const timeZone = 'America/New_York'\n\n const formatter = new Intl.DateTimeFormat('en-US', {\n weekday: 'short',\n month: 'short',\n day: 'numeric',\n timeZone,\n })\n\n const timeFormatter = new Intl.DateTimeFormat('en-US', {\n hour: 'numeric',\n minute: '2-digit',\n timeZoneName: 'short',\n timeZone,\n })\n\n const dateStr = formatter.format(deadlineDate)\n const timeStr = timeFormatter.format(deadlineDate)\n\n return `${timeStr} on ${dateStr}`\n }\n\n const handleCancelClick = (item: Payroll) => {\n onCancelDialogOpen(item)\n }\n\n const handleConfirmCancel = () => {\n if (cancelDialogItem) {\n onCancelPayroll(cancelDialogItem)\n }\n }\n\n const getMenuItems = (item: Payroll): MenuItem[] => {\n const payrollId = item.payrollUuid || item.uuid!\n const items: MenuItem[] = [\n {\n label: t('menu.viewSummary'),\n icon: <FileIcon aria-hidden />,\n onClick: () => {\n onViewSummary(payrollId)\n },\n },\n {\n label: t('menu.viewReceipt'),\n icon: <ReceiptIcon aria-hidden />,\n onClick: () => {\n onViewReceipt(payrollId)\n },\n },\n ]\n\n if (canCancelPayroll(item)) {\n items.push({\n label: t('menu.cancelPayroll'),\n icon: <TrashcanIcon aria-hidden />,\n onClick: () => {\n handleCancelClick(item)\n },\n 'data-destructive': 'true',\n })\n }\n\n return items\n }\n\n if (payrollHistory.length === 0) {\n return (\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={24}>\n <Heading as=\"h3\">{t('emptyState.title')}</Heading>\n <Text>{t('emptyState.description')}</Text>\n </Flex>\n )\n }\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n <Flex\n flexDirection={{ base: 'column', medium: 'row' }}\n justifyContent=\"space-between\"\n alignItems=\"flex-start\"\n gap={{ base: 12, medium: 24 }}\n >\n <Flex>\n <Heading as=\"h2\">{t('title')}</Heading>\n </Flex>\n <div className={styles.timeFilterContainer}>\n <Select\n value={selectedTimeFilter}\n onChange={(value: string) => {\n onTimeFilterChange(value as TimeFilterOption)\n }}\n options={timeFilterOptions}\n label={t('timeFilter.placeholder')}\n shouldVisuallyHideLabel\n isRequired\n />\n </div>\n </Flex>\n\n <DataView\n label={t('dataView.label')}\n columns={[\n {\n title: t('columns.payPeriod'),\n render: (item: Payroll) => (\n <Text>\n {dateFormatter.formatPayPeriodRange(\n item.payPeriod?.startDate,\n item.payPeriod?.endDate,\n )}\n </Text>\n ),\n },\n {\n title: t('columns.type'),\n render: (item: Payroll) => <Text>{getPayrollType(item)}</Text>,\n },\n {\n title: t('columns.payDate'),\n render: (item: Payroll) => (\n <Text>{dateFormatter.formatShortWithYear(item.checkDate)}</Text>\n ),\n },\n {\n title: t('columns.status'),\n render: (item: Payroll) => {\n const wireInRequest = wireInRequests.find(\n wire => wire.paymentUuid === item.payrollUuid,\n )\n return <PayrollStatusBadges payroll={item} wireInRequest={wireInRequest} />\n },\n },\n {\n title: t('columns.totalPayroll'),\n render: (item: Payroll) => (\n <Text weight=\"semibold\">{formatNumberAsCurrency(calculateTotalPayroll(item))}</Text>\n ),\n },\n ]}\n data={payrollHistory}\n itemMenu={(item: Payroll) => <HamburgerMenu items={getMenuItems(item)} />}\n />\n\n <Dialog\n isOpen={!!cancelDialogItem}\n onClose={onCancelDialogClose}\n onPrimaryActionClick={handleConfirmCancel}\n isDestructive\n isPrimaryActionLoading={isLoading}\n primaryActionLabel={t('cancelDialog.primaryAction')}\n closeActionLabel={t('cancelDialog.secondaryAction')}\n title={\n cancelDialogItem\n ? t('cancelDialog.title', {\n payPeriod: dateFormatter.formatPayPeriodRange(\n cancelDialogItem.payPeriod?.startDate,\n cancelDialogItem.payPeriod?.endDate,\n ),\n })\n : ''\n }\n >\n {cancelDialogItem && (\n <Flex flexDirection=\"column\" gap={16}>\n <Text>{t('cancelDialog.body')}</Text>\n {cancelDialogItem.payrollDeadline && (\n <Text>\n {t('cancelDialog.deadline', {\n deadline: formatDeadlineForDialog(cancelDialogItem),\n })}\n </Text>\n )}\n </Flex>\n )}\n </Dialog>\n </Flex>\n )\n}\n"],"names":["PayrollHistoryPresentation","payrollHistory","wireInRequests","selectedTimeFilter","onTimeFilterChange","onViewSummary","onViewReceipt","onCancelPayroll","cancelDialogItem","onCancelDialogOpen","onCancelDialogClose","isLoading","Heading","Text","Select","Dialog","useComponentContext","useI18n","useTranslation","dateFormatter","useDateFormatter","timeFilterOptions","canCancelPayroll","item","now","deadline","ptOffset","getPacificTimeOffset","nowInPT","deadlineInPT","cutoffTime","date","year","secondSundayMarch","firstSundayNovember","formatDeadlineForDialog","deadlineDate","timeZone","formatter","timeFormatter","dateStr","handleCancelClick","handleConfirmCancel","getMenuItems","payrollId","items","jsx","FileIcon","ReceiptIcon","TrashcanIcon","Flex","jsxs","styles","value","DataView","getPayrollType","wireInRequest","wire","PayrollStatusBadges","formatNumberAsCurrency","calculateTotalPayroll","HamburgerMenu"],"mappings":";;;;;;;;;;;;;;;;AAgCO,MAAMA,KAA6B,CAAC;AAAA,EACzC,gBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,WAAAC,IAAY;AACd,MAAuC;AACrC,QAAM,EAAE,SAAAC,GAAS,MAAAC,GAAM,QAAAC,GAAQ,QAAAC,EAAA,IAAWC,EAAA;AAC1C,EAAAC,EAAQ,wBAAwB;AAChC,QAAM,EAAE,EAAA,IAAMC,EAAe,wBAAwB,GAC/CC,IAAgBC,EAAA,GAEhBC,I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