@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.
- package/CHANGELOG.md +41 -0
- package/dist/components/Common/DataView/DataCards/DataCards.d.ts +2 -1
- package/dist/components/Common/DataView/DataCards/DataCards.js +63 -54
- package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js +14 -12
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js.map +1 -1
- package/dist/components/Common/DataView/DataTable/DataTable.d.ts +2 -1
- package/dist/components/Common/DataView/DataTable/DataTable.js +75 -66
- package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
- package/dist/components/Common/DataView/DataTable/DataTable.module.scss.js +8 -4
- package/dist/components/Common/DataView/DataTable/DataTable.module.scss.js.map +1 -1
- package/dist/components/Common/DataView/DataView.js +18 -17
- package/dist/components/Common/DataView/DataView.js.map +1 -1
- package/dist/components/Common/FieldLayout/FieldLayout.js +6 -6
- package/dist/components/Common/Fieldset/Fieldset.js +6 -6
- package/dist/components/Common/HorizontalFieldLayout/HorizontalFieldLayout.js +6 -6
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.js +58 -49
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.js.map +1 -1
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.module.scss.js +14 -10
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.module.scss.js.map +1 -1
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBoxTypes.d.ts +4 -0
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.d.ts +4 -0
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/List.js +11 -8
- package/dist/components/Company/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +5 -6
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +6 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +27 -25
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +41 -36
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.d.ts +1 -0
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +3 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.d.ts +9 -2
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js +19 -18
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +63 -62
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.js +69 -65
- package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.js.map +1 -1
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +3 -4
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.js +30 -23
- package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.js.map +1 -1
- package/dist/components/Company/StateTaxes/shared/RequirementFields.d.ts +8 -4
- package/dist/components/Company/StateTaxes/shared/RequirementFields.js +13 -12
- package/dist/components/Company/StateTaxes/shared/RequirementFields.js.map +1 -1
- package/dist/components/Company/StateTaxes/shared/prepareRequirements.d.ts +29 -0
- package/dist/components/Company/StateTaxes/shared/prepareRequirements.js +24 -0
- package/dist/components/Company/StateTaxes/shared/prepareRequirements.js.map +1 -0
- package/dist/components/Company/StateTaxes/shared/prepareRequirements.test.d.ts +1 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +68 -55
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +36 -35
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js +116 -116
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.d.ts +4 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js +19 -19
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js +16 -13
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.d.ts +4 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js +84 -96
- package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js.map +1 -1
- package/dist/components/Flow/Flow.js +22 -22
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/Flow/useFlow.js +3 -3
- package/dist/components/InformationRequests/InformationRequests.d.ts +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +68 -53
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +2 -3
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +87 -81
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +86 -67
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +4 -0
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.d.ts +1 -1
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js +26 -21
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.d.ts +8 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +29 -17
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js +21 -18
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.module.scss.js +9 -7
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.module.scss.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts +2 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +200 -199
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +3 -2
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +32 -32
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +254 -243
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +83 -76
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +23 -22
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +108 -97
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +38 -37
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +8 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +196 -174
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +3 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +173 -163
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/helpers.d.ts +0 -15
- package/dist/components/Payroll/helpers.js +13 -18
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +8 -9
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/helpers/openPdfInNewTab.d.ts +15 -0
- package/dist/helpers/openPdfInNewTab.js +28 -0
- package/dist/helpers/openPdfInNewTab.js.map +1 -0
- package/dist/i18n/en/Company.DocumentList.json.js +34 -32
- package/dist/i18n/en/Company.DocumentList.json.js.map +1 -1
- package/dist/i18n/en/Company.StateTaxes.json.js +1 -1
- package/dist/i18n/en/Employee.DocumentSigner.json.js +24 -22
- package/dist/i18n/en/Employee.DocumentSigner.json.js.map +1 -1
- package/dist/i18n/en/Payroll.OffCycleCreation.json.js +11 -9
- package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -1
- package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js +7 -7
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +29 -27
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +41 -39
- package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
- package/dist/i18n/types.d.ts +331 -1
- package/dist/style.css +1 -1
- 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;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ACH,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,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,IAAg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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
|
|
3
|
-
import { useFormContext as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { OffCyclePayPeriodDateFormPresentation as
|
|
6
|
-
import { WAGE_TYPE_CATEGORIES as
|
|
7
|
-
import
|
|
8
|
-
import { useI18n as
|
|
9
|
-
import { useComponentContext as
|
|
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
|
|
12
|
-
import { SwitchField as
|
|
13
|
-
import { MultiSelectComboBoxField as
|
|
14
|
-
import { RadioGroupField as
|
|
15
|
-
import { OffCycleTaxWithholdingTable as
|
|
16
|
-
import { OffCycleTaxWithholdingModal as
|
|
17
|
-
function
|
|
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:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
27
|
-
const { t: i } =
|
|
28
|
-
() =>
|
|
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:
|
|
33
|
+
label: r(`wageTypeGroups.${l}.label`),
|
|
34
|
+
taxedAsDescription: r(`wageTypeGroups.${l}.taxedAsDescription`)
|
|
32
35
|
};
|
|
33
|
-
return (l === "regular" || l === "supplemental") && (y.description =
|
|
36
|
+
return (l === "regular" || l === "supplemental") && (y.description = r(`wageTypeGroups.${l}.description`)), y;
|
|
34
37
|
}),
|
|
35
|
-
[
|
|
36
|
-
), { setValue: h, watch:
|
|
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
|
-
),
|
|
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(
|
|
54
|
-
/* @__PURE__ */ e(
|
|
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(
|
|
59
|
-
/* @__PURE__ */ e(
|
|
61
|
+
/* @__PURE__ */ e(m, { as: "h3", children: i("payPeriodSectionTitle") }),
|
|
62
|
+
/* @__PURE__ */ e(a, { variant: "supporting", children: i("payPeriodSectionDescription") })
|
|
60
63
|
] }),
|
|
61
|
-
/* @__PURE__ */ e(
|
|
64
|
+
/* @__PURE__ */ e(
|
|
65
|
+
N,
|
|
66
|
+
{
|
|
67
|
+
minCheckDate: C,
|
|
68
|
+
minCheckOnlyDate: x
|
|
69
|
+
}
|
|
70
|
+
)
|
|
62
71
|
] }),
|
|
63
|
-
/* @__PURE__ */ e("hr", { className:
|
|
64
|
-
/* @__PURE__ */ e(o, { flexDirection: "column", gap: 20, children: /* @__PURE__ */ e(
|
|
65
|
-
/* @__PURE__ */ e("hr", { className:
|
|
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(
|
|
76
|
+
/* @__PURE__ */ e(m, { as: "h3", children: d("sectionTitle") }),
|
|
68
77
|
/* @__PURE__ */ e(
|
|
69
|
-
|
|
78
|
+
L,
|
|
70
79
|
{
|
|
71
80
|
name: "includeAllEmployees",
|
|
72
81
|
label: i("includeAllEmployeesLabel"),
|
|
73
|
-
onChange:
|
|
82
|
+
onChange: A
|
|
74
83
|
}
|
|
75
84
|
),
|
|
76
|
-
!
|
|
77
|
-
|
|
85
|
+
!v && /* @__PURE__ */ e(
|
|
86
|
+
M,
|
|
78
87
|
{
|
|
79
88
|
name: "selectedEmployeeUuids",
|
|
80
|
-
label:
|
|
89
|
+
label: d("sectionTitle"),
|
|
81
90
|
shouldVisuallyHideLabel: !0,
|
|
82
|
-
placeholder:
|
|
91
|
+
placeholder: d("searchPlaceholder"),
|
|
83
92
|
options: g
|
|
84
93
|
}
|
|
85
94
|
)
|
|
86
95
|
] }),
|
|
87
|
-
/* @__PURE__ */ e("hr", { className:
|
|
96
|
+
/* @__PURE__ */ e("hr", { className: s.divider }),
|
|
88
97
|
/* @__PURE__ */ e(o, { flexDirection: "column", gap: 20, children: /* @__PURE__ */ e(
|
|
89
|
-
|
|
98
|
+
V,
|
|
90
99
|
{
|
|
91
100
|
name: "skipRegularDeductions",
|
|
92
101
|
label: t("title"),
|
|
93
102
|
description: t("description"),
|
|
94
|
-
options:
|
|
103
|
+
options: w,
|
|
95
104
|
convertValueToString: (l) => String(l)
|
|
96
105
|
}
|
|
97
106
|
) }),
|
|
98
|
-
/* @__PURE__ */ e("hr", { className:
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
-
|
|
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;AA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AK;AAAA,UACL,OAAO1B,EAAW,cAAc;AAAA,UAChC,yBAAuB;AAAA,UACvB,aAAaA,EAAW,mBAAmB;AAAA,UAC3C,SAASX;AAAA,QAAA;AAAA,MAAA;AAAA,IACX,GAEJ;AAAA,IAEA,gBAAAgC,EAAC,MAAA,EAAG,WAAWE,EAAO,QAAA,CAAS;AAAA,IAE/B,gBAAAF,EAACD,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAC;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAO5B,EAAY,OAAO;AAAA,QAC1B,aAAaA,EAAY,aAAa;AAAA,QACtC,SAASmB;AAAA,QACT,sBAAsB,CAAAU,MAAS,OAAOA,CAAK;AAAA,MAAA;AAAA,IAAA,GAE/C;AAAA,IAEA,gBAAAP,EAAC,MAAA,EAAG,WAAWE,EAAO,QAAA,CAAS;AAAA,IAE/B,gBAAAF;AAAA,MAACQ;AAAA,MAAA;AAAA,QACC,gBAAAvB;AAAA,QACA,QAAQf;AAAA,QACR,aAAaE;AAAA,MAAA;AAAA,IAAA;AAAA,IAEdD,KACC,gBAAA6B;AAAA,MAACS;AAAA,MAAA;AAAA,QACC,QAAM;AAAA,QACN,eAAevC;AAAA,QACf,QAAQG;AAAA,QACR,UAAUC;AAAA,MAAA;AAAA,IAAA;AAAA,sBAIbyB,GAAA,EAAK,gBAAe,YAAW,KAAK,IACnC,UAAA,gBAAAC,EAACjB,GAAA,EAAO,MAAK,UAAS,WAAWd,GAAW,YAAYA,GACrD,UAAAO,EAAE,aAAa,GAClB,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":";;;;;;;;;;;;;;;;AAqBO,SAASA,GAA6B;AAAA,EAC3C,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,6BAAAC;AACF,GAAsC;AACpC,EAAAC,EAAQ,0BAA0B,GAClCA,EAA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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(
|
|
19
|
+
export declare function OffCycleDeductionsSetting(props: OffCycleDeductionsSettingProps): import("react").JSX.Element;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
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:
|
|
10
|
-
onEvent:
|
|
11
|
+
skipRegularDeductions: n,
|
|
12
|
+
onEvent: i
|
|
11
13
|
}) {
|
|
12
|
-
m("Payroll.OffCycleDeductionsSetting", o),
|
|
13
|
-
const { t: e } =
|
|
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
|
-
),
|
|
26
|
-
|
|
27
|
-
skipRegularDeductions:
|
|
27
|
+
), r = (u) => {
|
|
28
|
+
i(C.OFF_CYCLE_DEDUCTIONS_CHANGE, {
|
|
29
|
+
skipRegularDeductions: u === "skip"
|
|
28
30
|
});
|
|
29
|
-
},
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
|
|
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:
|
|
36
|
-
value:
|
|
37
|
-
onChange:
|
|
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
|
-
|
|
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\
|
|
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;"}
|
package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.d.ts
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
/** @internal */
|
|
2
|
-
export
|
|
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;
|
package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js
CHANGED
|
@@ -1,20 +1,32 @@
|
|
|
1
|
-
import { jsxs as i, jsx as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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__ */
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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:
|
|
9
|
-
config:
|
|
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:
|
|
14
|
-
b[
|
|
15
|
-
).toLowerCase(),
|
|
16
|
-
regular: e("table.taxedAsRegular", { frequency:
|
|
17
|
-
supplemental:
|
|
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 =
|
|
22
|
+
], x = o.map((t) => ({
|
|
23
23
|
key: t.category,
|
|
24
24
|
data: [
|
|
25
25
|
{
|
|
26
26
|
key: `${t.category}-type`,
|
|
27
|
-
content: /* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */ a(
|
|
29
|
-
t.description && /* @__PURE__ */ a(
|
|
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:
|
|
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__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */ a(
|
|
42
|
-
/* @__PURE__ */ a(
|
|
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
|
] }),
|