@gusto/embedded-react-sdk 0.41.0 → 0.42.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 +26 -0
- package/dist/assets/icons/house.svg.js +10 -0
- package/dist/assets/icons/house.svg.js.map +1 -0
- package/dist/components/Base/Base.js +2 -3
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/EmptyData/EmptyData.d.ts +3 -0
- package/dist/components/Common/EmptyData/EmptyData.js +11 -11
- package/dist/components/Common/EmptyData/EmptyData.js.map +1 -1
- package/dist/components/Common/EmptyData/EmptyData.module.scss.js +8 -6
- package/dist/components/Common/EmptyData/EmptyData.module.scss.js.map +1 -1
- package/dist/components/Common/UI/Input/InputTypes.d.ts +1 -1
- package/dist/components/Common/UI/Input/InputTypes.js.map +1 -1
- package/dist/components/Common/UI/TextInput/TextInput.js +37 -35
- package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
- package/dist/components/Common/UI/TextInput/TextInputTypes.d.ts +1 -1
- package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +6 -8
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -8
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -10
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +6 -7
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +2 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -8
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +5 -6
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +9 -10
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +2 -3
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +8 -9
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +7 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +10 -12
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +11 -13
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -5
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -7
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +8 -10
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.d.ts +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +9 -11
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +7 -9
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +7 -9
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +2 -3
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +5 -6
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +5 -7
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +6 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +10 -12
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +6 -8
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +4 -5
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +2 -4
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +6 -8
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +8 -10
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +6 -8
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingFlow/OnboardingFlow.js +11 -15
- package/dist/components/Company/OnboardingFlow/OnboardingFlow.js.map +1 -1
- package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js +37 -35
- package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +5 -6
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +5 -6
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -4
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +3 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleForm.js +87 -100
- package/dist/components/Company/PaySchedule/PayScheduleForm.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleForm.module.scss.js +8 -10
- package/dist/components/Company/PaySchedule/PayScheduleForm.module.scss.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleList.js +2 -3
- package/dist/components/Company/PaySchedule/PayScheduleList.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.d.ts +11 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +5 -7
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -8
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +5 -7
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +2 -4
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +6 -7
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +5 -6
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +2 -3
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +2 -3
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js +13 -16
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js.map +1 -1
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js +61 -63
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +4 -6
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +2 -3
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +2 -3
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +2 -3
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +2 -3
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlow.js +11 -11
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlow.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +88 -111
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +2 -3
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +13 -14
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +2 -3
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +2 -3
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +2 -3
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +2 -3
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +5 -6
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +14 -15
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +23 -25
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +2 -0
- package/dist/components/Employee/Dashboard/DashboardComponents.js +18 -6
- package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -1
- package/dist/components/Employee/Dashboard/dashboardStateMachine.d.ts +2 -0
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js +55 -4
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +2 -3
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +2 -3
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +2 -3
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +6 -7
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +2 -3
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +6 -8
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +9 -11
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +7 -8
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.d.ts +0 -33
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +130 -215
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +79 -58
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/fields.d.ts +2 -3
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/fields.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/index.d.ts +2 -2
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/signEmployeeFormSchema.d.ts +0 -1
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/signEmployeeFormSchema.js +33 -49
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/signEmployeeFormSchema.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/useSignEmployeeForm.d.ts +12 -3
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/useSignEmployeeForm.js.map +1 -1
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +2 -3
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js.map +1 -0
- package/dist/components/Employee/{employee-list → EmployeeList}/management/ManagementEmployeeListView.js +2 -3
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js.map +1 -0
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.js.map +1 -0
- package/dist/components/Employee/{employee-list → EmployeeList}/onboarding/EmployeeListView.js +34 -35
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.js.map +1 -0
- package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js.map +1 -0
- package/dist/components/Employee/FederalTaxes/Actions.js +6 -8
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +4 -6
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +3 -4
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddress.d.ts +6 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js +48 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js.map +1 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.d.ts +18 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js +476 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -0
- package/dist/components/Employee/HomeAddress/management/getPendingFutureHomeAddress.d.ts +8 -0
- package/dist/components/Employee/HomeAddress/management/getPendingFutureHomeAddress.js +36 -0
- package/dist/components/Employee/HomeAddress/management/getPendingFutureHomeAddress.js.map +1 -0
- package/dist/components/Employee/HomeAddress/management/getPendingFutureHomeAddress.test.d.ts +1 -0
- package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.d.ts +45 -0
- package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.js +112 -0
- package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.js.map +1 -0
- package/dist/components/Employee/Landing/Landing.js +6 -7
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Actions.js +7 -9
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +4 -5
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +6 -7
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +6 -7
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +25 -25
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -7
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/AdminProfile.js +42 -42
- package/dist/components/Employee/Profile/AdminProfile.js.map +1 -1
- package/dist/components/Employee/Profile/EmployeeProfile.js +40 -36
- package/dist/components/Employee/Profile/EmployeeProfile.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.js +37 -36
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/index.d.ts +2 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.d.ts +3 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.js +24 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.js.map +1 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.d.ts +9 -3
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js +97 -97
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/index.d.ts +2 -0
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.d.ts +3 -0
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.js +24 -0
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.js.map +1 -0
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.d.ts +10 -4
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js +95 -84
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js.map +1 -1
- package/dist/components/Employee/StateTaxes/Actions.js +8 -10
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +3 -4
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +8 -10
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +4 -6
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +3 -4
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +2 -3
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js +11 -9
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +8 -9
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js +71 -89
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +2 -3
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddress.d.ts +6 -0
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js +48 -0
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js.map +1 -0
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.d.ts +16 -0
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js +367 -0
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -0
- package/dist/components/Employee/WorkAddress/management/getPendingFutureWorkAddress.d.ts +4 -0
- package/dist/components/Employee/WorkAddress/management/getPendingFutureWorkAddress.js +35 -0
- package/dist/components/Employee/WorkAddress/management/getPendingFutureWorkAddress.js.map +1 -0
- package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.d.ts +45 -0
- package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.js +143 -0
- package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.js.map +1 -0
- package/dist/components/Employee/exports/employeeManagement.d.ts +3 -1
- package/dist/components/Employee/exports/employeeManagement.js +12 -10
- package/dist/components/Employee/exports/employeeManagement.js.map +1 -1
- package/dist/components/Employee/exports/employeeOnboarding.d.ts +1 -1
- package/dist/components/Employee/exports/employeeOnboarding.js +1 -1
- package/dist/components/Employee/index.d.ts +5 -1
- package/dist/components/Employee/index.js +37 -33
- package/dist/components/Employee/index.js.map +1 -1
- package/dist/components/Flow/Flow.js +23 -51
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/Flow/FlowHeader.d.ts +16 -0
- package/dist/components/Flow/FlowHeader.js +89 -0
- package/dist/components/Flow/FlowHeader.js.map +1 -0
- package/dist/components/Flow/useFlow.d.ts +33 -6
- package/dist/components/Flow/useFlow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +17 -18
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +7 -8
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +2 -3
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +0 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalFlow.js +20 -18
- package/dist/components/Payroll/Dismissal/DismissalFlow.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js +10 -10
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +8 -9
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.js +17 -19
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +2 -3
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js +13 -11
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +9 -9
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
- package/dist/components/Payroll/OffCycle/offCycleStateMachine.js +25 -29
- package/dist/components/Payroll/OffCycle/offCycleStateMachine.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +18 -19
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +10 -12
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +6 -8
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +2 -4
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +7 -8
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +2 -3
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +2 -3
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +4 -5
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js +43 -42
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +38 -42
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.js +18 -17
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +69 -78
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +2 -3
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +13 -12
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js +51 -82
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +12 -13
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +29 -30
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +2 -3
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +2 -3
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +45 -44
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +0 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +2 -3
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlow.js +17 -15
- package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js +24 -24
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -1
- package/dist/components/Payroll/Transition/transitionStateMachine.js +25 -29
- package/dist/components/Payroll/Transition/transitionStateMachine.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +2 -3
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +6 -7
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js +12 -13
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.js +2 -3
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js +2 -3
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js +22 -24
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +2 -3
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/shared/EmployeeTable/EmployeeTableTypes.d.ts +1 -0
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +10 -12
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/helpers/breadcrumbHelpers.d.ts +35 -22
- package/dist/helpers/breadcrumbHelpers.js +45 -35
- package/dist/helpers/breadcrumbHelpers.js.map +1 -1
- package/dist/helpers/dateFormatting.d.ts +12 -0
- package/dist/helpers/dateFormatting.js +72 -65
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/helpers/formattedStrings.d.ts +2 -0
- package/dist/helpers/formattedStrings.js +30 -27
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/i18n/I18n.js +130 -35
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Employee.HomeAddress.Management.json.js +60 -0
- package/dist/i18n/en/Employee.HomeAddress.Management.json.js.map +1 -0
- package/dist/i18n/en/Employee.HomeAddress.json.js +22 -20
- package/dist/i18n/en/Employee.HomeAddress.json.js.map +1 -1
- package/dist/i18n/en/Employee.I9SignatureForm.json.js +79 -75
- package/dist/i18n/en/Employee.I9SignatureForm.json.js.map +1 -1
- package/dist/i18n/en/Employee.PaymentMethod.json.js +13 -13
- package/dist/i18n/en/Employee.WorkAddress.Management.json.js +62 -0
- package/dist/i18n/en/Employee.WorkAddress.Management.json.js.map +1 -0
- package/dist/i18n/en/Payroll.RecoveryCasesList.json.js +14 -10
- package/dist/i18n/en/Payroll.RecoveryCasesList.json.js.map +1 -1
- package/dist/i18n/en/common.json.d.ts +1 -0
- package/dist/i18n/en/common.json.js +28 -26
- package/dist/i18n/en/common.json.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +72 -68
- package/dist/index.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js +15 -18
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.d.ts +4 -2
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.js +19 -13
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +21 -24
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js +15 -18
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SelectHookField.d.ts +5 -2
- package/dist/partner-hook-utils/form/fields/SelectHookField.js +29 -28
- package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js +16 -19
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js +22 -25
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js.map +1 -1
- package/dist/shared/constants.d.ts +4 -0
- package/dist/shared/constants.js +14 -12
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +89 -1
- package/docs/reference/endpoint-inventory.json +72 -8
- package/package.json +7 -7
- package/dist/_virtual/dynamic-import-helper.js +0 -17
- package/dist/_virtual/dynamic-import-helper.js.map +0 -1
- package/dist/components/Common/SignatureForm/SignatureForm.d.ts +0 -14
- package/dist/components/Common/SignatureForm/SignatureForm.js +0 -28
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +0 -1
- package/dist/components/Common/SignatureForm/SignatureForm.module.scss.js +0 -10
- package/dist/components/Common/SignatureForm/SignatureForm.module.scss.js.map +0 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.d.ts +0 -8
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +0 -22
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +0 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.d.ts +0 -9
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +0 -39
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +0 -1
- package/dist/components/Common/SignatureForm/index.d.ts +0 -5
- package/dist/components/Employee/DocumentSigner/SignatureForm/Actions.d.ts +0 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/Actions.js +0 -20
- package/dist/components/Employee/DocumentSigner/SignatureForm/Actions.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/Form.d.ts +0 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/Form.js +0 -20
- package/dist/components/Employee/DocumentSigner/SignatureForm/Form.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/Head.d.ts +0 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/Head.js +0 -35
- package/dist/components/Employee/DocumentSigner/SignatureForm/Head.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/Preview.d.ts +0 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/Preview.js +0 -20
- package/dist/components/Employee/DocumentSigner/SignatureForm/Preview.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.d.ts +0 -9
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +0 -21
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +0 -1
- package/dist/components/Employee/employee-list/management/ManagementEmployeeList.js.map +0 -1
- package/dist/components/Employee/employee-list/management/ManagementEmployeeListView.js.map +0 -1
- package/dist/components/Employee/employee-list/onboarding/EmployeeList.js.map +0 -1
- package/dist/components/Employee/employee-list/onboarding/EmployeeListView.js.map +0 -1
- package/dist/components/Employee/employee-list/shared/useEmployeeList.js.map +0 -1
- /package/dist/components/Employee/{employee-list → EmployeeList}/management/ManagementEmployeeList.d.ts +0 -0
- /package/dist/components/Employee/{employee-list → EmployeeList}/management/ManagementEmployeeList.js +0 -0
- /package/dist/components/Employee/{employee-list → EmployeeList}/management/ManagementEmployeeListView.d.ts +0 -0
- /package/dist/components/Employee/{employee-list → EmployeeList}/onboarding/EmployeeList.d.ts +0 -0
- /package/dist/components/Employee/{employee-list → EmployeeList}/onboarding/EmployeeList.js +0 -0
- /package/dist/components/Employee/{employee-list → EmployeeList}/onboarding/EmployeeListView.d.ts +0 -0
- /package/dist/components/Employee/{employee-list → EmployeeList}/shared/index.d.ts +0 -0
- /package/dist/components/Employee/{employee-list → EmployeeList}/shared/useEmployeeList.d.ts +0 -0
- /package/dist/components/Employee/{employee-list → EmployeeList}/shared/useEmployeeList.js +0 -0
|
@@ -7,20 +7,18 @@ import { ApiProvider as C } from "../ApiProvider/ApiProvider.js";
|
|
|
7
7
|
import { LoadingIndicatorProvider as I } from "../LoadingIndicatorProvider/LoadingIndicatorProvider.js";
|
|
8
8
|
import { sanitizeError as L } from "../ObservabilityProvider/sanitization.js";
|
|
9
9
|
import { SDKI18next as m } from "./SDKI18next.js";
|
|
10
|
-
import "../../shared/constants.js";
|
|
11
|
-
import "classnames";
|
|
12
10
|
import { InternalError as x } from "../../components/Common/InternalError/InternalError.js";
|
|
13
11
|
import { LocaleProvider as z } from "../LocaleProvider/LocaleProvider.js";
|
|
14
12
|
import "../LocaleProvider/useLocale.js";
|
|
15
13
|
import { ThemeProvider as D } from "../ThemeProvider/ThemeProvider.js";
|
|
16
14
|
import { normalizeToSDKError as U } from "../../types/sdkError.js";
|
|
17
15
|
import { ObservabilityProvider as T } from "../ObservabilityProvider/ObservabilityProvider.js";
|
|
18
|
-
const
|
|
16
|
+
const V = (s) => {
|
|
19
17
|
const {
|
|
20
18
|
children: l,
|
|
21
19
|
config: r,
|
|
22
20
|
dictionary: i,
|
|
23
|
-
lng:
|
|
21
|
+
lng: n = "en",
|
|
24
22
|
locale: c = "en-US",
|
|
25
23
|
currency: d = "USD",
|
|
26
24
|
theme: p,
|
|
@@ -29,8 +27,8 @@ const X = (s) => {
|
|
|
29
27
|
queryClient: b
|
|
30
28
|
} = s;
|
|
31
29
|
if (i)
|
|
32
|
-
for (const
|
|
33
|
-
const e =
|
|
30
|
+
for (const t in i) {
|
|
31
|
+
const e = t;
|
|
34
32
|
for (const a in i[e])
|
|
35
33
|
m.addResourceBundle(
|
|
36
34
|
e,
|
|
@@ -41,14 +39,14 @@ const X = (s) => {
|
|
|
41
39
|
);
|
|
42
40
|
}
|
|
43
41
|
P(() => {
|
|
44
|
-
(async () => await m.changeLanguage(
|
|
45
|
-
}, [
|
|
42
|
+
(async () => await m.changeLanguage(n))();
|
|
43
|
+
}, [n]);
|
|
46
44
|
const u = k(() => {
|
|
47
45
|
if (r.observability?.onError)
|
|
48
|
-
return (
|
|
46
|
+
return (t, e) => {
|
|
49
47
|
if (!r.observability?.onError) return;
|
|
50
48
|
const h = {
|
|
51
|
-
...U(
|
|
49
|
+
...U(t),
|
|
52
50
|
timestamp: Date.now(),
|
|
53
51
|
componentStack: e.componentStack ?? void 0
|
|
54
52
|
}, y = L(h, r.observability.sanitization);
|
|
@@ -64,9 +62,9 @@ const X = (s) => {
|
|
|
64
62
|
queryClient: b,
|
|
65
63
|
children: l
|
|
66
64
|
}
|
|
67
|
-
) },
|
|
65
|
+
) }, n) }) }) }) }) }) });
|
|
68
66
|
};
|
|
69
67
|
export {
|
|
70
|
-
|
|
68
|
+
V as GustoProviderCustomUIAdapter
|
|
71
69
|
};
|
|
72
70
|
//# sourceMappingURL=GustoProviderCustomUIAdapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GustoProviderCustomUIAdapter.js","sources":["../../../src/contexts/GustoProvider/GustoProviderCustomUIAdapter.tsx"],"sourcesContent":["import type React from 'react'\nimport type { ErrorInfo } from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { I18nextProvider } from 'react-i18next'\nimport type { QueryClient } from '@tanstack/react-query'\nimport { useEffect, useMemo } from 'react'\nimport { ComponentsProvider } from '../ComponentAdapter/ComponentsProvider'\nimport type { ComponentsContextType } from '../ComponentAdapter/useComponentContext'\nimport { ApiProvider } from '../ApiProvider/ApiProvider'\nimport { LoadingIndicatorProvider } from '../LoadingIndicatorProvider/LoadingIndicatorProvider'\nimport type { LoadingIndicatorContextProps } from '../LoadingIndicatorProvider/useLoadingIndicator'\nimport { ObservabilityProvider } from '../ObservabilityProvider'\nimport { sanitizeError } from '../ObservabilityProvider/sanitization'\nimport { SDKI18next } from './SDKI18next'\nimport { InternalError } from '@/components/Common'\nimport { LocaleProvider } from '@/contexts/LocaleProvider'\nimport { ThemeProvider } from '@/contexts/ThemeProvider'\nimport type { GustoSDKTheme } from '@/contexts/ThemeProvider/theme'\nimport type { ResourceDictionary, SupportedLanguages } from '@/types/Helpers'\nimport type { SDKHooks } from '@/types/hooks'\nimport type { ObservabilityHook } from '@/types/observability'\nimport { normalizeToSDKError } from '@/types/sdkError'\n\nexport interface APIConfig {\n baseUrl: string\n headers?: HeadersInit\n hooks?: SDKHooks\n observability?: ObservabilityHook\n}\n\nexport interface GustoProviderProps {\n config: APIConfig\n dictionary?: ResourceDictionary\n lng?: string\n locale?: string\n currency?: string\n theme?: GustoSDKTheme\n queryClient?: QueryClient\n components: ComponentsContextType\n LoaderComponent?: LoadingIndicatorContextProps['LoadingIndicator']\n}\n\nexport interface GustoProviderCustomUIAdapterProps extends GustoProviderProps {\n children?: React.ReactNode\n}\n\n/**\n * A provider that accepts UI component adapters through the components prop\n */\nconst GustoProviderCustomUIAdapter: React.FC<GustoProviderCustomUIAdapterProps> = props => {\n const {\n children,\n config,\n dictionary,\n lng = 'en',\n locale = 'en-US',\n currency = 'USD',\n theme,\n components,\n LoaderComponent,\n queryClient,\n } = props\n\n if (dictionary) {\n for (const language in dictionary) {\n const lang = language as SupportedLanguages\n for (const ns in dictionary[lang]) {\n SDKI18next.addResourceBundle(\n lang,\n ns,\n (dictionary[lang] as Record<string, unknown>)[ns],\n true,\n true,\n )\n }\n }\n }\n\n useEffect(() => {\n void (async () => {\n await SDKI18next.changeLanguage(lng)\n })()\n }, [lng])\n\n const handleTopLevelError = useMemo(() => {\n if (!config.observability?.onError) return undefined\n\n return (error: unknown, errorInfo: ErrorInfo) => {\n if (!config.observability?.onError) return\n\n const sdkError = normalizeToSDKError(error)\n\n const observabilityError = {\n ...sdkError,\n timestamp: Date.now(),\n componentStack: errorInfo.componentStack ?? undefined,\n }\n\n const sanitizedError = sanitizeError(observabilityError, config.observability.sanitization)\n\n config.observability.onError(sanitizedError)\n }\n }, [config.observability])\n return (\n <ComponentsProvider value={components}>\n <LoadingIndicatorProvider value={LoaderComponent}>\n <ObservabilityProvider observability={config.observability}>\n <ErrorBoundary FallbackComponent={InternalError} onError={handleTopLevelError}>\n <ThemeProvider theme={theme}>\n <LocaleProvider locale={locale} currency={currency}>\n <I18nextProvider i18n={SDKI18next} key={lng}>\n <ApiProvider\n url={config.baseUrl}\n headers={config.headers}\n hooks={config.hooks}\n queryClient={queryClient}\n >\n {children}\n </ApiProvider>\n </I18nextProvider>\n </LocaleProvider>\n </ThemeProvider>\n </ErrorBoundary>\n </ObservabilityProvider>\n </LoadingIndicatorProvider>\n </ComponentsProvider>\n )\n}\n\nexport { GustoProviderCustomUIAdapter }\n"],"names":["GustoProviderCustomUIAdapter","props","children","config","dictionary","lng","locale","currency","theme","components","LoaderComponent","queryClient","language","lang","ns","SDKI18next","useEffect","handleTopLevelError","useMemo","error","errorInfo","observabilityError","normalizeToSDKError","sanitizedError","sanitizeError","jsx","ComponentsProvider","LoadingIndicatorProvider","ObservabilityProvider","ErrorBoundary","InternalError","ThemeProvider","LocaleProvider","I18nextProvider","ApiProvider"],"mappings":"
|
|
1
|
+
{"version":3,"file":"GustoProviderCustomUIAdapter.js","sources":["../../../src/contexts/GustoProvider/GustoProviderCustomUIAdapter.tsx"],"sourcesContent":["import type React from 'react'\nimport type { ErrorInfo } from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { I18nextProvider } from 'react-i18next'\nimport type { QueryClient } from '@tanstack/react-query'\nimport { useEffect, useMemo } from 'react'\nimport { ComponentsProvider } from '../ComponentAdapter/ComponentsProvider'\nimport type { ComponentsContextType } from '../ComponentAdapter/useComponentContext'\nimport { ApiProvider } from '../ApiProvider/ApiProvider'\nimport { LoadingIndicatorProvider } from '../LoadingIndicatorProvider/LoadingIndicatorProvider'\nimport type { LoadingIndicatorContextProps } from '../LoadingIndicatorProvider/useLoadingIndicator'\nimport { ObservabilityProvider } from '../ObservabilityProvider'\nimport { sanitizeError } from '../ObservabilityProvider/sanitization'\nimport { SDKI18next } from './SDKI18next'\nimport { InternalError } from '@/components/Common'\nimport { LocaleProvider } from '@/contexts/LocaleProvider'\nimport { ThemeProvider } from '@/contexts/ThemeProvider'\nimport type { GustoSDKTheme } from '@/contexts/ThemeProvider/theme'\nimport type { ResourceDictionary, SupportedLanguages } from '@/types/Helpers'\nimport type { SDKHooks } from '@/types/hooks'\nimport type { ObservabilityHook } from '@/types/observability'\nimport { normalizeToSDKError } from '@/types/sdkError'\n\nexport interface APIConfig {\n baseUrl: string\n headers?: HeadersInit\n hooks?: SDKHooks\n observability?: ObservabilityHook\n}\n\nexport interface GustoProviderProps {\n config: APIConfig\n dictionary?: ResourceDictionary\n lng?: string\n locale?: string\n currency?: string\n theme?: GustoSDKTheme\n queryClient?: QueryClient\n components: ComponentsContextType\n LoaderComponent?: LoadingIndicatorContextProps['LoadingIndicator']\n}\n\nexport interface GustoProviderCustomUIAdapterProps extends GustoProviderProps {\n children?: React.ReactNode\n}\n\n/**\n * A provider that accepts UI component adapters through the components prop\n */\nconst GustoProviderCustomUIAdapter: React.FC<GustoProviderCustomUIAdapterProps> = props => {\n const {\n children,\n config,\n dictionary,\n lng = 'en',\n locale = 'en-US',\n currency = 'USD',\n theme,\n components,\n LoaderComponent,\n queryClient,\n } = props\n\n if (dictionary) {\n for (const language in dictionary) {\n const lang = language as SupportedLanguages\n for (const ns in dictionary[lang]) {\n SDKI18next.addResourceBundle(\n lang,\n ns,\n (dictionary[lang] as Record<string, unknown>)[ns],\n true,\n true,\n )\n }\n }\n }\n\n useEffect(() => {\n void (async () => {\n await SDKI18next.changeLanguage(lng)\n })()\n }, [lng])\n\n const handleTopLevelError = useMemo(() => {\n if (!config.observability?.onError) return undefined\n\n return (error: unknown, errorInfo: ErrorInfo) => {\n if (!config.observability?.onError) return\n\n const sdkError = normalizeToSDKError(error)\n\n const observabilityError = {\n ...sdkError,\n timestamp: Date.now(),\n componentStack: errorInfo.componentStack ?? undefined,\n }\n\n const sanitizedError = sanitizeError(observabilityError, config.observability.sanitization)\n\n config.observability.onError(sanitizedError)\n }\n }, [config.observability])\n return (\n <ComponentsProvider value={components}>\n <LoadingIndicatorProvider value={LoaderComponent}>\n <ObservabilityProvider observability={config.observability}>\n <ErrorBoundary FallbackComponent={InternalError} onError={handleTopLevelError}>\n <ThemeProvider theme={theme}>\n <LocaleProvider locale={locale} currency={currency}>\n <I18nextProvider i18n={SDKI18next} key={lng}>\n <ApiProvider\n url={config.baseUrl}\n headers={config.headers}\n hooks={config.hooks}\n queryClient={queryClient}\n >\n {children}\n </ApiProvider>\n </I18nextProvider>\n </LocaleProvider>\n </ThemeProvider>\n </ErrorBoundary>\n </ObservabilityProvider>\n </LoadingIndicatorProvider>\n </ComponentsProvider>\n )\n}\n\nexport { GustoProviderCustomUIAdapter }\n"],"names":["GustoProviderCustomUIAdapter","props","children","config","dictionary","lng","locale","currency","theme","components","LoaderComponent","queryClient","language","lang","ns","SDKI18next","useEffect","handleTopLevelError","useMemo","error","errorInfo","observabilityError","normalizeToSDKError","sanitizedError","sanitizeError","jsx","ComponentsProvider","LoadingIndicatorProvider","ObservabilityProvider","ErrorBoundary","InternalError","ThemeProvider","LocaleProvider","I18nextProvider","ApiProvider"],"mappings":";;;;;;;;;;;;;;;AAiDA,MAAMA,IAA4E,CAAAC,MAAS;AACzF,QAAM;AAAA,IACJ,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,QAAAC,IAAS;AAAA,IACT,UAAAC,IAAW;AAAA,IACX,OAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,EAAA,IACEV;AAEJ,MAAIG;AACF,eAAWQ,KAAYR,GAAY;AACjC,YAAMS,IAAOD;AACb,iBAAWE,KAAMV,EAAWS,CAAI;AAC9B,QAAAE,EAAW;AAAA,UACTF;AAAA,UACAC;AAAA,UACCV,EAAWS,CAAI,EAA8BC,CAAE;AAAA,UAChD;AAAA,UACA;AAAA,QAAA;AAAA,IAGN;AAGF,EAAAE,EAAU,MAAM;AACd,KAAM,YACJ,MAAMD,EAAW,eAAeV,CAAG;AAAA,EAEvC,GAAG,CAACA,CAAG,CAAC;AAER,QAAMY,IAAsBC,EAAQ,MAAM;AACxC,QAAKf,EAAO,eAAe;AAE3B,aAAO,CAACgB,GAAgBC,MAAyB;AAC/C,YAAI,CAACjB,EAAO,eAAe,QAAS;AAIpC,cAAMkB,IAAqB;AAAA,UACzB,GAHeC,EAAoBH,CAAK;AAAA,UAIxC,WAAW,KAAK,IAAA;AAAA,UAChB,gBAAgBC,EAAU,kBAAkB;AAAA,QAAA,GAGxCG,IAAiBC,EAAcH,GAAoBlB,EAAO,cAAc,YAAY;AAE1F,QAAAA,EAAO,cAAc,QAAQoB,CAAc;AAAA,MAC7C;AAAA,EACF,GAAG,CAACpB,EAAO,aAAa,CAAC;AACzB,SACE,gBAAAsB,EAACC,GAAA,EAAmB,OAAOjB,GACzB,UAAA,gBAAAgB,EAACE,GAAA,EAAyB,OAAOjB,GAC/B,UAAA,gBAAAe,EAACG,GAAA,EAAsB,eAAezB,EAAO,eAC3C,UAAA,gBAAAsB,EAACI,GAAA,EAAc,mBAAmBC,GAAe,SAASb,GACxD,UAAA,gBAAAQ,EAACM,GAAA,EAAc,OAAAvB,GACb,UAAA,gBAAAiB,EAACO,GAAA,EAAe,QAAA1B,GAAgB,UAAAC,GAC9B,UAAA,gBAAAkB,EAACQ,GAAA,EAAgB,MAAMlB,GACrB,UAAA,gBAAAU;AAAA,IAACS;AAAA,IAAA;AAAA,MACC,KAAK/B,EAAO;AAAA,MACZ,SAASA,EAAO;AAAA,MAChB,OAAOA,EAAO;AAAA,MACd,aAAAQ;AAAA,MAEC,UAAAT;AAAA,IAAA;AAAA,EAAA,KAPmCG,CASxC,GACF,GACF,EAAA,CACF,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { BreadcrumbNodes, BreadcrumbTrail } from '../components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes';
|
|
2
|
+
import { FlowHeaderConfig } from '../components/Flow/useFlow';
|
|
3
|
+
type BreadcrumbsHeader = Extract<FlowHeaderConfig, {
|
|
4
|
+
type: 'breadcrumbs';
|
|
5
|
+
}>;
|
|
6
|
+
type WithHeader = {
|
|
7
|
+
header?: FlowHeaderConfig | null;
|
|
8
|
+
};
|
|
2
9
|
/**
|
|
3
10
|
* Builds a complete breadcrumb trail map from a hierarchical node structure.
|
|
4
11
|
*
|
|
@@ -16,32 +23,38 @@ export declare const buildBreadcrumbs: (nodes: BreadcrumbNodes) => BreadcrumbTra
|
|
|
16
23
|
*/
|
|
17
24
|
export declare const resolveBreadcrumbVariables: (variables: Record<string, string> | undefined, context: Record<string, unknown>) => Record<string, unknown>;
|
|
18
25
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
26
|
+
* Merges `patch` fields into the existing breadcrumbs header on a context,
|
|
27
|
+
* preserving the existing trails and CTA. If the context has no breadcrumbs
|
|
28
|
+
* header, a fresh one is created. Useful when a transition needs to flip
|
|
29
|
+
* breadcrumbs visibility (`currentBreadcrumbId`) without rebuilding any
|
|
30
|
+
* trails.
|
|
31
|
+
*/
|
|
32
|
+
export declare const patchBreadcrumbsHeader: <T extends WithHeader>(context: T, patch: Partial<Omit<BreadcrumbsHeader, "type">>) => T & {
|
|
33
|
+
header: BreadcrumbsHeader;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Removes a breadcrumb from all trails in the context's breadcrumbs header.
|
|
37
|
+
* Use this in state machine reducers to hide a step entirely (e.g. after
|
|
38
|
+
* payroll submission).
|
|
21
39
|
*/
|
|
22
|
-
export declare const hideBreadcrumb: <T extends
|
|
23
|
-
breadcrumbs?: BreadcrumbTrail;
|
|
24
|
-
}>(breadcrumbId: string, context: T) => T;
|
|
40
|
+
export declare const hideBreadcrumb: <T extends WithHeader>(breadcrumbId: string, context: T) => T;
|
|
25
41
|
/**
|
|
26
|
-
* Marks a breadcrumb as non-navigable across all trails in the context
|
|
27
|
-
* Use this in state machine reducers to disable backward
|
|
42
|
+
* Marks a breadcrumb as non-navigable across all trails in the context's
|
|
43
|
+
* breadcrumbs header. Use this in state machine reducers to disable backward
|
|
44
|
+
* navigation to a specific step.
|
|
28
45
|
*/
|
|
29
|
-
export declare const lockBreadcrumb: <T extends
|
|
30
|
-
breadcrumbs?: BreadcrumbTrail;
|
|
31
|
-
}>(breadcrumbId: string, context: T) => T;
|
|
46
|
+
export declare const lockBreadcrumb: <T extends WithHeader>(breadcrumbId: string, context: T) => T;
|
|
32
47
|
/**
|
|
33
|
-
* Updates the breadcrumb trail for a specific state with resolved variables
|
|
48
|
+
* Updates the breadcrumb trail for a specific state with resolved variables
|
|
49
|
+
* and switches the active breadcrumb to that state.
|
|
34
50
|
*
|
|
35
|
-
* This function is typically used in state machine transitions to update
|
|
36
|
-
* navigation when moving between states. It preserves all existing
|
|
37
|
-
* for other states and only updates the trail for the
|
|
38
|
-
* any template variables for that state's
|
|
39
|
-
|
|
51
|
+
* This function is typically used in state machine transitions to update
|
|
52
|
+
* breadcrumb navigation when moving between states. It preserves all existing
|
|
53
|
+
* breadcrumb trails for other states and only updates the trail for the
|
|
54
|
+
* specified state by resolving any template variables for that state's
|
|
55
|
+
* breadcrumb. The resulting context's header is always of type `'breadcrumbs'`.
|
|
40
56
|
*/
|
|
41
|
-
export declare const updateBreadcrumbs: <T extends {
|
|
42
|
-
|
|
43
|
-
currentBreadcrumb?: string;
|
|
44
|
-
}>(stateName: string, context: T, variables?: Record<string, string>) => Omit<T, "breadcrumbs" | "currentBreadcrumb"> & {
|
|
45
|
-
breadcrumbs: BreadcrumbTrail;
|
|
46
|
-
currentBreadcrumbId: string;
|
|
57
|
+
export declare const updateBreadcrumbs: <T extends WithHeader>(stateName: string, context: T, variables?: Record<string, string>) => T & {
|
|
58
|
+
header: BreadcrumbsHeader;
|
|
47
59
|
};
|
|
60
|
+
export {};
|
|
@@ -1,55 +1,65 @@
|
|
|
1
|
-
const o = (r) => {
|
|
1
|
+
const u = (r) => r?.type === "breadcrumbs" ? r : { type: "breadcrumbs" }, o = (r) => {
|
|
2
2
|
const e = {};
|
|
3
|
-
for (const [
|
|
4
|
-
const
|
|
5
|
-
let
|
|
6
|
-
for (;
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
3
|
+
for (const [t, a] of Object.entries(r)) {
|
|
4
|
+
const c = [];
|
|
5
|
+
let s = a;
|
|
6
|
+
for (; s; ) {
|
|
7
|
+
c.unshift(s.item);
|
|
8
|
+
const n = s.parent;
|
|
9
|
+
s = n ? r[n] ?? null : null;
|
|
10
10
|
}
|
|
11
|
-
e[
|
|
11
|
+
e[t] = c;
|
|
12
12
|
}
|
|
13
13
|
return e;
|
|
14
|
-
},
|
|
14
|
+
}, b = (r, e) => {
|
|
15
15
|
if (!r)
|
|
16
16
|
return {};
|
|
17
|
-
const
|
|
18
|
-
for (const [
|
|
19
|
-
const
|
|
20
|
-
if (
|
|
21
|
-
const
|
|
22
|
-
|
|
17
|
+
const t = {};
|
|
18
|
+
for (const [a, c] of Object.entries(r)) {
|
|
19
|
+
const s = c.match(/{{(.*?)}}/);
|
|
20
|
+
if (s?.[1]) {
|
|
21
|
+
const n = s[1].trim();
|
|
22
|
+
t[a] = e[n] ?? "";
|
|
23
23
|
} else
|
|
24
|
-
|
|
24
|
+
t[a] = c;
|
|
25
25
|
}
|
|
26
|
-
return
|
|
27
|
-
},
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
return t;
|
|
27
|
+
}, m = (r, e) => {
|
|
28
|
+
const t = u(r.header);
|
|
29
|
+
return { ...r, header: { ...t, ...e } };
|
|
30
|
+
}, i = (r, e) => {
|
|
31
|
+
const t = u(e.header), a = t.breadcrumbs ?? {}, c = Object.fromEntries(
|
|
32
|
+
Object.entries(a).map(([s, n]) => [
|
|
33
|
+
s,
|
|
34
|
+
n.filter((d) => d.id !== r)
|
|
32
35
|
])
|
|
33
36
|
);
|
|
34
|
-
return {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
return {
|
|
38
|
+
...e,
|
|
39
|
+
header: { ...t, breadcrumbs: c }
|
|
40
|
+
};
|
|
41
|
+
}, l = (r, e, t) => {
|
|
42
|
+
const a = u(e.header), c = a.breadcrumbs ?? {}, n = (c[r] ?? []).map((d) => ({
|
|
43
|
+
...d,
|
|
44
|
+
variables: b(t, e)
|
|
39
45
|
}));
|
|
40
46
|
return {
|
|
41
47
|
...e,
|
|
42
|
-
|
|
43
|
-
...
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
48
|
+
header: {
|
|
49
|
+
...a,
|
|
50
|
+
breadcrumbs: {
|
|
51
|
+
...c,
|
|
52
|
+
[r]: n
|
|
53
|
+
},
|
|
54
|
+
currentBreadcrumbId: r
|
|
55
|
+
}
|
|
47
56
|
};
|
|
48
57
|
};
|
|
49
58
|
export {
|
|
50
59
|
o as buildBreadcrumbs,
|
|
51
|
-
|
|
52
|
-
|
|
60
|
+
i as hideBreadcrumb,
|
|
61
|
+
m as patchBreadcrumbsHeader,
|
|
62
|
+
b as resolveBreadcrumbVariables,
|
|
53
63
|
l as updateBreadcrumbs
|
|
54
64
|
};
|
|
55
65
|
//# sourceMappingURL=breadcrumbHelpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumbHelpers.js","sources":["../../src/helpers/breadcrumbHelpers.ts"],"sourcesContent":["import type {\n BreadcrumbNode,\n BreadcrumbNodes,\n BreadcrumbTrail,\n FlowBreadcrumb,\n} from '@/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes'\n\n/**\n * Builds a complete breadcrumb trail map from a hierarchical node structure.\n *\n * Takes a tree structure of breadcrumb nodes and generates a map where each state\n * has its complete breadcrumb trail from root to that state. This is useful for\n * initializing breadcrumb navigation in state machines or multi-step flows.\n */\nexport const buildBreadcrumbs = (nodes: BreadcrumbNodes): BreadcrumbTrail => {\n const map: Record<string, FlowBreadcrumb[]> = {}\n\n for (const [state, node] of Object.entries(nodes)) {\n const trail: FlowBreadcrumb[] = []\n let current: BreadcrumbNode | null = node\n\n while (current) {\n trail.unshift(current.item)\n const parentKey: string | null = current.parent\n current = parentKey ? (nodes[parentKey] ?? null) : null\n }\n\n map[state] = trail\n }\n\n return map\n}\n\n/**\n * Resolves template variables in breadcrumb labels using values from a context object.\n *\n * Supports Handlebars-style template syntax ({{variableName}}) for dynamic breadcrumb labels.\n * Variables enclosed in double braces are replaced with their corresponding values from the context.\n * Non-template strings are returned as-is.\n */\nexport const resolveBreadcrumbVariables = (\n variables: Record<string, string> | undefined,\n context: Record<string, unknown>,\n): Record<string, unknown> => {\n if (!variables) {\n return {}\n }\n\n const resolved: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(variables)) {\n const match = value.match(/{{(.*?)}}/)\n if (match?.[1]) {\n const ctxKey = match[1].trim()\n resolved[key] = context[ctxKey] ?? ''\n } else {\n resolved[key] = value\n }\n }\n return resolved\n}\n\n/**\n * Removes a breadcrumb from all trails in the context.\n * Use this in state machine reducers to hide a step entirely (e.g. after payroll submission).\n */\nexport const hideBreadcrumb = <T extends
|
|
1
|
+
{"version":3,"file":"breadcrumbHelpers.js","sources":["../../src/helpers/breadcrumbHelpers.ts"],"sourcesContent":["import type {\n BreadcrumbNode,\n BreadcrumbNodes,\n BreadcrumbTrail,\n FlowBreadcrumb,\n} from '@/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes'\nimport type { FlowHeaderConfig } from '@/components/Flow/useFlow'\n\ntype BreadcrumbsHeader = Extract<FlowHeaderConfig, { type: 'breadcrumbs' }>\n\ntype WithHeader = { header?: FlowHeaderConfig | null }\n\n/**\n * Returns the existing breadcrumbs header from a context, defaulting to a\n * blank breadcrumbs config when the header is missing or of a different\n * variant. Helpers below use this so callers don't need to manually narrow\n * the discriminated `header` union before mutating breadcrumb data.\n */\nconst getBreadcrumbsHeader = (header: FlowHeaderConfig | null | undefined): BreadcrumbsHeader => {\n if (header?.type === 'breadcrumbs') return header\n return { type: 'breadcrumbs' }\n}\n\n/**\n * Builds a complete breadcrumb trail map from a hierarchical node structure.\n *\n * Takes a tree structure of breadcrumb nodes and generates a map where each state\n * has its complete breadcrumb trail from root to that state. This is useful for\n * initializing breadcrumb navigation in state machines or multi-step flows.\n */\nexport const buildBreadcrumbs = (nodes: BreadcrumbNodes): BreadcrumbTrail => {\n const map: Record<string, FlowBreadcrumb[]> = {}\n\n for (const [state, node] of Object.entries(nodes)) {\n const trail: FlowBreadcrumb[] = []\n let current: BreadcrumbNode | null = node\n\n while (current) {\n trail.unshift(current.item)\n const parentKey: string | null = current.parent\n current = parentKey ? (nodes[parentKey] ?? null) : null\n }\n\n map[state] = trail\n }\n\n return map\n}\n\n/**\n * Resolves template variables in breadcrumb labels using values from a context object.\n *\n * Supports Handlebars-style template syntax ({{variableName}}) for dynamic breadcrumb labels.\n * Variables enclosed in double braces are replaced with their corresponding values from the context.\n * Non-template strings are returned as-is.\n */\nexport const resolveBreadcrumbVariables = (\n variables: Record<string, string> | undefined,\n context: Record<string, unknown>,\n): Record<string, unknown> => {\n if (!variables) {\n return {}\n }\n\n const resolved: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(variables)) {\n const match = value.match(/{{(.*?)}}/)\n if (match?.[1]) {\n const ctxKey = match[1].trim()\n resolved[key] = context[ctxKey] ?? ''\n } else {\n resolved[key] = value\n }\n }\n return resolved\n}\n\n/**\n * Merges `patch` fields into the existing breadcrumbs header on a context,\n * preserving the existing trails and CTA. If the context has no breadcrumbs\n * header, a fresh one is created. Useful when a transition needs to flip\n * breadcrumbs visibility (`currentBreadcrumbId`) without rebuilding any\n * trails.\n */\nexport const patchBreadcrumbsHeader = <T extends WithHeader>(\n context: T,\n patch: Partial<Omit<BreadcrumbsHeader, 'type'>>,\n): T & { header: BreadcrumbsHeader } => {\n const existing = getBreadcrumbsHeader(context.header)\n return { ...context, header: { ...existing, ...patch } }\n}\n\n/**\n * Removes a breadcrumb from all trails in the context's breadcrumbs header.\n * Use this in state machine reducers to hide a step entirely (e.g. after\n * payroll submission).\n */\nexport const hideBreadcrumb = <T extends WithHeader>(breadcrumbId: string, context: T): T => {\n const breadcrumbsHeader = getBreadcrumbsHeader(context.header)\n const allBreadcrumbs = breadcrumbsHeader.breadcrumbs ?? {}\n const updatedBreadcrumbs = Object.fromEntries(\n Object.entries(allBreadcrumbs).map(([stateKey, trail]) => [\n stateKey,\n trail.filter(b => b.id !== breadcrumbId),\n ]),\n )\n return {\n ...context,\n header: { ...breadcrumbsHeader, breadcrumbs: updatedBreadcrumbs },\n }\n}\n\n/**\n * Marks a breadcrumb as non-navigable across all trails in the context's\n * breadcrumbs header. Use this in state machine reducers to disable backward\n * navigation to a specific step.\n */\nexport const lockBreadcrumb = <T extends WithHeader>(breadcrumbId: string, context: T): T => {\n const breadcrumbsHeader = getBreadcrumbsHeader(context.header)\n const allBreadcrumbs = breadcrumbsHeader.breadcrumbs ?? {}\n const updatedBreadcrumbs = Object.fromEntries(\n Object.entries(allBreadcrumbs).map(([stateKey, trail]) => [\n stateKey,\n trail.map(b => (b.id === breadcrumbId ? { ...b, isNavigable: false } : b)),\n ]),\n )\n return {\n ...context,\n header: { ...breadcrumbsHeader, breadcrumbs: updatedBreadcrumbs },\n }\n}\n\n/**\n * Updates the breadcrumb trail for a specific state with resolved variables\n * and switches the active breadcrumb to that state.\n *\n * This function is typically used in state machine transitions to update\n * breadcrumb navigation when moving between states. It preserves all existing\n * breadcrumb trails for other states and only updates the trail for the\n * specified state by resolving any template variables for that state's\n * breadcrumb. The resulting context's header is always of type `'breadcrumbs'`.\n */\nexport const updateBreadcrumbs = <T extends WithHeader>(\n stateName: string,\n context: T,\n variables?: Record<string, string>,\n): T & { header: BreadcrumbsHeader } => {\n const breadcrumbsHeader = getBreadcrumbsHeader(context.header)\n const allBreadcrumbs = breadcrumbsHeader.breadcrumbs ?? {}\n const trail = allBreadcrumbs[stateName] ?? []\n const resolvedTrail = trail.map(breadcrumb => ({\n ...breadcrumb,\n variables: resolveBreadcrumbVariables(variables, context as Record<string, unknown>),\n }))\n return {\n ...context,\n header: {\n ...breadcrumbsHeader,\n breadcrumbs: {\n ...allBreadcrumbs,\n [stateName]: resolvedTrail,\n },\n currentBreadcrumbId: stateName,\n },\n }\n}\n"],"names":["getBreadcrumbsHeader","header","buildBreadcrumbs","nodes","map","state","node","trail","current","parentKey","resolveBreadcrumbVariables","variables","context","resolved","key","value","match","ctxKey","patchBreadcrumbsHeader","patch","existing","hideBreadcrumb","breadcrumbId","breadcrumbsHeader","allBreadcrumbs","updatedBreadcrumbs","stateKey","b","updateBreadcrumbs","stateName","resolvedTrail","breadcrumb"],"mappings":"AAkBA,MAAMA,IAAuB,CAACC,MACxBA,GAAQ,SAAS,gBAAsBA,IACpC,EAAE,MAAM,cAAA,GAUJC,IAAmB,CAACC,MAA4C;AAC3E,QAAMC,IAAwC,CAAA;AAE9C,aAAW,CAACC,GAAOC,CAAI,KAAK,OAAO,QAAQH,CAAK,GAAG;AACjD,UAAMI,IAA0B,CAAA;AAChC,QAAIC,IAAiCF;AAErC,WAAOE,KAAS;AACd,MAAAD,EAAM,QAAQC,EAAQ,IAAI;AAC1B,YAAMC,IAA2BD,EAAQ;AACzC,MAAAA,IAAUC,IAAaN,EAAMM,CAAS,KAAK,OAAQ;AAAA,IACrD;AAEA,IAAAL,EAAIC,CAAK,IAAIE;AAAA,EACf;AAEA,SAAOH;AACT,GASaM,IAA6B,CACxCC,GACAC,MAC4B;AAC5B,MAAI,CAACD;AACH,WAAO,CAAA;AAGT,QAAME,IAAoC,CAAA;AAC1C,aAAW,CAACC,GAAKC,CAAK,KAAK,OAAO,QAAQJ,CAAS,GAAG;AACpD,UAAMK,IAAQD,EAAM,MAAM,WAAW;AACrC,QAAIC,IAAQ,CAAC,GAAG;AACd,YAAMC,IAASD,EAAM,CAAC,EAAE,KAAA;AACxB,MAAAH,EAASC,CAAG,IAAIF,EAAQK,CAAM,KAAK;AAAA,IACrC;AACE,MAAAJ,EAASC,CAAG,IAAIC;AAAA,EAEpB;AACA,SAAOF;AACT,GASaK,IAAyB,CACpCN,GACAO,MACsC;AACtC,QAAMC,IAAWpB,EAAqBY,EAAQ,MAAM;AACpD,SAAO,EAAE,GAAGA,GAAS,QAAQ,EAAE,GAAGQ,GAAU,GAAGD,IAAM;AACvD,GAOaE,IAAiB,CAAuBC,GAAsBV,MAAkB;AAC3F,QAAMW,IAAoBvB,EAAqBY,EAAQ,MAAM,GACvDY,IAAiBD,EAAkB,eAAe,CAAA,GAClDE,IAAqB,OAAO;AAAA,IAChC,OAAO,QAAQD,CAAc,EAAE,IAAI,CAAC,CAACE,GAAUnB,CAAK,MAAM;AAAA,MACxDmB;AAAA,MACAnB,EAAM,OAAO,CAAAoB,MAAKA,EAAE,OAAOL,CAAY;AAAA,IAAA,CACxC;AAAA,EAAA;AAEH,SAAO;AAAA,IACL,GAAGV;AAAA,IACH,QAAQ,EAAE,GAAGW,GAAmB,aAAaE,EAAA;AAAA,EAAmB;AAEpE,GAgCaG,IAAoB,CAC/BC,GACAjB,GACAD,MACsC;AACtC,QAAMY,IAAoBvB,EAAqBY,EAAQ,MAAM,GACvDY,IAAiBD,EAAkB,eAAe,CAAA,GAElDO,KADQN,EAAeK,CAAS,KAAK,CAAA,GACf,IAAI,CAAAE,OAAe;AAAA,IAC7C,GAAGA;AAAA,IACH,WAAWrB,EAA2BC,GAAWC,CAAkC;AAAA,EAAA,EACnF;AACF,SAAO;AAAA,IACL,GAAGA;AAAA,IACH,QAAQ;AAAA,MACN,GAAGW;AAAA,MACH,aAAa;AAAA,QACX,GAAGC;AAAA,QACH,CAACK,CAAS,GAAGC;AAAA,MAAA;AAAA,MAEf,qBAAqBD;AAAA,IAAA;AAAA,EACvB;AAEJ;"}
|
|
@@ -23,6 +23,18 @@ export declare const formatPayPeriodRange: (startDateInput?: string | Date | nul
|
|
|
23
23
|
useShortMonth?: boolean;
|
|
24
24
|
}) => string;
|
|
25
25
|
export declare const formatDateToStringDate: (date: Date) => string | null;
|
|
26
|
+
/**
|
|
27
|
+
* Converts any parseable date string to a `YYYY-MM-DD` ISO string using local
|
|
28
|
+
* time, so the calendar date is preserved regardless of the runtime timezone.
|
|
29
|
+
*
|
|
30
|
+
* Unlike `formatDateToStringDate` (which reads UTC), this function reads the
|
|
31
|
+
* local year/month/day — safe for dates parsed from locale-format strings
|
|
32
|
+
* (e.g. "4/16/1998") or ISO strings, both of which `normalizeToDate` lands at
|
|
33
|
+
* local midnight.
|
|
34
|
+
*
|
|
35
|
+
* Returns `''` for null, undefined, empty, or unparseable input.
|
|
36
|
+
*/
|
|
37
|
+
export declare const normalizeToISOString: (value?: string | null) => string;
|
|
26
38
|
/**
|
|
27
39
|
* Normalizes Date to local midnight, handling timezone issues from any adapter.
|
|
28
40
|
*/
|
|
@@ -2,136 +2,143 @@ const s = (t) => {
|
|
|
2
2
|
if (!t) return null;
|
|
3
3
|
if (typeof t == "string") {
|
|
4
4
|
if (/^\d{4}-\d{2}-\d{2}$/.test(t)) {
|
|
5
|
-
const
|
|
6
|
-
if (
|
|
7
|
-
const r =
|
|
5
|
+
const n = t.split("-");
|
|
6
|
+
if (n.length !== 3) return null;
|
|
7
|
+
const r = n.map(Number), o = r[0], i = r[1], a = r[2];
|
|
8
8
|
return o === void 0 || i === void 0 || a === void 0 || isNaN(o) || isNaN(i) || isNaN(a) || i < 1 || i > 12 || a < 1 || a > 31 ? null : new Date(o, i - 1, a);
|
|
9
9
|
}
|
|
10
|
-
const
|
|
11
|
-
return isNaN(
|
|
10
|
+
const e = new Date(t);
|
|
11
|
+
return isNaN(e.getTime()) ? null : e;
|
|
12
12
|
}
|
|
13
13
|
return t instanceof Date ? isNaN(t.getTime()) ? null : t : null;
|
|
14
|
-
},
|
|
15
|
-
const r = s(
|
|
16
|
-
return r ? r.toLocaleDateString(
|
|
17
|
-
},
|
|
14
|
+
}, u = (t) => (e, n) => {
|
|
15
|
+
const r = s(e);
|
|
16
|
+
return r ? r.toLocaleDateString(n, t) : "";
|
|
17
|
+
}, g = u({
|
|
18
18
|
weekday: "short",
|
|
19
19
|
month: "short",
|
|
20
20
|
day: "numeric"
|
|
21
|
-
}),
|
|
21
|
+
}), h = u({
|
|
22
22
|
weekday: "short",
|
|
23
23
|
month: "short",
|
|
24
24
|
day: "numeric",
|
|
25
25
|
year: "numeric"
|
|
26
|
-
}), y =
|
|
26
|
+
}), y = u({
|
|
27
27
|
month: "short",
|
|
28
28
|
day: "numeric"
|
|
29
|
-
}), S =
|
|
29
|
+
}), S = u({
|
|
30
30
|
month: "short",
|
|
31
31
|
day: "numeric",
|
|
32
32
|
year: "numeric"
|
|
33
|
-
}), N =
|
|
33
|
+
}), N = u({
|
|
34
34
|
month: "long",
|
|
35
35
|
day: "numeric"
|
|
36
|
-
}), T =
|
|
36
|
+
}), T = u({
|
|
37
37
|
month: "long",
|
|
38
38
|
day: "numeric",
|
|
39
39
|
year: "numeric"
|
|
40
|
-
}), w = (t,
|
|
41
|
-
const
|
|
42
|
-
if (!
|
|
43
|
-
const r =
|
|
40
|
+
}), w = (t, e) => {
|
|
41
|
+
const n = s(t);
|
|
42
|
+
if (!n) return { time: "", date: "" };
|
|
43
|
+
const r = n.toLocaleTimeString(e, {
|
|
44
44
|
hour: "numeric",
|
|
45
45
|
minute: "2-digit",
|
|
46
46
|
hour12: !0,
|
|
47
47
|
timeZoneName: "short"
|
|
48
|
-
}), o =
|
|
48
|
+
}), o = n.toLocaleDateString(e, {
|
|
49
49
|
weekday: "short",
|
|
50
50
|
month: "short",
|
|
51
51
|
day: "numeric"
|
|
52
52
|
});
|
|
53
53
|
return { time: r, date: o };
|
|
54
|
-
}, L = (t,
|
|
55
|
-
const r = s(t), o = s(
|
|
54
|
+
}, L = (t, e, n) => {
|
|
55
|
+
const r = s(t), o = s(e);
|
|
56
56
|
if (!r || !o)
|
|
57
57
|
return { startDate: "", endDate: "" };
|
|
58
|
-
const i = r.toLocaleDateString(
|
|
58
|
+
const i = r.toLocaleDateString(n, {
|
|
59
59
|
month: "long",
|
|
60
60
|
day: "numeric"
|
|
61
|
-
}), a = o.toLocaleDateString(
|
|
61
|
+
}), a = o.toLocaleDateString(n, {
|
|
62
62
|
month: "short",
|
|
63
63
|
day: "numeric",
|
|
64
64
|
year: "numeric"
|
|
65
65
|
});
|
|
66
66
|
return { startDate: i, endDate: a };
|
|
67
|
-
}, M = (t,
|
|
68
|
-
const o = s(t), i = s(
|
|
67
|
+
}, M = (t, e, n, r) => {
|
|
68
|
+
const o = s(t), i = s(e);
|
|
69
69
|
if (!o || !i) return "";
|
|
70
|
-
const a = r?.useShortMonth ? "short" : "long", c = o.toLocaleDateString(
|
|
70
|
+
const a = r?.useShortMonth ? "short" : "long", c = o.toLocaleDateString(n, {
|
|
71
71
|
month: a,
|
|
72
72
|
day: "numeric"
|
|
73
|
-
}), l = i.toLocaleDateString(
|
|
73
|
+
}), l = i.toLocaleDateString(n, {
|
|
74
74
|
month: a,
|
|
75
75
|
day: "numeric",
|
|
76
76
|
year: "numeric"
|
|
77
77
|
});
|
|
78
78
|
return `${c}–${l}`;
|
|
79
|
-
},
|
|
79
|
+
}, p = (t) => isNaN(t.getTime()) ? null : t.toISOString().split("T")[0] || null, W = (t) => {
|
|
80
|
+
if (!t) return "";
|
|
81
|
+
const e = s(t);
|
|
82
|
+
if (!e) return "";
|
|
83
|
+
const n = e.getFullYear(), r = String(e.getMonth() + 1).padStart(2, "0"), o = String(e.getDate()).padStart(2, "0");
|
|
84
|
+
return `${n}-${r}-${o}`;
|
|
85
|
+
}, $ = (t) => {
|
|
80
86
|
if (!t || isNaN(t.getTime()))
|
|
81
87
|
return null;
|
|
82
|
-
const
|
|
83
|
-
if (!
|
|
84
|
-
const r =
|
|
88
|
+
const e = t.toISOString(), [n] = e.split("T");
|
|
89
|
+
if (!n) return null;
|
|
90
|
+
const r = n.split("-");
|
|
85
91
|
if (r.length !== 3) return null;
|
|
86
92
|
const o = r.map(Number), i = o[0], a = o[1], c = o[2];
|
|
87
93
|
return isNaN(i) || isNaN(a) || isNaN(c) || a < 1 || a > 12 || c < 1 || c > 31 ? null : new Date(i, a - 1, c);
|
|
88
|
-
},
|
|
89
|
-
const
|
|
90
|
-
if (!
|
|
91
|
-
const
|
|
92
|
-
return (
|
|
93
|
-
},
|
|
94
|
-
const
|
|
95
|
-
if (!
|
|
96
|
-
const
|
|
97
|
-
return (
|
|
94
|
+
}, m = 1e3 * 60 * 60, d = m * 24, F = (t) => {
|
|
95
|
+
const e = s(t);
|
|
96
|
+
if (!e) return null;
|
|
97
|
+
const n = /* @__PURE__ */ new Date();
|
|
98
|
+
return (e.getTime() - n.getTime()) / m;
|
|
99
|
+
}, P = (t) => {
|
|
100
|
+
const e = s(t);
|
|
101
|
+
if (!e) return null;
|
|
102
|
+
const n = /* @__PURE__ */ new Date();
|
|
103
|
+
return (e.getTime() - n.getTime()) / d;
|
|
98
104
|
}, D = (t) => {
|
|
99
|
-
const
|
|
100
|
-
return
|
|
101
|
-
}, f = (t,
|
|
102
|
-
const
|
|
103
|
-
return
|
|
104
|
-
},
|
|
105
|
-
let
|
|
106
|
-
|
|
105
|
+
const e = t.getDay();
|
|
106
|
+
return e === 0 || e === 6;
|
|
107
|
+
}, f = (t, e) => {
|
|
108
|
+
const n = new Date(t);
|
|
109
|
+
return n.setDate(n.getDate() + e), n;
|
|
110
|
+
}, k = (t, e) => {
|
|
111
|
+
let n = new Date(t);
|
|
112
|
+
n.setHours(0, 0, 0, 0);
|
|
107
113
|
let r = 0;
|
|
108
|
-
for (; r <
|
|
109
|
-
|
|
110
|
-
return
|
|
114
|
+
for (; r < e; )
|
|
115
|
+
n = f(n, 1), D(n) || r++;
|
|
116
|
+
return n;
|
|
111
117
|
};
|
|
112
|
-
function
|
|
113
|
-
if (!(t == null ||
|
|
114
|
-
return `${String(t).padStart(2, "0")}-${String(
|
|
118
|
+
function Y(t, e) {
|
|
119
|
+
if (!(t == null || e == null))
|
|
120
|
+
return `${String(t).padStart(2, "0")}-${String(e).padStart(2, "0")}`;
|
|
115
121
|
}
|
|
116
122
|
export {
|
|
117
|
-
|
|
118
|
-
|
|
123
|
+
m as MS_PER_HOUR,
|
|
124
|
+
k as addBusinessDays,
|
|
119
125
|
f as addDays,
|
|
120
126
|
N as formatDateLong,
|
|
121
127
|
T as formatDateLongWithYear,
|
|
122
128
|
y as formatDateShort,
|
|
123
|
-
|
|
124
|
-
|
|
129
|
+
g as formatDateShortWithWeekday,
|
|
130
|
+
h as formatDateShortWithWeekdayAndYear,
|
|
125
131
|
S as formatDateShortWithYear,
|
|
126
|
-
|
|
132
|
+
p as formatDateToStringDate,
|
|
127
133
|
w as formatDateWithTime,
|
|
128
|
-
|
|
134
|
+
Y as formatMonthDay,
|
|
129
135
|
L as formatPayPeriod,
|
|
130
136
|
M as formatPayPeriodRange,
|
|
131
|
-
|
|
132
|
-
|
|
137
|
+
P as getDaysUntil,
|
|
138
|
+
F as getHoursUntil,
|
|
133
139
|
D as isWeekend,
|
|
134
|
-
|
|
135
|
-
s as normalizeToDate
|
|
140
|
+
$ as normalizeDateToLocal,
|
|
141
|
+
s as normalizeToDate,
|
|
142
|
+
W as normalizeToISOString
|
|
136
143
|
};
|
|
137
144
|
//# sourceMappingURL=dateFormatting.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateFormatting.js","sources":["../../src/helpers/dateFormatting.ts"],"sourcesContent":["/**\n * Normalizes any date input (string, Date, or undefined) to a Date object.\n * Handles YYYY-MM-DD strings by parsing them in local timezone to avoid timezone issues.\n * Also handles ISO timestamp strings for compatibility.\n * Returns null for invalid inputs.\n */\nexport const normalizeToDate = (dateInput?: string | Date | null): Date | null => {\n if (!dateInput) return null\n\n if (typeof dateInput === 'string') {\n if (/^\\d{4}-\\d{2}-\\d{2}$/.test(dateInput)) {\n const parts = dateInput.split('-')\n if (parts.length !== 3) return null\n\n const numbers = parts.map(Number)\n const year = numbers[0]\n const month = numbers[1]\n const day = numbers[2]\n if (year === undefined || month === undefined || day === undefined) {\n return null\n }\n\n if (\n isNaN(year) ||\n isNaN(month) ||\n isNaN(day) ||\n month < 1 ||\n month > 12 ||\n day < 1 ||\n day > 31\n ) {\n return null\n }\n\n return new Date(year, month - 1, day)\n }\n\n const parsedDate = new Date(dateInput)\n return isNaN(parsedDate.getTime()) ? null : parsedDate\n }\n\n if (dateInput instanceof Date) {\n return isNaN(dateInput.getTime()) ? null : dateInput\n }\n\n return null\n}\n\n/**\n * Creates a date formatter function that handles both string and Date inputs.\n */\nconst createDateFormatter =\n (options: Intl.DateTimeFormatOptions) =>\n (dateInput?: string | Date | null, locale?: string): string => {\n const date = normalizeToDate(dateInput)\n if (!date) return ''\n return date.toLocaleDateString(locale, options)\n }\n\nexport const formatDateShortWithWeekday = createDateFormatter({\n weekday: 'short',\n month: 'short',\n day: 'numeric',\n})\n\nexport const formatDateShortWithWeekdayAndYear = createDateFormatter({\n weekday: 'short',\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n})\n\nexport const formatDateShort = createDateFormatter({\n month: 'short',\n day: 'numeric',\n})\n\nexport const formatDateShortWithYear = createDateFormatter({\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n})\n\nexport const formatDateLong = createDateFormatter({\n month: 'long',\n day: 'numeric',\n})\n\nexport const formatDateLongWithYear = createDateFormatter({\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n})\n\nexport const formatDateWithTime = (\n dateInput?: string | Date | null,\n locale?: string,\n): { time: string; date: string } => {\n const date = normalizeToDate(dateInput)\n if (!date) return { time: '', date: '' }\n\n const time = date.toLocaleTimeString(locale, {\n hour: 'numeric',\n minute: '2-digit',\n hour12: true,\n timeZoneName: 'short',\n })\n\n const dateString = date.toLocaleDateString(locale, {\n weekday: 'short',\n month: 'short',\n day: 'numeric',\n })\n\n return { time, date: dateString }\n}\n\nexport const formatPayPeriod = (\n startDateInput?: string | Date | null,\n endDateInput?: string | Date | null,\n locale?: string,\n): { startDate: string; endDate: string } => {\n const startDate = normalizeToDate(startDateInput)\n const endDate = normalizeToDate(endDateInput)\n\n if (!startDate || !endDate) {\n return { startDate: '', endDate: '' }\n }\n\n const startFormatted = startDate.toLocaleDateString(locale, {\n month: 'long',\n day: 'numeric',\n })\n\n const endFormatted = endDate.toLocaleDateString(locale, {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n })\n\n return { startDate: startFormatted, endDate: endFormatted }\n}\n\nexport const formatPayPeriodRange = (\n startDateInput?: string | Date | null,\n endDateInput?: string | Date | null,\n locale?: string,\n options?: { useShortMonth?: boolean },\n): string => {\n const startDate = normalizeToDate(startDateInput)\n const endDate = normalizeToDate(endDateInput)\n\n if (!startDate || !endDate) return ''\n\n const monthFormat = options?.useShortMonth ? 'short' : 'long'\n\n const startFormatted = startDate.toLocaleDateString(locale, {\n month: monthFormat,\n day: 'numeric',\n })\n\n const endFormatted = endDate.toLocaleDateString(locale, {\n month: monthFormat,\n day: 'numeric',\n year: 'numeric',\n })\n\n return `${startFormatted}–${endFormatted}`\n}\n\nexport const formatDateToStringDate = (date: Date): string | null => {\n if (isNaN(date.getTime())) {\n return null\n }\n return date.toISOString().split('T')[0] || null\n}\n\n/**\n * Normalizes Date to local midnight, handling timezone issues from any adapter.\n */\nexport const normalizeDateToLocal = (date: Date | null): Date | null => {\n if (!date || isNaN(date.getTime())) {\n return null\n }\n\n const isoString = date.toISOString()\n const [datePart] = isoString.split('T')\n if (!datePart) return null\n\n const parts = datePart.split('-')\n if (parts.length !== 3) return null\n const numbers = parts.map(Number)\n const year = numbers[0]!\n const month = numbers[1]!\n const day = numbers[2]!\n if (isNaN(year) || isNaN(month) || isNaN(day) || month < 1 || month > 12 || day < 1 || day > 31) {\n return null\n }\n\n return new Date(year, month - 1, day)\n}\n\nexport const MS_PER_HOUR = 1000 * 60 * 60\nconst MS_PER_DAY = MS_PER_HOUR * 24\n\nexport const getHoursUntil = (deadline?: Date | string | null): number | null => {\n const deadlineDate = normalizeToDate(deadline)\n if (!deadlineDate) return null\n\n const now = new Date()\n const timeDiffMs = deadlineDate.getTime() - now.getTime()\n return timeDiffMs / MS_PER_HOUR\n}\n\nexport const getDaysUntil = (deadline?: Date | string | null): number | null => {\n const deadlineDate = normalizeToDate(deadline)\n if (!deadlineDate) return null\n\n const now = new Date()\n const timeDiffMs = deadlineDate.getTime() - now.getTime()\n return timeDiffMs / MS_PER_DAY\n}\n\nexport const isWeekend = (date: Date): boolean => {\n const day = date.getDay()\n return day === 0 || day === 6\n}\n\nexport const addDays = (date: Date, days: number): Date => {\n const result = new Date(date)\n result.setDate(result.getDate() + days)\n return result\n}\n\nexport const addBusinessDays = (startDate: Date, businessDays: number): Date => {\n let currentDate = new Date(startDate)\n currentDate.setHours(0, 0, 0, 0)\n let daysAdded = 0\n\n while (daysAdded < businessDays) {\n currentDate = addDays(currentDate, 1)\n if (!isWeekend(currentDate)) {\n daysAdded++\n }\n }\n\n return currentDate\n}\n\n/** Formats numeric month and day as a zero-padded `MM-DD` string. */\nexport function formatMonthDay(month?: number, day?: number): string | undefined {\n if (month == null || day == null) return undefined\n return `${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`\n}\n"],"names":["normalizeToDate","dateInput","parts","numbers","year","month","day","parsedDate","createDateFormatter","options","locale","date","formatDateShortWithWeekday","formatDateShortWithWeekdayAndYear","formatDateShort","formatDateShortWithYear","formatDateLong","formatDateLongWithYear","formatDateWithTime","time","dateString","formatPayPeriod","startDateInput","endDateInput","startDate","endDate","startFormatted","endFormatted","formatPayPeriodRange","monthFormat","formatDateToStringDate","normalizeDateToLocal","isoString","datePart","MS_PER_HOUR","MS_PER_DAY","getHoursUntil","deadline","deadlineDate","now","getDaysUntil","isWeekend","addDays","days","result","addBusinessDays","businessDays","currentDate","daysAdded","formatMonthDay"],"mappings":"AAMO,MAAMA,IAAkB,CAACC,MAAkD;AAChF,MAAI,CAACA,EAAW,QAAO;AAEvB,MAAI,OAAOA,KAAc,UAAU;AACjC,QAAI,sBAAsB,KAAKA,CAAS,GAAG;AACzC,YAAMC,IAAQD,EAAU,MAAM,GAAG;AACjC,UAAIC,EAAM,WAAW,E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AAQ;AAC9B,GAEaoC,IAAU,CAAC/B,GAAYgC,MAAuB;AACzD,QAAMC,IAAS,IAAI,KAAKjC,CAAI;AAC5B,SAAAiC,EAAO,QAAQA,EAAO,QAAA,IAAYD,CAAI,GAC/BC;AACT,GAEaC,IAAkB,CAACrB,GAAiBsB,MAA+B;AAC9E,MAAIC,IAAc,IAAI,KAAKvB,CAAS;AACpC,EAAAuB,EAAY,SAAS,GAAG,GAAG,GAAG,CAAC;AAC/B,MAAIC,IAAY;AAEhB,SAAOA,IAAYF;AACjB,IAAAC,IAAcL,EAAQK,GAAa,CAAC,GAC/BN,EAAUM,CAAW,KACxBC;AAIJ,SAAOD;AACT;AAGO,SAASE,EAAe5C,GAAgBC,GAAkC;AAC/E,MAAI,EAAAD,KAAS,QAAQC,KAAO;AAC5B,WAAO,GAAG,OAAOD,CAAK,EAAE,SAAS,GAAG,GAAG,CAAC,IAAI,OAAOC,CAAG,EAAE,SAAS,GAAG,GAAG,CAAC;AAC1E;"}
|
|
1
|
+
{"version":3,"file":"dateFormatting.js","sources":["../../src/helpers/dateFormatting.ts"],"sourcesContent":["/**\n * Normalizes any date input (string, Date, or undefined) to a Date object.\n * Handles YYYY-MM-DD strings by parsing them in local timezone to avoid timezone issues.\n * Also handles ISO timestamp strings for compatibility.\n * Returns null for invalid inputs.\n */\nexport const normalizeToDate = (dateInput?: string | Date | null): Date | null => {\n if (!dateInput) return null\n\n if (typeof dateInput === 'string') {\n if (/^\\d{4}-\\d{2}-\\d{2}$/.test(dateInput)) {\n const parts = dateInput.split('-')\n if (parts.length !== 3) return null\n\n const numbers = parts.map(Number)\n const year = numbers[0]\n const month = numbers[1]\n const day = numbers[2]\n if (year === undefined || month === undefined || day === undefined) {\n return null\n }\n\n if (\n isNaN(year) ||\n isNaN(month) ||\n isNaN(day) ||\n month < 1 ||\n month > 12 ||\n day < 1 ||\n day > 31\n ) {\n return null\n }\n\n return new Date(year, month - 1, day)\n }\n\n const parsedDate = new Date(dateInput)\n return isNaN(parsedDate.getTime()) ? null : parsedDate\n }\n\n if (dateInput instanceof Date) {\n return isNaN(dateInput.getTime()) ? null : dateInput\n }\n\n return null\n}\n\n/**\n * Creates a date formatter function that handles both string and Date inputs.\n */\nconst createDateFormatter =\n (options: Intl.DateTimeFormatOptions) =>\n (dateInput?: string | Date | null, locale?: string): string => {\n const date = normalizeToDate(dateInput)\n if (!date) return ''\n return date.toLocaleDateString(locale, options)\n }\n\nexport const formatDateShortWithWeekday = createDateFormatter({\n weekday: 'short',\n month: 'short',\n day: 'numeric',\n})\n\nexport const formatDateShortWithWeekdayAndYear = createDateFormatter({\n weekday: 'short',\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n})\n\nexport const formatDateShort = createDateFormatter({\n month: 'short',\n day: 'numeric',\n})\n\nexport const formatDateShortWithYear = createDateFormatter({\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n})\n\nexport const formatDateLong = createDateFormatter({\n month: 'long',\n day: 'numeric',\n})\n\nexport const formatDateLongWithYear = createDateFormatter({\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n})\n\nexport const formatDateWithTime = (\n dateInput?: string | Date | null,\n locale?: string,\n): { time: string; date: string } => {\n const date = normalizeToDate(dateInput)\n if (!date) return { time: '', date: '' }\n\n const time = date.toLocaleTimeString(locale, {\n hour: 'numeric',\n minute: '2-digit',\n hour12: true,\n timeZoneName: 'short',\n })\n\n const dateString = date.toLocaleDateString(locale, {\n weekday: 'short',\n month: 'short',\n day: 'numeric',\n })\n\n return { time, date: dateString }\n}\n\nexport const formatPayPeriod = (\n startDateInput?: string | Date | null,\n endDateInput?: string | Date | null,\n locale?: string,\n): { startDate: string; endDate: string } => {\n const startDate = normalizeToDate(startDateInput)\n const endDate = normalizeToDate(endDateInput)\n\n if (!startDate || !endDate) {\n return { startDate: '', endDate: '' }\n }\n\n const startFormatted = startDate.toLocaleDateString(locale, {\n month: 'long',\n day: 'numeric',\n })\n\n const endFormatted = endDate.toLocaleDateString(locale, {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n })\n\n return { startDate: startFormatted, endDate: endFormatted }\n}\n\nexport const formatPayPeriodRange = (\n startDateInput?: string | Date | null,\n endDateInput?: string | Date | null,\n locale?: string,\n options?: { useShortMonth?: boolean },\n): string => {\n const startDate = normalizeToDate(startDateInput)\n const endDate = normalizeToDate(endDateInput)\n\n if (!startDate || !endDate) return ''\n\n const monthFormat = options?.useShortMonth ? 'short' : 'long'\n\n const startFormatted = startDate.toLocaleDateString(locale, {\n month: monthFormat,\n day: 'numeric',\n })\n\n const endFormatted = endDate.toLocaleDateString(locale, {\n month: monthFormat,\n day: 'numeric',\n year: 'numeric',\n })\n\n return `${startFormatted}–${endFormatted}`\n}\n\nexport const formatDateToStringDate = (date: Date): string | null => {\n if (isNaN(date.getTime())) {\n return null\n }\n return date.toISOString().split('T')[0] || null\n}\n\n/**\n * Converts any parseable date string to a `YYYY-MM-DD` ISO string using local\n * time, so the calendar date is preserved regardless of the runtime timezone.\n *\n * Unlike `formatDateToStringDate` (which reads UTC), this function reads the\n * local year/month/day — safe for dates parsed from locale-format strings\n * (e.g. \"4/16/1998\") or ISO strings, both of which `normalizeToDate` lands at\n * local midnight.\n *\n * Returns `''` for null, undefined, empty, or unparseable input.\n */\nexport const normalizeToISOString = (value?: string | null): string => {\n if (!value) return ''\n const date = normalizeToDate(value)\n if (!date) return ''\n const year = date.getFullYear()\n const month = String(date.getMonth() + 1).padStart(2, '0')\n const day = String(date.getDate()).padStart(2, '0')\n return `${year}-${month}-${day}`\n}\n\n/**\n * Normalizes Date to local midnight, handling timezone issues from any adapter.\n */\nexport const normalizeDateToLocal = (date: Date | null): Date | null => {\n if (!date || isNaN(date.getTime())) {\n return null\n }\n\n const isoString = date.toISOString()\n const [datePart] = isoString.split('T')\n if (!datePart) return null\n\n const parts = datePart.split('-')\n if (parts.length !== 3) return null\n const numbers = parts.map(Number)\n const year = numbers[0]!\n const month = numbers[1]!\n const day = numbers[2]!\n if (isNaN(year) || isNaN(month) || isNaN(day) || month < 1 || month > 12 || day < 1 || day > 31) {\n return null\n }\n\n return new Date(year, month - 1, day)\n}\n\nexport const MS_PER_HOUR = 1000 * 60 * 60\nconst MS_PER_DAY = MS_PER_HOUR * 24\n\nexport const getHoursUntil = (deadline?: Date | string | null): number | null => {\n const deadlineDate = normalizeToDate(deadline)\n if (!deadlineDate) return null\n\n const now = new Date()\n const timeDiffMs = deadlineDate.getTime() - now.getTime()\n return timeDiffMs / MS_PER_HOUR\n}\n\nexport const getDaysUntil = (deadline?: Date | string | null): number | null => {\n const deadlineDate = normalizeToDate(deadline)\n if (!deadlineDate) return null\n\n const now = new Date()\n const timeDiffMs = deadlineDate.getTime() - now.getTime()\n return timeDiffMs / MS_PER_DAY\n}\n\nexport const isWeekend = (date: Date): boolean => {\n const day = date.getDay()\n return day === 0 || day === 6\n}\n\nexport const addDays = (date: Date, days: number): Date => {\n const result = new Date(date)\n result.setDate(result.getDate() + days)\n return result\n}\n\nexport const addBusinessDays = (startDate: Date, businessDays: number): Date => {\n let currentDate = new Date(startDate)\n currentDate.setHours(0, 0, 0, 0)\n let daysAdded = 0\n\n while (daysAdded < businessDays) {\n currentDate = addDays(currentDate, 1)\n if (!isWeekend(currentDate)) {\n daysAdded++\n }\n }\n\n return currentDate\n}\n\n/** Formats numeric month and day as a zero-padded `MM-DD` string. */\nexport function formatMonthDay(month?: number, day?: number): string | undefined {\n if (month == null || day == null) return undefined\n return `${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`\n}\n"],"names":["normalizeToDate","dateInput","parts","numbers","year","month","day","parsedDate","createDateFormatter","options","locale","date","formatDateShortWithWeekday","formatDateShortWithWeekdayAndYear","formatDateShort","formatDateShortWithYear","formatDateLong","formatDateLongWithYear","formatDateWithTime","time","dateString","formatPayPeriod","startDateInput","endDateInput","startDate","endDate","startFormatted","endFormatted","formatPayPeriodRange","monthFormat","formatDateToStringDate","normalizeToISOString","value","normalizeDateToLocal","isoString","datePart","MS_PER_HOUR","MS_PER_DAY","getHoursUntil","deadline","deadlineDate","now","getDaysUntil","isWeekend","addDays","days","result","addBusinessDays","businessDays","currentDate","daysAdded","formatMonthDay"],"mappings":"AAMO,MAAMA,IAAkB,CAACC,MAAkD;AAChF,MAAI,CAACA,EAAW,QAAO;AAEvB,MAAI,OAAOA,KAAc,UAAU;AACjC,QAAI,sBAAsB,KAAKA,CAAS,GAAG;AACzC,YAAMC,IAAQD,EAAU,MAAM,GAAG;AACjC,UAAIC,EAAM,WAAW,EAAG,QAAO;AAE/B,YAAMC,IAAUD,EAAM,IAAI,MAAM,GAC1BE,IAAOD,EAAQ,CAAC,GAChBE,IAAQF,EAAQ,CAAC,GACjBG,IAAMH,EAAQ,CAAC;AAKrB,aAJIC,MAAS,UAAaC,MAAU,UAAaC,MAAQ,UAKvD,MAAMF,CAAI,KACV,MAAMC,CAAK,KACX,MAAMC,CAAG,KACTD,IAAQ,KACRA,IAAQ,MACRC,IAAM,KACNA,IAAM,KAEC,OAGF,IAAI,KAAKF,GAAMC,IAAQ,GAAGC,CAAG;AAAA,IACtC;AAEA,UAAMC,IAAa,IAAI,KAAKN,CAAS;AACrC,WAAO,MAAMM,EAAW,QAAA,CAAS,IAAI,OAAOA;AAAA,EAC9C;AAEA,SAAIN,aAAqB,OAChB,MAAMA,EAAU,QAAA,CAAS,IAAI,OAAOA,IAGtC;AACT,GAKMO,IACJ,CAACC,MACD,CAACR,GAAkCS,MAA4B;AAC7D,QAAMC,IAAOX,EAAgBC,CAAS;AACtC,SAAKU,IACEA,EAAK,mBAAmBD,GAAQD,CAAO,IAD5B;AAEpB,GAEWG,IAA6BJ,EAAoB;AAAA,EAC5D,SAAS;AAAA,EACT,OAAO;AAAA,EACP,KAAK;AACP,CAAC,GAEYK,IAAoCL,EAAoB;AAAA,EACnE,SAAS;AAAA,EACT,OAAO;AAAA,EACP,KAAK;AAAA,EACL,MAAM;AACR,CAAC,GAEYM,IAAkBN,EAAoB;AAAA,EACjD,OAAO;AAAA,EACP,K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AE,SAAS,GAAG,GAAG,CAAC;AAC1E;"}
|
|
@@ -6,6 +6,8 @@ export declare const firstLastName: ({ first_name, last_name, }: {
|
|
|
6
6
|
last_name?: string | null;
|
|
7
7
|
}) => string;
|
|
8
8
|
export declare const getStreet: (address: EmployeeAddress | Location) => string;
|
|
9
|
+
/** Joins street lines with a comma for display (avoids getStreet’s leading-space/comma quirks). */
|
|
10
|
+
export declare const formatStreetForDisplay: (address: EmployeeAddress | Location) => string;
|
|
9
11
|
export declare const getCityStateZip: (address: EmployeeAddress | Location) => string;
|
|
10
12
|
export declare const addressInline: (address: EmployeeAddress | Location) => string;
|
|
11
13
|
export declare const currentDateString: () => string;
|