@gusto/embedded-react-sdk 0.23.1 → 0.24.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.
Files changed (123) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/components/Common/PayrollLoading/PayrollLoading.d.ts +2 -0
  3. package/dist/components/Common/PayrollLoading/PayrollLoading.js +19 -0
  4. package/dist/components/Common/PayrollLoading/PayrollLoading.js.map +1 -0
  5. package/dist/components/Common/PayrollLoading/PayrollLoadingTypes.d.ts +5 -0
  6. package/dist/components/Common/PayrollLoading/index.d.ts +3 -0
  7. package/dist/components/Common/index.d.ts +1 -0
  8. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
  9. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  10. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
  11. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  12. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
  13. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  14. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
  15. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  16. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  17. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  18. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
  19. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  20. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -9
  21. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  22. package/dist/components/Company/Industry/Context.js +6 -7
  23. package/dist/components/Company/Industry/Context.js.map +1 -1
  24. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
  25. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  26. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
  27. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  28. package/dist/components/Company/OnboardingOverview/context.js +3 -4
  29. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  30. package/dist/components/Company/PaySchedule/usePaySchedule.js +5 -6
  31. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  32. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
  33. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  34. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
  35. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  36. package/dist/components/Contractor/Address/useAddress.js +5 -6
  37. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  38. package/dist/components/Contractor/Profile/useContractorProfile.js +2 -3
  39. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  40. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +2 -3
  41. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  42. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +2 -3
  43. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  44. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +2 -3
  45. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  46. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  47. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  48. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
  49. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  50. package/dist/components/Employee/EmployeeList/useEmployeeList.js +3 -4
  51. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  52. package/dist/components/Employee/FederalTaxes/FederalForm.js +2 -0
  53. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  54. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +3 -4
  55. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  56. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +5 -6
  57. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  58. package/dist/components/Employee/Profile/useProfile.js +3 -4
  59. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  60. package/dist/components/Employee/StateTaxes/useStateTaxes.js +3 -4
  61. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  62. package/dist/components/Employee/Taxes/FederalForm.js +6 -4
  63. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  64. package/dist/components/Employee/Taxes/useTaxes.js +3 -4
  65. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  66. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.d.ts +4 -4
  67. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +26 -21
  68. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
  69. package/dist/components/Payroll/ConfirmWireDetails/index.d.ts +1 -1
  70. package/dist/components/Payroll/ConfirmWireDetails/types.d.ts +8 -1
  71. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.d.ts +2 -1
  72. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +56 -54
  73. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  74. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +2 -1
  75. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +90 -91
  76. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  77. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.d.ts +2 -1
  78. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +33 -31
  79. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  80. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +2 -1
  81. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +88 -87
  82. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  83. package/dist/components/Payroll/PayrollFlow/PayrollFlow.d.ts +1 -1
  84. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js +24 -18
  85. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -1
  86. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +5 -0
  87. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +77 -51
  88. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  89. package/dist/components/Payroll/PayrollLanding/PayrollLanding.d.ts +4 -1
  90. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +29 -21
  91. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
  92. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +5 -0
  93. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +36 -26
  94. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  95. package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +4 -1
  96. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +70 -60
  97. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  98. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +2 -1
  99. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +239 -234
  100. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  101. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.d.ts +2 -1
  102. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js +25 -15
  103. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js.map +1 -1
  104. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.d.ts +2 -1
  105. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +152 -137
  106. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  107. package/dist/components/Payroll/index.d.ts +1 -0
  108. package/dist/components/Payroll/usePreparedPayrollData.js +5 -6
  109. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  110. package/dist/contexts/ApiProvider/ApiProvider.d.ts +3 -1
  111. package/dist/contexts/ApiProvider/ApiProvider.js +26 -18
  112. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  113. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
  114. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  115. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  116. package/dist/contexts/GustoProvider/GustoProvider.d.ts +2 -0
  117. package/dist/contexts/GustoProvider/GustoProvider.js +12 -11
  118. package/dist/contexts/GustoProvider/GustoProvider.js.map +1 -1
  119. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +24 -14
  120. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  121. package/dist/index.d.ts +1 -0
  122. package/dist/style.css +1 -1
  123. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"PayrollEditEmployee.js","sources":["../../../../src/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.tsx"],"sourcesContent":["import { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { usePayrollsUpdateMutation } from '@gusto/embedded-api/react-query/payrollsUpdate'\nimport type { PayrollEmployeeCompensationsType } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollUpdateEmployeeCompensations } from '@gusto/embedded-api/models/components/payrollupdate'\nimport { useMemo } from 'react'\nimport { usePreparedPayrollData } from '../usePreparedPayrollData'\nimport { PayrollEditEmployeePresentation } from './PayrollEditEmployeePresentation'\nimport { componentEvents } from '@/shared/constants'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useComponentDictionary } from '@/i18n'\nimport { useBase } from '@/components/Base/useBase'\n\ninterface PayrollEditEmployeeProps extends BaseComponentInterface<'Payroll.PayrollEditEmployee'> {\n employeeId: string\n companyId: string\n payrollId: string\n}\n\nexport function PayrollEditEmployee(props: PayrollEditEmployeeProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({\n employeeId,\n companyId,\n payrollId,\n onEvent,\n dictionary,\n}: PayrollEditEmployeeProps) => {\n useComponentDictionary('Payroll.PayrollEditEmployee', dictionary)\n\n const { LoadingIndicator, baseSubmitHandler } = useBase()\n\n const { data: employeeData } = useEmployeesGetSuspense({ employeeId })\n const memoizedEmployeeId = useMemo(() => [employeeId], [])\n const { preparedPayroll, paySchedule, isLoading } = usePreparedPayrollData({\n companyId,\n payrollId,\n employeeUuids: memoizedEmployeeId,\n })\n\n const { mutateAsync: updatePayroll, isPending } = usePayrollsUpdateMutation()\n\n const employee = employeeData.employee!\n const employeeCompensation = preparedPayroll?.employeeCompensations?.at(0)\n\n const transformEmployeeCompensation = ({\n paymentMethod,\n reimbursements,\n ...compensation\n }: PayrollEmployeeCompensationsType): PayrollUpdateEmployeeCompensations => {\n return {\n ...compensation,\n ...(paymentMethod && paymentMethod !== 'Historical' ? { paymentMethod } : {}),\n memo: compensation.memo || undefined,\n }\n }\n\n const onSave = async (updatedCompensation: PayrollEmployeeCompensationsType) => {\n const transformedCompensation = transformEmployeeCompensation(updatedCompensation)\n await baseSubmitHandler(null, async () => {\n const result = await updatePayroll({\n request: {\n companyId,\n payrollId,\n payrollUpdate: {\n employeeCompensations: [transformedCompensation],\n },\n },\n })\n\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_SAVED, {\n payrollPrepared: result.payrollPrepared,\n employee,\n })\n })\n }\n\n const onCancel = () => {\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_CANCELLED)\n }\n\n if (isLoading) {\n return <LoadingIndicator />\n }\n\n return (\n <PayrollEditEmployeePresentation\n onSave={onSave}\n onCancel={onCancel}\n employee={employee}\n isPending={isPending}\n employeeCompensation={employeeCompensation}\n fixedCompensationTypes={preparedPayroll?.fixedCompensationTypes || []}\n payPeriodStartDate={preparedPayroll?.payPeriod?.startDate}\n paySchedule={paySchedule}\n isOffCycle={preparedPayroll?.offCycle}\n />\n )\n}\n"],"names":["PayrollEditEmployee","props","jsx","BaseComponent","Root","employeeId","companyId","payrollId","onEvent","dictionary","useComponentDictionary","LoadingIndicator","baseSubmitHandler","useBase","employeeData","useEmployeesGetSuspense","memoizedEmployeeId","useMemo","preparedPayroll","paySchedule","isLoading","usePreparedPayrollData","updatePayroll","isPending","usePayrollsUpdateMutation","employee","employeeCompensation","transformEmployeeCompensation","paymentMethod","reimbursements","compensation","onSave","updatedCompensation","transformedCompensation","result","componentEvents","onCancel","PayrollEditEmployeePresentation"],"mappings":";;;;;;;;;;AAmBO,SAASA,EAAoBC,GAA0D;AAC5F,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEO,MAAMG,IAAO,CAAC;AAAA,EACnB,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,YAAAC;AACF,MAAgC;AAC9B,EAAAC,EAAuB,+BAA+BD,CAAU;AAEhE,QAAM,EAAE,kBAAAE,GAAkB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AK;AAAA,MACA,UAAAX;AAAA,MACA,WAAAF;AAAA,MACA,sBAAAG;AAAA,MACA,wBAAwBR,GAAiB,0BAA0B,CAAA;AAAA,MACnE,oBAAoBA,GAAiB,WAAW;AAAA,MAChD,aAAAC;AAAA,MACA,YAAYD,GAAiB;AAAA,IAAA;AAAA,EAAA;AAGnC;"}
1
+ {"version":3,"file":"PayrollEditEmployee.js","sources":["../../../../src/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.tsx"],"sourcesContent":["import { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { usePayrollsUpdateMutation } from '@gusto/embedded-api/react-query/payrollsUpdate'\nimport type { PayrollEmployeeCompensationsType } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollUpdateEmployeeCompensations } from '@gusto/embedded-api/models/components/payrollupdate'\nimport { useMemo } from 'react'\nimport { usePreparedPayrollData } from '../usePreparedPayrollData'\nimport { PayrollEditEmployeePresentation } from './PayrollEditEmployeePresentation'\nimport { componentEvents } from '@/shared/constants'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useComponentDictionary } from '@/i18n'\nimport { useBase } from '@/components/Base/useBase'\n\ninterface PayrollEditEmployeeProps extends BaseComponentInterface<'Payroll.PayrollEditEmployee'> {\n employeeId: string\n companyId: string\n payrollId: string\n withReimbursements?: boolean\n}\n\nexport function PayrollEditEmployee(props: PayrollEditEmployeeProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({\n employeeId,\n companyId,\n payrollId,\n onEvent,\n dictionary,\n withReimbursements = true,\n}: PayrollEditEmployeeProps) => {\n useComponentDictionary('Payroll.PayrollEditEmployee', dictionary)\n\n const { LoadingIndicator, baseSubmitHandler } = useBase()\n\n const { data: employeeData } = useEmployeesGetSuspense({ employeeId })\n const memoizedEmployeeId = useMemo(() => [employeeId], [])\n const { preparedPayroll, paySchedule, isLoading } = usePreparedPayrollData({\n companyId,\n payrollId,\n employeeUuids: memoizedEmployeeId,\n })\n\n const { mutateAsync: updatePayroll, isPending } = usePayrollsUpdateMutation()\n\n const employee = employeeData.employee!\n const employeeCompensation = preparedPayroll?.employeeCompensations?.at(0)\n\n const transformEmployeeCompensation = ({\n paymentMethod,\n reimbursements,\n ...compensation\n }: PayrollEmployeeCompensationsType): PayrollUpdateEmployeeCompensations => {\n return {\n ...compensation,\n ...(paymentMethod && paymentMethod !== 'Historical' ? { paymentMethod } : {}),\n memo: compensation.memo || undefined,\n }\n }\n\n const onSave = async (updatedCompensation: PayrollEmployeeCompensationsType) => {\n const transformedCompensation = transformEmployeeCompensation(updatedCompensation)\n await baseSubmitHandler(null, async () => {\n const result = await updatePayroll({\n request: {\n companyId,\n payrollId,\n payrollUpdate: {\n employeeCompensations: [transformedCompensation],\n },\n },\n })\n\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_SAVED, {\n payrollPrepared: result.payrollPrepared,\n employee,\n })\n })\n }\n\n const onCancel = () => {\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_CANCELLED)\n }\n\n if (isLoading) {\n return <LoadingIndicator />\n }\n\n return (\n <PayrollEditEmployeePresentation\n onSave={onSave}\n onCancel={onCancel}\n employee={employee}\n isPending={isPending}\n employeeCompensation={employeeCompensation}\n fixedCompensationTypes={preparedPayroll?.fixedCompensationTypes || []}\n payPeriodStartDate={preparedPayroll?.payPeriod?.startDate}\n paySchedule={paySchedule}\n isOffCycle={preparedPayroll?.offCycle}\n withReimbursements={withReimbursements}\n />\n )\n}\n"],"names":["PayrollEditEmployee","props","jsx","BaseComponent","Root","employeeId","companyId","payrollId","onEvent","dictionary","withReimbursements","useComponentDictionary","LoadingIndicator","baseSubmitHandler","useBase","employeeData","useEmployeesGetSuspense","memoizedEmployeeId","useMemo","preparedPayroll","paySchedule","isLoading","usePreparedPayrollData","updatePayroll","isPending","usePayrollsUpdateMutation","employee","employeeCompensation","transformEmployeeCompensation","paymentMethod","reimbursements","compensation","onSave","updatedCompensation","transformedCompensation","result","componentEvents","onCancel","PayrollEditEmployeePresentation"],"mappings":";;;;;;;;;;AAoBO,SAASA,EAAoBC,GAA0D;AAC5F,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEO,MAAMG,IAAO,CAAC;AAAA,EACnB,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,YAAAC;AAAA,EACA,oBAAAC,IAAqB;AACvB,MAAgC;AAC9B,EAAAC,EAAuB,+BAA+BF,CAAU;AAEhE,QAAM,EAAE,kBAAAG,GAAkB,mBAAAC,EAAA,IAAsBC,EAAA,GAE1C,EAAE,MAAMC,EAAA,IAAiBC,EAAwB,EAAE,YAAAX,GAAY,GAC/DY,IAAqBC,EAAQ,MAAM,CAACb,CAAU,GAAG,CAAA,CAAE,GACnD,EAAE,iBAAAc,GAAiB,aAAAC,GAAa,WAAAC,EAAA,IAAcC,EAAuB;AAAA,IACzE,WAAAhB;AAAA,IACA,WAAAC;AAAA,IACA,eAAeU;AAAA,EAAA,CAChB,GAEK,EAAE,aAAaM,GAAe,WAAAC,EAAA,IAAcC,EAAA,GAE5CC,IAAWX,EAAa,UACxBY,IAAuBR,GAAiB,uBAAuB,GAAG,CAAC,GAEnES,IAAgC,CAAC;AAAA,IACrC,eAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,OAEI;AAAA,IACL,GAAGA;AAAA,IACH,GAAIF,KAAiBA,MAAkB,eAAe,EAAE,eAAAA,EAAA,IAAkB,CAAA;AAAA,IAC1E,MAAME,EAAa,QAAQ;AAAA,EAAA,IAIzBC,IAAS,OAAOC,MAA0D;AAC9E,UAAMC,IAA0BN,EAA8BK,CAAmB;AACjF,UAAMpB,EAAkB,MAAM,YAAY;AACxC,YAAMsB,IAAS,MAAMZ,EAAc;AAAA,QACjC,SAAS;AAAA,UACP,WAAAjB;AAAA,UACA,WAAAC;AAAA,UACA,eAAe;AAAA,YACb,uBAAuB,CAAC2B,CAAuB;AAAA,UAAA;AAAA,QACjD;AAAA,MACF,CACD;AAED,MAAA1B,EAAQ4B,EAAgB,4BAA4B;AAAA,QAClD,iBAAiBD,EAAO;AAAA,QACxB,UAAAT;AAAA,MAAA,CACD;AAAA,IACH,CAAC;AAAA,EACH,GAEMW,IAAW,MAAM;AACrB,IAAA7B,EAAQ4B,EAAgB,8BAA8B;AAAA,EACxD;AAEA,SAAIf,sBACMT,GAAA,EAAiB,IAIzB,gBAAAV;AAAA,IAACoC;AAAA,IAAA;AAAA,MACC,QAAAN;AAAA,MACA,UAAAK;AAAA,MACA,UAAAX;AAAA,MACA,WAAAF;AAAA,MACA,sBAAAG;AAAA,MACA,wBAAwBR,GAAiB,0BAA0B,CAAA;AAAA,MACnE,oBAAoBA,GAAiB,WAAW;AAAA,MAChD,aAAAC;AAAA,MACA,YAAYD,GAAiB;AAAA,MAC7B,oBAAAT;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -13,6 +13,7 @@ interface PayrollEditEmployeeProps {
13
13
  payPeriodStartDate?: string;
14
14
  paySchedule?: PayScheduleObject;
15
15
  isOffCycle?: boolean;
16
+ withReimbursements?: boolean;
16
17
  }
17
18
  export declare const PayrollEditEmployeeFormSchema: z.ZodObject<{
18
19
  hourlyCompensations: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>>;
@@ -35,5 +36,5 @@ export declare const PayrollEditEmployeeFormSchema: z.ZodObject<{
35
36
  paymentMethod?: "Check" | "Direct Deposit" | "Historical" | undefined;
36
37
  }>;
37
38
  export type PayrollEditEmployeeFormValues = z.infer<typeof PayrollEditEmployeeFormSchema>;
38
- export declare const PayrollEditEmployeePresentation: ({ onSave, onCancel, employee, employeeCompensation, isPending, fixedCompensationTypes, payPeriodStartDate, paySchedule, isOffCycle, }: PayrollEditEmployeeProps) => import("react/jsx-runtime").JSX.Element;
39
+ export declare const PayrollEditEmployeePresentation: ({ onSave, onCancel, employee, employeeCompensation, isPending, fixedCompensationTypes, payPeriodStartDate, paySchedule, isOffCycle, withReimbursements, }: PayrollEditEmployeeProps) => import("react/jsx-runtime").JSX.Element;
39
40
  export {};
@@ -1,30 +1,30 @@
1
1
  import { jsxs as a, jsx as r } from "react/jsx-runtime";
2
- import { useForm as W, useWatch as Y, FormProvider as K } from "react-hook-form";
3
- import { useRef as X, useMemo as Q } from "react";
4
- import { PayrollEmployeeCompensationsTypePaymentMethod as A } from "@gusto/embedded-api/models/components/payrollemployeecompensationstype";
5
- import { useTranslation as Z } from "react-i18next";
2
+ import { useForm as Y, useWatch as K, FormProvider as X } from "react-hook-form";
3
+ import { useRef as Q, useMemo as Z } from "react";
4
+ import { PayrollEmployeeCompensationsTypePaymentMethod as S } from "@gusto/embedded-api/models/components/payrollemployeecompensationstype";
5
+ import { useTranslation as J } from "react-i18next";
6
6
  import { z as m } from "zod";
7
- import { zodResolver as J } from "@hookform/resolvers/zod";
7
+ import { zodResolver as ee } from "@hookform/resolvers/zod";
8
8
  import u from "./PayrollEditEmployeePresentation.module.scss.js";
9
- import { TimeOffField as ee } from "./TimeOffField.js";
9
+ import { TimeOffField as te } from "./TimeOffField.js";
10
10
  import { Flex as y } from "../../Common/Flex/Flex.js";
11
- import { Grid as S } from "../../Common/Grid/Grid.js";
11
+ import { Grid as P } from "../../Common/Grid/Grid.js";
12
12
  import "classnames";
13
- import { RadioGroupField as te } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
13
+ import { RadioGroupField as ne } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
14
14
  import { TextInputField as R } from "../../Common/Fields/TextInputField/TextInputField.js";
15
- import { useComponentContext as ne } from "../../../contexts/ComponentAdapter/useComponentContext.js";
16
- import { useI18n as re } from "../../../i18n/I18n.js";
17
- import { Form as ie } from "../../Common/Form/Form.js";
18
- import { firstLastName as se, formatNumberAsCurrency as oe } from "../../../helpers/formattedStrings.js";
19
- import { getAdditionalEarningsCompensations as ae, getReimbursementCompensation as me, calculateGrossPay as G } from "../helpers.js";
20
- import { HOURS_COMPENSATION_NAMES as k, EXCLUDED_ADDITIONAL_EARNINGS as le, COMPENSATION_NAME_DOUBLE_OVERTIME as de, COMPENSATION_NAME_OVERTIME as ue, COMPENSATION_NAME_REGULAR_HOURS as ce, COMPENSATION_NAME_REIMBURSEMENT as pe, COMPENSATION_NAME_CASH_TIPS as fe, COMPENSATION_NAME_COMMISSION as he, COMPENSATION_NAME_CORRECTION_PAYMENT as Ce, COMPENSATION_NAME_PAYCHECK_TIPS as Ne, COMPENSATION_NAME_BONUS as Ee } from "../../../shared/constants.js";
21
- import { useContainerBreakpoints as ge } from "../../../hooks/useContainerBreakpoints/useContainerBreakpoints.js";
22
- const be = m.object({
15
+ import { useComponentContext as re } from "../../../contexts/ComponentAdapter/useComponentContext.js";
16
+ import { useI18n as ie } from "../../../i18n/I18n.js";
17
+ import { Form as se } from "../../Common/Form/Form.js";
18
+ import { firstLastName as oe, formatNumberAsCurrency as ae } from "../../../helpers/formattedStrings.js";
19
+ import { getAdditionalEarningsCompensations as me, getReimbursementCompensation as le, calculateGrossPay as k } from "../helpers.js";
20
+ import { HOURS_COMPENSATION_NAMES as w, EXCLUDED_ADDITIONAL_EARNINGS as de, COMPENSATION_NAME_DOUBLE_OVERTIME as ue, COMPENSATION_NAME_OVERTIME as ce, COMPENSATION_NAME_REGULAR_HOURS as pe, COMPENSATION_NAME_REIMBURSEMENT as fe, COMPENSATION_NAME_CASH_TIPS as he, COMPENSATION_NAME_COMMISSION as Ce, COMPENSATION_NAME_CORRECTION_PAYMENT as Ne, COMPENSATION_NAME_PAYCHECK_TIPS as Ee, COMPENSATION_NAME_BONUS as ge } from "../../../shared/constants.js";
21
+ import { useContainerBreakpoints as be } from "../../../hooks/useContainerBreakpoints/useContainerBreakpoints.js";
22
+ const Me = m.object({
23
23
  hourlyCompensations: m.record(m.string(), m.record(m.string(), m.string().optional())),
24
24
  timeOffCompensations: m.record(m.string(), m.string().optional()),
25
25
  fixedCompensations: m.record(m.string(), m.string().optional()),
26
- paymentMethod: m.nativeEnum(A).optional()
27
- }), w = (E, O, d, s) => {
26
+ paymentMethod: m.nativeEnum(S).optional()
27
+ }), H = (E, O, d, s) => {
28
28
  const g = {
29
29
  ...O,
30
30
  paymentMethod: E.paymentMethod
@@ -44,7 +44,7 @@ const be = m.object({
44
44
  const b = [];
45
45
  return Object.entries(E.fixedCompensations).forEach(([i, l]) => {
46
46
  const C = O?.fixedCompensations?.find(
47
- (x) => x.name?.toLowerCase() === i.toLowerCase()
47
+ (A) => A.name?.toLowerCase() === i.toLowerCase()
48
48
  );
49
49
  l && (C ? b.push({
50
50
  name: C.name,
@@ -56,7 +56,7 @@ const be = m.object({
56
56
  amount: l
57
57
  }));
58
58
  }), g.fixedCompensations = b, g;
59
- }, Be = ({
59
+ }, qe = ({
60
60
  onSave: E,
61
61
  onCancel: O,
62
62
  employee: d,
@@ -65,70 +65,71 @@ const be = m.object({
65
65
  fixedCompensationTypes: b,
66
66
  payPeriodStartDate: i,
67
67
  paySchedule: l,
68
- isOffCycle: C = !1
68
+ isOffCycle: C = !1,
69
+ withReimbursements: A = !0
69
70
  }) => {
70
- const { Button: x, Heading: c, Text: H } = ne(), { t } = Z("Payroll.PayrollEditEmployee");
71
- re("Payroll.PayrollEditEmployee");
72
- const f = d.jobs?.find((e) => e.primary), T = f ? [f] : [], v = X(null), p = ge({
73
- ref: v
71
+ const { Button: v, Heading: c, Text: $ } = re(), { t } = J("Payroll.PayrollEditEmployee");
72
+ ie("Payroll.PayrollEditEmployee");
73
+ const f = d.jobs?.find((e) => e.primary), T = f ? [f] : [], F = Q(null), p = be({
74
+ ref: F
74
75
  }).includes("small");
75
76
  s?.hourlyCompensations?.forEach((e) => {
76
77
  const n = d.jobs?.find((o) => o.uuid === e.jobUuid);
77
78
  n && !T.find((o) => o.uuid === n.uuid) && T.push(n);
78
79
  });
79
- const P = (s?.paidTimeOff || []).filter((e) => e.name), _ = ae({
80
+ const x = (s?.paidTimeOff || []).filter((e) => e.name), _ = me({
80
81
  flsaStatus: f?.compensations?.[0]?.flsaStatus,
81
82
  existingFixedCompensations: s?.fixedCompensations || [],
82
83
  primaryJobUuid: f?.uuid,
83
84
  fixedCompensationTypes: b,
84
- excludedTypes: le
85
- }), N = me(
85
+ excludedTypes: de
86
+ }), N = A ? le(
86
87
  s?.fixedCompensations || [],
87
88
  b,
88
89
  f?.uuid
89
- ), F = (e, n) => s?.hourlyCompensations?.find(
90
+ ) : null, j = (e, n) => s?.hourlyCompensations?.find(
90
91
  (o) => o.jobUuid === e && o.name?.toLowerCase() === n.toLowerCase()
91
- ), $ = (e) => {
92
+ ), B = (e) => {
92
93
  switch (e) {
93
- case ce:
94
+ case pe:
94
95
  return t("compensationNames.regularHours");
95
- case ue:
96
+ case ce:
96
97
  return t("compensationNames.overtime");
97
- case de:
98
+ case ue:
98
99
  return t("compensationNames.doubleOvertime");
99
100
  default:
100
101
  return e;
101
102
  }
102
- }, j = (e) => {
103
+ }, L = (e) => {
103
104
  switch (e) {
104
- case Ee:
105
+ case ge:
105
106
  return t("fixedCompensationNames.bonus");
106
- case Ne:
107
+ case Ee:
107
108
  return t("fixedCompensationNames.paycheckTips");
108
- case Ce:
109
+ case Ne:
109
110
  return t("fixedCompensationNames.correctionPayment");
110
- case he:
111
+ case Ce:
111
112
  return t("fixedCompensationNames.commission");
112
- case fe:
113
+ case he:
113
114
  return t("fixedCompensationNames.cashTips");
114
- case pe:
115
+ case fe:
115
116
  return t("fixedCompensationNames.reimbursement");
116
117
  default:
117
118
  return e;
118
119
  }
119
- }, B = {
120
+ }, q = {
120
121
  hourlyCompensations: (() => {
121
122
  const e = {};
122
123
  return T.forEach((n) => {
123
- k.forEach((o) => {
124
- const h = F(n.uuid, o);
124
+ w.forEach((o) => {
125
+ const h = j(n.uuid, o);
125
126
  h && (e[n.uuid] || (e[n.uuid] = {}), e[n.uuid][h.name] = h.hours ? parseFloat(h.hours).toString() : "");
126
127
  });
127
128
  }), e;
128
129
  })(),
129
130
  timeOffCompensations: (() => {
130
131
  const e = {};
131
- return P.forEach((n) => {
132
+ return x.forEach((n) => {
132
133
  e[n.name] = n.hours ? parseFloat(n.hours).toString() : "";
133
134
  }), e;
134
135
  })(),
@@ -138,30 +139,30 @@ const be = m.object({
138
139
  e[n.name] = n.amount ? n.amount : "";
139
140
  }), N && (e[N.name] = N.amount ? N.amount : ""), e;
140
141
  })(),
141
- paymentMethod: s?.paymentMethod || A.DirectDeposit
142
- }, I = W({
143
- resolver: J(be),
144
- defaultValues: B
145
- }), M = Y({
142
+ paymentMethod: s?.paymentMethod || S.DirectDeposit
143
+ }, I = Y({
144
+ resolver: ee(Me),
145
+ defaultValues: q
146
+ }), M = K({
146
147
  control: I.control
147
- }), q = Q(() => {
148
+ }), V = Z(() => {
148
149
  try {
149
150
  const e = {};
150
- M.hourlyCompensations && Object.entries(M.hourlyCompensations).forEach(([h, D]) => {
151
- D && (e[h] = D);
151
+ M.hourlyCompensations && Object.entries(M.hourlyCompensations).forEach(([h, G]) => {
152
+ G && (e[h] = G);
152
153
  });
153
154
  const n = {
154
155
  hourlyCompensations: e,
155
156
  timeOffCompensations: M.timeOffCompensations || {},
156
157
  fixedCompensations: M.fixedCompensations || {},
157
158
  paymentMethod: M.paymentMethod
158
- }, o = w(
159
+ }, o = H(
159
160
  n,
160
161
  s,
161
162
  (s?.paidTimeOff || []).filter((h) => h.name),
162
163
  f?.uuid
163
164
  );
164
- return G(
165
+ return k(
165
166
  o,
166
167
  d,
167
168
  i,
@@ -169,7 +170,7 @@ const be = m.object({
169
170
  C
170
171
  );
171
172
  } catch {
172
- return s ? G(
173
+ return s ? k(
173
174
  s,
174
175
  d,
175
176
  i,
@@ -185,18 +186,18 @@ const be = m.object({
185
186
  i,
186
187
  l,
187
188
  C
188
- ]), V = se({
189
+ ]), z = oe({
189
190
  first_name: d.firstName,
190
191
  last_name: d.lastName
191
- }), z = (e) => {
192
- const n = w(
192
+ }), W = (e) => {
193
+ const n = H(
193
194
  e,
194
195
  s,
195
- P,
196
+ x,
196
197
  f?.uuid
197
198
  );
198
199
  E(n);
199
- }, L = oe(q || 0), U = /* @__PURE__ */ a(
200
+ }, U = ae(V || 0), D = /* @__PURE__ */ a(
200
201
  y,
201
202
  {
202
203
  flexDirection: p ? "row" : "column",
@@ -204,11 +205,11 @@ const be = m.object({
204
205
  alignItems: p ? "flex-start" : "stretch",
205
206
  gap: 12,
206
207
  children: [
207
- /* @__PURE__ */ r(x, { variant: "secondary", onClick: O, title: t("cancelCta"), children: t("cancelCta") }),
208
+ /* @__PURE__ */ r(v, { variant: "secondary", onClick: O, title: t("cancelCta"), children: t("cancelCta") }),
208
209
  /* @__PURE__ */ r(
209
- x,
210
+ v,
210
211
  {
211
- onClick: I.handleSubmit(z),
212
+ onClick: I.handleSubmit(W),
212
213
  title: t("saveCta"),
213
214
  isLoading: g,
214
215
  children: t("saveCta")
@@ -217,31 +218,31 @@ const be = m.object({
217
218
  ]
218
219
  }
219
220
  );
220
- return /* @__PURE__ */ a("div", { ref: v, className: u.container, children: [
221
+ return /* @__PURE__ */ a("div", { ref: F, className: u.container, children: [
221
222
  /* @__PURE__ */ r(
222
223
  "div",
223
224
  {
224
225
  className: `${u.headerSection} ${p ? "" : u.headerSectionSticky}`,
225
226
  children: /* @__PURE__ */ a(y, { justifyContent: "space-between", children: [
226
227
  /* @__PURE__ */ a(y, { flexDirection: "column", gap: p ? 8 : 2, children: [
227
- /* @__PURE__ */ r(c, { as: "h1", styledAs: p ? "h2" : "h4", children: t("pageTitle", { employeeName: V }) }),
228
+ /* @__PURE__ */ r(c, { as: "h1", styledAs: p ? "h2" : "h4", children: t("pageTitle", { employeeName: z }) }),
228
229
  p ? /* @__PURE__ */ a(y, { flexDirection: "column", gap: 6, children: [
229
- /* @__PURE__ */ r(c, { as: "h2", styledAs: "h3", children: L }),
230
- /* @__PURE__ */ r(H, { className: u.grossPayLabel, children: t("grossPayLabel") })
231
- ] }) : /* @__PURE__ */ r(c, { as: "h2", styledAs: "h6", className: u.grossPayLabel, children: t("grossPayLabelMobile", { grossPay: L }) })
230
+ /* @__PURE__ */ r(c, { as: "h2", styledAs: "h3", children: U }),
231
+ /* @__PURE__ */ r($, { className: u.grossPayLabel, children: t("grossPayLabel") })
232
+ ] }) : /* @__PURE__ */ r(c, { as: "h2", styledAs: "h6", className: u.grossPayLabel, children: t("grossPayLabelMobile", { grossPay: U }) })
232
233
  ] }),
233
- p && U
234
+ p && D
234
235
  ] })
235
236
  }
236
237
  ),
237
- /* @__PURE__ */ a(K, { ...I, children: [
238
- /* @__PURE__ */ a(ie, { children: [
238
+ /* @__PURE__ */ a(X, { ...I, children: [
239
+ /* @__PURE__ */ a(se, { children: [
239
240
  T.length > 0 && /* @__PURE__ */ a("div", { className: u.fieldGroup, children: [
240
241
  /* @__PURE__ */ r(c, { as: "h3", children: t("regularHoursTitle") }),
241
242
  T.map((e) => /* @__PURE__ */ a(y, { flexDirection: "column", gap: 8, children: [
242
243
  /* @__PURE__ */ r(c, { as: "h4", children: e.title }),
243
- /* @__PURE__ */ r(S, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: k.map((n) => {
244
- const o = F(
244
+ /* @__PURE__ */ r(P, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: w.map((n) => {
245
+ const o = j(
245
246
  e.uuid,
246
247
  n
247
248
  );
@@ -252,7 +253,7 @@ const be = m.object({
252
253
  type: "number",
253
254
  adornmentEnd: t("hoursUnit"),
254
255
  isRequired: !0,
255
- label: $(n),
256
+ label: B(n),
256
257
  name: `hourlyCompensations.${e.uuid}.${o.name}`
257
258
  },
258
259
  n
@@ -260,10 +261,10 @@ const be = m.object({
260
261
  }) })
261
262
  ] }, e.uuid))
262
263
  ] }),
263
- P.length > 0 && /* @__PURE__ */ a("div", { className: u.fieldGroup, children: [
264
+ x.length > 0 && /* @__PURE__ */ a("div", { className: u.fieldGroup, children: [
264
265
  /* @__PURE__ */ r(c, { as: "h4", children: t("timeOffTitle") }),
265
- /* @__PURE__ */ r(S, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: P.map((e) => /* @__PURE__ */ r(
266
- ee,
266
+ /* @__PURE__ */ r(P, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: x.map((e) => /* @__PURE__ */ r(
267
+ te,
267
268
  {
268
269
  timeOff: e,
269
270
  employee: d
@@ -274,7 +275,7 @@ const be = m.object({
274
275
  _.length > 0 && /* @__PURE__ */ a("div", { className: u.fieldGroup, children: [
275
276
  /* @__PURE__ */ r(c, { as: "h4", children: t("additionalEarningsTitle") }),
276
277
  /* @__PURE__ */ r(
277
- S,
278
+ P,
278
279
  {
279
280
  gridTemplateColumns: { base: "1fr", small: [320, 320], large: [320, 320, 320] },
280
281
  gap: 20,
@@ -284,7 +285,7 @@ const be = m.object({
284
285
  type: "number",
285
286
  adornmentStart: "$",
286
287
  isRequired: !0,
287
- label: j(e.name),
288
+ label: L(e.name),
288
289
  name: `fixedCompensations.${e.name}`
289
290
  },
290
291
  e.name
@@ -294,13 +295,13 @@ const be = m.object({
294
295
  ] }),
295
296
  N && /* @__PURE__ */ a("div", { className: u.fieldGroup, children: [
296
297
  /* @__PURE__ */ r(c, { as: "h4", children: t("reimbursementTitle") }),
297
- /* @__PURE__ */ r(S, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: /* @__PURE__ */ r(
298
+ /* @__PURE__ */ r(P, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: /* @__PURE__ */ r(
298
299
  R,
299
300
  {
300
301
  type: "number",
301
302
  adornmentStart: "$",
302
303
  isRequired: !0,
303
- label: j(N.name),
304
+ label: L(N.name),
304
305
  name: `fixedCompensations.${N.name}`
305
306
  }
306
307
  ) })
@@ -308,7 +309,7 @@ const be = m.object({
308
309
  /* @__PURE__ */ a("div", { className: u.fieldGroup, children: [
309
310
  /* @__PURE__ */ r(c, { as: "h4", children: t("paymentMethodTitle") }),
310
311
  /* @__PURE__ */ r(
311
- te,
312
+ ne,
312
313
  {
313
314
  name: "paymentMethod",
314
315
  isRequired: !0,
@@ -316,11 +317,11 @@ const be = m.object({
316
317
  description: t("paymentMethodDescription"),
317
318
  options: [
318
319
  {
319
- value: A.DirectDeposit,
320
+ value: S.DirectDeposit,
320
321
  label: t("paymentMethodOptions.directDeposit")
321
322
  },
322
323
  {
323
- value: A.Check,
324
+ value: S.Check,
324
325
  label: t("paymentMethodOptions.check")
325
326
  }
326
327
  ]
@@ -328,12 +329,12 @@ const be = m.object({
328
329
  )
329
330
  ] })
330
331
  ] }),
331
- !p && U
332
+ !p && D
332
333
  ] })
333
334
  ] });
334
335
  };
335
336
  export {
336
- be as PayrollEditEmployeeFormSchema,
337
- Be as PayrollEditEmployeePresentation
337
+ Me as PayrollEditEmployeeFormSchema,
338
+ qe as PayrollEditEmployeePresentation
338
339
  };
339
340
  //# sourceMappingURL=PayrollEditEmployeePresentation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PayrollEditEmployeePresentation.js","sources":["../../../../src/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.tsx"],"sourcesContent":["import { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useMemo, useRef } from 'react'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type {\n FixedCompensations,\n PayrollEmployeeCompensationsType,\n} from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport { PayrollEmployeeCompensationsTypePaymentMethod } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollFixedCompensationTypesType } from '@gusto/embedded-api/models/components/payrollfixedcompensationtypestype'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport styles from './PayrollEditEmployeePresentation.module.scss'\nimport { TimeOffField } from './TimeOffField'\nimport { Flex, Grid, TextInputField, RadioGroupField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { Form } from '@/components/Common/Form'\nimport { formatNumberAsCurrency, firstLastName } from '@/helpers/formattedStrings'\nimport {\n getAdditionalEarningsCompensations,\n getReimbursementCompensation,\n calculateGrossPay,\n} from '@/components/Payroll/helpers'\nimport {\n COMPENSATION_NAME_DOUBLE_OVERTIME,\n COMPENSATION_NAME_OVERTIME,\n COMPENSATION_NAME_REGULAR_HOURS,\n HOURS_COMPENSATION_NAMES,\n EXCLUDED_ADDITIONAL_EARNINGS,\n COMPENSATION_NAME_REIMBURSEMENT,\n COMPENSATION_NAME_BONUS,\n COMPENSATION_NAME_PAYCHECK_TIPS,\n COMPENSATION_NAME_CORRECTION_PAYMENT,\n COMPENSATION_NAME_COMMISSION,\n COMPENSATION_NAME_CASH_TIPS,\n} from '@/shared/constants'\nimport useContainerBreakpoints from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\n\ninterface PayrollEditEmployeeProps {\n onSave: (updatedCompensation: PayrollEmployeeCompensationsType) => void\n onCancel: () => void\n employee: Employee\n employeeCompensation?: PayrollEmployeeCompensationsType\n isPending?: boolean\n fixedCompensationTypes: PayrollFixedCompensationTypesType[]\n payPeriodStartDate?: string\n paySchedule?: PayScheduleObject\n isOffCycle?: boolean\n}\n\nexport const PayrollEditEmployeeFormSchema = z.object({\n hourlyCompensations: z.record(z.string(), z.record(z.string(), z.string().optional())),\n timeOffCompensations: z.record(z.string(), z.string().optional()),\n fixedCompensations: z.record(z.string(), z.string().optional()),\n paymentMethod: z.nativeEnum(PayrollEmployeeCompensationsTypePaymentMethod).optional(),\n})\n\nexport type PayrollEditEmployeeFormValues = z.infer<typeof PayrollEditEmployeeFormSchema>\n\nconst buildCompensationFromFormData = (\n formData: PayrollEditEmployeeFormValues,\n employeeCompensation: PayrollEmployeeCompensationsType | undefined,\n timeOff: Array<{ name?: string; hours?: string }>,\n primaryJobUuid?: string,\n): PayrollEmployeeCompensationsType => {\n const updatedCompensation = {\n ...employeeCompensation,\n paymentMethod: formData.paymentMethod,\n }\n\n updatedCompensation.hourlyCompensations = employeeCompensation?.hourlyCompensations?.map(\n compensation => {\n const hours =\n compensation.jobUuid && compensation.name\n ? formData.hourlyCompensations[compensation.jobUuid]?.[compensation.name]\n : undefined\n return hours\n ? {\n ...compensation,\n hours,\n }\n : compensation\n },\n )\n\n updatedCompensation.paidTimeOff = timeOff.map(timeOffEntry => {\n return {\n ...timeOffEntry,\n hours: formData.timeOffCompensations[timeOffEntry.name!],\n }\n })\n\n const updatedFixedCompensations: FixedCompensations[] = []\n\n Object.entries(formData.fixedCompensations).forEach(([fixedCompensationName, formAmount]) => {\n const existingFixedCompensation = employeeCompensation?.fixedCompensations?.find(\n fixedCompensation =>\n fixedCompensation.name?.toLowerCase() === fixedCompensationName.toLowerCase(),\n )\n\n if (formAmount) {\n if (existingFixedCompensation) {\n updatedFixedCompensations.push({\n name: existingFixedCompensation.name,\n jobUuid: existingFixedCompensation.jobUuid,\n amount: formAmount,\n })\n } else if (parseFloat(formAmount) !== 0) {\n updatedFixedCompensations.push({\n name: fixedCompensationName,\n jobUuid: primaryJobUuid,\n amount: formAmount,\n })\n }\n }\n })\n\n updatedCompensation.fixedCompensations = updatedFixedCompensations\n\n return updatedCompensation\n}\n\nexport const PayrollEditEmployeePresentation = ({\n onSave,\n onCancel,\n employee,\n employeeCompensation,\n isPending = false,\n fixedCompensationTypes,\n payPeriodStartDate,\n paySchedule,\n isOffCycle = false,\n}: PayrollEditEmployeeProps) => {\n const { Button, Heading, Text } = useComponentContext()\n\n const { t } = useTranslation('Payroll.PayrollEditEmployee')\n useI18n('Payroll.PayrollEditEmployee')\n\n const primaryJob = employee.jobs?.find(job => job.primary)\n const hourlyJobs = primaryJob ? [primaryJob] : []\n\n const containerRef = useRef<HTMLDivElement>(null)\n const breakpoints = useContainerBreakpoints({\n ref: containerRef,\n })\n const isSmallOrGreater = breakpoints.includes('small')\n\n employeeCompensation?.hourlyCompensations?.forEach(compensation => {\n const job = employee.jobs?.find(job => job.uuid === compensation.jobUuid)\n if (job && !hourlyJobs.find(hourlyJob => hourlyJob.uuid === job.uuid)) {\n hourlyJobs.push(job)\n }\n })\n\n const timeOff = (employeeCompensation?.paidTimeOff || []).filter(entry => entry.name)\n\n const additionalEarnings = getAdditionalEarningsCompensations({\n flsaStatus: primaryJob?.compensations?.[0]?.flsaStatus,\n existingFixedCompensations: employeeCompensation?.fixedCompensations || [],\n primaryJobUuid: primaryJob?.uuid,\n fixedCompensationTypes,\n excludedTypes: EXCLUDED_ADDITIONAL_EARNINGS,\n })\n\n const reimbursement = getReimbursementCompensation(\n employeeCompensation?.fixedCompensations || [],\n fixedCompensationTypes,\n primaryJob?.uuid,\n )\n\n const findMatchingCompensation = (jobUuid: string, compensationName: string) => {\n return employeeCompensation?.hourlyCompensations?.find(\n compensation =>\n compensation.jobUuid === jobUuid &&\n compensation.name?.toLowerCase() === compensationName.toLowerCase(),\n )\n }\n\n const getCompensationLabel = (compensationName?: string) => {\n switch (compensationName) {\n case COMPENSATION_NAME_REGULAR_HOURS:\n return t('compensationNames.regularHours')\n case COMPENSATION_NAME_OVERTIME:\n return t('compensationNames.overtime')\n case COMPENSATION_NAME_DOUBLE_OVERTIME:\n return t('compensationNames.doubleOvertime')\n default:\n return compensationName\n }\n }\n\n const getFixedCompensationLabel = (compensationName?: string) => {\n switch (compensationName) {\n case COMPENSATION_NAME_BONUS:\n return t('fixedCompensationNames.bonus')\n case COMPENSATION_NAME_PAYCHECK_TIPS:\n return t('fixedCompensationNames.paycheckTips')\n case COMPENSATION_NAME_CORRECTION_PAYMENT:\n return t('fixedCompensationNames.correctionPayment')\n case COMPENSATION_NAME_COMMISSION:\n return t('fixedCompensationNames.commission')\n case COMPENSATION_NAME_CASH_TIPS:\n return t('fixedCompensationNames.cashTips')\n case COMPENSATION_NAME_REIMBURSEMENT:\n return t('fixedCompensationNames.reimbursement')\n default:\n return compensationName\n }\n }\n\n const defaultValues = {\n hourlyCompensations: (() => {\n const hourlyCompensations: PayrollEditEmployeeFormValues['hourlyCompensations'] = {}\n\n hourlyJobs.forEach(hourlyJob => {\n HOURS_COMPENSATION_NAMES.forEach(compensationName => {\n const matchingCompensation = findMatchingCompensation(hourlyJob.uuid, compensationName)\n if (matchingCompensation) {\n if (!hourlyCompensations[hourlyJob.uuid]) {\n hourlyCompensations[hourlyJob.uuid] = {}\n }\n hourlyCompensations[hourlyJob.uuid]![matchingCompensation.name!] =\n matchingCompensation.hours ? parseFloat(matchingCompensation.hours).toString() : ''\n }\n })\n })\n\n return hourlyCompensations\n })(),\n\n timeOffCompensations: (() => {\n const timeOffCompensations: PayrollEditEmployeeFormValues['timeOffCompensations'] = {}\n\n timeOff.forEach(timeOffCompensation => {\n timeOffCompensations[timeOffCompensation.name!] = timeOffCompensation.hours\n ? parseFloat(timeOffCompensation.hours).toString()\n : ''\n })\n\n return timeOffCompensations\n })(),\n\n fixedCompensations: (() => {\n const fixedCompensations: PayrollEditEmployeeFormValues['fixedCompensations'] = {}\n\n additionalEarnings.forEach(fixedComp => {\n fixedCompensations[fixedComp.name!] = fixedComp.amount ? fixedComp.amount : ''\n })\n\n if (reimbursement) {\n fixedCompensations[reimbursement.name!] = reimbursement.amount ? reimbursement.amount : ''\n }\n\n return fixedCompensations\n })(),\n\n paymentMethod:\n employeeCompensation?.paymentMethod ||\n PayrollEmployeeCompensationsTypePaymentMethod.DirectDeposit,\n }\n\n const formHandlers = useForm<PayrollEditEmployeeFormValues>({\n resolver: zodResolver(PayrollEditEmployeeFormSchema),\n defaultValues,\n })\n\n const watchedFormData = useWatch({\n control: formHandlers.control,\n })\n\n const currentGrossPay = useMemo(() => {\n try {\n // Build form data, filtering out undefined nested objects\n const hourlyCompensations: Record<string, Record<string, string | undefined>> = {}\n if (watchedFormData.hourlyCompensations) {\n Object.entries(watchedFormData.hourlyCompensations).forEach(([jobId, compensations]) => {\n if (compensations) {\n hourlyCompensations[jobId] = compensations\n }\n })\n }\n\n const formDataWithDefaults: PayrollEditEmployeeFormValues = {\n hourlyCompensations,\n timeOffCompensations: watchedFormData.timeOffCompensations || {},\n fixedCompensations: watchedFormData.fixedCompensations || {},\n paymentMethod: watchedFormData.paymentMethod,\n }\n\n const updatedCompensation = buildCompensationFromFormData(\n formDataWithDefaults,\n employeeCompensation,\n (employeeCompensation?.paidTimeOff || []).filter(entry => entry.name),\n primaryJob?.uuid,\n )\n\n return calculateGrossPay(\n updatedCompensation,\n employee,\n payPeriodStartDate,\n paySchedule,\n isOffCycle,\n )\n } catch {\n // Fallback to original compensation on error\n return employeeCompensation\n ? calculateGrossPay(\n employeeCompensation,\n employee,\n payPeriodStartDate,\n paySchedule,\n isOffCycle,\n )\n : 0\n }\n }, [\n watchedFormData,\n employeeCompensation,\n primaryJob?.uuid,\n employee,\n payPeriodStartDate,\n paySchedule,\n isOffCycle,\n ])\n\n const employeeName = firstLastName({\n first_name: employee.firstName,\n last_name: employee.lastName,\n })\n\n const onSubmit = (data: PayrollEditEmployeeFormValues) => {\n const updatedCompensation = buildCompensationFromFormData(\n data,\n employeeCompensation,\n timeOff,\n primaryJob?.uuid,\n )\n onSave(updatedCompensation)\n }\n\n const formattedCurrentGrossPay = formatNumberAsCurrency(currentGrossPay || 0)\n\n const actions = (\n <Flex\n flexDirection={isSmallOrGreater ? 'row' : 'column'}\n justifyContent={isSmallOrGreater ? 'flex-end' : 'normal'}\n alignItems={isSmallOrGreater ? 'flex-start' : 'stretch'}\n gap={12}\n >\n <Button variant=\"secondary\" onClick={onCancel} title={t('cancelCta')}>\n {t('cancelCta')}\n </Button>\n <Button\n onClick={formHandlers.handleSubmit(onSubmit)}\n title={t('saveCta')}\n isLoading={isPending}\n >\n {t('saveCta')}\n </Button>\n </Flex>\n )\n\n return (\n <div ref={containerRef} className={styles.container}>\n <div\n className={`${styles.headerSection} ${!isSmallOrGreater ? styles.headerSectionSticky : ''}`}\n >\n <Flex justifyContent=\"space-between\">\n <Flex flexDirection=\"column\" gap={isSmallOrGreater ? 8 : 2}>\n <Heading as=\"h1\" styledAs={isSmallOrGreater ? 'h2' : 'h4'}>\n {t('pageTitle', { employeeName })}\n </Heading>\n {isSmallOrGreater ? (\n <Flex flexDirection=\"column\" gap={6}>\n <Heading as=\"h2\" styledAs=\"h3\">\n {formattedCurrentGrossPay}\n </Heading>\n <Text className={styles.grossPayLabel}>{t('grossPayLabel')}</Text>\n </Flex>\n ) : (\n <Heading as=\"h2\" styledAs=\"h6\" className={styles.grossPayLabel}>\n {t('grossPayLabelMobile', { grossPay: formattedCurrentGrossPay })}\n </Heading>\n )}\n </Flex>\n {isSmallOrGreater && actions}\n </Flex>\n </div>\n <FormProvider {...formHandlers}>\n <Form>\n {hourlyJobs.length > 0 && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h3\">{t('regularHoursTitle')}</Heading>\n {hourlyJobs.map(hourlyJob => (\n <Flex key={hourlyJob.uuid} flexDirection=\"column\" gap={8}>\n <Heading as=\"h4\">{hourlyJob.title}</Heading>\n <Grid gridTemplateColumns={{ base: '1fr', small: [320, 320] }} gap={20}>\n {HOURS_COMPENSATION_NAMES.map(compensationName => {\n const employeeHourlyCompensation = findMatchingCompensation(\n hourlyJob.uuid,\n compensationName,\n )\n if (employeeHourlyCompensation) {\n return (\n <TextInputField\n key={compensationName}\n type=\"number\"\n adornmentEnd={t('hoursUnit')}\n isRequired\n label={getCompensationLabel(compensationName)}\n name={`hourlyCompensations.${hourlyJob.uuid}.${employeeHourlyCompensation.name}`}\n />\n )\n }\n })}\n </Grid>\n </Flex>\n ))}\n </div>\n )}\n {timeOff.length > 0 && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h4\">{t('timeOffTitle')}</Heading>\n <Grid gridTemplateColumns={{ base: '1fr', small: [320, 320] }} gap={20}>\n {timeOff.map(timeOffEntry => (\n <TimeOffField\n key={timeOffEntry.name}\n timeOff={timeOffEntry}\n employee={employee}\n />\n ))}\n </Grid>\n </div>\n )}\n {additionalEarnings.length > 0 && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h4\">{t('additionalEarningsTitle')}</Heading>\n <Grid\n gridTemplateColumns={{ base: '1fr', small: [320, 320], large: [320, 320, 320] }}\n gap={20}\n >\n {additionalEarnings.map(fixedCompensation => (\n <TextInputField\n key={fixedCompensation.name}\n type=\"number\"\n adornmentStart=\"$\"\n isRequired\n label={getFixedCompensationLabel(fixedCompensation.name)}\n name={`fixedCompensations.${fixedCompensation.name}`}\n />\n ))}\n </Grid>\n </div>\n )}\n {reimbursement && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h4\">{t('reimbursementTitle')}</Heading>\n <Grid gridTemplateColumns={{ base: '1fr', small: [320, 320] }} gap={20}>\n <TextInputField\n type=\"number\"\n adornmentStart=\"$\"\n isRequired\n label={getFixedCompensationLabel(reimbursement.name)}\n name={`fixedCompensations.${reimbursement.name}`}\n />\n </Grid>\n </div>\n )}\n <div className={styles.fieldGroup}>\n <Heading as=\"h4\">{t('paymentMethodTitle')}</Heading>\n <RadioGroupField\n name=\"paymentMethod\"\n isRequired\n label={t('paymentMethodLabel')}\n description={t('paymentMethodDescription')}\n options={[\n {\n value: PayrollEmployeeCompensationsTypePaymentMethod.DirectDeposit,\n label: t('paymentMethodOptions.directDeposit'),\n },\n {\n value: PayrollEmployeeCompensationsTypePaymentMethod.Check,\n label: t('paymentMethodOptions.check'),\n },\n ]}\n />\n </div>\n </Form>\n {!isSmallOrGreater && actions}\n </FormProvider>\n </div>\n )\n}\n"],"names":["PayrollEditEmployeeFormSchema","z","PayrollEmployeeCompensationsTypePaymentMethod","buildCompensationFromFormData","formData","employeeCompensation","timeOff","primaryJobUuid","updatedCompensation","compensation","hours","timeOffEntry","updatedFixedCompensations","fixedCompensationName","formAmount","existingFixedCompensation","fixedCompensation","PayrollEditEmployeePresentation","onSave","onCancel","employee","isPending","fixedCompensationTypes","payPeriodStartDate","paySchedule","isOffCycle","Button","Heading","Text","useComponentContext","useTranslation","useI18n","primaryJob","job","hourlyJobs","containerRef","useRef","isSmallOrGreater","useContainerBreakpoints","hourlyJob","entry","additionalEarnings","getAdditionalEarningsCompensations","EXCLUDED_ADDITIONAL_EARNINGS","reimbursement","getReimbursementCompensation","findMatchingCompensation","jobUuid","compensationName","getCompensationLabel","COMPENSATION_NAME_REGULAR_HOURS","COMPENSATION_NAME_OVERTIME","COMPENSATION_NAME_DOUBLE_OVERTIME","getFixedCompensationLabel","COMPENSATION_NAME_BONUS","COMPENSATION_NAME_PAYCHECK_TIPS","COMPENSATION_NAME_CORRECTION_PAYMENT","COMPENSATION_NAME_COMMISSION","COMPENSATION_NAME_CASH_TIPS","COMPENSATION_NAME_REIMBURSEMENT","defaultValues","hourlyCompensations","HOURS_COMPENSATION_NAMES","matchingCompensation","timeOffCompensations","timeOffCompensation","fixedCompensations","fixedComp","formHandlers","useForm","zodResolver","watchedFormData","useWatch","currentGrossPay","useMemo","jobId","compensations","formDataWithDefaults","calculateGrossPay","employeeName","firstLastName","onSubmit","data","formattedCurrentGrossPay","formatNumberAsCurrency","actions","jsxs","Flex","jsx","styles","FormProvider","Form","Grid","employeeHourlyCompensation","TextInputField","TimeOffField","RadioGroupField"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoDO,MAAMA,KAAgCC,EAAE,OAAO;AAAA,EACpD,qBAAqBA,EAAE,OAAOA,EAAE,OAAA,GAAUA,EAAE,OAAOA,EAAE,OAAA,GAAUA,EAAE,OAAA,EAAS,SAAA,CAAU,CAAC;AAAA,EACrF,sBAAsBA,EAAE,OAAOA,EAAE,OAAA,GAAUA,EAAE,SAAS,UAAU;AAAA,EAChE,oBAAoBA,EAAE,OAAOA,EAAE,OAAA,GAAUA,EAAE,SAAS,UAA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;AAAA,gBAAA;AAAA,gBAE/C;AAAA,kBACE,OAAOA,EAA8C;AAAA,kBACrD,OAAO,EAAE,4BAA4B;AAAA,gBAAA;AAAA,cACvC;AAAA,YACF;AAAA,UAAA;AAAA,QACF,EAAA,CACF;AAAA,MAAA,GACF;AAAA,MACC,CAACmC,KAAoBgD;AAAA,IAAA,EAAA,CACxB;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"PayrollEditEmployeePresentation.js","sources":["../../../../src/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.tsx"],"sourcesContent":["import { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useMemo, useRef } from 'react'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type {\n FixedCompensations,\n PayrollEmployeeCompensationsType,\n} from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport { PayrollEmployeeCompensationsTypePaymentMethod } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollFixedCompensationTypesType } from '@gusto/embedded-api/models/components/payrollfixedcompensationtypestype'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport styles from './PayrollEditEmployeePresentation.module.scss'\nimport { TimeOffField } from './TimeOffField'\nimport { Flex, Grid, TextInputField, RadioGroupField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { Form } from '@/components/Common/Form'\nimport { formatNumberAsCurrency, firstLastName } from '@/helpers/formattedStrings'\nimport {\n getAdditionalEarningsCompensations,\n getReimbursementCompensation,\n calculateGrossPay,\n} from '@/components/Payroll/helpers'\nimport {\n COMPENSATION_NAME_DOUBLE_OVERTIME,\n COMPENSATION_NAME_OVERTIME,\n COMPENSATION_NAME_REGULAR_HOURS,\n HOURS_COMPENSATION_NAMES,\n EXCLUDED_ADDITIONAL_EARNINGS,\n COMPENSATION_NAME_REIMBURSEMENT,\n COMPENSATION_NAME_BONUS,\n COMPENSATION_NAME_PAYCHECK_TIPS,\n COMPENSATION_NAME_CORRECTION_PAYMENT,\n COMPENSATION_NAME_COMMISSION,\n COMPENSATION_NAME_CASH_TIPS,\n} from '@/shared/constants'\nimport useContainerBreakpoints from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\n\ninterface PayrollEditEmployeeProps {\n onSave: (updatedCompensation: PayrollEmployeeCompensationsType) => void\n onCancel: () => void\n employee: Employee\n employeeCompensation?: PayrollEmployeeCompensationsType\n isPending?: boolean\n fixedCompensationTypes: PayrollFixedCompensationTypesType[]\n payPeriodStartDate?: string\n paySchedule?: PayScheduleObject\n isOffCycle?: boolean\n withReimbursements?: boolean\n}\n\nexport const PayrollEditEmployeeFormSchema = z.object({\n hourlyCompensations: z.record(z.string(), z.record(z.string(), z.string().optional())),\n timeOffCompensations: z.record(z.string(), z.string().optional()),\n fixedCompensations: z.record(z.string(), z.string().optional()),\n paymentMethod: z.nativeEnum(PayrollEmployeeCompensationsTypePaymentMethod).optional(),\n})\n\nexport type PayrollEditEmployeeFormValues = z.infer<typeof PayrollEditEmployeeFormSchema>\n\nconst buildCompensationFromFormData = (\n formData: PayrollEditEmployeeFormValues,\n employeeCompensation: PayrollEmployeeCompensationsType | undefined,\n timeOff: Array<{ name?: string; hours?: string }>,\n primaryJobUuid?: string,\n): PayrollEmployeeCompensationsType => {\n const updatedCompensation = {\n ...employeeCompensation,\n paymentMethod: formData.paymentMethod,\n }\n\n updatedCompensation.hourlyCompensations = employeeCompensation?.hourlyCompensations?.map(\n compensation => {\n const hours =\n compensation.jobUuid && compensation.name\n ? formData.hourlyCompensations[compensation.jobUuid]?.[compensation.name]\n : undefined\n return hours\n ? {\n ...compensation,\n hours,\n }\n : compensation\n },\n )\n\n updatedCompensation.paidTimeOff = timeOff.map(timeOffEntry => {\n return {\n ...timeOffEntry,\n hours: formData.timeOffCompensations[timeOffEntry.name!],\n }\n })\n\n const updatedFixedCompensations: FixedCompensations[] = []\n\n Object.entries(formData.fixedCompensations).forEach(([fixedCompensationName, formAmount]) => {\n const existingFixedCompensation = employeeCompensation?.fixedCompensations?.find(\n fixedCompensation =>\n fixedCompensation.name?.toLowerCase() === fixedCompensationName.toLowerCase(),\n )\n\n if (formAmount) {\n if (existingFixedCompensation) {\n updatedFixedCompensations.push({\n name: existingFixedCompensation.name,\n jobUuid: existingFixedCompensation.jobUuid,\n amount: formAmount,\n })\n } else if (parseFloat(formAmount) !== 0) {\n updatedFixedCompensations.push({\n name: fixedCompensationName,\n jobUuid: primaryJobUuid,\n amount: formAmount,\n })\n }\n }\n })\n\n updatedCompensation.fixedCompensations = updatedFixedCompensations\n\n return updatedCompensation\n}\n\nexport const PayrollEditEmployeePresentation = ({\n onSave,\n onCancel,\n employee,\n employeeCompensation,\n isPending = false,\n fixedCompensationTypes,\n payPeriodStartDate,\n paySchedule,\n isOffCycle = false,\n withReimbursements = true,\n}: PayrollEditEmployeeProps) => {\n const { Button, Heading, Text } = useComponentContext()\n\n const { t } = useTranslation('Payroll.PayrollEditEmployee')\n useI18n('Payroll.PayrollEditEmployee')\n\n const primaryJob = employee.jobs?.find(job => job.primary)\n const hourlyJobs = primaryJob ? [primaryJob] : []\n\n const containerRef = useRef<HTMLDivElement>(null)\n const breakpoints = useContainerBreakpoints({\n ref: containerRef,\n })\n const isSmallOrGreater = breakpoints.includes('small')\n\n employeeCompensation?.hourlyCompensations?.forEach(compensation => {\n const job = employee.jobs?.find(job => job.uuid === compensation.jobUuid)\n if (job && !hourlyJobs.find(hourlyJob => hourlyJob.uuid === job.uuid)) {\n hourlyJobs.push(job)\n }\n })\n\n const timeOff = (employeeCompensation?.paidTimeOff || []).filter(entry => entry.name)\n\n const additionalEarnings = getAdditionalEarningsCompensations({\n flsaStatus: primaryJob?.compensations?.[0]?.flsaStatus,\n existingFixedCompensations: employeeCompensation?.fixedCompensations || [],\n primaryJobUuid: primaryJob?.uuid,\n fixedCompensationTypes,\n excludedTypes: EXCLUDED_ADDITIONAL_EARNINGS,\n })\n\n const reimbursement = withReimbursements\n ? getReimbursementCompensation(\n employeeCompensation?.fixedCompensations || [],\n fixedCompensationTypes,\n primaryJob?.uuid,\n )\n : null\n\n const findMatchingCompensation = (jobUuid: string, compensationName: string) => {\n return employeeCompensation?.hourlyCompensations?.find(\n compensation =>\n compensation.jobUuid === jobUuid &&\n compensation.name?.toLowerCase() === compensationName.toLowerCase(),\n )\n }\n\n const getCompensationLabel = (compensationName?: string) => {\n switch (compensationName) {\n case COMPENSATION_NAME_REGULAR_HOURS:\n return t('compensationNames.regularHours')\n case COMPENSATION_NAME_OVERTIME:\n return t('compensationNames.overtime')\n case COMPENSATION_NAME_DOUBLE_OVERTIME:\n return t('compensationNames.doubleOvertime')\n default:\n return compensationName\n }\n }\n\n const getFixedCompensationLabel = (compensationName?: string) => {\n switch (compensationName) {\n case COMPENSATION_NAME_BONUS:\n return t('fixedCompensationNames.bonus')\n case COMPENSATION_NAME_PAYCHECK_TIPS:\n return t('fixedCompensationNames.paycheckTips')\n case COMPENSATION_NAME_CORRECTION_PAYMENT:\n return t('fixedCompensationNames.correctionPayment')\n case COMPENSATION_NAME_COMMISSION:\n return t('fixedCompensationNames.commission')\n case COMPENSATION_NAME_CASH_TIPS:\n return t('fixedCompensationNames.cashTips')\n case COMPENSATION_NAME_REIMBURSEMENT:\n return t('fixedCompensationNames.reimbursement')\n default:\n return compensationName\n }\n }\n\n const defaultValues = {\n hourlyCompensations: (() => {\n const hourlyCompensations: PayrollEditEmployeeFormValues['hourlyCompensations'] = {}\n\n hourlyJobs.forEach(hourlyJob => {\n HOURS_COMPENSATION_NAMES.forEach(compensationName => {\n const matchingCompensation = findMatchingCompensation(hourlyJob.uuid, compensationName)\n if (matchingCompensation) {\n if (!hourlyCompensations[hourlyJob.uuid]) {\n hourlyCompensations[hourlyJob.uuid] = {}\n }\n hourlyCompensations[hourlyJob.uuid]![matchingCompensation.name!] =\n matchingCompensation.hours ? parseFloat(matchingCompensation.hours).toString() : ''\n }\n })\n })\n\n return hourlyCompensations\n })(),\n\n timeOffCompensations: (() => {\n const timeOffCompensations: PayrollEditEmployeeFormValues['timeOffCompensations'] = {}\n\n timeOff.forEach(timeOffCompensation => {\n timeOffCompensations[timeOffCompensation.name!] = timeOffCompensation.hours\n ? parseFloat(timeOffCompensation.hours).toString()\n : ''\n })\n\n return timeOffCompensations\n })(),\n\n fixedCompensations: (() => {\n const fixedCompensations: PayrollEditEmployeeFormValues['fixedCompensations'] = {}\n\n additionalEarnings.forEach(fixedComp => {\n fixedCompensations[fixedComp.name!] = fixedComp.amount ? fixedComp.amount : ''\n })\n\n if (reimbursement) {\n fixedCompensations[reimbursement.name!] = reimbursement.amount ? reimbursement.amount : ''\n }\n\n return fixedCompensations\n })(),\n\n paymentMethod:\n employeeCompensation?.paymentMethod ||\n PayrollEmployeeCompensationsTypePaymentMethod.DirectDeposit,\n }\n\n const formHandlers = useForm<PayrollEditEmployeeFormValues>({\n resolver: zodResolver(PayrollEditEmployeeFormSchema),\n defaultValues,\n })\n\n const watchedFormData = useWatch({\n control: formHandlers.control,\n })\n\n const currentGrossPay = useMemo(() => {\n try {\n // Build form data, filtering out undefined nested objects\n const hourlyCompensations: Record<string, Record<string, string | undefined>> = {}\n if (watchedFormData.hourlyCompensations) {\n Object.entries(watchedFormData.hourlyCompensations).forEach(([jobId, compensations]) => {\n if (compensations) {\n hourlyCompensations[jobId] = compensations\n }\n })\n }\n\n const formDataWithDefaults: PayrollEditEmployeeFormValues = {\n hourlyCompensations,\n timeOffCompensations: watchedFormData.timeOffCompensations || {},\n fixedCompensations: watchedFormData.fixedCompensations || {},\n paymentMethod: watchedFormData.paymentMethod,\n }\n\n const updatedCompensation = buildCompensationFromFormData(\n formDataWithDefaults,\n employeeCompensation,\n (employeeCompensation?.paidTimeOff || []).filter(entry => entry.name),\n primaryJob?.uuid,\n )\n\n return calculateGrossPay(\n updatedCompensation,\n employee,\n payPeriodStartDate,\n paySchedule,\n isOffCycle,\n )\n } catch {\n // Fallback to original compensation on error\n return employeeCompensation\n ? calculateGrossPay(\n employeeCompensation,\n employee,\n payPeriodStartDate,\n paySchedule,\n isOffCycle,\n )\n : 0\n }\n }, [\n watchedFormData,\n employeeCompensation,\n primaryJob?.uuid,\n employee,\n payPeriodStartDate,\n paySchedule,\n isOffCycle,\n ])\n\n const employeeName = firstLastName({\n first_name: employee.firstName,\n last_name: employee.lastName,\n })\n\n const onSubmit = (data: PayrollEditEmployeeFormValues) => {\n const updatedCompensation = buildCompensationFromFormData(\n data,\n employeeCompensation,\n timeOff,\n primaryJob?.uuid,\n )\n onSave(updatedCompensation)\n }\n\n const formattedCurrentGrossPay = formatNumberAsCurrency(currentGrossPay || 0)\n\n const actions = (\n <Flex\n flexDirection={isSmallOrGreater ? 'row' : 'column'}\n justifyContent={isSmallOrGreater ? 'flex-end' : 'normal'}\n alignItems={isSmallOrGreater ? 'flex-start' : 'stretch'}\n gap={12}\n >\n <Button variant=\"secondary\" onClick={onCancel} title={t('cancelCta')}>\n {t('cancelCta')}\n </Button>\n <Button\n onClick={formHandlers.handleSubmit(onSubmit)}\n title={t('saveCta')}\n isLoading={isPending}\n >\n {t('saveCta')}\n </Button>\n </Flex>\n )\n\n return (\n <div ref={containerRef} className={styles.container}>\n <div\n className={`${styles.headerSection} ${!isSmallOrGreater ? styles.headerSectionSticky : ''}`}\n >\n <Flex justifyContent=\"space-between\">\n <Flex flexDirection=\"column\" gap={isSmallOrGreater ? 8 : 2}>\n <Heading as=\"h1\" styledAs={isSmallOrGreater ? 'h2' : 'h4'}>\n {t('pageTitle', { employeeName })}\n </Heading>\n {isSmallOrGreater ? (\n <Flex flexDirection=\"column\" gap={6}>\n <Heading as=\"h2\" styledAs=\"h3\">\n {formattedCurrentGrossPay}\n </Heading>\n <Text className={styles.grossPayLabel}>{t('grossPayLabel')}</Text>\n </Flex>\n ) : (\n <Heading as=\"h2\" styledAs=\"h6\" className={styles.grossPayLabel}>\n {t('grossPayLabelMobile', { grossPay: formattedCurrentGrossPay })}\n </Heading>\n )}\n </Flex>\n {isSmallOrGreater && actions}\n </Flex>\n </div>\n <FormProvider {...formHandlers}>\n <Form>\n {hourlyJobs.length > 0 && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h3\">{t('regularHoursTitle')}</Heading>\n {hourlyJobs.map(hourlyJob => (\n <Flex key={hourlyJob.uuid} flexDirection=\"column\" gap={8}>\n <Heading as=\"h4\">{hourlyJob.title}</Heading>\n <Grid gridTemplateColumns={{ base: '1fr', small: [320, 320] }} gap={20}>\n {HOURS_COMPENSATION_NAMES.map(compensationName => {\n const employeeHourlyCompensation = findMatchingCompensation(\n hourlyJob.uuid,\n compensationName,\n )\n if (employeeHourlyCompensation) {\n return (\n <TextInputField\n key={compensationName}\n type=\"number\"\n adornmentEnd={t('hoursUnit')}\n isRequired\n label={getCompensationLabel(compensationName)}\n name={`hourlyCompensations.${hourlyJob.uuid}.${employeeHourlyCompensation.name}`}\n />\n )\n }\n })}\n </Grid>\n </Flex>\n ))}\n </div>\n )}\n {timeOff.length > 0 && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h4\">{t('timeOffTitle')}</Heading>\n <Grid gridTemplateColumns={{ base: '1fr', small: [320, 320] }} gap={20}>\n {timeOff.map(timeOffEntry => (\n <TimeOffField\n key={timeOffEntry.name}\n timeOff={timeOffEntry}\n employee={employee}\n />\n ))}\n </Grid>\n </div>\n )}\n {additionalEarnings.length > 0 && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h4\">{t('additionalEarningsTitle')}</Heading>\n <Grid\n gridTemplateColumns={{ base: '1fr', small: [320, 320], large: [320, 320, 320] }}\n gap={20}\n >\n {additionalEarnings.map(fixedCompensation => (\n <TextInputField\n key={fixedCompensation.name}\n type=\"number\"\n adornmentStart=\"$\"\n isRequired\n label={getFixedCompensationLabel(fixedCompensation.name)}\n name={`fixedCompensations.${fixedCompensation.name}`}\n />\n ))}\n </Grid>\n </div>\n )}\n {reimbursement && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h4\">{t('reimbursementTitle')}</Heading>\n <Grid gridTemplateColumns={{ base: '1fr', small: [320, 320] }} gap={20}>\n <TextInputField\n type=\"number\"\n adornmentStart=\"$\"\n isRequired\n label={getFixedCompensationLabel(reimbursement.name)}\n name={`fixedCompensations.${reimbursement.name}`}\n />\n </Grid>\n </div>\n )}\n <div className={styles.fieldGroup}>\n <Heading as=\"h4\">{t('paymentMethodTitle')}</Heading>\n <RadioGroupField\n name=\"paymentMethod\"\n isRequired\n label={t('paymentMethodLabel')}\n description={t('paymentMethodDescription')}\n options={[\n {\n value: PayrollEmployeeCompensationsTypePaymentMethod.DirectDeposit,\n label: t('paymentMethodOptions.directDeposit'),\n },\n {\n value: PayrollEmployeeCompensationsTypePaymentMethod.Check,\n label: t('paymentMethodOptions.check'),\n },\n ]}\n />\n </div>\n </Form>\n {!isSmallOrGreater && actions}\n </FormProvider>\n </div>\n )\n}\n"],"names":["PayrollEditEmployeeFormSchema","z","PayrollEmployeeCompensationsTypePaymentMethod","buildCompensationFromFormData","formData","employeeCompensation","timeOff","primaryJobUuid","updatedCompensation","compensation","hours","timeOffEntry","updatedFixedCompensations","fixedCompensationName","formAmount","existingFixedCompensation","fixedCompensation","PayrollEditEmployeePresentation","onSave","onCancel","employee","isPending","fixedCompensationTypes","payPeriodStartDate","paySchedule","isOffCycle","withReimbursements","Button","Heading","Text","useComponentContext","useTranslation","useI18n","primaryJob","job","hourlyJobs","containerRef","useRef","isSmallOrGreater","useContainerBreakpoints","hourlyJob","entry","additionalEarnings","getAdditionalEarningsCompensations","EXCLUDED_ADDITIONAL_EARNINGS","reimbursement","getReimbursementCompensation","findMatchingCompensation","jobUuid","compensationName","getCompensationLabel","COMPENSATION_NAME_REGULAR_HOURS","COMPENSATION_NAME_OVERTIME","COMPENSATION_NAME_DOUBLE_OVERTIME","getFixedCompensationLabel","COMPENSATION_NAME_BONUS","COMPENSATION_NAME_PAYCHECK_TIPS","COMPENSATION_NAME_CORRECTION_PAYMENT","COMPENSATION_NAME_COMMISSION","COMPENSATION_NAME_CASH_TIPS","COMPENSATION_NAME_REIMBURSEMENT","defaultValues","hourlyCompensations","HOURS_COMPENSATION_NAMES","matchingCompensation","timeOffCompensations","timeOffCompensation","fixedCompensations","fixedComp","formHandlers","useForm","zodResolver","watchedFormData","useWatch","currentGrossPay","useMemo","jobId","compensations","formDataWithDefaults","calculateGrossPay","employeeName","firstLastName","onSubmit","data","formattedCurrentGrossPay","formatNumberAsCurrency","actions","jsxs","Flex","jsx","styles","FormProvider","Form","Grid","employeeHourlyCompensation","TextInputField","TimeOffField","RadioGroupField"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqDO,MAAMA,KAAgCC,EAAE,OAAO;AAAA,EACpD,qBAAqBA,EAAE,OAAOA,EAAE,OAAA,GAAUA,EAAE,OAAOA,EAAE,OAAA,GAAUA,EAAE,OAAA,EAAS,SAAA,CAAU,CAAC;AAAA,EACrF,sBAAsBA,EAAE,OAAOA,EAAE,OAAA,GAAUA,EAAE,SAAS,UAAU;AAAA,EAChE,oBAAoBA,EAAE,OAAOA,EAAE,OAAA,GAAUA,EAAE,SAAS,UAAU;AAAA,EAC9D,eAAeA,EAAE,WAAWC,CAA6C,EAAE,SAAA;AAC7E,CAAC,GAIKC,IAAgC,CACpCC,GACAC,GACAC,GACAC,MACqC;AACrC,QAAMC,IAAsB;AAAA,IAC1B,GAAGH;AAAA,IACH,eAAeD,EAAS;AAAA,EAAA;AAG1B,EAAAI,EAAoB,sBAAsBH,GAAsB,qBAAqB;AAAA,IACnF,CAAAI,MAAgB;AACd,YAAMC,IACJD,EAAa,WAAWA,EAAa,OACjCL,EAAS,oBAAoBK,EAAa,OAAO,IAAIA,EAAa,IAAI,IACtE;AACN,aAAOC,IACH;AAAA,QACE,GAAGD;AAAA,QACH,OAAAC;AAAA,MAAA,IAEFD;AAAA,IACN;AAAA,EAAA,GAGFD,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AA;AAAA,UAAA,gBAAAD,EAAC7D,GAAA,EAAQ,IAAG,MAAM,UAAA,EAAE,oBAAoB,GAAE;AAAA,UAC1C,gBAAA6D,EAACI,GAAA,EAAK,qBAAqB,EAAE,MAAM,OAAO,OAAO,CAAC,KAAK,GAAG,EAAA,GAAK,KAAK,IAClE,UAAA,gBAAAJ;AAAA,YAACM;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,gBAAe;AAAA,cACf,YAAU;AAAA,cACV,OAAOzC,EAA0BT,EAAc,IAAI;AAAA,cACnD,MAAM,sBAAsBA,EAAc,IAAI;AAAA,YAAA;AAAA,UAAA,EAChD,CACF;AAAA,QAAA,GACF;AAAA,QAEF,gBAAA0C,EAAC,OAAA,EAAI,WAAWG,EAAO,YACrB,UAAA;AAAA,UAAA,gBAAAD,EAAC7D,GAAA,EAAQ,IAAG,MAAM,UAAA,EAAE,oBAAoB,GAAE;AAAA,UAC1C,gBAAA6D;AAAA,YAACQ;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,YAAU;AAAA,cACV,OAAO,EAAE,oBAAoB;AAAA,cAC7B,aAAa,EAAE,0BAA0B;AAAA,cACzC,SAAS;AAAA,gBACP;AAAA,kBACE,OAAO/F,EAA8C;AAAA,kBACrD,OAAO,EAAE,oCAAoC;AAAA,gBAAA;AAAA,gBAE/C;AAAA,kBACE,OAAOA,EAA8C;AAAA,kBACrD,OAAO,EAAE,4BAA4B;AAAA,gBAAA;AAAA,cACvC;AAAA,YACF;AAAA,UAAA;AAAA,QACF,EAAA,CACF;AAAA,MAAA,GACF;AAAA,MACC,CAACoC,KAAoBgD;AAAA,IAAA,EAAA,CACxB;AAAA,EAAA,GACF;AAEJ;"}
@@ -1,2 +1,2 @@
1
1
  import { PayrollFlowProps } from './PayrollFlowComponents';
2
- export declare const PayrollFlow: ({ companyId, onEvent }: PayrollFlowProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const PayrollFlow: ({ companyId, onEvent, withReimbursements, ConfirmWireDetailsComponent, }: PayrollFlowProps) => import("react/jsx-runtime").JSX.Element;