@gusto/embedded-react-sdk 0.56.0 → 0.56.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +24 -18
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
- package/dist/components/Payroll/OffCycle/offCycleStateMachine.js +39 -21
- package/dist/components/Payroll/OffCycle/offCycleStateMachine.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +85 -82
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +52 -51
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +12 -12
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +40 -40
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +26 -25
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +13 -16
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +0 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeHelpers.js +138 -110
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/usePayrollEditEmployeeForm.js +149 -146
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/usePayrollEditEmployeeForm.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +4 -0
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js +22 -35
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlow.js +49 -36
- package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js +24 -47
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -1
- package/dist/components/Payroll/Transition/transitionStateMachine.js +35 -40
- package/dist/components/Payroll/Transition/transitionStateMachine.js.map +1 -1
- package/dist/components/Payroll/TransitionPayroll/TransitionPayroll.js +48 -0
- package/dist/components/Payroll/TransitionPayroll/TransitionPayroll.js.map +1 -0
- package/dist/components/Payroll/TransitionPayroll/TransitionPayrollComponents.js +35 -0
- package/dist/components/Payroll/TransitionPayroll/TransitionPayrollComponents.js.map +1 -0
- package/dist/components/Payroll/TransitionPayroll/transitionPayrollStateMachine.js +23 -0
- package/dist/components/Payroll/TransitionPayroll/transitionPayrollStateMachine.js.map +1 -0
- package/dist/components/Payroll/TransitionPayroll/useResolveTransitionPayroll.js +32 -0
- package/dist/components/Payroll/TransitionPayroll/useResolveTransitionPayroll.js.map +1 -0
- package/dist/components/Payroll/index.js +7 -5
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/i18n/I18n.js +9 -4
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollBlocker.json.js +10 -8
- package/dist/i18n/en/Payroll.PayrollBlocker.json.js.map +1 -1
- package/dist/i18n/es_US/Company.StateTaxes.json.js +1 -1
- package/dist/i18n/es_US/Contractor.ContractorList.json.js +14 -12
- package/dist/i18n/es_US/Contractor.ContractorList.json.js.map +1 -1
- package/dist/i18n/es_US/Contractor.Management.Compensation.json.js +4 -4
- package/dist/i18n/es_US/Contractor.Management.Profile.json.js +4 -4
- package/dist/i18n/es_US/Contractor.ManagementContractorList.json.js +40 -38
- package/dist/i18n/es_US/Contractor.ManagementContractorList.json.js.map +1 -1
- package/dist/i18n/es_US/Contractor.Payments.PaymentsList.json.js +18 -16
- package/dist/i18n/es_US/Contractor.Payments.PaymentsList.json.js.map +1 -1
- package/dist/i18n/es_US/Contractor.Profile.json.js +5 -5
- package/dist/i18n/es_US/Payroll.OffCycleCreation.json.js +11 -9
- package/dist/i18n/es_US/Payroll.OffCycleCreation.json.js.map +1 -1
- package/dist/i18n/es_US/Payroll.OffCyclePayPeriodDateForm.json.js +2 -2
- package/dist/i18n/es_US/Payroll.OffCycleTaxWithholding.json.js +6 -6
- package/dist/i18n/es_US/Payroll.PayrollConfiguration.json.js +15 -15
- package/dist/i18n/es_US/Payroll.PayrollEditEmployee.json.js +28 -26
- package/dist/i18n/es_US/Payroll.PayrollEditEmployee.json.js.map +1 -1
- package/dist/i18n/es_US/Payroll.PayrollOverview.json.js +40 -38
- package/dist/i18n/es_US/Payroll.PayrollOverview.json.js.map +1 -1
- package/dist/i18n/es_US/Payroll.PrintChecksBanner.json.js +14 -0
- package/dist/i18n/es_US/Payroll.PrintChecksBanner.json.js.map +1 -0
- package/dist/i18n/es_US/Payroll.PrintChecksFailure.json.js +12 -0
- package/dist/i18n/es_US/Payroll.PrintChecksFailure.json.js.map +1 -0
- package/dist/i18n/es_US/Payroll.PrintChecksForm.json.js +26 -0
- package/dist/i18n/es_US/Payroll.PrintChecksForm.json.js.map +1 -0
- package/dist/i18n/es_US/Payroll.PrintChecksSummary.json.js +14 -0
- package/dist/i18n/es_US/Payroll.PrintChecksSummary.json.js.map +1 -0
- package/dist/i18n/es_US/Payroll.UNSTABLE_PayrollEditEmployee.json.js +78 -0
- package/dist/i18n/es_US/Payroll.UNSTABLE_PayrollEditEmployee.json.js.map +1 -0
- package/dist/i18n/es_US/common.json.js +1 -1
- package/dist/package.json.js +1 -1
- package/dist/shared/constants.js +21 -20
- package/dist/shared/constants.js.map +1 -1
- package/dist/src/components/Payroll/OffCycle/OffCycleFlow.d.ts +2 -0
- package/dist/src/components/Payroll/OffCycle/OffCycleFlowComponents.d.ts +2 -0
- package/dist/src/components/Payroll/OffCycle/offCycleStateMachine.d.ts +1 -0
- package/dist/src/components/Payroll/OffCycleCreation/OffCycleCreation.d.ts +1 -0
- package/dist/src/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
- package/dist/src/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +5 -0
- package/dist/src/components/Payroll/PayrollConfiguration/PayrollConfiguration.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeHelpers.d.ts +18 -0
- package/dist/src/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.d.ts +8 -0
- package/dist/src/components/Payroll/PayrollFlow/PayrollFlow.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollFlow/TransitionFlowContextual.d.ts +6 -1
- package/dist/src/components/Payroll/Transition/TransitionFlow.d.ts +17 -15
- package/dist/src/components/Payroll/Transition/TransitionFlowComponents.d.ts +21 -12
- package/dist/src/components/Payroll/Transition/transitionStateMachine.d.ts +25 -4
- package/dist/src/components/Payroll/TransitionPayroll/TransitionPayroll.d.ts +55 -0
- package/dist/src/components/Payroll/TransitionPayroll/TransitionPayrollComponents.d.ts +24 -0
- package/dist/src/components/Payroll/TransitionPayroll/TransitionPayrollTypes.d.ts +23 -0
- package/dist/src/components/Payroll/TransitionPayroll/index.d.ts +2 -0
- package/dist/src/components/Payroll/TransitionPayroll/transitionPayrollStateMachine.d.ts +15 -0
- package/dist/src/components/Payroll/TransitionPayroll/useResolveTransitionPayroll.d.ts +28 -0
- package/dist/src/components/Payroll/index.d.ts +2 -0
- package/dist/src/i18n/types.d.ts +6 -0
- package/dist/src/shared/constants.d.ts +2 -0
- package/docs/guides/endpoint-inventory.json +14 -19
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransitionFlow.js","sources":["../../../../src/components/Payroll/Transition/TransitionFlow.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"TransitionFlow.js","sources":["../../../../src/components/Payroll/Transition/TransitionFlow.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { createMachine } from 'robot3'\nimport { useResolveTransitionPayroll } from '../TransitionPayroll/useResolveTransitionPayroll'\nimport { transitionMachine, transitionBreadcrumbsNodes } from './transitionStateMachine'\nimport {\n TransitionPayrollContextual,\n type TransitionFlowContextInterface,\n type TransitionFlowProps,\n} from './TransitionFlowComponents'\nimport { Flow } from '@/components/Flow/Flow'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { buildBreadcrumbs, updateBreadcrumbs } from '@/helpers/breadcrumbHelpers'\n\n/**\n * Macro flow that runs a transition payroll end to end: resolve or create the payroll, then\n * configure, review, submit, and view receipts.\n *\n * @remarks\n * Renders {@link TransitionPayroll} as its entry step, then routes the events its configuration\n * screen emits into the shared payroll-execution states (overview, edit-employee, receipts,\n * blockers). It owns the breadcrumb chrome and back-navigation, and re-runs the same cached resolve\n * lookup to seed its initial breadcrumb and payroll context.\n *\n * There is no terminal state (SDK-1169). Completion events bubble via `onEvent` for the parent to\n * handle (in `Payroll.PayrollFlow` the parent machine does).\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `transition/created` | Fired when the transition payroll is created and the flow advances to configuration | `{ payrollUuid: string }` |\n * | `breadcrumb/navigate` | Fired when the user navigates via the breadcrumb header | `{ key: string }` |\n *\n * All standard run-payroll events are emitted once configuration begins.\n *\n * @components\n * - {@link TransitionPayroll}\n * - {@link PayrollOverview}\n * - {@link PayrollEditEmployee}\n * - {@link PayrollReceipts}\n * - {@link PayrollBlockerList}\n *\n * @param props - See {@link TransitionFlowProps}.\n * @returns The transition payroll flow.\n * @public\n *\n * @example\n * ```tsx title=\"App.tsx\"\n * import { Payroll, type EventType } from '@gusto/embedded-react-sdk'\n *\n * function MyApp() {\n * return (\n * <Payroll.TransitionFlow\n * companyId=\"a007e1ab-3595-43c2-ab4b-af7a5af2e365\"\n * startDate=\"2025-01-16\"\n * endDate=\"2025-01-31\"\n * payScheduleUuid=\"c75c1ef6-2ec0-4cca-94a5-8b4cf7e5ea21\"\n * onEvent={(eventType: EventType) => {\n * if (eventType === 'runPayroll/submitted') {\n * // Payroll submitted — navigate to your next screen\n * }\n * }}\n * />\n * )\n * }\n * ```\n */\nexport function TransitionFlow(props: TransitionFlowProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({\n companyId,\n startDate,\n endDate,\n payScheduleUuid,\n payrollUuid,\n withReimbursements = true,\n}: TransitionFlowProps) {\n const { onEvent } = useBase()\n\n const resolvedPayrollUuid = useResolveTransitionPayroll({\n companyId,\n startDate,\n endDate,\n payScheduleUuid,\n })\n\n // A caller-supplied payrollUuid wins over the lookup, so a parent that already knows the payroll\n // can skip creation.\n const initialPayrollUuid = payrollUuid ?? resolvedPayrollUuid\n\n // Freeze the machine once. Creating a payroll refetches the resolve query, so recomputing this\n // would re-seat the machine mid-flow. TransitionPayroll freezes the same decision independently.\n const [machine] = useState(() => {\n const initialBreadcrumbId = initialPayrollUuid ? 'configuration' : 'createTransitionPayroll'\n const breadcrumbs = buildBreadcrumbs(transitionBreadcrumbsNodes)\n const initialBreadcrumbContext = updateBreadcrumbs(\n initialBreadcrumbId,\n { header: { type: 'breadcrumbs' as const, breadcrumbs } },\n { startDate, endDate },\n )\n\n return createMachine(\n 'transitionPayroll',\n transitionMachine,\n (initialContext: TransitionFlowContextInterface) => ({\n ...initialContext,\n ...initialBreadcrumbContext,\n component: TransitionPayrollContextual,\n companyId,\n startDate,\n endDate,\n payScheduleUuid,\n payrollUuid: initialPayrollUuid,\n withReimbursements,\n withOffcyclePayroll: true,\n }),\n )\n })\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n"],"names":["TransitionFlow","props","jsx","BaseComponent","Root","companyId","startDate","endDate","payScheduleUuid","payrollUuid","withReimbursements","onEvent","useBase","resolvedPayrollUuid","useResolveTransitionPayroll","initialPayrollUuid","machine","useState","initialBreadcrumbId","breadcrumbs","buildBreadcrumbs","transitionBreadcrumbsNodes","initialBreadcrumbContext","updateBreadcrumbs","createMachine","transitionMachine","initialContext","TransitionPayrollContextual","Flow"],"mappings":";;;;;;;;;;AAmEO,SAASA,EAAeC,GAA4B;AACzD,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK;AAAA,EACZ,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC,IAAqB;AACvB,GAAwB;AACtB,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEdC,IAAsBC,EAA4B;AAAA,IACtD,WAAAT;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,iBAAAC;AAAA,EAAA,CACD,GAIKO,IAAqBN,KAAeI,GAIpC,CAACG,CAAO,IAAIC,EAAS,MAAM;AAC/B,UAAMC,IAAsBH,IAAqB,kBAAkB,2BAC7DI,IAAcC,EAAiBC,CAA0B,GACzDC,IAA2BC;AAAA,MAC/BL;AAAA,MACA,EAAE,QAAQ,EAAE,MAAM,eAAwB,aAAAC,IAAY;AAAA,MACtD,EAAE,WAAAb,GAAW,SAAAC,EAAA;AAAA,IAAQ;AAGvB,WAAOiB;AAAA,MACL;AAAA,MACAC;AAAA,MACA,CAACC,OAAoD;AAAA,QACnD,GAAGA;AAAA,QACH,GAAGJ;AAAA,QACH,WAAWK;AAAA,QACX,WAAAtB;AAAA,QACA,WAAAC;AAAA,QACA,SAAAC;AAAA,QACA,iBAAAC;AAAA,QACA,aAAaO;AAAA,QACb,oBAAAL;AAAA,QACA,qBAAqB;AAAA,MAAA;AAAA,IACvB;AAAA,EAEJ,CAAC;AAED,SAAO,gBAAAR,EAAC0B,GAAA,EAAK,SAAAZ,GAAkB,SAAAL,EAAA,CAAkB;AACnD;"}
|
|
@@ -1,54 +1,31 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { useFlow as d } from "../../Flow/useFlow.js";
|
|
3
|
+
import { ensureRequired as t } from "../../../helpers/ensureRequired.js";
|
|
4
|
+
import { TransitionPayroll as l } from "../TransitionPayroll/TransitionPayroll.js";
|
|
5
|
+
function f() {
|
|
6
|
+
const {
|
|
7
|
+
companyId: e,
|
|
8
|
+
startDate: o,
|
|
9
|
+
endDate: r,
|
|
10
|
+
payScheduleUuid: n,
|
|
11
|
+
payrollUuid: a,
|
|
12
|
+
withReimbursements: i,
|
|
13
|
+
onEvent: m
|
|
14
|
+
} = d();
|
|
15
|
+
return /* @__PURE__ */ u(
|
|
16
|
+
l,
|
|
13
17
|
{
|
|
14
|
-
companyId:
|
|
15
|
-
startDate:
|
|
16
|
-
endDate:
|
|
17
|
-
payScheduleUuid:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
function S() {
|
|
23
|
-
const { companyId: r, payrollUuid: t, onEvent: e, header: n } = s(), o = n?.type === "breadcrumbs" ? n.breadcrumbs?.createTransitionPayroll?.[0] : void 0, u = c(() => o ? [o] : void 0, [o]), d = a(r), m = a(t);
|
|
24
|
-
return /* @__PURE__ */ i(y, { onEvent: e, children: /* @__PURE__ */ i(
|
|
25
|
-
x,
|
|
26
|
-
{
|
|
27
|
-
companyId: d,
|
|
28
|
-
payrollId: m,
|
|
29
|
-
onEvent: e,
|
|
30
|
-
prefixBreadcrumbs: u
|
|
31
|
-
}
|
|
32
|
-
) });
|
|
33
|
-
}
|
|
34
|
-
function x({
|
|
35
|
-
companyId: r,
|
|
36
|
-
payrollId: t,
|
|
37
|
-
...e
|
|
38
|
-
}) {
|
|
39
|
-
const { data: n } = l({ companyId: r, payrollId: t }), o = n.payrollShow?.payPeriod;
|
|
40
|
-
return /* @__PURE__ */ i(
|
|
41
|
-
p,
|
|
42
|
-
{
|
|
43
|
-
companyId: r,
|
|
44
|
-
payrollId: t,
|
|
45
|
-
initialPayPeriod: o,
|
|
46
|
-
...e
|
|
18
|
+
companyId: t(e),
|
|
19
|
+
startDate: t(o),
|
|
20
|
+
endDate: t(r),
|
|
21
|
+
payScheduleUuid: t(n),
|
|
22
|
+
payrollUuid: a,
|
|
23
|
+
withReimbursements: i,
|
|
24
|
+
onEvent: m
|
|
47
25
|
}
|
|
48
26
|
);
|
|
49
27
|
}
|
|
50
28
|
export {
|
|
51
|
-
|
|
52
|
-
S as TransitionExecutionContextual
|
|
29
|
+
f as TransitionPayrollContextual
|
|
53
30
|
};
|
|
54
31
|
//# sourceMappingURL=TransitionFlowComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransitionFlowComponents.js","sources":["../../../../src/components/Payroll/Transition/TransitionFlowComponents.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"TransitionFlowComponents.js","sources":["../../../../src/components/Payroll/Transition/TransitionFlowComponents.tsx"],"sourcesContent":["import { TransitionPayroll } from '../TransitionPayroll'\nimport type { PayrollFlowContextInterface } from '../PayrollFlow/PayrollFlowComponents'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport type { EventType } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\n/**\n * Flow context shape carried through the transition payroll macro state machine.\n *\n * @remarks\n * Extends {@link PayrollFlowContextInterface} so the payroll-execution reducers reused by the\n * transition machine (overview, edit-employee, receipts, blockers) typecheck against a single\n * shared context shape.\n *\n * @internal\n */\nexport interface TransitionFlowContextInterface extends PayrollFlowContextInterface {\n /** Start date of the transition pay period (YYYY-MM-DD). */\n startDate: string\n /** End date of the transition pay period (YYYY-MM-DD). */\n endDate: string\n /** UUID of the pay schedule the transition is associated with. */\n payScheduleUuid: string\n}\n\n/**\n * Props for {@link TransitionFlow}.\n *\n * @public\n */\nexport interface TransitionFlowProps {\n /** Company running the transition payroll. */\n companyId: string\n /** Start date of the transition pay period (YYYY-MM-DD). */\n startDate: string\n /** End date of the transition pay period (YYYY-MM-DD). */\n endDate: string\n /** UUID of the pay schedule the transition is associated with. */\n payScheduleUuid: string\n /**\n * UUID of an existing transition payroll. When provided, the flow skips the lookup and starts on\n * configuration for this payroll. When omitted, it resolves the payroll for the pay period.\n */\n payrollUuid?: string\n /** Whether reimbursement fields are shown throughout the flow. Defaults to `true`. */\n withReimbursements?: boolean\n /** Callback invoked for each event emitted by the flow and its child steps. */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Renders {@link TransitionPayroll} as the entry step of {@link TransitionFlow}, wiring its events\n * up to the flow's state machine.\n *\n * @internal\n */\nexport function TransitionPayrollContextual() {\n const {\n companyId,\n startDate,\n endDate,\n payScheduleUuid,\n payrollUuid,\n withReimbursements,\n onEvent,\n } = useFlow<TransitionFlowContextInterface>()\n return (\n <TransitionPayroll\n companyId={ensureRequired(companyId)}\n startDate={ensureRequired(startDate)}\n endDate={ensureRequired(endDate)}\n payScheduleUuid={ensureRequired(payScheduleUuid)}\n payrollUuid={payrollUuid}\n withReimbursements={withReimbursements}\n onEvent={onEvent}\n />\n )\n}\n"],"names":["TransitionPayrollContextual","companyId","startDate","endDate","payScheduleUuid","payrollUuid","withReimbursements","onEvent","useFlow","jsx","TransitionPayroll","ensureRequired"],"mappings":";;;;AAyDO,SAASA,IAA8B;AAC5C,QAAM;AAAA,IACJ,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,SAAAC;AAAA,EAAA,IACEC,EAAA;AACJ,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAeV,CAAS;AAAA,MACnC,WAAWU,EAAeT,CAAS;AAAA,MACnC,SAASS,EAAeR,CAAO;AAAA,MAC/B,iBAAiBQ,EAAeP,CAAe;AAAA,MAC/C,aAAAC;AAAA,MACA,oBAAAC;AAAA,MACA,SAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,54 +1,49 @@
|
|
|
1
|
-
import { state as t, transition as n, reduce as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { state as t, transition as n, reduce as i } from "robot3";
|
|
2
|
+
import { payrollExecutionMachine as e, getPayrollExecutionBreadcrumbsNodes as l, calculatedTransition as s, alreadyProcessedTransition as c, employeeEditTransition as d, blockersViewAllTransition as m } from "../PayrollExecutionFlow/payrollExecutionMachine.js";
|
|
3
|
+
import { TransitionPayrollContextual as u } from "./TransitionFlowComponents.js";
|
|
4
|
+
import { componentEvents as p } from "../../../shared/constants.js";
|
|
5
|
+
import { updateBreadcrumbs as y } from "../../../helpers/breadcrumbHelpers.js";
|
|
6
|
+
const r = l(), T = r.configuration, D = {
|
|
7
|
+
// Display-only creation crumb (no `onNavigate`, matching the non-navigable prefix the flow
|
|
8
|
+
// rendered before this refactor).
|
|
6
9
|
createTransitionPayroll: {
|
|
7
10
|
parent: null,
|
|
8
11
|
item: {
|
|
9
12
|
id: "createTransitionPayroll",
|
|
10
13
|
label: "breadcrumbLabel",
|
|
11
|
-
namespace: "Payroll.Transition"
|
|
12
|
-
onNavigate: ((r) => ({
|
|
13
|
-
...a(r, { currentBreadcrumbId: "createTransitionPayroll" }),
|
|
14
|
-
component: i,
|
|
15
|
-
payrollUuid: void 0
|
|
16
|
-
}))
|
|
14
|
+
namespace: "Payroll.Transition"
|
|
17
15
|
}
|
|
16
|
+
},
|
|
17
|
+
...r,
|
|
18
|
+
configuration: {
|
|
19
|
+
...T,
|
|
20
|
+
parent: "createTransitionPayroll"
|
|
18
21
|
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
),
|
|
33
|
-
e(u)
|
|
22
|
+
}, b = n(
|
|
23
|
+
p.TRANSITION_CREATED,
|
|
24
|
+
"transitionPayroll",
|
|
25
|
+
i(
|
|
26
|
+
(o, a) => ({
|
|
27
|
+
...y("configuration", o, {
|
|
28
|
+
startDate: o.startDate,
|
|
29
|
+
endDate: o.endDate
|
|
30
|
+
}),
|
|
31
|
+
component: u,
|
|
32
|
+
payrollUuid: a.payload?.payrollUuid ?? o.payrollUuid
|
|
33
|
+
})
|
|
34
|
+
)
|
|
34
35
|
), B = {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
...a(r, { currentBreadcrumbId: void 0 }),
|
|
42
|
-
payrollUuid: o.payload?.payrollUuid,
|
|
43
|
-
component: d
|
|
44
|
-
})
|
|
45
|
-
)
|
|
46
|
-
)
|
|
36
|
+
transitionPayroll: t(
|
|
37
|
+
b,
|
|
38
|
+
s,
|
|
39
|
+
c,
|
|
40
|
+
d,
|
|
41
|
+
m
|
|
47
42
|
),
|
|
48
|
-
|
|
43
|
+
...e
|
|
49
44
|
};
|
|
50
45
|
export {
|
|
51
|
-
|
|
46
|
+
D as transitionBreadcrumbsNodes,
|
|
52
47
|
B as transitionMachine
|
|
53
48
|
};
|
|
54
49
|
//# sourceMappingURL=transitionStateMachine.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transitionStateMachine.js","sources":["../../../../src/components/Payroll/Transition/transitionStateMachine.ts"],"sourcesContent":["import { state, transition, reduce
|
|
1
|
+
{"version":3,"file":"transitionStateMachine.js","sources":["../../../../src/components/Payroll/Transition/transitionStateMachine.ts"],"sourcesContent":["import { state, transition, reduce } from 'robot3'\nimport {\n payrollExecutionMachine,\n getPayrollExecutionBreadcrumbsNodes,\n calculatedTransition,\n alreadyProcessedTransition,\n employeeEditTransition,\n blockersViewAllTransition,\n} from '../PayrollExecutionFlow/payrollExecutionMachine'\nimport {\n TransitionPayrollContextual,\n type TransitionFlowContextInterface,\n} from './TransitionFlowComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineTransition } from '@/types/Helpers'\nimport type {\n BreadcrumbNode,\n BreadcrumbNodes,\n} from '@/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes'\nimport { updateBreadcrumbs } from '@/helpers/breadcrumbHelpers'\n\nconst executionBreadcrumbsNodes = getPayrollExecutionBreadcrumbsNodes()\nconst sharedConfigurationNode = executionBreadcrumbsNodes.configuration!\n\n/**\n * Breadcrumb nodes for the transition payroll macro flow: the creation crumb merged with the\n * shared payroll-execution crumbs. `configuration` is nested under the creation crumb so the\n * \"Transition Payroll\" crumb persists in the trail once the flow advances past creation, matching\n * the display-only prefix the flow rendered before this refactor.\n *\n * @internal\n */\nexport const transitionBreadcrumbsNodes: BreadcrumbNodes = {\n // Display-only creation crumb (no `onNavigate`, matching the non-navigable prefix the flow\n // rendered before this refactor).\n createTransitionPayroll: {\n parent: null,\n item: {\n id: 'createTransitionPayroll',\n label: 'breadcrumbLabel',\n namespace: 'Payroll.Transition',\n },\n },\n ...executionBreadcrumbsNodes,\n configuration: {\n ...sharedConfigurationNode,\n parent: 'createTransitionPayroll',\n },\n} satisfies Record<string, BreadcrumbNode>\n\n// Records the created payroll's UUID and moves the breadcrumb to configuration, keeping\n// TransitionPayroll mounted so it advances its own screen from creation to configuration.\nconst transitionCreatedTransition = transition(\n componentEvents.TRANSITION_CREATED,\n 'transitionPayroll',\n reduce(\n (\n ctx: TransitionFlowContextInterface,\n ev: { payload?: { payrollUuid?: string } },\n ): TransitionFlowContextInterface => ({\n ...updateBreadcrumbs('configuration', ctx, {\n startDate: ctx.startDate,\n endDate: ctx.endDate,\n }),\n component: TransitionPayrollContextual,\n payrollUuid: ev.payload?.payrollUuid ?? ctx.payrollUuid,\n }),\n ),\n)\n\n/**\n * Macro state machine for {@link TransitionFlow}.\n *\n * @remarks\n * The entry state renders {@link TransitionPayroll}; the rest of the states are the shared\n * {@link payrollExecutionMachine} states, reused via object spread. The entry state reuses that\n * machine's onward transitions so configuration events route into overview / edit-employee /\n * blockers.\n *\n * @internal\n */\nexport const transitionMachine = {\n transitionPayroll: state<MachineTransition>(\n transitionCreatedTransition,\n calculatedTransition,\n alreadyProcessedTransition,\n employeeEditTransition,\n blockersViewAllTransition,\n ),\n ...payrollExecutionMachine,\n}\n"],"names":["executionBreadcrumbsNodes","getPayrollExecutionBreadcrumbsNodes","sharedConfigurationNode","transitionBreadcrumbsNodes","transitionCreatedTransition","transition","componentEvents","reduce","ctx","ev","updateBreadcrumbs","TransitionPayrollContextual","transitionMachine","state","calculatedTransition","alreadyProcessedTransition","employeeEditTransition","blockersViewAllTransition","payrollExecutionMachine"],"mappings":";;;;;AAqBA,MAAMA,IAA4BC,EAAA,GAC5BC,IAA0BF,EAA0B,eAU7CG,IAA8C;AAAA;AAAA;AAAA,EAGzD,yBAAyB;AAAA,IACvB,QAAQ;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,WAAW;AAAA,IAAA;AAAA,EACb;AAAA,EAEF,GAAGH;AAAA,EACH,eAAe;AAAA,IACb,GAAGE;AAAA,IACH,QAAQ;AAAA,EAAA;AAEZ,GAIME,IAA8BC;AAAA,EAClCC,EAAgB;AAAA,EAChB;AAAA,EACAC;AAAA,IACE,CACEC,GACAC,OACoC;AAAA,MACpC,GAAGC,EAAkB,iBAAiBF,GAAK;AAAA,QACzC,WAAWA,EAAI;AAAA,QACf,SAASA,EAAI;AAAA,MAAA,CACd;AAAA,MACD,WAAWG;AAAA,MACX,aAAaF,EAAG,SAAS,eAAeD,EAAI;AAAA,IAAA;AAAA,EAC9C;AAEJ,GAaaI,IAAoB;AAAA,EAC/B,mBAAmBC;AAAA,IACjBT;AAAA,IACAU;AAAA,IACAC;AAAA,IACAC;AAAA,IACAC;AAAA,EAAA;AAAA,EAEF,GAAGC;AACL;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as p } from "react";
|
|
3
|
+
import { createMachine as P } from "robot3";
|
|
4
|
+
import { transitionPayrollMachine as x } from "./transitionPayrollStateMachine.js";
|
|
5
|
+
import { PayrollConfigurationContextual as y, TransitionCreationContextual as C } from "./TransitionPayrollComponents.js";
|
|
6
|
+
import { useResolveTransitionPayroll as h } from "./useResolveTransitionPayroll.js";
|
|
7
|
+
import { BaseComponent as g } from "../../Base/Base.js";
|
|
8
|
+
import { useBase as v } from "../../Base/useBase.js";
|
|
9
|
+
import { Flow as B } from "../../Flow/Flow.js";
|
|
10
|
+
function k(o) {
|
|
11
|
+
return /* @__PURE__ */ r(g, { ...o, children: /* @__PURE__ */ r(T, { ...o }) });
|
|
12
|
+
}
|
|
13
|
+
function T({
|
|
14
|
+
companyId: o,
|
|
15
|
+
startDate: n,
|
|
16
|
+
endDate: t,
|
|
17
|
+
payScheduleUuid: i,
|
|
18
|
+
payrollUuid: l,
|
|
19
|
+
withReimbursements: m = !0
|
|
20
|
+
}) {
|
|
21
|
+
const { onEvent: s } = v(), u = h({
|
|
22
|
+
companyId: o,
|
|
23
|
+
startDate: n,
|
|
24
|
+
endDate: t,
|
|
25
|
+
payScheduleUuid: i
|
|
26
|
+
}), e = l ?? u, [c] = p(() => {
|
|
27
|
+
const a = !!e;
|
|
28
|
+
return P(
|
|
29
|
+
a ? "configuration" : "creation",
|
|
30
|
+
x,
|
|
31
|
+
(f) => ({
|
|
32
|
+
...f,
|
|
33
|
+
component: a ? y : C,
|
|
34
|
+
companyId: o,
|
|
35
|
+
startDate: n,
|
|
36
|
+
endDate: t,
|
|
37
|
+
payScheduleUuid: i,
|
|
38
|
+
payrollUuid: e,
|
|
39
|
+
withReimbursements: m
|
|
40
|
+
})
|
|
41
|
+
);
|
|
42
|
+
});
|
|
43
|
+
return /* @__PURE__ */ r(B, { machine: c, onEvent: s });
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
k as TransitionPayroll
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=TransitionPayroll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransitionPayroll.js","sources":["../../../../src/components/Payroll/TransitionPayroll/TransitionPayroll.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { createMachine } from 'robot3'\nimport { transitionPayrollMachine } from './transitionPayrollStateMachine'\nimport {\n TransitionCreationContextual,\n PayrollConfigurationContextual,\n type TransitionPayrollContextInterface,\n} from './TransitionPayrollComponents'\nimport { useResolveTransitionPayroll } from './useResolveTransitionPayroll'\nimport type { TransitionPayrollProps } from './TransitionPayrollTypes'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flow } from '@/components/Flow/Flow'\n\n/**\n * Resolves and runs a transition payroll for a pay-schedule change, picking up an existing\n * unprocessed transition payroll when one exists and creating one otherwise.\n *\n * @remarks\n * A transition payroll covers the gap that opens when a company changes its pay schedule. This\n * component looks up whether one already exists for the pay period and picks the starting screen:\n *\n * - If it exists, it starts on {@link PayrollConfiguration} for that payroll.\n * - Otherwise it starts on {@link TransitionCreation}, then advances to {@link PayrollConfiguration}\n * once the payroll is created.\n *\n * Configuration events (calculate, employee edit, blockers, etc.) are emitted through `onEvent` for\n * the host to route. Compose it inside {@link TransitionFlow} for the full run-payroll experience,\n * or handle the events yourself.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `transition/created` | The transition payroll has been created and the flow advances to configuration | `{ payrollUuid: string }` |\n *\n * Once configuration begins, all standard run-payroll events are emitted as well (e.g.\n * `runPayroll/calculated`, `runPayroll/employee/edit`, `runPayroll/blockers/viewAll`).\n *\n * @components\n * - {@link TransitionCreation}\n * - {@link PayrollConfiguration}\n *\n * @param props - See {@link TransitionPayrollProps}.\n * @returns The transition payroll component.\n * @public\n *\n * @example\n * ```tsx title=\"App.tsx\"\n * import { Payroll, type EventType } from '@gusto/embedded-react-sdk'\n *\n * function MyApp() {\n * return (\n * <Payroll.TransitionPayroll\n * companyId=\"a007e1ab-3595-43c2-ab4b-af7a5af2e365\"\n * startDate=\"2025-01-16\"\n * endDate=\"2025-01-31\"\n * payScheduleUuid=\"c75c1ef6-2ec0-4cca-94a5-8b4cf7e5ea21\"\n * onEvent={(eventType: EventType) => {\n * if (eventType === 'runPayroll/calculated') {\n * // Payroll calculated — navigate to your review screen\n * }\n * }}\n * />\n * )\n * }\n * ```\n */\nexport function TransitionPayroll(props: TransitionPayrollProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({\n companyId,\n startDate,\n endDate,\n payScheduleUuid,\n payrollUuid,\n withReimbursements = true,\n}: TransitionPayrollProps) {\n const { onEvent } = useBase()\n\n const resolvedPayrollUuid = useResolveTransitionPayroll({\n companyId,\n startDate,\n endDate,\n payScheduleUuid,\n })\n\n // A caller-supplied payrollUuid wins over the lookup, so a parent that already knows the payroll\n // can skip creation.\n const initialPayrollUuid = payrollUuid ?? resolvedPayrollUuid\n\n // Freeze the machine once. Creating a payroll refetches the resolve query, so recomputing this\n // would re-seat the machine mid-flow.\n const [machine] = useState(() => {\n const hasExisting = Boolean(initialPayrollUuid)\n return createMachine(\n hasExisting ? 'configuration' : 'creation',\n transitionPayrollMachine,\n (initialContext: TransitionPayrollContextInterface) => ({\n ...initialContext,\n component: hasExisting ? PayrollConfigurationContextual : TransitionCreationContextual,\n companyId,\n startDate,\n endDate,\n payScheduleUuid,\n payrollUuid: initialPayrollUuid,\n withReimbursements,\n }),\n )\n })\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n"],"names":["TransitionPayroll","props","jsx","BaseComponent","Root","companyId","startDate","endDate","payScheduleUuid","payrollUuid","withReimbursements","onEvent","useBase","resolvedPayrollUuid","useResolveTransitionPayroll","initialPayrollUuid","machine","useState","hasExisting","createMachine","transitionPayrollMachine","initialContext","PayrollConfigurationContextual","TransitionCreationContextual","Flow"],"mappings":";;;;;;;;;AAmEO,SAASA,EAAkBC,GAA+B;AAC/D,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK;AAAA,EACZ,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC,IAAqB;AACvB,GAA2B;AACzB,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEdC,IAAsBC,EAA4B;AAAA,IACtD,WAAAT;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,iBAAAC;AAAA,EAAA,CACD,GAIKO,IAAqBN,KAAeI,GAIpC,CAACG,CAAO,IAAIC,EAAS,MAAM;AAC/B,UAAMC,IAAc,EAAQH;AAC5B,WAAOI;AAAA,MACLD,IAAc,kBAAkB;AAAA,MAChCE;AAAA,MACA,CAACC,OAAuD;AAAA,QACtD,GAAGA;AAAA,QACH,WAAWH,IAAcI,IAAiCC;AAAA,QAC1D,WAAAlB;AAAA,QACA,WAAAC;AAAA,QACA,SAAAC;AAAA,QACA,iBAAAC;AAAA,QACA,aAAaO;AAAA,QACb,oBAAAL;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ,CAAC;AAED,SAAO,gBAAAR,EAACsB,GAAA,EAAK,SAAAR,GAAkB,SAAAL,EAAA,CAAkB;AACnD;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { PayrollConfiguration as m } from "../PayrollConfiguration/PayrollConfiguration.js";
|
|
3
|
+
import { useFlow as i } from "../../Flow/useFlow.js";
|
|
4
|
+
import { ensureRequired as o } from "../../../helpers/ensureRequired.js";
|
|
5
|
+
import { TransitionCreation as p } from "../TransitionCreation/TransitionCreation.js";
|
|
6
|
+
function f() {
|
|
7
|
+
const { companyId: t, startDate: n, endDate: r, payScheduleUuid: e, onEvent: u } = i();
|
|
8
|
+
return /* @__PURE__ */ a(
|
|
9
|
+
p,
|
|
10
|
+
{
|
|
11
|
+
companyId: o(t),
|
|
12
|
+
startDate: o(n),
|
|
13
|
+
endDate: o(r),
|
|
14
|
+
payScheduleUuid: o(e),
|
|
15
|
+
onEvent: u
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
function C() {
|
|
20
|
+
const { companyId: t, payrollUuid: n, onEvent: r, withReimbursements: e } = i();
|
|
21
|
+
return /* @__PURE__ */ a(
|
|
22
|
+
m,
|
|
23
|
+
{
|
|
24
|
+
companyId: o(t),
|
|
25
|
+
payrollId: o(n),
|
|
26
|
+
onEvent: r,
|
|
27
|
+
withReimbursements: e
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
C as PayrollConfigurationContextual,
|
|
33
|
+
f as TransitionCreationContextual
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=TransitionPayrollComponents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransitionPayrollComponents.js","sources":["../../../../src/components/Payroll/TransitionPayroll/TransitionPayrollComponents.tsx"],"sourcesContent":["import { TransitionCreation } from '../TransitionCreation'\nimport { PayrollConfiguration } from '../PayrollConfiguration/PayrollConfiguration'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\n/**\n * Flow context shape carried through the {@link TransitionPayroll} state machine.\n *\n * @internal\n */\nexport interface TransitionPayrollContextInterface extends FlowContextInterface {\n /** Company the transition payroll belongs to. */\n companyId: string\n /** Start date of the transition pay period (YYYY-MM-DD). */\n startDate: string\n /** End date of the transition pay period (YYYY-MM-DD). */\n endDate: string\n /** UUID of the pay schedule the transition is associated with. */\n payScheduleUuid: string\n /** UUID of the transition payroll once it has been resolved or created. */\n payrollUuid?: string\n /** Whether reimbursement fields are shown on the configuration screen. Defaults to `true`. */\n withReimbursements?: boolean\n}\n\n/** @internal */\nexport function TransitionCreationContextual() {\n const { companyId, startDate, endDate, payScheduleUuid, onEvent } =\n useFlow<TransitionPayrollContextInterface>()\n return (\n <TransitionCreation\n companyId={ensureRequired(companyId)}\n startDate={ensureRequired(startDate)}\n endDate={ensureRequired(endDate)}\n payScheduleUuid={ensureRequired(payScheduleUuid)}\n onEvent={onEvent}\n />\n )\n}\n\n/** @internal */\nexport function PayrollConfigurationContextual() {\n const { companyId, payrollUuid, onEvent, withReimbursements } =\n useFlow<TransitionPayrollContextInterface>()\n return (\n <PayrollConfiguration\n companyId={ensureRequired(companyId)}\n payrollId={ensureRequired(payrollUuid)}\n onEvent={onEvent}\n withReimbursements={withReimbursements}\n />\n )\n}\n"],"names":["TransitionCreationContextual","companyId","startDate","endDate","payScheduleUuid","onEvent","useFlow","jsx","TransitionCreation","ensureRequired","PayrollConfigurationContextual","payrollUuid","withReimbursements","PayrollConfiguration"],"mappings":";;;;;AA0BO,SAASA,IAA+B;AAC7C,QAAM,EAAE,WAAAC,GAAW,WAAAC,GAAW,SAAAC,GAAS,iBAAAC,GAAiB,SAAAC,EAAA,IACtDC,EAAA;AACF,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAeR,CAAS;AAAA,MACnC,WAAWQ,EAAeP,CAAS;AAAA,MACnC,SAASO,EAAeN,CAAO;AAAA,MAC/B,iBAAiBM,EAAeL,CAAe;AAAA,MAC/C,SAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;AAGO,SAASK,IAAiC;AAC/C,QAAM,EAAE,WAAAT,GAAW,aAAAU,GAAa,SAAAN,GAAS,oBAAAO,EAAA,IACvCN,EAAA;AACF,SACE,gBAAAC;AAAA,IAACM;AAAA,IAAA;AAAA,MACC,WAAWJ,EAAeR,CAAS;AAAA,MACnC,WAAWQ,EAAeE,CAAW;AAAA,MACrC,SAAAN;AAAA,MACA,oBAAAO;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { state as o, transition as r, reduce as i } from "robot3";
|
|
2
|
+
import { PayrollConfigurationContextual as a } from "./TransitionPayrollComponents.js";
|
|
3
|
+
import { componentEvents as e } from "../../../shared/constants.js";
|
|
4
|
+
const m = {
|
|
5
|
+
creation: o(
|
|
6
|
+
r(
|
|
7
|
+
e.TRANSITION_CREATED,
|
|
8
|
+
"configuration",
|
|
9
|
+
i(
|
|
10
|
+
(t, n) => ({
|
|
11
|
+
...t,
|
|
12
|
+
payrollUuid: n.payload?.payrollUuid,
|
|
13
|
+
component: a
|
|
14
|
+
})
|
|
15
|
+
)
|
|
16
|
+
)
|
|
17
|
+
),
|
|
18
|
+
configuration: o()
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
m as transitionPayrollMachine
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=transitionPayrollStateMachine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transitionPayrollStateMachine.js","sources":["../../../../src/components/Payroll/TransitionPayroll/transitionPayrollStateMachine.ts"],"sourcesContent":["import { state, transition, reduce } from 'robot3'\nimport {\n PayrollConfigurationContextual,\n type TransitionPayrollContextInterface,\n} from './TransitionPayrollComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineTransition } from '@/types/Helpers'\n\n/**\n * State machine for {@link TransitionPayroll}.\n *\n * @remarks\n * `creation` shows {@link TransitionCreation}; `configuration` shows {@link PayrollConfiguration}.\n * The component freezes the initial state from the resolve lookup. `configuration` has no outgoing\n * transitions (a plain zero-transition state, not a robot3 final state per SDK-1169) so its events\n * bubble via `onEvent` and the screen keeps working if the host stays mounted past completion.\n *\n * @internal\n */\nexport const transitionPayrollMachine = {\n creation: state<MachineTransition>(\n transition(\n componentEvents.TRANSITION_CREATED,\n 'configuration',\n reduce(\n (\n ctx: TransitionPayrollContextInterface,\n ev: { payload?: { payrollUuid?: string } },\n ): TransitionPayrollContextInterface => ({\n ...ctx,\n payrollUuid: ev.payload?.payrollUuid,\n component: PayrollConfigurationContextual,\n }),\n ),\n ),\n ),\n\n configuration: state<MachineTransition>(),\n}\n"],"names":["transitionPayrollMachine","state","transition","componentEvents","reduce","ctx","ev","PayrollConfigurationContextual"],"mappings":";;;AAmBO,MAAMA,IAA2B;AAAA,EACtC,UAAUC;AAAA,IACRC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CACEC,GACAC,OACuC;AAAA,UACvC,GAAGD;AAAA,UACH,aAAaC,EAAG,SAAS;AAAA,UACzB,WAAWC;AAAA,QAAA;AAAA,MACb;AAAA,IACF;AAAA,EACF;AAAA,EAGF,eAAeN,EAAA;AACjB;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { usePayrollsListSuspense as i } from "@gusto/embedded-api/react-query/payrollsList";
|
|
2
|
+
import { QueryParamPayrollTypes as s, ProcessingStatuses as u } from "@gusto/embedded-api/models/operations/getv1companiescompanyidpayrolls";
|
|
3
|
+
const c = 28, p = "Transition from old pay schedule";
|
|
4
|
+
function d() {
|
|
5
|
+
const e = /* @__PURE__ */ new Date();
|
|
6
|
+
return e.setDate(e.getDate() + c), e.toISOString().split("T")[0];
|
|
7
|
+
}
|
|
8
|
+
function S({
|
|
9
|
+
companyId: e,
|
|
10
|
+
startDate: o,
|
|
11
|
+
endDate: r,
|
|
12
|
+
payScheduleUuid: n
|
|
13
|
+
}) {
|
|
14
|
+
const { data: l } = i({
|
|
15
|
+
companyId: e,
|
|
16
|
+
processingStatuses: [u.Unprocessed],
|
|
17
|
+
endDate: d(),
|
|
18
|
+
payrollTypes: [
|
|
19
|
+
s.Regular,
|
|
20
|
+
s.OffCycle,
|
|
21
|
+
s.External
|
|
22
|
+
]
|
|
23
|
+
});
|
|
24
|
+
return l.payrollList?.find((a) => {
|
|
25
|
+
const t = a.payPeriod;
|
|
26
|
+
return a.offCycleReason === p && t?.startDate === o && t.endDate === r && t.payScheduleUuid === n;
|
|
27
|
+
})?.payrollUuid;
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
S as useResolveTransitionPayroll
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=useResolveTransitionPayroll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResolveTransitionPayroll.js","sources":["../../../../src/components/Payroll/TransitionPayroll/useResolveTransitionPayroll.ts"],"sourcesContent":["import { usePayrollsListSuspense } from '@gusto/embedded-api/react-query/payrollsList'\nimport {\n ProcessingStatuses,\n QueryParamPayrollTypes,\n} from '@gusto/embedded-api/models/operations/getv1companiescompanyidpayrolls'\n\nconst FUTURE_LOOKAHEAD_DAYS = 28\n\nconst TRANSITION_OFF_CYCLE_REASON = 'Transition from old pay schedule'\n\nfunction getFutureEndDate(): string {\n const date = new Date()\n date.setDate(date.getDate() + FUTURE_LOOKAHEAD_DAYS)\n return date.toISOString().split('T')[0]!\n}\n\n/**\n * Arguments describing the transition pay period to resolve.\n *\n * @internal\n */\nexport interface ResolveTransitionPayrollArgs {\n companyId: string\n startDate: string\n endDate: string\n payScheduleUuid: string\n}\n\n/**\n * Looks up an existing unprocessed transition payroll for the given pay period.\n *\n * @remarks\n * A transition payroll is an unprocessed off-cycle payroll whose `offCycleReason` is\n * `\"Transition from old pay schedule\"` and whose pay period matches the supplied\n * `startDate`, `endDate`, and `payScheduleUuid`. When the company changed its pay schedule\n * the platform creates exactly one such payroll for the coverage gap; this hook finds it so\n * the caller can resume it instead of creating a duplicate.\n *\n * Backed by a suspense query, so callers must render it under a suspense boundary.\n *\n * @param args - The pay period to match. See {@link ResolveTransitionPayrollArgs}.\n * @returns The matching payroll's UUID, or `undefined` when none exists yet.\n * @internal\n */\nexport function useResolveTransitionPayroll({\n companyId,\n startDate,\n endDate,\n payScheduleUuid,\n}: ResolveTransitionPayrollArgs): string | undefined {\n const { data: payrollsData } = usePayrollsListSuspense({\n companyId,\n processingStatuses: [ProcessingStatuses.Unprocessed],\n endDate: getFutureEndDate(),\n payrollTypes: [\n QueryParamPayrollTypes.Regular,\n QueryParamPayrollTypes.OffCycle,\n QueryParamPayrollTypes.External,\n ],\n })\n\n const match = payrollsData.payrollList?.find(payroll => {\n const period = payroll.payPeriod\n return (\n payroll.offCycleReason === TRANSITION_OFF_CYCLE_REASON &&\n period?.startDate === startDate &&\n period.endDate === endDate &&\n period.payScheduleUuid === payScheduleUuid\n )\n })\n\n return match?.payrollUuid\n}\n"],"names":["FUTURE_LOOKAHEAD_DAYS","TRANSITION_OFF_CYCLE_REASON","getFutureEndDate","date","useResolveTransitionPayroll","companyId","startDate","endDate","payScheduleUuid","payrollsData","usePayrollsListSuspense","ProcessingStatuses","QueryParamPayrollTypes","payroll","period"],"mappings":";;AAMA,MAAMA,IAAwB,IAExBC,IAA8B;AAEpC,SAASC,IAA2B;AAClC,QAAMC,wBAAW,KAAA;AACjB,SAAAA,EAAK,QAAQA,EAAK,QAAA,IAAYH,CAAqB,GAC5CG,EAAK,YAAA,EAAc,MAAM,GAAG,EAAE,CAAC;AACxC;AA8BO,SAASC,EAA4B;AAAA,EAC1C,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,iBAAAC;AACF,GAAqD;AACnD,QAAM,EAAE,MAAMC,EAAA,IAAiBC,EAAwB;AAAA,IACrD,WAAAL;AAAA,IACA,oBAAoB,CAACM,EAAmB,WAAW;AAAA,IACnD,SAAST,EAAA;AAAA,IACT,cAAc;AAAA,MACZU,EAAuB;AAAA,MACvBA,EAAuB;AAAA,MACvBA,EAAuB;AAAA,IAAA;AAAA,EACzB,CACD;AAYD,SAVcH,EAAa,aAAa,KAAK,CAAAI,MAAW;AACtD,UAAMC,IAASD,EAAQ;AACvB,WACEA,EAAQ,mBAAmBZ,KAC3Ba,GAAQ,cAAcR,KACtBQ,EAAO,YAAYP,KACnBO,EAAO,oBAAoBN;AAAA,EAE/B,CAAC,GAEa;AAChB;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PayrollConfiguration as e } from "./PayrollConfiguration/PayrollConfiguration.js";
|
|
2
2
|
import { PayrollEditEmployee as l } from "./PayrollEditEmployee/PayrollEditEmployee.js";
|
|
3
3
|
import { PayrollHistory as i } from "./PayrollHistory/PayrollHistory.js";
|
|
4
|
-
import { PayrollLanding as
|
|
4
|
+
import { PayrollLanding as a } from "./PayrollLanding/PayrollLanding.js";
|
|
5
5
|
import { PayrollList as x } from "./PayrollList/PayrollList.js";
|
|
6
6
|
import { PayrollOverview as s } from "./PayrollOverview/PayrollOverview.js";
|
|
7
7
|
import { PayrollFlow as P } from "./PayrollFlow/PayrollFlow.js";
|
|
@@ -12,19 +12,20 @@ import { PrintChecks as g } from "./PrintChecks/PrintChecks.js";
|
|
|
12
12
|
import { DismissalFlow as v } from "./Dismissal/DismissalFlow.js";
|
|
13
13
|
import { DismissalPayPeriodSelection as L } from "./Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js";
|
|
14
14
|
import { OffCycleCreation as S } from "./OffCycleCreation/OffCycleCreation.js";
|
|
15
|
-
import { OffCycleDeductionsSetting as
|
|
15
|
+
import { OffCycleDeductionsSetting as k } from "./OffCycleDeductionsSetting/OffCycleDeductionsSetting.js";
|
|
16
16
|
import { OffCycleFlow as B } from "./OffCycle/OffCycleFlow.js";
|
|
17
17
|
import { OffCycleReasonSelection as W } from "./OffCycleReasonSelection/OffCycleReasonSelection.js";
|
|
18
18
|
import { PayrollBlockerList as j } from "./PayrollBlocker/components/PayrollBlockerList.js";
|
|
19
19
|
import { PayrollExecutionFlow as z } from "./PayrollExecutionFlow/PayrollExecutionFlow.js";
|
|
20
20
|
import { TransitionCreation as G } from "./TransitionCreation/TransitionCreation.js";
|
|
21
21
|
import { TransitionFlow as J } from "./Transition/TransitionFlow.js";
|
|
22
|
+
import { TransitionPayroll as M } from "./TransitionPayroll/TransitionPayroll.js";
|
|
22
23
|
export {
|
|
23
24
|
F as ConfirmWireDetails,
|
|
24
25
|
v as DismissalFlow,
|
|
25
26
|
L as DismissalPayPeriodSelection,
|
|
26
27
|
S as OffCycleCreation,
|
|
27
|
-
|
|
28
|
+
k as OffCycleDeductionsSetting,
|
|
28
29
|
B as OffCycleFlow,
|
|
29
30
|
W as OffCycleReasonSelection,
|
|
30
31
|
j as PayrollBlockerList,
|
|
@@ -33,13 +34,14 @@ export {
|
|
|
33
34
|
z as PayrollExecutionFlow,
|
|
34
35
|
P as PayrollFlow,
|
|
35
36
|
i as PayrollHistory,
|
|
36
|
-
|
|
37
|
+
a as PayrollLanding,
|
|
37
38
|
x as PayrollList,
|
|
38
39
|
s as PayrollOverview,
|
|
39
40
|
C as PayrollReceipts,
|
|
40
41
|
g as PrintChecks,
|
|
41
42
|
d as RecoveryCases,
|
|
42
43
|
G as TransitionCreation,
|
|
43
|
-
J as TransitionFlow
|
|
44
|
+
J as TransitionFlow,
|
|
45
|
+
M as TransitionPayroll
|
|
44
46
|
};
|
|
45
47
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/i18n/I18n.js
CHANGED
|
@@ -232,23 +232,28 @@ const j = "common", i = /* @__PURE__ */ Object.assign({
|
|
|
232
232
|
"./es_US/Payroll.PayrollList.json": () => import("./es_US/Payroll.PayrollList.json.js").then((e) => e.default),
|
|
233
233
|
"./es_US/Payroll.PayrollOverview.json": () => import("./es_US/Payroll.PayrollOverview.json.js").then((e) => e.default),
|
|
234
234
|
"./es_US/Payroll.PayrollReceipts.json": () => import("./es_US/Payroll.PayrollReceipts.json.js").then((e) => e.default),
|
|
235
|
+
"./es_US/Payroll.PrintChecksBanner.json": () => import("./es_US/Payroll.PrintChecksBanner.json.js").then((e) => e.default),
|
|
236
|
+
"./es_US/Payroll.PrintChecksFailure.json": () => import("./es_US/Payroll.PrintChecksFailure.json.js").then((e) => e.default),
|
|
237
|
+
"./es_US/Payroll.PrintChecksForm.json": () => import("./es_US/Payroll.PrintChecksForm.json.js").then((e) => e.default),
|
|
238
|
+
"./es_US/Payroll.PrintChecksSummary.json": () => import("./es_US/Payroll.PrintChecksSummary.json.js").then((e) => e.default),
|
|
235
239
|
"./es_US/Payroll.RecoveryCasesList.json": () => import("./es_US/Payroll.RecoveryCasesList.json.js").then((e) => e.default),
|
|
236
240
|
"./es_US/Payroll.RecoveryCasesResubmit.json": () => import("./es_US/Payroll.RecoveryCasesResubmit.json.js").then((e) => e.default),
|
|
237
241
|
"./es_US/Payroll.Transition.json": () => import("./es_US/Payroll.Transition.json.js").then((e) => e.default),
|
|
238
242
|
"./es_US/Payroll.TransitionCreation.json": () => import("./es_US/Payroll.TransitionCreation.json.js").then((e) => e.default),
|
|
239
243
|
"./es_US/Payroll.TransitionPayrollAlert.json": () => import("./es_US/Payroll.TransitionPayrollAlert.json.js").then((e) => e.default),
|
|
244
|
+
"./es_US/Payroll.UNSTABLE_PayrollEditEmployee.json": () => import("./es_US/Payroll.UNSTABLE_PayrollEditEmployee.json.js").then((e) => e.default),
|
|
240
245
|
"./es_US/Payroll.WireInstructions.json": () => import("./es_US/Payroll.WireInstructions.json.js").then((e) => e.default),
|
|
241
246
|
"./es_US/common.json": () => import("./es_US/common.json.js").then((e) => e.default)
|
|
242
247
|
});
|
|
243
|
-
function
|
|
248
|
+
function u(e, t) {
|
|
244
249
|
const o = `./${e ?? "en"}/${t}.json`;
|
|
245
250
|
return i[o] ?? i[`./en/${t}.json`];
|
|
246
251
|
}
|
|
247
|
-
const s = new f(50),
|
|
252
|
+
const s = new f(50), d = ({ lng: e = "en", ns: t }) => {
|
|
248
253
|
let n = !0, o = !1, a;
|
|
249
254
|
const l = (async () => {
|
|
250
255
|
try {
|
|
251
|
-
const m =
|
|
256
|
+
const m = u(e, t);
|
|
252
257
|
if (!m) {
|
|
253
258
|
o = !0, n = !1;
|
|
254
259
|
return;
|
|
@@ -271,7 +276,7 @@ const s = new f(50), u = ({ lng: e = "en", ns: t }) => {
|
|
|
271
276
|
const n = Array.isArray(e) ? e : [e];
|
|
272
277
|
for (const o of n) {
|
|
273
278
|
const a = `${t.language}:${o}`;
|
|
274
|
-
s.get(a) === null && s.put(a,
|
|
279
|
+
s.get(a) === null && s.put(a, d({ lng: t.language, ns: o }));
|
|
275
280
|
const r = s.get(a);
|
|
276
281
|
if (r) {
|
|
277
282
|
const l = r();
|