@gusto/embedded-react-sdk 0.22.0 → 0.23.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 +31 -0
- package/dist/assets/icons/eye.svg.js +10 -0
- package/dist/assets/icons/eye.svg.js.map +1 -0
- package/dist/components/Common/PaginationControl/PaginationControlTypes.d.ts +1 -1
- package/dist/components/Common/ReorderableList/ReorderableItem.d.ts +1 -1
- package/dist/components/Common/ReorderableList/ReorderableItem.js.map +1 -1
- package/dist/components/Common/ReorderableList/ReorderableList.js +7 -7
- package/dist/components/Common/ReorderableList/ReorderableList.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +12 -11
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +2 -2
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Common/UI/Button/ButtonIcon.d.ts +1 -1
- package/dist/components/Common/UI/Button/ButtonIcon.js +10 -7
- package/dist/components/Common/UI/Button/ButtonIcon.js.map +1 -1
- package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
- package/dist/components/Common/UI/Tabs/Tabs.module.scss.js +5 -5
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +12 -12
- 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/InviteSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +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/Form.js +6 -5
- 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/BankAccountVerify/Form.js +6 -5
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +2 -2
- 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 +2 -2
- 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/FederalTaxes.js +2 -2
- package/dist/components/Company/FederalTaxes/Form.js +4 -3
- 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/Context.js +7 -6
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +2 -2
- 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/LocationsList.js +2 -2
- 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 +3 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
- package/dist/components/Company/PaySchedule/_parts/Head.js +9 -8
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +12 -11
- 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/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/index.d.ts +2 -0
- package/dist/components/Company/index.js +20 -16
- package/dist/components/Company/index.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +2 -2
- package/dist/components/Contractor/Address/Form.js +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 +17 -17
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -2
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.d.ts +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +198 -42
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +15 -8
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +94 -63
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.d.ts +39 -0
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +132 -0
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +11 -0
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +139 -0
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/helpers.d.ts +2 -0
- package/dist/components/Contractor/Payments/CreatePayment/helpers.js +6 -0
- package/dist/components/Contractor/Payments/CreatePayment/helpers.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +3 -2
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +21 -20
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +1 -2
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +48 -84
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.d.ts +8 -0
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js +26 -0
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js.map +1 -0
- package/dist/components/Contractor/Payments/{Detail/DetailPresentation.d.ts → PaymentHistory/PaymentHistoryPresentation.d.ts} +5 -4
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +114 -0
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.d.ts +3 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +43 -23
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.d.ts +8 -14
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +73 -65
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/types.d.ts +8 -0
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
- 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 +1 -1
- package/dist/components/Employee/Compensation/Edit.js +14 -14
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +11 -10
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +0 -3
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +63 -76
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +12 -11
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +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 +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/EmployeeList.js +4 -3
- package/dist/components/Employee/EmployeeList/EmployeeList.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/useEmployeeList.js +4 -3
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +7 -7
- 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 +8 -8
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +2 -2
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +25 -23
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js +116 -106
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +8 -8
- 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/AdminPersonalDetails.js +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
- package/dist/components/Employee/Profile/useProfile.js +4 -3
- package/dist/components/Employee/Profile/useProfile.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/FederalForm.js +7 -7
- package/dist/components/Employee/Taxes/useTaxes.js +4 -3
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Flow/Flow.d.ts +3 -3
- package/dist/components/Flow/Flow.js +32 -27
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +9 -9
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +7 -6
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +3 -2
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +27 -27
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +9 -8
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +87 -72
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +18 -17
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +17 -16
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +35 -35
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/{FastAchThresholdExceeded.d.ts → FastAchSubmissionBlockerBanner.d.ts} +2 -2
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +55 -0
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -0
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/index.d.ts +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +3 -2
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js +1 -1
- package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +1 -1
- package/dist/components/Payroll/index.js +8 -6
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +6 -5
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +4 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +9 -10
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/LocaleProvider/useLocale.d.ts +6 -3
- package/dist/contexts/LocaleProvider/useLocale.js +12 -9
- package/dist/contexts/LocaleProvider/useLocale.js.map +1 -1
- package/dist/helpers/currencyHelpers.d.ts +2 -0
- package/dist/helpers/currencyHelpers.js +6 -0
- package/dist/helpers/currencyHelpers.js.map +1 -0
- package/dist/i18n/I18n.js +3 -3
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +27 -21
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js.map +1 -1
- package/dist/i18n/en/Contractor.Payments.PaymentHistory.json.js +24 -0
- package/dist/i18n/en/Contractor.Payments.PaymentHistory.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js +30 -28
- package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +1 -1
- package/dist/i18n/en/Payroll.PayrollList.json.js +5 -5
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +14 -14
- package/dist/shared/constants.d.ts +8 -2
- package/dist/shared/constants.js +18 -12
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +57 -46
- package/package.json +11 -11
- package/dist/components/Contractor/Payments/EditPayment/EditPayment.d.ts +0 -7
- package/dist/components/Contractor/Payments/EditPayment/EditPayment.js +0 -34
- package/dist/components/Contractor/Payments/EditPayment/EditPayment.js.map +0 -1
- package/dist/components/Contractor/Payments/EditPayment/EditPaymentPresentation.d.ts +0 -6
- package/dist/components/Contractor/Payments/EditPayment/EditPaymentPresentation.js +0 -84
- package/dist/components/Contractor/Payments/EditPayment/EditPaymentPresentation.js.map +0 -1
- package/dist/components/Contractor/Payments/Overview/Overview.d.ts +0 -7
- package/dist/components/Contractor/Payments/Overview/Overview.js +0 -72
- package/dist/components/Contractor/Payments/Overview/Overview.js.map +0 -1
- package/dist/components/Contractor/Payments/Overview/OverviewPresentation.d.ts +0 -18
- package/dist/components/Contractor/Payments/Overview/OverviewPresentation.js +0 -131
- package/dist/components/Contractor/Payments/Overview/OverviewPresentation.js.map +0 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js +0 -51
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js.map +0 -1
- package/dist/i18n/en/Contractor.Payments.EditPayment.json.js +0 -36
- package/dist/i18n/en/Contractor.Payments.EditPayment.json.js.map +0 -1
- package/dist/i18n/en/Contractor.Payments.Overview.json.js +0 -34
- package/dist/i18n/en/Contractor.Payments.Overview.json.js.map +0 -1
- package/dist/i18n/en/ContractorPayment.ContractorPaymentDetail.json.js +0 -24
- package/dist/i18n/en/ContractorPayment.ContractorPaymentDetail.json.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProfile.js","sources":["../../../../src/components/Employee/Profile/useProfile.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\n\n//Interface for context passed down to component slots\ntype ProfileContextType = {\n companyLocations: Location[]\n workAddresses?: EmployeeWorkAddress[]\n employee?: Employee\n isSelfOnboardingIntended?: boolean\n isPending: boolean\n isAdmin: boolean\n handleCancel: () => void\n isSelfOnboardingEnabled: boolean\n hasCompletedSelfOnboarding: boolean\n}\n\nconst [useProfile, ProfileProvider] = createCompoundContext<ProfileContextType>('ProfileContext')\nexport { useProfile, ProfileProvider }\n"],"names":["useProfile","ProfileProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useProfile.js","sources":["../../../../src/components/Employee/Profile/useProfile.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\n\n//Interface for context passed down to component slots\ntype ProfileContextType = {\n companyLocations: Location[]\n workAddresses?: EmployeeWorkAddress[]\n employee?: Employee\n isSelfOnboardingIntended?: boolean\n isPending: boolean\n isAdmin: boolean\n handleCancel: () => void\n isSelfOnboardingEnabled: boolean\n hasCompletedSelfOnboarding: boolean\n}\n\nconst [useProfile, ProfileProvider] = createCompoundContext<ProfileContextType>('ProfileContext')\nexport { useProfile, ProfileProvider }\n"],"names":["useProfile","ProfileProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAM,CAACA,GAAYC,CAAe,IAAIC,EAA0C,gBAAgB;"}
|
|
@@ -9,11 +9,12 @@ import "../../Base/useBase.js";
|
|
|
9
9
|
import "../../../shared/constants.js";
|
|
10
10
|
import "classnames";
|
|
11
11
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
|
+
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
12
13
|
import "dompurify";
|
|
13
14
|
import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
|
|
14
|
-
const [
|
|
15
|
+
const [d, u] = t("StateTaxesContext");
|
|
15
16
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
u as StateTaxesProvider,
|
|
18
|
+
d as useStateTaxes
|
|
18
19
|
};
|
|
19
20
|
//# sourceMappingURL=useStateTaxes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStateTaxes.js","sources":["../../../../src/components/Employee/StateTaxes/useStateTaxes.ts"],"sourcesContent":["import type { EmployeeStateTaxesList } from '@gusto/embedded-api/models/components/employeestatetaxeslist'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesContextType = {\n employeeStateTaxes: EmployeeStateTaxesList[]\n isPending: boolean\n isAdmin: boolean\n}\n\nconst [useStateTaxes, StateTaxesProvider] =\n createCompoundContext<StateTaxesContextType>('StateTaxesContext')\nexport { useStateTaxes, StateTaxesProvider }\n"],"names":["useStateTaxes","StateTaxesProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useStateTaxes.js","sources":["../../../../src/components/Employee/StateTaxes/useStateTaxes.ts"],"sourcesContent":["import type { EmployeeStateTaxesList } from '@gusto/embedded-api/models/components/employeestatetaxeslist'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesContextType = {\n employeeStateTaxes: EmployeeStateTaxesList[]\n isPending: boolean\n isAdmin: boolean\n}\n\nconst [useStateTaxes, StateTaxesProvider] =\n createCompoundContext<StateTaxesContextType>('StateTaxesContext')\nexport { useStateTaxes, StateTaxesProvider }\n"],"names":["useStateTaxes","StateTaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AASA,MAAM,CAACA,GAAeC,CAAkB,IACtCC,EAA6C,mBAAmB;"}
|
|
@@ -4,12 +4,12 @@ import { useFormContext as m } from "react-hook-form";
|
|
|
4
4
|
import { z as t } from "zod";
|
|
5
5
|
import "../../../shared/constants.js";
|
|
6
6
|
import "classnames";
|
|
7
|
-
import {
|
|
7
|
+
import { RadioGroupField as g } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
8
|
+
import { TextInputField as f } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
9
|
+
import { NumberInputField as l } from "../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
10
|
+
import { useComponentContext as c } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
11
|
import "react";
|
|
9
12
|
import { SelectField as s } from "../../Common/Fields/SelectField/SelectField.js";
|
|
10
|
-
import { RadioGroupField as f } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
11
|
-
import { NumberInputField as l } from "../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
12
|
-
import { TextInputField as c } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
13
13
|
const p = t.object({
|
|
14
14
|
w4DataType: t.literal("rev_2020_w4"),
|
|
15
15
|
filingStatus: t.string().min(1),
|
|
@@ -29,7 +29,7 @@ function A() {
|
|
|
29
29
|
return e("w4DataType") === "rev_2020_w4" ? /* @__PURE__ */ i(b, {}) : /* @__PURE__ */ i(S, {});
|
|
30
30
|
}
|
|
31
31
|
function b() {
|
|
32
|
-
const { t: e } = o("Employee.Taxes"), r =
|
|
32
|
+
const { t: e } = o("Employee.Taxes"), r = c(), d = [
|
|
33
33
|
{ value: "Single", label: e("filingStatusSingle") },
|
|
34
34
|
{ value: "Married", label: e("filingStatusMarried") },
|
|
35
35
|
{ value: "Head of Household", label: e("filingStatusHeadOfHousehold") },
|
|
@@ -48,7 +48,7 @@ function b() {
|
|
|
48
48
|
}
|
|
49
49
|
),
|
|
50
50
|
/* @__PURE__ */ i(
|
|
51
|
-
|
|
51
|
+
g,
|
|
52
52
|
{
|
|
53
53
|
name: "twoJobs",
|
|
54
54
|
isRequired: !0,
|
|
@@ -147,7 +147,7 @@ function S() {
|
|
|
147
147
|
}
|
|
148
148
|
),
|
|
149
149
|
/* @__PURE__ */ i(
|
|
150
|
-
|
|
150
|
+
f,
|
|
151
151
|
{
|
|
152
152
|
name: "additionalWithholding",
|
|
153
153
|
label: e("additionalWithholding"),
|
|
@@ -9,11 +9,12 @@ import "../../Base/useBase.js";
|
|
|
9
9
|
import "../../../shared/constants.js";
|
|
10
10
|
import "classnames";
|
|
11
11
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
|
+
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
12
13
|
import "dompurify";
|
|
13
14
|
import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
|
|
14
|
-
const [
|
|
15
|
+
const [u, f] = o("TaxesContext");
|
|
15
16
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
f as TaxesProvider,
|
|
18
|
+
u as useTaxes
|
|
18
19
|
};
|
|
19
20
|
//# sourceMappingURL=useTaxes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTaxes.js","sources":["../../../../src/components/Employee/Taxes/useTaxes.ts"],"sourcesContent":["import type { EmployeeStateTaxesList } from '@gusto/embedded-api/models/components/employeestatetaxeslist'\nimport { createCompoundContext } from '@/components/Base'\n\ntype TaxesContextType = {\n employeeStateTaxes: EmployeeStateTaxesList[]\n isPending: boolean\n isAdmin: boolean\n}\n\nconst [useTaxes, TaxesProvider] = createCompoundContext<TaxesContextType>('TaxesContext')\nexport { useTaxes, TaxesProvider }\n"],"names":["useTaxes","TaxesProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTaxes.js","sources":["../../../../src/components/Employee/Taxes/useTaxes.ts"],"sourcesContent":["import type { EmployeeStateTaxesList } from '@gusto/embedded-api/models/components/employeestatetaxeslist'\nimport { createCompoundContext } from '@/components/Base'\n\ntype TaxesContextType = {\n employeeStateTaxes: EmployeeStateTaxesList[]\n isPending: boolean\n isAdmin: boolean\n}\n\nconst [useTaxes, TaxesProvider] = createCompoundContext<TaxesContextType>('TaxesContext')\nexport { useTaxes, TaxesProvider }\n"],"names":["useTaxes","TaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AASA,MAAM,CAACA,GAAUC,CAAa,IAAIC,EAAwC,cAAc;"}
|
|
@@ -2,9 +2,9 @@ import { Machine } from 'robot3';
|
|
|
2
2
|
import { OnEventType } from '../Base/useBase';
|
|
3
3
|
import { FlowContextInterface } from './useFlow';
|
|
4
4
|
import { EventType } from '../../shared/constants';
|
|
5
|
-
type FlowProps = {
|
|
6
|
-
machine:
|
|
5
|
+
type FlowProps<M extends Machine> = {
|
|
6
|
+
machine: M;
|
|
7
7
|
onEvent: OnEventType<EventType, unknown>;
|
|
8
8
|
};
|
|
9
|
-
export declare const Flow: ({ onEvent, machine }: FlowProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const Flow: <M extends Machine<object, FlowContextInterface>>({ onEvent, machine, }: FlowProps<M>) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export {};
|
|
@@ -1,53 +1,58 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useMachine as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { FlowBreadcrumbs as
|
|
5
|
-
import { Flex as
|
|
1
|
+
import { jsx as e, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { useMachine as v } from "react-robot";
|
|
3
|
+
import { useTranslation as w } from "react-i18next";
|
|
4
|
+
import { FlowBreadcrumbs as F } from "../Common/FlowBreadcrumbs/FlowBreadcrumbs.js";
|
|
5
|
+
import { Flex as s, FlexItem as d } from "../Common/Flex/Flex.js";
|
|
6
6
|
import "classnames";
|
|
7
|
-
import
|
|
7
|
+
import "../../shared/constants.js";
|
|
8
|
+
import { useComponentContext as j } from "../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
9
|
import "react";
|
|
9
|
-
import { FlowContext as
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
import { FlowContext as E } from "./useFlow.js";
|
|
11
|
+
const q = ({
|
|
12
|
+
onEvent: x,
|
|
13
|
+
machine: f
|
|
14
|
+
}) => {
|
|
15
|
+
const b = j(), { t: g } = w(), [r, h, c] = v(f, {
|
|
16
|
+
onEvent: i,
|
|
13
17
|
component: null,
|
|
14
18
|
progressBarCta: null
|
|
15
19
|
}), {
|
|
16
|
-
progressBarType:
|
|
20
|
+
progressBarType: l = null,
|
|
17
21
|
totalSteps: o = null,
|
|
18
22
|
currentStep: t = null,
|
|
19
23
|
currentBreadcrumbId: n,
|
|
20
|
-
breadcrumbs:
|
|
24
|
+
breadcrumbs: B = {}
|
|
21
25
|
} = r.context;
|
|
22
|
-
function
|
|
23
|
-
|
|
26
|
+
function i(m, a) {
|
|
27
|
+
const p = { type: m, payload: a }, C = h;
|
|
28
|
+
c.child ? c.child.send(p) : C(p), x(m, a);
|
|
24
29
|
}
|
|
25
|
-
return /* @__PURE__ */ e(
|
|
26
|
-
|
|
30
|
+
return /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e(
|
|
31
|
+
E.Provider,
|
|
27
32
|
{
|
|
28
33
|
value: {
|
|
29
34
|
...r.context
|
|
30
35
|
},
|
|
31
|
-
children: /* @__PURE__ */
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
children: /* @__PURE__ */ u(s, { flexDirection: "column", gap: 32, children: [
|
|
37
|
+
l === "progress" && t && o && /* @__PURE__ */ e(
|
|
38
|
+
b.ProgressBar,
|
|
34
39
|
{
|
|
35
40
|
totalSteps: o,
|
|
36
41
|
currentStep: t,
|
|
37
|
-
label:
|
|
42
|
+
label: g("progressBarLabel", { totalSteps: o, currentStep: t }),
|
|
38
43
|
cta: r.context.progressBarCta
|
|
39
44
|
}
|
|
40
45
|
),
|
|
41
|
-
|
|
42
|
-
/* @__PURE__ */ e(
|
|
43
|
-
|
|
46
|
+
l === "breadcrumbs" && /* @__PURE__ */ u(s, { flexDirection: "row", justifyContent: "space-between", alignItems: "center", children: [
|
|
47
|
+
/* @__PURE__ */ e(d, { flexGrow: 1, children: /* @__PURE__ */ e(
|
|
48
|
+
F,
|
|
44
49
|
{
|
|
45
|
-
breadcrumbs: n ?
|
|
50
|
+
breadcrumbs: n ? B[n] ?? [] : [],
|
|
46
51
|
currentBreadcrumbId: n,
|
|
47
|
-
onEvent:
|
|
52
|
+
onEvent: i
|
|
48
53
|
}
|
|
49
54
|
) }),
|
|
50
|
-
/* @__PURE__ */ e(
|
|
55
|
+
/* @__PURE__ */ e(d, { children: r.context.progressBarCta && /* @__PURE__ */ e(r.context.progressBarCta, {}) })
|
|
51
56
|
] }),
|
|
52
57
|
r.context.component && /* @__PURE__ */ e(r.context.component, {})
|
|
53
58
|
] })
|
|
@@ -55,6 +60,6 @@ const L = ({ onEvent: d, machine: x }) => {
|
|
|
55
60
|
) });
|
|
56
61
|
};
|
|
57
62
|
export {
|
|
58
|
-
|
|
63
|
+
q as Flow
|
|
59
64
|
};
|
|
60
65
|
//# sourceMappingURL=Flow.js.map
|
|
@@ -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:
|
|
1
|
+
{"version":3,"file":"Flow.js","sources":["../../../src/components/Flow/Flow.tsx"],"sourcesContent":["import { useMachine } from 'react-robot'\nimport { type Machine, type SendFunction } 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<M extends Machine> = {\n machine: M\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport const Flow = <M extends Machine<object, FlowContextInterface>>({\n onEvent,\n machine,\n}: FlowProps<M>) => {\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 const event = { type, payload: data }\n const sendFn = send as SendFunction<string>\n //When dealing with nested state machine, correct machine needs to recieve an event\n if (service.child) {\n ;(service.child.send as SendFunction<string>)(event)\n } else {\n sendFn(event)\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","event","sendFn","Flex","jsx","FlowContext","jsxs","FlexItem","FlowBreadcrumbs"],"mappings":";;;;;;;;;;AAiBO,MAAMA,IAAO,CAAkD;AAAA,EACpE,SAAAC;AAAA,EACA,SAAAC;AACF,MAAoB;AAClB,QAAMC,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACR,CAACC,GAASC,GAAMC,CAAO,IAAIC,EAAWR,GAAS;AAAA,IACnD,SAASS;AAAA,IACT,WAAW;AAAA,IACX,gBAAgB;AAAA,EAAA,CACjB,GAEK;AAAA,IACJ,iBAAAC,IAAkB;AAAA,IAClB,YAAAC,IAAa;AAAA,IACb,aAAAC,IAAc;AAAA,IACd,qBAAAC;AAAA,IACA,aAAAC,IAAc,CAAA;AAAA,EAAC,IACbT,EAAQ;AAEZ,WAASI,EAAYM,GAAiBC,GAAqB;AACzD,UAAMC,IAAQ,EAAE,MAAAF,GAAM,SAASC,EAAA,GACzBE,IAASZ;AAEf,IAAIC,EAAQ,QACRA,EAAQ,MAAM,KAA8BU,CAAK,IAEnDC,EAAOD,CAAK,GAGdlB,EAAQgB,GAAMC,CAAI;AAAA,EACpB;AAEA,2BACGG,GAAA,EACC,UAAA,gBAAAC;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,GAAGhB,EAAQ;AAAA,MAAA;AAAA,MAGb,UAAA,gBAAAiB,EAACH,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAA;AAAA,QAAAT,MAAoB,cAAcE,KAAeD,KAChD,gBAAAS;AAAA,UAACnB,EAAW;AAAA,UAAX;AAAA,YACC,YAAAU;AAAA,YACA,aAAAC;AAAA,YACA,OAAOT,EAAE,oBAAoB,EAAE,YAAAQ,GAAY,aAAAC,GAAa;AAAA,YACxD,KAAKP,EAAQ,QAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,QAGxBK,MAAoB,iBACnB,gBAAAY,EAACH,GAAA,EAAK,eAAc,OAAM,gBAAe,iBAAgB,YAAW,UAClE,UAAA;AAAA,UAAA,gBAAAC,EAACG,GAAA,EAAS,UAAU,GAClB,UAAA,gBAAAH;AAAA,YAACI;AAAA,YAAA;AAAA,cACC,aAAaX,IAAuBC,EAAYD,CAAmB,KAAK,CAAA,IAAM,CAAA;AAAA,cAC9E,qBAAAA;AAAA,cACA,SAASJ;AAAA,YAAA;AAAA,UAAA,GAEb;AAAA,UACA,gBAAAW,EAACG,GAAA,EACE,UAAAlB,EAAQ,QAAQ,oCAAmBA,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;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmWireDetails.js","sources":["../../../../src/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { useMemo, useRef, useState } from 'react'\nimport { useWireInRequestsListSuspense } from '@gusto/embedded-api/react-query/wireInRequestsList'\nimport { ConfirmWireDetailsBanner } from './ConfirmWireDetailsBanner'\nimport { confirmWireDetailsMachine } from './confirmWireDetailsStateMachine'\nimport { type ConfirmWireDetailsContextInterface } from './ConfirmWireDetailsComponents'\nimport styles from './ConfirmWireDetails.module.scss'\nimport { BaseComponent, BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { payrollWireEvents, type EventType } from '@/shared/constants'\n\nexport interface ConfirmWireDetailsProps extends BaseComponentInterface {\n companyId: string\n wireInId?: string\n}\n\nexport function ConfirmWireDetails(props: ConfirmWireDetailsProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, wireInId, onEvent }: ConfirmWireDetailsProps) {\n const { Modal, LoadingSpinner } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n const modalContainerRef = useRef<HTMLDivElement>(null)\n\n const { data: wireInRequestsData } = useWireInRequestsListSuspense({\n companyUuid: companyId,\n })\n\n const activeWireInRequests = (wireInRequestsData.wireInRequestList || []).filter(\n r => r.status === 'awaiting_funds',\n )\n\n const selectedWireInId = useMemo(() => {\n if (wireInId) {\n return wireInId\n }\n\n return activeWireInRequests[0]?.uuid\n }, [wireInId, activeWireInRequests[0]?.uuid])\n\n const confirmWireDetailsMachineInstance = useMemo(\n () =>\n createMachine(\n 'banner',\n confirmWireDetailsMachine,\n (): ConfirmWireDetailsContextInterface => ({\n component: null,\n companyId,\n wireInId,\n selectedWireInId,\n onEvent: handleEvent,\n modalContainerRef,\n }),\n ),\n [companyId, wireInId],\n )\n const [current, send] = useMachine(confirmWireDetailsMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n
|
|
1
|
+
{"version":3,"file":"ConfirmWireDetails.js","sources":["../../../../src/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { useMemo, useRef, useState } from 'react'\nimport { useWireInRequestsListSuspense } from '@gusto/embedded-api/react-query/wireInRequestsList'\nimport { ConfirmWireDetailsBanner } from './ConfirmWireDetailsBanner'\nimport { confirmWireDetailsMachine } from './confirmWireDetailsStateMachine'\nimport { type ConfirmWireDetailsContextInterface } from './ConfirmWireDetailsComponents'\nimport styles from './ConfirmWireDetails.module.scss'\nimport { BaseComponent, BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { payrollWireEvents, type EventType } from '@/shared/constants'\n\nexport interface ConfirmWireDetailsProps extends BaseComponentInterface {\n companyId: string\n wireInId?: string\n}\n\nexport function ConfirmWireDetails(props: ConfirmWireDetailsProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, wireInId, onEvent }: ConfirmWireDetailsProps) {\n const { Modal, LoadingSpinner } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n const modalContainerRef = useRef<HTMLDivElement>(null)\n\n const { data: wireInRequestsData } = useWireInRequestsListSuspense({\n companyUuid: companyId,\n })\n\n const activeWireInRequests = (wireInRequestsData.wireInRequestList || []).filter(\n r => r.status === 'awaiting_funds',\n )\n\n const selectedWireInId = useMemo(() => {\n if (wireInId) {\n return wireInId\n }\n\n return activeWireInRequests[0]?.uuid\n }, [wireInId, activeWireInRequests[0]?.uuid])\n\n const confirmWireDetailsMachineInstance = useMemo(\n () =>\n createMachine(\n 'banner',\n confirmWireDetailsMachine,\n (): ConfirmWireDetailsContextInterface => ({\n component: null,\n companyId,\n wireInId,\n selectedWireInId,\n onEvent: handleEvent,\n modalContainerRef,\n }),\n ),\n [companyId, wireInId],\n )\n const [current, send] = useMachine(confirmWireDetailsMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n send({ type, payload: data })\n\n if (type === payrollWireEvents.PAYROLL_WIRE_START_TRANSFER) {\n setIsModalOpen(true)\n }\n\n if (\n type === payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_CANCEL ||\n type === payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL ||\n type === payrollWireEvents.PAYROLL_WIRE_FORM_DONE\n ) {\n setIsModalOpen(false)\n }\n\n onEvent(type, data)\n }\n\n const handleStartWireTransfer = () => {\n handleEvent(payrollWireEvents.PAYROLL_WIRE_START_TRANSFER)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <ConfirmWireDetailsBanner\n companyId={companyId}\n wireInId={wireInId}\n onStartWireTransfer={handleStartWireTransfer}\n onEvent={onEvent}\n confirmationAlert={current.context.confirmationAlert}\n />\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n containerRef={modalContainerRef}\n footer={\n Footer && (\n <BaseBoundaries\n LoaderComponent={() => (\n <div className={styles.footer}>\n <LoadingSpinner size=\"sm\" />\n </div>\n )}\n >\n <Footer onEvent={handleEvent} />\n </BaseBoundaries>\n )\n }\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </FlowContext.Provider>\n )\n}\n"],"names":["ConfirmWireDetails","props","jsx","BaseComponent","Root","companyId","wireInId","onEvent","Modal","LoadingSpinner","useComponentContext","isModalOpen","setIsModalOpen","useState","modalContainerRef","useRef","wireInRequestsData","useWireInRequestsListSuspense","activeWireInRequests","r","selectedWireInId","useMemo","confirmWireDetailsMachineInstance","createMachine","confirmWireDetailsMachine","handleEvent","current","send","useMachine","type","data","payrollWireEvents","handleStartWireTransfer","handleCloseModal","CurrentComponent","Footer","jsxs","FlowContext","ConfirmWireDetailsBanner","BaseBoundaries","styles"],"mappings":";;;;;;;;;;;;;AAkBO,SAASA,EAAmBC,GAAgC;AACjE,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,UAAAC,GAAU,SAAAC,KAAoC;AACvE,QAAM,EAAE,OAAAC,GAAO,gBAAAC,EAAA,IAAmBC,EAAA,GAC5B,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAC9CC,IAAoBC,EAAuB,IAAI,GAE/C,EAAE,MAAMC,EAAA,IAAuBC,EAA8B;AAAA,IACjE,aAAaZ;AAAA,EAAA,CACd,GAEKa,KAAwBF,EAAmB,qBAAqB,CAAA,GAAI;AAAA,IACxE,CAAAG,MAAKA,EAAE,WAAW;AAAA,EAAA,GAGdC,IAAmBC,EAAQ,MAC3Bf,KAIGY,EAAqB,CAAC,GAAG,MAC/B,CAACZ,GAAUY,EAAqB,CAAC,GAAG,IAAI,CAAC,GAEtCI,IAAoCD;AAAA,IACxC,MACEE;AAAA,MACE;AAAA,MACAC;AAAA,MACA,OAA2C;AAAA,QACzC,WAAW;AAAA,QACX,WAAAnB;AAAA,QACA,UAAAC;AAAA,QACA,kBAAAc;AAAA,QACA,SAASK;AAAA,QACT,mBAAAX;AAAA,MAAA;AAAA,IACF;AAAA,IAEJ,CAACT,GAAWC,CAAQ;AAAA,EAAA,GAEhB,CAACoB,GAASC,CAAI,IAAIC,EAAWN,CAAiC;AAEpE,WAASG,EAAYI,GAAiBC,GAAgB;AACpD,IAAAH,EAAK,EAAE,MAAAE,GAAM,SAASC,EAAA,CAAM,GAExBD,MAASE,EAAkB,+BAC7BnB,EAAe,EAAI,IAInBiB,MAASE,EAAkB,oCAC3BF,MAASE,EAAkB,4BAC3BF,MAASE,EAAkB,2BAE3BnB,EAAe,EAAK,GAGtBL,EAAQsB,GAAMC,CAAI;AAAA,EACpB;AAEA,QAAME,IAA0B,MAAM;AACpC,IAAAP,EAAYM,EAAkB,2BAA2B;AAAA,EAC3D,GAEME,IAAmB,MAAM;AAC7B,IAAArB,EAAe,EAAK;AAAA,EACtB,GAEMsB,IAAmBR,EAAQ,QAAQ,WACnCS,IAASD,GAAkB,UAAU;AAE3C,SACE,gBAAAE;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,GAAGX,EAAQ;AAAA,QACX,SAASD;AAAA,MAAA;AAAA,MAGX,UAAA;AAAA,QAAA,gBAAAvB;AAAA,UAACoC;AAAA,UAAA;AAAA,YACC,WAAAjC;AAAA,YACA,UAAAC;AAAA,YACA,qBAAqB0B;AAAA,YACrB,SAAAzB;AAAA,YACA,mBAAmBmB,EAAQ,QAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,QAErC,gBAAAxB;AAAA,UAACM;AAAA,UAAA;AAAA,YACC,QAAQG;AAAA,YACR,SAASsB;AAAA,YACT,cAAcnB;AAAA,YACd,QACEqB,KACE,gBAAAjC;AAAA,cAACqC;AAAA,cAAA;AAAA,gBACC,iBAAiB,MACf,gBAAArC,EAAC,OAAA,EAAI,WAAWsC,EAAO,QACrB,UAAA,gBAAAtC,EAACO,GAAA,EAAe,MAAK,KAAA,CAAK,EAAA,CAC5B;AAAA,gBAGF,UAAA,gBAAAP,EAACiC,GAAA,EAAO,SAASV,EAAA,CAAa;AAAA,cAAA;AAAA,YAAA;AAAA,YAKnC,UAAAS,uBAAqBA,GAAA,CAAA,CAAiB;AAAA,UAAA;AAAA,QAAA;AAAA,MACzC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js
CHANGED
|
@@ -16,12 +16,12 @@ import { useComponentDictionary as z, useI18n as g } from "../../../../i18n/I18n
|
|
|
16
16
|
import { Flex as p, FlexItem as f } from "../../../Common/Flex/Flex.js";
|
|
17
17
|
import { payrollWireEvents as N } from "../../../../shared/constants.js";
|
|
18
18
|
import "classnames";
|
|
19
|
-
import "
|
|
20
|
-
import {
|
|
21
|
-
import { useDateFormatter as J } from "../../../../hooks/useDateFormatter.js";
|
|
19
|
+
import { TextInputField as V } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
20
|
+
import { DatePickerField as J } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
|
|
22
21
|
import { NumberInputField as Q } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
23
|
-
import
|
|
24
|
-
import {
|
|
22
|
+
import "react";
|
|
23
|
+
import { TextAreaField as X } from "../../../Common/Fields/TextAreaField/TextAreaField.js";
|
|
24
|
+
import { useDateFormatter as Z } from "../../../../hooks/useDateFormatter.js";
|
|
25
25
|
const $ = r.object({
|
|
26
26
|
amountSent: r.number().positive(),
|
|
27
27
|
dateSent: r.date(),
|
|
@@ -43,7 +43,7 @@ const oe = ({
|
|
|
43
43
|
modalContainerRef: y
|
|
44
44
|
}) => {
|
|
45
45
|
z("Payroll.ConfirmWireDetailsForm", i), g("Payroll.ConfirmWireDetailsForm");
|
|
46
|
-
const { onEvent: a, baseSubmitHandler: I } = Y(), { t } = F("Payroll.ConfirmWireDetailsForm"), { Heading: v, Text: b } = S(), R =
|
|
46
|
+
const { onEvent: a, baseSubmitHandler: I } = Y(), { t } = F("Payroll.ConfirmWireDetailsForm"), { Heading: v, Text: b } = S(), R = Z(), { data: P } = U({
|
|
47
47
|
wireInRequestUuid: o
|
|
48
48
|
}), W = P.wireInRequest, { data: q } = G({
|
|
49
49
|
companyId: n,
|
|
@@ -95,7 +95,7 @@ const oe = ({
|
|
|
95
95
|
}
|
|
96
96
|
),
|
|
97
97
|
/* @__PURE__ */ e(
|
|
98
|
-
|
|
98
|
+
J,
|
|
99
99
|
{
|
|
100
100
|
name: "dateSent",
|
|
101
101
|
label: t("dateLabel"),
|
|
@@ -105,7 +105,7 @@ const oe = ({
|
|
|
105
105
|
}
|
|
106
106
|
),
|
|
107
107
|
/* @__PURE__ */ e(
|
|
108
|
-
|
|
108
|
+
V,
|
|
109
109
|
{
|
|
110
110
|
name: "bankName",
|
|
111
111
|
label: t("bankNameLabel"),
|
|
@@ -115,7 +115,7 @@ const oe = ({
|
|
|
115
115
|
errorMessage: t("validations.bankName")
|
|
116
116
|
}
|
|
117
117
|
),
|
|
118
|
-
/* @__PURE__ */ e(
|
|
118
|
+
/* @__PURE__ */ e(X, { name: "additionalNotes", label: t("notesLabel"), rows: 3 })
|
|
119
119
|
] })
|
|
120
120
|
}
|
|
121
121
|
) })
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
1
|
+
import { jsx as l, jsxs as m } from "react/jsx-runtime";
|
|
2
2
|
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
|
-
import { Flex as
|
|
5
|
+
import { Flex as d } from "../../../Common/Flex/Flex.js";
|
|
6
6
|
import "classnames";
|
|
7
|
+
import "../../../../shared/constants.js";
|
|
7
8
|
import "react";
|
|
8
9
|
import { useI18n as C } from "../../../../i18n/I18n.js";
|
|
9
|
-
function
|
|
10
|
+
function H({
|
|
10
11
|
blockers: o,
|
|
11
12
|
onMultipleViewClick: i,
|
|
12
13
|
multipleViewLabel: h,
|
|
@@ -30,7 +31,7 @@ function F({
|
|
|
30
31
|
};
|
|
31
32
|
}), t = p[0];
|
|
32
33
|
if (!y && t)
|
|
33
|
-
return /* @__PURE__ */ l(a, { status: "error", label: t.title, className: s, children: /* @__PURE__ */ d
|
|
34
|
+
return /* @__PURE__ */ l(a, { status: "error", label: t.title, className: s, children: /* @__PURE__ */ m(d, { flexDirection: "column", gap: 8, children: [
|
|
34
35
|
/* @__PURE__ */ l(c, { children: t.description }),
|
|
35
36
|
t.helpText && t.helpText !== t.description && /* @__PURE__ */ l(c, { variant: "supporting", size: "sm", children: t.helpText })
|
|
36
37
|
] }) });
|
|
@@ -41,7 +42,7 @@ function F({
|
|
|
41
42
|
status: "error",
|
|
42
43
|
label: e("multipleIssuesTitle", { count: o.length }),
|
|
43
44
|
className: s,
|
|
44
|
-
children: /* @__PURE__ */ d
|
|
45
|
+
children: /* @__PURE__ */ m(d, { flexDirection: "column", gap: 16, children: [
|
|
45
46
|
/* @__PURE__ */ l(x, { items: g }),
|
|
46
47
|
i && /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(f, { variant: "secondary", onClick: i, title: u, children: u }) })
|
|
47
48
|
] })
|
|
@@ -49,6 +50,6 @@ function F({
|
|
|
49
50
|
);
|
|
50
51
|
}
|
|
51
52
|
export {
|
|
52
|
-
|
|
53
|
+
H as PayrollBlockerAlerts
|
|
53
54
|
};
|
|
54
55
|
//# 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;"}
|
|
@@ -4,11 +4,12 @@ import f from "classnames";
|
|
|
4
4
|
import u from "./PayrollBlockerList.module.scss.js";
|
|
5
5
|
import { useComponentContext as h } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
6
|
import { FlexItem as x, Flex as o } from "../../../Common/Flex/Flex.js";
|
|
7
|
+
import "../../../../shared/constants.js";
|
|
7
8
|
import "react";
|
|
8
9
|
import { DataView as y } from "../../../Common/DataView/DataView.js";
|
|
9
10
|
import { useDataView as g } from "../../../Common/DataView/useDataView.js";
|
|
10
11
|
import { useI18n as b } from "../../../../i18n/I18n.js";
|
|
11
|
-
function
|
|
12
|
+
function V({ blockers: i, className: s }) {
|
|
12
13
|
b("Payroll.PayrollBlocker");
|
|
13
14
|
const { t: l } = p("Payroll.PayrollBlocker"), { Button: c, Text: n, Heading: m } = h(), d = g({
|
|
14
15
|
data: i,
|
|
@@ -35,6 +36,6 @@ function I({ blockers: i, className: s }) {
|
|
|
35
36
|
] }) });
|
|
36
37
|
}
|
|
37
38
|
export {
|
|
38
|
-
|
|
39
|
+
V as PayrollBlockerList
|
|
39
40
|
};
|
|
40
41
|
//# sourceMappingURL=PayrollBlockerList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayrollBlockerList.js","sources":["../../../../../src/components/Payroll/PayrollBlocker/components/PayrollBlockerList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport styles from './PayrollBlockerList.module.scss'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex, FlexItem } from '@/components/Common'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { useI18n } from '@/i18n'\n\nexport interface PayrollBlocker {\n id: string\n title: string\n description: string\n action?: {\n label: string\n onClick: () => void\n }\n}\n\ninterface PayrollBlockerListProps {\n blockers: PayrollBlocker[]\n className?: string\n}\n\n/**\n * PayrollBlockerList - DataView-based component displaying payroll blockers\n * Shows each blocker with individual resolution buttons\n */\nexport function PayrollBlockerList({ blockers, className }: PayrollBlockerListProps) {\n useI18n('Payroll.PayrollBlocker')\n const { t } = useTranslation('Payroll.PayrollBlocker')\n const { Button, Text, Heading } = useComponentContext()\n\n const dataViewProps = useDataView({\n data: blockers,\n columns: [\n {\n title: t('blockerSectionLabel'),\n render: blocker => (\n <FlexItem flexGrow={1}>\n <Flex flexDirection=\"column\" gap={8}>\n <Text weight=\"semibold\">{blocker.title}</Text>\n <Text variant=\"supporting\">{blocker.description}</Text>\n </Flex>\n </FlexItem>\n ),\n },\n {\n title: '',\n render: blocker => {\n // For presentational purposes, just show the primary action if it exists\n const action = blocker.action\n\n if (!action) {\n return null\n }\n\n return (\n <Flex justifyContent=\"flex-end\" alignItems=\"center\">\n <Button variant=\"secondary\" onClick={action.onClick} title={action.label}>\n {action.label}\n </Button>\n </Flex>\n )\n },\n },\n ],\n })\n\n if (blockers.length === 0) {\n return null\n }\n\n return (\n <div className={classNames(styles.root, className)}>\n <Flex flexDirection=\"column\" gap={24}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('blockersListTitle')}\n </Heading>\n\n <DataView {...dataViewProps} label={t('blockersListTitle')} />\n </Flex>\n </div>\n )\n}\n"],"names":["PayrollBlockerList","blockers","className","useI18n","t","useTranslation","Button","Text","Heading","useComponentContext","dataViewProps","useDataView","blocker","jsx","FlexItem","jsxs","Flex","action","classNames","styles","DataView"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PayrollBlockerList.js","sources":["../../../../../src/components/Payroll/PayrollBlocker/components/PayrollBlockerList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport styles from './PayrollBlockerList.module.scss'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex, FlexItem } from '@/components/Common'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { useI18n } from '@/i18n'\n\nexport interface PayrollBlocker {\n id: string\n title: string\n description: string\n action?: {\n label: string\n onClick: () => void\n }\n}\n\ninterface PayrollBlockerListProps {\n blockers: PayrollBlocker[]\n className?: string\n}\n\n/**\n * PayrollBlockerList - DataView-based component displaying payroll blockers\n * Shows each blocker with individual resolution buttons\n */\nexport function PayrollBlockerList({ blockers, className }: PayrollBlockerListProps) {\n useI18n('Payroll.PayrollBlocker')\n const { t } = useTranslation('Payroll.PayrollBlocker')\n const { Button, Text, Heading } = useComponentContext()\n\n const dataViewProps = useDataView({\n data: blockers,\n columns: [\n {\n title: t('blockerSectionLabel'),\n render: blocker => (\n <FlexItem flexGrow={1}>\n <Flex flexDirection=\"column\" gap={8}>\n <Text weight=\"semibold\">{blocker.title}</Text>\n <Text variant=\"supporting\">{blocker.description}</Text>\n </Flex>\n </FlexItem>\n ),\n },\n {\n title: '',\n render: blocker => {\n // For presentational purposes, just show the primary action if it exists\n const action = blocker.action\n\n if (!action) {\n return null\n }\n\n return (\n <Flex justifyContent=\"flex-end\" alignItems=\"center\">\n <Button variant=\"secondary\" onClick={action.onClick} title={action.label}>\n {action.label}\n </Button>\n </Flex>\n )\n },\n },\n ],\n })\n\n if (blockers.length === 0) {\n return null\n }\n\n return (\n <div className={classNames(styles.root, className)}>\n <Flex flexDirection=\"column\" gap={24}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('blockersListTitle')}\n </Heading>\n\n <DataView {...dataViewProps} label={t('blockersListTitle')} />\n </Flex>\n </div>\n )\n}\n"],"names":["PayrollBlockerList","blockers","className","useI18n","t","useTranslation","Button","Text","Heading","useComponentContext","dataViewProps","useDataView","blocker","jsx","FlexItem","jsxs","Flex","action","classNames","styles","DataView"],"mappings":";;;;;;;;;;;AA4BO,SAASA,EAAmB,EAAE,UAAAC,GAAU,WAAAC,KAAsC;AACnF,EAAAC,EAAQ,wBAAwB;AAChC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB,GAC/C,EAAE,QAAAC,GAAQ,MAAAC,GAAM,SAAAC,EAAA,IAAYC,EAAA,GAE5BC,IAAgBC,EAAY;AAAA,IAChC,MAAMV;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,OAAOG,EAAE,qBAAqB;AAAA,QAC9B,QAAQ,CAAAQ,MACN,gBAAAC,EAACC,GAAA,EAAS,UAAU,GAClB,UAAA,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,UAAA,gBAAAH,EAACN,GAAA,EAAK,QAAO,YAAY,UAAAK,EAAQ,OAAM;AAAA,UACvC,gBAAAC,EAACN,GAAA,EAAK,SAAQ,cAAc,YAAQ,YAAA,CAAY;AAAA,QAAA,EAAA,CAClD,EAAA,CACF;AAAA,MAAA;AAAA,MAGJ;AAAA,QACE,OAAO;AAAA,QACP,QAAQ,CAAAK,MAAW;AAEjB,gBAAMK,IAASL,EAAQ;AAEvB,iBAAKK,sBAKFD,GAAA,EAAK,gBAAe,YAAW,YAAW,UACzC,4BAACV,GAAA,EAAO,SAAQ,aAAY,SAASW,EAAO,SAAS,OAAOA,EAAO,OAChE,UAAAA,EAAO,OACV,EAAA,CACF,IARO;AAAA,QAUX;AAAA,MAAA;AAAA,IACF;AAAA,EACF,CACD;AAED,SAAIhB,EAAS,WAAW,IACf,OAIP,gBAAAY,EAAC,OAAA,EAAI,WAAWK,EAAWC,EAAO,MAAMjB,CAAS,GAC/C,UAAA,gBAAAa,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAH,EAACL,KAAQ,IAAG,MAAK,UAAS,MACvB,UAAAJ,EAAE,mBAAmB,GACxB;AAAA,sBAECgB,GAAA,EAAU,GAAGV,GAAe,OAAON,EAAE,mBAAmB,EAAA,CAAG;AAAA,EAAA,EAAA,CAC9D,EAAA,CACF;AAEJ;"}
|
|
@@ -10,15 +10,15 @@ 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
12
|
import "classnames";
|
|
13
|
-
import {
|
|
14
|
-
import { useI18n as ne } from "../../../i18n/I18n.js";
|
|
15
|
-
import { Form as re } from "../../Common/Form/Form.js";
|
|
16
|
-
import { firstLastName as ie, formatNumberAsCurrency as se } from "../../../helpers/formattedStrings.js";
|
|
17
|
-
import { getAdditionalEarningsCompensations as oe, getReimbursementCompensation as ae, calculateGrossPay as G } from "../helpers.js";
|
|
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";
|
|
19
|
-
import { useContainerBreakpoints as Ee } from "../../../hooks/useContainerBreakpoints/useContainerBreakpoints.js";
|
|
13
|
+
import { RadioGroupField as te } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
20
14
|
import { TextInputField as R } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
21
|
-
import {
|
|
15
|
+
import { useComponentContext as ne } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
16
|
+
import { useI18n as re } from "../../../i18n/I18n.js";
|
|
17
|
+
import { Form as ie } from "../../Common/Form/Form.js";
|
|
18
|
+
import { firstLastName as se, formatNumberAsCurrency as oe } from "../../../helpers/formattedStrings.js";
|
|
19
|
+
import { getAdditionalEarningsCompensations as ae, getReimbursementCompensation as me, calculateGrossPay as G } from "../helpers.js";
|
|
20
|
+
import { HOURS_COMPENSATION_NAMES as k, EXCLUDED_ADDITIONAL_EARNINGS as le, COMPENSATION_NAME_DOUBLE_OVERTIME as de, COMPENSATION_NAME_OVERTIME as ue, COMPENSATION_NAME_REGULAR_HOURS as ce, COMPENSATION_NAME_REIMBURSEMENT as pe, COMPENSATION_NAME_CASH_TIPS as fe, COMPENSATION_NAME_COMMISSION as he, COMPENSATION_NAME_CORRECTION_PAYMENT as Ce, COMPENSATION_NAME_PAYCHECK_TIPS as Ne, COMPENSATION_NAME_BONUS as Ee } from "../../../shared/constants.js";
|
|
21
|
+
import { useContainerBreakpoints as ge } from "../../../hooks/useContainerBreakpoints/useContainerBreakpoints.js";
|
|
22
22
|
const be = m.object({
|
|
23
23
|
hourlyCompensations: m.record(m.string(), m.record(m.string(), m.string().optional())),
|
|
24
24
|
timeOffCompensations: m.record(m.string(), m.string().optional()),
|
|
@@ -67,22 +67,22 @@ const be = m.object({
|
|
|
67
67
|
paySchedule: l,
|
|
68
68
|
isOffCycle: C = !1
|
|
69
69
|
}) => {
|
|
70
|
-
const { Button: x, Heading: c, Text: H } =
|
|
71
|
-
|
|
72
|
-
const f = d.jobs?.find((e) => e.primary), T = f ? [f] : [], v = X(null), p =
|
|
70
|
+
const { Button: x, Heading: c, Text: H } = ne(), { t } = Z("Payroll.PayrollEditEmployee");
|
|
71
|
+
re("Payroll.PayrollEditEmployee");
|
|
72
|
+
const f = d.jobs?.find((e) => e.primary), T = f ? [f] : [], v = X(null), p = ge({
|
|
73
73
|
ref: v
|
|
74
74
|
}).includes("small");
|
|
75
75
|
s?.hourlyCompensations?.forEach((e) => {
|
|
76
76
|
const n = d.jobs?.find((o) => o.uuid === e.jobUuid);
|
|
77
77
|
n && !T.find((o) => o.uuid === n.uuid) && T.push(n);
|
|
78
78
|
});
|
|
79
|
-
const P = (s?.paidTimeOff || []).filter((e) => e.name), _ =
|
|
79
|
+
const P = (s?.paidTimeOff || []).filter((e) => e.name), _ = ae({
|
|
80
80
|
flsaStatus: f?.compensations?.[0]?.flsaStatus,
|
|
81
81
|
existingFixedCompensations: s?.fixedCompensations || [],
|
|
82
82
|
primaryJobUuid: f?.uuid,
|
|
83
83
|
fixedCompensationTypes: b,
|
|
84
|
-
excludedTypes:
|
|
85
|
-
}), N =
|
|
84
|
+
excludedTypes: le
|
|
85
|
+
}), N = me(
|
|
86
86
|
s?.fixedCompensations || [],
|
|
87
87
|
b,
|
|
88
88
|
f?.uuid
|
|
@@ -90,28 +90,28 @@ const be = m.object({
|
|
|
90
90
|
(o) => o.jobUuid === e && o.name?.toLowerCase() === n.toLowerCase()
|
|
91
91
|
), $ = (e) => {
|
|
92
92
|
switch (e) {
|
|
93
|
-
case
|
|
93
|
+
case ce:
|
|
94
94
|
return t("compensationNames.regularHours");
|
|
95
|
-
case
|
|
95
|
+
case ue:
|
|
96
96
|
return t("compensationNames.overtime");
|
|
97
|
-
case
|
|
97
|
+
case de:
|
|
98
98
|
return t("compensationNames.doubleOvertime");
|
|
99
99
|
default:
|
|
100
100
|
return e;
|
|
101
101
|
}
|
|
102
102
|
}, j = (e) => {
|
|
103
103
|
switch (e) {
|
|
104
|
-
case
|
|
104
|
+
case Ee:
|
|
105
105
|
return t("fixedCompensationNames.bonus");
|
|
106
|
-
case
|
|
106
|
+
case Ne:
|
|
107
107
|
return t("fixedCompensationNames.paycheckTips");
|
|
108
|
-
case
|
|
108
|
+
case Ce:
|
|
109
109
|
return t("fixedCompensationNames.correctionPayment");
|
|
110
|
-
case
|
|
110
|
+
case he:
|
|
111
111
|
return t("fixedCompensationNames.commission");
|
|
112
|
-
case
|
|
112
|
+
case fe:
|
|
113
113
|
return t("fixedCompensationNames.cashTips");
|
|
114
|
-
case
|
|
114
|
+
case pe:
|
|
115
115
|
return t("fixedCompensationNames.reimbursement");
|
|
116
116
|
default:
|
|
117
117
|
return e;
|
|
@@ -185,7 +185,7 @@ const be = m.object({
|
|
|
185
185
|
i,
|
|
186
186
|
l,
|
|
187
187
|
C
|
|
188
|
-
]), V =
|
|
188
|
+
]), V = se({
|
|
189
189
|
first_name: d.firstName,
|
|
190
190
|
last_name: d.lastName
|
|
191
191
|
}), z = (e) => {
|
|
@@ -196,7 +196,7 @@ const be = m.object({
|
|
|
196
196
|
f?.uuid
|
|
197
197
|
);
|
|
198
198
|
E(n);
|
|
199
|
-
}, L =
|
|
199
|
+
}, L = oe(q || 0), U = /* @__PURE__ */ a(
|
|
200
200
|
y,
|
|
201
201
|
{
|
|
202
202
|
flexDirection: p ? "row" : "column",
|
|
@@ -235,7 +235,7 @@ const be = m.object({
|
|
|
235
235
|
}
|
|
236
236
|
),
|
|
237
237
|
/* @__PURE__ */ a(K, { ...I, children: [
|
|
238
|
-
/* @__PURE__ */ a(
|
|
238
|
+
/* @__PURE__ */ a(ie, { children: [
|
|
239
239
|
T.length > 0 && /* @__PURE__ */ a("div", { className: u.fieldGroup, children: [
|
|
240
240
|
/* @__PURE__ */ r(c, { as: "h3", children: t("regularHoursTitle") }),
|
|
241
241
|
T.map((e) => /* @__PURE__ */ a(y, { flexDirection: "column", gap: 8, children: [
|
|
@@ -308,7 +308,7 @@ const be = m.object({
|
|
|
308
308
|
/* @__PURE__ */ a("div", { className: u.fieldGroup, children: [
|
|
309
309
|
/* @__PURE__ */ r(c, { as: "h4", children: t("paymentMethodTitle") }),
|
|
310
310
|
/* @__PURE__ */ r(
|
|
311
|
-
|
|
311
|
+
te,
|
|
312
312
|
{
|
|
313
313
|
name: "paymentMethod",
|
|
314
314
|
isRequired: !0,
|