@gusto/embedded-react-sdk 0.55.2 → 0.55.4

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 (159) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/components/Common/DataView/DataCards/DataCards.d.ts +2 -1
  3. package/dist/components/Common/DataView/DataCards/DataCards.js +63 -54
  4. package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
  5. package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js +14 -12
  6. package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js.map +1 -1
  7. package/dist/components/Common/DataView/DataTable/DataTable.d.ts +2 -1
  8. package/dist/components/Common/DataView/DataTable/DataTable.js +75 -66
  9. package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
  10. package/dist/components/Common/DataView/DataTable/DataTable.module.scss.js +8 -4
  11. package/dist/components/Common/DataView/DataTable/DataTable.module.scss.js.map +1 -1
  12. package/dist/components/Common/DataView/DataView.js +18 -17
  13. package/dist/components/Common/DataView/DataView.js.map +1 -1
  14. package/dist/components/Common/FieldLayout/FieldLayout.js +6 -6
  15. package/dist/components/Common/Fieldset/Fieldset.js +6 -6
  16. package/dist/components/Common/HorizontalFieldLayout/HorizontalFieldLayout.js +6 -6
  17. package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.js +58 -49
  18. package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.js.map +1 -1
  19. package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.module.scss.js +14 -10
  20. package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.module.scss.js.map +1 -1
  21. package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBoxTypes.d.ts +4 -0
  22. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
  23. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  24. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
  25. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  26. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
  27. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  28. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
  29. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  30. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.d.ts +4 -0
  31. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  32. package/dist/components/Company/DocumentSigner/DocumentList/List.js +11 -8
  33. package/dist/components/Company/DocumentSigner/DocumentList/List.js.map +1 -1
  34. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  35. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  36. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +5 -6
  37. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  38. package/dist/components/Company/Industry/Context.js +6 -7
  39. package/dist/components/Company/Industry/Context.js.map +1 -1
  40. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
  41. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  42. package/dist/components/Company/Locations/LocationsList/List.js +27 -25
  43. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  44. package/dist/components/Company/Locations/LocationsList/LocationsList.js +41 -36
  45. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  46. package/dist/components/Company/Locations/LocationsList/useLocationsList.d.ts +1 -0
  47. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
  48. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  49. package/dist/components/Company/OnboardingOverview/context.js +3 -4
  50. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  51. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.d.ts +9 -2
  52. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js +19 -18
  53. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js.map +1 -1
  54. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +63 -62
  55. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  56. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
  57. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  58. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
  59. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  60. package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.js +69 -65
  61. package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.js.map +1 -1
  62. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +3 -4
  63. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
  64. package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.js +30 -23
  65. package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.js.map +1 -1
  66. package/dist/components/Company/StateTaxes/shared/RequirementFields.d.ts +8 -4
  67. package/dist/components/Company/StateTaxes/shared/RequirementFields.js +13 -12
  68. package/dist/components/Company/StateTaxes/shared/RequirementFields.js.map +1 -1
  69. package/dist/components/Company/StateTaxes/shared/prepareRequirements.d.ts +29 -0
  70. package/dist/components/Company/StateTaxes/shared/prepareRequirements.js +24 -0
  71. package/dist/components/Company/StateTaxes/shared/prepareRequirements.js.map +1 -0
  72. package/dist/components/Company/StateTaxes/shared/prepareRequirements.test.d.ts +1 -0
  73. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +68 -55
  74. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
  75. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +36 -35
  76. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  77. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js +116 -116
  78. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
  79. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.d.ts +4 -0
  80. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js +19 -19
  81. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  82. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js +16 -13
  83. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js.map +1 -1
  84. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  85. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  86. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.d.ts +4 -0
  87. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -1
  88. package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js +84 -96
  89. package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js.map +1 -1
  90. package/dist/components/Flow/Flow.js +22 -22
  91. package/dist/components/Flow/Flow.js.map +1 -1
  92. package/dist/components/Flow/useFlow.js +3 -3
  93. package/dist/components/InformationRequests/InformationRequests.d.ts +1 -1
  94. package/dist/components/InformationRequests/InformationRequests.js +68 -53
  95. package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
  96. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +2 -3
  97. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  98. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +87 -81
  99. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
  100. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
  101. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +86 -67
  102. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
  103. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +4 -0
  104. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.d.ts +1 -1
  105. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js +26 -21
  106. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js.map +1 -1
  107. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.d.ts +8 -1
  108. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +29 -17
  109. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
  110. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js +21 -18
  111. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js.map +1 -1
  112. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.module.scss.js +9 -7
  113. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.module.scss.js.map +1 -1
  114. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts +2 -0
  115. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js.map +1 -1
  116. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +200 -199
  117. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  118. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +3 -2
  119. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +32 -32
  120. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
  121. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +254 -243
  122. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  123. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +83 -76
  124. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  125. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +23 -22
  126. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  127. package/dist/components/Payroll/PayrollList/PayrollList.js +108 -97
  128. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  129. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +38 -37
  130. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  131. package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +8 -1
  132. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +196 -174
  133. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  134. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +3 -1
  135. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +173 -163
  136. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  137. package/dist/components/Payroll/helpers.d.ts +0 -15
  138. package/dist/components/Payroll/helpers.js +13 -18
  139. package/dist/components/Payroll/helpers.js.map +1 -1
  140. package/dist/components/Payroll/usePreparedPayrollData.js +8 -9
  141. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  142. package/dist/helpers/openPdfInNewTab.d.ts +15 -0
  143. package/dist/helpers/openPdfInNewTab.js +28 -0
  144. package/dist/helpers/openPdfInNewTab.js.map +1 -0
  145. package/dist/i18n/en/Company.DocumentList.json.js +34 -32
  146. package/dist/i18n/en/Company.DocumentList.json.js.map +1 -1
  147. package/dist/i18n/en/Company.StateTaxes.json.js +1 -1
  148. package/dist/i18n/en/Employee.DocumentSigner.json.js +24 -22
  149. package/dist/i18n/en/Employee.DocumentSigner.json.js.map +1 -1
  150. package/dist/i18n/en/Payroll.OffCycleCreation.json.js +11 -9
  151. package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -1
  152. package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js +7 -7
  153. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +29 -27
  154. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
  155. package/dist/i18n/en/Payroll.PayrollOverview.json.js +41 -39
  156. package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
  157. package/dist/i18n/types.d.ts +331 -1
  158. package/dist/style.css +1 -1
  159. package/package.json +21 -21
@@ -1 +1 @@
1
- {"version":3,"file":"OffCycleCreation.js","sources":["../../../../src/components/Payroll/OffCycleCreation/OffCycleCreation.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useState } from 'react'\nimport { FormProvider, useForm, type Resolver } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { usePayrollsCreateOffCycleMutation } from '@gusto/embedded-api/react-query/payrollsCreateOffCycle'\nimport {\n OffCycleReason as ApiOffCycleReason,\n WithholdingPayPeriod,\n} from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayrolls'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport { useEmployeesListSuspense } from '@gusto/embedded-api/react-query/employeesList'\nimport { OFF_CYCLE_REASON_DEFAULTS, type OffCycleReason } from '../OffCycleReasonSelection'\nimport {\n createOffCyclePayPeriodDateFormSchema,\n type OffCyclePayrollDateType,\n} from '../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes'\nimport { useOffCyclePayPeriodDateValidation } from '../OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation'\nimport type { OffCycleTaxWithholdingConfig } from '../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes'\nimport type { OffCycleCreationFormData, OffCycleCreationProps } from './OffCycleCreationTypes'\nimport { OffCycleCreationPresentation } from './OffCycleCreationPresentation'\nimport { useCompanyPaymentSpeed } from '@/hooks/useCompanyPaymentSpeed'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { SDKInternalError } from '@/types/sdkError'\nimport { Form } from '@/components/Common/Form'\nimport type { MultiSelectComboBoxOption } from '@/components/Common/UI/MultiSelectComboBox/MultiSelectComboBoxTypes'\n\nconst LOCAL_TO_API_REASON: Record<OffCycleReason, ApiOffCycleReason> = {\n bonus: ApiOffCycleReason.Bonus,\n correction: ApiOffCycleReason.Correction,\n}\n\n/**\n * Creation form for off-cycle (bonus or correction) payrolls.\n *\n * Walks the user through configuring pay period dates, selecting a reason, choosing\n * employees, and setting deduction and tax withholding preferences, then submits the\n * resulting payroll for execution.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `offCycle/created` | The off-cycle payroll has been created | `{ payrollUuid: string }` |\n *\n * Changing the reason updates the deduction and withholding defaults — `'bonus'` skips\n * regular deductions and uses the supplemental withholding rate; `'correction'` includes\n * regular deductions and uses the regular rate.\n *\n * @param props - {@link OffCycleCreationProps} plus base component props.\n * @returns The off-cycle payroll creation form.\n * @public\n */\nexport function OffCycleCreation(props: OffCycleCreationProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ dictionary, companyId, payrollType = 'bonus' }: OffCycleCreationProps) {\n useComponentDictionary('Payroll.OffCycleCreation', dictionary)\n useI18n('Payroll.OffCycleCreation')\n useI18n('Payroll.OffCycleReasonSelection')\n useI18n('Payroll.OffCyclePayPeriodDateForm')\n useI18n('Payroll.OffCycleDeductionsSetting')\n useI18n('Payroll.EmployeeSelection')\n\n const { t } = useTranslation('Payroll.OffCyclePayPeriodDateForm')\n const { t: tCreation } = useTranslation('Payroll.OffCycleCreation')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { paymentSpeedDays } = useCompanyPaymentSpeed(companyId)\n\n const { minCheckDate, today } = useOffCyclePayPeriodDateValidation(paymentSpeedDays)\n const { mutateAsync: createOffCyclePayroll, isPending } = usePayrollsCreateOffCycleMutation()\n\n const [taxWithholdingConfig, setTaxWithholdingConfig] = useState<OffCycleTaxWithholdingConfig>({\n withholdingPayPeriod: WithholdingPayPeriod.EveryOtherWeek,\n withholdingRate: OFF_CYCLE_REASON_DEFAULTS[payrollType].withholdingType,\n })\n const [isTaxWithholdingModalOpen, setIsTaxWithholdingModalOpen] = useState(false)\n\n const handleTaxWithholdingEditClick = useCallback(() => {\n setIsTaxWithholdingModalOpen(true)\n }, [])\n\n const handleTaxWithholdingModalDone = useCallback((config: OffCycleTaxWithholdingConfig) => {\n setTaxWithholdingConfig(config)\n setIsTaxWithholdingModalOpen(false)\n }, [])\n\n const handleTaxWithholdingModalCancel = useCallback(() => {\n setIsTaxWithholdingModalOpen(false)\n }, [])\n\n const { data: employeesData } = useEmployeesListSuspense({\n companyId,\n onboardedActive: true,\n })\n\n const employees: MultiSelectComboBoxOption[] = useMemo(() => {\n const employeeList = employeesData.showEmployees ?? []\n return [...employeeList]\n .sort((a, b) => {\n const lastNameComparison = a.lastName.localeCompare(b.lastName)\n if (lastNameComparison !== 0) return lastNameComparison\n return a.firstName.localeCompare(b.firstName)\n })\n .map(employee => {\n const fullName = [employee.firstName, employee.lastName].filter(Boolean).join(' ')\n return {\n label: fullName,\n value: employee.uuid,\n }\n })\n }, [employeesData])\n\n const translateValidation = (key: string, options?: Record<string, unknown>): string =>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n t(key as any, options as any) as string\n\n const dynamicResolver: Resolver<OffCycleCreationFormData> = (values, context, options) => {\n const reason = values.reason\n const isCheckOnly = values.isCheckOnly\n const resolvedPayrollType: OffCyclePayrollDateType =\n reason === 'correction' ? 'correction' : payrollType\n\n const dateSchema = createOffCyclePayPeriodDateFormSchema(\n translateValidation,\n resolvedPayrollType,\n isCheckOnly ? today : minCheckDate,\n paymentSpeedDays,\n )\n const schema = z\n .object({\n reason: z.enum(['bonus', 'correction']),\n skipRegularDeductions: z.boolean(),\n includeAllEmployees: z.boolean(),\n selectedEmployeeUuids: z.array(z.string()),\n })\n .and(dateSchema)\n .superRefine((data, ctx) => {\n if (!data.includeAllEmployees && data.selectedEmployeeUuids.length === 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['selectedEmployeeUuids'],\n message: tCreation('errors.noEmployeesSelected'),\n })\n }\n })\n\n return zodResolver(schema)(values, context, options)\n }\n\n const methods = useForm<OffCycleCreationFormData>({\n resolver: dynamicResolver,\n defaultValues: {\n reason: payrollType,\n isCheckOnly: false,\n startDate: null,\n endDate: null,\n checkDate: null,\n skipRegularDeductions: OFF_CYCLE_REASON_DEFAULTS[payrollType].skipDeductions,\n includeAllEmployees: false,\n selectedEmployeeUuids: [],\n },\n })\n\n const watchedReason = methods.watch('reason')\n\n useEffect(() => {\n methods.setValue(\n 'skipRegularDeductions',\n OFF_CYCLE_REASON_DEFAULTS[watchedReason].skipDeductions,\n )\n setTaxWithholdingConfig(prev => ({\n ...prev,\n withholdingRate: OFF_CYCLE_REASON_DEFAULTS[watchedReason].withholdingType,\n }))\n }, [watchedReason, methods])\n\n const onSubmit = async (data: OffCycleCreationFormData) => {\n const reason = data.reason\n const checkDate = data.checkDate!\n const startDate = data.startDate!\n const endDate = data.endDate!\n const employeeUuids = data.includeAllEmployees\n ? employees.map(e => e.value)\n : data.selectedEmployeeUuids.length > 0\n ? data.selectedEmployeeUuids\n : undefined\n\n await baseSubmitHandler(data, async () => {\n const response = await createOffCyclePayroll({\n request: {\n companyId,\n requestBody: {\n offCycle: true,\n offCycleReason: LOCAL_TO_API_REASON[reason],\n startDate: new RFCDate(startDate),\n endDate: new RFCDate(endDate),\n checkDate: new RFCDate(checkDate),\n skipRegularDeductions: data.skipRegularDeductions,\n isCheckOnlyPayroll: data.isCheckOnly,\n employeeUuids,\n withholdingPayPeriod: taxWithholdingConfig.withholdingPayPeriod,\n fixedWithholdingRate: taxWithholdingConfig.withholdingRate === 'supplemental',\n },\n },\n })\n\n const payrollUuid =\n response.payrollUnprocessed?.payrollUuid ?? response.payrollUnprocessed?.uuid\n\n if (!payrollUuid) {\n throw new SDKInternalError(tCreation('errors.missingPayrollId'))\n }\n\n onEvent(componentEvents.OFF_CYCLE_CREATED, { payrollUuid })\n })\n }\n\n return (\n <FormProvider {...methods}>\n <Form onSubmit={methods.handleSubmit(onSubmit)}>\n <OffCycleCreationPresentation\n employees={employees}\n isPending={isPending}\n taxWithholdingConfig={taxWithholdingConfig}\n isTaxWithholdingModalOpen={isTaxWithholdingModalOpen}\n onTaxWithholdingEditClick={handleTaxWithholdingEditClick}\n onTaxWithholdingModalDone={handleTaxWithholdingModalDone}\n onTaxWithholdingModalCancel={handleTaxWithholdingModalCancel}\n />\n </Form>\n </FormProvider>\n )\n}\n"],"names":["LOCAL_TO_API_REASON","ApiOffCycleReason","OffCycleCreation","props","jsx","BaseComponent","Root","dictionary","companyId","payrollType","useComponentDictionary","useI18n","t","useTranslation","tCreation","onEvent","baseSubmitHandler","useBase","paymentSpeedDays","useCompanyPaymentSpeed","minCheckDate","today","useOffCyclePayPeriodDateValidation","createOffCyclePayroll","isPending","usePayrollsCreateOffCycleMutation","taxWithholdingConfig","setTaxWithholdingConfig","useState","WithholdingPayPeriod","OFF_CYCLE_REASON_DEFAULTS","isTaxWithholdingModalOpen","setIsTaxWithholdingModalOpen","handleTaxWithholdingEditClick","useCallback","handleTaxWithholdingModalDone","config","handleTaxWithholdingModalCancel","employeesData","useEmployeesListSuspense","employees","useMemo","a","b","lastNameComparison","employee","translateValidation","key","options","methods","useForm","values","context","reason","isCheckOnly","dateSchema","createOffCyclePayPeriodDateFormSchema","schema","z","data","ctx","zodResolver","watchedReason","useEffect","prev","onSubmit","checkDate","startDate","endDate","employeeUuids","e","response","RFCDate","payrollUuid","SDKInternalError","componentEvents","FormProvider","Form","OffCycleCreationPresentation"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA8BA,MAAMA,KAAiE;AAAA,EACrE,OAAOC,EAAkB;AAAA,EACzB,YAAYA,EAAkB;AAChC;AAsBO,SAASC,GAAiBC,GAA8B;AAC7D,SACE,gBAAAC,EAACC,MAAe,GAAGF,GACjB,4BAACG,IAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,GAAK,EAAE,YAAAC,GAAY,WAAAC,GAAW,aAAAC,IAAc,WAAkC;AACrF,EAAAC,GAAuB,4BAA4BH,CAAU,GAC7DI,EAAQ,0BAA0B,GAClCA,EAAQ,iCAAiC,GACzCA,EAAQ,mCAAmC,GAC3CA,EAAQ,mCAAmC,GAC3CA,EAAQ,2BAA2B;AAEnC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mCAAmC,GAC1D,EAAE,GAAGC,MAAcD,EAAe,0BAA0B,GAC5D,EAAE,SAAAE,GAAS,mBAAAC,EAAA,IAAsBC,GAAA,GAEjC,EAAE,kBAAAC,EAAA,IAAqBC,GAAuBX,CAAS,GAEvD,EAAE,cAAAY,GAAc,OAAAC,MAAUC,EAAmCJ,CAAgB,GAC7E,EAAE,aAAaK,GAAuB,WAAAC,EAAA,IAAcC,EAAA,GAEpD,CAACC,GAAsBC,CAAuB,IAAIC,EAAuC;AAAA,IAC7F,sBAAsBC,EAAqB;AAAA,IAC3C,iBAAiBC,EAA0BrB,CAAW,EAAE;AAAA,EAAA,CACzD,GACK,CAACsB,GAA2BC,CAA4B,IAAIJ,EAAS,EAAK,GAE1EK,IAAgCC,EAAY,MAAM;AACtD,IAAAF,EAA6B,EAAI;AAAA,EACnC,GAAG,CAAA,CAAE,GAECG,IAAgCD,EAAY,CAACE,MAAyC;AAC1F,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BqD,CAAM;AAAA,YAC1C,WAAW,IAAImB,EAAQL,CAAS;AAAA,YAChC,SAAS,IAAIK,EAAQJ,CAAO;AAAA,YAC5B,WAAW,IAAII,EAAQN,CAAS;AAAA,YAChC,uBAAuBP,EAAK;AAAA,YAC5B,oBAAoBA,EAAK;AAAA,YACzB,eAAAU;AAAA,YACA,sBAAsB3C,EAAqB;AAAA,YAC3C,sBAAsBA,EAAqB,oBAAoB;AAAA,UAAA;AAAA,QACjE;AAAA,MACF,CACD,GAEK+C,IACJF,EAAS,oBAAoB,eAAeA,EAAS,oBAAoB;AAE3E,UAAI,CAACE;AACH,cAAM,IAAIC,GAAiB5D,EAAU,yBAAyB,CAAC;AAGjE,MAAAC,EAAQ4D,GAAgB,mBAAmB,EAAE,aAAAF,EAAA,CAAa;AAAA,IAC5D,CAAC;AAAA,EACH;AAEA,SACE,gBAAArE,EAACwE,GAAA,EAAc,GAAG3B,GAChB,UAAA,gBAAA7C,EAACyE,MAAK,UAAU5B,EAAQ,aAAagB,CAAQ,GAC3C,UAAA,gBAAA7D;AAAA,IAAC0E;AAAA,IAAA;AAAA,MACC,WAAAtC;AAAA,MACA,WAAAhB;AAAA,MACA,sBAAAE;AAAA,MACA,2BAAAK;AAAA,MACA,2BAA2BE;AAAA,MAC3B,2BAA2BE;AAAA,MAC3B,6BAA6BE;AAAA,IAAA;AAAA,EAAA,GAEjC,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"OffCycleCreation.js","sources":["../../../../src/components/Payroll/OffCycleCreation/OffCycleCreation.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useState } from 'react'\nimport { FormProvider, useForm, type Resolver } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { usePayrollsCreateOffCycleMutation } from '@gusto/embedded-api/react-query/payrollsCreateOffCycle'\nimport {\n OffCycleReason as ApiOffCycleReason,\n WithholdingPayPeriod,\n} from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayrolls'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport { useEmployeesListSuspense } from '@gusto/embedded-api/react-query/employeesList'\nimport { OFF_CYCLE_REASON_DEFAULTS, type OffCycleReason } from '../OffCycleReasonSelection'\nimport {\n createOffCyclePayPeriodDateFormSchema,\n type OffCyclePayrollDateType,\n} from '../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes'\nimport { useOffCyclePayPeriodDateValidation } from '../OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation'\nimport type { OffCycleTaxWithholdingConfig } from '../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes'\nimport type { OffCycleCreationFormData, OffCycleCreationProps } from './OffCycleCreationTypes'\nimport { OffCycleCreationPresentation } from './OffCycleCreationPresentation'\nimport { useCompanyPaymentSpeed } from '@/hooks/useCompanyPaymentSpeed'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { SDKInternalError } from '@/types/sdkError'\nimport { Form } from '@/components/Common/Form'\nimport type { MultiSelectComboBoxOption } from '@/components/Common/UI/MultiSelectComboBox/MultiSelectComboBoxTypes'\n\nconst LOCAL_TO_API_REASON: Record<OffCycleReason, ApiOffCycleReason> = {\n bonus: ApiOffCycleReason.Bonus,\n correction: ApiOffCycleReason.Correction,\n}\n\n/**\n * Creation form for off-cycle (bonus or correction) payrolls.\n *\n * Walks the user through configuring pay period dates, selecting a reason, choosing\n * employees, and setting deduction and tax withholding preferences, then submits the\n * resulting payroll for execution.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `offCycle/created` | The off-cycle payroll has been created | `{ payrollUuid: string }` |\n *\n * Changing the reason updates the deduction and withholding defaults — `'bonus'` skips\n * regular deductions and uses the supplemental withholding rate; `'correction'` includes\n * regular deductions and uses the regular rate.\n *\n * @param props - {@link OffCycleCreationProps} plus base component props.\n * @returns The off-cycle payroll creation form.\n * @public\n */\nexport function OffCycleCreation(props: OffCycleCreationProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ dictionary, companyId, payrollType = 'bonus' }: OffCycleCreationProps) {\n useComponentDictionary('Payroll.OffCycleCreation', dictionary)\n useI18n('Payroll.OffCycleCreation')\n useI18n('Payroll.OffCycleReasonSelection')\n useI18n('Payroll.OffCyclePayPeriodDateForm')\n useI18n('Payroll.OffCycleDeductionsSetting')\n useI18n('Payroll.EmployeeSelection')\n\n const { t } = useTranslation('Payroll.OffCyclePayPeriodDateForm')\n const { t: tCreation } = useTranslation('Payroll.OffCycleCreation')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { paymentSpeedDays } = useCompanyPaymentSpeed(companyId)\n\n const { minCheckDate, today } = useOffCyclePayPeriodDateValidation(paymentSpeedDays)\n const { mutateAsync: createOffCyclePayroll, isPending } = usePayrollsCreateOffCycleMutation()\n\n const [taxWithholdingConfig, setTaxWithholdingConfig] = useState<OffCycleTaxWithholdingConfig>({\n withholdingPayPeriod: WithholdingPayPeriod.EveryOtherWeek,\n withholdingRate: OFF_CYCLE_REASON_DEFAULTS[payrollType].withholdingType,\n })\n const [isTaxWithholdingModalOpen, setIsTaxWithholdingModalOpen] = useState(false)\n\n const handleTaxWithholdingEditClick = useCallback(() => {\n setIsTaxWithholdingModalOpen(true)\n }, [])\n\n const handleTaxWithholdingModalDone = useCallback((config: OffCycleTaxWithholdingConfig) => {\n setTaxWithholdingConfig(config)\n setIsTaxWithholdingModalOpen(false)\n }, [])\n\n const handleTaxWithholdingModalCancel = useCallback(() => {\n setIsTaxWithholdingModalOpen(false)\n }, [])\n\n const { data: employeesData } = useEmployeesListSuspense({\n companyId,\n onboardedActive: true,\n })\n\n const employees: MultiSelectComboBoxOption[] = useMemo(() => {\n const employeeList = employeesData.showEmployees ?? []\n return [...employeeList]\n .sort((a, b) => {\n const lastNameComparison = a.lastName.localeCompare(b.lastName)\n if (lastNameComparison !== 0) return lastNameComparison\n return a.firstName.localeCompare(b.firstName)\n })\n .map(employee => {\n const fullName = [employee.firstName, employee.lastName].filter(Boolean).join(' ')\n const primaryJob = employee.jobs?.find(job => job.primary) ?? employee.jobs?.[0]\n return {\n label: fullName,\n value: employee.uuid,\n description: primaryJob?.title || undefined,\n }\n })\n }, [employeesData])\n\n const translateValidation = (key: string, options?: Record<string, unknown>): string =>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n t(key as any, options as any) as string\n\n const dynamicResolver: Resolver<OffCycleCreationFormData> = (values, context, options) => {\n const reason = values.reason\n const isCheckOnly = values.isCheckOnly\n const resolvedPayrollType: OffCyclePayrollDateType =\n reason === 'correction' ? 'correction' : payrollType\n\n const dateSchema = createOffCyclePayPeriodDateFormSchema(\n translateValidation,\n resolvedPayrollType,\n isCheckOnly ? today : minCheckDate,\n paymentSpeedDays,\n )\n const schema = z\n .object({\n reason: z.enum(['bonus', 'correction']),\n skipRegularDeductions: z.boolean(),\n includeAllEmployees: z.boolean(),\n selectedEmployeeUuids: z.array(z.string()),\n })\n .and(dateSchema)\n .superRefine((data, ctx) => {\n if (!data.includeAllEmployees && data.selectedEmployeeUuids.length === 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['selectedEmployeeUuids'],\n message: tCreation('errors.noEmployeesSelected'),\n })\n }\n })\n\n return zodResolver(schema)(values, context, options)\n }\n\n const methods = useForm<OffCycleCreationFormData>({\n resolver: dynamicResolver,\n defaultValues: {\n reason: payrollType,\n isCheckOnly: false,\n startDate: null,\n endDate: null,\n checkDate: null,\n skipRegularDeductions: OFF_CYCLE_REASON_DEFAULTS[payrollType].skipDeductions,\n includeAllEmployees: false,\n selectedEmployeeUuids: [],\n },\n })\n\n const watchedReason = methods.watch('reason')\n\n useEffect(() => {\n methods.setValue(\n 'skipRegularDeductions',\n OFF_CYCLE_REASON_DEFAULTS[watchedReason].skipDeductions,\n )\n setTaxWithholdingConfig(prev => ({\n ...prev,\n withholdingRate: OFF_CYCLE_REASON_DEFAULTS[watchedReason].withholdingType,\n }))\n }, [watchedReason, methods])\n\n const onSubmit = async (data: OffCycleCreationFormData) => {\n const reason = data.reason\n const checkDate = data.checkDate!\n const startDate = data.startDate!\n const endDate = data.endDate!\n const employeeUuids = data.includeAllEmployees\n ? employees.map(e => e.value)\n : data.selectedEmployeeUuids.length > 0\n ? data.selectedEmployeeUuids\n : undefined\n\n await baseSubmitHandler(data, async () => {\n const response = await createOffCyclePayroll({\n request: {\n companyId,\n requestBody: {\n offCycle: true,\n offCycleReason: LOCAL_TO_API_REASON[reason],\n startDate: new RFCDate(startDate),\n endDate: new RFCDate(endDate),\n checkDate: new RFCDate(checkDate),\n skipRegularDeductions: data.skipRegularDeductions,\n isCheckOnlyPayroll: data.isCheckOnly,\n employeeUuids,\n withholdingPayPeriod: taxWithholdingConfig.withholdingPayPeriod,\n fixedWithholdingRate: taxWithholdingConfig.withholdingRate === 'supplemental',\n },\n },\n })\n\n const payrollUuid =\n response.payrollUnprocessed?.payrollUuid ?? response.payrollUnprocessed?.uuid\n\n if (!payrollUuid) {\n throw new SDKInternalError(tCreation('errors.missingPayrollId'))\n }\n\n onEvent(componentEvents.OFF_CYCLE_CREATED, { payrollUuid })\n })\n }\n\n return (\n <FormProvider {...methods}>\n <Form onSubmit={methods.handleSubmit(onSubmit)}>\n <OffCycleCreationPresentation\n employees={employees}\n isPending={isPending}\n minCheckDate={minCheckDate}\n minCheckOnlyDate={today}\n taxWithholdingConfig={taxWithholdingConfig}\n isTaxWithholdingModalOpen={isTaxWithholdingModalOpen}\n onTaxWithholdingEditClick={handleTaxWithholdingEditClick}\n onTaxWithholdingModalDone={handleTaxWithholdingModalDone}\n onTaxWithholdingModalCancel={handleTaxWithholdingModalCancel}\n />\n </Form>\n </FormProvider>\n )\n}\n"],"names":["LOCAL_TO_API_REASON","ApiOffCycleReason","OffCycleCreation","props","jsx","BaseComponent","Root","dictionary","companyId","payrollType","useComponentDictionary","useI18n","t","useTranslation","tCreation","onEvent","baseSubmitHandler","useBase","paymentSpeedDays","useCompanyPaymentSpeed","minCheckDate","today","useOffCyclePayPeriodDateValidation","createOffCyclePayroll","isPending","usePayrollsCreateOffCycleMutation","taxWithholdingConfig","setTaxWithholdingConfig","useState","WithholdingPayPeriod","OFF_CYCLE_REASON_DEFAULTS","isTaxWithholdingModalOpen","setIsTaxWithholdingModalOpen","handleTaxWithholdingEditClick","useCallback","handleTaxWithholdingModalDone","config","handleTaxWithholdingModalCancel","employeesData","useEmployeesListSuspense","employees","useMemo","a","b","lastNameComparison","employee","fullName","primaryJob","job","translateValidation","key","options","methods","useForm","values","context","reason","isCheckOnly","dateSchema","createOffCyclePayPeriodDateFormSchema","schema","z","data","ctx","zodResolver","watchedReason","useEffect","prev","onSubmit","checkDate","startDate","endDate","employeeUuids","e","response","RFCDate","payrollUuid","SDKInternalError","componentEvents","FormProvider","Form","OffCycleCreationPresentation"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA8BA,MAAMA,KAAiE;AAAA,EACrE,OAAOC,EAAkB;AAAA,EACzB,YAAYA,EAAkB;AAChC;AAsBO,SAASC,GAAiBC,GAA8B;AAC7D,SACE,gBAAAC,EAACC,MAAe,GAAGF,GACjB,4BAACG,IAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,GAAK,EAAE,YAAAC,GAAY,WAAAC,GAAW,aAAAC,IAAc,WAAkC;AACrF,EAAAC,GAAuB,4BAA4BH,CAAU,GAC7DI,EAAQ,0BAA0B,GAClCA,EAAQ,iCAAiC,GACzCA,EAAQ,mCAAmC,GAC3CA,EAAQ,mCAAmC,GAC3CA,EAAQ,2BAA2B;AAEnC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mCAAmC,GAC1D,EAAE,GAAGC,MAAcD,EAAe,0BAA0B,GAC5D,EAAE,SAAAE,GAAS,mBAAAC,EAAA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,gBAAAhD,EAAC4E,MAAK,UAAU5B,EAAQ,aAAagB,CAAQ,GAC3C,UAAA,gBAAAhE;AAAA,IAAC6E;AAAA,IAAA;AAAA,MACC,WAAAzC;AAAA,MACA,WAAAhB;AAAA,MACA,cAAAJ;AAAA,MACA,kBAAkBC;AAAA,MAClB,sBAAAK;AAAA,MACA,2BAAAK;AAAA,MACA,2BAA2BE;AAAA,MAC3B,2BAA2BE;AAAA,MAC3B,6BAA6BE;AAAA,IAAA;AAAA,EAAA,GAEjC,EAAA,CACF;AAEJ;"}
@@ -1,3 +1,3 @@
1
1
  import { OffCycleCreationPresentationProps } from './OffCycleCreationTypes';
2
2
  /** @internal */
3
- export declare function OffCycleCreationPresentation({ employees, isPending, taxWithholdingConfig, isTaxWithholdingModalOpen, onTaxWithholdingEditClick, onTaxWithholdingModalDone, onTaxWithholdingModalCancel, }: OffCycleCreationPresentationProps): import("react").JSX.Element;
3
+ export declare function OffCycleCreationPresentation({ employees, isPending, minCheckDate, minCheckOnlyDate, taxWithholdingConfig, isTaxWithholdingModalOpen, onTaxWithholdingEditClick, onTaxWithholdingModalDone, onTaxWithholdingModalCancel, }: OffCycleCreationPresentationProps): import("react").JSX.Element;
@@ -1,44 +1,47 @@
1
1
  import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
- import { useMemo as A, useCallback as F } from "react";
3
- import { useFormContext as G } from "react-hook-form";
4
- import { useTranslation as r } from "react-i18next";
5
- import { OffCyclePayPeriodDateFormPresentation as w } from "../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js";
6
- import { WAGE_TYPE_CATEGORIES as W } from "../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js";
7
- import a from "./OffCycleCreationPresentation.module.scss.js";
8
- import { useI18n as c } from "../../../i18n/I18n.js";
9
- import { useComponentContext as k } from "../../../contexts/ComponentAdapter/useComponentContext.js";
2
+ import { useMemo as G, useCallback as F } from "react";
3
+ import { useFormContext as W } from "react-hook-form";
4
+ import { useTranslation as c, Trans as k } from "react-i18next";
5
+ import { OffCyclePayPeriodDateFormPresentation as N } from "../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js";
6
+ import { WAGE_TYPE_CATEGORIES as R } from "../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js";
7
+ import s from "./OffCycleCreationPresentation.module.scss.js";
8
+ import { useI18n as p } from "../../../i18n/I18n.js";
9
+ import { useComponentContext as j } from "../../../contexts/ComponentAdapter/useComponentContext.js";
10
10
  import { Flex as o } from "../../Common/Flex/Flex.js";
11
- import { OffCycleReasonSelectionPresentation as N } from "../OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js";
12
- import { SwitchField as R } from "../../Common/Fields/SwitchField/SwitchField.js";
13
- import { MultiSelectComboBoxField as j } from "../../Common/Fields/MultiSelectComboBoxField/MultiSelectComboBoxField.js";
14
- import { RadioGroupField as I } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
15
- import { OffCycleTaxWithholdingTable as L } from "../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js";
16
- import { OffCycleTaxWithholdingModal as M } from "../OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js";
17
- function oe({
11
+ import { OffCycleReasonSelectionPresentation as I } from "../OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js";
12
+ import { SwitchField as L } from "../../Common/Fields/SwitchField/SwitchField.js";
13
+ import { MultiSelectComboBoxField as M } from "../../Common/Fields/MultiSelectComboBoxField/MultiSelectComboBoxField.js";
14
+ import { RadioGroupField as V } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
15
+ import { OffCycleTaxWithholdingTable as $ } from "../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js";
16
+ import { OffCycleTaxWithholdingModal as B } from "../OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js";
17
+ function te({
18
18
  employees: g,
19
- isPending: m,
20
- taxWithholdingConfig: u,
21
- isTaxWithholdingModalOpen: C,
22
- onTaxWithholdingEditClick: x,
23
- onTaxWithholdingModalDone: T,
24
- onTaxWithholdingModalCancel: b
19
+ isPending: u,
20
+ minCheckDate: C,
21
+ minCheckOnlyDate: x,
22
+ taxWithholdingConfig: f,
23
+ isTaxWithholdingModalOpen: D,
24
+ onTaxWithholdingEditClick: T,
25
+ onTaxWithholdingModalDone: b,
26
+ onTaxWithholdingModalCancel: P
25
27
  }) {
26
- c("Payroll.OffCycleCreation"), c("Payroll.OffCycleDeductionsSetting"), c("Payroll.EmployeeSelection"), c("Payroll.OffCycleTaxWithholding");
27
- const { t: i } = r("Payroll.OffCycleCreation"), { t } = r("Payroll.OffCycleDeductionsSetting"), { t: s } = r("Payroll.EmployeeSelection"), { t: p } = r("Payroll.OffCycleTaxWithholding"), { Heading: d, Text: f, Button: D } = k(), P = A(
28
- () => W.map((l) => {
28
+ p("Payroll.OffCycleCreation"), p("Payroll.OffCycleDeductionsSetting"), p("Payroll.EmployeeSelection"), p("Payroll.OffCycleTaxWithholding");
29
+ const { t: i } = c("Payroll.OffCycleCreation"), { t } = c("Payroll.OffCycleDeductionsSetting"), { t: d } = c("Payroll.EmployeeSelection"), { t: r } = c("Payroll.OffCycleTaxWithholding"), { Heading: m, Text: a, Button: E } = j(), O = G(
30
+ () => R.map((l) => {
29
31
  const y = {
30
32
  category: l,
31
- label: p(`wageTypeGroups.${l}.label`)
33
+ label: r(`wageTypeGroups.${l}.label`),
34
+ taxedAsDescription: r(`wageTypeGroups.${l}.taxedAsDescription`)
32
35
  };
33
- return (l === "regular" || l === "supplemental") && (y.description = p(`wageTypeGroups.${l}.description`)), y;
36
+ return (l === "regular" || l === "supplemental") && (y.description = r(`wageTypeGroups.${l}.description`)), y;
34
37
  }),
35
- [p]
36
- ), { setValue: h, watch: E } = G(), O = E("includeAllEmployees"), S = F(
38
+ [r]
39
+ ), { setValue: h, watch: S } = W(), v = S("includeAllEmployees"), A = F(
37
40
  (l) => {
38
41
  l && h("selectedEmployeeUuids", []);
39
42
  },
40
43
  [h]
41
- ), v = [
44
+ ), w = [
42
45
  {
43
46
  value: !1,
44
47
  label: t("options.include.label")
@@ -50,73 +53,89 @@ function oe({
50
53
  ];
51
54
  return /* @__PURE__ */ n(o, { flexDirection: "column", gap: 32, children: [
52
55
  /* @__PURE__ */ n(o, { flexDirection: "column", gap: 4, children: [
53
- /* @__PURE__ */ e(d, { as: "h2", children: i("pageTitle") }),
54
- /* @__PURE__ */ e(f, { variant: "supporting", children: i("pageDescription") })
56
+ /* @__PURE__ */ e(m, { as: "h2", children: i("pageTitle") }),
57
+ /* @__PURE__ */ e(a, { variant: "supporting", children: i("pageDescription") })
55
58
  ] }),
56
59
  /* @__PURE__ */ n(o, { flexDirection: "column", gap: 20, children: [
57
60
  /* @__PURE__ */ n(o, { flexDirection: "column", gap: 4, children: [
58
- /* @__PURE__ */ e(d, { as: "h3", children: i("payPeriodSectionTitle") }),
59
- /* @__PURE__ */ e(f, { variant: "supporting", children: i("payPeriodSectionDescription") })
61
+ /* @__PURE__ */ e(m, { as: "h3", children: i("payPeriodSectionTitle") }),
62
+ /* @__PURE__ */ e(a, { variant: "supporting", children: i("payPeriodSectionDescription") })
60
63
  ] }),
61
- /* @__PURE__ */ e(w, {})
64
+ /* @__PURE__ */ e(
65
+ N,
66
+ {
67
+ minCheckDate: C,
68
+ minCheckOnlyDate: x
69
+ }
70
+ )
62
71
  ] }),
63
- /* @__PURE__ */ e("hr", { className: a.divider }),
64
- /* @__PURE__ */ e(o, { flexDirection: "column", gap: 20, children: /* @__PURE__ */ e(N, { name: "reason" }) }),
65
- /* @__PURE__ */ e("hr", { className: a.divider }),
72
+ /* @__PURE__ */ e("hr", { className: s.divider }),
73
+ /* @__PURE__ */ e(o, { flexDirection: "column", gap: 20, children: /* @__PURE__ */ e(I, { name: "reason" }) }),
74
+ /* @__PURE__ */ e("hr", { className: s.divider }),
66
75
  /* @__PURE__ */ n(o, { flexDirection: "column", gap: 12, children: [
67
- /* @__PURE__ */ e(d, { as: "h3", children: s("sectionTitle") }),
76
+ /* @__PURE__ */ e(m, { as: "h3", children: d("sectionTitle") }),
68
77
  /* @__PURE__ */ e(
69
- R,
78
+ L,
70
79
  {
71
80
  name: "includeAllEmployees",
72
81
  label: i("includeAllEmployeesLabel"),
73
- onChange: S
82
+ onChange: A
74
83
  }
75
84
  ),
76
- !O && /* @__PURE__ */ e(
77
- j,
85
+ !v && /* @__PURE__ */ e(
86
+ M,
78
87
  {
79
88
  name: "selectedEmployeeUuids",
80
- label: s("sectionTitle"),
89
+ label: d("sectionTitle"),
81
90
  shouldVisuallyHideLabel: !0,
82
- placeholder: s("searchPlaceholder"),
91
+ placeholder: d("searchPlaceholder"),
83
92
  options: g
84
93
  }
85
94
  )
86
95
  ] }),
87
- /* @__PURE__ */ e("hr", { className: a.divider }),
96
+ /* @__PURE__ */ e("hr", { className: s.divider }),
88
97
  /* @__PURE__ */ e(o, { flexDirection: "column", gap: 20, children: /* @__PURE__ */ e(
89
- I,
98
+ V,
90
99
  {
91
100
  name: "skipRegularDeductions",
92
101
  label: t("title"),
93
102
  description: t("description"),
94
- options: v,
103
+ options: w,
95
104
  convertValueToString: (l) => String(l)
96
105
  }
97
106
  ) }),
98
- /* @__PURE__ */ e("hr", { className: a.divider }),
99
- /* @__PURE__ */ e(
100
- L,
101
- {
102
- wageTypeGroups: P,
103
- config: u,
104
- onEditClick: x
105
- }
106
- ),
107
- C && /* @__PURE__ */ e(
108
- M,
109
- {
110
- isOpen: !0,
111
- defaultConfig: u,
112
- onDone: T,
113
- onCancel: b
114
- }
115
- ),
116
- /* @__PURE__ */ e(o, { justifyContent: "flex-end", gap: 12, children: /* @__PURE__ */ e(D, { type: "submit", isLoading: m, isDisabled: m, children: i("continueCta") }) })
107
+ /* @__PURE__ */ e("hr", { className: s.divider }),
108
+ /* @__PURE__ */ n(o, { flexDirection: "column", gap: 12, children: [
109
+ /* @__PURE__ */ e(a, { variant: "supporting", children: /* @__PURE__ */ e(
110
+ k,
111
+ {
112
+ t: i,
113
+ i18nKey: "taxWithholdingDisclaimer",
114
+ components: { bold: /* @__PURE__ */ e(a, { as: "span", weight: "bold" }) }
115
+ }
116
+ ) }),
117
+ /* @__PURE__ */ e(
118
+ $,
119
+ {
120
+ wageTypeGroups: O,
121
+ config: f,
122
+ onEditClick: T
123
+ }
124
+ ),
125
+ D && /* @__PURE__ */ e(
126
+ B,
127
+ {
128
+ isOpen: !0,
129
+ defaultConfig: f,
130
+ onDone: b,
131
+ onCancel: P
132
+ }
133
+ )
134
+ ] }),
135
+ /* @__PURE__ */ e(o, { justifyContent: "flex-end", gap: 12, children: /* @__PURE__ */ e(E, { type: "submit", isLoading: u, isDisabled: u, children: i("continueCta") }) })
117
136
  ] });
118
137
  }
119
138
  export {
120
- oe as OffCycleCreationPresentation
139
+ te as OffCycleCreationPresentation
121
140
  };
122
141
  //# sourceMappingURL=OffCycleCreationPresentation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OffCycleCreationPresentation.js","sources":["../../../../src/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.tsx"],"sourcesContent":["import { useCallback, useMemo } from 'react'\nimport { useFormContext } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { OffCycleReasonSelectionPresentation } from '../OffCycleReasonSelection'\nimport { OffCyclePayPeriodDateFormPresentation } from '../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation'\nimport { OffCycleTaxWithholdingTable } from '../OffCycleTaxWithholdingTable'\nimport { OffCycleTaxWithholdingModal } from '../OffCycleTaxWithholdingModal'\nimport {\n WAGE_TYPE_CATEGORIES,\n type WageTypeGroup,\n} from '../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes'\nimport type {\n OffCycleCreationFormData,\n OffCycleCreationPresentationProps,\n} from './OffCycleCreationTypes'\nimport styles from './OffCycleCreationPresentation.module.scss'\nimport { useI18n } from '@/i18n'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex, RadioGroupField, SwitchField, MultiSelectComboBoxField } from '@/components/Common'\n\n/** @internal */\nexport function OffCycleCreationPresentation({\n employees,\n isPending,\n taxWithholdingConfig,\n isTaxWithholdingModalOpen,\n onTaxWithholdingEditClick,\n onTaxWithholdingModalDone,\n onTaxWithholdingModalCancel,\n}: OffCycleCreationPresentationProps) {\n useI18n('Payroll.OffCycleCreation')\n useI18n('Payroll.OffCycleDeductionsSetting')\n useI18n('Payroll.EmployeeSelection')\n useI18n('Payroll.OffCycleTaxWithholding')\n const { t } = useTranslation('Payroll.OffCycleCreation')\n const { t: tDeductions } = useTranslation('Payroll.OffCycleDeductionsSetting')\n const { t: tEmployees } = useTranslation('Payroll.EmployeeSelection')\n const { t: tWithholding } = useTranslation('Payroll.OffCycleTaxWithholding')\n const { Heading, Text, Button } = useComponentContext()\n\n const wageTypeGroups: WageTypeGroup[] = useMemo(\n () =>\n WAGE_TYPE_CATEGORIES.map(category => {\n const group: WageTypeGroup = {\n category,\n label: tWithholding(`wageTypeGroups.${category}.label`),\n }\n if (category === 'regular' || category === 'supplemental') {\n group.description = tWithholding(`wageTypeGroups.${category}.description`)\n }\n return group\n }),\n [tWithholding],\n )\n\n const { setValue, watch } = useFormContext<OffCycleCreationFormData>()\n const includeAllEmployees = watch('includeAllEmployees')\n\n const handleToggleIncludeAll = useCallback(\n (checked: boolean) => {\n if (checked) {\n setValue('selectedEmployeeUuids', [])\n }\n },\n [setValue],\n )\n\n const deductionsOptions = [\n {\n value: false,\n label: tDeductions('options.include.label'),\n },\n {\n value: true,\n label: tDeductions('options.skip.label'),\n },\n ]\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Flex flexDirection=\"column\" gap={4}>\n <Heading as=\"h2\">{t('pageTitle')}</Heading>\n <Text variant=\"supporting\">{t('pageDescription')}</Text>\n </Flex>\n\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={4}>\n <Heading as=\"h3\">{t('payPeriodSectionTitle')}</Heading>\n <Text variant=\"supporting\">{t('payPeriodSectionDescription')}</Text>\n </Flex>\n <OffCyclePayPeriodDateFormPresentation />\n </Flex>\n\n <hr className={styles.divider} />\n\n <Flex flexDirection=\"column\" gap={20}>\n <OffCycleReasonSelectionPresentation name=\"reason\" />\n </Flex>\n\n <hr className={styles.divider} />\n\n <Flex flexDirection=\"column\" gap={12}>\n <Heading as=\"h3\">{tEmployees('sectionTitle')}</Heading>\n <SwitchField\n name=\"includeAllEmployees\"\n label={t('includeAllEmployeesLabel')}\n onChange={handleToggleIncludeAll}\n />\n {!includeAllEmployees && (\n <MultiSelectComboBoxField\n name=\"selectedEmployeeUuids\"\n label={tEmployees('sectionTitle')}\n shouldVisuallyHideLabel\n placeholder={tEmployees('searchPlaceholder')}\n options={employees}\n />\n )}\n </Flex>\n\n <hr className={styles.divider} />\n\n <Flex flexDirection=\"column\" gap={20}>\n <RadioGroupField<boolean>\n name=\"skipRegularDeductions\"\n label={tDeductions('title')}\n description={tDeductions('description')}\n options={deductionsOptions}\n convertValueToString={value => String(value)}\n />\n </Flex>\n\n <hr className={styles.divider} />\n\n <OffCycleTaxWithholdingTable\n wageTypeGroups={wageTypeGroups}\n config={taxWithholdingConfig}\n onEditClick={onTaxWithholdingEditClick}\n />\n {isTaxWithholdingModalOpen && (\n <OffCycleTaxWithholdingModal\n isOpen\n defaultConfig={taxWithholdingConfig}\n onDone={onTaxWithholdingModalDone}\n onCancel={onTaxWithholdingModalCancel}\n />\n )}\n\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button type=\"submit\" isLoading={isPending} isDisabled={isPending}>\n {t('continueCta')}\n </Button>\n </Flex>\n </Flex>\n )\n}\n"],"names":["OffCycleCreationPresentation","employees","isPending","taxWithholdingConfig","isTaxWithholdingModalOpen","onTaxWithholdingEditClick","onTaxWithholdingModalDone","onTaxWithholdingModalCancel","useI18n","t","useTranslation","tDeductions","tEmployees","tWithholding","Heading","Text","Button","useComponentContext","wageTypeGroups","useMemo","WAGE_TYPE_CATEGORIES","category","group","setValue","watch","useFormContext","includeAllEmployees","handleToggleIncludeAll","useCallback","checked","deductionsOptions","jsxs","Flex","jsx","OffCyclePayPeriodDateFormPresentation","styles","OffCycleReasonSelectionPresentation","SwitchField","MultiSelectComboBoxField","RadioGroupField","value","OffCycleTaxWithholdingTable","OffCycleTaxWithholdingModal"],"mappings":";;;;;;;;;;;;;;;;AAqBO,SAASA,GAA6B;AAAA,EAC3C,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,6BAAAC;AACF,GAAsC;AACpC,EAAAC,EAAQ,0BAA0B,GAClCA,EAAQ,mCAAmC,GAC3CA,EAAQ,2BAA2B,GACnCA,EAAQ,gCAAgC;AACxC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,0BAA0B,GACjD,EAAEC,MAAmBD,EAAe,mCAAmC,GACvE,EAAE,GAAGE,MAAeF,EAAe,2BAA2B,GAC9D,EAAE,GAAGG,MAAiBH,EAAe,gCAAgC,GACrE,EAAE,SAAAI,GAAS,MAAAC,GAAM,QAAAC,EAAA,IAAWC,EAAA,GAE5BC,IAAkCC;AAAA,IACtC,MACEC,EAAqB,IAAI,CAAAC,MAAY;AACnC,YAAMC,IAAuB;AAAA,QAC3B,UAAAD;AAAA,QACA,OAAOR,EAAa,kBAAkBQ,CAAQ,QAAQ;AAAA,MAAA;AAExD,cAAIA,MAAa,aAAaA,MAAa,oBACzCC,EAAM,cAAcT,EAAa,kBAAkBQ,CAAQ,cAAc,IAEpEC;AAAA,IACT,CAAC;AAAA,IACH,CAACT,CAAY;AAAA,EAAA,GAGT,EAAE,UAAAU,GAAU,OAAAC,EAAA,IAAUC,EAAA,GACtBC,IAAsBF,EAAM,qBAAqB,GAEjDG,IAAyBC;AAAA,IAC7B,CAACC,MAAqB;AACpB,MAAIA,KACFN,EAAS,yBAAyB,EAAE;AAAA,IAExC;AAAA,IACA,CAAC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B,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"OffCycleCreationPresentation.js","sources":["../../../../src/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.tsx"],"sourcesContent":["import { useCallback, useMemo } from 'react'\nimport { useFormContext } from 'react-hook-form'\nimport { Trans, useTranslation } from 'react-i18next'\nimport { OffCycleReasonSelectionPresentation } from '../OffCycleReasonSelection'\nimport { OffCyclePayPeriodDateFormPresentation } from '../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation'\nimport { OffCycleTaxWithholdingTable } from '../OffCycleTaxWithholdingTable'\nimport { OffCycleTaxWithholdingModal } from '../OffCycleTaxWithholdingModal'\nimport {\n WAGE_TYPE_CATEGORIES,\n type WageTypeGroup,\n} from '../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes'\nimport type {\n OffCycleCreationFormData,\n OffCycleCreationPresentationProps,\n} from './OffCycleCreationTypes'\nimport styles from './OffCycleCreationPresentation.module.scss'\nimport { useI18n } from '@/i18n'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex, RadioGroupField, SwitchField, MultiSelectComboBoxField } from '@/components/Common'\n\n/** @internal */\nexport function OffCycleCreationPresentation({\n employees,\n isPending,\n minCheckDate,\n minCheckOnlyDate,\n taxWithholdingConfig,\n isTaxWithholdingModalOpen,\n onTaxWithholdingEditClick,\n onTaxWithholdingModalDone,\n onTaxWithholdingModalCancel,\n}: OffCycleCreationPresentationProps) {\n useI18n('Payroll.OffCycleCreation')\n useI18n('Payroll.OffCycleDeductionsSetting')\n useI18n('Payroll.EmployeeSelection')\n useI18n('Payroll.OffCycleTaxWithholding')\n const { t } = useTranslation('Payroll.OffCycleCreation')\n const { t: tDeductions } = useTranslation('Payroll.OffCycleDeductionsSetting')\n const { t: tEmployees } = useTranslation('Payroll.EmployeeSelection')\n const { t: tWithholding } = useTranslation('Payroll.OffCycleTaxWithholding')\n const { Heading, Text, Button } = useComponentContext()\n\n const wageTypeGroups: WageTypeGroup[] = useMemo(\n () =>\n WAGE_TYPE_CATEGORIES.map(category => {\n const group: WageTypeGroup = {\n category,\n label: tWithholding(`wageTypeGroups.${category}.label`),\n taxedAsDescription: tWithholding(`wageTypeGroups.${category}.taxedAsDescription`),\n }\n if (category === 'regular' || category === 'supplemental') {\n group.description = tWithholding(`wageTypeGroups.${category}.description`)\n }\n return group\n }),\n [tWithholding],\n )\n\n const { setValue, watch } = useFormContext<OffCycleCreationFormData>()\n const includeAllEmployees = watch('includeAllEmployees')\n\n const handleToggleIncludeAll = useCallback(\n (checked: boolean) => {\n if (checked) {\n setValue('selectedEmployeeUuids', [])\n }\n },\n [setValue],\n )\n\n const deductionsOptions = [\n {\n value: false,\n label: tDeductions('options.include.label'),\n },\n {\n value: true,\n label: tDeductions('options.skip.label'),\n },\n ]\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Flex flexDirection=\"column\" gap={4}>\n <Heading as=\"h2\">{t('pageTitle')}</Heading>\n <Text variant=\"supporting\">{t('pageDescription')}</Text>\n </Flex>\n\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={4}>\n <Heading as=\"h3\">{t('payPeriodSectionTitle')}</Heading>\n <Text variant=\"supporting\">{t('payPeriodSectionDescription')}</Text>\n </Flex>\n <OffCyclePayPeriodDateFormPresentation\n minCheckDate={minCheckDate}\n minCheckOnlyDate={minCheckOnlyDate}\n />\n </Flex>\n\n <hr className={styles.divider} />\n\n <Flex flexDirection=\"column\" gap={20}>\n <OffCycleReasonSelectionPresentation name=\"reason\" />\n </Flex>\n\n <hr className={styles.divider} />\n\n <Flex flexDirection=\"column\" gap={12}>\n <Heading as=\"h3\">{tEmployees('sectionTitle')}</Heading>\n <SwitchField\n name=\"includeAllEmployees\"\n label={t('includeAllEmployeesLabel')}\n onChange={handleToggleIncludeAll}\n />\n {!includeAllEmployees && (\n <MultiSelectComboBoxField\n name=\"selectedEmployeeUuids\"\n label={tEmployees('sectionTitle')}\n shouldVisuallyHideLabel\n placeholder={tEmployees('searchPlaceholder')}\n options={employees}\n />\n )}\n </Flex>\n\n <hr className={styles.divider} />\n\n <Flex flexDirection=\"column\" gap={20}>\n <RadioGroupField<boolean>\n name=\"skipRegularDeductions\"\n label={tDeductions('title')}\n description={tDeductions('description')}\n options={deductionsOptions}\n convertValueToString={value => String(value)}\n />\n </Flex>\n\n <hr className={styles.divider} />\n\n <Flex flexDirection=\"column\" gap={12}>\n <Text variant=\"supporting\">\n <Trans\n t={t}\n i18nKey=\"taxWithholdingDisclaimer\"\n components={{ bold: <Text as=\"span\" weight=\"bold\" /> }}\n />\n </Text>\n <OffCycleTaxWithholdingTable\n wageTypeGroups={wageTypeGroups}\n config={taxWithholdingConfig}\n onEditClick={onTaxWithholdingEditClick}\n />\n {isTaxWithholdingModalOpen && (\n <OffCycleTaxWithholdingModal\n isOpen\n defaultConfig={taxWithholdingConfig}\n onDone={onTaxWithholdingModalDone}\n onCancel={onTaxWithholdingModalCancel}\n />\n )}\n </Flex>\n\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button type=\"submit\" isLoading={isPending} isDisabled={isPending}>\n {t('continueCta')}\n </Button>\n </Flex>\n </Flex>\n )\n}\n"],"names":["OffCycleCreationPresentation","employees","isPending","minCheckDate","minCheckOnlyDate","taxWithholdingConfig","isTaxWithholdingModalOpen","onTaxWithholdingEditClick","onTaxWithholdingModalDone","onTaxWithholdingModalCancel","useI18n","t","useTranslation","tDeductions","tEmployees","tWithholding","Heading","Text","Button","useComponentContext","wageTypeGroups","useMemo","WAGE_TYPE_CATEGORIES","category","group","setValue","watch","useFormContext","includeAllEmployees","handleToggleIncludeAll","useCallback","checked","deductionsOptions","jsxs","Flex","jsx","OffCyclePayPeriodDateFormPresentation","styles","OffCycleReasonSelectionPresentation","SwitchField","MultiSelectComboBoxField","RadioGroupField","value","Trans","OffCycleTaxWithholdingTable","OffCycleTaxWithholdingModal"],"mappings":";;;;;;;;;;;;;;;;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AAA;AAAA,UACC,QAAM;AAAA,UACN,eAAexC;AAAA,UACf,QAAQG;AAAA,UACR,UAAUC;AAAA,QAAA;AAAA,MAAA;AAAA,IACZ,GAEJ;AAAA,sBAECyB,GAAA,EAAK,gBAAe,YAAW,KAAK,IACnC,UAAA,gBAAAC,EAACjB,GAAA,EAAO,MAAK,UAAS,WAAWhB,GAAW,YAAYA,GACrD,UAAAS,EAAE,aAAa,GAClB,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
@@ -35,6 +35,10 @@ export interface OffCycleCreationPresentationProps {
35
35
  employees: MultiSelectComboBoxOption[];
36
36
  /** Whether the off-cycle create mutation is in flight. */
37
37
  isPending?: boolean;
38
+ /** Earliest selectable payment date for direct deposit (today plus the ACH lead time). */
39
+ minCheckDate: Date;
40
+ /** Earliest selectable payment date when the payroll is check-only (today). */
41
+ minCheckOnlyDate: Date;
38
42
  /** Current tax withholding configuration shown in the table. */
39
43
  taxWithholdingConfig: OffCycleTaxWithholdingConfig;
40
44
  /** Whether the tax withholding edit modal is open. */
@@ -16,4 +16,4 @@ import { OffCycleDeductionsSettingProps } from './types';
16
16
  * @returns The rendered radio group.
17
17
  * @public
18
18
  */
19
- export declare function OffCycleDeductionsSetting({ dictionary, skipRegularDeductions, onEvent, }: OffCycleDeductionsSettingProps): import("react").JSX.Element;
19
+ export declare function OffCycleDeductionsSetting(props: OffCycleDeductionsSettingProps): import("react").JSX.Element;
@@ -1,16 +1,18 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import { useMemo as u } from "react";
3
- import { useTranslation as a } from "react-i18next";
4
- import { useComponentDictionary as m, useI18n as f } from "../../../i18n/I18n.js";
5
- import { componentEvents as d } from "../../../shared/constants.js";
6
- import { useComponentContext as C } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
- function S({
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { useMemo as a } from "react";
3
+ import { useTranslation as p } from "react-i18next";
4
+ import { BaseBoundaries as f } from "../../Base/Base.js";
5
+ import "../../Base/useBase.js";
6
+ import { useComponentDictionary as m, useI18n as d } from "../../../i18n/I18n.js";
7
+ import { componentEvents as C } from "../../../shared/constants.js";
8
+ import { useComponentContext as y } from "../../../contexts/ComponentAdapter/useComponentContext.js";
9
+ function D({
8
10
  dictionary: o,
9
- skipRegularDeductions: t,
10
- onEvent: n
11
+ skipRegularDeductions: n,
12
+ onEvent: i
11
13
  }) {
12
- m("Payroll.OffCycleDeductionsSetting", o), f("Payroll.OffCycleDeductionsSetting");
13
- const { t: e } = a("Payroll.OffCycleDeductionsSetting"), { RadioGroup: i } = C(), l = u(
14
+ m("Payroll.OffCycleDeductionsSetting", o), d("Payroll.OffCycleDeductionsSetting");
15
+ const { t: e } = p("Payroll.OffCycleDeductionsSetting"), { RadioGroup: l } = y(), s = a(
14
16
  () => [
15
17
  {
16
18
  value: "include",
@@ -22,23 +24,26 @@ function S({
22
24
  }
23
25
  ],
24
26
  [e]
25
- ), s = (c) => {
26
- n(d.OFF_CYCLE_DEDUCTIONS_CHANGE, {
27
- skipRegularDeductions: c === "skip"
27
+ ), r = (u) => {
28
+ i(C.OFF_CYCLE_DEDUCTIONS_CHANGE, {
29
+ skipRegularDeductions: u === "skip"
28
30
  });
29
- }, r = t ? "skip" : "include";
30
- return /* @__PURE__ */ p(
31
- i,
31
+ }, c = n ? "skip" : "include";
32
+ return /* @__PURE__ */ t(
33
+ l,
32
34
  {
33
35
  label: e("title"),
34
36
  description: e("description"),
35
- options: l,
36
- value: r,
37
- onChange: s
37
+ options: s,
38
+ value: c,
39
+ onChange: r
38
40
  }
39
41
  );
40
42
  }
43
+ function P(o) {
44
+ return /* @__PURE__ */ t(f, { componentName: "Payroll.OffCycleDeductionsSetting", children: /* @__PURE__ */ t(D, { ...o }) });
45
+ }
41
46
  export {
42
- S as OffCycleDeductionsSetting
47
+ P as OffCycleDeductionsSetting
43
48
  };
44
49
  //# sourceMappingURL=OffCycleDeductionsSetting.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OffCycleDeductionsSetting.js","sources":["../../../../src/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { OffCycleDeductionsSettingProps } from './types'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ntype DeductionsValue = 'include' | 'skip'\n\n/**\n * Radio control for choosing whether an off-cycle payroll skips regular deductions and contributions.\n *\n * @remarks\n * Taxes are always included regardless of the selection. Selecting \"Skip\" blocks all regular\n * deductions and contributions except 401(k); selecting \"Include\" runs all regular deductions\n * and contributions normally.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `offCycle/deductionsChange` | Fired when the deduction preference changes | {@link OffCycleDeductionsSettingChangePayload} |\n *\n * @param props - {@link OffCycleDeductionsSettingProps}\n * @returns The rendered radio group.\n * @public\n */\nexport function OffCycleDeductionsSetting({\n dictionary,\n skipRegularDeductions,\n onEvent,\n}: OffCycleDeductionsSettingProps) {\n useComponentDictionary('Payroll.OffCycleDeductionsSetting', dictionary)\n useI18n('Payroll.OffCycleDeductionsSetting')\n\n const { t } = useTranslation('Payroll.OffCycleDeductionsSetting')\n const { RadioGroup } = useComponentContext()\n\n const options = useMemo(\n () => [\n {\n value: 'include' as const,\n label: t('options.include.label'),\n },\n {\n value: 'skip' as const,\n label: t('options.skip.label'),\n },\n ],\n [t],\n )\n\n const handleChange = (value: string) => {\n onEvent(componentEvents.OFF_CYCLE_DEDUCTIONS_CHANGE, {\n skipRegularDeductions: value === 'skip',\n })\n }\n\n const selectedValue: DeductionsValue = skipRegularDeductions ? 'skip' : 'include'\n\n return (\n <RadioGroup\n label={t('title')}\n description={t('description')}\n options={options}\n value={selectedValue}\n onChange={handleChange}\n />\n )\n}\n"],"names":["OffCycleDeductionsSetting","dictionary","skipRegularDeductions","onEvent","useComponentDictionary","useI18n","t","useTranslation","RadioGroup","useComponentContext","options","useMemo","handleChange","value","componentEvents","selectedValue","jsx"],"mappings":";;;;;;AA0BO,SAASA,EAA0B;AAAA,EACxC,YAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,SAAAC;AACF,GAAmC;AACjC,EAAAC,EAAuB,qCAAqCH,CAAU,GACtEI,EAAQ,mCAAmC;AAE3C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mCAAmC,GAC1D,EAAE,YAAAC,EAAA,IAAeC,EAAA,GAEjBC,IAAUC;AAAA,IACd,MAAM;AAAA,MACJ;AAAA,QACE,OAAO;AAAA,QACP,OAAOL,EAAE,uBAAuB;AAAA,MAAA;AAAA,MAElC;AAAA,QACE,OAAO;AAAA,QACP,OAAOA,EAAE,oBAAoB;AAAA,MAAA;AAAA,IAC/B;AAAA,IAEF,CAACA,CAAC;AAAA,EAAA,GAGEM,IAAe,CAACC,MAAkB;AACtC,IAAAV,EAAQW,EAAgB,6BAA6B;AAAA,MACnD,uBAAuBD,MAAU;AAAA,IAAA,CAClC;AAAA,EACH,GAEME,IAAiCb,IAAwB,SAAS;AAExE,SACE,gBAAAc;AAAA,IAACR;AAAA,IAAA;AAAA,MACC,OAAOF,EAAE,OAAO;AAAA,MAChB,aAAaA,EAAE,aAAa;AAAA,MAC5B,SAAAI;AAAA,MACA,OAAOK;AAAA,MACP,UAAUH;AAAA,IAAA;AAAA,EAAA;AAGhB;"}
1
+ {"version":3,"file":"OffCycleDeductionsSetting.js","sources":["../../../../src/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { OffCycleDeductionsSettingProps } from './types'\nimport { BaseBoundaries } from '@/components/Base'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ntype DeductionsValue = 'include' | 'skip'\n\nfunction OffCycleDeductionsSettingRoot({\n dictionary,\n skipRegularDeductions,\n onEvent,\n}: OffCycleDeductionsSettingProps) {\n useComponentDictionary('Payroll.OffCycleDeductionsSetting', dictionary)\n useI18n('Payroll.OffCycleDeductionsSetting')\n\n const { t } = useTranslation('Payroll.OffCycleDeductionsSetting')\n const { RadioGroup } = useComponentContext()\n\n const options = useMemo(\n () => [\n {\n value: 'include' as const,\n label: t('options.include.label'),\n },\n {\n value: 'skip' as const,\n label: t('options.skip.label'),\n },\n ],\n [t],\n )\n\n const handleChange = (value: string) => {\n onEvent(componentEvents.OFF_CYCLE_DEDUCTIONS_CHANGE, {\n skipRegularDeductions: value === 'skip',\n })\n }\n\n const selectedValue: DeductionsValue = skipRegularDeductions ? 'skip' : 'include'\n\n return (\n <RadioGroup\n label={t('title')}\n description={t('description')}\n options={options}\n value={selectedValue}\n onChange={handleChange}\n />\n )\n}\n\n/**\n * Radio control for choosing whether an off-cycle payroll skips regular deductions and contributions.\n *\n * @remarks\n * Taxes are always included regardless of the selection. Selecting \"Skip\" blocks all regular\n * deductions and contributions except 401(k); selecting \"Include\" runs all regular deductions\n * and contributions normally.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `offCycle/deductionsChange` | Fired when the deduction preference changes | {@link OffCycleDeductionsSettingChangePayload} |\n *\n * @param props - {@link OffCycleDeductionsSettingProps}\n * @returns The rendered radio group.\n * @public\n */\nexport function OffCycleDeductionsSetting(props: OffCycleDeductionsSettingProps) {\n return (\n <BaseBoundaries componentName=\"Payroll.OffCycleDeductionsSetting\">\n <OffCycleDeductionsSettingRoot {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["OffCycleDeductionsSettingRoot","dictionary","skipRegularDeductions","onEvent","useComponentDictionary","useI18n","t","useTranslation","RadioGroup","useComponentContext","options","useMemo","handleChange","value","componentEvents","selectedValue","jsx","OffCycleDeductionsSetting","props","BaseBoundaries"],"mappings":";;;;;;;;AAUA,SAASA,EAA8B;AAAA,EACrC,YAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,SAAAC;AACF,GAAmC;AACjC,EAAAC,EAAuB,qCAAqCH,CAAU,GACtEI,EAAQ,mCAAmC;AAE3C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mCAAmC,GAC1D,EAAE,YAAAC,EAAA,IAAeC,EAAA,GAEjBC,IAAUC;AAAA,IACd,MAAM;AAAA,MACJ;AAAA,QACE,OAAO;AAAA,QACP,OAAOL,EAAE,uBAAuB;AAAA,MAAA;AAAA,MAElC;AAAA,QACE,OAAO;AAAA,QACP,OAAOA,EAAE,oBAAoB;AAAA,MAAA;AAAA,IAC/B;AAAA,IAEF,CAACA,CAAC;AAAA,EAAA,GAGEM,IAAe,CAACC,MAAkB;AACtC,IAAAV,EAAQW,EAAgB,6BAA6B;AAAA,MACnD,uBAAuBD,MAAU;AAAA,IAAA,CAClC;AAAA,EACH,GAEME,IAAiCb,IAAwB,SAAS;AAExE,SACE,gBAAAc;AAAA,IAACR;AAAA,IAAA;AAAA,MACC,OAAOF,EAAE,OAAO;AAAA,MAChB,aAAaA,EAAE,aAAa;AAAA,MAC5B,SAAAI;AAAA,MACA,OAAOK;AAAA,MACP,UAAUH;AAAA,IAAA;AAAA,EAAA;AAGhB;AAmBO,SAASK,EAA0BC,GAAuC;AAC/E,SACE,gBAAAF,EAACG,KAAe,eAAc,qCAC5B,4BAACnB,GAAA,EAA+B,GAAGkB,GAAO,EAAA,CAC5C;AAEJ;"}
@@ -1,2 +1,9 @@
1
1
  /** @internal */
2
- export declare function OffCyclePayPeriodDateFormPresentation(): import("react").JSX.Element;
2
+ export interface OffCyclePayPeriodDateFormPresentationProps {
3
+ /** Earliest selectable payment date for direct deposit (today plus the ACH lead time). */
4
+ minCheckDate: Date;
5
+ /** Earliest selectable payment date when the payroll is check-only (today). */
6
+ minCheckOnlyDate: Date;
7
+ }
8
+ /** @internal */
9
+ export declare function OffCyclePayPeriodDateFormPresentation({ minCheckDate, minCheckOnlyDate, }: OffCyclePayPeriodDateFormPresentationProps): import("react").JSX.Element;
@@ -1,20 +1,32 @@
1
- import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
- import { useTranslation as l } from "react-i18next";
3
- import r from "./OffCyclePayPeriodDateFormPresentation.module.scss.js";
4
- import { useI18n as o } from "../../../i18n/I18n.js";
5
- import { CheckboxField as c } from "../../Common/Fields/CheckboxField/CheckboxField.js";
6
- import { DatePickerField as t } from "../../Common/Fields/DatePickerField/DatePickerField.js";
7
- function D() {
8
- o("Payroll.OffCyclePayPeriodDateForm");
9
- const { t: e } = l("Payroll.OffCyclePayPeriodDateForm");
10
- return /* @__PURE__ */ i("div", { className: r.root, children: [
11
- /* @__PURE__ */ i("div", { className: r.dateFields, children: [
12
- /* @__PURE__ */ a(t, { name: "startDate", label: e("startDateLabel"), isRequired: !0 }),
13
- /* @__PURE__ */ a(t, { name: "endDate", label: e("endDateLabel"), isRequired: !0 })
1
+ import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
+ import { useFormContext as s, useWatch as m } from "react-hook-form";
3
+ import { useTranslation as d } from "react-i18next";
4
+ import a from "./OffCyclePayPeriodDateFormPresentation.module.scss.js";
5
+ import { useI18n as h } from "../../../i18n/I18n.js";
6
+ import { CheckboxField as y } from "../../Common/Fields/CheckboxField/CheckboxField.js";
7
+ import { DatePickerField as r } from "../../Common/Fields/DatePickerField/DatePickerField.js";
8
+ function O({
9
+ minCheckDate: o,
10
+ minCheckOnlyDate: l
11
+ }) {
12
+ h("Payroll.OffCyclePayPeriodDateForm");
13
+ const { t: e } = d("Payroll.OffCyclePayPeriodDateForm"), { control: c } = s(), n = m({ control: c, name: "isCheckOnly" }) ? l : o;
14
+ return /* @__PURE__ */ i("div", { className: a.root, children: [
15
+ /* @__PURE__ */ i("div", { className: a.dateFields, children: [
16
+ /* @__PURE__ */ t(r, { name: "startDate", label: e("startDateLabel"), isRequired: !0 }),
17
+ /* @__PURE__ */ t(r, { name: "endDate", label: e("endDateLabel"), isRequired: !0 })
14
18
  ] }),
15
- /* @__PURE__ */ a("div", { className: r.checkDateField, children: /* @__PURE__ */ a(t, { name: "checkDate", label: e("checkDateLabel"), isRequired: !0 }) }),
16
- /* @__PURE__ */ a(
17
- c,
19
+ /* @__PURE__ */ t("div", { className: a.checkDateField, children: /* @__PURE__ */ t(
20
+ r,
21
+ {
22
+ name: "checkDate",
23
+ label: e("checkDateLabel"),
24
+ isRequired: !0,
25
+ minDate: n
26
+ }
27
+ ) }),
28
+ /* @__PURE__ */ t(
29
+ y,
18
30
  {
19
31
  name: "isCheckOnly",
20
32
  label: e("checkOnlyLabel"),
@@ -24,6 +36,6 @@ function D() {
24
36
  ] });
25
37
  }
26
38
  export {
27
- D as OffCyclePayPeriodDateFormPresentation
39
+ O as OffCyclePayPeriodDateFormPresentation
28
40
  };
29
41
  //# sourceMappingURL=OffCyclePayPeriodDateFormPresentation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OffCyclePayPeriodDateFormPresentation.js","sources":["../../../../src/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport styles from './OffCyclePayPeriodDateFormPresentation.module.scss'\nimport { useI18n } from '@/i18n'\nimport { CheckboxField, DatePickerField } from '@/components/Common'\n\n/** @internal */\nexport function OffCyclePayPeriodDateFormPresentation() {\n useI18n('Payroll.OffCyclePayPeriodDateForm')\n const { t } = useTranslation('Payroll.OffCyclePayPeriodDateForm')\n\n return (\n <div className={styles.root}>\n <div className={styles.dateFields}>\n <DatePickerField name=\"startDate\" label={t('startDateLabel')} isRequired />\n <DatePickerField name=\"endDate\" label={t('endDateLabel')} isRequired />\n </div>\n\n <div className={styles.checkDateField}>\n <DatePickerField name=\"checkDate\" label={t('checkDateLabel')} isRequired />\n </div>\n\n <CheckboxField\n name=\"isCheckOnly\"\n label={t('checkOnlyLabel')}\n description={t('checkOnlyDescription')}\n />\n </div>\n )\n}\n"],"names":["OffCyclePayPeriodDateFormPresentation","useI18n","t","useTranslation","jsxs","styles","jsx","DatePickerField","CheckboxField"],"mappings":";;;;;;AAMO,SAASA,IAAwC;AACtD,EAAAC,EAAQ,mCAAmC;AAC3C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mCAAmC;AAEhE,SACE,gBAAAC,EAAC,OAAA,EAAI,WAAWC,EAAO,MACrB,UAAA;AAAA,IAAA,gBAAAD,EAAC,OAAA,EAAI,WAAWC,EAAO,YACrB,UAAA;AAAA,MAAA,gBAAAC,EAACC,GAAA,EAAgB,MAAK,aAAY,OAAOL,EAAE,gBAAgB,GAAG,YAAU,IAAC;AAAA,MACzE,gBAAAI,EAACC,KAAgB,MAAK,WAAU,OAAOL,EAAE,cAAc,GAAG,YAAU,GAAA,CAAC;AAAA,IAAA,GACvE;AAAA,IAEA,gBAAAI,EAAC,OAAA,EAAI,WAAWD,EAAO,gBACrB,UAAA,gBAAAC,EAACC,GAAA,EAAgB,MAAK,aAAY,OAAOL,EAAE,gBAAgB,GAAG,YAAU,IAAC,GAC3E;AAAA,IAEA,gBAAAI;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAON,EAAE,gBAAgB;AAAA,QACzB,aAAaA,EAAE,sBAAsB;AAAA,MAAA;AAAA,IAAA;AAAA,EACvC,GACF;AAEJ;"}
1
+ {"version":3,"file":"OffCyclePayPeriodDateFormPresentation.js","sources":["../../../../src/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.tsx"],"sourcesContent":["import { useFormContext, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type { OffCyclePayPeriodDateFormData } from './OffCyclePayPeriodDateFormTypes'\nimport styles from './OffCyclePayPeriodDateFormPresentation.module.scss'\nimport { useI18n } from '@/i18n'\nimport { CheckboxField, DatePickerField } from '@/components/Common'\n\n/** @internal */\nexport interface OffCyclePayPeriodDateFormPresentationProps {\n /** Earliest selectable payment date for direct deposit (today plus the ACH lead time). */\n minCheckDate: Date\n /** Earliest selectable payment date when the payroll is check-only (today). */\n minCheckOnlyDate: Date\n}\n\n/** @internal */\nexport function OffCyclePayPeriodDateFormPresentation({\n minCheckDate,\n minCheckOnlyDate,\n}: OffCyclePayPeriodDateFormPresentationProps) {\n useI18n('Payroll.OffCyclePayPeriodDateForm')\n const { t } = useTranslation('Payroll.OffCyclePayPeriodDateForm')\n\n const { control } = useFormContext<OffCyclePayPeriodDateFormData>()\n const isCheckOnly = useWatch({ control, name: 'isCheckOnly' })\n\n // Mirrors the resolver's own `isCheckOnly ? today : minCheckDate` so the picker and the\n // validation agree. Without a minDate the rule existed only as a submit-time error, and\n // legacy gws-flows disables invalid dates in the picker (SDK-1274). Checking \"check-only\"\n // has to widen the bound back to today, live.\n const checkDateMinimum = isCheckOnly ? minCheckOnlyDate : minCheckDate\n\n return (\n <div className={styles.root}>\n <div className={styles.dateFields}>\n <DatePickerField name=\"startDate\" label={t('startDateLabel')} isRequired />\n <DatePickerField name=\"endDate\" label={t('endDateLabel')} isRequired />\n </div>\n\n <div className={styles.checkDateField}>\n <DatePickerField\n name=\"checkDate\"\n label={t('checkDateLabel')}\n isRequired\n minDate={checkDateMinimum}\n />\n </div>\n\n <CheckboxField\n name=\"isCheckOnly\"\n label={t('checkOnlyLabel')}\n description={t('checkOnlyDescription')}\n />\n </div>\n )\n}\n"],"names":["OffCyclePayPeriodDateFormPresentation","minCheckDate","minCheckOnlyDate","useI18n","t","useTranslation","control","useFormContext","checkDateMinimum","useWatch","jsxs","styles","jsx","DatePickerField","CheckboxField"],"mappings":";;;;;;;AAgBO,SAASA,EAAsC;AAAA,EACpD,cAAAC;AAAA,EACA,kBAAAC;AACF,GAA+C;AAC7C,EAAAC,EAAQ,mCAAmC;AAC3C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mCAAmC,GAE1D,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAOdC,IANcC,EAAS,EAAE,SAAAH,GAAS,MAAM,eAAe,IAMtBJ,IAAmBD;AAE1D,SACE,gBAAAS,EAAC,OAAA,EAAI,WAAWC,EAAO,MACrB,UAAA;AAAA,IAAA,gBAAAD,EAAC,OAAA,EAAI,WAAWC,EAAO,YACrB,UAAA;AAAA,MAAA,gBAAAC,EAACC,GAAA,EAAgB,MAAK,aAAY,OAAOT,EAAE,gBAAgB,GAAG,YAAU,IAAC;AAAA,MACzE,gBAAAQ,EAACC,KAAgB,MAAK,WAAU,OAAOT,EAAE,cAAc,GAAG,YAAU,GAAA,CAAC;AAAA,IAAA,GACvE;AAAA,IAEA,gBAAAQ,EAAC,OAAA,EAAI,WAAWD,EAAO,gBACrB,UAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOT,EAAE,gBAAgB;AAAA,QACzB,YAAU;AAAA,QACV,SAASI;AAAA,MAAA;AAAA,IAAA,GAEb;AAAA,IAEA,gBAAAI;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOV,EAAE,gBAAgB;AAAA,QACzB,aAAaA,EAAE,sBAAsB;AAAA,MAAA;AAAA,IAAA;AAAA,EACvC,GACF;AAEJ;"}
@@ -1,45 +1,48 @@
1
- import { jsxs as l, jsx as a } from "react/jsx-runtime";
1
+ import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
2
  import { useTranslation as f } from "react-i18next";
3
3
  import n from "./OffCycleTaxWithholdingTable.module.scss.js";
4
4
  import { WITHHOLDING_PAY_PERIOD_I18N_KEY as b } from "./OffCycleTaxWithholdingTableTypes.js";
5
5
  import { useComponentContext as g } from "../../../contexts/ComponentAdapter/useComponentContext.js";
6
6
  import { useI18n as u } from "../../../i18n/I18n.js";
7
7
  function k({
8
- wageTypeGroups: s,
9
- config: i,
8
+ wageTypeGroups: o,
9
+ config: r,
10
10
  onEditClick: d
11
11
  }) {
12
12
  u("Payroll.OffCycleTaxWithholding");
13
- const { t: e } = f("Payroll.OffCycleTaxWithholding"), { Table: c, Button: h, Heading: y, Text: r } = g(), o = e(
14
- b[i.withholdingPayPeriod]
15
- ).toLowerCase(), m = {
16
- regular: e("table.taxedAsRegular", { frequency: o }),
17
- supplemental: i.withholdingRate === "supplemental" ? e("table.taxedAsSupplemental") : e("table.taxedAsRegular", { frequency: o }),
13
+ const { t: e } = f("Payroll.OffCycleTaxWithholding"), { Table: c, Button: h, Heading: m, Text: l } = g(), s = e(
14
+ b[r.withholdingPayPeriod]
15
+ ).toLowerCase(), y = {
16
+ regular: e("table.taxedAsRegular", { frequency: s }),
17
+ supplemental: r.withholdingRate === "supplemental" ? e("table.taxedAsSupplemental") : e("table.taxedAsRegular", { frequency: s }),
18
18
  reimbursement: e("table.taxedAsNotTaxed")
19
19
  }, p = [
20
20
  { key: "wage-types", content: e("table.headers.wageTypes") },
21
21
  { key: "taxed-as", content: e("table.headers.taxedAs") }
22
- ], x = s.map((t) => ({
22
+ ], x = o.map((t) => ({
23
23
  key: t.category,
24
24
  data: [
25
25
  {
26
26
  key: `${t.category}-type`,
27
- content: /* @__PURE__ */ l("div", { className: n.wageTypeCell, children: [
28
- /* @__PURE__ */ a(r, { weight: "semibold", children: t.label }),
29
- t.description && /* @__PURE__ */ a(r, { variant: "supporting", children: t.description })
27
+ content: /* @__PURE__ */ i("div", { className: n.wageTypeCell, children: [
28
+ /* @__PURE__ */ a(l, { weight: "semibold", children: t.label }),
29
+ t.description && /* @__PURE__ */ a(l, { variant: "supporting", children: t.description })
30
30
  ] })
31
31
  },
32
32
  {
33
33
  key: `${t.category}-taxed-as`,
34
- content: m[t.category]
34
+ content: /* @__PURE__ */ i("div", { className: n.taxedAsCell, children: [
35
+ /* @__PURE__ */ a(l, { children: y[t.category] }),
36
+ t.taxedAsDescription && /* @__PURE__ */ a(l, { variant: "supporting", children: t.taxedAsDescription })
37
+ ] })
35
38
  }
36
39
  ]
37
40
  }));
38
- return /* @__PURE__ */ l("div", { className: n.root, children: [
39
- /* @__PURE__ */ l("div", { className: n.header, children: [
40
- /* @__PURE__ */ l("div", { className: n.headerContent, children: [
41
- /* @__PURE__ */ a(y, { as: "h3", children: e("title") }),
42
- /* @__PURE__ */ a(r, { variant: "supporting", children: e("description") })
41
+ return /* @__PURE__ */ i("div", { className: n.root, children: [
42
+ /* @__PURE__ */ i("div", { className: n.header, children: [
43
+ /* @__PURE__ */ i("div", { className: n.headerContent, children: [
44
+ /* @__PURE__ */ a(m, { as: "h3", children: e("title") }),
45
+ /* @__PURE__ */ a(l, { variant: "supporting", children: e("description") })
43
46
  ] }),
44
47
  /* @__PURE__ */ a(h, { variant: "secondary", onClick: d, children: e("editButton") })
45
48
  ] }),