@gusto/embedded-react-sdk 0.19.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/components/Base/Base.js +3 -2
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +6 -4
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +12 -10
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +8 -6
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +8 -6
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +7 -6
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +9 -8
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +3 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +3 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +7 -6
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +6 -5
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +10 -9
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +8 -7
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +3 -2
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +8 -7
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +7 -6
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +8 -7
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -4
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +6 -5
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +13 -11
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +8 -6
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +7 -6
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +17 -15
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +3 -2
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +9 -8
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +6 -5
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +7 -6
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +11 -10
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +3 -2
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +5 -4
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +11 -9
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +3 -2
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +14 -12
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +6 -5
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +3 -2
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +4 -2
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +4 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +34 -32
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +11 -10
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +10 -9
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +3 -2
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +6 -5
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +6 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +7 -6
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +6 -5
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +5 -3
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +3 -2
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +6 -5
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +16 -15
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +14 -13
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +3 -2
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -2
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +3 -2
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +3 -2
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +5 -4
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +3 -2
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +6 -5
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +3 -2
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +3 -2
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +3 -2
- package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +5 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +11 -9
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +3 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +13 -11
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +5 -4
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +3 -2
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +3 -2
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -3
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Actions.js +3 -2
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +5 -4
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -3
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +6 -5
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +5 -4
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -2
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +7 -6
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +3 -2
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/Actions.js +7 -6
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +5 -4
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +7 -6
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +21 -20
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +4 -3
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/Actions.js +7 -6
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -3
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +8 -7
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +5 -4
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +4 -3
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Flow/Flow.js +10 -9
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +10 -9
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +18 -17
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +35 -34
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +6 -5
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +3 -2
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +3 -2
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +3 -2
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +3 -2
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js +6 -5
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +6 -5
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/helpers/validations.js +1 -1
- package/dist/helpers/validations.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flow.js","sources":["../../../src/components/Flow/Flow.tsx"],"sourcesContent":["import { useMachine } from 'react-robot'\nimport { type Machine } from 'robot3'\nimport { useTranslation } from 'react-i18next'\nimport type { OnEventType } from '../Base/useBase'\nimport { FlowBreadcrumbs } from '../Common/FlowBreadcrumbs/FlowBreadcrumbs'\nimport { Flex } from '../Common/Flex'\nimport { FlexItem } from '../Common'\nimport type { FlowContextInterface } from './useFlow'\nimport { FlowContext } from './useFlow'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ntype FlowProps = {\n machine: Machine<object, FlowContextInterface>\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport const Flow = ({ onEvent, machine }: FlowProps) => {\n const Components = useComponentContext()\n const { t } = useTranslation()\n const [current, send, service] = useMachine(machine, {\n onEvent: handleEvent,\n component: null,\n progressBarCta: null,\n })\n\n const {\n progressBarType = null,\n totalSteps = null,\n currentStep = null,\n currentBreadcrumbId,\n breadcrumbs = {},\n } = current.context\n\n function handleEvent(type: EventType, data: unknown): void {\n //When dealing with nested state machine, correct machine needs to recieve an event\n if (service.child) {\n //@ts-expect-error: not sure why 'type' type is incorrectly derived here\n service.child.send({ type: type, payload: data })\n } else {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n send({ type: type, payload: data })\n }\n // Pass event upstream - onEvent can be optional on Flow component\n onEvent(type, data)\n }\n\n return (\n <Flex>\n <FlowContext.Provider\n value={{\n ...current.context,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {progressBarType === 'progress' && currentStep && totalSteps && (\n <Components.ProgressBar\n totalSteps={totalSteps}\n currentStep={currentStep}\n label={t('progressBarLabel', { totalSteps, currentStep })}\n cta={current.context.progressBarCta}\n />\n )}\n {progressBarType === 'breadcrumbs' && (\n <Flex flexDirection=\"row\" justifyContent=\"space-between\" alignItems=\"center\">\n <FlexItem flexGrow={1}>\n <FlowBreadcrumbs\n breadcrumbs={currentBreadcrumbId ? (breadcrumbs[currentBreadcrumbId] ?? []) : []}\n currentBreadcrumbId={currentBreadcrumbId}\n onEvent={handleEvent}\n />\n </FlexItem>\n <FlexItem>\n {current.context.progressBarCta && <current.context.progressBarCta />}\n </FlexItem>\n </Flex>\n )}\n {current.context.component && <current.context.component />}\n </Flex>\n </FlowContext.Provider>\n </Flex>\n )\n}\n"],"names":["Flow","onEvent","machine","Components","useComponentContext","t","useTranslation","current","send","service","useMachine","handleEvent","progressBarType","totalSteps","currentStep","currentBreadcrumbId","breadcrumbs","type","data","Flex","jsx","FlowContext","jsxs","FlexItem","FlowBreadcrumbs"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Flow.js","sources":["../../../src/components/Flow/Flow.tsx"],"sourcesContent":["import { useMachine } from 'react-robot'\nimport { type Machine } from 'robot3'\nimport { useTranslation } from 'react-i18next'\nimport type { OnEventType } from '../Base/useBase'\nimport { FlowBreadcrumbs } from '../Common/FlowBreadcrumbs/FlowBreadcrumbs'\nimport { Flex } from '../Common/Flex'\nimport { FlexItem } from '../Common'\nimport type { FlowContextInterface } from './useFlow'\nimport { FlowContext } from './useFlow'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ntype FlowProps = {\n machine: Machine<object, FlowContextInterface>\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport const Flow = ({ onEvent, machine }: FlowProps) => {\n const Components = useComponentContext()\n const { t } = useTranslation()\n const [current, send, service] = useMachine(machine, {\n onEvent: handleEvent,\n component: null,\n progressBarCta: null,\n })\n\n const {\n progressBarType = null,\n totalSteps = null,\n currentStep = null,\n currentBreadcrumbId,\n breadcrumbs = {},\n } = current.context\n\n function handleEvent(type: EventType, data: unknown): void {\n //When dealing with nested state machine, correct machine needs to recieve an event\n if (service.child) {\n //@ts-expect-error: not sure why 'type' type is incorrectly derived here\n service.child.send({ type: type, payload: data })\n } else {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n send({ type: type, payload: data })\n }\n // Pass event upstream - onEvent can be optional on Flow component\n onEvent(type, data)\n }\n\n return (\n <Flex>\n <FlowContext.Provider\n value={{\n ...current.context,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {progressBarType === 'progress' && currentStep && totalSteps && (\n <Components.ProgressBar\n totalSteps={totalSteps}\n currentStep={currentStep}\n label={t('progressBarLabel', { totalSteps, currentStep })}\n cta={current.context.progressBarCta}\n />\n )}\n {progressBarType === 'breadcrumbs' && (\n <Flex flexDirection=\"row\" justifyContent=\"space-between\" alignItems=\"center\">\n <FlexItem flexGrow={1}>\n <FlowBreadcrumbs\n breadcrumbs={currentBreadcrumbId ? (breadcrumbs[currentBreadcrumbId] ?? []) : []}\n currentBreadcrumbId={currentBreadcrumbId}\n onEvent={handleEvent}\n />\n </FlexItem>\n <FlexItem>\n {current.context.progressBarCta && <current.context.progressBarCta />}\n </FlexItem>\n </Flex>\n )}\n {current.context.component && <current.context.component />}\n </Flex>\n </FlowContext.Provider>\n </Flex>\n )\n}\n"],"names":["Flow","onEvent","machine","Components","useComponentContext","t","useTranslation","current","send","service","useMachine","handleEvent","progressBarType","totalSteps","currentStep","currentBreadcrumbId","breadcrumbs","type","data","Flex","jsx","FlowContext","jsxs","FlexItem","FlowBreadcrumbs"],"mappings":";;;;;;;;AAiBO,MAAMA,IAAO,CAAC,EAAE,SAAAC,GAAS,SAAAC,QAAyB;AACvD,QAAMC,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACR,CAACC,GAASC,GAAMC,CAAO,IAAIC,EAAWR,GAAS;AAAA,IACnD,SAASS;AAAA,IACT,WAAW;AAA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mBA,EAAQ,QAAQ,gBAAhB,CAAA,CAA+B,EAAA,CACrE;AAAA,QAAA,GACF;AAAA,QAEDA,EAAQ,QAAQ,+BAAcA,EAAQ,QAAQ,WAAhB,CAAA,CAA0B;AAAA,MAAA,EAAA,CAC3D;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -3,23 +3,24 @@ import { useTranslation as P } from "react-i18next";
|
|
|
3
3
|
import { getBlockerTranslationKeys as v } from "../payrollHelpers.js";
|
|
4
4
|
import { useComponentContext as A } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
5
5
|
import { Flex as m } from "../../../Common/Flex/Flex.js";
|
|
6
|
+
import "classnames";
|
|
6
7
|
import { useI18n as C } from "../../../../i18n/I18n.js";
|
|
7
|
-
function
|
|
8
|
-
blockers:
|
|
8
|
+
function z({
|
|
9
|
+
blockers: o,
|
|
9
10
|
onMultipleViewClick: i,
|
|
10
11
|
multipleViewLabel: h,
|
|
11
12
|
className: s
|
|
12
13
|
}) {
|
|
13
14
|
C("Payroll.PayrollBlocker");
|
|
14
15
|
const { t: e } = P("Payroll.PayrollBlocker"), { Alert: a, Button: f, Text: c, UnorderedList: x } = A();
|
|
15
|
-
if (
|
|
16
|
+
if (o.length === 0)
|
|
16
17
|
return null;
|
|
17
|
-
const y =
|
|
18
|
-
const
|
|
18
|
+
const y = o.length > 1, p = o.map((r) => {
|
|
19
|
+
const n = v(r.key), B = e(n.titleKey, {
|
|
19
20
|
defaultValue: r.key.replace(/_/g, " ").replace(/\b\w/g, (K) => K.toUpperCase())
|
|
20
|
-
}), T = e(
|
|
21
|
+
}), T = e(n.descriptionKey, {
|
|
21
22
|
defaultValue: r.message || e("defaultBlockerDescription")
|
|
22
|
-
}), k = e(
|
|
23
|
+
}), k = e(n.helpTextKey, { defaultValue: e("defaultBlockerHelp") });
|
|
23
24
|
return {
|
|
24
25
|
...r,
|
|
25
26
|
title: B,
|
|
@@ -37,7 +38,7 @@ function w({
|
|
|
37
38
|
a,
|
|
38
39
|
{
|
|
39
40
|
status: "error",
|
|
40
|
-
label: e("multipleIssuesTitle", { count:
|
|
41
|
+
label: e("multipleIssuesTitle", { count: o.length }),
|
|
41
42
|
className: s,
|
|
42
43
|
children: /* @__PURE__ */ d(m, { flexDirection: "column", gap: 16, children: [
|
|
43
44
|
/* @__PURE__ */ l(x, { items: g }),
|
|
@@ -47,6 +48,6 @@ function w({
|
|
|
47
48
|
);
|
|
48
49
|
}
|
|
49
50
|
export {
|
|
50
|
-
|
|
51
|
+
z as PayrollBlockerAlerts
|
|
51
52
|
};
|
|
52
53
|
//# sourceMappingURL=PayrollBlockerAlerts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayrollBlockerAlerts.js","sources":["../../../../../src/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type ApiPayrollBlocker, getBlockerTranslationKeys } from '../payrollHelpers'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex } from '@/components/Common'\nimport { useI18n } from '@/i18n'\n\ninterface PayrollBlockerAlertsProps {\n blockers: ApiPayrollBlocker[]\n className?: string\n onMultipleViewClick?: () => void\n multipleViewLabel?: string\n}\n\n/**\n * PayrollBlockerAlerts - Alert-style component for inline blocker display\n * Shows single blocker as alert, or multiple blockers as summary with \"Review\" button\n * Returns null for empty blocker arrays\n */\nexport function PayrollBlockerAlerts({\n blockers,\n onMultipleViewClick,\n multipleViewLabel,\n className,\n}: PayrollBlockerAlertsProps) {\n useI18n('Payroll.PayrollBlocker')\n const { t } = useTranslation('Payroll.PayrollBlocker')\n const { Alert, Button, Text, UnorderedList } = useComponentContext()\n\n // Return null for empty blockers array\n if (blockers.length === 0) {\n return null\n }\n\n const hasMultipleBlockers = blockers.length > 1\n\n const enrichedBlockers = blockers.map(blocker => {\n const translationKeys = getBlockerTranslationKeys(blocker.key)\n\n const title = t(translationKeys.titleKey, {\n defaultValue: blocker.key.replace(/_/g, ' ').replace(/\\b\\w/g, l => l.toUpperCase()),\n })\n const description = t(translationKeys.descriptionKey, {\n defaultValue: blocker.message || t('defaultBlockerDescription'),\n })\n const helpText = t(translationKeys.helpTextKey, { defaultValue: t('defaultBlockerHelp') })\n\n return {\n ...blocker,\n title,\n description,\n helpText,\n }\n })\n\n const singleBlocker = enrichedBlockers[0]\n\n if (!hasMultipleBlockers && singleBlocker) {\n return (\n <Alert status=\"error\" label={singleBlocker.title} className={className}>\n <Flex flexDirection=\"column\" gap={8}>\n <Text>{singleBlocker.description}</Text>\n {singleBlocker.helpText && singleBlocker.helpText !== singleBlocker.description && (\n <Text variant=\"supporting\" size=\"sm\">\n {singleBlocker.helpText}\n </Text>\n )}\n </Flex>\n </Alert>\n )\n }\n\n const listItems = enrichedBlockers.map(blocker => blocker.title)\n const defaultMultipleLabel = multipleViewLabel || t('viewAllBlockers')\n\n return (\n <Alert\n status=\"error\"\n label={t('multipleIssuesTitle', { count: blockers.length })}\n className={className}\n >\n <Flex flexDirection=\"column\" gap={16}>\n <UnorderedList items={listItems} />\n {onMultipleViewClick && (\n <div>\n <Button variant=\"secondary\" onClick={onMultipleViewClick} title={defaultMultipleLabel}>\n {defaultMultipleLabel}\n </Button>\n </div>\n )}\n </Flex>\n </Alert>\n )\n}\n"],"names":["PayrollBlockerAlerts","blockers","onMultipleViewClick","multipleViewLabel","className","useI18n","t","useTranslation","Alert","Button","Text","UnorderedList","useComponentContext","hasMultipleBlockers","enrichedBlockers","blocker","translationKeys","getBlockerTranslationKeys","title","l","description","helpText","singleBlocker","jsx","jsxs","Flex","listItems","defaultMultipleLabel"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PayrollBlockerAlerts.js","sources":["../../../../../src/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type ApiPayrollBlocker, getBlockerTranslationKeys } from '../payrollHelpers'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex } from '@/components/Common'\nimport { useI18n } from '@/i18n'\n\ninterface PayrollBlockerAlertsProps {\n blockers: ApiPayrollBlocker[]\n className?: string\n onMultipleViewClick?: () => void\n multipleViewLabel?: string\n}\n\n/**\n * PayrollBlockerAlerts - Alert-style component for inline blocker display\n * Shows single blocker as alert, or multiple blockers as summary with \"Review\" button\n * Returns null for empty blocker arrays\n */\nexport function PayrollBlockerAlerts({\n blockers,\n onMultipleViewClick,\n multipleViewLabel,\n className,\n}: PayrollBlockerAlertsProps) {\n useI18n('Payroll.PayrollBlocker')\n const { t } = useTranslation('Payroll.PayrollBlocker')\n const { Alert, Button, Text, UnorderedList } = useComponentContext()\n\n // Return null for empty blockers array\n if (blockers.length === 0) {\n return null\n }\n\n const hasMultipleBlockers = blockers.length > 1\n\n const enrichedBlockers = blockers.map(blocker => {\n const translationKeys = getBlockerTranslationKeys(blocker.key)\n\n const title = t(translationKeys.titleKey, {\n defaultValue: blocker.key.replace(/_/g, ' ').replace(/\\b\\w/g, l => l.toUpperCase()),\n })\n const description = t(translationKeys.descriptionKey, {\n defaultValue: blocker.message || t('defaultBlockerDescription'),\n })\n const helpText = t(translationKeys.helpTextKey, { defaultValue: t('defaultBlockerHelp') })\n\n return {\n ...blocker,\n title,\n description,\n helpText,\n }\n })\n\n const singleBlocker = enrichedBlockers[0]\n\n if (!hasMultipleBlockers && singleBlocker) {\n return (\n <Alert status=\"error\" label={singleBlocker.title} className={className}>\n <Flex flexDirection=\"column\" gap={8}>\n <Text>{singleBlocker.description}</Text>\n {singleBlocker.helpText && singleBlocker.helpText !== singleBlocker.description && (\n <Text variant=\"supporting\" size=\"sm\">\n {singleBlocker.helpText}\n </Text>\n )}\n </Flex>\n </Alert>\n )\n }\n\n const listItems = enrichedBlockers.map(blocker => blocker.title)\n const defaultMultipleLabel = multipleViewLabel || t('viewAllBlockers')\n\n return (\n <Alert\n status=\"error\"\n label={t('multipleIssuesTitle', { count: blockers.length })}\n className={className}\n >\n <Flex flexDirection=\"column\" gap={16}>\n <UnorderedList items={listItems} />\n {onMultipleViewClick && (\n <div>\n <Button variant=\"secondary\" onClick={onMultipleViewClick} title={defaultMultipleLabel}>\n {defaultMultipleLabel}\n </Button>\n </div>\n )}\n </Flex>\n </Alert>\n )\n}\n"],"names":["PayrollBlockerAlerts","blockers","onMultipleViewClick","multipleViewLabel","className","useI18n","t","useTranslation","Alert","Button","Text","UnorderedList","useComponentContext","hasMultipleBlockers","enrichedBlockers","blocker","translationKeys","getBlockerTranslationKeys","title","l","description","helpText","singleBlocker","jsx","jsxs","Flex","listItems","defaultMultipleLabel"],"mappings":";;;;;;;AAkBO,SAASA,EAAqB;AAAA,EACnC,UAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,WAAAC;AACF,GAA8B;AAC5B,EAAAC,EAAQ,wBAAwB;AAChC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB,GAC/C,EAAE,OAAAC,GAAO,QAAAC,GAAQ,MAAAC,GAAM,eAAAC,EAAA,IAAkBC,EAAA;AAG/C,MAAIX,EAAS,WAAW;AACtB,WAAO;AAGT,QAAMY,IAAsBZ,EAAS,SAAS,GAExCa,IAAmBb,EAAS,IAAI,CAAAc,MAAW;AAC/C,UAAMC,IAAkBC,EAA0BF,EAAQ,GAAG,GAEvDG,IAAQZ,EAAEU,EAAgB,UAAU;AAAA,MACxC,cAAcD,EAAQ,IAAI,QAAQ,MAAM,GAAG,EAAE,QAAQ,SAAS,CAAAI,MAAKA,EAAE,YAAA,CAAa;AAAA,IAAA,CACnF,GACKC,IAAcd,EAAEU,EAAgB,gBAAgB;AAAA,MACpD,cAAcD,EAAQ,WAAWT,EAAE,2BAA2B;AAAA,IAAA,CAC/D,GACKe,IAAWf,EAAEU,EAAgB,aAAa,EAAE,cAAcV,EAAE,oBAAoB,GAAG;AAEzF,WAAO;AAAA,MACL,GAAGS;AAAA,MACH,OAAAG;AAAA,MACA,aAAAE;AAAA,MACA,UAAAC;AAAA,IAAA;AAAA,EAEJ,CAAC,GAEKC,IAAgBR,EAAiB,CAAC;AAExC,MAAI,CAACD,KAAuBS;AAC1B,WACE,gBAAAC,EAACf,GAAA,EAAM,QAAO,SAAQ,OAAOc,EAAc,OAAO,WAAAlB,GAChD,UAAA,gBAAAoB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAAF,EAACb,GAAA,EAAM,YAAc,YAAA,CAAY;AAAA,MAChCY,EAAc,YAAYA,EAAc,aAAaA,EAAc,eAClE,gBAAAC,EAACb,GAAA,EAAK,SAAQ,cAAa,MAAK,MAC7B,YAAc,SAAA,CACjB;AAAA,IAAA,EAAA,CAEJ,EAAA,CACF;AAIJ,QAAMgB,IAAYZ,EAAiB,IAAI,CAAAC,MAAWA,EAAQ,KAAK,GACzDY,IAAuBxB,KAAqBG,EAAE,iBAAiB;AAErE,SACE,gBAAAiB;AAAA,IAACf;AAAA,IAAA;AAAA,MACC,QAAO;AAAA,MACP,OAAOF,EAAE,uBAAuB,EAAE,OAAOL,EAAS,QAAQ;AAAA,MAC1D,WAAAG;AAAA,MAEA,UAAA,gBAAAoB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,QAAA,gBAAAF,EAACZ,GAAA,EAAc,OAAOe,EAAA,CAAW;AAAA,QAChCxB,KACC,gBAAAqB,EAAC,OAAA,EACC,UAAA,gBAAAA,EAACd,GAAA,EAAO,SAAQ,aAAY,SAASP,GAAqB,OAAOyB,GAC9D,UAAAA,EAAA,CACH,EAAA,CACF;AAAA,MAAA,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as o, Fragment as G } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as N } from "react";
|
|
3
3
|
import { useTranslation as S, Trans as O } from "react-i18next";
|
|
4
4
|
import { useFormatEmployeePayRate as V, getRegularHours as _, getOvertimeHours as z, formatHoursDisplay as P, getTotalPtoHours as K, getAdditionalEarnings as W, getReimbursements as X, calculateGrossPay as q } from "../helpers.js";
|
|
@@ -7,6 +7,7 @@ import k from "./PayrollConfigurationPresentation.module.scss.js";
|
|
|
7
7
|
import { useI18n as Q } from "../../../i18n/I18n.js";
|
|
8
8
|
import { Flex as m, FlexItem as h } from "../../Common/Flex/Flex.js";
|
|
9
9
|
import { Grid as Y } from "../../Common/Grid/Grid.js";
|
|
10
|
+
import "classnames";
|
|
10
11
|
import { useComponentContext as Z } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
12
|
import $ from "../../../assets/icons/pencil.svg.js";
|
|
12
13
|
import ee from "../../../assets/icons/x-circle.svg.js";
|
|
@@ -14,11 +15,11 @@ import te from "../../../assets/icons/plus-circle.svg.js";
|
|
|
14
15
|
import { formatNumberAsCurrency as f, firstLastName as re } from "../../../helpers/formattedStrings.js";
|
|
15
16
|
import { useDateFormatter as ne } from "../../../hooks/useDateFormatter.js";
|
|
16
17
|
import { useLoadingIndicator as ie } from "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
17
|
-
import { useContainerBreakpoints as
|
|
18
|
-
import { HamburgerMenu as
|
|
18
|
+
import { useContainerBreakpoints as oe } from "../../../hooks/useContainerBreakpoints/useContainerBreakpoints.js";
|
|
19
|
+
import { HamburgerMenu as le } from "../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
19
20
|
import { DataView as ae } from "../../Common/DataView/DataView.js";
|
|
20
|
-
const se = (
|
|
21
|
-
employeeCompensations:
|
|
21
|
+
const se = (l, u) => l?.startDate && l.endDate ? u.formatPayPeriod(l.startDate, l.endDate) : { startDate: "", endDate: "" }, Ie = ({
|
|
22
|
+
employeeCompensations: l,
|
|
22
23
|
employeeDetails: u,
|
|
23
24
|
payPeriod: y,
|
|
24
25
|
paySchedule: T,
|
|
@@ -35,12 +36,12 @@ const se = (o, u) => o?.startDate && o.endDate ? u.formatPayPeriod(o.startDate,
|
|
|
35
36
|
}) => {
|
|
36
37
|
const { Button: x, Heading: g, Text: i, Badge: R, LoadingSpinner: A, Alert: F } = Z();
|
|
37
38
|
Q("Payroll.PayrollConfiguration");
|
|
38
|
-
const { t: r } = S("Payroll.PayrollConfiguration"), B = ne(), { LoadingIndicator: L } = ie(), U = V(), w = N(null), a =
|
|
39
|
+
const { t: r } = S("Payroll.PayrollConfiguration"), B = ne(), { LoadingIndicator: L } = ie(), U = V(), w = N(null), a = oe({ ref: w }).includes("small"), c = new Map(u.map((t) => [t.uuid, t])), j = (t) => {
|
|
39
40
|
const n = c.get(t);
|
|
40
41
|
return n ? re({ first_name: n.firstName, last_name: n.lastName }) : null;
|
|
41
42
|
};
|
|
42
|
-
return /* @__PURE__ */ e("div", { ref: w, className: k.container, children: /* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ e("div", { ref: w, className: k.container, children: /* @__PURE__ */ o(m, { flexDirection: "column", gap: 16, children: [
|
|
44
|
+
/* @__PURE__ */ o(
|
|
44
45
|
m,
|
|
45
46
|
{
|
|
46
47
|
flexDirection: a ? "row" : "column",
|
|
@@ -48,7 +49,7 @@ const se = (o, u) => o?.startDate && o.endDate ? u.formatPayPeriod(o.startDate,
|
|
|
48
49
|
alignItems: a ? "center" : "stretch",
|
|
49
50
|
gap: a ? 0 : 16,
|
|
50
51
|
children: [
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ o(h, { children: [
|
|
52
53
|
/* @__PURE__ */ e(g, { as: "h1", children: r("pageTitle") }),
|
|
53
54
|
/* @__PURE__ */ e(i, { children: /* @__PURE__ */ e(
|
|
54
55
|
O,
|
|
@@ -80,15 +81,15 @@ const se = (o, u) => o?.startDate && o.endDate ? u.formatPayPeriod(o.startDate,
|
|
|
80
81
|
]
|
|
81
82
|
}
|
|
82
83
|
),
|
|
83
|
-
(C || d) && /* @__PURE__ */
|
|
84
|
+
(C || d) && /* @__PURE__ */ o(Y, { gap: 16, gridTemplateColumns: "1fr", children: [
|
|
84
85
|
d && /* @__PURE__ */ e(F, { status: "info", label: d.label, children: d.content }),
|
|
85
86
|
C
|
|
86
87
|
] }),
|
|
87
|
-
p ? /* @__PURE__ */ e(L, { children: /* @__PURE__ */
|
|
88
|
+
p ? /* @__PURE__ */ e(L, { children: /* @__PURE__ */ o(m, { flexDirection: "column", alignItems: "center", gap: 4, children: [
|
|
88
89
|
/* @__PURE__ */ e(A, { size: "lg" }),
|
|
89
90
|
/* @__PURE__ */ e(g, { as: "h4", children: r("loadingTitle") }),
|
|
90
91
|
/* @__PURE__ */ e(i, { children: r("loadingDescription") })
|
|
91
|
-
] }) }) : /* @__PURE__ */
|
|
92
|
+
] }) }) : /* @__PURE__ */ o(G, { children: [
|
|
92
93
|
/* @__PURE__ */ e("div", { className: k.payrollBlockerContainer, children: D.length > 0 && /* @__PURE__ */ e(
|
|
93
94
|
J,
|
|
94
95
|
{
|
|
@@ -96,7 +97,7 @@ const se = (o, u) => o?.startDate && o.endDate ? u.formatPayPeriod(o.startDate,
|
|
|
96
97
|
onMultipleViewClick: H
|
|
97
98
|
}
|
|
98
99
|
) }),
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ o(h, { children: [
|
|
100
101
|
/* @__PURE__ */ e(g, { as: "h3", children: r("hoursAndEarningsTitle") }),
|
|
101
102
|
/* @__PURE__ */ e(i, { children: r("hoursAndEarningsDescription") })
|
|
102
103
|
] }),
|
|
@@ -109,7 +110,7 @@ const se = (o, u) => o?.startDate && o.endDate ? u.formatPayPeriod(o.startDate,
|
|
|
109
110
|
title: /* @__PURE__ */ e(i, { weight: "semibold", children: r("tableColumns.employees") }),
|
|
110
111
|
render: (t) => {
|
|
111
112
|
const n = c.get(t.employeeUuid || ""), s = U(n);
|
|
112
|
-
return /* @__PURE__ */
|
|
113
|
+
return /* @__PURE__ */ o(m, { flexDirection: "column", gap: 8, children: [
|
|
113
114
|
/* @__PURE__ */ e(i, { weight: "semibold", children: j(t.employeeUuid || "") }),
|
|
114
115
|
s && /* @__PURE__ */ e(i, { variant: "supporting", children: s }),
|
|
115
116
|
t.excluded && /* @__PURE__ */ e(R, { status: "warning", children: r("skippedBadge") })
|
|
@@ -158,9 +159,9 @@ const se = (o, u) => o?.startDate && o.endDate ? u.formatPayPeriod(o.startDate,
|
|
|
158
159
|
}
|
|
159
160
|
}
|
|
160
161
|
],
|
|
161
|
-
data:
|
|
162
|
+
data: l,
|
|
162
163
|
itemMenu: (t) => /* @__PURE__ */ e(
|
|
163
|
-
|
|
164
|
+
le,
|
|
164
165
|
{
|
|
165
166
|
items: [
|
|
166
167
|
{
|
|
@@ -189,6 +190,6 @@ const se = (o, u) => o?.startDate && o.endDate ? u.formatPayPeriod(o.startDate,
|
|
|
189
190
|
] }) });
|
|
190
191
|
};
|
|
191
192
|
export {
|
|
192
|
-
|
|
193
|
+
Ie as PayrollConfigurationPresentation
|
|
193
194
|
};
|
|
194
195
|
//# sourceMappingURL=PayrollConfigurationPresentation.js.map
|
package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayrollConfigurationPresentation.js","sources":["../../../../src/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useRef } from 'react'\nimport type { EmployeeCompensations } from '@gusto/embedded-api/models/components/payrollshow'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { PayrollPayPeriodType } from '@gusto/embedded-api/models/components/payrollpayperiodtype'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport { Trans, useTranslation } from 'react-i18next'\nimport type { PayrollEmployeeCompensationsType } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport {\n useFormatEmployeePayRate,\n getRegularHours,\n getOvertimeHours,\n getTotalPtoHours,\n getAdditionalEarnings,\n getReimbursements,\n formatHoursDisplay,\n calculateGrossPay,\n} from '../helpers'\nimport type { ApiPayrollBlocker } from '../PayrollBlocker/payrollHelpers'\nimport { PayrollBlockerAlerts } from '../PayrollBlocker/components/PayrollBlockerAlerts'\nimport styles from './PayrollConfigurationPresentation.module.scss'\nimport { useI18n } from '@/i18n'\nimport { DataView, Flex, FlexItem, Grid } from '@/components/Common'\nimport type { PaginationControlProps } from '@/components/Common/PaginationControl/PaginationControlTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport XCircle from '@/assets/icons/x-circle.svg?react'\nimport PlusCircle from '@/assets/icons/plus-circle.svg?react'\nimport { firstLastName, formatNumberAsCurrency } from '@/helpers/formattedStrings'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport { useLoadingIndicator } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport useContainerBreakpoints from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\n\ninterface PayrollConfigurationPresentationProps {\n employeeCompensations: EmployeeCompensations[]\n employeeDetails: Employee[]\n payPeriod?: PayrollPayPeriodType\n paySchedule?: PayScheduleObject\n onCalculatePayroll: () => void\n onEdit: (employee: Employee) => void\n onToggleExclude: (employeeCompensation: PayrollEmployeeCompensationsType) => void\n onViewBlockers: () => void\n isOffCycle?: boolean\n alerts?: ReactNode\n payrollDeadlineNotice?: {\n label: string\n content?: ReactNode\n }\n isPending?: boolean\n payrollBlockers?: ApiPayrollBlocker[]\n pagination?: PaginationControlProps\n}\n\nconst getPayrollConfigurationTitle = (\n payPeriod: PayrollPayPeriodType | undefined,\n dateFormatter: ReturnType<typeof useDateFormatter>,\n) => {\n if (payPeriod?.startDate && payPeriod.endDate) {\n return dateFormatter.formatPayPeriod(payPeriod.startDate, payPeriod.endDate)\n }\n return { startDate: '', endDate: '' }\n}\n\nexport const PayrollConfigurationPresentation = ({\n employeeCompensations,\n employeeDetails,\n payPeriod,\n paySchedule,\n onEdit,\n onToggleExclude,\n onCalculatePayroll,\n onViewBlockers,\n isOffCycle = false,\n alerts,\n payrollDeadlineNotice,\n isPending,\n payrollBlockers = [],\n pagination,\n}: PayrollConfigurationPresentationProps) => {\n const { Button, Heading, Text, Badge, LoadingSpinner, Alert } = useComponentContext()\n useI18n('Payroll.PayrollConfiguration')\n const { t } = useTranslation('Payroll.PayrollConfiguration')\n const dateFormatter = useDateFormatter()\n const { LoadingIndicator } = useLoadingIndicator()\n const formatEmployeePayRate = useFormatEmployeePayRate()\n const containerRef = useRef<HTMLDivElement>(null)\n const breakpoints = useContainerBreakpoints({ ref: containerRef })\n const isDesktop = breakpoints.includes('small')\n\n const employeeMap = new Map(employeeDetails.map(employee => [employee.uuid, employee]))\n\n const getEmployeeName = (employeeUuid: string) => {\n const employee = employeeMap.get(employeeUuid)\n return employee\n ? firstLastName({ first_name: employee.firstName, last_name: employee.lastName })\n : null\n }\n\n return (\n <div ref={containerRef} className={styles.container}>\n <Flex flexDirection=\"column\" gap={16}>\n <Flex\n flexDirection={isDesktop ? 'row' : 'column'}\n justifyContent={isDesktop ? 'space-between' : 'normal'}\n alignItems={isDesktop ? 'center' : 'stretch'}\n gap={isDesktop ? 0 : 16}\n >\n <FlexItem>\n <Heading as=\"h1\">{t('pageTitle')}</Heading>\n <Text>\n <Trans\n i18nKey=\"description\"\n t={t}\n components={{ dateWrapper: <Text weight=\"bold\" as=\"span\" /> }}\n values={getPayrollConfigurationTitle(payPeriod, dateFormatter)}\n />\n </Text>\n </FlexItem>\n <FlexItem flexGrow={isDesktop ? 0 : 0}>\n {isDesktop ? (\n <Button\n title={t('calculatePayrollTitle')}\n onClick={onCalculatePayroll}\n isDisabled={isPending}\n >\n {t('calculatePayroll')}\n </Button>\n ) : (\n <Flex flexDirection=\"column\" justifyContent=\"normal\" alignItems=\"stretch\" gap={12}>\n <Button\n title={t('calculatePayrollTitle')}\n onClick={onCalculatePayroll}\n isDisabled={isPending}\n >\n {t('calculatePayroll')}\n </Button>\n </Flex>\n )}\n </FlexItem>\n </Flex>\n\n {(alerts || payrollDeadlineNotice) && (\n <Grid gap={16} gridTemplateColumns=\"1fr\">\n {payrollDeadlineNotice && (\n <Alert status=\"info\" label={payrollDeadlineNotice.label}>\n {payrollDeadlineNotice.content}\n </Alert>\n )}\n {alerts}\n </Grid>\n )}\n\n {isPending ? (\n <LoadingIndicator>\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={4}>\n <LoadingSpinner size=\"lg\" />\n <Heading as=\"h4\">{t('loadingTitle')}</Heading>\n <Text>{t('loadingDescription')}</Text>\n </Flex>\n </LoadingIndicator>\n ) : (\n <>\n <div className={styles.payrollBlockerContainer}>\n {payrollBlockers.length > 0 && (\n <PayrollBlockerAlerts\n blockers={payrollBlockers}\n onMultipleViewClick={onViewBlockers}\n />\n )}\n </div>\n <FlexItem>\n <Heading as=\"h3\">{t('hoursAndEarningsTitle')}</Heading>\n <Text>{t('hoursAndEarningsDescription')}</Text>\n </FlexItem>\n\n <DataView\n label={t('employeeCompensationsTitle')}\n columns={[\n {\n title: <Text weight=\"semibold\">{t('tableColumns.employees')}</Text>,\n render: (item: EmployeeCompensations) => {\n const employee = employeeMap.get(item.employeeUuid || '')\n const payRateDisplay = formatEmployeePayRate(employee)\n return (\n <Flex flexDirection=\"column\" gap={8 as const}>\n <Text weight=\"semibold\">{getEmployeeName(item.employeeUuid || '')}</Text>\n {payRateDisplay && <Text variant=\"supporting\">{payRateDisplay}</Text>}\n {item.excluded && <Badge status=\"warning\">{t('skippedBadge')}</Badge>}\n </Flex>\n )\n },\n },\n {\n title: <Text weight=\"semibold\">{t('tableColumns.hours')}</Text>,\n render: (item: EmployeeCompensations) => {\n const hours = getRegularHours(item)\n const overtimeHours = getOvertimeHours(item)\n return <Text>{formatHoursDisplay(hours + overtimeHours)}</Text>\n },\n },\n {\n title: <Text weight=\"semibold\">{t('tableColumns.timeOff')}</Text>,\n render: (item: EmployeeCompensations) => {\n const ptoHours = getTotalPtoHours(item)\n return <Text>{formatHoursDisplay(ptoHours)}</Text>\n },\n },\n {\n title: <Text weight=\"semibold\">{t('tableColumns.additionalEarnings')}</Text>,\n render: (item: EmployeeCompensations) => {\n const earnings = getAdditionalEarnings(item)\n return <Text>{formatNumberAsCurrency(earnings)}</Text>\n },\n },\n {\n title: <Text weight=\"semibold\">{t('tableColumns.reimbursements')}</Text>,\n render: (item: EmployeeCompensations) => {\n const reimbursements = getReimbursements(item)\n return <Text>{formatNumberAsCurrency(reimbursements)}</Text>\n },\n },\n {\n title: <Text weight=\"semibold\">{t('tableColumns.totalPay')}</Text>,\n render: (item: PayrollEmployeeCompensationsType) => {\n const employee = employeeMap.get(item.employeeUuid || '')\n const calculatedGrossPay = employee\n ? calculateGrossPay(\n item,\n employee,\n payPeriod?.startDate,\n paySchedule,\n isOffCycle,\n )\n : 0\n return <Text>{formatNumberAsCurrency(calculatedGrossPay)}</Text>\n },\n },\n ]}\n data={employeeCompensations}\n itemMenu={(item: EmployeeCompensations) => (\n <HamburgerMenu\n items={[\n {\n label: t('editMenu.edit'),\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n const employee = employeeMap.get(item.employeeUuid || '')\n if (employee) {\n onEdit(employee)\n }\n },\n },\n {\n label: t(item.excluded ? 'editMenu.unskip' : 'editMenu.skip'),\n icon: item.excluded ? <PlusCircle aria-hidden /> : <XCircle aria-hidden />,\n onClick: () => {\n const employee = employeeMap.get(item.employeeUuid || '')\n if (employee) {\n onToggleExclude(item)\n }\n },\n },\n ]}\n triggerLabel={t('editMenu.edit')}\n />\n )}\n pagination={pagination}\n />\n </>\n )}\n </Flex>\n </div>\n )\n}\n"],"names":["getPayrollConfigurationTitle","payPeriod","dateFormatter","PayrollConfigurationPresentation","employeeCompensations","employeeDetails","paySchedule","onEdit","onToggleExclude","onCalculatePayroll","onViewBlockers","isOffCycle","alerts","payrollDeadlineNotice","isPending","payrollBlockers","pagination","Button","Heading","Text","Badge","LoadingSpinner","Alert","useComponentContext","useI18n","t","useTranslation","useDateFormatter","LoadingIndicator","useLoadingIndicator","formatEmployeePayRate","useFormatEmployeePayRate","containerRef","useRef","isDesktop","useContainerBreakpoints","employeeMap","employee","getEmployeeName","employeeUuid","firstLastName","jsx","styles","jsxs","Flex","FlexItem","Trans","Grid","Fragment","PayrollBlockerAlerts","DataView","item","payRateDisplay","hours","getRegularHours","overtimeHours","getOvertimeHours","formatHoursDisplay","ptoHours","getTotalPtoHours","earnings","getAdditionalEarnings","formatNumberAsCurrency","reimbursements","getReimbursements","calculatedGrossPay","calculateGrossPay","HamburgerMenu","PencilSvg","PlusCircle","XCircle"],"mappings":";;;;;;;;;;;;;;;;;;;AAsDA,MAAMA,KAA+B,CACnCC,GACAC,MAEID,GAAW,aAAaA,EAAU,UAC7BC,EAAc,gBAAgBD,EAAU,WAAWA,EAAU,OAAO,IAEtE,EAAE,WAAW,IAAI,SAAS,GAAA,GAGtBE,KAAmC,CAAC;AAAA,EAC/C,uBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,WAAAJ;AAAA,EACA,aAAAK;AAAA,EACA,QAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,QAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,iBAAAC,IAAkB,CAAA;AAAA,EAClB,YAAAC;AACF,MAA6C;AAC3C,QAAM,EAAE,QAAAC,GAAQ,SAAAC,GAAS,MAAAC,GAAM,OAAAC,GAAO,gBAAAC,GAAgB,OAAAC,EAAA,IAAUC,EAAA;AAChE,EAAAC,EAAQ,8BAA8B;AACtC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,8BAA8B,GACrDxB,IAAgByB,GAAA,GAChB,EAAE,kBAAAC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O;AAAA,gBACL;AAAA,kBACE,OAAO1C,EAAE,eAAe;AAAA,kBACxB,MAAM,gBAAAgB,EAAC2B,GAAA,EAAU,eAAW,GAAA,CAAC;AAAA,kBAC7B,SAAS,MAAM;AACb,0BAAM/B,IAAWD,EAAY,IAAIe,EAAK,gBAAgB,EAAE;AACxD,oBAAId,KACF9B,EAAO8B,CAAQ;AAAA,kBAEnB;AAAA,gBAAA;AAAA,gBAEF;AAAA,kBACE,OAAOZ,EAAE0B,EAAK,WAAW,oBAAoB,eAAe;AAAA,kBAC5D,MAAMA,EAAK,WAAW,gBAAAV,EAAC4B,IAAA,EAAW,eAAW,GAAA,CAAC,IAAK,gBAAA5B,EAAC6B,IAAA,EAAQ,eAAW,GAAA,CAAC;AAAA,kBACxE,SAAS,MAAM;AAEb,oBADiBlC,EAAY,IAAIe,EAAK,gBAAgB,EAAE,KAEtD3C,EAAgB2C,CAAI;AAAA,kBAExB;AAAA,gBAAA;AAAA,cACF;AAAA,cAEF,cAAc1B,EAAE,eAAe;AAAA,YAAA;AAAA,UAAA;AAAA,UAGnC,YAAAT;AAAA,QAAA;AAAA,MAAA;AAAA,IACF,EAAA,CACF;AAAA,EAAA,EAAA,CAEJ,EAAA,CACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"PayrollConfigurationPresentation.js","sources":["../../../../src/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useRef } from 'react'\nimport type { EmployeeCompensations } from '@gusto/embedded-api/models/components/payrollshow'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { PayrollPayPeriodType } from '@gusto/embedded-api/models/components/payrollpayperiodtype'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport { Trans, useTranslation } from 'react-i18next'\nimport type { PayrollEmployeeCompensationsType } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport {\n useFormatEmployeePayRate,\n getRegularHours,\n getOvertimeHours,\n getTotalPtoHours,\n getAdditionalEarnings,\n getReimbursements,\n formatHoursDisplay,\n calculateGrossPay,\n} from '../helpers'\nimport type { ApiPayrollBlocker } from '../PayrollBlocker/payrollHelpers'\nimport { PayrollBlockerAlerts } from '../PayrollBlocker/components/PayrollBlockerAlerts'\nimport styles from './PayrollConfigurationPresentation.module.scss'\nimport { useI18n } from '@/i18n'\nimport { DataView, Flex, FlexItem, Grid } from '@/components/Common'\nimport type { PaginationControlProps } from '@/components/Common/PaginationControl/PaginationControlTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport XCircle from '@/assets/icons/x-circle.svg?react'\nimport PlusCircle from '@/assets/icons/plus-circle.svg?react'\nimport { firstLastName, formatNumberAsCurrency } from '@/helpers/formattedStrings'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport { useLoadingIndicator } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport useContainerBreakpoints from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\n\ninterface PayrollConfigurationPresentationProps {\n employeeCompensations: EmployeeCompensations[]\n employeeDetails: Employee[]\n payPeriod?: PayrollPayPeriodType\n paySchedule?: PayScheduleObject\n onCalculatePayroll: () => void\n onEdit: (employee: Employee) => void\n onToggleExclude: (employeeCompensation: PayrollEmployeeCompensationsType) => void\n onViewBlockers: () => void\n isOffCycle?: boolean\n alerts?: ReactNode\n payrollDeadlineNotice?: {\n label: string\n content?: ReactNode\n }\n isPending?: boolean\n payrollBlockers?: ApiPayrollBlocker[]\n pagination?: PaginationControlProps\n}\n\nconst getPayrollConfigurationTitle = (\n payPeriod: PayrollPayPeriodType | undefined,\n dateFormatter: ReturnType<typeof useDateFormatter>,\n) => {\n if (payPeriod?.startDate && payPeriod.endDate) {\n return dateFormatter.formatPayPeriod(payPeriod.startDate, payPeriod.endDate)\n }\n return { startDate: '', endDate: '' }\n}\n\nexport const PayrollConfigurationPresentation = ({\n employeeCompensations,\n employeeDetails,\n payPeriod,\n paySchedule,\n onEdit,\n onToggleExclude,\n onCalculatePayroll,\n onViewBlockers,\n isOffCycle = false,\n alerts,\n payrollDeadlineNotice,\n isPending,\n payrollBlockers = [],\n pagination,\n}: PayrollConfigurationPresentationProps) => {\n const { Button, Heading, Text, Badge, LoadingSpinner, Alert } = useComponentContext()\n useI18n('Payroll.PayrollConfiguration')\n const { t } = useTranslation('Payroll.PayrollConfiguration')\n const dateFormatter = useDateFormatter()\n const { LoadingIndicator } = useLoadingIndicator()\n const formatEmployeePayRate = useFormatEmployeePayRate()\n const containerRef = useRef<HTMLDivElement>(null)\n const breakpoints = useContainerBreakpoints({ ref: containerRef })\n const isDesktop = breakpoints.includes('small')\n\n const employeeMap = new Map(employeeDetails.map(employee => [employee.uuid, employee]))\n\n const getEmployeeName = (employeeUuid: string) => {\n const employee = employeeMap.get(employeeUuid)\n return employee\n ? firstLastName({ first_name: employee.firstName, last_name: employee.lastName })\n : null\n }\n\n return (\n <div ref={containerRef} className={styles.container}>\n <Flex flexDirection=\"column\" gap={16}>\n <Flex\n flexDirection={isDesktop ? 'row' : 'column'}\n justifyContent={isDesktop ? 'space-between' : 'normal'}\n alignItems={isDesktop ? 'center' : 'stretch'}\n gap={isDesktop ? 0 : 16}\n >\n <FlexItem>\n <Heading as=\"h1\">{t('pageTitle')}</Heading>\n <Text>\n <Trans\n i18nKey=\"description\"\n t={t}\n components={{ dateWrapper: <Text weight=\"bold\" as=\"span\" /> }}\n values={getPayrollConfigurationTitle(payPeriod, dateFormatter)}\n />\n </Text>\n </FlexItem>\n <FlexItem flexGrow={isDesktop ? 0 : 0}>\n {isDesktop ? (\n <Button\n title={t('calculatePayrollTitle')}\n onClick={onCalculatePayroll}\n isDisabled={isPending}\n >\n {t('calculatePayroll')}\n </Button>\n ) : (\n <Flex flexDirection=\"column\" justifyContent=\"normal\" alignItems=\"stretch\" gap={12}>\n <Button\n title={t('calculatePayrollTitle')}\n onClick={onCalculatePayroll}\n isDisabled={isPending}\n >\n {t('calculatePayroll')}\n </Button>\n </Flex>\n )}\n </FlexItem>\n </Flex>\n\n {(alerts || payrollDeadlineNotice) && (\n <Grid gap={16} gridTemplateColumns=\"1fr\">\n {payrollDeadlineNotice && (\n <Alert status=\"info\" label={payrollDeadlineNotice.label}>\n {payrollDeadlineNotice.content}\n </Alert>\n )}\n {alerts}\n </Grid>\n )}\n\n {isPending ? (\n <LoadingIndicator>\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={4}>\n <LoadingSpinner size=\"lg\" />\n <Heading as=\"h4\">{t('loadingTitle')}</Heading>\n <Text>{t('loadingDescription')}</Text>\n </Flex>\n </LoadingIndicator>\n ) : (\n <>\n <div className={styles.payrollBlockerContainer}>\n {payrollBlockers.length > 0 && (\n <PayrollBlockerAlerts\n blockers={payrollBlockers}\n onMultipleViewClick={onViewBlockers}\n />\n )}\n </div>\n <FlexItem>\n <Heading as=\"h3\">{t('hoursAndEarningsTitle')}</Heading>\n <Text>{t('hoursAndEarningsDescription')}</Text>\n </FlexItem>\n\n <DataView\n label={t('employeeCompensationsTitle')}\n columns={[\n {\n title: <Text weight=\"semibold\">{t('tableColumns.employees')}</Text>,\n render: (item: EmployeeCompensations) => {\n const employee = employeeMap.get(item.employeeUuid || '')\n const payRateDisplay = formatEmployeePayRate(employee)\n return (\n <Flex flexDirection=\"column\" gap={8 as const}>\n <Text weight=\"semibold\">{getEmployeeName(item.employeeUuid || '')}</Text>\n {payRateDisplay && <Text variant=\"supporting\">{payRateDisplay}</Text>}\n {item.excluded && <Badge status=\"warning\">{t('skippedBadge')}</Badge>}\n </Flex>\n )\n },\n },\n {\n title: <Text weight=\"semibold\">{t('tableColumns.hours')}</Text>,\n render: (item: EmployeeCompensations) => {\n const hours = getRegularHours(item)\n const overtimeHours = getOvertimeHours(item)\n return <Text>{formatHoursDisplay(hours + overtimeHours)}</Text>\n },\n },\n {\n title: <Text weight=\"semibold\">{t('tableColumns.timeOff')}</Text>,\n render: (item: EmployeeCompensations) => {\n const ptoHours = getTotalPtoHours(item)\n return <Text>{formatHoursDisplay(ptoHours)}</Text>\n },\n },\n {\n title: <Text weight=\"semibold\">{t('tableColumns.additionalEarnings')}</Text>,\n render: (item: EmployeeCompensations) => {\n const earnings = getAdditionalEarnings(item)\n return <Text>{formatNumberAsCurrency(earnings)}</Text>\n },\n },\n {\n title: <Text weight=\"semibold\">{t('tableColumns.reimbursements')}</Text>,\n render: (item: EmployeeCompensations) => {\n const reimbursements = getReimbursements(item)\n return <Text>{formatNumberAsCurrency(reimbursements)}</Text>\n },\n },\n {\n title: <Text weight=\"semibold\">{t('tableColumns.totalPay')}</Text>,\n render: (item: PayrollEmployeeCompensationsType) => {\n const employee = employeeMap.get(item.employeeUuid || '')\n const calculatedGrossPay = employee\n ? calculateGrossPay(\n item,\n employee,\n payPeriod?.startDate,\n paySchedule,\n isOffCycle,\n )\n : 0\n return <Text>{formatNumberAsCurrency(calculatedGrossPay)}</Text>\n },\n },\n ]}\n data={employeeCompensations}\n itemMenu={(item: EmployeeCompensations) => (\n <HamburgerMenu\n items={[\n {\n label: t('editMenu.edit'),\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n const employee = employeeMap.get(item.employeeUuid || '')\n if (employee) {\n onEdit(employee)\n }\n },\n },\n {\n label: t(item.excluded ? 'editMenu.unskip' : 'editMenu.skip'),\n icon: item.excluded ? <PlusCircle aria-hidden /> : <XCircle aria-hidden />,\n onClick: () => {\n const employee = employeeMap.get(item.employeeUuid || '')\n if (employee) {\n onToggleExclude(item)\n }\n },\n },\n ]}\n triggerLabel={t('editMenu.edit')}\n />\n )}\n pagination={pagination}\n />\n </>\n )}\n </Flex>\n </div>\n )\n}\n"],"names":["getPayrollConfigurationTitle","payPeriod","dateFormatter","PayrollConfigurationPresentation","employeeCompensations","employeeDetails","paySchedule","onEdit","onToggleExclude","onCalculatePayroll","onViewBlockers","isOffCycle","alerts","payrollDeadlineNotice","isPending","payrollBlockers","pagination","Button","Heading","Text","Badge","LoadingSpinner","Alert","useComponentContext","useI18n","t","useTranslation","useDateFormatter","LoadingIndicator","useLoadingIndicator","formatEmployeePayRate","useFormatEmployeePayRate","containerRef","useRef","isDesktop","useContainerBreakpoints","employeeMap","employee","getEmployeeName","employeeUuid","firstLastName","jsx","styles","jsxs","Flex","FlexItem","Trans","Grid","Fragment","PayrollBlockerAlerts","DataView","item","payRateDisplay","hours","getRegularHours","overtimeHours","getOvertimeHours","formatHoursDisplay","ptoHours","getTotalPtoHours","earnings","getAdditionalEarnings","formatNumberAsCurrency","reimbursements","getReimbursements","calculatedGrossPay","calculateGrossPay","HamburgerMenu","PencilSvg","PlusCircle","XCircle"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsDA,MAAMA,KAA+B,CACnCC,GACAC,MAEID,GAAW,aAAaA,EAAU,UAC7BC,EAAc,gBAAgBD,EAAU,WAAWA,EAAU,OAAO,IAEtE,EAAE,WAAW,IAAI,SAAS,GAAA,GAGtBE,KAAmC,CAAC;AAAA,EAC/C,uBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,WAAAJ;AAAA,EACA,aAAAK;AAAA,EACA,QAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,QAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,iBAAAC,IAAkB,CAAA;AAAA,EAClB,YAAAC;AACF,MAA6C;AAC3C,QAAM,EAAE,QAAAC,GAAQ,SAAAC,GAAS,MAAAC,GAAM,OAAAC,GAAO,gBAAAC,GAAgB,OAAAC,EAAA,IAAUC,EAAA;AAChE,EAAAC,EAAQ,8BAA8B;AACtC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,8BAA8B,GACrDxB,IAAgByB,GAAA,GAChB,EAAE,kBAAAC,EAAA,IAAqBC,GAAA,GACv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,OAAO1C,EAAE,eAAe;AAAA,kBACxB,MAAM,gBAAAgB,EAAC2B,GAAA,EAAU,eAAW,GAAA,CAAC;AAAA,kBAC7B,SAAS,MAAM;AACb,0BAAM/B,IAAWD,EAAY,IAAIe,EAAK,gBAAgB,EAAE;AACxD,oBAAId,KACF9B,EAAO8B,CAAQ;AAAA,kBAEnB;AAAA,gBAAA;AAAA,gBAEF;AAAA,kBACE,OAAOZ,EAAE0B,EAAK,WAAW,oBAAoB,eAAe;AAAA,kBAC5D,MAAMA,EAAK,WAAW,gBAAAV,EAAC4B,IAAA,EAAW,eAAW,GAAA,CAAC,IAAK,gBAAA5B,EAAC6B,IAAA,EAAQ,eAAW,GAAA,CAAC;AAAA,kBACxE,SAAS,MAAM;AAEb,oBADiBlC,EAAY,IAAIe,EAAK,gBAAgB,EAAE,KAEtD3C,EAAgB2C,CAAI;AAAA,kBAExB;AAAA,gBAAA;AAAA,cACF;AAAA,cAEF,cAAc1B,EAAE,eAAe;AAAA,YAAA;AAAA,UAAA;AAAA,UAGnC,YAAAT;AAAA,QAAA;AAAA,MAAA;AAAA,IACF,EAAA,CACF;AAAA,EAAA,EAAA,CAEJ,EAAA,CACF;AAEJ;"}
|
|
@@ -9,10 +9,11 @@ import u from "./PayrollEditEmployeePresentation.module.scss.js";
|
|
|
9
9
|
import { TimeOffField as ee } from "./TimeOffField.js";
|
|
10
10
|
import { Flex as y } from "../../Common/Flex/Flex.js";
|
|
11
11
|
import { Grid as S } from "../../Common/Grid/Grid.js";
|
|
12
|
+
import "classnames";
|
|
12
13
|
import { useComponentContext as te } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
14
|
import { useI18n as ne } from "../../../i18n/I18n.js";
|
|
14
15
|
import { Form as re } from "../../Common/Form/Form.js";
|
|
15
|
-
import { firstLastName as
|
|
16
|
+
import { firstLastName as ie, formatNumberAsCurrency as se } from "../../../helpers/formattedStrings.js";
|
|
16
17
|
import { getAdditionalEarningsCompensations as oe, getReimbursementCompensation as ae, calculateGrossPay as G } from "../helpers.js";
|
|
17
18
|
import { HOURS_COMPENSATION_NAMES as k, EXCLUDED_ADDITIONAL_EARNINGS as me, COMPENSATION_NAME_DOUBLE_OVERTIME as le, COMPENSATION_NAME_OVERTIME as de, COMPENSATION_NAME_REGULAR_HOURS as ue, COMPENSATION_NAME_REIMBURSEMENT as ce, COMPENSATION_NAME_CASH_TIPS as pe, COMPENSATION_NAME_COMMISSION as fe, COMPENSATION_NAME_CORRECTION_PAYMENT as he, COMPENSATION_NAME_PAYCHECK_TIPS as Ce, COMPENSATION_NAME_BONUS as Ne } from "../../../shared/constants.js";
|
|
18
19
|
import { useContainerBreakpoints as Ee } from "../../../hooks/useContainerBreakpoints/useContainerBreakpoints.js";
|
|
@@ -23,46 +24,46 @@ const be = m.object({
|
|
|
23
24
|
timeOffCompensations: m.record(m.string(), m.string().optional()),
|
|
24
25
|
fixedCompensations: m.record(m.string(), m.string().optional()),
|
|
25
26
|
paymentMethod: m.nativeEnum(A).optional()
|
|
26
|
-
}), w = (E, O, d,
|
|
27
|
+
}), w = (E, O, d, s) => {
|
|
27
28
|
const g = {
|
|
28
29
|
...O,
|
|
29
30
|
paymentMethod: E.paymentMethod
|
|
30
31
|
};
|
|
31
32
|
g.hourlyCompensations = O?.hourlyCompensations?.map(
|
|
32
|
-
(
|
|
33
|
-
const l =
|
|
33
|
+
(i) => {
|
|
34
|
+
const l = i.jobUuid && i.name ? E.hourlyCompensations[i.jobUuid]?.[i.name] : void 0;
|
|
34
35
|
return l ? {
|
|
35
|
-
...
|
|
36
|
+
...i,
|
|
36
37
|
hours: l
|
|
37
|
-
} :
|
|
38
|
+
} : i;
|
|
38
39
|
}
|
|
39
|
-
), g.paidTimeOff = d.map((
|
|
40
|
-
...
|
|
41
|
-
hours: E.timeOffCompensations[
|
|
40
|
+
), g.paidTimeOff = d.map((i) => ({
|
|
41
|
+
...i,
|
|
42
|
+
hours: E.timeOffCompensations[i.name]
|
|
42
43
|
}));
|
|
43
44
|
const b = [];
|
|
44
|
-
return Object.entries(E.fixedCompensations).forEach(([
|
|
45
|
+
return Object.entries(E.fixedCompensations).forEach(([i, l]) => {
|
|
45
46
|
const C = O?.fixedCompensations?.find(
|
|
46
|
-
(x) => x.name?.toLowerCase() ===
|
|
47
|
+
(x) => x.name?.toLowerCase() === i.toLowerCase()
|
|
47
48
|
);
|
|
48
49
|
l && (C ? b.push({
|
|
49
50
|
name: C.name,
|
|
50
51
|
jobUuid: C.jobUuid,
|
|
51
52
|
amount: l
|
|
52
53
|
}) : parseFloat(l) !== 0 && b.push({
|
|
53
|
-
name:
|
|
54
|
-
jobUuid:
|
|
54
|
+
name: i,
|
|
55
|
+
jobUuid: s,
|
|
55
56
|
amount: l
|
|
56
57
|
}));
|
|
57
58
|
}), g.fixedCompensations = b, g;
|
|
58
|
-
},
|
|
59
|
+
}, Be = ({
|
|
59
60
|
onSave: E,
|
|
60
61
|
onCancel: O,
|
|
61
62
|
employee: d,
|
|
62
|
-
employeeCompensation:
|
|
63
|
+
employeeCompensation: s,
|
|
63
64
|
isPending: g = !1,
|
|
64
65
|
fixedCompensationTypes: b,
|
|
65
|
-
payPeriodStartDate:
|
|
66
|
+
payPeriodStartDate: i,
|
|
66
67
|
paySchedule: l,
|
|
67
68
|
isOffCycle: C = !1
|
|
68
69
|
}) => {
|
|
@@ -71,21 +72,21 @@ const be = m.object({
|
|
|
71
72
|
const f = d.jobs?.find((e) => e.primary), T = f ? [f] : [], v = X(null), p = Ee({
|
|
72
73
|
ref: v
|
|
73
74
|
}).includes("small");
|
|
74
|
-
|
|
75
|
+
s?.hourlyCompensations?.forEach((e) => {
|
|
75
76
|
const n = d.jobs?.find((o) => o.uuid === e.jobUuid);
|
|
76
77
|
n && !T.find((o) => o.uuid === n.uuid) && T.push(n);
|
|
77
78
|
});
|
|
78
|
-
const P = (
|
|
79
|
+
const P = (s?.paidTimeOff || []).filter((e) => e.name), _ = oe({
|
|
79
80
|
flsaStatus: f?.compensations?.[0]?.flsaStatus,
|
|
80
|
-
existingFixedCompensations:
|
|
81
|
+
existingFixedCompensations: s?.fixedCompensations || [],
|
|
81
82
|
primaryJobUuid: f?.uuid,
|
|
82
83
|
fixedCompensationTypes: b,
|
|
83
84
|
excludedTypes: me
|
|
84
85
|
}), N = ae(
|
|
85
|
-
|
|
86
|
+
s?.fixedCompensations || [],
|
|
86
87
|
b,
|
|
87
88
|
f?.uuid
|
|
88
|
-
), F = (e, n) =>
|
|
89
|
+
), F = (e, n) => s?.hourlyCompensations?.find(
|
|
89
90
|
(o) => o.jobUuid === e && o.name?.toLowerCase() === n.toLowerCase()
|
|
90
91
|
), $ = (e) => {
|
|
91
92
|
switch (e) {
|
|
@@ -137,7 +138,7 @@ const be = m.object({
|
|
|
137
138
|
e[n.name] = n.amount ? n.amount : "";
|
|
138
139
|
}), N && (e[N.name] = N.amount ? N.amount : ""), e;
|
|
139
140
|
})(),
|
|
140
|
-
paymentMethod:
|
|
141
|
+
paymentMethod: s?.paymentMethod || A.DirectDeposit
|
|
141
142
|
}, I = W({
|
|
142
143
|
resolver: J(be),
|
|
143
144
|
defaultValues: B
|
|
@@ -156,46 +157,46 @@ const be = m.object({
|
|
|
156
157
|
paymentMethod: M.paymentMethod
|
|
157
158
|
}, o = w(
|
|
158
159
|
n,
|
|
159
|
-
|
|
160
|
-
(
|
|
160
|
+
s,
|
|
161
|
+
(s?.paidTimeOff || []).filter((h) => h.name),
|
|
161
162
|
f?.uuid
|
|
162
163
|
);
|
|
163
164
|
return G(
|
|
164
165
|
o,
|
|
165
166
|
d,
|
|
166
|
-
|
|
167
|
+
i,
|
|
167
168
|
l,
|
|
168
169
|
C
|
|
169
170
|
);
|
|
170
171
|
} catch {
|
|
171
|
-
return
|
|
172
|
-
i,
|
|
173
|
-
d,
|
|
172
|
+
return s ? G(
|
|
174
173
|
s,
|
|
174
|
+
d,
|
|
175
|
+
i,
|
|
175
176
|
l,
|
|
176
177
|
C
|
|
177
178
|
) : 0;
|
|
178
179
|
}
|
|
179
180
|
}, [
|
|
180
181
|
M,
|
|
181
|
-
|
|
182
|
+
s,
|
|
182
183
|
f?.uuid,
|
|
183
184
|
d,
|
|
184
|
-
|
|
185
|
+
i,
|
|
185
186
|
l,
|
|
186
187
|
C
|
|
187
|
-
]), V =
|
|
188
|
+
]), V = ie({
|
|
188
189
|
first_name: d.firstName,
|
|
189
190
|
last_name: d.lastName
|
|
190
191
|
}), z = (e) => {
|
|
191
192
|
const n = w(
|
|
192
193
|
e,
|
|
193
|
-
|
|
194
|
+
s,
|
|
194
195
|
P,
|
|
195
196
|
f?.uuid
|
|
196
197
|
);
|
|
197
198
|
E(n);
|
|
198
|
-
}, L =
|
|
199
|
+
}, L = se(q || 0), U = /* @__PURE__ */ a(
|
|
199
200
|
y,
|
|
200
201
|
{
|
|
201
202
|
flexDirection: p ? "row" : "column",
|
|
@@ -333,6 +334,6 @@ const be = m.object({
|
|
|
333
334
|
};
|
|
334
335
|
export {
|
|
335
336
|
be as PayrollEditEmployeeFormSchema,
|
|
336
|
-
|
|
337
|
+
Be as PayrollEditEmployeePresentation
|
|
337
338
|
};
|
|
338
339
|
//# sourceMappingURL=PayrollEditEmployeePresentation.js.map
|