@gusto/embedded-react-sdk 0.55.1 → 0.55.2
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 +18 -0
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
- package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
- 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/useInviteSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.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/context.js +4 -3
- package/dist/components/Company/BankAccount/BankAccountForm/context.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/FederalTaxes/useFederalTaxes.js +6 -5
- package/dist/components/Company/FederalTaxes/useFederalTaxes.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/Locations/LocationForm/useLocationForm.js +4 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.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/context.js +4 -3
- package/dist/components/Company/OnboardingOverview/context.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/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +4 -3
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.js +4 -4
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js +4 -4
- package/dist/components/Flow/Flow.js +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +3 -2
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.d.ts +7 -0
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +191 -153
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +1 -0
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +87 -81
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.d.ts +1 -0
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +73 -48
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.d.ts +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.js +22 -20
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +3 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +22 -20
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.d.ts +2 -0
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +34 -26
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +4 -0
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +51 -43
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.d.ts +2 -0
- package/dist/components/Payroll/PayrollList/PayrollList.js +48 -47
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +2 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +44 -43
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +7 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +115 -112
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +2 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +94 -103
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js +22 -16
- package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +58 -49
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/PrintChecks/PrintChecks.d.ts +21 -0
- package/dist/components/Payroll/PrintChecks/PrintChecks.js +68 -0
- package/dist/components/Payroll/PrintChecks/PrintChecks.js.map +1 -0
- package/dist/components/Payroll/PrintChecks/PrintChecksBanner/PrintChecksBanner.d.ts +9 -0
- package/dist/components/Payroll/PrintChecks/PrintChecksBanner/PrintChecksBanner.js +34 -0
- package/dist/components/Payroll/PrintChecks/PrintChecksBanner/PrintChecksBanner.js.map +1 -0
- package/dist/components/Payroll/PrintChecks/PrintChecksBanner/index.d.ts +1 -0
- package/dist/components/Payroll/PrintChecks/PrintChecksComponents.d.ts +48 -0
- package/dist/components/Payroll/PrintChecks/PrintChecksComponents.js +26 -0
- package/dist/components/Payroll/PrintChecks/PrintChecksComponents.js.map +1 -0
- package/dist/components/Payroll/PrintChecks/PrintChecksFailure/PrintChecksFailure.d.ts +14 -0
- package/dist/components/Payroll/PrintChecks/PrintChecksFailure/PrintChecksFailure.js +47 -0
- package/dist/components/Payroll/PrintChecks/PrintChecksFailure/PrintChecksFailure.js.map +1 -0
- package/dist/components/Payroll/PrintChecks/PrintChecksFailure/index.d.ts +1 -0
- package/dist/components/Payroll/PrintChecks/PrintChecksForm/PrintChecksForm.d.ts +16 -0
- package/dist/components/Payroll/PrintChecks/PrintChecksForm/PrintChecksForm.js +144 -0
- package/dist/components/Payroll/PrintChecks/PrintChecksForm/PrintChecksForm.js.map +1 -0
- package/dist/components/Payroll/PrintChecks/PrintChecksForm/index.d.ts +1 -0
- package/dist/components/Payroll/PrintChecks/PrintChecksSummary/PrintChecksSummary.d.ts +14 -0
- package/dist/components/Payroll/PrintChecks/PrintChecksSummary/PrintChecksSummary.js +39 -0
- package/dist/components/Payroll/PrintChecks/PrintChecksSummary/PrintChecksSummary.js.map +1 -0
- package/dist/components/Payroll/PrintChecks/PrintChecksSummary/index.d.ts +1 -0
- package/dist/components/Payroll/PrintChecks/index.d.ts +2 -0
- package/dist/components/Payroll/PrintChecks/printChecksStateMachine.d.ts +33 -0
- package/dist/components/Payroll/PrintChecks/printChecksStateMachine.js +93 -0
- package/dist/components/Payroll/PrintChecks/printChecksStateMachine.js.map +1 -0
- package/dist/components/Payroll/PrintChecks/types.d.ts +14 -0
- package/dist/components/Payroll/index.d.ts +2 -0
- package/dist/components/Payroll/index.js +26 -24
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +9 -8
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/i18n/I18n.js +4 -0
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +9 -9
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +38 -38
- package/dist/i18n/en/Payroll.PayrollReceipts.json.js +2 -2
- package/dist/i18n/en/Payroll.PrintChecksBanner.json.js +14 -0
- package/dist/i18n/en/Payroll.PrintChecksBanner.json.js.map +1 -0
- package/dist/i18n/en/Payroll.PrintChecksFailure.json.js +12 -0
- package/dist/i18n/en/Payroll.PrintChecksFailure.json.js.map +1 -0
- package/dist/i18n/en/Payroll.PrintChecksForm.json.js +28 -0
- package/dist/i18n/en/Payroll.PrintChecksForm.json.js.map +1 -0
- package/dist/i18n/en/Payroll.PrintChecksSummary.json.js +14 -0
- package/dist/i18n/en/Payroll.PrintChecksSummary.json.js.map +1 -0
- package/dist/i18n/types.d.ts +65 -7
- package/dist/models/external.d.ts +3 -0
- package/dist/partner-hook-utils/form/buildFormSchema.js +60 -54
- package/dist/partner-hook-utils/form/buildFormSchema.js.map +1 -1
- package/dist/shared/constants.d.ts +28 -0
- package/dist/shared/constants.js +61 -50
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/docs/guides/endpoint-inventory.json +26 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GrossUpModal.js","sources":["../../../../src/components/Payroll/GrossUpModal/GrossUpModal.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport type { GrossUpModalProps } from './GrossUpModalTypes'\nimport styles from './GrossUpModal.module.scss'\nimport { ActionsLayout, Flex, NumberInputField } from '@/components/Common'\nimport { useBase } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\n\nconst GrossUpFormSchema = z.object({\n netPay: z.number().positive(),\n})\n\ntype GrossUpFormValues = z.infer<typeof GrossUpFormSchema>\n\n/** @internal */\nexport function GrossUpModal({ isOpen, onCalculateGrossUp, onApply, onCancel }: GrossUpModalProps) {\n useI18n('Payroll.GrossUpModal')\n const { t } = useTranslation('Payroll.GrossUpModal')\n const { Modal, Heading, Text, Button, Alert } = useComponentContext()\n const { baseSubmitHandler } = useBase()\n const modalContainerRef = useRef<HTMLDivElement>(null)\n\n const [calculatedGrossUp, setCalculatedGrossUp] = useState<string | null>(null)\n const [errorMessage, setErrorMessage] = useState<string | null>(null)\n const [isCalculating, setIsCalculating] = useState(false)\n const [isApplying, setIsApplying] = useState(false)\n\n const formHandlers = useForm<GrossUpFormValues>({\n resolver: zodResolver(GrossUpFormSchema),\n defaultValues: { netPay: 0 },\n })\n\n useEffect(() => {\n if (!isOpen) {\n formHandlers.reset({ netPay: 0 })\n setCalculatedGrossUp(null)\n setErrorMessage(null)\n }\n }, [isOpen, formHandlers.reset])\n\n const handleCalculate = async (data: GrossUpFormValues) => {\n setErrorMessage(null)\n setCalculatedGrossUp(null)\n setIsCalculating(true)\n\n await baseSubmitHandler(null, async () => {\n try {\n const result = await onCalculateGrossUp(data.netPay)\n\n if (result) {\n setCalculatedGrossUp(result)\n } else {\n setErrorMessage(t('errorMessage'))\n }\n } finally {\n setIsCalculating(false)\n }\n })\n }\n\n const handleApply = async () => {\n if (calculatedGrossUp) {\n setIsApplying(true)\n await baseSubmitHandler(null, async () => {\n try {\n await onApply(calculatedGrossUp)\n } finally {\n setIsApplying(false)\n }\n })\n }\n }\n\n return (\n <Modal\n isOpen={isOpen}\n onClose={onCancel}\n containerRef={modalContainerRef}\n footer={\n <ActionsLayout>\n <Button\n variant=\"primary\"\n isDisabled={!calculatedGrossUp}\n onClick={handleApply}\n isLoading={isApplying}\n >\n {t('applyCta')}\n </Button>\n <Button variant=\"secondary\" onClick={onCancel}>\n {t('cancelCta')}\n </Button>\n </ActionsLayout>\n }\n >\n <FormProvider {...formHandlers}>\n <div className={styles.header}>\n <Heading as=\"h2\" styledAs=\"h3\">\n {t('title')}\n </Heading>\n <Text variant=\"supporting\" as=\"p\">\n {t('description')}\n </Text>\n </div>\n\n <div className={styles.content}>\n {errorMessage && (\n <div className={styles.alert}>\n <Alert label={errorMessage} status=\"error\" disableScrollIntoView />\n </div>\n )}\n\n <div className={styles.alert}>\n <Alert label={t('warning')} status=\"warning\" disableScrollIntoView />\n </div>\n\n <Flex flexDirection=\"row\" gap={8}>\n <NumberInputField\n name=\"netPay\"\n label={t('netPayLabel')}\n format=\"currency\"\n errorMessage={t('validations.netPay')}\n min={0}\n isRequired\n />\n <Button\n variant=\"secondary\"\n className={styles.calculateButton}\n isDisabled={isCalculating}\n onClick={formHandlers.handleSubmit(handleCalculate)}\n >\n {isCalculating ? t('calculatingCta') : t('calculateCta')}\n </Button>\n </Flex>\n\n {calculatedGrossUp && (\n <>\n <div className={styles.result}>\n <Text size=\"sm\" variant=\"supporting\" weight=\"semibold\">\n {t('grossPayResult')}\n </Text>\n <Heading as=\"h3\">{formatNumberAsCurrency(parseFloat(calculatedGrossUp))}</Heading>\n </div>\n </>\n )}\n </div>\n </FormProvider>\n </Modal>\n )\n}\n"],"names":["GrossUpFormSchema","z","GrossUpModal","isOpen","onCalculateGrossUp","onApply","onCancel","useI18n","t","useTranslation","Modal","Heading","Text","Button","Alert","useComponentContext","baseSubmitHandler","useBase","modalContainerRef","useRef","calculatedGrossUp","setCalculatedGrossUp","useState","errorMessage","setErrorMessage","isCalculating","setIsCalculating","isApplying","setIsApplying","formHandlers","useForm","zodResolver","useEffect","handleCalculate","data","result","jsx","ActionsLayout","jsxs","FormProvider","styles","Flex","NumberInputField","Fragment"],"mappings":"
|
|
1
|
+
{"version":3,"file":"GrossUpModal.js","sources":["../../../../src/components/Payroll/GrossUpModal/GrossUpModal.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport type { GrossUpModalProps } from './GrossUpModalTypes'\nimport styles from './GrossUpModal.module.scss'\nimport { ActionsLayout, Flex, NumberInputField } from '@/components/Common'\nimport { useBase } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\n\nconst GrossUpFormSchema = z.object({\n netPay: z.number().positive(),\n})\n\ntype GrossUpFormValues = z.infer<typeof GrossUpFormSchema>\n\n/** @internal */\nexport function GrossUpModal({ isOpen, onCalculateGrossUp, onApply, onCancel }: GrossUpModalProps) {\n useI18n('Payroll.GrossUpModal')\n const { t } = useTranslation('Payroll.GrossUpModal')\n const { Modal, Heading, Text, Button, Alert } = useComponentContext()\n const { baseSubmitHandler } = useBase()\n const modalContainerRef = useRef<HTMLDivElement>(null)\n\n const [calculatedGrossUp, setCalculatedGrossUp] = useState<string | null>(null)\n const [errorMessage, setErrorMessage] = useState<string | null>(null)\n const [isCalculating, setIsCalculating] = useState(false)\n const [isApplying, setIsApplying] = useState(false)\n\n const formHandlers = useForm<GrossUpFormValues>({\n resolver: zodResolver(GrossUpFormSchema),\n defaultValues: { netPay: 0 },\n })\n\n useEffect(() => {\n if (!isOpen) {\n formHandlers.reset({ netPay: 0 })\n setCalculatedGrossUp(null)\n setErrorMessage(null)\n }\n }, [isOpen, formHandlers.reset])\n\n const handleCalculate = async (data: GrossUpFormValues) => {\n setErrorMessage(null)\n setCalculatedGrossUp(null)\n setIsCalculating(true)\n\n await baseSubmitHandler(null, async () => {\n try {\n const result = await onCalculateGrossUp(data.netPay)\n\n if (result) {\n setCalculatedGrossUp(result)\n } else {\n setErrorMessage(t('errorMessage'))\n }\n } finally {\n setIsCalculating(false)\n }\n })\n }\n\n const handleApply = async () => {\n if (calculatedGrossUp) {\n setIsApplying(true)\n await baseSubmitHandler(null, async () => {\n try {\n await onApply(calculatedGrossUp)\n } finally {\n setIsApplying(false)\n }\n })\n }\n }\n\n return (\n <Modal\n isOpen={isOpen}\n onClose={onCancel}\n containerRef={modalContainerRef}\n footer={\n <ActionsLayout>\n <Button\n variant=\"primary\"\n isDisabled={!calculatedGrossUp}\n onClick={handleApply}\n isLoading={isApplying}\n >\n {t('applyCta')}\n </Button>\n <Button variant=\"secondary\" onClick={onCancel}>\n {t('cancelCta')}\n </Button>\n </ActionsLayout>\n }\n >\n <FormProvider {...formHandlers}>\n <div className={styles.header}>\n <Heading as=\"h2\" styledAs=\"h3\">\n {t('title')}\n </Heading>\n <Text variant=\"supporting\" as=\"p\">\n {t('description')}\n </Text>\n </div>\n\n <div className={styles.content}>\n {errorMessage && (\n <div className={styles.alert}>\n <Alert label={errorMessage} status=\"error\" disableScrollIntoView />\n </div>\n )}\n\n <div className={styles.alert}>\n <Alert label={t('warning')} status=\"warning\" disableScrollIntoView />\n </div>\n\n <Flex flexDirection=\"row\" gap={8}>\n <NumberInputField\n name=\"netPay\"\n label={t('netPayLabel')}\n format=\"currency\"\n errorMessage={t('validations.netPay')}\n min={0}\n isRequired\n />\n <Button\n variant=\"secondary\"\n className={styles.calculateButton}\n isDisabled={isCalculating}\n onClick={formHandlers.handleSubmit(handleCalculate)}\n >\n {isCalculating ? t('calculatingCta') : t('calculateCta')}\n </Button>\n </Flex>\n\n {calculatedGrossUp && (\n <>\n <div className={styles.result}>\n <Text size=\"sm\" variant=\"supporting\" weight=\"semibold\">\n {t('grossPayResult')}\n </Text>\n <Heading as=\"h3\">{formatNumberAsCurrency(parseFloat(calculatedGrossUp))}</Heading>\n </div>\n </>\n )}\n </div>\n </FormProvider>\n </Modal>\n )\n}\n"],"names":["GrossUpFormSchema","z","GrossUpModal","isOpen","onCalculateGrossUp","onApply","onCancel","useI18n","t","useTranslation","Modal","Heading","Text","Button","Alert","useComponentContext","baseSubmitHandler","useBase","modalContainerRef","useRef","calculatedGrossUp","setCalculatedGrossUp","useState","errorMessage","setErrorMessage","isCalculating","setIsCalculating","isApplying","setIsApplying","formHandlers","useForm","zodResolver","useEffect","handleCalculate","data","result","jsx","ActionsLayout","jsxs","FormProvider","styles","Flex","NumberInputField","Fragment"],"mappings":"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"}
|
|
@@ -19,6 +19,12 @@ export interface PayrollConfigurationProps extends BaseComponentInterface<'Payro
|
|
|
19
19
|
* Handles the configuration phase of payroll processing, allowing users to review and modify employee compensation before calculating the payroll.
|
|
20
20
|
*
|
|
21
21
|
* @remarks
|
|
22
|
+
* If the payroll turns out to already be processed (e.g. another actor submitted it while this
|
|
23
|
+
* screen was open), this component emits `runPayroll/alreadyProcessed` and then renders
|
|
24
|
+
* {@link PayrollOverview} in its place — the read-only breakdown with the gated "Cancel payroll"
|
|
25
|
+
* action — instead of the configuration table. Events from that delegated view (e.g.
|
|
26
|
+
* `runPayroll/cancelled`) are emitted through this component's own `onEvent`.
|
|
27
|
+
*
|
|
22
28
|
* Emits the following events:
|
|
23
29
|
*
|
|
24
30
|
* @events
|
|
@@ -28,6 +34,7 @@ export interface PayrollConfigurationProps extends BaseComponentInterface<'Payro
|
|
|
28
34
|
* | `runPayroll/employee/skip` | An employee is skipped or unskipped for this payroll | `{ employeeId }` |
|
|
29
35
|
* | `runPayroll/employee/saved` | Employee compensation changes are persisted | `{ payrollPrepared }` |
|
|
30
36
|
* | `runPayroll/calculated` | Payroll calculation completes successfully | `{ payrollId, alert, payPeriod }` |
|
|
37
|
+
* | `runPayroll/alreadyProcessed` | The payroll turns out to already be processed while configuring it | `{ payrollId, alert, payPeriod }` |
|
|
31
38
|
* | `runPayroll/processingFailed` | Payroll calculation fails or times out | — |
|
|
32
39
|
* | `runPayroll/blockers/viewAll` | The "view all blockers" affordance is selected | — |
|
|
33
40
|
* | `runPayroll/grossUp/selected` | The set-net-earnings menu item is selected for an employee | `{ employeeUuid }` |
|
|
@@ -1,169 +1,196 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as f, useRef as
|
|
3
|
-
import { useQueryClient as
|
|
4
|
-
import { usePayrollsGetSuspense as
|
|
5
|
-
import { payrollsCalculate as
|
|
6
|
-
import { useGustoEmbeddedContext as
|
|
7
|
-
import { PayrollProcessingRequestStatus as
|
|
8
|
-
import { useTranslation as
|
|
9
|
-
import { usePayrollsUpdateMutation as
|
|
10
|
-
import { usePayrollsCalculateGrossUpMutation as
|
|
11
|
-
import { usePayrollsGetBlockersSuspense as
|
|
12
|
-
import { payrollSubmitHandler as
|
|
13
|
-
import { hasDirectDepositEmployees as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
import { jsx as C, jsxs as fe, Fragment as Ce } from "react/jsx-runtime";
|
|
2
|
+
import { useState as f, useRef as q, useMemo as F, useEffect as D } from "react";
|
|
3
|
+
import { useQueryClient as Pe } from "@tanstack/react-query";
|
|
4
|
+
import { usePayrollsGetSuspense as Ue } from "@gusto/embedded-api/react-query/payrollsGet";
|
|
5
|
+
import { payrollsCalculate as ge } from "@gusto/embedded-api/funcs/payrollsCalculate";
|
|
6
|
+
import { useGustoEmbeddedContext as he } from "@gusto/embedded-api/react-query/_context";
|
|
7
|
+
import { PayrollProcessingRequestStatus as O } from "@gusto/embedded-api/models/components/payrollprocessingrequest";
|
|
8
|
+
import { useTranslation as Le } from "react-i18next";
|
|
9
|
+
import { usePayrollsUpdateMutation as Se } from "@gusto/embedded-api/react-query/payrollsUpdate";
|
|
10
|
+
import { usePayrollsCalculateGrossUpMutation as Ae } from "@gusto/embedded-api/react-query/payrollsCalculateGrossUp";
|
|
11
|
+
import { usePayrollsGetBlockersSuspense as _e } from "@gusto/embedded-api/react-query/payrollsGetBlockers";
|
|
12
|
+
import { payrollSubmitHandler as we } from "../PayrollBlocker/payrollHelpers.js";
|
|
13
|
+
import { hasDirectDepositEmployees as Re } from "../helpers.js";
|
|
14
|
+
import { PayrollOverview as Ee } from "../PayrollOverview/PayrollOverview.js";
|
|
15
|
+
import { PayrollConfigurationPresentation as De } from "./PayrollConfigurationPresentation.js";
|
|
16
|
+
import { usePayrollConfigurationData as Oe } from "./usePayrollConfigurationData.js";
|
|
17
|
+
import { isGrossUpEligible as Te, getGrossUpTargetCompensationName as xe } from "./grossUpHelpers.js";
|
|
18
|
+
import { BaseComponent as be } from "../../Base/Base.js";
|
|
19
|
+
import { componentEvents as l } from "../../../shared/constants.js";
|
|
20
|
+
import { useComponentDictionary as ke, useI18n as Ne } from "../../../i18n/I18n.js";
|
|
21
|
+
import { useBase as Ge } from "../../Base/useBase.js";
|
|
22
|
+
import { useDateFormatter as Ye } from "../../../hooks/useDateFormatter.js";
|
|
23
|
+
import { SDKInternalError as j } from "../../../types/sdkError.js";
|
|
24
|
+
import { API_QUERY_NAMESPACE as Me } from "../../../contexts/ApiProvider/apiVersion.js";
|
|
25
|
+
import { GrossUpModal as Be } from "../GrossUpModal/GrossUpModal.js";
|
|
26
|
+
const qe = (t) => t?.status === O.Calculating, Fe = (t, u) => u != null && (t?.status === O.CalculateSuccess || t == null);
|
|
27
|
+
function fo(t) {
|
|
28
|
+
return /* @__PURE__ */ C(be, { ...t, children: /* @__PURE__ */ C(je, { ...t, children: t.children }) });
|
|
28
29
|
}
|
|
29
|
-
const
|
|
30
|
+
const je = ({
|
|
30
31
|
onEvent: t,
|
|
31
|
-
companyId:
|
|
32
|
-
payrollId:
|
|
33
|
-
dictionary:
|
|
34
|
-
alerts:
|
|
35
|
-
withReimbursements:
|
|
32
|
+
companyId: u,
|
|
33
|
+
payrollId: i,
|
|
34
|
+
dictionary: v,
|
|
35
|
+
alerts: W,
|
|
36
|
+
withReimbursements: T = !0
|
|
36
37
|
}) => {
|
|
37
|
-
|
|
38
|
-
const { t: p } =
|
|
38
|
+
ke("Payroll.PayrollConfiguration", v), Ne("Payroll.PayrollConfiguration");
|
|
39
|
+
const { t: p } = Le("Payroll.PayrollConfiguration"), { baseSubmitHandler: P } = Ge(), c = Ye(), [n, m] = f(!1), [g, x] = f(!1), h = q(null), K = he(), H = Pe(), { data: s } = Ue(
|
|
39
40
|
{
|
|
40
|
-
companyId:
|
|
41
|
-
payrollId:
|
|
41
|
+
companyId: u,
|
|
42
|
+
payrollId: i,
|
|
42
43
|
include: ["taxes", "benefits", "deductions", "payroll_status_meta"]
|
|
43
44
|
},
|
|
44
|
-
{ refetchInterval:
|
|
45
|
-
),
|
|
45
|
+
{ refetchInterval: n ? 5e3 : !1 }
|
|
46
|
+
), V = F(
|
|
46
47
|
() => s.payrollShow?.employeeCompensations?.filter((e) => e.excluded).map((e) => e.employeeUuid).filter(Boolean) ?? [],
|
|
47
48
|
[s.payrollShow?.employeeCompensations]
|
|
48
49
|
), {
|
|
49
|
-
employeeDetails:
|
|
50
|
-
employeeCompensations:
|
|
51
|
-
paySchedule:
|
|
52
|
-
payPeriod:
|
|
50
|
+
employeeDetails: I,
|
|
51
|
+
employeeCompensations: b,
|
|
52
|
+
paySchedule: Q,
|
|
53
|
+
payPeriod: J,
|
|
53
54
|
payrollCategory: L,
|
|
54
|
-
pagination:
|
|
55
|
-
isLoading:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
55
|
+
pagination: z,
|
|
56
|
+
isLoading: X,
|
|
57
|
+
isAlreadyProcessed: S,
|
|
58
|
+
refetch: A
|
|
59
|
+
} = Oe({
|
|
60
|
+
companyId: u,
|
|
61
|
+
payrollId: i,
|
|
62
|
+
isCalculating: n || g,
|
|
63
|
+
excludedEmployeeUuids: V
|
|
64
|
+
}), _ = F(
|
|
65
|
+
() => ({
|
|
66
|
+
type: "error",
|
|
67
|
+
title: p("alerts.alreadyProcessed"),
|
|
68
|
+
alertKey: "alreadyProcessed"
|
|
69
|
+
}),
|
|
70
|
+
[p]
|
|
71
|
+
), w = q(!1);
|
|
72
|
+
D(() => {
|
|
73
|
+
if (!S) {
|
|
74
|
+
w.current = !1;
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
w.current || (w.current = !0, t(l.RUN_PAYROLL_ALREADY_PROCESSED, {
|
|
78
|
+
payrollId: i,
|
|
79
|
+
alert: _,
|
|
80
|
+
payPeriod: s.payrollShow?.payPeriod
|
|
81
|
+
}));
|
|
82
|
+
}, [
|
|
83
|
+
S,
|
|
84
|
+
t,
|
|
85
|
+
i,
|
|
86
|
+
_,
|
|
87
|
+
s.payrollShow?.payPeriod
|
|
88
|
+
]);
|
|
89
|
+
const { mutateAsync: k, isPending: Z } = Se(), { mutateAsync: $ } = Ae(), [d, N] = f(null), [ee, R] = f(!1), G = Te(L), U = xe(L), oe = (e) => {
|
|
90
|
+
N(e), R(!0), t(l.RUN_PAYROLL_GROSS_UP_SELECTED, { employeeUuid: e });
|
|
91
|
+
}, te = async (e) => {
|
|
65
92
|
if (!d) return null;
|
|
66
93
|
let o = null;
|
|
67
|
-
return await
|
|
68
|
-
o = (await
|
|
94
|
+
return await P(null, async () => {
|
|
95
|
+
o = (await $({
|
|
69
96
|
request: {
|
|
70
|
-
payrollUuid:
|
|
97
|
+
payrollUuid: i,
|
|
71
98
|
payrollGrossUpRequest: {
|
|
72
99
|
employeeUuid: d,
|
|
73
100
|
netPay: e.toString()
|
|
74
101
|
}
|
|
75
102
|
}
|
|
76
|
-
})).payrollGrossUpResponse?.grossUp ?? null, o && t(
|
|
103
|
+
})).payrollGrossUpResponse?.grossUp ?? null, o && t(l.RUN_PAYROLL_GROSS_UP_CALCULATED, {
|
|
77
104
|
grossUp: o,
|
|
78
105
|
netPay: e,
|
|
79
106
|
employeeUuid: d
|
|
80
107
|
});
|
|
81
108
|
}), o;
|
|
82
|
-
},
|
|
109
|
+
}, ae = async (e) => {
|
|
83
110
|
if (!d || !U)
|
|
84
|
-
throw new
|
|
111
|
+
throw new j(
|
|
85
112
|
"Unable to apply gross-up: missing employee or target compensation."
|
|
86
113
|
);
|
|
87
|
-
const o =
|
|
114
|
+
const o = b.find((a) => a.employeeUuid === d);
|
|
88
115
|
if (!o)
|
|
89
|
-
throw new
|
|
90
|
-
const
|
|
116
|
+
throw new j("Unable to apply gross-up: employee compensation not found.");
|
|
117
|
+
const r = o.fixedCompensations ?? [], y = r.some(
|
|
91
118
|
(a) => a.name?.toLowerCase() === U.toLowerCase()
|
|
92
|
-
),
|
|
119
|
+
), B = r.map((a) => ({
|
|
93
120
|
name: a.name,
|
|
94
121
|
jobUuid: a.jobUuid,
|
|
95
122
|
amount: a.name?.toLowerCase() === U.toLowerCase() ? e : "0"
|
|
96
123
|
}));
|
|
97
124
|
if (!y) {
|
|
98
|
-
const a = o.hourlyCompensations?.[0]?.jobUuid ??
|
|
99
|
-
|
|
125
|
+
const a = o.hourlyCompensations?.[0]?.jobUuid ?? r[0]?.jobUuid ?? "";
|
|
126
|
+
B.push({
|
|
100
127
|
name: U,
|
|
101
128
|
jobUuid: a,
|
|
102
129
|
amount: e
|
|
103
130
|
});
|
|
104
131
|
}
|
|
105
|
-
const
|
|
132
|
+
const me = (o.hourlyCompensations ?? []).map((a) => ({
|
|
106
133
|
name: a.name,
|
|
107
134
|
jobUuid: a.jobUuid,
|
|
108
135
|
hours: "0"
|
|
109
|
-
})),
|
|
136
|
+
})), de = (o.paidTimeOff ?? []).map((a) => ({
|
|
110
137
|
name: a.name,
|
|
111
138
|
hours: "0"
|
|
112
|
-
})),
|
|
139
|
+
})), ye = M({
|
|
113
140
|
...o,
|
|
114
|
-
fixedCompensations:
|
|
115
|
-
hourlyCompensations:
|
|
116
|
-
paidTimeOff:
|
|
141
|
+
fixedCompensations: B,
|
|
142
|
+
hourlyCompensations: me,
|
|
143
|
+
paidTimeOff: de
|
|
117
144
|
});
|
|
118
|
-
await
|
|
119
|
-
const a = await
|
|
145
|
+
await P({}, async () => {
|
|
146
|
+
const a = await k({
|
|
120
147
|
request: {
|
|
121
|
-
companyId:
|
|
122
|
-
payrollId:
|
|
148
|
+
companyId: u,
|
|
149
|
+
payrollId: i,
|
|
123
150
|
payrollUpdate: {
|
|
124
|
-
employeeCompensations: [{ ...
|
|
151
|
+
employeeCompensations: [{ ...ye, excluded: !1 }]
|
|
125
152
|
}
|
|
126
153
|
}
|
|
127
154
|
});
|
|
128
|
-
t(
|
|
155
|
+
t(l.RUN_PAYROLL_EMPLOYEE_SAVED, {
|
|
129
156
|
payrollPrepared: a.payrollPrepared
|
|
130
|
-
}), await
|
|
131
|
-
}),
|
|
132
|
-
},
|
|
157
|
+
}), await A();
|
|
158
|
+
}), N(null), R(!1);
|
|
159
|
+
}, se = async (e) => {
|
|
133
160
|
try {
|
|
134
|
-
await
|
|
161
|
+
await ae(e);
|
|
135
162
|
} catch {
|
|
136
163
|
}
|
|
137
|
-
}, { data:
|
|
138
|
-
companyUuid:
|
|
139
|
-
}),
|
|
164
|
+
}, { data: re } = _e({
|
|
165
|
+
companyUuid: u
|
|
166
|
+
}), Y = (re.payrollBlockers ?? []).map((e) => ({
|
|
140
167
|
key: e.key,
|
|
141
168
|
message: e.message
|
|
142
|
-
})), [
|
|
143
|
-
|
|
144
|
-
const e = await
|
|
145
|
-
|
|
169
|
+
})), [le, E] = f(Y), ie = async () => {
|
|
170
|
+
E([]), h.current = s.payrollShow?.calculatedAt?.getTime() ?? null, await P({}, async () => {
|
|
171
|
+
const e = await we(async () => {
|
|
172
|
+
x(!0);
|
|
146
173
|
try {
|
|
147
|
-
const o = await
|
|
148
|
-
companyId:
|
|
149
|
-
payrollId:
|
|
174
|
+
const o = await ge(K, {
|
|
175
|
+
companyId: u,
|
|
176
|
+
payrollId: i
|
|
150
177
|
});
|
|
151
178
|
if (!o.ok)
|
|
152
179
|
throw o.error;
|
|
153
|
-
|
|
180
|
+
H.invalidateQueries({ queryKey: [Me] }), m(!0);
|
|
154
181
|
} finally {
|
|
155
|
-
|
|
182
|
+
x(!1);
|
|
156
183
|
}
|
|
157
184
|
});
|
|
158
|
-
!e.success && e.blockers.length > 0 &&
|
|
185
|
+
!e.success && e.blockers.length > 0 && E(e.blockers);
|
|
159
186
|
});
|
|
160
|
-
},
|
|
161
|
-
t(
|
|
187
|
+
}, ne = (e) => {
|
|
188
|
+
t(l.RUN_PAYROLL_EMPLOYEE_EDIT, {
|
|
162
189
|
employeeId: e.uuid,
|
|
163
190
|
firstName: e.firstName,
|
|
164
191
|
lastName: e.lastName
|
|
165
192
|
});
|
|
166
|
-
},
|
|
193
|
+
}, M = (e) => {
|
|
167
194
|
const { paymentMethod: o } = e;
|
|
168
195
|
return {
|
|
169
196
|
employeeUuid: e.employeeUuid,
|
|
@@ -176,14 +203,14 @@ const Ye = ({
|
|
|
176
203
|
...o && o !== "Historical" ? { paymentMethod: o } : {},
|
|
177
204
|
memo: e.memo || void 0
|
|
178
205
|
};
|
|
179
|
-
},
|
|
180
|
-
t(
|
|
206
|
+
}, ue = async (e) => {
|
|
207
|
+
t(l.RUN_PAYROLL_EMPLOYEE_SKIP, {
|
|
181
208
|
employeeId: e.employeeUuid
|
|
182
|
-
}), await
|
|
183
|
-
const o =
|
|
209
|
+
}), await P({}, async () => {
|
|
210
|
+
const o = M(e), r = await k({
|
|
184
211
|
request: {
|
|
185
|
-
companyId:
|
|
186
|
-
payrollId:
|
|
212
|
+
companyId: u,
|
|
213
|
+
payrollId: i,
|
|
187
214
|
payrollUpdate: {
|
|
188
215
|
employeeCompensations: [
|
|
189
216
|
{ ...o, excluded: !o.excluded }
|
|
@@ -191,42 +218,42 @@ const Ye = ({
|
|
|
191
218
|
}
|
|
192
219
|
}
|
|
193
220
|
});
|
|
194
|
-
t(
|
|
195
|
-
payrollPrepared:
|
|
196
|
-
}), await
|
|
221
|
+
t(l.RUN_PAYROLL_EMPLOYEE_SAVED, {
|
|
222
|
+
payrollPrepared: r.payrollPrepared
|
|
223
|
+
}), await A();
|
|
197
224
|
});
|
|
198
|
-
},
|
|
199
|
-
t(
|
|
225
|
+
}, pe = () => {
|
|
226
|
+
t(l.RUN_PAYROLL_BLOCKERS_VIEW_ALL);
|
|
200
227
|
};
|
|
201
|
-
|
|
202
|
-
|
|
228
|
+
D(() => {
|
|
229
|
+
qe(s.payrollShow?.processingRequest) && !n && (h.current = s.payrollShow?.calculatedAt?.getTime() ?? null, m(!0));
|
|
203
230
|
const e = s.payrollShow?.calculatedAt, o = e?.getTime() !== h.current;
|
|
204
|
-
|
|
205
|
-
payrollId:
|
|
231
|
+
n && o && Fe(s.payrollShow?.processingRequest, e) && (t(l.RUN_PAYROLL_CALCULATED, {
|
|
232
|
+
payrollId: i,
|
|
206
233
|
alert: {
|
|
207
234
|
type: "success",
|
|
208
235
|
title: p("alerts.progressSaved"),
|
|
209
236
|
alertKey: "progressSaved"
|
|
210
237
|
},
|
|
211
238
|
payPeriod: s.payrollShow?.payPeriod
|
|
212
|
-
}),
|
|
239
|
+
}), E([]), m(!1)), n && s.payrollShow?.processingRequest?.status === O.ProcessingFailed && (t(l.RUN_PAYROLL_PROCESSING_FAILED), m(!1));
|
|
213
240
|
}, [
|
|
214
241
|
s.payrollShow?.processingRequest?.status,
|
|
215
242
|
s.payrollShow?.calculatedAt,
|
|
216
|
-
|
|
243
|
+
n,
|
|
217
244
|
t,
|
|
218
245
|
p,
|
|
219
|
-
|
|
220
|
-
]),
|
|
221
|
-
if (!
|
|
246
|
+
i
|
|
247
|
+
]), D(() => {
|
|
248
|
+
if (!n) return;
|
|
222
249
|
const e = 180 * 1e3, o = setTimeout(() => {
|
|
223
|
-
t(
|
|
250
|
+
t(l.RUN_PAYROLL_PROCESSING_FAILED), m(!1);
|
|
224
251
|
}, e);
|
|
225
252
|
return () => {
|
|
226
253
|
clearTimeout(o);
|
|
227
254
|
};
|
|
228
|
-
}, [
|
|
229
|
-
const
|
|
255
|
+
}, [n, t]);
|
|
256
|
+
const ce = (() => {
|
|
230
257
|
const e = s.payrollShow?.payrollStatusMeta;
|
|
231
258
|
if (e?.payrollLate && e.initialCheckDate && e.expectedDebitTime && e.expectedCheckDate)
|
|
232
259
|
return {
|
|
@@ -239,56 +266,67 @@ const Ye = ({
|
|
|
239
266
|
}),
|
|
240
267
|
variant: "warning"
|
|
241
268
|
};
|
|
242
|
-
const { payrollShow:
|
|
243
|
-
if (
|
|
269
|
+
const { payrollShow: r } = s, y = r?.employeeCompensations;
|
|
270
|
+
if (r && y && y.length > 0 && Re(y))
|
|
244
271
|
return {
|
|
245
272
|
label: p("alerts.directDepositDeadline", {
|
|
246
|
-
payDate: c.formatShortWithWeekday(
|
|
247
|
-
...c.formatWithTime(
|
|
273
|
+
payDate: c.formatShortWithWeekday(r.checkDate),
|
|
274
|
+
...c.formatWithTime(r.payrollDeadline)
|
|
248
275
|
}),
|
|
249
276
|
content: p("alerts.directDepositDeadlineText"),
|
|
250
277
|
variant: "info"
|
|
251
278
|
};
|
|
252
279
|
})();
|
|
253
|
-
return /* @__PURE__ */
|
|
254
|
-
|
|
255
|
-
|
|
280
|
+
return S ? /* @__PURE__ */ C(
|
|
281
|
+
Ee,
|
|
282
|
+
{
|
|
283
|
+
companyId: u,
|
|
284
|
+
payrollId: i,
|
|
285
|
+
onEvent: (o, r) => {
|
|
286
|
+
o === l.RUN_PAYROLL_CANCELLED && A(), t(o, r);
|
|
287
|
+
},
|
|
288
|
+
withReimbursements: T,
|
|
289
|
+
alerts: [_]
|
|
290
|
+
}
|
|
291
|
+
) : /* @__PURE__ */ fe(Ce, { children: [
|
|
292
|
+
/* @__PURE__ */ C(
|
|
293
|
+
De,
|
|
256
294
|
{
|
|
257
|
-
onCalculatePayroll:
|
|
258
|
-
isCalculateDisabled:
|
|
259
|
-
onEdit:
|
|
260
|
-
onToggleExclude:
|
|
261
|
-
onViewBlockers:
|
|
262
|
-
employeeCompensations:
|
|
263
|
-
employeeDetails:
|
|
264
|
-
payPeriod:
|
|
265
|
-
paySchedule:
|
|
295
|
+
onCalculatePayroll: ie,
|
|
296
|
+
isCalculateDisabled: Y.length > 0,
|
|
297
|
+
onEdit: ne,
|
|
298
|
+
onToggleExclude: ue,
|
|
299
|
+
onViewBlockers: pe,
|
|
300
|
+
employeeCompensations: b,
|
|
301
|
+
employeeDetails: I,
|
|
302
|
+
payPeriod: J,
|
|
303
|
+
paySchedule: Q,
|
|
266
304
|
payrollCategory: L,
|
|
267
|
-
alerts:
|
|
268
|
-
payrollAlert:
|
|
269
|
-
isPending:
|
|
270
|
-
isCalculating: g ||
|
|
271
|
-
payrollBlockers:
|
|
272
|
-
pagination:
|
|
273
|
-
withReimbursements:
|
|
274
|
-
grossUpEnabled:
|
|
275
|
-
onGrossUpSelect:
|
|
305
|
+
alerts: W,
|
|
306
|
+
payrollAlert: ce,
|
|
307
|
+
isPending: n || X || Z || g,
|
|
308
|
+
isCalculating: g || n,
|
|
309
|
+
payrollBlockers: le,
|
|
310
|
+
pagination: z,
|
|
311
|
+
withReimbursements: T,
|
|
312
|
+
grossUpEnabled: G,
|
|
313
|
+
onGrossUpSelect: oe
|
|
276
314
|
}
|
|
277
315
|
),
|
|
278
|
-
|
|
279
|
-
|
|
316
|
+
G && /* @__PURE__ */ C(
|
|
317
|
+
Be,
|
|
280
318
|
{
|
|
281
|
-
isOpen:
|
|
282
|
-
onCalculateGrossUp:
|
|
283
|
-
onApply:
|
|
319
|
+
isOpen: ee,
|
|
320
|
+
onCalculateGrossUp: te,
|
|
321
|
+
onApply: se,
|
|
284
322
|
onCancel: () => {
|
|
285
|
-
|
|
323
|
+
R(!1);
|
|
286
324
|
}
|
|
287
325
|
}
|
|
288
326
|
)
|
|
289
327
|
] });
|
|
290
328
|
};
|
|
291
329
|
export {
|
|
292
|
-
|
|
330
|
+
fo as PayrollConfiguration
|
|
293
331
|
};
|
|
294
332
|
//# sourceMappingURL=PayrollConfiguration.js.map
|