@gusto/embedded-react-sdk 0.37.0-rc.5 → 0.38.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 +45 -0
- package/dist/UNSTABLE_Hooks.js +2 -2
- package/dist/assets/icons/filter-funnel.svg.js +10 -0
- package/dist/assets/icons/filter-funnel.svg.js.map +1 -0
- package/dist/components/Base/Base.js +3 -2
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.d.ts +17 -0
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.js +100 -0
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.js.map +1 -0
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.module.scss.js +10 -0
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.module.scss.js.map +1 -0
- package/dist/components/Common/DetailViewLayout/DetailViewLayout.d.ts +2 -0
- package/dist/components/Common/DetailViewLayout/DetailViewLayoutTypes.d.ts +40 -0
- package/dist/components/Common/DetailViewLayout/index.d.ts +3 -0
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +21 -20
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js.map +1 -1
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes.d.ts +5 -0
- package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.d.ts +1 -1
- package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js +10 -8
- package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +6 -4
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +6 -5
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +7 -6
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +18 -18
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.d.ts +5 -0
- package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.js.map +1 -1
- package/dist/components/Common/UI/DateRangePicker/DateRangePicker.d.ts +2 -0
- package/dist/components/Common/UI/DateRangePicker/DateRangePicker.js +74 -0
- package/dist/components/Common/UI/DateRangePicker/DateRangePicker.js.map +1 -0
- package/dist/components/Common/UI/DateRangePicker/DateRangePicker.module.scss.js +30 -0
- package/dist/components/Common/UI/DateRangePicker/DateRangePicker.module.scss.js.map +1 -0
- package/dist/components/Common/UI/DateRangePicker/DateRangePickerTypes.d.ts +14 -0
- package/dist/components/Common/UI/DateRangePicker/index.d.ts +2 -0
- package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
- package/dist/components/Common/UI/Heading/Heading.d.ts +1 -1
- package/dist/components/Common/UI/Heading/Heading.js +11 -9
- package/dist/components/Common/UI/Heading/Heading.js.map +1 -1
- package/dist/components/Common/UI/Heading/HeadingTypes.d.ts +1 -1
- package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
- package/dist/components/Common/index.d.ts +2 -0
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +3 -2
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +3 -2
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +3 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +11 -11
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +3 -2
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +3 -2
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +3 -2
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +11 -9
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -3
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +9 -8
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +8 -7
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +6 -4
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +3 -2
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +9 -8
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -3
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +3 -2
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +5 -3
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +6 -5
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +7 -6
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +5 -3
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +10 -8
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +3 -2
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +8 -6
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +5 -4
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +7 -6
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +4 -3
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +7 -6
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +7 -6
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +3 -2
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +14 -12
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +7 -5
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +3 -2
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +5 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +23 -21
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +17 -16
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
- package/dist/components/Company/PaySchedule/_parts/Head.js +10 -8
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +15 -13
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.d.ts +1 -0
- package/dist/components/Company/PaySchedule/usePaySchedule.js +7 -5
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +4 -3
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +7 -5
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +51 -50
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +3 -2
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +6 -5
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -2
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +4 -2
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +10 -10
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +7 -5
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +4 -3
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +4 -2
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +8 -6
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +4 -2
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +4 -2
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
- package/dist/components/Contractor/Profile/useContractorProfile.js +53 -49
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.d.ts +2 -2
- package/dist/components/Contractor/Submit/Submit.js +46 -45
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +5 -4
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +28 -27
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +23 -22
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +12 -10
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +19 -17
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +13 -11
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +8 -7
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +7 -6
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +6 -5
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +4 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +5 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +26 -24
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +10 -9
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +8 -7
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +5 -3
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +4 -2
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.d.ts +2 -5
- package/dist/components/Employee/EmployeeList/EmployeeList.js +45 -91
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeListView.d.ts +15 -0
- package/dist/components/Employee/EmployeeList/EmployeeListView.js +132 -0
- package/dist/components/Employee/EmployeeList/EmployeeListView.js.map +1 -0
- package/dist/components/Employee/EmployeeList/ManagementEmployeeList.d.ts +9 -0
- package/dist/components/Employee/EmployeeList/ManagementEmployeeList.js +81 -0
- package/dist/components/Employee/EmployeeList/ManagementEmployeeList.js.map +1 -0
- package/dist/components/Employee/EmployeeList/ManagementEmployeeListView.d.ts +17 -0
- package/dist/components/Employee/EmployeeList/ManagementEmployeeListView.js +195 -0
- package/dist/components/Employee/EmployeeList/ManagementEmployeeListView.js.map +1 -0
- package/dist/components/Employee/EmployeeList/index.d.ts +3 -0
- package/dist/components/Employee/EmployeeList/useEmployeeList.d.ts +36 -23
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +114 -17
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Actions.js +7 -6
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +11 -10
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +5 -3
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +15 -14
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js +4 -4
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.d.ts +1 -0
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js +14 -8
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js +10 -11
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +6 -5
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +9 -8
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js +44 -43
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +7 -6
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +11 -10
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +7 -5
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/Actions.js +7 -6
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +5 -4
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
- package/dist/components/Employee/Profile/useProfile.js +5 -3
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/Actions.js +8 -7
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +5 -3
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +9 -8
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +11 -10
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +5 -3
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +16 -14
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +13 -12
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +4 -2
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -1
- package/dist/components/Employee/index.d.ts +1 -0
- package/dist/components/Employee/index.js +38 -36
- package/dist/components/Employee/index.js.map +1 -1
- package/dist/components/Flow/Flow.js +18 -16
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +17 -16
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +12 -11
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +4 -3
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +9 -8
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +10 -8
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +14 -12
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +30 -25
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +32 -30
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +2 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +7 -6
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +13 -12
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +13 -11
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +12 -12
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +192 -186
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +2 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +102 -76
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +158 -159
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.module.scss.js +7 -7
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.d.ts +11 -0
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +55 -18
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js +40 -40
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +65 -54
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js +35 -14
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +80 -69
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.d.ts +0 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +59 -66
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +5 -4
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +95 -100
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +98 -68
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +9 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +213 -132
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +8 -6
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +49 -47
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +187 -178
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +4 -2
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +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/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +3 -2
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +7 -6
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +4 -2
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlow.d.ts +1 -1
- package/dist/components/Payroll/Transition/TransitionFlow.js +29 -27
- package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlowComponents.d.ts +1 -0
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +14 -12
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +4 -2
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.d.ts +1 -1
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.d.ts +1 -1
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.d.ts +1 -2
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.d.ts +1 -1
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.d.ts +1 -2
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js +10 -9
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.d.ts +1 -2
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.d.ts +1 -2
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js +11 -10
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.d.ts +1 -2
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js +10 -9
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.d.ts +1 -2
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js +13 -12
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.d.ts +1 -2
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js +14 -13
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.d.ts +1 -2
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js +15 -14
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.d.ts +1 -1
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/index.d.ts +1 -1
- package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.d.ts +1 -1
- package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.d.ts +1 -1
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.d.ts +1 -1
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/useHookFieldResolution.d.ts +1 -2
- package/dist/components/UNSTABLE_Hooks/form/useHookFieldResolution.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/withOptions.d.ts +1 -1
- package/dist/components/UNSTABLE_Hooks/form/withOptions.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js +3 -2
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.d.ts +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.d.ts +10 -10
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js +19 -19
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js +3 -2
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.d.ts +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +9 -9
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js +15 -15
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js +7 -6
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.d.ts +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.d.ts +5 -5
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js +13 -13
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/index.d.ts +3 -3
- package/dist/components/UNSTABLE_TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.d.ts +5 -0
- package/dist/components/UNSTABLE_TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.js +46 -0
- package/dist/components/UNSTABLE_TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.d.ts +5 -0
- package/dist/components/UNSTABLE_TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.js +46 -0
- package/dist/components/UNSTABLE_TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionForm.d.ts +5 -0
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionForm.js +46 -0
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionForm.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyDetailsForm/PolicyDetailsForm.d.ts +6 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyDetailsForm/PolicyDetailsForm.js +50 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyDetailsForm/PolicyDetailsForm.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyList.d.ts +5 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyList.js +50 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyList.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettings.d.ts +5 -0
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettings.js +46 -0
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettings.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelector.d.ts +5 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelector.js +59 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelector.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlow.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlow.js +25 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlow.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +29 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js +98 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/index.d.ts +3 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/timeOffStateMachine.d.ts +14 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/timeOffStateMachine.js +290 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/shared/EmployeeTable/EmployeeTable.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/shared/EmployeeTable/EmployeeTableTypes.d.ts +26 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/shared/EmployeeTable/index.d.ts +4 -0
- package/dist/components/UNSTABLE_TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.d.ts +5 -0
- package/dist/components/UNSTABLE_TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.js +35 -0
- package/dist/components/UNSTABLE_TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.d.ts +5 -0
- package/dist/components/UNSTABLE_TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.js +35 -0
- package/dist/components/UNSTABLE_TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/ViewPolicyDetails/ViewPolicyDetails.d.ts +5 -0
- package/dist/components/UNSTABLE_TimeOff/ViewPolicyDetails/ViewPolicyDetails.js +35 -0
- package/dist/components/UNSTABLE_TimeOff/ViewPolicyDetails/ViewPolicyDetails.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/ViewPolicyEmployees/ViewPolicyEmployees.d.ts +5 -0
- package/dist/components/UNSTABLE_TimeOff/ViewPolicyEmployees/ViewPolicyEmployees.js +35 -0
- package/dist/components/UNSTABLE_TimeOff/ViewPolicyEmployees/ViewPolicyEmployees.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/index.d.ts +25 -0
- package/dist/components/UNSTABLE_TimeOff/index.js +27 -0
- package/dist/components/UNSTABLE_TimeOff/index.js.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +48 -46
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
- package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +11 -10
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/helpers/breadcrumbHelpers.d.ts +14 -0
- package/dist/helpers/breadcrumbHelpers.js +35 -26
- package/dist/helpers/breadcrumbHelpers.js.map +1 -1
- package/dist/{components/UNSTABLE_Hooks → helpers}/collectErrors.d.ts +1 -1
- package/dist/{components/UNSTABLE_Hooks → helpers}/collectErrors.js +1 -1
- package/dist/helpers/collectErrors.js.map +1 -0
- package/dist/hooks/useDateRangeFilter/useDateRangeFilter.d.ts +20 -0
- package/dist/hooks/useDateRangeFilter/useDateRangeFilter.js +38 -0
- package/dist/hooks/useDateRangeFilter/useDateRangeFilter.js.map +1 -0
- package/dist/hooks/useDateRangeFilter/useDateRangeFilter.test.d.ts +1 -0
- package/dist/{components/UNSTABLE_Hooks → hooks}/useErrorHandling.d.ts +2 -2
- package/dist/{components/UNSTABLE_Hooks → hooks}/useErrorHandling.js +1 -1
- package/dist/hooks/useErrorHandling.js.map +1 -0
- package/dist/hooks/useErrorHandling.test.d.ts +1 -0
- package/dist/hooks/usePagination/usePagination.d.ts +2 -0
- package/dist/hooks/usePagination/usePagination.js +32 -29
- package/dist/hooks/usePagination/usePagination.js.map +1 -1
- package/dist/i18n/I18n.js +15 -15
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js +10 -12
- package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.EmployeeTable.json.js +32 -0
- package/dist/i18n/en/Company.TimeOff.EmployeeTable.json.js.map +1 -0
- package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js +11 -13
- package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicyDetails.json.js +10 -10
- package/dist/i18n/en/Employee.EmployeeList.json.js +22 -20
- package/dist/i18n/en/Employee.EmployeeList.json.js.map +1 -1
- package/dist/i18n/en/Employee.ManagementEmployeeList.json.js +40 -0
- package/dist/i18n/en/Employee.ManagementEmployeeList.json.js.map +1 -0
- package/dist/i18n/en/Payroll.PayrollHistory.json.js +12 -12
- package/dist/i18n/en/Payroll.PayrollList.json.js +28 -20
- package/dist/i18n/en/Payroll.PayrollList.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +30 -28
- package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
- package/dist/index.js +18 -16
- package/dist/index.js.map +1 -1
- package/dist/shared/constants.d.ts +46 -0
- package/dist/shared/constants.js +99 -74
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +85 -32
- package/dist/{components/UNSTABLE_Hooks/types.d.ts → types/sdkHooks.d.ts} +28 -2
- package/docs/reference/endpoint-inventory.json +554 -385
- package/package.json +25 -16
- package/dist/components/Employee/EmployeeList/Actions.d.ts +0 -1
- package/dist/components/Employee/EmployeeList/Actions.js +0 -14
- package/dist/components/Employee/EmployeeList/Actions.js.map +0 -1
- package/dist/components/Employee/EmployeeList/Head.d.ts +0 -1
- package/dist/components/Employee/EmployeeList/Head.js +0 -12
- package/dist/components/Employee/EmployeeList/Head.js.map +0 -1
- package/dist/components/Employee/EmployeeList/List.d.ts +0 -2
- package/dist/components/Employee/EmployeeList/List.js +0 -124
- package/dist/components/Employee/EmployeeList/List.js.map +0 -1
- package/dist/components/Employee/EmployeeList/List.module.scss.js +0 -8
- package/dist/components/Employee/EmployeeList/List.module.scss.js.map +0 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.module.scss.js +0 -8
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.module.scss.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/collectErrors.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/types.d.ts +0 -27
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.js.map +0 -1
- /package/dist/components/{UNSTABLE_Hooks/useErrorHandling.test.d.ts → UNSTABLE_TimeOff/TimeOffFlow/timeOffStateMachine.test.d.ts} +0 -0
|
@@ -8,9 +8,10 @@ import { useI18n as E } from "../../../../i18n/I18n.js";
|
|
|
8
8
|
import { BaseComponent as N } from "../../../Base/Base.js";
|
|
9
9
|
import { useBase as P } from "../../../Base/useBase.js";
|
|
10
10
|
import { Flex as _ } from "../../../Common/Flex/Flex.js";
|
|
11
|
+
import "classnames";
|
|
11
12
|
import { companyEvents as i } from "../../../../shared/constants.js";
|
|
12
13
|
import { usePagination as g } from "../../../../hooks/usePagination/usePagination.js";
|
|
13
|
-
function
|
|
14
|
+
function S(t) {
|
|
14
15
|
return /* @__PURE__ */ o(N, { ...t, children: /* @__PURE__ */ o(x, { ...t, children: t.children }) });
|
|
15
16
|
}
|
|
16
17
|
function x({ companyId: t, className: e, children: r }) {
|
|
@@ -43,6 +44,6 @@ function x({ companyId: t, className: e, children: r }) {
|
|
|
43
44
|
) });
|
|
44
45
|
}
|
|
45
46
|
export {
|
|
46
|
-
|
|
47
|
+
S as LocationsList
|
|
47
48
|
};
|
|
48
49
|
//# sourceMappingURL=LocationsList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/LocationsList.tsx"],"sourcesContent":["import { useLocationsGetSuspense } from '@gusto/embedded-api/react-query/locationsGet'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { LocationsListProvider } from './useLocationsList'\nimport { useI18n } from '@/i18n'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\nimport { usePagination } from '@/hooks/usePagination/usePagination'\n\ninterface LocationsListProps extends BaseComponentInterface {\n companyId: string\n}\n\nexport function LocationsList(props: LocationsListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, className, children }: LocationsListProps) {\n useI18n('Company.Locations')\n const { onEvent } = useBase()\n\n const { getPaginationProps } = usePagination()\n\n const {\n data: { companyLocationsList, httpMeta },\n } = useLocationsGetSuspense({ companyId })\n\n const handleContinue = () => {\n onEvent(companyEvents.COMPANY_LOCATION_DONE)\n }\n const handleAddLocation = () => {\n onEvent(companyEvents.COMPANY_LOCATION_CREATE)\n }\n const handleEditLocation = (uuid: string) => {\n onEvent(companyEvents.COMPANY_LOCATION_EDIT, { uuid })\n }\n\n return (\n <section className={className}>\n <LocationsListProvider\n value={{\n ...getPaginationProps(httpMeta.response.headers),\n locationList: companyLocationsList ?? [],\n handleAddLocation,\n handleEditLocation,\n handleContinue,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <List />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsListProvider>\n </section>\n )\n}\n"],"names":["LocationsList","props","jsx","BaseComponent","Root","companyId","className","children","useI18n","onEvent","useBase","getPaginationProps","usePagination","companyLocationsList","httpMeta","useLocationsGetSuspense","handleContinue","companyEvents","handleAddLocation","handleEditLocation","uuid","LocationsListProvider","Flex","jsxs","Fragment","Head","List","Actions"],"mappings":"
|
|
1
|
+
{"version":3,"file":"LocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/LocationsList.tsx"],"sourcesContent":["import { useLocationsGetSuspense } from '@gusto/embedded-api/react-query/locationsGet'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { LocationsListProvider } from './useLocationsList'\nimport { useI18n } from '@/i18n'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\nimport { usePagination } from '@/hooks/usePagination/usePagination'\n\ninterface LocationsListProps extends BaseComponentInterface {\n companyId: string\n}\n\nexport function LocationsList(props: LocationsListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, className, children }: LocationsListProps) {\n useI18n('Company.Locations')\n const { onEvent } = useBase()\n\n const { getPaginationProps } = usePagination()\n\n const {\n data: { companyLocationsList, httpMeta },\n } = useLocationsGetSuspense({ companyId })\n\n const handleContinue = () => {\n onEvent(companyEvents.COMPANY_LOCATION_DONE)\n }\n const handleAddLocation = () => {\n onEvent(companyEvents.COMPANY_LOCATION_CREATE)\n }\n const handleEditLocation = (uuid: string) => {\n onEvent(companyEvents.COMPANY_LOCATION_EDIT, { uuid })\n }\n\n return (\n <section className={className}>\n <LocationsListProvider\n value={{\n ...getPaginationProps(httpMeta.response.headers),\n locationList: companyLocationsList ?? [],\n handleAddLocation,\n handleEditLocation,\n handleContinue,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <List />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsListProvider>\n </section>\n )\n}\n"],"names":["LocationsList","props","jsx","BaseComponent","Root","companyId","className","children","useI18n","onEvent","useBase","getPaginationProps","usePagination","companyLocationsList","httpMeta","useLocationsGetSuspense","handleContinue","companyEvents","handleAddLocation","handleEditLocation","uuid","LocationsListProvider","Flex","jsxs","Fragment","Head","List","Actions"],"mappings":";;;;;;;;;;;;;AAgBO,SAASA,EAAcC,GAA2B;AACvD,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,KAAgC;AACpE,EAAAC,EAAQ,mBAAmB;AAC3B,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEd,EAAE,oBAAAC,EAAA,IAAuBC,EAAA,GAEzB;AAAA,IACJ,MAAM,EAAE,sBAAAC,GAAsB,UAAAC,EAAA;AAAA,EAAS,IACrCC,EAAwB,EAAE,WAAAV,GAAW,GAEnCW,IAAiB,MAAM;AAC3B,IAAAP,EAAQQ,EAAc,qBAAqB;AAAA,EAC7C,GACMC,IAAoB,MAAM;AAC9B,IAAAT,EAAQQ,EAAc,uBAAuB;AAAA,EAC/C,GACME,IAAqB,CAACC,MAAiB;AAC3C,IAAAX,EAAQQ,EAAc,uBAAuB,EAAE,MAAAG,EAAA,CAAM;AAAA,EACvD;AAEA,SACE,gBAAAlB,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACmB;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,GAAGV,EAAmBG,EAAS,SAAS,OAAO;AAAA,QAC/C,cAAcD,KAAwB,CAAA;AAAA,QACtC,mBAAAK;AAAA,QACA,oBAAAC;AAAA,QACA,gBAAAH;AAAA,MAAA;AAAA,MAGF,UAAA,gBAAAd,EAACoB,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAf,KAGC,gBAAAgB,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAtB,EAACuB,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -10,13 +10,15 @@ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
|
10
10
|
import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
11
11
|
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
12
12
|
import "../../../../shared/constants.js";
|
|
13
|
+
import "classnames";
|
|
13
14
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
15
|
+
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
16
|
import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
|
|
15
|
-
const [
|
|
17
|
+
const [v, y] = o(
|
|
16
18
|
"CompanyDocumentListContext"
|
|
17
19
|
);
|
|
18
20
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
y as LocationsListProvider,
|
|
22
|
+
v as useLocationsList
|
|
21
23
|
};
|
|
22
24
|
//# sourceMappingURL=useLocationsList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/useLocationsList.ts"],"sourcesContent":["import { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\nimport type { PaginationItemsPerPage } from '@/components/Common/PaginationControl/PaginationControlTypes'\n\ntype LocationsListContextType = {\n locationList: Location[]\n totalPages: number\n totalCount: number\n currentPage: number\n itemsPerPage: PaginationItemsPerPage\n handleItemsPerPageChange: (n: PaginationItemsPerPage) => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleEditLocation: (uuid: string) => void\n handleAddLocation: () => void\n handleContinue: () => void\n}\n\nconst [useLocationsList, LocationsListProvider] = createCompoundContext<LocationsListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useLocationsList, LocationsListProvider }\n"],"names":["useLocationsList","LocationsListProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/useLocationsList.ts"],"sourcesContent":["import { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\nimport type { PaginationItemsPerPage } from '@/components/Common/PaginationControl/PaginationControlTypes'\n\ntype LocationsListContextType = {\n locationList: Location[]\n totalPages: number\n totalCount: number\n currentPage: number\n itemsPerPage: PaginationItemsPerPage\n handleItemsPerPageChange: (n: PaginationItemsPerPage) => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleEditLocation: (uuid: string) => void\n handleAddLocation: () => void\n handleContinue: () => void\n}\n\nconst [useLocationsList, LocationsListProvider] = createCompoundContext<LocationsListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useLocationsList, LocationsListProvider }\n"],"names":["useLocationsList","LocationsListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;AAoBA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { jsxs as i, jsx as
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { useOnboardingOverview as
|
|
4
|
-
import { Flex as
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/* @__PURE__ */
|
|
1
|
+
import { jsxs as i, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as m } from "react-i18next";
|
|
3
|
+
import { useOnboardingOverview as l } from "./context.js";
|
|
4
|
+
import { Flex as p } from "../../Common/Flex/Flex.js";
|
|
5
|
+
import "classnames";
|
|
6
|
+
import "../../../shared/constants.js";
|
|
7
|
+
import { useComponentContext as a } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
|
+
const x = () => {
|
|
9
|
+
const e = a(), { onboardingCompleted: t, handleDone: r } = l(), { t: o } = m("Company.OnboardingOverview");
|
|
10
|
+
return t ? /* @__PURE__ */ i(p, { alignItems: "center", flexDirection: "column", gap: 8, children: [
|
|
11
|
+
/* @__PURE__ */ n(e.Heading, { as: "h2", textAlign: "center", children: o("onboardingCompletedTitle") }),
|
|
12
|
+
/* @__PURE__ */ n("p", { children: o("onboardingCompletedDescription") }),
|
|
13
|
+
/* @__PURE__ */ n(e.Button, { variant: "secondary", onClick: r, children: o("onboardingCompletedCta") })
|
|
12
14
|
] }) : null;
|
|
13
15
|
};
|
|
14
16
|
export {
|
|
15
|
-
|
|
17
|
+
x as Completed
|
|
16
18
|
};
|
|
17
19
|
//# sourceMappingURL=Completed.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Completed.js","sources":["../../../../src/components/Company/OnboardingOverview/Completed.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useOnboardingOverview } from './context'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Completed = () => {\n const Components = useComponentContext()\n const { onboardingCompleted, handleDone } = useOnboardingOverview()\n const { t } = useTranslation('Company.OnboardingOverview')\n if (!onboardingCompleted) {\n return null\n }\n return (\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('onboardingCompletedTitle')}\n </Components.Heading>\n <p>{t('onboardingCompletedDescription')}</p>\n <Components.Button variant=\"secondary\" onClick={handleDone}>\n {t('onboardingCompletedCta')}\n </Components.Button>\n </Flex>\n )\n}\n"],"names":["Completed","Components","useComponentContext","onboardingCompleted","handleDone","useOnboardingOverview","t","useTranslation","Flex","jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Completed.js","sources":["../../../../src/components/Company/OnboardingOverview/Completed.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useOnboardingOverview } from './context'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Completed = () => {\n const Components = useComponentContext()\n const { onboardingCompleted, handleDone } = useOnboardingOverview()\n const { t } = useTranslation('Company.OnboardingOverview')\n if (!onboardingCompleted) {\n return null\n }\n return (\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('onboardingCompletedTitle')}\n </Components.Heading>\n <p>{t('onboardingCompletedDescription')}</p>\n <Components.Button variant=\"secondary\" onClick={handleDone}>\n {t('onboardingCompletedCta')}\n </Components.Button>\n </Flex>\n )\n}\n"],"names":["Completed","Components","useComponentContext","onboardingCompleted","handleDone","useOnboardingOverview","t","useTranslation","Flex","jsx"],"mappings":";;;;;;;AAKO,MAAMA,IAAY,MAAM;AAC7B,QAAMC,IAAaC,EAAA,GACb,EAAE,qBAAAC,GAAqB,YAAAC,EAAA,IAAeC,EAAA,GACtC,EAAE,GAAAC,EAAA,IAAMC,EAAe,4BAA4B;AACzD,SAAKJ,sBAIFK,GAAA,EAAK,YAAW,UAAS,eAAc,UAAS,KAAK,GACpD,UAAA;AAAA,IAAA,gBAAAC,EAACR,EAAW,SAAX,EAAmB,IAAG,MAAK,WAAU,UACnC,UAAAK,EAAE,0BAA0B,EAAA,CAC/B;AAAA,IACA,gBAAAG,EAAC,KAAA,EAAG,UAAAH,EAAE,gCAAgC,EAAA,CAAE;AAAA,IACxC,gBAAAG,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASG,GAC7C,UAAAE,EAAE,wBAAwB,EAAA,CAC7B;AAAA,EAAA,GACF,IAXO;AAaX;"}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as
|
|
2
|
+
import { useTranslation as a } from "react-i18next";
|
|
3
3
|
import { useOnboardingOverview as c } from "./context.js";
|
|
4
4
|
import { Flex as m } from "../../Common/Flex/Flex.js";
|
|
5
|
+
import "classnames";
|
|
6
|
+
import "../../../shared/constants.js";
|
|
5
7
|
import { ActionsLayout as d } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
6
8
|
import { RequirementsList as u } from "../../Common/RequirementsList/RequirementsList.js";
|
|
7
9
|
import { useComponentContext as g } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
10
|
import f from "../../../assets/icons/icon-arrow-right.svg.js";
|
|
9
|
-
const
|
|
10
|
-
const n = g(), { onboardingSteps: o, onboardingCompleted: l, handleContinue:
|
|
11
|
+
const O = () => {
|
|
12
|
+
const n = g(), { onboardingSteps: o, onboardingCompleted: l, handleContinue: p } = c(), { t } = a("Company.OnboardingOverview");
|
|
11
13
|
if (l)
|
|
12
14
|
return null;
|
|
13
15
|
const r = !o?.some((i) => i.required && i.completed);
|
|
14
16
|
return /* @__PURE__ */ e(
|
|
15
17
|
n.Box,
|
|
16
18
|
{
|
|
17
|
-
footer: /* @__PURE__ */ e(d, { children: /* @__PURE__ */ s(n.Button, { variant: "secondary", onClick:
|
|
19
|
+
footer: /* @__PURE__ */ e(d, { children: /* @__PURE__ */ s(n.Button, { variant: "secondary", onClick: p, children: [
|
|
18
20
|
t(r ? "initialSetupCta" : "missingRequirementsCta"),
|
|
19
21
|
/* @__PURE__ */ e(f, { "aria-hidden": !0 })
|
|
20
22
|
] }) }),
|
|
@@ -38,6 +40,6 @@ const T = () => {
|
|
|
38
40
|
);
|
|
39
41
|
};
|
|
40
42
|
export {
|
|
41
|
-
|
|
43
|
+
O as MissingRequirements
|
|
42
44
|
};
|
|
43
45
|
//# sourceMappingURL=MissingRequirements.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MissingRequirements.js","sources":["../../../../src/components/Company/OnboardingOverview/MissingRequirements.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useOnboardingOverview } from './context'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { RequirementsList } from '@/components/Common/RequirementsList/RequirementsList'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport ArrowRightIcon from '@/assets/icons/icon-arrow-right.svg?react'\n\nexport const MissingRequirements = () => {\n const Components = useComponentContext()\n const { onboardingSteps, onboardingCompleted, handleContinue } = useOnboardingOverview()\n const { t } = useTranslation('Company.OnboardingOverview')\n\n if (onboardingCompleted) {\n return null\n }\n\n const isInitialSetup = !onboardingSteps?.some(step => step.required && step.completed)\n\n return (\n <Components.Box\n footer={\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleContinue}>\n {t(isInitialSetup ? 'initialSetupCta' : 'missingRequirementsCta')}\n <ArrowRightIcon aria-hidden />\n </Components.Button>\n </ActionsLayout>\n }\n >\n <Flex flexDirection=\"column\" alignItems=\"flex-start\" gap={32}>\n <Flex flexDirection=\"column\" gap={4}>\n <Components.Heading as=\"h2\">\n {t(isInitialSetup ? 'initialSetupTitle' : 'missingRequirementsTitle')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {t(isInitialSetup ? 'initialSetupDescription' : 'missingRequirementsDescription')}\n </Components.Text>\n </Flex>\n {onboardingSteps && (\n <RequirementsList\n requirements={onboardingSteps.map(step => ({\n completed: step.completed!,\n title: t(`stepTitles.${step.id!}`),\n description: t(`stepDescriptions.${step.id!}`),\n }))}\n />\n )}\n </Flex>\n </Components.Box>\n )\n}\n"],"names":["MissingRequirements","Components","useComponentContext","onboardingSteps","onboardingCompleted","handleContinue","useOnboardingOverview","useTranslation","isInitialSetup","step","jsx","ActionsLayout","jsxs","ArrowRightIcon","Flex","RequirementsList"],"mappings":"
|
|
1
|
+
{"version":3,"file":"MissingRequirements.js","sources":["../../../../src/components/Company/OnboardingOverview/MissingRequirements.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useOnboardingOverview } from './context'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { RequirementsList } from '@/components/Common/RequirementsList/RequirementsList'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport ArrowRightIcon from '@/assets/icons/icon-arrow-right.svg?react'\n\nexport const MissingRequirements = () => {\n const Components = useComponentContext()\n const { onboardingSteps, onboardingCompleted, handleContinue } = useOnboardingOverview()\n const { t } = useTranslation('Company.OnboardingOverview')\n\n if (onboardingCompleted) {\n return null\n }\n\n const isInitialSetup = !onboardingSteps?.some(step => step.required && step.completed)\n\n return (\n <Components.Box\n footer={\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleContinue}>\n {t(isInitialSetup ? 'initialSetupCta' : 'missingRequirementsCta')}\n <ArrowRightIcon aria-hidden />\n </Components.Button>\n </ActionsLayout>\n }\n >\n <Flex flexDirection=\"column\" alignItems=\"flex-start\" gap={32}>\n <Flex flexDirection=\"column\" gap={4}>\n <Components.Heading as=\"h2\">\n {t(isInitialSetup ? 'initialSetupTitle' : 'missingRequirementsTitle')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {t(isInitialSetup ? 'initialSetupDescription' : 'missingRequirementsDescription')}\n </Components.Text>\n </Flex>\n {onboardingSteps && (\n <RequirementsList\n requirements={onboardingSteps.map(step => ({\n completed: step.completed!,\n title: t(`stepTitles.${step.id!}`),\n description: t(`stepDescriptions.${step.id!}`),\n }))}\n />\n )}\n </Flex>\n </Components.Box>\n )\n}\n"],"names":["MissingRequirements","Components","useComponentContext","onboardingSteps","onboardingCompleted","handleContinue","useOnboardingOverview","useTranslation","isInitialSetup","step","jsx","ActionsLayout","jsxs","ArrowRightIcon","Flex","RequirementsList"],"mappings":";;;;;;;;;;AAOO,MAAMA,IAAsB,MAAM;AACvC,QAAMC,IAAaC,EAAA,GACb,EAAE,iBAAAC,GAAiB,qBAAAC,GAAqB,gBAAAC,EAAA,IAAmBC,EAAA,GAC3D,EAAE,EAAA,IAAMC,EAAe,4BAA4B;AAEzD,MAAIH;AACF,WAAO;AAGT,QAAMI,IAAiB,CAACL,GAAiB,KAAK,OAAQM,EAAK,YAAYA,EAAK,SAAS;AAErF,SACE,gBAAAC;AAAA,IAACT,EAAW;AAAA,IAAX;AAAA,MACC,QACE,gBAAAS,EAACC,GAAA,EACC,UAAA,gBAAAC,EAACX,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASI,GAC7C,UAAA;AAAA,QAAA,EAAEG,IAAiB,oBAAoB,wBAAwB;AAAA,QAChE,gBAAAE,EAACG,GAAA,EAAe,eAAW,GAAA,CAAC;AAAA,MAAA,EAAA,CAC9B,EAAA,CACF;AAAA,MAGF,4BAACC,GAAA,EAAK,eAAc,UAAS,YAAW,cAAa,KAAK,IACxD,UAAA;AAAA,QAAA,gBAAAF,EAACE,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,UAAA,gBAAAJ,EAACT,EAAW,SAAX,EAAmB,IAAG,MACpB,UAAA,EAAEO,IAAiB,sBAAsB,0BAA0B,EAAA,CACtE;AAAA,UACA,gBAAAE,EAACT,EAAW,MAAX,EAAgB,SAAQ,cACtB,UAAA,EAAEO,IAAiB,4BAA4B,gCAAgC,EAAA,CAClF;AAAA,QAAA,GACF;AAAA,QACCL,KACC,gBAAAO;AAAA,UAACK;AAAA,UAAA;AAAA,YACC,cAAcZ,EAAgB,IAAI,CAAAM,OAAS;AAAA,cACzC,WAAWA,EAAK;AAAA,cAChB,OAAO,EAAE,cAAcA,EAAK,EAAG,EAAE;AAAA,cACjC,aAAa,EAAE,oBAAoBA,EAAK,EAAG,EAAE;AAAA,YAAA,EAC7C;AAAA,UAAA;AAAA,QAAA;AAAA,MACJ,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -7,8 +7,9 @@ import { BaseComponent as f } from "../../Base/Base.js";
|
|
|
7
7
|
import { useBase as v } from "../../Base/useBase.js";
|
|
8
8
|
import { useI18n as C, useComponentDictionary as g } from "../../../i18n/I18n.js";
|
|
9
9
|
import { Flex as h } from "../../Common/Flex/Flex.js";
|
|
10
|
+
import "classnames";
|
|
10
11
|
import { componentEvents as i } from "../../../shared/constants.js";
|
|
11
|
-
function
|
|
12
|
+
function j(o) {
|
|
12
13
|
return C("Company.OnboardingOverview"), g("Company.OnboardingOverview", o.dictionary), /* @__PURE__ */ n(f, { ...o, children: /* @__PURE__ */ n(b, { ...o, children: o.children }) });
|
|
13
14
|
}
|
|
14
15
|
const b = ({ companyId: o, className: t, children: e }) => {
|
|
@@ -34,6 +35,6 @@ const b = ({ companyId: o, className: t, children: e }) => {
|
|
|
34
35
|
) });
|
|
35
36
|
};
|
|
36
37
|
export {
|
|
37
|
-
|
|
38
|
+
j as OnboardingOverview
|
|
38
39
|
};
|
|
39
40
|
//# sourceMappingURL=OnboardingOverview.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnboardingOverview.js","sources":["../../../../src/components/Company/OnboardingOverview/OnboardingOverview.tsx"],"sourcesContent":["import { useCompaniesGetOnboardingStatusSuspense } from '@gusto/embedded-api/react-query/companiesGetOnboardingStatus'\nimport { OnboardingOverviewProvider } from './context'\nimport { MissingRequirements } from './MissingRequirements'\nimport { Completed } from './Completed'\nimport {\n BaseComponent,\n useBase,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { Flex } from '@/components/Common'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface OnboardingOverviewProps extends CommonComponentInterface<'Company.OnboardingOverview'> {\n companyId: string\n}\n\nexport function OnboardingOverview(props: OnboardingOverviewProps & BaseComponentInterface) {\n useI18n('Company.OnboardingOverview')\n useComponentDictionary('Company.OnboardingOverview', props.dictionary)\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ companyId, className, children }: OnboardingOverviewProps) => {\n const { onEvent } = useBase()\n\n const { data } = useCompaniesGetOnboardingStatusSuspense({ companyUuid: companyId })\n const { onboardingCompleted, onboardingSteps } = data.companyOnboardingStatus!\n\n const handleDone = () => {\n onEvent(componentEvents.COMPANY_OVERVIEW_DONE)\n }\n const handleContinue = () => {\n onEvent(componentEvents.COMPANY_OVERVIEW_CONTINUE)\n }\n\n return (\n <section className={className}>\n <OnboardingOverviewProvider\n value={{\n onboardingCompleted,\n onboardingSteps,\n handleDone,\n handleContinue,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Completed />\n <MissingRequirements />\n </>\n )}\n </Flex>\n </OnboardingOverviewProvider>\n </section>\n )\n}\n"],"names":["OnboardingOverview","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","companyId","className","children","onEvent","useBase","data","useCompaniesGetOnboardingStatusSuspense","onboardingCompleted","onboardingSteps","OnboardingOverviewProvider","componentEvents","Flex","jsxs","Fragment","Completed","MissingRequirements"],"mappings":"
|
|
1
|
+
{"version":3,"file":"OnboardingOverview.js","sources":["../../../../src/components/Company/OnboardingOverview/OnboardingOverview.tsx"],"sourcesContent":["import { useCompaniesGetOnboardingStatusSuspense } from '@gusto/embedded-api/react-query/companiesGetOnboardingStatus'\nimport { OnboardingOverviewProvider } from './context'\nimport { MissingRequirements } from './MissingRequirements'\nimport { Completed } from './Completed'\nimport {\n BaseComponent,\n useBase,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { Flex } from '@/components/Common'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface OnboardingOverviewProps extends CommonComponentInterface<'Company.OnboardingOverview'> {\n companyId: string\n}\n\nexport function OnboardingOverview(props: OnboardingOverviewProps & BaseComponentInterface) {\n useI18n('Company.OnboardingOverview')\n useComponentDictionary('Company.OnboardingOverview', props.dictionary)\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ companyId, className, children }: OnboardingOverviewProps) => {\n const { onEvent } = useBase()\n\n const { data } = useCompaniesGetOnboardingStatusSuspense({ companyUuid: companyId })\n const { onboardingCompleted, onboardingSteps } = data.companyOnboardingStatus!\n\n const handleDone = () => {\n onEvent(componentEvents.COMPANY_OVERVIEW_DONE)\n }\n const handleContinue = () => {\n onEvent(componentEvents.COMPANY_OVERVIEW_CONTINUE)\n }\n\n return (\n <section className={className}>\n <OnboardingOverviewProvider\n value={{\n onboardingCompleted,\n onboardingSteps,\n handleDone,\n handleContinue,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Completed />\n <MissingRequirements />\n </>\n )}\n </Flex>\n </OnboardingOverviewProvider>\n </section>\n )\n}\n"],"names":["OnboardingOverview","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","companyId","className","children","onEvent","useBase","data","useCompaniesGetOnboardingStatusSuspense","onboardingCompleted","onboardingSteps","OnboardingOverviewProvider","componentEvents","Flex","jsxs","Fragment","Completed","MissingRequirements"],"mappings":";;;;;;;;;;;AAmBO,SAASA,EAAmBC,GAAyD;AAC1F,SAAAC,EAAQ,4BAA4B,GACpCC,EAAuB,8BAA8BF,EAAM,UAAU,GAEnE,gBAAAG,EAACC,GAAA,EAAe,GAAGJ,GACjB,UAAA,gBAAAG,EAACE,KAAM,GAAGL,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMK,IAAO,CAAC,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,QAAwC;AAC5E,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEd,EAAE,MAAAC,EAAA,IAASC,EAAwC,EAAE,aAAaN,GAAW,GAC7E,EAAE,qBAAAO,GAAqB,iBAAAC,EAAA,IAAoBH,EAAK;AAStD,SACE,gBAAAR,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACY;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,qBAAAF;AAAA,QACA,iBAAAC;AAAA,QACA,YAbW,MAAM;AACvB,UAAAL,EAAQO,EAAgB,qBAAqB;AAAA,QAC/C;AAAA,QAYQ,gBAXe,MAAM;AAC3B,UAAAP,EAAQO,EAAgB,yBAAyB;AAAA,QACnD;AAAA,MASQ;AAAA,MAGF,UAAA,gBAAAb,EAACc,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAT,KAGC,gBAAAU,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAhB,EAACiB,GAAA,EAAU;AAAA,0BACVC,GAAA,CAAA,CAAoB;AAAA,MAAA,EAAA,CACvB,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -10,11 +10,13 @@ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
|
10
10
|
import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
11
11
|
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
12
12
|
import "../../../shared/constants.js";
|
|
13
|
+
import "classnames";
|
|
13
14
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
15
|
+
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
16
|
import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
|
|
15
|
-
const [
|
|
17
|
+
const [c, s] = o("OnboardingOverviewContext");
|
|
16
18
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
s as OnboardingOverviewProvider,
|
|
20
|
+
c as useOnboardingOverview
|
|
19
21
|
};
|
|
20
22
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../../../src/components/Company/OnboardingOverview/context.ts"],"sourcesContent":["import type { OnboardingStep } from '@gusto/embedded-api/models/components/companyonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\n\ntype OnboardingOverviewContextType = {\n onboardingCompleted?: boolean\n onboardingSteps?: OnboardingStep[]\n handleDone: () => void\n handleContinue: () => void\n}\n\nconst [useOnboardingOverview, OnboardingOverviewProvider] =\n createCompoundContext<OnboardingOverviewContextType>('OnboardingOverviewContext')\n\nexport { useOnboardingOverview, OnboardingOverviewProvider }\n"],"names":["useOnboardingOverview","OnboardingOverviewProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../../../../src/components/Company/OnboardingOverview/context.ts"],"sourcesContent":["import type { OnboardingStep } from '@gusto/embedded-api/models/components/companyonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\n\ntype OnboardingOverviewContextType = {\n onboardingCompleted?: boolean\n onboardingSteps?: OnboardingStep[]\n handleDone: () => void\n handleContinue: () => void\n}\n\nconst [useOnboardingOverview, OnboardingOverviewProvider] =\n createCompoundContext<OnboardingOverviewContextType>('OnboardingOverviewContext')\n\nexport { useOnboardingOverview, OnboardingOverviewProvider }\n"],"names":["useOnboardingOverview","OnboardingOverviewProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAuBC,CAA0B,IACtDC,EAAqD,2BAA2B;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as a, jsxs as k } from "react/jsx-runtime";
|
|
2
2
|
import { useForm as z, FormProvider as K } from "react-hook-form";
|
|
3
3
|
import { zodResolver as J } from "@hookform/resolvers/zod";
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as C, useEffect as w } from "react";
|
|
5
5
|
import { usePaySchedulesGetPreview as Q } from "@gusto/embedded-api/react-query/paySchedulesGetPreview";
|
|
6
6
|
import { usePaySchedulesUpdateMutation as W } from "@gusto/embedded-api/react-query/paySchedulesUpdate";
|
|
7
7
|
import { usePaySchedulesGetAllSuspense as X } from "@gusto/embedded-api/react-query/paySchedulesGetAll";
|
|
@@ -12,25 +12,26 @@ import { Form as oe } from "../../Common/Form/Form.js";
|
|
|
12
12
|
import { BaseComponent as re } from "../../Base/Base.js";
|
|
13
13
|
import { useBase as te } from "../../Base/useBase.js";
|
|
14
14
|
import { Flex as ae } from "../../Common/Flex/Flex.js";
|
|
15
|
-
import
|
|
15
|
+
import "classnames";
|
|
16
16
|
import { componentEvents as S } from "../../../shared/constants.js";
|
|
17
|
+
import { useI18n as ne, useComponentDictionary as ce } from "../../../i18n/I18n.js";
|
|
17
18
|
import { formatDateToStringDate as p } from "../../../helpers/dateFormatting.js";
|
|
18
19
|
import { normalizeErrorKeyForForm as ie } from "../../../helpers/formattedStrings.js";
|
|
19
20
|
import { Head as de } from "./_parts/Head.js";
|
|
20
21
|
import { List as se } from "./_parts/List.js";
|
|
21
22
|
import { Edit as me } from "./_parts/Edit.js";
|
|
22
23
|
import { Actions as ye } from "./_parts/Actions.js";
|
|
23
|
-
const
|
|
24
|
+
const be = ({
|
|
24
25
|
companyId: n,
|
|
25
26
|
defaultValues: s,
|
|
26
27
|
dictionary: t,
|
|
27
28
|
...m
|
|
28
29
|
}) => (ne("Company.PaySchedule"), ce("Company.PaySchedule", t), /* @__PURE__ */ a(re, { ...m, children: /* @__PURE__ */ a(Pe, { companyId: n, defaultValues: s, children: m.children }) })), Pe = ({ companyId: n, children: s, defaultValues: t }) => {
|
|
29
|
-
const { baseSubmitHandler: m, onEvent: h, error:
|
|
30
|
+
const { baseSubmitHandler: m, onEvent: h, error: L, setError: q } = te(), { data: l } = X({
|
|
30
31
|
companyId: n
|
|
31
|
-
}), { data:
|
|
32
|
+
}), { data: T } = $({ companyUuid: n }), O = T?.paymentConfigs?.paymentSpeed, [i, y] = C(
|
|
32
33
|
l.payScheduleList?.length === 0 ? "ADD_PAY_SCHEDULE" : "LIST_PAY_SCHEDULES"
|
|
33
|
-
), [f,
|
|
34
|
+
), [f, U] = C(null), H = {
|
|
34
35
|
frequency: t?.frequency ?? "Every week",
|
|
35
36
|
anchorPayDate: t?.anchorPayDate ? new Date(t.anchorPayDate) : void 0,
|
|
36
37
|
anchorEndOfPayPeriod: t?.anchorEndOfPayPeriod ? new Date(t.anchorEndOfPayPeriod) : void 0,
|
|
@@ -38,21 +39,21 @@ const Ne = ({
|
|
|
38
39
|
day2: t?.day2 ?? void 0,
|
|
39
40
|
customName: t?.customName ?? "",
|
|
40
41
|
customTwicePerMonth: "false"
|
|
41
|
-
},
|
|
42
|
+
}, v = Z(), A = W(), E = z({
|
|
42
43
|
resolver: J(V),
|
|
43
|
-
defaultValues:
|
|
44
|
-
}), { watch:
|
|
45
|
-
|
|
44
|
+
defaultValues: H
|
|
45
|
+
}), { watch: g, setValue: D, reset: d, clearErrors: Y, setError: _ } = E, P = L?.fieldErrors;
|
|
46
|
+
w(() => {
|
|
46
47
|
P && P.length > 0 && P.forEach((o) => {
|
|
47
48
|
const r = ie(o.field);
|
|
48
|
-
|
|
49
|
+
_(r, { message: o.message });
|
|
49
50
|
});
|
|
50
|
-
}, [
|
|
51
|
-
const e =
|
|
51
|
+
}, [_, P]);
|
|
52
|
+
const e = g(), M = e.anchorPayDate && p(e.anchorPayDate) || "", N = e.anchorEndOfPayPeriod && p(e.anchorEndOfPayPeriod) || "", { data: b, isLoading: B } = Q(
|
|
52
53
|
{
|
|
53
54
|
companyId: n,
|
|
54
55
|
frequency: e.frequency,
|
|
55
|
-
anchorPayDate:
|
|
56
|
+
anchorPayDate: M,
|
|
56
57
|
anchorEndOfPayPeriod: N,
|
|
57
58
|
day1: e.day1 ?? void 0,
|
|
58
59
|
day2: e.day2 ?? void 0
|
|
@@ -61,13 +62,13 @@ const Ne = ({
|
|
|
61
62
|
enabled: !!(e.anchorPayDate && e.anchorEndOfPayPeriod && (i === "ADD_PAY_SCHEDULE" || i === "EDIT_PAY_SCHEDULE"))
|
|
62
63
|
}
|
|
63
64
|
);
|
|
64
|
-
|
|
65
|
+
w(() => {
|
|
65
66
|
e.frequency === "Twice per month" && e.day1 === 15 && e.day2 === 31 && e.customTwicePerMonth === void 0 ? D("customTwicePerMonth", "1st15th") : e.frequency === "Twice per month" && e.customTwicePerMonth === void 0 && D("customTwicePerMonth", "custom");
|
|
66
67
|
}, [e.frequency, e.day1, e.day2, D, e.customTwicePerMonth]);
|
|
67
68
|
const F = () => {
|
|
68
69
|
y("ADD_PAY_SCHEDULE"), d({});
|
|
69
70
|
}, x = () => {
|
|
70
|
-
y("LIST_PAY_SCHEDULES"), d({}),
|
|
71
|
+
y("LIST_PAY_SCHEDULES"), d({}), Y(), q(null);
|
|
71
72
|
}, R = (o) => {
|
|
72
73
|
d({
|
|
73
74
|
frequency: o.frequency,
|
|
@@ -76,14 +77,14 @@ const Ne = ({
|
|
|
76
77
|
day1: o.day1 ?? void 0,
|
|
77
78
|
day2: o.day2 ?? void 0,
|
|
78
79
|
customName: o.customName ?? ""
|
|
79
|
-
}),
|
|
80
|
+
}), U(o), y("EDIT_PAY_SCHEDULE");
|
|
80
81
|
}, j = () => {
|
|
81
82
|
h(S.PAY_SCHEDULE_DONE);
|
|
82
83
|
}, G = async (o) => {
|
|
83
84
|
await m(o, async (r) => {
|
|
84
85
|
const u = (c) => c && p(c) || "";
|
|
85
86
|
if (i === "ADD_PAY_SCHEDULE") {
|
|
86
|
-
const c = await
|
|
87
|
+
const c = await v.mutateAsync({
|
|
87
88
|
request: {
|
|
88
89
|
companyId: n,
|
|
89
90
|
requestBody: {
|
|
@@ -98,7 +99,7 @@ const Ne = ({
|
|
|
98
99
|
});
|
|
99
100
|
h(S.PAY_SCHEDULE_CREATED, c), d();
|
|
100
101
|
} else if (i === "EDIT_PAY_SCHEDULE") {
|
|
101
|
-
const c = f?.version, I = await
|
|
102
|
+
const c = f?.version, I = await A.mutateAsync({
|
|
102
103
|
request: {
|
|
103
104
|
payScheduleId: f?.uuid,
|
|
104
105
|
companyId: n,
|
|
@@ -128,11 +129,12 @@ const Ne = ({
|
|
|
128
129
|
handleCancel: x,
|
|
129
130
|
handleContinue: j,
|
|
130
131
|
mode: i,
|
|
132
|
+
isPending: v.isPending || A.isPending,
|
|
131
133
|
paySchedules: l.payScheduleList,
|
|
132
134
|
payPeriodPreview: b?.object?.payPeriods,
|
|
133
135
|
payPreviewLoading: B,
|
|
134
136
|
currentPaySchedule: f,
|
|
135
|
-
paymentSpeed:
|
|
137
|
+
paymentSpeed: O
|
|
136
138
|
},
|
|
137
139
|
children: /* @__PURE__ */ a("span", { "data-testid": "pay-schedule-edit-form", children: /* @__PURE__ */ a(K, { ...E, children: /* @__PURE__ */ a(oe, { onSubmit: E.handleSubmit(G), children: s || /* @__PURE__ */ k(ae, { flexDirection: "column", children: [
|
|
138
140
|
/* @__PURE__ */ a(de, {}),
|
|
@@ -144,6 +146,6 @@ const Ne = ({
|
|
|
144
146
|
);
|
|
145
147
|
};
|
|
146
148
|
export {
|
|
147
|
-
|
|
149
|
+
be as PaySchedule
|
|
148
150
|
};
|
|
149
151
|
//# sourceMappingURL=PaySchedule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/PaySchedule.tsx"],"sourcesContent":["import type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useEffect, useState } from 'react'\nimport { usePaySchedulesGetPreview } from '@gusto/embedded-api/react-query/paySchedulesGetPreview'\nimport { usePaySchedulesUpdateMutation } from '@gusto/embedded-api/react-query/paySchedulesUpdate'\nimport { usePaySchedulesGetAllSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAll'\nimport { usePaySchedulesCreateMutation } from '@gusto/embedded-api/react-query/paySchedulesCreate'\nimport { usePaymentConfigsGet } from '@gusto/embedded-api/react-query/paymentConfigsGet'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { Frequency } from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayschedules'\nimport type { MODE, PayScheduleInputs, PayScheduleOutputs } from './usePaySchedule'\nimport {\n PayScheduleProvider,\n PayScheduleSchema,\n type PayScheduleDefaultValues,\n} from './usePaySchedule'\nimport { Actions, Edit, Head, List } from './_parts'\nimport { Form } from '@/components/Common/Form'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { formatDateToStringDate } from '@/helpers/dateFormatting'\nimport { normalizeErrorKeyForForm } from '@/helpers/formattedStrings'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface PayScheduleProps extends CommonComponentInterface<'Company.PaySchedule'> {\n companyId: string\n defaultValues?: PayScheduleDefaultValues\n}\n\nexport const PaySchedule = ({\n companyId,\n defaultValues,\n dictionary,\n ...props\n}: PayScheduleProps & BaseComponentInterface) => {\n useI18n('Company.PaySchedule')\n useComponentDictionary('Company.PaySchedule', dictionary)\n return (\n <BaseComponent {...props}>\n <Root companyId={companyId} defaultValues={defaultValues}>\n {props.children}\n </Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ companyId, children, defaultValues }: PayScheduleProps) => {\n const { baseSubmitHandler, onEvent, error, setError: setBaseError } = useBase()\n\n const { data: paySchedules } = usePaySchedulesGetAllSuspense({\n companyId,\n })\n\n const { data: paymentConfigs } = usePaymentConfigsGet({ companyUuid: companyId })\n const paymentSpeed = paymentConfigs?.paymentConfigs?.paymentSpeed\n\n const [mode, setMode] = useState<MODE>(\n paySchedules.payScheduleList?.length === 0 ? 'ADD_PAY_SCHEDULE' : 'LIST_PAY_SCHEDULES',\n )\n const [currentPaySchedule, setCurrentPaySchedule] = useState<PayScheduleType | null>(null)\n const transformedDefaultValues: PayScheduleInputs = {\n frequency: defaultValues?.frequency ?? 'Every week',\n anchorPayDate: defaultValues?.anchorPayDate ? new Date(defaultValues.anchorPayDate) : undefined,\n anchorEndOfPayPeriod: defaultValues?.anchorEndOfPayPeriod\n ? new Date(defaultValues.anchorEndOfPayPeriod)\n : undefined,\n day1: defaultValues?.day1 ?? undefined,\n day2: defaultValues?.day2 ?? undefined,\n customName: defaultValues?.customName ?? '',\n customTwicePerMonth: 'false',\n }\n\n const createPayScheduleMutation = usePaySchedulesCreateMutation()\n const updatePayScheduleMutation = usePaySchedulesUpdateMutation()\n\n const formMethods = useForm<PayScheduleInputs, unknown, PayScheduleOutputs>({\n resolver: zodResolver(PayScheduleSchema),\n defaultValues: transformedDefaultValues,\n })\n const { watch, setValue, reset, clearErrors, setError } = formMethods\n\n const fieldErrors = error?.fieldErrors\n useEffect(() => {\n if (fieldErrors && fieldErrors.length > 0) {\n fieldErrors.forEach(fieldError => {\n const key = normalizeErrorKeyForForm(fieldError.field)\n setError(key as keyof PayScheduleInputs, { message: fieldError.message })\n })\n }\n }, [setError, fieldErrors])\n\n const allValues = watch()\n\n const formattedAnchorPayDate = allValues.anchorPayDate\n ? formatDateToStringDate(allValues.anchorPayDate) || ''\n : ''\n const formattedAnchorEndOfPayPeriod = allValues.anchorEndOfPayPeriod\n ? formatDateToStringDate(allValues.anchorEndOfPayPeriod) || ''\n : ''\n\n const { data: payPreviewData, isLoading } = usePaySchedulesGetPreview(\n {\n companyId,\n frequency: allValues.frequency,\n anchorPayDate: formattedAnchorPayDate,\n anchorEndOfPayPeriod: formattedAnchorEndOfPayPeriod,\n day1: allValues.day1 ?? undefined,\n day2: allValues.day2 ?? undefined,\n },\n {\n enabled: Boolean(\n allValues.anchorPayDate &&\n allValues.anchorEndOfPayPeriod &&\n (mode === 'ADD_PAY_SCHEDULE' || mode === 'EDIT_PAY_SCHEDULE'),\n ),\n },\n )\n\n // Set the custom_twice_per_month value based on the frequency and day_1 and day_2 values as it is not set by the API call\n useEffect(() => {\n if (\n allValues.frequency === 'Twice per month' &&\n allValues.day1 === 15 &&\n allValues.day2 === 31 &&\n allValues.customTwicePerMonth === undefined\n ) {\n setValue('customTwicePerMonth', `1st15th`)\n } else if (\n allValues.frequency === 'Twice per month' &&\n allValues.customTwicePerMonth === undefined\n ) {\n setValue('customTwicePerMonth', `custom`)\n }\n }, [allValues.frequency, allValues.day1, allValues.day2, setValue, allValues.customTwicePerMonth])\n\n const handleAdd = () => {\n setMode('ADD_PAY_SCHEDULE')\n reset({})\n }\n const handleCancel = () => {\n setMode('LIST_PAY_SCHEDULES')\n reset({})\n clearErrors()\n setBaseError(null)\n }\n const handleEdit = (schedule: PayScheduleType) => {\n reset({\n frequency: schedule.frequency as Frequency,\n anchorPayDate: schedule.anchorPayDate ? new Date(schedule.anchorPayDate) : undefined,\n anchorEndOfPayPeriod: schedule.anchorEndOfPayPeriod\n ? new Date(schedule.anchorEndOfPayPeriod)\n : undefined,\n day1: schedule.day1 ?? undefined,\n day2: schedule.day2 ?? undefined,\n customName: schedule.customName ?? '',\n })\n setCurrentPaySchedule(schedule)\n setMode('EDIT_PAY_SCHEDULE')\n }\n const handleContinue = () => {\n onEvent(componentEvents.PAY_SCHEDULE_DONE)\n }\n const onSubmit: SubmitHandler<PayScheduleOutputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n const formatPayloadDate = (date: Date | undefined): string => {\n return date ? formatDateToStringDate(date) || '' : ''\n }\n\n if (mode === 'ADD_PAY_SCHEDULE') {\n const createPayScheduleResponse = await createPayScheduleMutation.mutateAsync({\n request: {\n companyId,\n requestBody: {\n frequency: payload.frequency,\n anchorPayDate: formatPayloadDate(payload.anchorPayDate),\n anchorEndOfPayPeriod: formatPayloadDate(payload.anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1,\n day2: payload.day2,\n },\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_CREATED, createPayScheduleResponse)\n reset()\n } else if (mode === 'EDIT_PAY_SCHEDULE') {\n const version = currentPaySchedule?.version\n const updatePayScheduleResponse = await updatePayScheduleMutation.mutateAsync({\n request: {\n payScheduleId: currentPaySchedule?.uuid as string,\n companyId,\n requestBody: {\n frequency: payload.frequency,\n anchorPayDate: formatPayloadDate(payload.anchorPayDate),\n anchorEndOfPayPeriod: formatPayloadDate(payload.anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1,\n day2: payload.day2,\n version: version as string,\n },\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_UPDATED, updatePayScheduleResponse)\n reset()\n }\n setMode('LIST_PAY_SCHEDULES')\n })\n }\n\n return (\n <PayScheduleProvider\n value={{\n companyId,\n handleAdd,\n handleEdit,\n handleCancel,\n handleContinue,\n mode,\n paySchedules: paySchedules.payScheduleList,\n payPeriodPreview: payPreviewData?.object?.payPeriods,\n payPreviewLoading: isLoading,\n currentPaySchedule,\n paymentSpeed,\n }}\n >\n <span data-testid=\"pay-schedule-edit-form\">\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Edit />\n <Actions />\n </Flex>\n )}\n </Form>\n </FormProvider>\n </span>\n </PayScheduleProvider>\n )\n}\n"],"names":["PaySchedule","companyId","defaultValues","dictionary","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","children","baseSubmitHandler","onEvent","error","setBaseError","useBase","paySchedules","usePaySchedulesGetAllSuspense","paymentConfigs","usePaymentConfigsGet","paymentSpeed","mode","setMode","useState","currentPaySchedule","setCurrentPaySchedule","transformedDefaultValues","createPayScheduleMutation","usePaySchedulesCreateMutation","updatePayScheduleMutation","usePaySchedulesUpdateMutation","formMethods","useForm","zodResolver","PayScheduleSchema","watch","setValue","reset","clearErrors","setError","fieldErrors","useEffect","fieldError","key","normalizeErrorKeyForForm","allValues","formattedAnchorPayDate","formatDateToStringDate","formattedAnchorEndOfPayPeriod","payPreviewData","isLoading","usePaySchedulesGetPreview","handleAdd","handleCancel","handleEdit","schedule","handleContinue","componentEvents","onSubmit","data","payload","formatPayloadDate","date","createPayScheduleResponse","version","updatePayScheduleResponse","PayScheduleProvider","FormProvider","Form","jsxs","Flex","Head","List","Edit","Actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiCO,MAAMA,KAAc,CAAC;AAAA,EAC1B,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACL,OACEC,GAAQ,qBAAqB,GAC7BC,GAAuB,uBAAuBH,CAAU,GAEtD,gBAAAI,EAACC,IAAA,EAAe,GAAGJ,GACjB,UAAA,gBAAAG,EAACE,MAAK,WAAAR,GAAsB,eAAAC,GACzB,UAAAE,EAAM,SAAA,CACT,EAAA,CACF,IAIEK,KAAO,CAAC,EAAE,WAAAR,GAAW,UAAAS,GAAU,eAAAR,QA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AyB,GACvE5B,EAAA;AAAA,MACF;AACA,MAAAf,EAAQ,oBAAoB;AAAA,IAC9B,CAAC;AAAA,EACH;AAEA,SACE,gBAAAf;AAAA,IAAC2D;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,WAAAjE;AAAA,QACA,WAAAmD;AAAA,QACA,YAAAE;AAAA,QACA,cAAAD;AAAA,QACA,gBAAAG;AAAA,QACA,MAAAnC;AAAA,QACA,cAAcL,EAAa;AAAA,QAC3B,kBAAkBiC,GAAgB,QAAQ;AAAA,QAC1C,mBAAmBC;AAAA,QACnB,oBAAA1B;AAAA,QACA,cAAAJ;AAAA,MAAA;AAAA,MAGF,UAAA,gBAAAb,EAAC,UAAK,eAAY,0BAChB,4BAAC4D,GAAA,EAAc,GAAGpC,GAChB,UAAA,gBAAAxB,EAAC6D,IAAA,EAAK,UAAUrC,EAAY,aAAa2B,CAAQ,GAC9C,UAAAhD,KAGC,gBAAA2D,EAACC,IAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAA/D,EAACgE,IAAA,EAAK;AAAA,0BACLC,IAAA,EAAK;AAAA,0BACLC,IAAA,EAAK;AAAA,0BACLC,IAAA,CAAA,CAAQ;AAAA,MAAA,GACX,EAAA,CAEJ,GACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
1
|
+
{"version":3,"file":"PaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/PaySchedule.tsx"],"sourcesContent":["import type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useEffect, useState } from 'react'\nimport { usePaySchedulesGetPreview } from '@gusto/embedded-api/react-query/paySchedulesGetPreview'\nimport { usePaySchedulesUpdateMutation } from '@gusto/embedded-api/react-query/paySchedulesUpdate'\nimport { usePaySchedulesGetAllSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAll'\nimport { usePaySchedulesCreateMutation } from '@gusto/embedded-api/react-query/paySchedulesCreate'\nimport { usePaymentConfigsGet } from '@gusto/embedded-api/react-query/paymentConfigsGet'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { Frequency } from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayschedules'\nimport type { MODE, PayScheduleInputs, PayScheduleOutputs } from './usePaySchedule'\nimport {\n PayScheduleProvider,\n PayScheduleSchema,\n type PayScheduleDefaultValues,\n} from './usePaySchedule'\nimport { Actions, Edit, Head, List } from './_parts'\nimport { Form } from '@/components/Common/Form'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { formatDateToStringDate } from '@/helpers/dateFormatting'\nimport { normalizeErrorKeyForForm } from '@/helpers/formattedStrings'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface PayScheduleProps extends CommonComponentInterface<'Company.PaySchedule'> {\n companyId: string\n defaultValues?: PayScheduleDefaultValues\n}\n\nexport const PaySchedule = ({\n companyId,\n defaultValues,\n dictionary,\n ...props\n}: PayScheduleProps & BaseComponentInterface) => {\n useI18n('Company.PaySchedule')\n useComponentDictionary('Company.PaySchedule', dictionary)\n return (\n <BaseComponent {...props}>\n <Root companyId={companyId} defaultValues={defaultValues}>\n {props.children}\n </Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ companyId, children, defaultValues }: PayScheduleProps) => {\n const { baseSubmitHandler, onEvent, error, setError: setBaseError } = useBase()\n\n const { data: paySchedules } = usePaySchedulesGetAllSuspense({\n companyId,\n })\n\n const { data: paymentConfigs } = usePaymentConfigsGet({ companyUuid: companyId })\n const paymentSpeed = paymentConfigs?.paymentConfigs?.paymentSpeed\n\n const [mode, setMode] = useState<MODE>(\n paySchedules.payScheduleList?.length === 0 ? 'ADD_PAY_SCHEDULE' : 'LIST_PAY_SCHEDULES',\n )\n const [currentPaySchedule, setCurrentPaySchedule] = useState<PayScheduleType | null>(null)\n const transformedDefaultValues: PayScheduleInputs = {\n frequency: defaultValues?.frequency ?? 'Every week',\n anchorPayDate: defaultValues?.anchorPayDate ? new Date(defaultValues.anchorPayDate) : undefined,\n anchorEndOfPayPeriod: defaultValues?.anchorEndOfPayPeriod\n ? new Date(defaultValues.anchorEndOfPayPeriod)\n : undefined,\n day1: defaultValues?.day1 ?? undefined,\n day2: defaultValues?.day2 ?? undefined,\n customName: defaultValues?.customName ?? '',\n customTwicePerMonth: 'false',\n }\n\n const createPayScheduleMutation = usePaySchedulesCreateMutation()\n const updatePayScheduleMutation = usePaySchedulesUpdateMutation()\n\n const formMethods = useForm<PayScheduleInputs, unknown, PayScheduleOutputs>({\n resolver: zodResolver(PayScheduleSchema),\n defaultValues: transformedDefaultValues,\n })\n const { watch, setValue, reset, clearErrors, setError } = formMethods\n\n const fieldErrors = error?.fieldErrors\n useEffect(() => {\n if (fieldErrors && fieldErrors.length > 0) {\n fieldErrors.forEach(fieldError => {\n const key = normalizeErrorKeyForForm(fieldError.field)\n setError(key as keyof PayScheduleInputs, { message: fieldError.message })\n })\n }\n }, [setError, fieldErrors])\n\n const allValues = watch()\n\n const formattedAnchorPayDate = allValues.anchorPayDate\n ? formatDateToStringDate(allValues.anchorPayDate) || ''\n : ''\n const formattedAnchorEndOfPayPeriod = allValues.anchorEndOfPayPeriod\n ? formatDateToStringDate(allValues.anchorEndOfPayPeriod) || ''\n : ''\n\n const { data: payPreviewData, isLoading } = usePaySchedulesGetPreview(\n {\n companyId,\n frequency: allValues.frequency,\n anchorPayDate: formattedAnchorPayDate,\n anchorEndOfPayPeriod: formattedAnchorEndOfPayPeriod,\n day1: allValues.day1 ?? undefined,\n day2: allValues.day2 ?? undefined,\n },\n {\n enabled: Boolean(\n allValues.anchorPayDate &&\n allValues.anchorEndOfPayPeriod &&\n (mode === 'ADD_PAY_SCHEDULE' || mode === 'EDIT_PAY_SCHEDULE'),\n ),\n },\n )\n\n // Set the custom_twice_per_month value based on the frequency and day_1 and day_2 values as it is not set by the API call\n useEffect(() => {\n if (\n allValues.frequency === 'Twice per month' &&\n allValues.day1 === 15 &&\n allValues.day2 === 31 &&\n allValues.customTwicePerMonth === undefined\n ) {\n setValue('customTwicePerMonth', `1st15th`)\n } else if (\n allValues.frequency === 'Twice per month' &&\n allValues.customTwicePerMonth === undefined\n ) {\n setValue('customTwicePerMonth', `custom`)\n }\n }, [allValues.frequency, allValues.day1, allValues.day2, setValue, allValues.customTwicePerMonth])\n\n const handleAdd = () => {\n setMode('ADD_PAY_SCHEDULE')\n reset({})\n }\n const handleCancel = () => {\n setMode('LIST_PAY_SCHEDULES')\n reset({})\n clearErrors()\n setBaseError(null)\n }\n const handleEdit = (schedule: PayScheduleType) => {\n reset({\n frequency: schedule.frequency as Frequency,\n anchorPayDate: schedule.anchorPayDate ? new Date(schedule.anchorPayDate) : undefined,\n anchorEndOfPayPeriod: schedule.anchorEndOfPayPeriod\n ? new Date(schedule.anchorEndOfPayPeriod)\n : undefined,\n day1: schedule.day1 ?? undefined,\n day2: schedule.day2 ?? undefined,\n customName: schedule.customName ?? '',\n })\n setCurrentPaySchedule(schedule)\n setMode('EDIT_PAY_SCHEDULE')\n }\n const handleContinue = () => {\n onEvent(componentEvents.PAY_SCHEDULE_DONE)\n }\n const onSubmit: SubmitHandler<PayScheduleOutputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n const formatPayloadDate = (date: Date | undefined): string => {\n return date ? formatDateToStringDate(date) || '' : ''\n }\n\n if (mode === 'ADD_PAY_SCHEDULE') {\n const createPayScheduleResponse = await createPayScheduleMutation.mutateAsync({\n request: {\n companyId,\n requestBody: {\n frequency: payload.frequency,\n anchorPayDate: formatPayloadDate(payload.anchorPayDate),\n anchorEndOfPayPeriod: formatPayloadDate(payload.anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1,\n day2: payload.day2,\n },\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_CREATED, createPayScheduleResponse)\n reset()\n } else if (mode === 'EDIT_PAY_SCHEDULE') {\n const version = currentPaySchedule?.version\n const updatePayScheduleResponse = await updatePayScheduleMutation.mutateAsync({\n request: {\n payScheduleId: currentPaySchedule?.uuid as string,\n companyId,\n requestBody: {\n frequency: payload.frequency,\n anchorPayDate: formatPayloadDate(payload.anchorPayDate),\n anchorEndOfPayPeriod: formatPayloadDate(payload.anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1,\n day2: payload.day2,\n version: version as string,\n },\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_UPDATED, updatePayScheduleResponse)\n reset()\n }\n setMode('LIST_PAY_SCHEDULES')\n })\n }\n\n return (\n <PayScheduleProvider\n value={{\n companyId,\n handleAdd,\n handleEdit,\n handleCancel,\n handleContinue,\n mode,\n isPending: createPayScheduleMutation.isPending || updatePayScheduleMutation.isPending,\n paySchedules: paySchedules.payScheduleList,\n payPeriodPreview: payPreviewData?.object?.payPeriods,\n payPreviewLoading: isLoading,\n currentPaySchedule,\n paymentSpeed,\n }}\n >\n <span data-testid=\"pay-schedule-edit-form\">\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Edit />\n <Actions />\n </Flex>\n )}\n </Form>\n </FormProvider>\n </span>\n </PayScheduleProvider>\n )\n}\n"],"names":["PaySchedule","companyId","defaultValues","dictionary","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","children","baseSubmitHandler","onEvent","error","setBaseError","useBase","paySchedules","usePaySchedulesGetAllSuspense","paymentConfigs","usePaymentConfigsGet","paymentSpeed","mode","setMode","useState","currentPaySchedule","setCurrentPaySchedule","transformedDefaultValues","createPayScheduleMutation","usePaySchedulesCreateMutation","updatePayScheduleMutation","usePaySchedulesUpdateMutation","formMethods","useForm","zodResolver","PayScheduleSchema","watch","setValue","reset","clearErrors","setError","fieldErrors","useEffect","fieldError","key","normalizeErrorKeyForForm","allValues","formattedAnchorPayDate","formatDateToStringDate","formattedAnchorEndOfPayPeriod","payPreviewData","isLoading","usePaySchedulesGetPreview","handleAdd","handleCancel","handleEdit","schedule","handleContinue","componentEvents","onSubmit","data","payload","formatPayloadDate","date","createPayScheduleResponse","version","updatePayScheduleResponse","PayScheduleProvider","FormProvider","Form","jsxs","Flex","Head","List","Edit","Actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAiCO,MAAMA,KAAc,CAAC;AAAA,EAC1B,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACL,OACEC,GAAQ,qBAAqB,GAC7BC,GAAuB,uBAAuBH,CAAU,GAEtD,gBAAAI,EAACC,IAAA,EAAe,GAAGJ,GACjB,UAAA,gBAAAG,EAACE,MAAK,WAAAR,GAAsB,eAAAC,GACzB,UAAAE,EAAM,SAAA,CACT,EAAA,CACF,IAIEK,KAAO,CAAC,EAAE,WAAAR,GAAW,UAAAS,GAAU,eAAAR,QAAsC;AACzE,QAAM,EAAE,mBAAAS,GAAmB,SAAAC,GAAS,OAAAC,GAAO,UAAUC,EAAA,IAAiBC,GAAA,GAEhE,EAAE,MAAMC,EAAA,IAAiBC,EAA8B;AAAA,IAC3D,WAAAhB;AAAA,EAAA,CACD,GAEK,EAAE,MAAMiB,EAAA,IAAmBC,EAAqB,EAAE,aAAalB,GAAW,GAC1EmB,IAAeF,GAAgB,gBAAgB,cAE/C,CAACG,GAAMC,CAAO,IAAIC;AAAA,IACtBP,EAAa,iBAAiB,WAAW,IAAI,qBAAqB;AAAA,EAAA,GAE9D,CAACQ,GAAoBC,CAAqB,IAAIF,EAAiC,IAAI,GACnFG,IAA8C;AAAA,IAClD,WAAWxB,GAAe,aAAa;AAAA,IACvC,eAAeA,GAAe,gBAAgB,IAAI,KAAKA,EAAc,aAAa,IAAI;AAAA,IACtF,sBAAsBA,GAAe,uBACjC,IAAI,KA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,UAAUrC,EAAY,aAAa2B,CAAQ,GAC9C,UAAAhD,KAGC,gBAAA2D,EAACC,IAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAA/D,EAACgE,IAAA,EAAK;AAAA,0BACLC,IAAA,EAAK;AAAA,0BACLC,IAAA,EAAK;AAAA,0BACLC,IAAA,CAAA,CAAQ;AAAA,MAAA,GACX,EAAA,CAEJ,GACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { jsxs as e, Fragment as
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { usePaySchedule as
|
|
1
|
+
import { jsxs as e, Fragment as l, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as m } from "react-i18next";
|
|
3
|
+
import { usePaySchedule as u } from "../usePaySchedule.js";
|
|
4
4
|
import "../../../../shared/constants.js";
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
import "classnames";
|
|
6
|
+
import { ActionsLayout as a } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
7
|
+
import { useComponentContext as h } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
|
+
const P = () => {
|
|
9
|
+
const { t: n } = m("Company.PaySchedule"), { mode: i, handleAdd: s, handleCancel: r, handleContinue: d, isPending: c } = u(), t = h();
|
|
10
|
+
return /* @__PURE__ */ e(l, { children: [
|
|
11
|
+
i === "LIST_PAY_SCHEDULES" && /* @__PURE__ */ e(a, { children: [
|
|
11
12
|
/* @__PURE__ */ o(
|
|
12
13
|
t.Button,
|
|
13
14
|
{
|
|
14
15
|
variant: "secondary",
|
|
15
16
|
onClick: () => {
|
|
16
|
-
|
|
17
|
+
s();
|
|
17
18
|
},
|
|
18
19
|
children: n("addAnotherPayScheduleCta")
|
|
19
20
|
}
|
|
@@ -23,13 +24,13 @@ const E = () => {
|
|
|
23
24
|
{
|
|
24
25
|
variant: "primary",
|
|
25
26
|
onClick: () => {
|
|
26
|
-
|
|
27
|
+
d();
|
|
27
28
|
},
|
|
28
29
|
children: n("continueCta")
|
|
29
30
|
}
|
|
30
31
|
)
|
|
31
32
|
] }),
|
|
32
|
-
|
|
33
|
+
i === "ADD_PAY_SCHEDULE" && /* @__PURE__ */ e(a, { children: [
|
|
33
34
|
/* @__PURE__ */ o(
|
|
34
35
|
t.Button,
|
|
35
36
|
{
|
|
@@ -40,9 +41,9 @@ const E = () => {
|
|
|
40
41
|
children: n("actions.cancel")
|
|
41
42
|
}
|
|
42
43
|
),
|
|
43
|
-
/* @__PURE__ */ o(t.Button, { type: "submit", children: n("actions.save") })
|
|
44
|
+
/* @__PURE__ */ o(t.Button, { type: "submit", isLoading: c, children: n("actions.save") })
|
|
44
45
|
] }),
|
|
45
|
-
|
|
46
|
+
i === "EDIT_PAY_SCHEDULE" && /* @__PURE__ */ e(a, { children: [
|
|
46
47
|
/* @__PURE__ */ o(
|
|
47
48
|
t.Button,
|
|
48
49
|
{
|
|
@@ -53,11 +54,11 @@ const E = () => {
|
|
|
53
54
|
children: n("actions.cancel")
|
|
54
55
|
}
|
|
55
56
|
),
|
|
56
|
-
/* @__PURE__ */ o(t.Button, { type: "submit", children: n("actions.save") })
|
|
57
|
+
/* @__PURE__ */ o(t.Button, { type: "submit", isLoading: c, children: n("actions.save") })
|
|
57
58
|
] })
|
|
58
59
|
] });
|
|
59
60
|
};
|
|
60
61
|
export {
|
|
61
|
-
|
|
62
|
+
P as Actions
|
|
62
63
|
};
|
|
63
64
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const { mode, handleAdd, handleCancel, handleContinue } = usePaySchedule()\n const Components = useComponentContext()\n\n return (\n <>\n {mode === 'LIST_PAY_SCHEDULES' && (\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleAdd()\n }}\n >\n {t('addAnotherPayScheduleCta')}\n </Components.Button>\n <Components.Button\n variant=\"primary\"\n onClick={() => {\n handleContinue()\n }}\n >\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )}\n {mode === 'ADD_PAY_SCHEDULE' && (\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleCancel()\n }}\n >\n {t('actions.cancel')}\n </Components.Button>\n <Components.Button type=\"submit\"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const { mode, handleAdd, handleCancel, handleContinue, isPending } = usePaySchedule()\n const Components = useComponentContext()\n\n return (\n <>\n {mode === 'LIST_PAY_SCHEDULES' && (\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleAdd()\n }}\n >\n {t('addAnotherPayScheduleCta')}\n </Components.Button>\n <Components.Button\n variant=\"primary\"\n onClick={() => {\n handleContinue()\n }}\n >\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )}\n {mode === 'ADD_PAY_SCHEDULE' && (\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleCancel()\n }}\n >\n {t('actions.cancel')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('actions.save')}\n </Components.Button>\n </ActionsLayout>\n )}\n {mode === 'EDIT_PAY_SCHEDULE' && (\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleCancel()\n }}\n >\n {t('actions.cancel')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('actions.save')}\n </Components.Button>\n </ActionsLayout>\n )}\n </>\n )\n}\n"],"names":["Actions","t","useTranslation","mode","handleAdd","handleCancel","handleContinue","isPending","usePaySchedule","Components","useComponentContext","jsxs","Fragment","ActionsLayout","jsx"],"mappings":";;;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,MAAAC,GAAM,WAAAC,GAAW,cAAAC,GAAc,gBAAAC,GAAgB,WAAAC,EAAA,IAAcC,EAAA,GAC/DC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAT,MAAS,0CACPU,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACb,YAAAL,EAAA;AAAA,UACF;AAAA,UAEC,YAAE,0BAA0B;AAAA,QAAA;AAAA,MAAA;AAAA,MAE/B,gBAAAU;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACb,YAAAH,EAAA;AAAA,UACF;AAAA,UAEC,YAAE,aAAa;AAAA,QAAA;AAAA,MAAA;AAAA,IAClB,GACF;AAAA,IAEDH,MAAS,sBACR,gBAAAQ,EAACE,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACb,YAAAJ,EAAA;AAAA,UACF;AAAA,UAEC,YAAE,gBAAgB;AAAA,QAAA;AAAA,MAAA;AAAA,MAErB,gBAAAS,EAACL,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