@gusto/embedded-react-sdk 0.57.1 → 0.57.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/components/Base/Base.js +2 -3
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -8
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -10
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -6
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -8
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -6
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +10 -11
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -8
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +8 -9
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -6
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +10 -12
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +11 -13
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -7
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -6
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +7 -9
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -11
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +5 -7
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +6 -9
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +10 -12
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +8 -10
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -6
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +6 -8
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +11 -13
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -6
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +3 -6
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleForm.js +66 -62
- package/dist/components/Company/PaySchedule/PayScheduleForm.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleForm.module.scss.js +2 -2
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.js +80 -68
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.js.map +1 -1
- package/dist/components/Company/PaySchedule/management/PayScheduleCompensationOverviewPresentation.js +11 -13
- package/dist/components/Company/PaySchedule/management/PayScheduleCompensationOverviewPresentation.js.map +1 -1
- package/dist/components/Company/PaySchedule/management/PayScheduleManagementComponents.js +49 -44
- package/dist/components/Company/PaySchedule/management/PayScheduleManagementComponents.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +5 -7
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -6
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -8
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -6
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +3 -6
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
- package/dist/components/Contractor/Compensation/management/CompensationCard/CompensationCard.js +16 -17
- package/dist/components/Contractor/Compensation/management/CompensationCard/CompensationCard.js.map +1 -1
- package/dist/components/Contractor/Documents/management/DocumentsCard/DocumentsCard.js +8 -9
- package/dist/components/Contractor/Documents/management/DocumentsCard/DocumentsCard.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/shared/ContractorBankAccountFormBody/ContractorBankAccountFormBody.js +6 -8
- package/dist/components/Contractor/PaymentMethod/shared/ContractorBankAccountFormBody/ContractorBankAccountFormBody.js.map +1 -1
- package/dist/components/Contractor/Profile/management/ProfileCard/ProfileCard.js +26 -27
- package/dist/components/Contractor/Profile/management/ProfileCard/ProfileCard.js.map +1 -1
- package/dist/components/Contractor/Profile/management/ProfileEditForm.js +11 -11
- package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.js +12 -13
- package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.js.map +1 -1
- package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.js +12 -13
- package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js +6 -8
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -6
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js +3 -4
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js +3 -4
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js +22 -24
- package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js.map +1 -1
- package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js +8 -9
- package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js.map +1 -1
- package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js +14 -15
- package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js.map +1 -1
- package/dist/components/Employee/Profile/management/ProfileEditForm.js +1 -1
- package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js +7 -8
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js.map +1 -1
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js +7 -8
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +56 -54
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +14 -16
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +6 -8
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +9 -11
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +74 -88
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +44 -46
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js +63 -61
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -1
- package/dist/components/Payroll/TransitionPayroll/useResolveTransitionPayroll.js +14 -13
- package/dist/components/Payroll/TransitionPayroll/useResolveTransitionPayroll.js.map +1 -1
- package/dist/components/Payroll/helpers.js +52 -48
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +13 -16
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/Payroll/useUnprocessedTransitionPayPeriods.js +2 -2
- package/dist/components/Payroll/useUnprocessedTransitionPayPeriods.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js +2 -4
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js.map +1 -1
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js +6 -8
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js.map +1 -1
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js +28 -30
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +2 -4
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/helpers/dateFormatting.js +47 -40
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/i18n/en/Company.Management.PaySchedule.json.js +20 -18
- package/dist/i18n/en/Company.Management.PaySchedule.json.js.map +1 -1
- package/dist/i18n/en/Company.Management.PayScheduleAssignment.json.js +6 -4
- package/dist/i18n/en/Company.Management.PayScheduleAssignment.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollHistory.json.js +5 -5
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +1 -1
- package/dist/package.json.js +1 -1
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js +8 -10
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +12 -14
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js +13 -15
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SelectHookField.js +10 -12
- package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js +14 -16
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js +8 -10
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js.map +1 -1
- package/dist/src/components/Company/PaySchedule/PayScheduleForm.d.ts +6 -0
- package/dist/src/components/Payroll/helpers.d.ts +20 -0
- package/dist/src/helpers/dateFormatting.d.ts +13 -0
- package/dist/src/i18n/types.d.ts +14 -2
- package/dist/style.css +1 -1
- package/package.json +7 -7
|
@@ -1,38 +1,36 @@
|
|
|
1
1
|
import { jsx as i, jsxs as b, Fragment as S } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as D } from "react-i18next";
|
|
3
3
|
import { EmployeeTable as L } from "../EmployeeTable/EmployeeTable.js";
|
|
4
|
-
import "classnames";
|
|
5
|
-
import "../../../../shared/constants.js";
|
|
6
4
|
import { EmptyData as O } from "../../../Common/EmptyData/EmptyData.js";
|
|
7
5
|
import { useComponentContext as T } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
6
|
import { useI18n as x } from "../../../../i18n/I18n.js";
|
|
9
7
|
import A from "../../../../assets/icons/plus-circle.svg.js";
|
|
10
8
|
import { DetailViewLayout as v } from "../../../Common/DetailViewLayout/DetailViewLayout.js";
|
|
11
9
|
const F = "employees";
|
|
12
|
-
function
|
|
13
|
-
title:
|
|
14
|
-
subtitle:
|
|
15
|
-
onBack:
|
|
10
|
+
function _({
|
|
11
|
+
title: r,
|
|
12
|
+
subtitle: c,
|
|
13
|
+
onBack: m,
|
|
16
14
|
backLabel: s,
|
|
17
15
|
actions: p,
|
|
18
16
|
firstTab: a,
|
|
19
17
|
selectedTabId: d,
|
|
20
18
|
onTabChange: h,
|
|
21
|
-
employees:
|
|
19
|
+
employees: e,
|
|
22
20
|
onAddEmployee: n,
|
|
23
21
|
removeDialog: o,
|
|
24
|
-
successAlert:
|
|
22
|
+
successAlert: l,
|
|
25
23
|
onDismissAlert: u,
|
|
26
24
|
className: y
|
|
27
25
|
}) {
|
|
28
26
|
x("Company.TimeOff.PolicyDetail");
|
|
29
|
-
const { t
|
|
27
|
+
const { t } = D("Company.TimeOff.PolicyDetail"), { Alert: C, Dialog: f, Button: E } = T(), g = e.emptyState ?? (n ? () => /* @__PURE__ */ i(O, { title: t("emptyEmployees.title"), children: /* @__PURE__ */ i(
|
|
30
28
|
E,
|
|
31
29
|
{
|
|
32
30
|
variant: "secondary",
|
|
33
31
|
icon: /* @__PURE__ */ i(A, { "aria-hidden": !0 }),
|
|
34
32
|
onClick: n,
|
|
35
|
-
children:
|
|
33
|
+
children: t("emptyEmployees.addEmployeeCta")
|
|
36
34
|
}
|
|
37
35
|
) }) : void 0), P = [
|
|
38
36
|
{
|
|
@@ -42,33 +40,33 @@ function Y({
|
|
|
42
40
|
},
|
|
43
41
|
{
|
|
44
42
|
id: F,
|
|
45
|
-
label:
|
|
43
|
+
label: t("tabs.employees"),
|
|
46
44
|
content: /* @__PURE__ */ i(
|
|
47
45
|
L,
|
|
48
46
|
{
|
|
49
|
-
data:
|
|
50
|
-
searchValue:
|
|
51
|
-
onSearchChange:
|
|
52
|
-
onSearchClear:
|
|
53
|
-
searchPlaceholder:
|
|
54
|
-
itemMenu:
|
|
55
|
-
pagination:
|
|
56
|
-
isFetching:
|
|
47
|
+
data: e.data,
|
|
48
|
+
searchValue: e.searchValue,
|
|
49
|
+
onSearchChange: e.onSearchChange,
|
|
50
|
+
onSearchClear: e.onSearchClear,
|
|
51
|
+
searchPlaceholder: e.searchPlaceholder,
|
|
52
|
+
itemMenu: e.itemMenu,
|
|
53
|
+
pagination: e.pagination,
|
|
54
|
+
isFetching: e.isFetching,
|
|
57
55
|
emptyState: g,
|
|
58
|
-
additionalColumns:
|
|
59
|
-
hideJobTitle:
|
|
56
|
+
additionalColumns: e.additionalColumns,
|
|
57
|
+
hideJobTitle: e.hideJobTitle
|
|
60
58
|
}
|
|
61
59
|
)
|
|
62
60
|
}
|
|
63
61
|
];
|
|
64
62
|
return /* @__PURE__ */ b(S, { children: [
|
|
65
|
-
|
|
63
|
+
l && /* @__PURE__ */ i(C, { status: "success", label: l, onDismiss: u }),
|
|
66
64
|
/* @__PURE__ */ i(
|
|
67
65
|
v,
|
|
68
66
|
{
|
|
69
|
-
title:
|
|
70
|
-
subtitle:
|
|
71
|
-
onBack:
|
|
67
|
+
title: r,
|
|
68
|
+
subtitle: c,
|
|
69
|
+
onBack: m,
|
|
72
70
|
backLabel: s,
|
|
73
71
|
actions: p,
|
|
74
72
|
tabs: P,
|
|
@@ -85,15 +83,15 @@ function Y({
|
|
|
85
83
|
onPrimaryActionClick: o.onConfirm,
|
|
86
84
|
isPrimaryActionLoading: o.isPending,
|
|
87
85
|
isDestructive: !0,
|
|
88
|
-
title:
|
|
89
|
-
primaryActionLabel:
|
|
90
|
-
closeActionLabel:
|
|
91
|
-
children:
|
|
86
|
+
title: t("removeEmployeeDialog.title", { name: o.employeeName }),
|
|
87
|
+
primaryActionLabel: t("removeEmployeeDialog.confirmCta"),
|
|
88
|
+
closeActionLabel: t("removeEmployeeDialog.cancelCta"),
|
|
89
|
+
children: t("removeEmployeeDialog.description", { name: o.employeeName })
|
|
92
90
|
}
|
|
93
91
|
)
|
|
94
92
|
] });
|
|
95
93
|
}
|
|
96
94
|
export {
|
|
97
|
-
|
|
95
|
+
_ as PolicyDetailLayout
|
|
98
96
|
};
|
|
99
97
|
//# sourceMappingURL=PolicyDetailLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolicyDetailLayout.js","sources":["../../../../../src/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { EmployeeTableItem } from '../EmployeeTable/EmployeeTableTypes'\nimport { EmployeeTable } from '../EmployeeTable/EmployeeTable'\nimport type { PolicyDetailLayoutProps } from './PolicyDetailLayoutTypes'\nimport { DetailViewLayout, EmptyData } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport PlusCircleIcon from '@/assets/icons/plus-circle.svg?react'\n\nconst EMPLOYEES_TAB_ID = 'employees'\n\n/** @internal */\nexport function PolicyDetailLayout<T extends EmployeeTableItem>({\n title,\n subtitle,\n onBack,\n backLabel,\n actions,\n firstTab,\n selectedTabId,\n onTabChange,\n employees,\n onAddEmployee,\n removeDialog,\n successAlert,\n onDismissAlert,\n className,\n}: PolicyDetailLayoutProps<T>) {\n useI18n('Company.TimeOff.PolicyDetail')\n const { t } = useTranslation('Company.TimeOff.PolicyDetail')\n const { Alert, Dialog, Button } = useComponentContext()\n\n const emptyEmployeesState =\n employees.emptyState ??\n (onAddEmployee\n ? () => (\n <EmptyData title={t('emptyEmployees.title')}>\n <Button\n variant=\"secondary\"\n icon={<PlusCircleIcon aria-hidden />}\n onClick={onAddEmployee}\n >\n {t('emptyEmployees.addEmployeeCta')}\n </Button>\n </EmptyData>\n )\n : undefined)\n\n const tabs = [\n {\n id: firstTab.id,\n label: firstTab.label,\n content: firstTab.content,\n },\n {\n id: EMPLOYEES_TAB_ID,\n label: t('tabs.employees'),\n content: (\n <EmployeeTable<T>\n data={employees.data}\n searchValue={employees.searchValue}\n onSearchChange={employees.onSearchChange}\n onSearchClear={employees.onSearchClear}\n searchPlaceholder={employees.searchPlaceholder}\n itemMenu={employees.itemMenu}\n pagination={employees.pagination}\n isFetching={employees.isFetching}\n emptyState={emptyEmployeesState}\n additionalColumns={employees.additionalColumns}\n hideJobTitle={employees.hideJobTitle}\n />\n ),\n },\n ]\n\n return (\n <>\n {successAlert && <Alert status=\"success\" label={successAlert} onDismiss={onDismissAlert} />}\n\n <DetailViewLayout\n title={title}\n subtitle={subtitle}\n onBack={onBack}\n backLabel={backLabel}\n actions={actions}\n tabs={tabs}\n selectedTabId={selectedTabId}\n onTabChange={onTabChange}\n className={className}\n />\n\n <Dialog\n isOpen={removeDialog.isOpen}\n onClose={removeDialog.onClose}\n onPrimaryActionClick={removeDialog.onConfirm}\n isPrimaryActionLoading={removeDialog.isPending}\n isDestructive\n title={t('removeEmployeeDialog.title', { name: removeDialog.employeeName })}\n primaryActionLabel={t('removeEmployeeDialog.confirmCta')}\n closeActionLabel={t('removeEmployeeDialog.cancelCta')}\n >\n {t('removeEmployeeDialog.description', { name: removeDialog.employeeName })}\n </Dialog>\n </>\n )\n}\n"],"names":["EMPLOYEES_TAB_ID","PolicyDetailLayout","title","subtitle","onBack","backLabel","actions","firstTab","selectedTabId","onTabChange","employees","onAddEmployee","removeDialog","successAlert","onDismissAlert","className","useI18n","
|
|
1
|
+
{"version":3,"file":"PolicyDetailLayout.js","sources":["../../../../../src/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { EmployeeTableItem } from '../EmployeeTable/EmployeeTableTypes'\nimport { EmployeeTable } from '../EmployeeTable/EmployeeTable'\nimport type { PolicyDetailLayoutProps } from './PolicyDetailLayoutTypes'\nimport { DetailViewLayout, EmptyData } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport PlusCircleIcon from '@/assets/icons/plus-circle.svg?react'\n\nconst EMPLOYEES_TAB_ID = 'employees'\n\n/** @internal */\nexport function PolicyDetailLayout<T extends EmployeeTableItem>({\n title,\n subtitle,\n onBack,\n backLabel,\n actions,\n firstTab,\n selectedTabId,\n onTabChange,\n employees,\n onAddEmployee,\n removeDialog,\n successAlert,\n onDismissAlert,\n className,\n}: PolicyDetailLayoutProps<T>) {\n useI18n('Company.TimeOff.PolicyDetail')\n const { t } = useTranslation('Company.TimeOff.PolicyDetail')\n const { Alert, Dialog, Button } = useComponentContext()\n\n const emptyEmployeesState =\n employees.emptyState ??\n (onAddEmployee\n ? () => (\n <EmptyData title={t('emptyEmployees.title')}>\n <Button\n variant=\"secondary\"\n icon={<PlusCircleIcon aria-hidden />}\n onClick={onAddEmployee}\n >\n {t('emptyEmployees.addEmployeeCta')}\n </Button>\n </EmptyData>\n )\n : undefined)\n\n const tabs = [\n {\n id: firstTab.id,\n label: firstTab.label,\n content: firstTab.content,\n },\n {\n id: EMPLOYEES_TAB_ID,\n label: t('tabs.employees'),\n content: (\n <EmployeeTable<T>\n data={employees.data}\n searchValue={employees.searchValue}\n onSearchChange={employees.onSearchChange}\n onSearchClear={employees.onSearchClear}\n searchPlaceholder={employees.searchPlaceholder}\n itemMenu={employees.itemMenu}\n pagination={employees.pagination}\n isFetching={employees.isFetching}\n emptyState={emptyEmployeesState}\n additionalColumns={employees.additionalColumns}\n hideJobTitle={employees.hideJobTitle}\n />\n ),\n },\n ]\n\n return (\n <>\n {successAlert && <Alert status=\"success\" label={successAlert} onDismiss={onDismissAlert} />}\n\n <DetailViewLayout\n title={title}\n subtitle={subtitle}\n onBack={onBack}\n backLabel={backLabel}\n actions={actions}\n tabs={tabs}\n selectedTabId={selectedTabId}\n onTabChange={onTabChange}\n className={className}\n />\n\n <Dialog\n isOpen={removeDialog.isOpen}\n onClose={removeDialog.onClose}\n onPrimaryActionClick={removeDialog.onConfirm}\n isPrimaryActionLoading={removeDialog.isPending}\n isDestructive\n title={t('removeEmployeeDialog.title', { name: removeDialog.employeeName })}\n primaryActionLabel={t('removeEmployeeDialog.confirmCta')}\n closeActionLabel={t('removeEmployeeDialog.cancelCta')}\n >\n {t('removeEmployeeDialog.description', { name: removeDialog.employeeName })}\n </Dialog>\n </>\n )\n}\n"],"names":["EMPLOYEES_TAB_ID","PolicyDetailLayout","title","subtitle","onBack","backLabel","actions","firstTab","selectedTabId","onTabChange","employees","onAddEmployee","removeDialog","successAlert","onDismissAlert","className","useI18n","useTranslation","Alert","Dialog","Button","useComponentContext","emptyEmployeesState","EmptyData","jsx","PlusCircleIcon","tabs","EmployeeTable","jsxs","Fragment","DetailViewLayout"],"mappings":";;;;;;;;AASA,MAAMA,IAAmB;AAGlB,SAASC,EAAgD;AAAA,EAC9D,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AACF,GAA+B;AAC7B,EAAAC,EAAQ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B;AAAA,QACA,eAAAlB;AAAA,QACA,aAAAC;AAAA,QACA,WAAAM;AAAA,MAAA;AAAA,IAAA;AAAA,IAGF,gBAAAS;AAAA,MAACL;AAAA,MAAA;AAAA,QACC,QAAQP,EAAa;AAAA,QACrB,SAASA,EAAa;AAAA,QACtB,sBAAsBA,EAAa;AAAA,QACnC,wBAAwBA,EAAa;AAAA,QACrC,eAAa;AAAA,QACb,OAAO,EAAE,8BAA8B,EAAE,MAAMA,EAAa,cAAc;AAAA,QAC1E,oBAAoB,EAAE,iCAAiC;AAAA,QACvD,kBAAkB,EAAE,gCAAgC;AAAA,QAEnD,YAAE,oCAAoC,EAAE,MAAMA,EAAa,cAAc;AAAA,MAAA;AAAA,IAAA;AAAA,EAC5E,GACF;AAEJ;"}
|
|
@@ -8,8 +8,6 @@ import { LoadingIndicatorProvider as U } from "../LoadingIndicatorProvider/Loadi
|
|
|
8
8
|
import { sanitizeError as z } from "../ObservabilityProvider/sanitization.js";
|
|
9
9
|
import { UnstableFeaturesProvider as D } from "../UnstableFeaturesProvider/UnstableFeaturesProvider.js";
|
|
10
10
|
import { SDKI18next as m } from "./SDKI18next.js";
|
|
11
|
-
import "classnames";
|
|
12
|
-
import "../../shared/constants.js";
|
|
13
11
|
import { InternalError as F } from "../../components/Common/InternalError/InternalError.js";
|
|
14
12
|
import { LocaleProvider as T } from "../LocaleProvider/LocaleProvider.js";
|
|
15
13
|
import "../LocaleProvider/useLocale.js";
|
|
@@ -17,7 +15,7 @@ import { ThemeProvider as w } from "../ThemeProvider/ThemeProvider.js";
|
|
|
17
15
|
import { normalizeToSDKError as A } from "../../types/sdkError.js";
|
|
18
16
|
import { NonceContext as B } from "../NonceProvider/useNonce.js";
|
|
19
17
|
import { ObservabilityProvider as K } from "../ObservabilityProvider/ObservabilityProvider.js";
|
|
20
|
-
function
|
|
18
|
+
function rr(l) {
|
|
21
19
|
const {
|
|
22
20
|
children: s,
|
|
23
21
|
config: o,
|
|
@@ -72,6 +70,6 @@ function er(l) {
|
|
|
72
70
|
) }, n) }) }) }) }) }) }) });
|
|
73
71
|
}
|
|
74
72
|
export {
|
|
75
|
-
|
|
73
|
+
rr as GustoProviderCustomUIAdapter
|
|
76
74
|
};
|
|
77
75
|
//# sourceMappingURL=GustoProviderCustomUIAdapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GustoProviderCustomUIAdapter.js","sources":["../../../src/contexts/GustoProvider/GustoProviderCustomUIAdapter.tsx"],"sourcesContent":["import type React from 'react'\nimport type { ErrorInfo, JSX, ReactNode } from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { I18nextProvider } from 'react-i18next'\nimport type { QueryClient } from '@tanstack/react-query'\nimport { useEffect, useMemo } from 'react'\nimport { ComponentsProvider } from '../ComponentAdapter/ComponentsProvider'\nimport type { ComponentsContextType } from '../ComponentAdapter/useComponentContext'\nimport { ApiProvider } from '../ApiProvider/ApiProvider'\nimport { LoadingIndicatorProvider } from '../LoadingIndicatorProvider/LoadingIndicatorProvider'\nimport { ObservabilityProvider } from '../ObservabilityProvider'\nimport { sanitizeError } from '../ObservabilityProvider/sanitization'\nimport { UnstableFeaturesProvider } from '../UnstableFeaturesProvider/UnstableFeaturesProvider'\nimport type { UnstableFeatures } from '../UnstableFeaturesProvider/useUnstableFeature'\nimport { SDKI18next } from './SDKI18next'\nimport { InternalError } from '@/components/Common'\nimport { LocaleProvider } from '@/contexts/LocaleProvider'\nimport { NonceContext } from '@/contexts/NonceProvider'\nimport { ThemeProvider } from '@/contexts/ThemeProvider'\nimport type { GustoSDKTheme } from '@/contexts/ThemeProvider/theme'\nimport type { GlobalResourceDictionary, SupportedLanguages } from '@/types/Helpers'\nimport type { SDKHooks } from '@/types/hooks'\nimport type { ObservabilityHook } from '@/types/observability'\nimport { normalizeToSDKError } from '@/types/sdkError'\n\n/**\n * API client configuration passed to {@link GustoProvider} (and {@link GustoProviderCustomUIAdapter}).\n *\n * @public\n */\nexport interface APIConfig {\n /** URL of your backend proxy that forwards SDK requests to the Gusto Embedded API. SDK components never call Gusto directly. */\n baseUrl: string\n /** Extra headers applied to every API request. Combined with any headers your proxy adds. */\n headers?: HeadersInit\n /** Request interceptor hooks. Use these to inspect, modify, or react to requests and responses. See {@link SDKHooks}. */\n hooks?: SDKHooks\n /** Observability hook for surfacing errors and metrics from the SDK to your monitoring stack. See {@link ObservabilityHook}. */\n observability?: ObservabilityHook\n}\n\n/**\n * Shared configuration props accepted by {@link GustoProvider} and {@link GustoProviderCustomUIAdapter}.\n *\n * @public\n */\nexport interface GustoBaseProviderProps {\n /** API client configuration, including the proxy `baseUrl`, request hooks, and observability. See {@link APIConfig}. */\n config: APIConfig\n /** Translation overrides keyed by language and i18next namespace. Strings supplied here replace the SDK defaults for the matching keys. */\n dictionary?: GlobalResourceDictionary\n /** Active i18next language. Defaults to `'en'`. */\n lng?: string\n /** BCP 47 locale used for number, date, and currency formatting throughout the SDK. Defaults to `'en-US'`. */\n locale?: string\n /** ISO 4217 currency code used for monetary formatting. Defaults to `'USD'`. */\n currency?: string\n /** Theme overrides applied to SDK components. See {@link GustoSDKTheme}. */\n theme?: Partial<GustoSDKTheme>\n /**\n * CSP nonce to apply to runtime-injected `<style>` elements (theming, PDF download window).\n * Pass the same per-request nonce your app uses in its `style-src 'nonce-…'` directive.\n * Also exposed to custom UI components via `useNonce`.\n */\n nonce?: string\n /**\n * Element to use as the portal container for SDK popovers and dropdowns.\n * Defaults to a themed root element the SDK appends to `document.body`.\n *\n * Pass an element here if rendering inside a modal, or **required** if\n * rendering inside a shadow root — `document.body` sits outside every\n * shadow boundary, so without an explicit container overlays would\n * otherwise escape your shadow root's style encapsulation.\n */\n portalContainer?: HTMLElement\n /** Optional TanStack Query `QueryClient`. When omitted, the SDK creates its own client configured for Gusto's API. */\n queryClient?: QueryClient\n /** Complete map of UI components the SDK renders. Required because this adapter ships no defaults. */\n components: ComponentsContextType\n /** Loading indicator rendered while SDK queries are pending. Overrides the SDK default spinner. */\n LoaderComponent?: ({ children }: { children?: ReactNode }) => JSX.Element\n /**\n * Opt-in flags for alpha SDK functionality. See {@link UnstableFeatures}.\n * @alpha\n */\n unstableFeatures?: UnstableFeatures\n}\n\n/**\n * Props for {@link GustoProviderCustomUIAdapter}.\n *\n * @public\n */\nexport interface GustoProviderCustomUIAdapterProps extends GustoBaseProviderProps {\n /** The application tree that should have access to the SDK. */\n children?: React.ReactNode\n}\n\n/**\n * Top-level provider that requires a complete component map and ships no UI defaults.\n *\n * @remarks\n * Use this adapter when you want full control over every UI primitive the SDK renders, or when\n * you want to avoid the React Aria dependency for tree-shaking. Unlike {@link GustoProvider}, the\n * `components` prop on {@link GustoProviderProps} is required and must supply every component the\n * SDK renders.\n *\n * @param props - See {@link GustoProviderCustomUIAdapterProps}.\n * @returns The configured provider tree wrapping `children`.\n * @public\n * @group Providers\n */\nexport function GustoProviderCustomUIAdapter(props: GustoProviderCustomUIAdapterProps) {\n const {\n children,\n config,\n dictionary,\n lng = 'en',\n locale = 'en-US',\n currency = 'USD',\n theme,\n nonce,\n portalContainer,\n components,\n LoaderComponent,\n queryClient,\n unstableFeatures,\n } = props\n\n if (dictionary) {\n for (const language in dictionary) {\n const lang = language as SupportedLanguages\n for (const ns in dictionary[lang]) {\n SDKI18next.addResourceBundle(\n lang,\n ns,\n (dictionary[lang] as Record<string, unknown>)[ns],\n true,\n true,\n )\n }\n }\n }\n\n useEffect(() => {\n void (async () => {\n await SDKI18next.changeLanguage(lng)\n })()\n }, [lng])\n\n const handleTopLevelError = useMemo(() => {\n if (!config.observability?.onError) return undefined\n\n return (error: unknown, errorInfo: ErrorInfo) => {\n if (!config.observability?.onError) return\n\n const sdkError = normalizeToSDKError(error)\n\n const observabilityError = {\n ...sdkError,\n timestamp: Date.now(),\n componentStack: errorInfo.componentStack ?? undefined,\n }\n\n const sanitizedError = sanitizeError(observabilityError, config.observability.sanitization)\n\n config.observability.onError(sanitizedError)\n }\n }, [config.observability])\n return (\n <NonceContext.Provider value={nonce}>\n <ComponentsProvider value={components}>\n <LoadingIndicatorProvider value={LoaderComponent}>\n <ObservabilityProvider observability={config.observability}>\n <ErrorBoundary FallbackComponent={InternalError} onError={handleTopLevelError}>\n <ThemeProvider theme={theme} portalContainer={portalContainer}>\n <LocaleProvider locale={locale} currency={currency}>\n <I18nextProvider i18n={SDKI18next} key={lng}>\n <ApiProvider\n url={config.baseUrl}\n headers={config.headers}\n hooks={config.hooks}\n queryClient={queryClient}\n >\n <UnstableFeaturesProvider value={unstableFeatures}>\n {children}\n </UnstableFeaturesProvider>\n </ApiProvider>\n </I18nextProvider>\n </LocaleProvider>\n </ThemeProvider>\n </ErrorBoundary>\n </ObservabilityProvider>\n </LoadingIndicatorProvider>\n </ComponentsProvider>\n </NonceContext.Provider>\n )\n}\n"],"names":["GustoProviderCustomUIAdapter","props","children","config","dictionary","lng","locale","currency","theme","nonce","portalContainer","components","LoaderComponent","queryClient","unstableFeatures","language","lang","ns","SDKI18next","useEffect","handleTopLevelError","useMemo","error","errorInfo","observabilityError","normalizeToSDKError","sanitizedError","sanitizeError","NonceContext","jsx","ComponentsProvider","LoadingIndicatorProvider","ObservabilityProvider","ErrorBoundary","InternalError","ThemeProvider","LocaleProvider","I18nextProvider","ApiProvider","UnstableFeaturesProvider"],"mappings":";;;;;;;;;;;;;;;;;;;AAgHO,SAASA,GAA6BC,GAA0C;AACrF,QAAM;AAAA,IACJ,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,QAAAC,IAAS;AAAA,IACT,UAAAC,IAAW;AAAA,IACX,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,kBAAAC;AAAA,EAAA,IACEb;AAEJ,MAAIG;AACF,eAAWW,KAAYX,GAAY;AACjC,YAAMY,IAAOD;AACb,iBAAWE,KAAMb,EAAWY,CAAI;AAC9B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zB,GAC9B,UAAAZ,EAAA,CACH;AAAA,IAAA;AAAA,EAAA,KAToCG,CAWxC,EAAA,CACF,EAAA,CACF,GACF,GACF,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"GustoProviderCustomUIAdapter.js","sources":["../../../src/contexts/GustoProvider/GustoProviderCustomUIAdapter.tsx"],"sourcesContent":["import type React from 'react'\nimport type { ErrorInfo, JSX, ReactNode } from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { I18nextProvider } from 'react-i18next'\nimport type { QueryClient } from '@tanstack/react-query'\nimport { useEffect, useMemo } from 'react'\nimport { ComponentsProvider } from '../ComponentAdapter/ComponentsProvider'\nimport type { ComponentsContextType } from '../ComponentAdapter/useComponentContext'\nimport { ApiProvider } from '../ApiProvider/ApiProvider'\nimport { LoadingIndicatorProvider } from '../LoadingIndicatorProvider/LoadingIndicatorProvider'\nimport { ObservabilityProvider } from '../ObservabilityProvider'\nimport { sanitizeError } from '../ObservabilityProvider/sanitization'\nimport { UnstableFeaturesProvider } from '../UnstableFeaturesProvider/UnstableFeaturesProvider'\nimport type { UnstableFeatures } from '../UnstableFeaturesProvider/useUnstableFeature'\nimport { SDKI18next } from './SDKI18next'\nimport { InternalError } from '@/components/Common'\nimport { LocaleProvider } from '@/contexts/LocaleProvider'\nimport { NonceContext } from '@/contexts/NonceProvider'\nimport { ThemeProvider } from '@/contexts/ThemeProvider'\nimport type { GustoSDKTheme } from '@/contexts/ThemeProvider/theme'\nimport type { GlobalResourceDictionary, SupportedLanguages } from '@/types/Helpers'\nimport type { SDKHooks } from '@/types/hooks'\nimport type { ObservabilityHook } from '@/types/observability'\nimport { normalizeToSDKError } from '@/types/sdkError'\n\n/**\n * API client configuration passed to {@link GustoProvider} (and {@link GustoProviderCustomUIAdapter}).\n *\n * @public\n */\nexport interface APIConfig {\n /** URL of your backend proxy that forwards SDK requests to the Gusto Embedded API. SDK components never call Gusto directly. */\n baseUrl: string\n /** Extra headers applied to every API request. Combined with any headers your proxy adds. */\n headers?: HeadersInit\n /** Request interceptor hooks. Use these to inspect, modify, or react to requests and responses. See {@link SDKHooks}. */\n hooks?: SDKHooks\n /** Observability hook for surfacing errors and metrics from the SDK to your monitoring stack. See {@link ObservabilityHook}. */\n observability?: ObservabilityHook\n}\n\n/**\n * Shared configuration props accepted by {@link GustoProvider} and {@link GustoProviderCustomUIAdapter}.\n *\n * @public\n */\nexport interface GustoBaseProviderProps {\n /** API client configuration, including the proxy `baseUrl`, request hooks, and observability. See {@link APIConfig}. */\n config: APIConfig\n /** Translation overrides keyed by language and i18next namespace. Strings supplied here replace the SDK defaults for the matching keys. */\n dictionary?: GlobalResourceDictionary\n /** Active i18next language. Defaults to `'en'`. */\n lng?: string\n /** BCP 47 locale used for number, date, and currency formatting throughout the SDK. Defaults to `'en-US'`. */\n locale?: string\n /** ISO 4217 currency code used for monetary formatting. Defaults to `'USD'`. */\n currency?: string\n /** Theme overrides applied to SDK components. See {@link GustoSDKTheme}. */\n theme?: Partial<GustoSDKTheme>\n /**\n * CSP nonce to apply to runtime-injected `<style>` elements (theming, PDF download window).\n * Pass the same per-request nonce your app uses in its `style-src 'nonce-…'` directive.\n * Also exposed to custom UI components via `useNonce`.\n */\n nonce?: string\n /**\n * Element to use as the portal container for SDK popovers and dropdowns.\n * Defaults to a themed root element the SDK appends to `document.body`.\n *\n * Pass an element here if rendering inside a modal, or **required** if\n * rendering inside a shadow root — `document.body` sits outside every\n * shadow boundary, so without an explicit container overlays would\n * otherwise escape your shadow root's style encapsulation.\n */\n portalContainer?: HTMLElement\n /** Optional TanStack Query `QueryClient`. When omitted, the SDK creates its own client configured for Gusto's API. */\n queryClient?: QueryClient\n /** Complete map of UI components the SDK renders. Required because this adapter ships no defaults. */\n components: ComponentsContextType\n /** Loading indicator rendered while SDK queries are pending. Overrides the SDK default spinner. */\n LoaderComponent?: ({ children }: { children?: ReactNode }) => JSX.Element\n /**\n * Opt-in flags for alpha SDK functionality. See {@link UnstableFeatures}.\n * @alpha\n */\n unstableFeatures?: UnstableFeatures\n}\n\n/**\n * Props for {@link GustoProviderCustomUIAdapter}.\n *\n * @public\n */\nexport interface GustoProviderCustomUIAdapterProps extends GustoBaseProviderProps {\n /** The application tree that should have access to the SDK. */\n children?: React.ReactNode\n}\n\n/**\n * Top-level provider that requires a complete component map and ships no UI defaults.\n *\n * @remarks\n * Use this adapter when you want full control over every UI primitive the SDK renders, or when\n * you want to avoid the React Aria dependency for tree-shaking. Unlike {@link GustoProvider}, the\n * `components` prop on {@link GustoProviderProps} is required and must supply every component the\n * SDK renders.\n *\n * @param props - See {@link GustoProviderCustomUIAdapterProps}.\n * @returns The configured provider tree wrapping `children`.\n * @public\n * @group Providers\n */\nexport function GustoProviderCustomUIAdapter(props: GustoProviderCustomUIAdapterProps) {\n const {\n children,\n config,\n dictionary,\n lng = 'en',\n locale = 'en-US',\n currency = 'USD',\n theme,\n nonce,\n portalContainer,\n components,\n LoaderComponent,\n queryClient,\n unstableFeatures,\n } = props\n\n if (dictionary) {\n for (const language in dictionary) {\n const lang = language as SupportedLanguages\n for (const ns in dictionary[lang]) {\n SDKI18next.addResourceBundle(\n lang,\n ns,\n (dictionary[lang] as Record<string, unknown>)[ns],\n true,\n true,\n )\n }\n }\n }\n\n useEffect(() => {\n void (async () => {\n await SDKI18next.changeLanguage(lng)\n })()\n }, [lng])\n\n const handleTopLevelError = useMemo(() => {\n if (!config.observability?.onError) return undefined\n\n return (error: unknown, errorInfo: ErrorInfo) => {\n if (!config.observability?.onError) return\n\n const sdkError = normalizeToSDKError(error)\n\n const observabilityError = {\n ...sdkError,\n timestamp: Date.now(),\n componentStack: errorInfo.componentStack ?? undefined,\n }\n\n const sanitizedError = sanitizeError(observabilityError, config.observability.sanitization)\n\n config.observability.onError(sanitizedError)\n }\n }, [config.observability])\n return (\n <NonceContext.Provider value={nonce}>\n <ComponentsProvider value={components}>\n <LoadingIndicatorProvider value={LoaderComponent}>\n <ObservabilityProvider observability={config.observability}>\n <ErrorBoundary FallbackComponent={InternalError} onError={handleTopLevelError}>\n <ThemeProvider theme={theme} portalContainer={portalContainer}>\n <LocaleProvider locale={locale} currency={currency}>\n <I18nextProvider i18n={SDKI18next} key={lng}>\n <ApiProvider\n url={config.baseUrl}\n headers={config.headers}\n hooks={config.hooks}\n queryClient={queryClient}\n >\n <UnstableFeaturesProvider value={unstableFeatures}>\n {children}\n </UnstableFeaturesProvider>\n </ApiProvider>\n </I18nextProvider>\n </LocaleProvider>\n </ThemeProvider>\n </ErrorBoundary>\n </ObservabilityProvider>\n </LoadingIndicatorProvider>\n </ComponentsProvider>\n </NonceContext.Provider>\n )\n}\n"],"names":["GustoProviderCustomUIAdapter","props","children","config","dictionary","lng","locale","currency","theme","nonce","portalContainer","components","LoaderComponent","queryClient","unstableFeatures","language","lang","ns","SDKI18next","useEffect","handleTopLevelError","useMemo","error","errorInfo","observabilityError","normalizeToSDKError","sanitizedError","sanitizeError","NonceContext","jsx","ComponentsProvider","LoadingIndicatorProvider","ObservabilityProvider","ErrorBoundary","InternalError","ThemeProvider","LocaleProvider","I18nextProvider","ApiProvider","UnstableFeaturesProvider"],"mappings":";;;;;;;;;;;;;;;;;AAgHO,SAASA,GAA6BC,GAA0C;AACrF,QAAM;AAAA,IACJ,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,QAAAC,IAAS;AAAA,IACT,UAAAC,IAAW;AAAA,IACX,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,kBAAAC;AAAA,EAAA,IACEb;AAEJ,MAAIG;AACF,eAAWW,KAAYX,GAAY;AACjC,YAAMY,IAAOD;AACb,iBAAWE,KAAMb,EAAWY,CAAI;AAC9B,QAAAE,EAAW;AAAA,UACTF;AAAA,UACAC;AAAA,UACCb,EAAWY,CAAI,EAA8BC,CAAE;A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EAAA,CACF,GACF,GACF,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RFCDate as d } from "@gusto/embedded-api/types/rfcdate";
|
|
1
2
|
const s = (t) => {
|
|
2
3
|
if (!t) return null;
|
|
3
4
|
if (typeof t == "string") {
|
|
@@ -14,30 +15,30 @@ const s = (t) => {
|
|
|
14
15
|
}, c = (t) => (e, n) => {
|
|
15
16
|
const r = s(e);
|
|
16
17
|
return r ? r.toLocaleDateString(n, t) : "";
|
|
17
|
-
},
|
|
18
|
+
}, S = c({
|
|
18
19
|
weekday: "short",
|
|
19
20
|
month: "short",
|
|
20
21
|
day: "numeric"
|
|
21
|
-
}),
|
|
22
|
+
}), w = c({
|
|
22
23
|
weekday: "short",
|
|
23
24
|
month: "short",
|
|
24
25
|
day: "numeric",
|
|
25
26
|
year: "numeric"
|
|
26
|
-
}),
|
|
27
|
+
}), N = c({
|
|
27
28
|
month: "short",
|
|
28
29
|
day: "numeric"
|
|
29
|
-
}),
|
|
30
|
+
}), F = c({
|
|
30
31
|
month: "short",
|
|
31
32
|
day: "numeric",
|
|
32
33
|
year: "numeric"
|
|
33
|
-
}),
|
|
34
|
+
}), T = c({
|
|
34
35
|
month: "long",
|
|
35
36
|
day: "numeric"
|
|
36
|
-
}),
|
|
37
|
+
}), M = c({
|
|
37
38
|
month: "long",
|
|
38
39
|
day: "numeric",
|
|
39
40
|
year: "numeric"
|
|
40
|
-
}),
|
|
41
|
+
}), $ = (t, e) => {
|
|
41
42
|
const n = s(t);
|
|
42
43
|
if (!n) return { time: "", date: "" };
|
|
43
44
|
const r = n.toLocaleTimeString(e, {
|
|
@@ -51,7 +52,7 @@ const s = (t) => {
|
|
|
51
52
|
day: "numeric"
|
|
52
53
|
});
|
|
53
54
|
return { time: r, date: o };
|
|
54
|
-
},
|
|
55
|
+
}, L = (t, e, n) => {
|
|
55
56
|
const r = s(t), o = s(e);
|
|
56
57
|
if (!r || !o)
|
|
57
58
|
return { startDate: "", endDate: "" };
|
|
@@ -64,7 +65,7 @@ const s = (t) => {
|
|
|
64
65
|
year: "numeric"
|
|
65
66
|
});
|
|
66
67
|
return { startDate: a, endDate: i };
|
|
67
|
-
},
|
|
68
|
+
}, Y = (t, e, n, r) => {
|
|
68
69
|
const o = s(t), a = s(e);
|
|
69
70
|
if (!o || !a) return "";
|
|
70
71
|
const i = r?.useShortMonth ? "short" : "long", m = o.toLocaleDateString(n, {
|
|
@@ -76,72 +77,78 @@ const s = (t) => {
|
|
|
76
77
|
year: "numeric"
|
|
77
78
|
});
|
|
78
79
|
return `${m}–${D}`;
|
|
79
|
-
},
|
|
80
|
+
}, l = (t) => {
|
|
80
81
|
if (isNaN(t.getTime()))
|
|
81
82
|
return null;
|
|
82
83
|
const e = String(t.getFullYear()).padStart(4, "0"), n = String(t.getMonth() + 1).padStart(2, "0"), r = String(t.getDate()).padStart(2, "0");
|
|
83
84
|
return `${e}-${n}-${r}`;
|
|
84
|
-
},
|
|
85
|
+
}, R = (t) => {
|
|
86
|
+
const e = l(t);
|
|
87
|
+
if (!e)
|
|
88
|
+
throw new RangeError(`Cannot convert an invalid date to RFCDate: ${String(t)}`);
|
|
89
|
+
return new d(e);
|
|
90
|
+
}, W = (t) => {
|
|
85
91
|
if (!t) return "";
|
|
86
92
|
const e = s(t);
|
|
87
93
|
if (!e) return "";
|
|
88
94
|
const n = e.getFullYear(), r = String(e.getMonth() + 1).padStart(2, "0"), o = String(e.getDate()).padStart(2, "0");
|
|
89
95
|
return `${n}-${r}-${o}`;
|
|
90
|
-
},
|
|
96
|
+
}, p = (t) => !t || isNaN(t.getTime()) ? null : new Date(t.getFullYear(), t.getMonth(), t.getDate()), u = 1e3 * 60 * 60, g = u * 24, k = (t) => {
|
|
91
97
|
const e = s(t);
|
|
92
98
|
if (!e) return null;
|
|
93
99
|
const n = /* @__PURE__ */ new Date();
|
|
94
100
|
return (e.getTime() - n.getTime()) / u;
|
|
95
|
-
},
|
|
101
|
+
}, P = (t) => {
|
|
96
102
|
const e = s(t);
|
|
97
103
|
if (!e) return null;
|
|
98
104
|
const n = /* @__PURE__ */ new Date();
|
|
99
|
-
return (e.getTime() - n.getTime()) /
|
|
100
|
-
},
|
|
105
|
+
return (e.getTime() - n.getTime()) / g;
|
|
106
|
+
}, h = (t) => {
|
|
101
107
|
const e = t.getDay();
|
|
102
108
|
return e === 0 || e === 6;
|
|
103
|
-
},
|
|
109
|
+
}, f = (t, e) => {
|
|
104
110
|
const n = new Date(t);
|
|
105
111
|
return n.setDate(n.getDate() + e), n;
|
|
106
|
-
},
|
|
112
|
+
}, v = (t, e) => {
|
|
107
113
|
const n = new Date(t);
|
|
108
114
|
return n.setFullYear(n.getFullYear() + e), n;
|
|
109
|
-
},
|
|
115
|
+
}, C = (t, e) => {
|
|
110
116
|
let n = new Date(t);
|
|
111
117
|
n.setHours(0, 0, 0, 0);
|
|
112
118
|
let r = 0;
|
|
113
119
|
for (; r < e; )
|
|
114
|
-
n =
|
|
120
|
+
n = f(n, 1), h(n) || r++;
|
|
115
121
|
return n;
|
|
116
122
|
};
|
|
117
|
-
function
|
|
123
|
+
function _(t, e) {
|
|
118
124
|
if (!(t == null || e == null))
|
|
119
125
|
return `${String(t).padStart(2, "0")}-${String(e).padStart(2, "0")}`;
|
|
120
126
|
}
|
|
121
|
-
function
|
|
127
|
+
function z(t) {
|
|
122
128
|
return new Date(2023, t, 0).getDate();
|
|
123
129
|
}
|
|
124
130
|
export {
|
|
125
131
|
u as MS_PER_HOUR,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
132
|
+
C as addBusinessDays,
|
|
133
|
+
f as addDays,
|
|
134
|
+
v as addYears,
|
|
135
|
+
T as formatDateLong,
|
|
136
|
+
M as formatDateLongWithYear,
|
|
137
|
+
N as formatDateShort,
|
|
138
|
+
S as formatDateShortWithWeekday,
|
|
139
|
+
w as formatDateShortWithWeekdayAndYear,
|
|
140
|
+
F as formatDateShortWithYear,
|
|
141
|
+
l as formatDateToStringDate,
|
|
142
|
+
$ as formatDateWithTime,
|
|
143
|
+
_ as formatMonthDay,
|
|
144
|
+
L as formatPayPeriod,
|
|
145
|
+
Y as formatPayPeriodRange,
|
|
146
|
+
z as getDaysInMonth,
|
|
147
|
+
P as getDaysUntil,
|
|
148
|
+
k as getHoursUntil,
|
|
149
|
+
p as normalizeDateToLocal,
|
|
144
150
|
s as normalizeToDate,
|
|
145
|
-
|
|
151
|
+
W as normalizeToISOString,
|
|
152
|
+
R as toRFCDate
|
|
146
153
|
};
|
|
147
154
|
//# sourceMappingURL=dateFormatting.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateFormatting.js","sources":["../../src/helpers/dateFormatting.ts"],"sourcesContent":["/**\n * Normalizes any date input (string, Date, or undefined) to a Date object.\n *\n * @remarks Handles `YYYY-MM-DD` strings by parsing them in local time to avoid\n * timezone drift. Also accepts ISO timestamp strings and existing `Date`\n * instances. Returns `null` for nullish, empty, or unparseable input.\n *\n * @param dateInput - The date value to normalize.\n * @returns A `Date` instance, or `null` if the input is missing or invalid.\n * @internal\n */\nexport const normalizeToDate = (dateInput?: string | Date | null): Date | null => {\n if (!dateInput) return null\n\n if (typeof dateInput === 'string') {\n if (/^\\d{4}-\\d{2}-\\d{2}$/.test(dateInput)) {\n const parts = dateInput.split('-')\n if (parts.length !== 3) return null\n\n const numbers = parts.map(Number)\n const year = numbers[0]\n const month = numbers[1]\n const day = numbers[2]\n if (year === undefined || month === undefined || day === undefined) {\n return null\n }\n\n if (\n isNaN(year) ||\n isNaN(month) ||\n isNaN(day) ||\n month < 1 ||\n month > 12 ||\n day < 1 ||\n day > 31\n ) {\n return null\n }\n\n return new Date(year, month - 1, day)\n }\n\n const parsedDate = new Date(dateInput)\n return isNaN(parsedDate.getTime()) ? null : parsedDate\n }\n\n if (dateInput instanceof Date) {\n return isNaN(dateInput.getTime()) ? null : dateInput\n }\n\n return null\n}\n\n/**\n * Creates a date formatter function that handles both string and Date inputs.\n */\nconst createDateFormatter =\n (options: Intl.DateTimeFormatOptions) =>\n (dateInput?: string | Date | null, locale?: string): string => {\n const date = normalizeToDate(dateInput)\n if (!date) return ''\n return date.toLocaleDateString(locale, options)\n }\n\n/**\n * Formats a date as a short weekday plus short month and day (e.g. `Mon, Jan 5`).\n *\n * @internal\n */\nexport const formatDateShortWithWeekday = createDateFormatter({\n weekday: 'short',\n month: 'short',\n day: 'numeric',\n})\n\n/**\n * Formats a date as a short weekday, short month, day, and year (e.g. `Mon, Jan 5, 2025`).\n *\n * @internal\n */\nexport const formatDateShortWithWeekdayAndYear = createDateFormatter({\n weekday: 'short',\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n})\n\n/**\n * Formats a date as a short month and day (e.g. `Jan 5`).\n *\n * @internal\n */\nexport const formatDateShort = createDateFormatter({\n month: 'short',\n day: 'numeric',\n})\n\n/**\n * Formats a date as a short month, day, and year (e.g. `Jan 5, 2025`).\n *\n * @internal\n */\nexport const formatDateShortWithYear = createDateFormatter({\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n})\n\n/**\n * Formats a date as a long month and day (e.g. `January 5`).\n *\n * @internal\n */\nexport const formatDateLong = createDateFormatter({\n month: 'long',\n day: 'numeric',\n})\n\n/**\n * Formats a date as a long month, day, and year (e.g. `January 5, 2025`).\n *\n * @internal\n */\nexport const formatDateLongWithYear = createDateFormatter({\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n})\n\n/**\n * Splits a date into separate locale-formatted time and date strings.\n *\n * @param dateInput - The date value to format.\n * @param locale - Optional BCP 47 locale tag passed to `toLocaleString`.\n * @returns An object with `time` (e.g. `3:45 PM EST`) and `date` (e.g. `Mon, Jan 5`).\n * Both fields are empty strings when the input cannot be parsed.\n * @internal\n */\nexport const formatDateWithTime = (\n dateInput?: string | Date | null,\n locale?: string,\n): { time: string; date: string } => {\n const date = normalizeToDate(dateInput)\n if (!date) return { time: '', date: '' }\n\n const time = date.toLocaleTimeString(locale, {\n hour: 'numeric',\n minute: '2-digit',\n hour12: true,\n timeZoneName: 'short',\n })\n\n const dateString = date.toLocaleDateString(locale, {\n weekday: 'short',\n month: 'short',\n day: 'numeric',\n })\n\n return { time, date: dateString }\n}\n\n/**\n * Formats a pay period start and end date for display as separate fields.\n *\n * @remarks Start date renders with the long month and day; end date renders\n * with the short month, day, and year.\n *\n * @param startDateInput - Pay period start date.\n * @param endDateInput - Pay period end date.\n * @param locale - Optional BCP 47 locale tag passed to `toLocaleDateString`.\n * @returns Formatted `startDate` and `endDate` strings. Both fields are empty\n * strings when either input cannot be parsed.\n * @internal\n */\nexport const formatPayPeriod = (\n startDateInput?: string | Date | null,\n endDateInput?: string | Date | null,\n locale?: string,\n): { startDate: string; endDate: string } => {\n const startDate = normalizeToDate(startDateInput)\n const endDate = normalizeToDate(endDateInput)\n\n if (!startDate || !endDate) {\n return { startDate: '', endDate: '' }\n }\n\n const startFormatted = startDate.toLocaleDateString(locale, {\n month: 'long',\n day: 'numeric',\n })\n\n const endFormatted = endDate.toLocaleDateString(locale, {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n })\n\n return { startDate: startFormatted, endDate: endFormatted }\n}\n\n/**\n * Formats a pay period as a single en-dash–separated range string.\n *\n * @param startDateInput - Pay period start date.\n * @param endDateInput - Pay period end date.\n * @param locale - Optional BCP 47 locale tag passed to `toLocaleDateString`.\n * @param options - When `useShortMonth` is true, both ends use short month names.\n * Otherwise both use the long month name.\n * @returns The formatted range (e.g. `January 1–January 15, 2025`), or an empty\n * string when either input cannot be parsed.\n * @internal\n */\nexport const formatPayPeriodRange = (\n startDateInput?: string | Date | null,\n endDateInput?: string | Date | null,\n locale?: string,\n options?: { useShortMonth?: boolean },\n): string => {\n const startDate = normalizeToDate(startDateInput)\n const endDate = normalizeToDate(endDateInput)\n\n if (!startDate || !endDate) return ''\n\n const monthFormat = options?.useShortMonth ? 'short' : 'long'\n\n const startFormatted = startDate.toLocaleDateString(locale, {\n month: monthFormat,\n day: 'numeric',\n })\n\n const endFormatted = endDate.toLocaleDateString(locale, {\n month: monthFormat,\n day: 'numeric',\n year: 'numeric',\n })\n\n return `${startFormatted}–${endFormatted}`\n}\n\n/**\n * Formats a `Date` as a `YYYY-MM-DD` string using the local year, month, and day.\n *\n * @param date - The date to format.\n * @returns A zero-padded `YYYY-MM-DD` string, or `null` when the input is an invalid date.\n * @internal\n */\nexport const formatDateToStringDate = (date: Date): string | null => {\n if (isNaN(date.getTime())) {\n return null\n }\n const year = String(date.getFullYear()).padStart(4, '0')\n const month = String(date.getMonth() + 1).padStart(2, '0')\n const day = String(date.getDate()).padStart(2, '0')\n return `${year}-${month}-${day}`\n}\n\n/**\n * Converts any parseable date string to a `YYYY-MM-DD` ISO string using local time.\n *\n * @remarks Reads the local year, month, and day so the calendar date is\n * preserved regardless of the runtime timezone. Safe for dates parsed from\n * locale-format strings (e.g. `4/16/1998`) or ISO strings, both of which land\n * at local midnight when normalized.\n *\n * @param value - The date string to convert.\n * @returns A `YYYY-MM-DD` string, or `''` for nullish, empty, or unparseable input.\n * @internal\n */\nexport const normalizeToISOString = (value?: string | null): string => {\n if (!value) return ''\n const date = normalizeToDate(value)\n if (!date) return ''\n const year = date.getFullYear()\n const month = String(date.getMonth() + 1).padStart(2, '0')\n const day = String(date.getDate()).padStart(2, '0')\n return `${year}-${month}-${day}`\n}\n\n/**\n * Normalizes a `Date` to local midnight, stripping any time-of-day component.\n *\n * @param date - The date to normalize, or `null`.\n * @returns A new `Date` at local midnight, or `null` when the input is missing or invalid.\n * @internal\n */\nexport const normalizeDateToLocal = (date: Date | null): Date | null => {\n if (!date || isNaN(date.getTime())) {\n return null\n }\n return new Date(date.getFullYear(), date.getMonth(), date.getDate())\n}\n\n/**\n * Number of milliseconds in one hour.\n *\n * @internal\n */\nexport const MS_PER_HOUR = 1000 * 60 * 60\nconst MS_PER_DAY = MS_PER_HOUR * 24\n\n/**\n * Returns the number of hours from now until a deadline.\n *\n * @param deadline - Target date in the future (or past, for negative results).\n * @returns Hours until `deadline` (fractional, negative if `deadline` is in\n * the past), or `null` when the input cannot be parsed.\n * @internal\n */\nexport const getHoursUntil = (deadline?: Date | string | null): number | null => {\n const deadlineDate = normalizeToDate(deadline)\n if (!deadlineDate) return null\n\n const now = new Date()\n const timeDiffMs = deadlineDate.getTime() - now.getTime()\n return timeDiffMs / MS_PER_HOUR\n}\n\n/**\n * Returns the number of days from now until a deadline.\n *\n * @param deadline - Target date in the future (or past, for negative results).\n * @returns Days until `deadline` (fractional, negative if `deadline` is in\n * the past), or `null` when the input cannot be parsed.\n * @internal\n */\nexport const getDaysUntil = (deadline?: Date | string | null): number | null => {\n const deadlineDate = normalizeToDate(deadline)\n if (!deadlineDate) return null\n\n const now = new Date()\n const timeDiffMs = deadlineDate.getTime() - now.getTime()\n return timeDiffMs / MS_PER_DAY\n}\n\n/**\n * Returns whether a date falls on Saturday or Sunday.\n *\n * @param date - The date to test.\n * @returns `true` if `date` is a weekend day.\n * @internal\n */\nconst isWeekend = (date: Date): boolean => {\n const day = date.getDay()\n return day === 0 || day === 6\n}\n\n/**\n * Returns a new `Date` offset from the input by a given number of days.\n *\n * @param date - The base date. Not mutated.\n * @param days - Number of days to add (negative values subtract).\n * @returns A new `Date` shifted by `days`.\n * @internal\n */\nexport const addDays = (date: Date, days: number): Date => {\n const result = new Date(date)\n result.setDate(result.getDate() + days)\n return result\n}\n\n/**\n * Returns a new `Date` offset by a given number of years.\n *\n * @param date - The base date. Not mutated.\n * @param years - Number of years to add (negative values subtract).\n * @returns A new `Date` shifted by `years`.\n * @internal\n */\nexport const addYears = (date: Date, years: number): Date => {\n const result = new Date(date)\n result.setFullYear(result.getFullYear() + years)\n return result\n}\n\n/**\n * Returns a new `Date` offset by a given number of business days (Monday–Friday).\n *\n * @remarks Skips Saturdays and Sundays when counting. The result is normalized\n * to local midnight. Does not account for holidays.\n *\n * @param startDate - The base date. Not mutated.\n * @param businessDays - Number of business days to add.\n * @returns A new `Date` shifted forward by `businessDays` weekdays.\n * @internal\n */\nexport const addBusinessDays = (startDate: Date, businessDays: number): Date => {\n let currentDate = new Date(startDate)\n currentDate.setHours(0, 0, 0, 0)\n let daysAdded = 0\n\n while (daysAdded < businessDays) {\n currentDate = addDays(currentDate, 1)\n if (!isWeekend(currentDate)) {\n daysAdded++\n }\n }\n\n return currentDate\n}\n\n/**\n * Formats numeric month and day as a zero-padded `MM-DD` string.\n *\n * @param month - Month number, 1–12.\n * @param day - Day-of-month number, 1–31.\n * @returns A `MM-DD` string, or `undefined` when either argument is missing.\n * @internal\n */\nexport function formatMonthDay(month?: number, day?: number): string | undefined {\n if (month == null || day == null) return undefined\n return `${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`\n}\n\n/**\n * Returns the number of days in a given month (1-indexed).\n *\n * @remarks Uses a non-leap year, so February always returns 28.\n *\n * @param month - Month number, 1–12.\n * @returns The number of days in that month.\n * @internal\n */\nexport function getDaysInMonth(month: number): number {\n return new Date(2023, month, 0).getDate()\n}\n"],"names":["normalizeToDate","dateInput","parts","numbers","year","month","day","parsedDate","createDateFormatter","options","locale","date","formatDateShortWithWeekday","formatDateShortWithWeekdayAndYear","formatDateShort","formatDateShortWithYear","formatDateLong","formatDateLongWithYear","formatDateWithTime","time","dateString","formatPayPeriod","startDateInput","endDateInput","startDate","endDate","startFormatted","endFormatted","formatPayPeriodRange","monthFormat","formatDateToStringDate","normalizeToISOString","value","normalizeDateToLocal","MS_PER_HOUR","MS_PER_DAY","getHoursUntil","deadline","deadlineDate","now","getDaysUntil","isWeekend","addDays","days","result","addYears","years","addBusinessDays","businessDays","currentDate","daysAdded","formatMonthDay","getDaysInMonth"],"mappings":"AAWO,MAAMA,IAAkB,CAACC,MAAkD;AACh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'@gusto/embedded-api/types/rfcdate'\n\n/**\n * Normalizes any date input (string, Date, or undefined) to a Date object.\n *\n * @remarks Handles `YYYY-MM-DD` strings by parsing them in local time to avoid\n * timezone drift. Also accepts ISO timestamp strings and existing `Date`\n * instances. Returns `null` for nullish, empty, or unparseable input.\n *\n * @param dateInput - The date value to normalize.\n * @returns A `Date` instance, or `null` if the input is missing or invalid.\n * @internal\n */\nexport const normalizeToDate = (dateInput?: string | Date | null): Date | null => {\n if (!dateInput) return null\n\n if (typeof dateInput === 'string') {\n if (/^\\d{4}-\\d{2}-\\d{2}$/.test(dateInput)) {\n const parts = dateInput.split('-')\n if (parts.length !== 3) return null\n\n const numbers = parts.map(Number)\n const year = numbers[0]\n const month = numbers[1]\n const day = numbers[2]\n if (year === undefined || month === undefined || day === undefined) {\n return null\n }\n\n if (\n isNaN(year) ||\n isNaN(month) ||\n isNaN(day) ||\n month < 1 ||\n month > 12 ||\n day < 1 ||\n day > 31\n ) {\n return null\n }\n\n return new Date(year, month - 1, day)\n }\n\n const parsedDate = new Date(dateInput)\n return isNaN(parsedDate.getTime()) ? null : parsedDate\n }\n\n if (dateInput instanceof Date) {\n return isNaN(dateInput.getTime()) ? null : dateInput\n }\n\n return null\n}\n\n/**\n * Creates a date formatter function that handles both string and Date inputs.\n */\nconst createDateFormatter =\n (options: Intl.DateTimeFormatOptions) =>\n (dateInput?: string | Date | null, locale?: string): string => {\n const date = normalizeToDate(dateInput)\n if (!date) return ''\n return date.toLocaleDateString(locale, options)\n }\n\n/**\n * Formats a date as a short weekday plus short month and day (e.g. `Mon, Jan 5`).\n *\n * @internal\n */\nexport const formatDateShortWithWeekday = createDateFormatter({\n weekday: 'short',\n month: 'short',\n day: 'numeric',\n})\n\n/**\n * Formats a date as a short weekday, short month, day, and year (e.g. `Mon, Jan 5, 2025`).\n *\n * @internal\n */\nexport const formatDateShortWithWeekdayAndYear = createDateFormatter({\n weekday: 'short',\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n})\n\n/**\n * Formats a date as a short month and day (e.g. `Jan 5`).\n *\n * @internal\n */\nexport const formatDateShort = createDateFormatter({\n month: 'short',\n day: 'numeric',\n})\n\n/**\n * Formats a date as a short month, day, and year (e.g. `Jan 5, 2025`).\n *\n * @internal\n */\nexport const formatDateShortWithYear = createDateFormatter({\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n})\n\n/**\n * Formats a date as a long month and day (e.g. `January 5`).\n *\n * @internal\n */\nexport const formatDateLong = createDateFormatter({\n month: 'long',\n day: 'numeric',\n})\n\n/**\n * Formats a date as a long month, day, and year (e.g. `January 5, 2025`).\n *\n * @internal\n */\nexport const formatDateLongWithYear = createDateFormatter({\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n})\n\n/**\n * Splits a date into separate locale-formatted time and date strings.\n *\n * @param dateInput - The date value to format.\n * @param locale - Optional BCP 47 locale tag passed to `toLocaleString`.\n * @returns An object with `time` (e.g. `3:45 PM EST`) and `date` (e.g. `Mon, Jan 5`).\n * Both fields are empty strings when the input cannot be parsed.\n * @internal\n */\nexport const formatDateWithTime = (\n dateInput?: string | Date | null,\n locale?: string,\n): { time: string; date: string } => {\n const date = normalizeToDate(dateInput)\n if (!date) return { time: '', date: '' }\n\n const time = date.toLocaleTimeString(locale, {\n hour: 'numeric',\n minute: '2-digit',\n hour12: true,\n timeZoneName: 'short',\n })\n\n const dateString = date.toLocaleDateString(locale, {\n weekday: 'short',\n month: 'short',\n day: 'numeric',\n })\n\n return { time, date: dateString }\n}\n\n/**\n * Formats a pay period start and end date for display as separate fields.\n *\n * @remarks Start date renders with the long month and day; end date renders\n * with the short month, day, and year.\n *\n * @param startDateInput - Pay period start date.\n * @param endDateInput - Pay period end date.\n * @param locale - Optional BCP 47 locale tag passed to `toLocaleDateString`.\n * @returns Formatted `startDate` and `endDate` strings. Both fields are empty\n * strings when either input cannot be parsed.\n * @internal\n */\nexport const formatPayPeriod = (\n startDateInput?: string | Date | null,\n endDateInput?: string | Date | null,\n locale?: string,\n): { startDate: string; endDate: string } => {\n const startDate = normalizeToDate(startDateInput)\n const endDate = normalizeToDate(endDateInput)\n\n if (!startDate || !endDate) {\n return { startDate: '', endDate: '' }\n }\n\n const startFormatted = startDate.toLocaleDateString(locale, {\n month: 'long',\n day: 'numeric',\n })\n\n const endFormatted = endDate.toLocaleDateString(locale, {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n })\n\n return { startDate: startFormatted, endDate: endFormatted }\n}\n\n/**\n * Formats a pay period as a single en-dash–separated range string.\n *\n * @param startDateInput - Pay period start date.\n * @param endDateInput - Pay period end date.\n * @param locale - Optional BCP 47 locale tag passed to `toLocaleDateString`.\n * @param options - When `useShortMonth` is true, both ends use short month names.\n * Otherwise both use the long month name.\n * @returns The formatted range (e.g. `January 1–January 15, 2025`), or an empty\n * string when either input cannot be parsed.\n * @internal\n */\nexport const formatPayPeriodRange = (\n startDateInput?: string | Date | null,\n endDateInput?: string | Date | null,\n locale?: string,\n options?: { useShortMonth?: boolean },\n): string => {\n const startDate = normalizeToDate(startDateInput)\n const endDate = normalizeToDate(endDateInput)\n\n if (!startDate || !endDate) return ''\n\n const monthFormat = options?.useShortMonth ? 'short' : 'long'\n\n const startFormatted = startDate.toLocaleDateString(locale, {\n month: monthFormat,\n day: 'numeric',\n })\n\n const endFormatted = endDate.toLocaleDateString(locale, {\n month: monthFormat,\n day: 'numeric',\n year: 'numeric',\n })\n\n return `${startFormatted}–${endFormatted}`\n}\n\n/**\n * Formats a `Date` as a `YYYY-MM-DD` string using the local year, month, and day.\n *\n * @param date - The date to format.\n * @returns A zero-padded `YYYY-MM-DD` string, or `null` when the input is an invalid date.\n * @internal\n */\nexport const formatDateToStringDate = (date: Date): string | null => {\n if (isNaN(date.getTime())) {\n return null\n }\n const year = String(date.getFullYear()).padStart(4, '0')\n const month = String(date.getMonth() + 1).padStart(2, '0')\n const day = String(date.getDate()).padStart(2, '0')\n return `${year}-${month}-${day}`\n}\n\n/**\n * Converts a `Date` into an `RFCDate` for the same local calendar day.\n *\n * @remarks Use this instead of `new RFCDate(date)`, which serializes through\n * `toISOString()` and shifts the day back by one in timezones ahead of UTC.\n *\n * @param date - The date to convert.\n * @returns An `RFCDate` carrying the local year, month, and day of `date`.\n * @throws RangeError when `date` is an invalid date.\n * @internal\n */\nexport const toRFCDate = (date: Date): RFCDate => {\n const dateString = formatDateToStringDate(date)\n if (!dateString) {\n throw new RangeError(`Cannot convert an invalid date to RFCDate: ${String(date)}`)\n }\n return new RFCDate(dateString)\n}\n\n/**\n * Converts any parseable date string to a `YYYY-MM-DD` ISO string using local time.\n *\n * @remarks Reads the local year, month, and day so the calendar date is\n * preserved regardless of the runtime timezone. Safe for dates parsed from\n * locale-format strings (e.g. `4/16/1998`) or ISO strings, both of which land\n * at local midnight when normalized.\n *\n * @param value - The date string to convert.\n * @returns A `YYYY-MM-DD` string, or `''` for nullish, empty, or unparseable input.\n * @internal\n */\nexport const normalizeToISOString = (value?: string | null): string => {\n if (!value) return ''\n const date = normalizeToDate(value)\n if (!date) return ''\n const year = date.getFullYear()\n const month = String(date.getMonth() + 1).padStart(2, '0')\n const day = String(date.getDate()).padStart(2, '0')\n return `${year}-${month}-${day}`\n}\n\n/**\n * Normalizes a `Date` to local midnight, stripping any time-of-day component.\n *\n * @param date - The date to normalize, or `null`.\n * @returns A new `Date` at local midnight, or `null` when the input is missing or invalid.\n * @internal\n */\nexport const normalizeDateToLocal = (date: Date | null): Date | null => {\n if (!date || isNaN(date.getTime())) {\n return null\n }\n return new Date(date.getFullYear(), date.getMonth(), date.getDate())\n}\n\n/**\n * Number of milliseconds in one hour.\n *\n * @internal\n */\nexport const MS_PER_HOUR = 1000 * 60 * 60\nconst MS_PER_DAY = MS_PER_HOUR * 24\n\n/**\n * Returns the number of hours from now until a deadline.\n *\n * @param deadline - Target date in the future (or past, for negative results).\n * @returns Hours until `deadline` (fractional, negative if `deadline` is in\n * the past), or `null` when the input cannot be parsed.\n * @internal\n */\nexport const getHoursUntil = (deadline?: Date | string | null): number | null => {\n const deadlineDate = normalizeToDate(deadline)\n if (!deadlineDate) return null\n\n const now = new Date()\n const timeDiffMs = deadlineDate.getTime() - now.getTime()\n return timeDiffMs / MS_PER_HOUR\n}\n\n/**\n * Returns the number of days from now until a deadline.\n *\n * @param deadline - Target date in the future (or past, for negative results).\n * @returns Days until `deadline` (fractional, negative if `deadline` is in\n * the past), or `null` when the input cannot be parsed.\n * @internal\n */\nexport const getDaysUntil = (deadline?: Date | string | null): number | null => {\n const deadlineDate = normalizeToDate(deadline)\n if (!deadlineDate) return null\n\n const now = new Date()\n const timeDiffMs = deadlineDate.getTime() - now.getTime()\n return timeDiffMs / MS_PER_DAY\n}\n\n/**\n * Returns whether a date falls on Saturday or Sunday.\n *\n * @param date - The date to test.\n * @returns `true` if `date` is a weekend day.\n * @internal\n */\nconst isWeekend = (date: Date): boolean => {\n const day = date.getDay()\n return day === 0 || day === 6\n}\n\n/**\n * Returns a new `Date` offset from the input by a given number of days.\n *\n * @param date - The base date. Not mutated.\n * @param days - Number of days to add (negative values subtract).\n * @returns A new `Date` shifted by `days`.\n * @internal\n */\nexport const addDays = (date: Date, days: number): Date => {\n const result = new Date(date)\n result.setDate(result.getDate() + days)\n return result\n}\n\n/**\n * Returns a new `Date` offset by a given number of years.\n *\n * @param date - The base date. Not mutated.\n * @param years - Number of years to add (negative values subtract).\n * @returns A new `Date` shifted by `years`.\n * @internal\n */\nexport const addYears = (date: Date, years: number): Date => {\n const result = new Date(date)\n result.setFullYear(result.getFullYear() + years)\n return result\n}\n\n/**\n * Returns a new `Date` offset by a given number of business days (Monday–Friday).\n *\n * @remarks Skips Saturdays and Sundays when counting. The result is normalized\n * to local midnight. Does not account for holidays.\n *\n * @param startDate - The base date. Not mutated.\n * @param businessDays - Number of business days to add.\n * @returns A new `Date` shifted forward by `businessDays` weekdays.\n * @internal\n */\nexport const addBusinessDays = (startDate: Date, businessDays: number): Date => {\n let currentDate = new Date(startDate)\n currentDate.setHours(0, 0, 0, 0)\n let daysAdded = 0\n\n while (daysAdded < businessDays) {\n currentDate = addDays(currentDate, 1)\n if (!isWeekend(currentDate)) {\n daysAdded++\n }\n }\n\n return currentDate\n}\n\n/**\n * Formats numeric month and day as a zero-padded `MM-DD` string.\n *\n * @param month - Month number, 1–12.\n * @param day - Day-of-month number, 1–31.\n * @returns A `MM-DD` string, or `undefined` when either argument is missing.\n * @internal\n */\nexport function formatMonthDay(month?: number, day?: number): string | undefined {\n if (month == null || day == null) return undefined\n return `${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`\n}\n\n/**\n * Returns the number of days in a given month (1-indexed).\n *\n * @remarks Uses a non-leap year, so February always returns 28.\n *\n * @param month - Month number, 1–12.\n * @returns The number of days in that month.\n * @internal\n */\nexport function getDaysInMonth(month: number): number {\n return new Date(2023, month, 0).getDate()\n}\n"],"names":["normalizeToDate","dateInput","parts","numbers","year","month","day","parsedDate","createDateFormatter","options","locale","date","formatDateShortWithWeekday","formatDateShortWithWeekdayAndYear","formatDateShort","formatDateShortWithYear","formatDateLong","formatDateLongWithYear","formatDateWithTime","time","dateString","formatPayPeriod","startDateInput","endDateInput","startDate","endDate","startFormatted","endFormatted","formatPayPeriodRange","monthFormat","formatDateToStringDate","toRFCDate","RFCDate","normalizeToISOString","value","normalizeDateToLocal","MS_PER_HOUR","MS_PER_DAY","getHoursUntil","deadline","deadlineDate","now","getDaysUntil","isWeekend","addDays","days","result","addYears","years","addBusinessDays","businessDays","currentDate","daysAdded","formatMonthDay","getDaysInMonth"],"mappings":";AAaO,MAAMA,IAAkB,CAACC,MAAkD;AAChF,MAAI,CAACA,EAAW,QAAO;AAEvB,MAAI,OAAOA,KAAc,UAAU;AACjC,QAAI,sBAAsB,KAAKA,CAAS,GAAG;AACzC,YAAMC,IAAQD,EAAU,MAAM,GAAG;AACjC,UAAIC,EAAM,WAAW,EAAG,QAAO;AAE/B,YAAMC,IAAUD,EAAM,IAAI,MAAM,GAC1BE,IAAOD,EAAQ,CAAC,GAChBE,IAAQF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BuC,CAAQ;AAC7C,MAAI,CAACC,EAAc,QAAO;AAE1B,QAAMC,wBAAU,KAAA;AAEhB,UADmBD,EAAa,QAAA,IAAYC,EAAI,QAAA,KAC5BJ;AACtB,GASMM,IAAY,CAAChC,MAAwB;AACzC,QAAML,IAAMK,EAAK,OAAA;AACjB,SAAOL,MAAQ,KAAKA,MAAQ;AAC9B,GAUasC,IAAU,CAACjC,GAAYkC,MAAuB;AACzD,QAAMC,IAAS,IAAI,KAAKnC,CAAI;AAC5B,SAAAmC,EAAO,QAAQA,EAAO,QAAA,IAAYD,CAAI,GAC/BC;AACT,GAUaC,IAAW,CAACpC,GAAYqC,MAAwB;AAC3D,QAAMF,IAAS,IAAI,KAAKnC,CAAI;AAC5B,SAAAmC,EAAO,YAAYA,EAAO,YAAA,IAAgBE,CAAK,GACxCF;AACT,GAaaG,IAAkB,CAACzB,GAAiB0B,MAA+B;AAC9E,MAAIC,IAAc,IAAI,KAAK3B,CAAS;AACpC,EAAA2B,EAAY,SAAS,GAAG,GAAG,GAAG,CAAC;AAC/B,MAAIC,IAAY;AAEhB,SAAOA,IAAYF;AACjB,IAAAC,IAAcP,EAAQO,GAAa,CAAC,GAC/BR,EAAUQ,CAAW,KACxBC;AAIJ,SAAOD;AACT;AAUO,SAASE,EAAehD,GAAgBC,GAAkC;AAC/E,MAAI,EAAAD,KAAS,QAAQC,KAAO;AAC5B,WAAO,GAAG,OAAOD,CAAK,EAAE,SAAS,GAAG,GAAG,CAAC,IAAI,OAAOC,CAAG,EAAE,SAAS,GAAG,GAAG,CAAC;AAC1E;AAWO,SAASgD,EAAejD,GAAuB;AACpD,SAAO,IAAI,KAAK,MAAMA,GAAO,CAAC,EAAE,QAAA;AAClC;"}
|
|
@@ -1,34 +1,36 @@
|
|
|
1
|
-
const e = "Pay schedule",
|
|
1
|
+
const e = "Pay schedule", a = "You have assigned everyone to be on one pay schedule.", t = "You have assigned employees to pay schedules by compensation type.", o = "Pay schedules by compensation type", s = "Manage", n = "Edit", l = "Edit schedule", c = "Edit pay schedule", d = "Edit AutoPilot", i = "Pay schedule actions", u = { name: "Name", frequency: "Frequency", schedule: "Schedule" }, y = { hourly: "Hourly", salaried: "Salaried" }, r = { label: "AutoPilot", enabled: "Enabled", disabled: "Disabled" }, p = { assignmentUpdated: "Pay schedule assignment updated." }, h = { anchorEndOfPayPeriodDescription: "The last date of the first pay period; can be the same as the first pay date.", payrollDeadline: "Run payroll by" }, b = {
|
|
2
2
|
title: e,
|
|
3
|
-
description:
|
|
4
|
-
compensationDescription:
|
|
5
|
-
compensationTableLabel:
|
|
6
|
-
manageCta:
|
|
3
|
+
description: a,
|
|
4
|
+
compensationDescription: t,
|
|
5
|
+
compensationTableLabel: o,
|
|
6
|
+
manageCta: s,
|
|
7
7
|
editCta: n,
|
|
8
|
-
editScheduleCta:
|
|
9
|
-
editScheduleAriaLabel:
|
|
8
|
+
editScheduleCta: l,
|
|
9
|
+
editScheduleAriaLabel: c,
|
|
10
10
|
editAutoPilotAriaLabel: d,
|
|
11
11
|
rowMenuTriggerLabel: i,
|
|
12
12
|
labels: u,
|
|
13
13
|
compensationTypes: y,
|
|
14
|
-
autoPilot:
|
|
15
|
-
alerts:
|
|
14
|
+
autoPilot: r,
|
|
15
|
+
alerts: p,
|
|
16
|
+
scheduleForm: h
|
|
16
17
|
};
|
|
17
18
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
p as alerts,
|
|
20
|
+
r as autoPilot,
|
|
21
|
+
t as compensationDescription,
|
|
22
|
+
o as compensationTableLabel,
|
|
22
23
|
y as compensationTypes,
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
b as default,
|
|
25
|
+
a as description,
|
|
25
26
|
d as editAutoPilotAriaLabel,
|
|
26
27
|
n as editCta,
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
c as editScheduleAriaLabel,
|
|
29
|
+
l as editScheduleCta,
|
|
29
30
|
u as labels,
|
|
30
|
-
|
|
31
|
+
s as manageCta,
|
|
31
32
|
i as rowMenuTriggerLabel,
|
|
33
|
+
h as scheduleForm,
|
|
32
34
|
e as title
|
|
33
35
|
};
|
|
34
36
|
//# sourceMappingURL=Company.Management.PaySchedule.json.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Company.Management.PaySchedule.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Company.Management.PaySchedule.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
const e = { heading: "Choose schedule type", description: "After you choose, you can create a pay schedule for each group.", options: { single: { label: "Everyone on one schedule", description: "Choose one pay schedule for all your employees" }, hourlySalaried: { label: "Separate schedules by compensation type", description: "Choose one pay schedule for hourly employees and another for salaried employees" } } }, a = { heading: "Assign employees", payScheduleLabel: "Pay schedule", payScheduleDescription: "The pay schedule to use for all employees.", addPayScheduleCta: "Add pay schedule" }, o = { heading: "Assign employees", hourlyPayScheduleLabel: "Hourly employees", hourlyPayScheduleDescription: "The pay schedule to use for hourly employees.", salariedPayScheduleLabel: "Salaried employees", salariedPayScheduleDescription: "The pay schedule to use for salaried employees.", addPayScheduleCta: "Add pay schedule" }, s = { heading: "Review changes", noChangesHeading: "There are no changes to review.", noChangesDescription: "If you intended to make changes, please go back and make them.", employeeChangesHeading: "Employees affected", nameLabel: "Name", transitionPayPeriodLabel: "Transition pay period", payFrequencyLabel: "New pay frequency", firstPayPeriodLabel: "First pay period", noTransitionNeeded: "No transition needed" }, n = "Back", l = "Continue",
|
|
1
|
+
const e = { heading: "Choose schedule type", description: "After you choose, you can create a pay schedule for each group.", options: { single: { label: "Everyone on one schedule", description: "Choose one pay schedule for all your employees" }, hourlySalaried: { label: "Separate schedules by compensation type", description: "Choose one pay schedule for hourly employees and another for salaried employees" } } }, a = { heading: "Assign employees", payScheduleLabel: "Pay schedule", payScheduleDescription: "The pay schedule to use for all employees.", addPayScheduleCta: "Add pay schedule" }, o = { heading: "Assign employees", hourlyPayScheduleLabel: "Hourly employees", hourlyPayScheduleDescription: "The pay schedule to use for hourly employees.", salariedPayScheduleLabel: "Salaried employees", salariedPayScheduleDescription: "The pay schedule to use for salaried employees.", addPayScheduleCta: "Add pay schedule" }, s = { heading: "Review changes", noChangesHeading: "There are no changes to review.", noChangesDescription: "If you intended to make changes, please go back and make them.", employeeChangesHeading: "Employees affected", nameLabel: "Name", transitionPayPeriodLabel: "Transition pay period", payFrequencyLabel: "New pay frequency", firstPayPeriodLabel: "First pay period", noTransitionNeeded: "No transition needed" }, n = "Back", l = "Continue", t = "Submit", d = { anchorEndOfPayPeriodDescription: "The last date of the first pay period; can be the same as the first pay date.", payrollDeadline: "Run payroll by" }, i = {
|
|
2
2
|
typeStep: e,
|
|
3
3
|
scheduleStep: a,
|
|
4
4
|
compensationStep: o,
|
|
5
5
|
reviewStep: s,
|
|
6
6
|
backCta: n,
|
|
7
7
|
continueCta: l,
|
|
8
|
-
submitCta:
|
|
8
|
+
submitCta: t,
|
|
9
|
+
scheduleForm: d
|
|
9
10
|
};
|
|
10
11
|
export {
|
|
11
12
|
n as backCta,
|
|
12
13
|
o as compensationStep,
|
|
13
14
|
l as continueCta,
|
|
14
|
-
|
|
15
|
+
i as default,
|
|
15
16
|
s as reviewStep,
|
|
17
|
+
d as scheduleForm,
|
|
16
18
|
a as scheduleStep,
|
|
17
|
-
|
|
19
|
+
t as submitCta,
|
|
18
20
|
e as typeStep
|
|
19
21
|
};
|
|
20
22
|
//# sourceMappingURL=Company.Management.PayScheduleAssignment.json.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Company.Management.PayScheduleAssignment.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Company.Management.PayScheduleAssignment.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const e = "Payroll history",
|
|
1
|
+
const e = "Payroll history", t = { startDate: "From", endDate: "To", apply: "Apply", cancel: "Cancel", reset: "Reset", selectDates: "Select dates", trigger: "Filter by date" }, a = { label: "Payroll history" }, l = { payPeriod: "Pay period", type: "Type", payDate: "Pay date", status: "Status", totalPayroll: "Total payroll" }, o = { viewSummary: "View payroll summary", viewReceipt: "View payroll receipt", cancelPayroll: "Cancel payroll" }, r = { default: { title: "No payroll history", description: "When you run payrolls, they'll appear here for easy reference." }, filtered: { title: "No payrolls in this date range", description: "Try adjusting the date filter to see more payrolls." } }, y = { noAmount: "—" }, i = { title: "Cancel {{payPeriod}} payroll?", body: "You may cancel this payroll and run it again later. Your changes will be saved.", deadline: "Run this payroll by {{time}} on {{date}} to pay your employees on time.", primaryAction: "Yes, cancel payroll", secondaryAction: "No, go back" }, s = {
|
|
2
2
|
title: e,
|
|
3
|
-
dateFilter:
|
|
4
|
-
dataView:
|
|
3
|
+
dateFilter: t,
|
|
4
|
+
dataView: a,
|
|
5
5
|
columns: l,
|
|
6
6
|
menu: o,
|
|
7
7
|
emptyState: r,
|
|
@@ -11,8 +11,8 @@ const e = "Payroll history", a = { startDate: "From", endDate: "To", apply: "App
|
|
|
11
11
|
export {
|
|
12
12
|
i as cancelDialog,
|
|
13
13
|
l as columns,
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
a as dataView,
|
|
15
|
+
t as dateFilter,
|
|
16
16
|
s as default,
|
|
17
17
|
r as emptyState,
|
|
18
18
|
y as labels,
|