@gusto/embedded-react-sdk 0.14.1 → 0.16.0
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 +51 -0
- package/dist/assets/icons/feature-icon-check.svg.js +10 -0
- package/dist/assets/icons/feature-icon-check.svg.js.map +1 -0
- package/dist/components/Common/DataView/DataView.d.ts +2 -1
- package/dist/components/Common/DataView/DataView.js +19 -18
- package/dist/components/Common/DataView/DataView.js.map +1 -1
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.d.ts +2 -0
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +52 -0
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js.map +1 -0
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes.d.ts +44 -0
- package/dist/components/Common/FlowBreadcrumbs/index.d.ts +3 -0
- package/dist/components/Common/PaginationControl/PaginationControl.js +36 -36
- package/dist/components/Common/PaginationControl/PaginationControl.js.map +1 -1
- package/dist/components/Common/PaginationControl/PaginationControlTypes.d.ts +3 -1
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.d.ts +2 -0
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +38 -0
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js.map +1 -0
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.module.scss.js +16 -0
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.module.scss.js.map +1 -0
- package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.d.ts +27 -0
- package/dist/components/Common/UI/Breadcrumbs/index.d.ts +3 -0
- package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
- package/dist/components/Company/Locations/LocationsList/List.js +28 -26
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +7 -6
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.d.ts +3 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingFlow/OnboardingFlow.js +10 -10
- package/dist/components/Company/OnboardingFlow/OnboardingFlow.js.map +1 -1
- package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js +16 -10
- package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +6 -6
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +59 -57
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/ContractorList/useContractorList.d.ts +3 -1
- package/dist/components/Contractor/ContractorList/useContractorList.js +7 -6
- package/dist/components/Contractor/ContractorList/useContractorList.js.map +1 -1
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js +37 -37
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +11 -11
- package/dist/components/Employee/EmployeeList/EmployeeList.js +11 -10
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +45 -43
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.d.ts +3 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Flow/Flow.js +44 -24
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/Flow/useFlow.d.ts +10 -1
- package/dist/components/Flow/useFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.d.ts +1 -1
- package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.js +16 -16
- package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +20 -20
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +9 -9
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +128 -94
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +3 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +72 -76
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +42 -42
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.d.ts +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.js +20 -19
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +5 -3
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +65 -45
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/index.d.ts +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +233 -96
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +21 -20
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +12 -12
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +8 -9
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +83 -78
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +1 -2
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +41 -45
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +1 -2
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +118 -119
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.d.ts +1 -2
- package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js +12 -26
- package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.d.ts +1 -2
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +40 -44
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/helpers.d.ts +2 -0
- package/dist/components/Payroll/helpers.js +38 -37
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.d.ts +4 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +24 -18
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +41 -39
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
- package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/helpers/breadcrumbHelpers.d.ts +33 -0
- package/dist/helpers/breadcrumbHelpers.js +46 -0
- package/dist/helpers/breadcrumbHelpers.js.map +1 -0
- package/dist/helpers/breadcrumbHelpers.test.d.ts +1 -0
- package/dist/i18n/I18n.d.ts +1 -1
- package/dist/i18n/I18n.js +32 -23
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.PaySchedule.json.js +2 -2
- package/dist/i18n/en/Payroll.PayrollBlocker.json.js +28 -0
- package/dist/i18n/en/Payroll.PayrollBlocker.json.js.map +1 -0
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +28 -24
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +28 -26
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollFlow.json.js +8 -0
- package/dist/i18n/en/Payroll.PayrollFlow.json.js.map +1 -0
- package/dist/i18n/en/Payroll.PayrollHistory.json.js +9 -9
- package/dist/i18n/en/Payroll.PayrollLanding.json.js +2 -2
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +60 -56
- package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollReceipts.json.js +16 -12
- package/dist/i18n/en/Payroll.PayrollReceipts.json.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/shared/constants.d.ts +3 -0
- package/dist/shared/constants.js +11 -9
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +157 -150
- package/package.json +12 -12
- package/dist/components/Payroll/RunPayrollFlow/RunPayroll.d.ts +0 -23
- package/dist/components/Payroll/RunPayrollFlow/RunPayrollFlow.d.ts +0 -6
- package/dist/i18n/en/Payroll.RunPayroll.json.js +0 -8
- package/dist/i18n/en/Payroll.RunPayroll.json.js.map +0 -1
- package/dist/i18n/en/PayrollBlocker.json.js +0 -24
- package/dist/i18n/en/PayrollBlocker.json.js.map +0 -1
|
@@ -1,41 +1,42 @@
|
|
|
1
1
|
import { jsx as t, Fragment as r, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as
|
|
2
|
+
import { useTranslation as P } from "react-i18next";
|
|
3
3
|
import { useLocationsList as C } from "./useLocationsList.js";
|
|
4
|
-
import
|
|
4
|
+
import y from "../../../../assets/icons/pencil.svg.js";
|
|
5
5
|
import "classnames";
|
|
6
|
-
import { EmptyData as
|
|
7
|
-
import { useComponentContext as
|
|
8
|
-
import { getStreet as
|
|
9
|
-
import { VisuallyHidden as
|
|
10
|
-
import { HamburgerMenu as
|
|
11
|
-
import { useDataView as
|
|
12
|
-
import { DataView as
|
|
13
|
-
const
|
|
14
|
-
const a =
|
|
6
|
+
import { EmptyData as b } from "../../../Common/EmptyData/EmptyData.js";
|
|
7
|
+
import { useComponentContext as x } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
|
+
import { getStreet as T, getCityStateZip as v } from "../../../../helpers/formattedStrings.js";
|
|
9
|
+
import { VisuallyHidden as A } from "../../../Common/VisuallyHidden/VisuallyHidden.js";
|
|
10
|
+
import { HamburgerMenu as k } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
11
|
+
import { useDataView as D } from "../../../Common/DataView/useDataView.js";
|
|
12
|
+
import { DataView as S } from "../../../Common/DataView/DataView.js";
|
|
13
|
+
const q = () => {
|
|
14
|
+
const a = x(), {
|
|
15
15
|
locationList: o,
|
|
16
16
|
handleEditLocation: s,
|
|
17
17
|
currentPage: d,
|
|
18
18
|
totalPages: l,
|
|
19
19
|
handleFirstPage: m,
|
|
20
20
|
handleItemsPerPageChange: c,
|
|
21
|
-
handleLastPage:
|
|
22
|
-
handleNextPage:
|
|
21
|
+
handleLastPage: g,
|
|
22
|
+
handleNextPage: p,
|
|
23
23
|
handlePreviousPage: u,
|
|
24
|
-
handleAddLocation: h
|
|
25
|
-
|
|
24
|
+
handleAddLocation: h,
|
|
25
|
+
itemsPerPage: f
|
|
26
|
+
} = C(), { t: e } = P("Company.Locations"), { ...L } = D({
|
|
26
27
|
data: o,
|
|
27
28
|
columns: [
|
|
28
29
|
{
|
|
29
30
|
key: "name",
|
|
30
31
|
title: e("locationListCol1"),
|
|
31
32
|
render: (i) => /* @__PURE__ */ t(r, { children: /* @__PURE__ */ n("address", { children: [
|
|
32
|
-
/* @__PURE__ */ t(a.Text, { as: "div", children:
|
|
33
|
-
/* @__PURE__ */ t(a.Text, { as: "div", size: "sm", children:
|
|
33
|
+
/* @__PURE__ */ t(a.Text, { as: "div", children: T(i) }),
|
|
34
|
+
/* @__PURE__ */ t(a.Text, { as: "div", size: "sm", children: v(i) })
|
|
34
35
|
] }) })
|
|
35
36
|
},
|
|
36
37
|
{
|
|
37
38
|
key: "status",
|
|
38
|
-
title: /* @__PURE__ */ t(
|
|
39
|
+
title: /* @__PURE__ */ t(A, { children: e("locationListCol2") }),
|
|
39
40
|
render: (i) => /* @__PURE__ */ n(r, { children: [
|
|
40
41
|
i.mailingAddress && /* @__PURE__ */ t(a.Badge, { status: "info", children: e("mailingAddress") }),
|
|
41
42
|
i.filingAddress && /* @__PURE__ */ n(r, { children: [
|
|
@@ -46,7 +47,7 @@ const Z = () => {
|
|
|
46
47
|
}
|
|
47
48
|
],
|
|
48
49
|
itemMenu: (i) => /* @__PURE__ */ t(
|
|
49
|
-
|
|
50
|
+
k,
|
|
50
51
|
{
|
|
51
52
|
items: [
|
|
52
53
|
{
|
|
@@ -54,7 +55,7 @@ const Z = () => {
|
|
|
54
55
|
onClick: () => {
|
|
55
56
|
s(i.uuid);
|
|
56
57
|
},
|
|
57
|
-
icon: /* @__PURE__ */ t(
|
|
58
|
+
icon: /* @__PURE__ */ t(y, { "aria-hidden": !0 }),
|
|
58
59
|
"data-testid": "edit-location"
|
|
59
60
|
}
|
|
60
61
|
],
|
|
@@ -63,19 +64,20 @@ const Z = () => {
|
|
|
63
64
|
}
|
|
64
65
|
),
|
|
65
66
|
pagination: {
|
|
66
|
-
handleNextPage:
|
|
67
|
+
handleNextPage: p,
|
|
67
68
|
handleFirstPage: m,
|
|
68
|
-
handleLastPage:
|
|
69
|
+
handleLastPage: g,
|
|
69
70
|
handlePreviousPage: u,
|
|
70
71
|
handleItemsPerPageChange: c,
|
|
71
72
|
currentPage: d,
|
|
72
|
-
totalPages: l
|
|
73
|
+
totalPages: l,
|
|
74
|
+
itemsPerPage: f
|
|
73
75
|
},
|
|
74
|
-
emptyState: () => /* @__PURE__ */ t(
|
|
76
|
+
emptyState: () => /* @__PURE__ */ t(b, { title: e("emptyTableTitle"), description: e("emptyTableDescription"), children: /* @__PURE__ */ t(a.Button, { variant: "secondary", onClick: h, children: e("addFirstLocationCta") }) })
|
|
75
77
|
});
|
|
76
|
-
return /* @__PURE__ */ t(
|
|
78
|
+
return /* @__PURE__ */ t(S, { label: e("locationListLabel"), ...L });
|
|
77
79
|
};
|
|
78
80
|
export {
|
|
79
|
-
|
|
81
|
+
q as List
|
|
80
82
|
};
|
|
81
83
|
//# sourceMappingURL=List.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sources":["../../../../../src/components/Company/Locations/LocationsList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { DataView, EmptyData, useDataView, VisuallyHidden } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { getCityStateZip, getStreet } from '@/helpers/formattedStrings'\n\n/**List of employees slot for EmployeeList component */\nexport const List = () => {\n const Components = useComponentContext()\n const {\n locationList,\n handleEditLocation,\n currentPage,\n totalPages,\n handleFirstPage,\n handleItemsPerPageChange,\n handleLastPage,\n handleNextPage,\n handlePreviousPage,\n handleAddLocation,\n } = useLocationsList()\n\n const { t } = useTranslation('Company.Locations')\n const { ...dataViewProps } = useDataView({\n data: locationList,\n columns: [\n {\n key: 'name',\n title: t('locationListCol1'),\n render: location => {\n return (\n <>\n <address>\n <Components.Text as=\"div\">{getStreet(location)}</Components.Text>\n <Components.Text as=\"div\" size=\"sm\">\n {getCityStateZip(location)}\n </Components.Text>\n </address>\n </>\n )\n },\n },\n {\n key: 'status',\n title: <VisuallyHidden>{t('locationListCol2')}</VisuallyHidden>,\n render: location => {\n return (\n <>\n {location.mailingAddress && (\n <Components.Badge status={'info'}>{t('mailingAddress')}</Components.Badge>\n )}\n {location.filingAddress && (\n <>\n {' '}\n <Components.Badge status={'info'}>{t('filingAddress')}</Components.Badge>\n </>\n )}\n </>\n )\n },\n },\n ],\n itemMenu: location => {\n return (\n <HamburgerMenu\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEditLocation(location.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n 'data-testid': 'edit-location',\n },\n ]}\n data-testid=\"location-hamburger\"\n triggerLabel={t('hamburgerTitle')}\n />\n )\n },\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n },\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addFirstLocationCta')}\n </Components.Button>\n </EmptyData>\n ),\n })\n return <DataView label={t('locationListLabel')} {...dataViewProps} />\n}\n"],"names":["List","Components","useComponentContext","locationList","handleEditLocation","currentPage","totalPages","handleFirstPage","handleItemsPerPageChange","handleLastPage","handleNextPage","handlePreviousPage","handleAddLocation","useLocationsList","t","useTranslation","dataViewProps","useDataView","location","jsx","Fragment","getStreet","getCityStateZip","VisuallyHidden","jsxs","HamburgerMenu","PencilSvg","EmptyData","DataView"],"mappings":";;;;;;;;;;;;AASO,MAAMA,IAAO,MAAM;AACxB,QAAMC,IAAaC,EAAA,GACb;AAAA,IACJ,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,mBAAAC;AAAA,EAAA,IACEC,EAAA,GAEE,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,GAAGC,EAAA,IAAkBC,EAAY;AAAA,IACvC,
|
|
1
|
+
{"version":3,"file":"List.js","sources":["../../../../../src/components/Company/Locations/LocationsList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { DataView, EmptyData, useDataView, VisuallyHidden } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { getCityStateZip, getStreet } from '@/helpers/formattedStrings'\n\n/**List of employees slot for EmployeeList component */\nexport const List = () => {\n const Components = useComponentContext()\n const {\n locationList,\n handleEditLocation,\n currentPage,\n totalPages,\n handleFirstPage,\n handleItemsPerPageChange,\n handleLastPage,\n handleNextPage,\n handlePreviousPage,\n handleAddLocation,\n itemsPerPage,\n } = useLocationsList()\n\n const { t } = useTranslation('Company.Locations')\n const { ...dataViewProps } = useDataView({\n data: locationList,\n columns: [\n {\n key: 'name',\n title: t('locationListCol1'),\n render: location => {\n return (\n <>\n <address>\n <Components.Text as=\"div\">{getStreet(location)}</Components.Text>\n <Components.Text as=\"div\" size=\"sm\">\n {getCityStateZip(location)}\n </Components.Text>\n </address>\n </>\n )\n },\n },\n {\n key: 'status',\n title: <VisuallyHidden>{t('locationListCol2')}</VisuallyHidden>,\n render: location => {\n return (\n <>\n {location.mailingAddress && (\n <Components.Badge status={'info'}>{t('mailingAddress')}</Components.Badge>\n )}\n {location.filingAddress && (\n <>\n {' '}\n <Components.Badge status={'info'}>{t('filingAddress')}</Components.Badge>\n </>\n )}\n </>\n )\n },\n },\n ],\n itemMenu: location => {\n return (\n <HamburgerMenu\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEditLocation(location.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n 'data-testid': 'edit-location',\n },\n ]}\n data-testid=\"location-hamburger\"\n triggerLabel={t('hamburgerTitle')}\n />\n )\n },\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n itemsPerPage,\n },\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addFirstLocationCta')}\n </Components.Button>\n </EmptyData>\n ),\n })\n return <DataView label={t('locationListLabel')} {...dataViewProps} />\n}\n"],"names":["List","Components","useComponentContext","locationList","handleEditLocation","currentPage","totalPages","handleFirstPage","handleItemsPerPageChange","handleLastPage","handleNextPage","handlePreviousPage","handleAddLocation","itemsPerPage","useLocationsList","t","useTranslation","dataViewProps","useDataView","location","jsx","Fragment","getStreet","getCityStateZip","VisuallyHidden","jsxs","HamburgerMenu","PencilSvg","EmptyData","DataView"],"mappings":";;;;;;;;;;;;AASO,MAAMA,IAAO,MAAM;AACxB,QAAMC,IAAaC,EAAA,GACb;AAAA,IACJ,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,cAAAC;AAAA,EAAA,IACEC,EAAA,GAEE,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,GAAGC,EAAA,IAAkBC,EAAY;AAAA,IACvC,MAAMf;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAA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AItC,YAAY;AAAA,MACV,gBAAAL;AAAA,MACA,iBAAAH;AAAA,MACA,gBAAAE;AAAA,MACA,oBAAAE;AAAA,MACA,0BAAAH;AAAA,MACA,aAAAH;AAAA,MACA,YAAAC;AAAA,MACA,cAAAO;AAAA,IAAA;AAAA,IAEF,YAAY,MACV,gBAAAO,EAACQ,GAAA,EAAU,OAAOb,EAAE,iBAAiB,GAAG,aAAaA,EAAE,uBAAuB,GAC5E,UAAA,gBAAAK,EAACnB,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASW,GAC7C,UAAAG,EAAE,qBAAqB,EAAA,CAC1B,EAAA,CACF;AAAA,EAAA,CAEH;AACD,2BAAQc,GAAA,EAAS,OAAOd,EAAE,mBAAmB,GAAI,GAAGE,GAAe;AACrE;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e, jsxs as p, Fragment as u } from "react/jsx-runtime";
|
|
2
2
|
import { useLocationsGetSuspense as L } from "@gusto/embedded-api/react-query/locationsGet";
|
|
3
|
-
import { useState as
|
|
3
|
+
import { useState as d } from "react";
|
|
4
4
|
import { Head as f } from "./Head.js";
|
|
5
5
|
import { List as C } from "./List.js";
|
|
6
6
|
import { Actions as A } from "./Actions.js";
|
|
@@ -15,12 +15,12 @@ import { companyEvents as i } from "../../../../shared/constants.js";
|
|
|
15
15
|
function V(o) {
|
|
16
16
|
return /* @__PURE__ */ e(x, { ...o, children: /* @__PURE__ */ e(v, { ...o, children: o.children }) });
|
|
17
17
|
}
|
|
18
|
-
function v({ companyId: o, className:
|
|
18
|
+
function v({ companyId: o, className: l, children: s }) {
|
|
19
19
|
O("Company.Locations");
|
|
20
|
-
const { onEvent: a } = E(), [m, n] =
|
|
20
|
+
const { onEvent: a } = E(), [m, n] = d(1), [c, h] = d(5), {
|
|
21
21
|
data: { locationList: P, httpMeta: g }
|
|
22
|
-
} = L({ companyId: o, page: m, per:
|
|
23
|
-
return /* @__PURE__ */ e("section", { className:
|
|
22
|
+
} = L({ companyId: o, page: m, per: c }), r = Number(g.response.headers.get("x-total-pages") ?? 1);
|
|
23
|
+
return /* @__PURE__ */ e("section", { className: l, children: /* @__PURE__ */ e(
|
|
24
24
|
N,
|
|
25
25
|
{
|
|
26
26
|
value: {
|
|
@@ -50,7 +50,8 @@ function v({ companyId: o, className: d, children: s }) {
|
|
|
50
50
|
},
|
|
51
51
|
handleContinue: () => {
|
|
52
52
|
a(i.COMPANY_LOCATION_DONE);
|
|
53
|
-
}
|
|
53
|
+
},
|
|
54
|
+
itemsPerPage: c
|
|
54
55
|
},
|
|
55
56
|
children: /* @__PURE__ */ e(I, { flexDirection: "column", gap: 32, children: s || /* @__PURE__ */ p(u, { children: [
|
|
56
57
|
/* @__PURE__ */ e(f, {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/LocationsList.tsx"],"sourcesContent":["import { useLocationsGetSuspense } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useState } from 'react'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { LocationsListProvider } from './useLocationsList'\nimport { useI18n } from '@/i18n'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\n\ninterface LocationsListProps extends BaseComponentInterface {\n companyId: string\n}\n\nexport function LocationsList(props: LocationsListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, className, children }: LocationsListProps) {\n useI18n('Company.Locations')\n const { onEvent } = useBase()\n\n const [currentPage, setCurrentPage] = useState(1)\n const [itemsPerPage, setItemsPerPage] = useState(5)\n\n const {\n data: { locationList, httpMeta },\n } = useLocationsGetSuspense({ companyId, page: currentPage, per: itemsPerPage })\n\n const totalPages = Number(httpMeta.response.headers.get('x-total-pages') ?? 1)\n\n const handleItemsPerPageChange = (newCount:
|
|
1
|
+
{"version":3,"file":"LocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/LocationsList.tsx"],"sourcesContent":["import { useLocationsGetSuspense } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useState } from 'react'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { LocationsListProvider } from './useLocationsList'\nimport { useI18n } from '@/i18n'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\nimport type { PaginationItemsPerPage } from '@/components/Common/PaginationControl/PaginationControlTypes'\n\ninterface LocationsListProps extends BaseComponentInterface {\n companyId: string\n}\n\nexport function LocationsList(props: LocationsListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, className, children }: LocationsListProps) {\n useI18n('Company.Locations')\n const { onEvent } = useBase()\n\n const [currentPage, setCurrentPage] = useState(1)\n const [itemsPerPage, setItemsPerPage] = useState<PaginationItemsPerPage>(5)\n\n const {\n data: { locationList, httpMeta },\n } = useLocationsGetSuspense({ companyId, page: currentPage, per: itemsPerPage })\n\n const totalPages = Number(httpMeta.response.headers.get('x-total-pages') ?? 1)\n\n const handleItemsPerPageChange = (newCount: PaginationItemsPerPage) => {\n setItemsPerPage(newCount)\n }\n const handleFirstPage = () => {\n setCurrentPage(1)\n }\n const handlePreviousPage = () => {\n setCurrentPage(prevPage => Math.max(prevPage - 1, 1))\n }\n const handleNextPage = () => {\n setCurrentPage(prevPage => Math.min(prevPage + 1, totalPages))\n }\n const handleLastPage = () => {\n setCurrentPage(totalPages)\n }\n\n const handleContinue = () => {\n onEvent(companyEvents.COMPANY_LOCATION_DONE)\n }\n const handleAddLocation = () => {\n onEvent(companyEvents.COMPANY_LOCATION_CREATE)\n }\n const handleEditLocation = (uuid: string) => {\n onEvent(companyEvents.COMPANY_LOCATION_EDIT, { uuid })\n }\n\n return (\n <section className={className}>\n <LocationsListProvider\n value={{\n locationList: locationList ?? [],\n currentPage,\n totalPages,\n handleFirstPage,\n handlePreviousPage,\n handleNextPage,\n handleLastPage,\n handleItemsPerPageChange,\n handleAddLocation,\n handleEditLocation,\n handleContinue,\n itemsPerPage,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <List />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsListProvider>\n </section>\n )\n}\n"],"names":["LocationsList","props","jsx","BaseComponent","Root","companyId","className","children","useI18n","onEvent","useBase","currentPage","setCurrentPage","useState","itemsPerPage","setItemsPerPage","locationList","httpMeta","useLocationsGetSuspense","totalPages","LocationsListProvider","prevPage","newCount","companyEvents","uuid","Flex","jsxs","Fragment","Head","List","Actions"],"mappings":";;;;;;;;;;;;;;AAiBO,SAASA,EAAcC,GAA2B;AACvD,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,KAAgC;AACpE,EAAAC,EAAQ,mBAAmB;AAC3B,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEd,CAACC,GAAaC,CAAc,IAAIC,EAAS,CAAC,GAC1C,CAACC,GAAcC,CAAe,IAAIF,EAAiC,CAAC,GAEpE;AAAA,IACJ,MAAM,EAAE,cAAAG,GAAc,UAAAC,EAAA;AAAA,EAAS,IAC7BC,EAAwB,EAAE,WAAAb,GAAW,MAAMM,GAAa,KAAKG,GAAc,GAEzEK,IAAa,OAAOF,EAAS,SAAS,QAAQ,IAAI,eAAe,KAAK,CAAC;AA4B7E,SACE,gBAAAf,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;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from '../../../Common/PaginationControl/PaginationControlTypes';
|
|
2
3
|
type LocationsListContextType = {
|
|
3
4
|
locationList: Location[];
|
|
4
5
|
totalPages: number;
|
|
5
6
|
currentPage: number;
|
|
6
|
-
|
|
7
|
+
itemsPerPage: PaginationItemsPerPage;
|
|
8
|
+
handleItemsPerPageChange: (n: PaginationItemsPerPage) => void;
|
|
7
9
|
handleFirstPage: () => void;
|
|
8
10
|
handlePreviousPage: () => void;
|
|
9
11
|
handleNextPage: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/useLocationsList.ts"],"sourcesContent":["import { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\n\ntype LocationsListContextType = {\n locationList: Location[]\n totalPages: number\n currentPage: number\n handleItemsPerPageChange: (n:
|
|
1
|
+
{"version":3,"file":"useLocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/useLocationsList.ts"],"sourcesContent":["import { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\nimport type { PaginationItemsPerPage } from '@/components/Common/PaginationControl/PaginationControlTypes'\n\ntype LocationsListContextType = {\n locationList: Location[]\n totalPages: number\n currentPage: number\n itemsPerPage: PaginationItemsPerPage\n handleItemsPerPageChange: (n: PaginationItemsPerPage) => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleEditLocation: (uuid: string) => void\n handleAddLocation: () => void\n handleContinue: () => void\n}\n\nconst [useLocationsList, LocationsListProvider] = createCompoundContext<LocationsListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useLocationsList, LocationsListProvider }\n"],"names":["useLocationsList","LocationsListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAmBA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
|
|
@@ -2,29 +2,29 @@ import { jsx as i } from "react/jsx-runtime";
|
|
|
2
2
|
import { createMachine as m } from "robot3";
|
|
3
3
|
import { useMemo as p } from "react";
|
|
4
4
|
import { onboardingMachine as a } from "./onboardingStateMachine.js";
|
|
5
|
-
import { OnboardingOverviewContextual as
|
|
6
|
-
import { Flow as
|
|
7
|
-
const
|
|
8
|
-
const
|
|
5
|
+
import { OnboardingOverviewContextual as c } from "./OnboardingFlowComponents.js";
|
|
6
|
+
import { Flow as s } from "../../Flow/Flow.js";
|
|
7
|
+
const h = ({ companyId: o, onEvent: e, defaultValues: r }) => {
|
|
8
|
+
const n = p(
|
|
9
9
|
() => m(
|
|
10
10
|
"overview",
|
|
11
11
|
a,
|
|
12
|
-
(
|
|
13
|
-
...
|
|
14
|
-
component:
|
|
12
|
+
(t) => ({
|
|
13
|
+
...t,
|
|
14
|
+
component: c,
|
|
15
15
|
companyId: o,
|
|
16
16
|
defaultValues: r,
|
|
17
17
|
totalSteps: 8,
|
|
18
18
|
currentStep: 1,
|
|
19
|
-
|
|
19
|
+
progressBarType: null
|
|
20
20
|
//Overview step does not show progress bar
|
|
21
21
|
})
|
|
22
22
|
),
|
|
23
23
|
[o, r]
|
|
24
24
|
);
|
|
25
|
-
return /* @__PURE__ */ i(
|
|
25
|
+
return /* @__PURE__ */ i(s, { machine: n, onEvent: e });
|
|
26
26
|
};
|
|
27
27
|
export {
|
|
28
|
-
|
|
28
|
+
h as OnboardingFlow
|
|
29
29
|
};
|
|
30
30
|
//# sourceMappingURL=OnboardingFlow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnboardingFlow.js","sources":["../../../../src/components/Company/OnboardingFlow/OnboardingFlow.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { onboardingMachine } from './onboardingStateMachine'\nimport type { OnboardingFlowProps } from './OnboardingFlowComponents'\nimport {\n OnboardingOverviewContextual,\n type OnboardingFlowContextInterface,\n} from './OnboardingFlowComponents'\nimport { Flow } from '@/components/Flow/Flow'\n\nexport const OnboardingFlow = ({ companyId, onEvent, defaultValues }: OnboardingFlowProps) => {\n const onboardingFlow = useMemo(\n () =>\n createMachine(\n 'overview',\n onboardingMachine,\n (initialContext: OnboardingFlowContextInterface) => ({\n ...initialContext,\n component: OnboardingOverviewContextual,\n companyId,\n defaultValues,\n totalSteps: 8,\n currentStep: 1,\n
|
|
1
|
+
{"version":3,"file":"OnboardingFlow.js","sources":["../../../../src/components/Company/OnboardingFlow/OnboardingFlow.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { onboardingMachine } from './onboardingStateMachine'\nimport type { OnboardingFlowProps } from './OnboardingFlowComponents'\nimport {\n OnboardingOverviewContextual,\n type OnboardingFlowContextInterface,\n} from './OnboardingFlowComponents'\nimport { Flow } from '@/components/Flow/Flow'\n\nexport const OnboardingFlow = ({ companyId, onEvent, defaultValues }: OnboardingFlowProps) => {\n const onboardingFlow = useMemo(\n () =>\n createMachine(\n 'overview',\n onboardingMachine,\n (initialContext: OnboardingFlowContextInterface) => ({\n ...initialContext,\n component: OnboardingOverviewContextual,\n companyId,\n defaultValues,\n totalSteps: 8,\n currentStep: 1,\n progressBarType: null, //Overview step does not show progress bar\n }),\n ),\n [companyId, defaultValues],\n )\n return <Flow machine={onboardingFlow} onEvent={onEvent} />\n}\n"],"names":["OnboardingFlow","companyId","onEvent","defaultValues","onboardingFlow","useMemo","createMachine","onboardingMachine","initialContext","OnboardingOverviewContextual","jsx","Flow"],"mappings":";;;;;;AAUO,MAAMA,IAAiB,CAAC,EAAE,WAAAC,GAAW,SAAAC,GAAS,eAAAC,QAAyC;AAC5F,QAAMC,IAAiBC;AAAA,IACrB,MACEC;AAAA,MACE;AAAA,MACAC;AAAA,MACA,CAACC,OAAoD;AAAA,QACnD,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,WAAAR;AAAA,QACA,eAAAE;AAAA,QACA,YAAY;AAAA,QACZ,aAAa;AAAA,QACb,iBAAiB;AAAA;AAAA,MAAA;AAAA,IACnB;AAAA,IAEJ,CAACF,GAAWE,CAAa;AAAA,EAAA;AAE3B,SAAO,gBAAAO,EAACC,GAAA,EAAK,SAASP,GAAgB,SAAAF,EAAA,CAAkB;AAC1D;"}
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import { state as e, transition as t, reduce as o } from "robot3";
|
|
2
|
-
import { OnboardingOverviewContextual as u, DocumentSignerContextual as
|
|
2
|
+
import { OnboardingOverviewContextual as u, DocumentSignerContextual as p, StateTaxesContextual as s, PayScheduleContextual as O, EmployeesContextual as E, BankAccountContextual as l, IndustryContextual as N, FederalTaxesContextual as C, LocationsContextual as _ } from "./OnboardingFlowComponents.js";
|
|
3
3
|
import { componentEvents as n } from "../../../shared/constants.js";
|
|
4
|
-
const r = (
|
|
5
|
-
...
|
|
6
|
-
...
|
|
4
|
+
const r = (a) => (c) => ({
|
|
5
|
+
...c,
|
|
6
|
+
...a
|
|
7
7
|
}), S = {
|
|
8
8
|
overview: e(
|
|
9
9
|
t(
|
|
10
10
|
n.COMPANY_OVERVIEW_CONTINUE,
|
|
11
11
|
"locations",
|
|
12
|
-
o(
|
|
12
|
+
o(
|
|
13
|
+
r({
|
|
14
|
+
component: _,
|
|
15
|
+
currentStep: 1,
|
|
16
|
+
progressBarType: "progress"
|
|
17
|
+
})
|
|
18
|
+
)
|
|
13
19
|
),
|
|
14
20
|
t(n.COMPANY_OVERVIEW_DONE, "final")
|
|
15
21
|
),
|
|
@@ -24,14 +30,14 @@ const r = (c) => (a) => ({
|
|
|
24
30
|
t(
|
|
25
31
|
n.COMPANY_FEDERAL_TAXES_DONE,
|
|
26
32
|
"industry",
|
|
27
|
-
o(r({ component:
|
|
33
|
+
o(r({ component: N, currentStep: 3 }))
|
|
28
34
|
)
|
|
29
35
|
),
|
|
30
36
|
industry: e(
|
|
31
37
|
t(
|
|
32
38
|
n.COMPANY_INDUSTRY_SELECTED,
|
|
33
39
|
"bankAccount",
|
|
34
|
-
o(r({ component:
|
|
40
|
+
o(r({ component: l, currentStep: 4 }))
|
|
35
41
|
)
|
|
36
42
|
),
|
|
37
43
|
bankAccount: e(
|
|
@@ -52,14 +58,14 @@ const r = (c) => (a) => ({
|
|
|
52
58
|
t(
|
|
53
59
|
n.PAY_SCHEDULE_DONE,
|
|
54
60
|
"stateTaxes",
|
|
55
|
-
o(r({ component:
|
|
61
|
+
o(r({ component: s, currentStep: 7 }))
|
|
56
62
|
)
|
|
57
63
|
),
|
|
58
64
|
stateTaxes: e(
|
|
59
65
|
t(
|
|
60
66
|
n.COMPANY_STATE_TAX_DONE,
|
|
61
67
|
"documents",
|
|
62
|
-
o(r({ component:
|
|
68
|
+
o(r({ component: p, currentStep: 8 }))
|
|
63
69
|
)
|
|
64
70
|
),
|
|
65
71
|
documents: e(
|
|
@@ -70,7 +76,7 @@ const r = (c) => (a) => ({
|
|
|
70
76
|
r({
|
|
71
77
|
component: u,
|
|
72
78
|
currentStep: 1,
|
|
73
|
-
|
|
79
|
+
progressBarType: null
|
|
74
80
|
})
|
|
75
81
|
)
|
|
76
82
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onboardingStateMachine.js","sources":["../../../../src/components/Company/OnboardingFlow/onboardingStateMachine.ts"],"sourcesContent":["import { transition, reduce, state } from 'robot3'\nimport {\n BankAccountContextual,\n DocumentSignerContextual,\n EmployeesContextual,\n FederalTaxesContextual,\n IndustryContextual,\n LocationsContextual,\n OnboardingOverviewContextual,\n PayScheduleContextual,\n StateTaxesContextual,\n type OnboardingFlowContextInterface,\n} from './OnboardingFlowComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineTransition } from '@/types/Helpers'\n\nconst createReducer = (props: Partial<OnboardingFlowContextInterface>) => {\n return (ctx: OnboardingFlowContextInterface): OnboardingFlowContextInterface => ({\n ...ctx,\n ...props,\n })\n}\nexport const onboardingMachine = {\n overview: state<MachineTransition>(\n transition(\n componentEvents.COMPANY_OVERVIEW_CONTINUE,\n 'locations',\n reduce(createReducer({
|
|
1
|
+
{"version":3,"file":"onboardingStateMachine.js","sources":["../../../../src/components/Company/OnboardingFlow/onboardingStateMachine.ts"],"sourcesContent":["import { transition, reduce, state } from 'robot3'\nimport {\n BankAccountContextual,\n DocumentSignerContextual,\n EmployeesContextual,\n FederalTaxesContextual,\n IndustryContextual,\n LocationsContextual,\n OnboardingOverviewContextual,\n PayScheduleContextual,\n StateTaxesContextual,\n type OnboardingFlowContextInterface,\n} from './OnboardingFlowComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineTransition } from '@/types/Helpers'\n\nconst createReducer = (props: Partial<OnboardingFlowContextInterface>) => {\n return (ctx: OnboardingFlowContextInterface): OnboardingFlowContextInterface => ({\n ...ctx,\n ...props,\n })\n}\nexport const onboardingMachine = {\n overview: state<MachineTransition>(\n transition(\n componentEvents.COMPANY_OVERVIEW_CONTINUE,\n 'locations',\n reduce(\n createReducer({\n component: LocationsContextual,\n currentStep: 1,\n progressBarType: 'progress',\n }),\n ),\n ),\n transition(componentEvents.COMPANY_OVERVIEW_DONE, 'final'),\n ),\n locations: state<MachineTransition>(\n transition(\n componentEvents.COMPANY_LOCATION_DONE,\n 'federalTaxes',\n reduce(createReducer({ component: FederalTaxesContextual, currentStep: 2 })),\n ),\n ),\n federalTaxes: state<MachineTransition>(\n transition(\n componentEvents.COMPANY_FEDERAL_TAXES_DONE,\n 'industry',\n reduce(createReducer({ component: IndustryContextual, currentStep: 3 })),\n ),\n ),\n industry: state<MachineTransition>(\n transition(\n componentEvents.COMPANY_INDUSTRY_SELECTED,\n 'bankAccount',\n reduce(createReducer({ component: BankAccountContextual, currentStep: 4 })),\n ),\n ),\n bankAccount: state<MachineTransition>(\n transition(\n componentEvents.COMPANY_BANK_ACCOUNT_DONE,\n 'employees',\n reduce(createReducer({ component: EmployeesContextual, currentStep: 5 })),\n ),\n ),\n employees: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_ONBOARDING_DONE,\n 'payschedule',\n reduce(createReducer({ component: PayScheduleContextual, currentStep: 6 })),\n ),\n ),\n payschedule: state<MachineTransition>(\n transition(\n componentEvents.PAY_SCHEDULE_DONE,\n 'stateTaxes',\n reduce(createReducer({ component: StateTaxesContextual, currentStep: 7 })),\n ),\n ),\n stateTaxes: state<MachineTransition>(\n transition(\n componentEvents.COMPANY_STATE_TAX_DONE,\n 'documents',\n reduce(createReducer({ component: DocumentSignerContextual, currentStep: 8 })),\n ),\n ),\n documents: state<MachineTransition>(\n transition(\n componentEvents.COMPANY_FORMS_DONE,\n 'overview',\n reduce(\n createReducer({\n component: OnboardingOverviewContextual,\n currentStep: 1,\n progressBarType: null,\n }),\n ),\n ),\n ),\n\n final: state<MachineTransition>(),\n}\n"],"names":["createReducer","props","ctx","onboardingMachine","state","transition","componentEvents","reduce","LocationsContextual","FederalTaxesContextual","IndustryContextual","BankAccountContextual","EmployeesContextual","PayScheduleContextual","StateTaxesContextual","DocumentSignerContextual","OnboardingOverviewContextual"],"mappings":";;;AAgBA,MAAMA,IAAgB,CAACC,MACd,CAACC,OAAyE;AAAA,EAC/E,GAAGA;AAAA,EACH,GAAGD;AAAA,IAGME,IAAoB;AAAA,EAC/B,UAAUC;AAAA,IACRC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACEP,EAAc;AAAA,UACZ,WAAWQ;AAAA,UACX,aAAa;AAAA,UACb,iBAAiB;AAAA,QAAA,CAClB;AAAA,MAAA;AAAA,IACH;AAAA,IAEFH,EAAWC,EAAgB,uBAAuB,OAAO;AAAA,EAAA;AAAA,EAE3D,WAAWF;AAAA,IACTC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAOP,EAAc,EAAE,WAAWS,GAAwB,aAAa,GAAG,CAAC;AAAA,IAAA;AAAA,EAC7E;AAAA,EAEF,cAAcL;AAAA,IACZC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAOP,EAAc,EAAE,WAAWU,GAAoB,aAAa,GAAG,CAAC;AAAA,IAAA;AAAA,EACzE;AAAA,EAEF,UAAUN;AAAA,IACRC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAOP,EAAc,EAAE,WAAWW,GAAuB,aAAa,GAAG,CAAC;AAAA,IAAA;AAAA,EAC5E;AAAA,EAEF,aAAaP;AAAA,IACXC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAOP,EAAc,EAAE,WAAWY,GAAqB,aAAa,GAAG,CAAC;AAAA,IAAA;AAAA,EAC1E;AAAA,EAEF,WAAWR;AAAA,IACTC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAOP,EAAc,EAAE,WAAWa,GAAuB,aAAa,GAAG,CAAC;AAAA,IAAA;AAAA,EAC5E;AAAA,EAEF,aAAaT;AAAA,IACXC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAOP,EAAc,EAAE,WAAWc,GAAsB,aAAa,GAAG,CAAC;AAAA,IAAA;AAAA,EAC3E;AAAA,EAEF,YAAYV;AAAA,IACVC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAOP,EAAc,EAAE,WAAWe,GAA0B,aAAa,GAAG,CAAC;AAAA,IAAA;AAAA,EAC/E;AAAA,EAEF,WAAWX;AAAA,IACTC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACEP,EAAc;AAAA,UACZ,WAAWgB;AAAA,UACX,aAAa;AAAA,UACb,iBAAiB;AAAA,QAAA,CAClB;AAAA,MAAA;AAAA,IACH;AAAA,EACF;AAAA,EAGF,OAAOZ,EAAA;AACT;"}
|
|
@@ -2,12 +2,12 @@ import { jsx as t, jsxs as m } from "react/jsx-runtime";
|
|
|
2
2
|
import { useFormContext as C, useWatch as y } from "react-hook-form";
|
|
3
3
|
import { useTranslation as S } from "react-i18next";
|
|
4
4
|
import { useState as g, useEffect as T } from "react";
|
|
5
|
-
import { usePaySchedule as
|
|
5
|
+
import { usePaySchedule as x } from "../usePaySchedule.js";
|
|
6
6
|
import l from "./Edit.module.scss.js";
|
|
7
7
|
import { Flex as h } from "../../../Common/Flex/Flex.js";
|
|
8
|
-
import { Grid as
|
|
8
|
+
import { Grid as E } from "../../../Common/Grid/Grid.js";
|
|
9
9
|
import "classnames";
|
|
10
|
-
import { useComponentContext as
|
|
10
|
+
import { useComponentContext as N } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
11
|
import { useLocale as O } from "../../../../contexts/LocaleProvider/useLocale.js";
|
|
12
12
|
import { formatDateNamedWeekdayShortPlusDate as f } from "../../../../helpers/dateFormatting.js";
|
|
13
13
|
import { TextInputField as R } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
@@ -16,12 +16,12 @@ import { RadioGroupField as M } from "../../../Common/Fields/RadioGroupField/Rad
|
|
|
16
16
|
import { NumberInputField as P } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
17
17
|
import { DatePickerField as D } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
|
|
18
18
|
const Q = () => {
|
|
19
|
-
const o =
|
|
19
|
+
const o = N(), { t: e } = S("Company.PaySchedule"), { locale: u } = O(), { payPeriodPreview: r, mode: p, payPreviewLoading: v } = x(), { setValue: d } = C(), [a, b] = g(0), i = y({ name: "frequency" }), n = y({ name: "customTwicePerMonth" }), w = i === "Twice per month" && n === "custom" || i === "Monthly", q = i === "Twice per month" && n === "custom";
|
|
20
20
|
return T(() => {
|
|
21
21
|
i === "Twice per month" && n === "1st15th" && (d("day1", 15), d("day2", 31));
|
|
22
|
-
}, [i, n, d]), p !== "EDIT_PAY_SCHEDULE" && p !== "ADD_PAY_SCHEDULE" ? null : /* @__PURE__ */ t("div", { className: l.payScheduleContainer, children: /* @__PURE__ */ m(
|
|
22
|
+
}, [i, n, d]), p !== "EDIT_PAY_SCHEDULE" && p !== "ADD_PAY_SCHEDULE" ? null : /* @__PURE__ */ t("div", { className: l.payScheduleContainer, children: /* @__PURE__ */ m(E, { gap: 32, gridTemplateColumns: { base: "1fr", small: "1fr 1fr" }, children: [
|
|
23
23
|
/* @__PURE__ */ t("div", { className: l.payScheduleForm, children: /* @__PURE__ */ m(h, { flexDirection: "column", children: [
|
|
24
|
-
/* @__PURE__ */ t(R, { name: "customName", label: "
|
|
24
|
+
/* @__PURE__ */ t(R, { name: "customName", label: e("labels.name"), isRequired: !0 }),
|
|
25
25
|
/* @__PURE__ */ t(
|
|
26
26
|
F,
|
|
27
27
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Edit.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Edit.tsx"],"sourcesContent":["import { useFormContext, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { useEffect, useState } from 'react'\nimport type { PayScheduleInputs } from '../usePaySchedule'\nimport { usePaySchedule } from '../usePaySchedule'\nimport style from './Edit.module.scss'\nimport {\n Flex,\n SelectField,\n RadioGroupField,\n Grid,\n TextInputField,\n NumberInputField,\n DatePickerField,\n} from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useLocale } from '@/contexts/LocaleProvider'\nimport { formatDateNamedWeekdayShortPlusDate } from '@/helpers/dateFormatting'\n\nexport const Edit = () => {\n const Components = useComponentContext()\n const { t } = useTranslation('Company.PaySchedule')\n const { locale } = useLocale()\n const { payPeriodPreview, mode, payPreviewLoading } = usePaySchedule()\n const { setValue } = useFormContext<PayScheduleInputs>()\n const [selectedPayPeriodIndex, setSelectedPayPeriodIndex] = useState<number>(0)\n\n const frequency = useWatch({ name: 'frequency' })\n const customTwicePerMonth = useWatch({ name: 'customTwicePerMonth' })\n\n const shouldShowDay1 =\n (frequency === 'Twice per month' && customTwicePerMonth === 'custom') || frequency === 'Monthly'\n const shouldShowDay2 = frequency === 'Twice per month' && customTwicePerMonth === 'custom'\n\n useEffect(() => {\n if (frequency === 'Twice per month' && customTwicePerMonth === '1st15th') {\n setValue('day1', 15)\n setValue('day2', 31)\n }\n }, [frequency, customTwicePerMonth, setValue])\n\n if (mode !== 'EDIT_PAY_SCHEDULE' && mode !== 'ADD_PAY_SCHEDULE') {\n return null\n }\n\n return (\n <div className={style.payScheduleContainer}>\n <Grid gap={32} gridTemplateColumns={{ base: '1fr', small: '1fr 1fr' }}>\n <div className={style.payScheduleForm}>\n <Flex flexDirection={'column'}>\n <TextInputField name=\"customName\" label=\"Name\" isRequired />\n <SelectField\n name=\"frequency\"\n label={t('labels.frequency')}\n options={[\n { value: 'Every week', label: t('frequencies.everyWeek') },\n { value: 'Every other week', label: t('frequencies.everyOtherWeek') },\n { value: 'Twice per month', label: t('frequencies.twicePerMonth') },\n { value: 'Monthly', label: t('frequencies.monthly') },\n ]}\n isRequired\n />\n {frequency === 'Twice per month' && (\n <RadioGroupField\n name=\"customTwicePerMonth\"\n label={t('labels.frequencyOptions')}\n description={t('descriptions.frequencyOptionsDescription')}\n options={[\n { value: '1st15th', label: t('frequencyOptions.15thAndLast') },\n { value: 'custom', label: t('frequencyOptions.custom') },\n ]}\n />\n )}\n <DatePickerField\n name=\"anchorPayDate\"\n label={t('labels.firstPayDate')}\n description={t('descriptions.anchorPayDateDescription')}\n isRequired\n />\n <DatePickerField\n name=\"anchorEndOfPayPeriod\"\n label={t('labels.firstPayPeriodEndDate')}\n description={t('descriptions.anchorEndOfPayPeriodDescription')}\n isRequired\n />\n <div className={shouldShowDay1 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day1\" label={t('labels.firstPayDayOfTheMonth')} isRequired />\n </div>\n <div className={shouldShowDay2 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day2\" label={t('labels.lastPayDayOfTheMonth')} isRequired />\n </div>\n </Flex>\n </div>\n <Flex flexDirection=\"column\" gap={4} justifyContent=\"center\" alignItems=\"center\">\n {payPeriodPreview && payPeriodPreview[selectedPayPeriodIndex] ? (\n <div className={style.calendarContainer}>\n {!payPreviewLoading && (\n <Components.Select\n label={t('labels.preview')}\n isRequired\n options={payPeriodPreview.map((period, index) => {\n return {\n value: String(index),\n label: `${formatDateNamedWeekdayShortPlusDate(period.startDate, locale)} – ${formatDateNamedWeekdayShortPlusDate(period.endDate, locale)}`,\n }\n })}\n value={String(selectedPayPeriodIndex)}\n onChange={(value: string) => {\n const numericValue = Number(value)\n if (!isNaN(numericValue)) {\n setSelectedPayPeriodIndex(numericValue)\n }\n }}\n />\n )}\n <Components.CalendarPreview\n key={selectedPayPeriodIndex}\n dateRange={{\n start: new Date(payPeriodPreview[selectedPayPeriodIndex].startDate as string),\n end: new Date(payPeriodPreview[selectedPayPeriodIndex].endDate as string),\n label: t('payPreview.payPeriod') || 'Pay Period',\n }}\n highlightDates={[\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].checkDate as string),\n highlightColor: 'primary',\n label: t('payPreview.payday') || 'Payday',\n },\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].runPayrollBy as string),\n highlightColor: 'secondary',\n label: t('payPreview.payrollDeadline') || 'Payroll Deadline',\n },\n ]}\n />\n </div>\n ) : (\n <div className={style.calendarContainer}>\n <Components.Alert\n status=\"info\"\n label={t('previewAlert.title', 'Pay Schedule Preview')}\n >\n <Components.Text>\n {t(\n 'previewAlert.description',\n 'Complete all the required fields on the left to see a preview of your pay schedule.',\n )}\n </Components.Text>\n </Components.Alert>\n </div>\n )}\n </Flex>\n </Grid>\n </div>\n )\n}\n"],"names":["Edit","Components","useComponentContext","t","useTranslation","locale","useLocale","payPeriodPreview","mode","payPreviewLoading","usePaySchedule","setValue","useFormContext","selectedPayPeriodIndex","setSelectedPayPeriodIndex","useState","frequency","useWatch","customTwicePerMonth","shouldShowDay1","shouldShowDay2","useEffect","jsx","style","jsxs","Grid","Flex","TextInputField","SelectField","RadioGroupField","DatePickerField","NumberInputField","period","index","formatDateNamedWeekdayShortPlusDate","value","numericValue"],"mappings":";;;;;;;;;;;;;;;;;AAmBO,MAAMA,IAAO,MA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WC,EAAM,mBACpB,UAAA,gBAAAD;AAAA,MAACrB,EAAW;AAAA,MAAX;AAAA,QACC,QAAO;AAAA,QACP,OAAOE,EAAE,sBAAsB,sBAAsB;AAAA,QAErD,UAAA,gBAAAmB,EAACrB,EAAW,MAAX,EACE,UAAAE;AAAA,UACC;AAAA,UACA;AAAA,QAAA,EACF,CACF;AAAA,MAAA;AAAA,IAAA,GAEJ,EAAA,CAEJ;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"Edit.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Edit.tsx"],"sourcesContent":["import { useFormContext, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { useEffect, useState } from 'react'\nimport type { PayScheduleInputs } from '../usePaySchedule'\nimport { usePaySchedule } from '../usePaySchedule'\nimport style from './Edit.module.scss'\nimport {\n Flex,\n SelectField,\n RadioGroupField,\n Grid,\n TextInputField,\n NumberInputField,\n DatePickerField,\n} from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useLocale } from '@/contexts/LocaleProvider'\nimport { formatDateNamedWeekdayShortPlusDate } from '@/helpers/dateFormatting'\n\nexport const Edit = () => {\n const Components = useComponentContext()\n const { t } = useTranslation('Company.PaySchedule')\n const { locale } = useLocale()\n const { payPeriodPreview, mode, payPreviewLoading } = usePaySchedule()\n const { setValue } = useFormContext<PayScheduleInputs>()\n const [selectedPayPeriodIndex, setSelectedPayPeriodIndex] = useState<number>(0)\n\n const frequency = useWatch({ name: 'frequency' })\n const customTwicePerMonth = useWatch({ name: 'customTwicePerMonth' })\n\n const shouldShowDay1 =\n (frequency === 'Twice per month' && customTwicePerMonth === 'custom') || frequency === 'Monthly'\n const shouldShowDay2 = frequency === 'Twice per month' && customTwicePerMonth === 'custom'\n\n useEffect(() => {\n if (frequency === 'Twice per month' && customTwicePerMonth === '1st15th') {\n setValue('day1', 15)\n setValue('day2', 31)\n }\n }, [frequency, customTwicePerMonth, setValue])\n\n if (mode !== 'EDIT_PAY_SCHEDULE' && mode !== 'ADD_PAY_SCHEDULE') {\n return null\n }\n\n return (\n <div className={style.payScheduleContainer}>\n <Grid gap={32} gridTemplateColumns={{ base: '1fr', small: '1fr 1fr' }}>\n <div className={style.payScheduleForm}>\n <Flex flexDirection={'column'}>\n <TextInputField name=\"customName\" label={t('labels.name')} isRequired />\n <SelectField\n name=\"frequency\"\n label={t('labels.frequency')}\n options={[\n { value: 'Every week', label: t('frequencies.everyWeek') },\n { value: 'Every other week', label: t('frequencies.everyOtherWeek') },\n { value: 'Twice per month', label: t('frequencies.twicePerMonth') },\n { value: 'Monthly', label: t('frequencies.monthly') },\n ]}\n isRequired\n />\n {frequency === 'Twice per month' && (\n <RadioGroupField\n name=\"customTwicePerMonth\"\n label={t('labels.frequencyOptions')}\n description={t('descriptions.frequencyOptionsDescription')}\n options={[\n { value: '1st15th', label: t('frequencyOptions.15thAndLast') },\n { value: 'custom', label: t('frequencyOptions.custom') },\n ]}\n />\n )}\n <DatePickerField\n name=\"anchorPayDate\"\n label={t('labels.firstPayDate')}\n description={t('descriptions.anchorPayDateDescription')}\n isRequired\n />\n <DatePickerField\n name=\"anchorEndOfPayPeriod\"\n label={t('labels.firstPayPeriodEndDate')}\n description={t('descriptions.anchorEndOfPayPeriodDescription')}\n isRequired\n />\n <div className={shouldShowDay1 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day1\" label={t('labels.firstPayDayOfTheMonth')} isRequired />\n </div>\n <div className={shouldShowDay2 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day2\" label={t('labels.lastPayDayOfTheMonth')} isRequired />\n </div>\n </Flex>\n </div>\n <Flex flexDirection=\"column\" gap={4} justifyContent=\"center\" alignItems=\"center\">\n {payPeriodPreview && payPeriodPreview[selectedPayPeriodIndex] ? (\n <div className={style.calendarContainer}>\n {!payPreviewLoading && (\n <Components.Select\n label={t('labels.preview')}\n isRequired\n options={payPeriodPreview.map((period, index) => {\n return {\n value: String(index),\n label: `${formatDateNamedWeekdayShortPlusDate(period.startDate, locale)} – ${formatDateNamedWeekdayShortPlusDate(period.endDate, locale)}`,\n }\n })}\n value={String(selectedPayPeriodIndex)}\n onChange={(value: string) => {\n const numericValue = Number(value)\n if (!isNaN(numericValue)) {\n setSelectedPayPeriodIndex(numericValue)\n }\n }}\n />\n )}\n <Components.CalendarPreview\n key={selectedPayPeriodIndex}\n dateRange={{\n start: new Date(payPeriodPreview[selectedPayPeriodIndex].startDate as string),\n end: new Date(payPeriodPreview[selectedPayPeriodIndex].endDate as string),\n label: t('payPreview.payPeriod') || 'Pay Period',\n }}\n highlightDates={[\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].checkDate as string),\n highlightColor: 'primary',\n label: t('payPreview.payday') || 'Payday',\n },\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].runPayrollBy as string),\n highlightColor: 'secondary',\n label: t('payPreview.payrollDeadline') || 'Payroll Deadline',\n },\n ]}\n />\n </div>\n ) : (\n <div className={style.calendarContainer}>\n <Components.Alert\n status=\"info\"\n label={t('previewAlert.title', 'Pay Schedule Preview')}\n >\n <Components.Text>\n {t(\n 'previewAlert.description',\n 'Complete all the required fields on the left to see a preview of your pay schedule.',\n )}\n </Components.Text>\n </Components.Alert>\n </div>\n )}\n </Flex>\n </Grid>\n </div>\n )\n}\n"],"names":["Edit","Components","useComponentContext","t","useTranslation","locale","useLocale","payPeriodPreview","mode","payPreviewLoading","usePaySchedule","setValue","useFormContext","selectedPayPeriodIndex","setSelectedPayPeriodIndex","useState","frequency","useWatch","customTwicePerMonth","shouldShowDay1","shouldShowDay2","useEffect","jsx","style","jsxs","Grid","Flex","TextInputField","SelectField","RadioGroupField","DatePickerField","NumberInputField","period","index","formatDateNamedWeekdayShortPlusDate","value","numericValue"],"mappings":";;;;;;;;;;;;;;;;;AAmBO,MAAMA,IAAO,MAAM;AACxB,QAAMC,IAAaC,EAAA,GACb,EAAE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