@gusto/embedded-react-sdk 0.44.1 → 0.45.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 +63 -0
- package/dist/components/Common/DetailViewLayout/DetailViewLayout.js +7 -7
- package/dist/components/Common/DetailViewLayout/DetailViewLayout.js.map +1 -1
- package/dist/components/Common/UI/Alert/Alert.js +24 -23
- package/dist/components/Common/UI/Alert/Alert.js.map +1 -1
- package/dist/components/Common/UI/Alert/Alert.module.scss.js +16 -14
- package/dist/components/Common/UI/Alert/Alert.module.scss.js.map +1 -1
- package/dist/components/Common/UI/Alert/AlertTypes.d.ts +8 -0
- package/dist/components/Common/UI/Alert/AlertTypes.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +38 -38
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -20
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/Head.js +12 -9
- package/dist/components/Company/AssignSignatory/Head.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +25 -25
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -20
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -22
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Head.js +11 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Head.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -20
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Head.js +44 -39
- package/dist/components/Company/BankAccount/BankAccountList/Head.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -20
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +28 -28
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +9 -9
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Head.js +7 -6
- package/dist/components/Company/FederalTaxes/Head.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +12 -28
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +7 -23
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Head.js +10 -9
- package/dist/components/Company/Industry/Head.js.map +1 -1
- package/dist/components/Company/Industry/IndustrySelect.js +22 -19
- package/dist/components/Company/Industry/IndustrySelect.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Head.js +9 -8
- package/dist/components/Company/Locations/LocationForm/Head.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -20
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Head.js +11 -10
- package/dist/components/Company/Locations/LocationsList/Head.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +11 -11
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -20
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +4 -20
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleList.js +18 -18
- package/dist/components/Company/PaySchedule/PayScheduleList.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -20
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -20
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +6 -22
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +7 -7
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +2 -2
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +42 -52
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Employee/Compensation/index.d.ts +1 -1
- package/dist/components/Employee/Compensation/{Compensation.d.ts → onboarding/Compensation.d.ts} +3 -3
- package/dist/components/Employee/Compensation/onboarding/Compensation.js +88 -0
- package/dist/components/Employee/Compensation/onboarding/Compensation.js.map +1 -0
- package/dist/components/Employee/Compensation/{CompensationFlowComponents.d.ts → onboarding/CompensationFlowComponents.d.ts} +3 -3
- package/dist/components/Employee/Compensation/onboarding/CompensationFlowComponents.js +59 -0
- package/dist/components/Employee/Compensation/onboarding/CompensationFlowComponents.js.map +1 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.d.ts +21 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js +249 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.module.scss.js +8 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.module.scss.js.map +1 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/index.d.ts +3 -0
- package/dist/components/Employee/Compensation/{JobsList → onboarding/JobsList}/JobsList.d.ts +1 -1
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.js +43 -0
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.js.map +1 -0
- package/dist/components/Employee/Compensation/{JobsList → onboarding/JobsList}/JobsListPresentation.js +10 -10
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.js.map +1 -0
- package/dist/components/Employee/Compensation/{compensationStateMachine.js → onboarding/compensationStateMachine.js} +1 -1
- package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.js.map +1 -0
- package/dist/components/Employee/Compensation/onboarding/index.d.ts +2 -0
- package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.d.ts +9 -0
- package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.js +10 -0
- package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.js.map +1 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +7 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js +41 -35
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/index.d.ts +0 -2
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.d.ts +24 -3
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js +193 -181
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/index.d.ts +0 -2
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.d.ts +8 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js +14 -13
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.d.ts +19 -2
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js +133 -130
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
- package/dist/components/Employee/Dashboard/BasicDetailsView.d.ts +13 -0
- package/dist/components/Employee/Dashboard/BasicDetailsView.js +87 -65
- package/dist/components/Employee/Dashboard/BasicDetailsView.js.map +1 -1
- package/dist/components/Employee/Dashboard/CompensationCard.d.ts +13 -0
- package/dist/components/Employee/Dashboard/Dashboard.js +89 -109
- package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +15 -0
- package/dist/components/Employee/Dashboard/DashboardComponents.js +120 -25
- package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -1
- package/dist/components/Employee/Dashboard/DocumentsView.d.ts +11 -0
- package/dist/components/Employee/Dashboard/DocumentsView.js +24 -17
- package/dist/components/Employee/Dashboard/DocumentsView.js.map +1 -1
- package/dist/components/Employee/Dashboard/JobAndPayView.d.ts +9 -17
- package/dist/components/Employee/Dashboard/JobAndPayView.js +495 -114
- package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -1
- package/dist/components/Employee/Dashboard/PendingChangesReviewModal.d.ts +10 -0
- package/dist/components/Employee/Dashboard/PendingChangesReviewModal.js +64 -0
- package/dist/components/Employee/Dashboard/PendingChangesReviewModal.js.map +1 -0
- package/dist/components/Employee/Dashboard/TaxesView.d.ts +13 -0
- package/dist/components/Employee/Dashboard/TaxesView.js +82 -60
- package/dist/components/Employee/Dashboard/TaxesView.js.map +1 -1
- package/dist/components/Employee/Dashboard/dashboardStateMachine.d.ts +7 -0
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js +227 -40
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.d.ts +50 -0
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js +57 -0
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js.map +1 -0
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.test.d.ts +1 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js +7 -4
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +14 -8
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +60 -36
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -1
- package/dist/components/Employee/Dashboard/usePendingChangeDetailRenderer.d.ts +8 -0
- package/dist/components/Employee/Dashboard/usePendingChangeDetailRenderer.js +61 -0
- package/dist/components/Employee/Dashboard/usePendingChangeDetailRenderer.js.map +1 -0
- package/dist/components/Employee/Deductions/Deductions.d.ts +2 -8
- package/dist/components/Employee/Deductions/Deductions.js +25 -52
- package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportFormView.d.ts +9 -0
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportFormView.js +137 -0
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportFormView.js.map +1 -0
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.d.ts +9 -5
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +97 -94
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/StandardDeductionForm.d.ts +18 -0
- package/dist/components/Employee/Deductions/DeductionsForm/StandardDeductionForm.js +137 -0
- package/dist/components/Employee/Deductions/DeductionsForm/StandardDeductionForm.js.map +1 -0
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.d.ts +10 -5
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +57 -77
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.d.ts +5 -5
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +29 -39
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js +8 -6
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js.map +1 -1
- package/dist/components/Employee/Deductions/{DeductionsComponents.d.ts → deductionsContextualComponents.d.ts} +7 -8
- package/dist/components/Employee/Deductions/deductionsContextualComponents.js +74 -0
- package/dist/components/Employee/Deductions/deductionsContextualComponents.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.d.ts +7 -0
- package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.js +31 -0
- package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/formatDeductionAmount.d.ts +7 -0
- package/dist/components/Employee/Deductions/shared/formatDeductionAmount.js +10 -0
- package/dist/components/Employee/Deductions/shared/formatDeductionAmount.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/formatDeductionAmount.test.d.ts +1 -0
- package/dist/components/Employee/Deductions/shared/index.d.ts +7 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.d.ts +63 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js +64 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.d.ts +36 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +39 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/index.d.ts +4 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.d.ts +62 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js +208 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.d.ts +63 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.js +52 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.d.ts +25 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +36 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/index.d.ts +4 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.d.ts +64 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.js +203 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/useDeductionsList.d.ts +22 -0
- package/dist/components/Employee/Deductions/shared/useDeductionsList.js +50 -0
- package/dist/components/Employee/Deductions/shared/useDeductionsList.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/useDeleteDeduction.d.ts +13 -0
- package/dist/components/Employee/Deductions/shared/useDeleteDeduction.js +17 -0
- package/dist/components/Employee/Deductions/shared/useDeleteDeduction.js.map +1 -0
- package/dist/components/Employee/Deductions/stateMachine.d.ts +4 -5
- package/dist/components/Employee/Deductions/stateMachine.js +67 -89
- package/dist/components/Employee/Deductions/stateMachine.js.map +1 -1
- package/dist/components/Employee/Documents/management/DocumentManager.d.ts +6 -0
- package/dist/components/Employee/Documents/management/DocumentManager.js +60 -0
- package/dist/components/Employee/Documents/management/DocumentManager.js.map +1 -0
- package/dist/components/Employee/Documents/management/index.d.ts +3 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/Actions.js +3 -3
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/DocumentList.d.ts +1 -1
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/DocumentList.js +5 -5
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/Head.js +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Head.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/List.js +3 -3
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js.map +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +8 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentSigner.d.ts +1 -1
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentSigner.js +5 -5
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibility.d.ts +1 -1
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibility.js +4 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibilityPresentation.js +11 -11
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.test.d.ts +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/countries.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/I9SignatureForm/I9SignatureForm.d.ts +1 -1
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/I9SignatureForm/I9SignatureForm.js +11 -11
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/documentSignerStateMachine.d.ts +2 -2
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/documentSignerStateMachine.js +8 -8
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/documentSignerStateMachine.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/stateMachine.js +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.js.map +1 -0
- package/dist/components/Employee/{EmployeeDocuments → Documents/onboarding/EmployeeDocuments}/EmployeeDocuments.d.ts +3 -3
- package/dist/components/Employee/{EmployeeDocuments → Documents/onboarding/EmployeeDocuments}/EmployeeDocuments.js +6 -6
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.js.map +1 -0
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.js +117 -0
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/shared}/SignatureForm/SignatureForm.d.ts +1 -1
- package/dist/components/Employee/{DocumentSigner → Documents/shared}/SignatureForm/SignatureForm.js +11 -11
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js.map +1 -0
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js.map +1 -0
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.js.map +1 -0
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/useSignEmployeeForm.js.map +1 -0
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js +89 -82
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js +37 -35
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.d.ts +1 -0
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js +14 -8
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js +38 -39
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +29 -27
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/index.d.ts +1 -1
- package/dist/components/Employee/PaymentMethod/management/ListView.d.ts +8 -0
- package/dist/components/Employee/PaymentMethod/management/ListView.js +138 -0
- package/dist/components/Employee/PaymentMethod/management/ListView.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.d.ts +11 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js +49 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.d.ts +8 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.js +23 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/management/index.d.ts +4 -0
- package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.d.ts +5 -0
- package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.js +75 -0
- package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.d.ts +8 -0
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js +66 -0
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.d.ts +9 -0
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.js +168 -0
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.d.ts +11 -0
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js +44 -0
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.d.ts +8 -0
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.js +23 -0
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/onboarding/SplitView.d.ts +8 -0
- package/dist/components/Employee/PaymentMethod/onboarding/SplitView.js +97 -0
- package/dist/components/Employee/PaymentMethod/onboarding/SplitView.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/onboarding/index.d.ts +2 -0
- package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.d.ts +5 -0
- package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.js +75 -0
- package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/DeleteBankAccountDialog.d.ts +9 -0
- package/dist/components/Employee/PaymentMethod/shared/DeleteBankAccountDialog.js +31 -0
- package/dist/components/Employee/PaymentMethod/shared/DeleteBankAccountDialog.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/index.d.ts +7 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.d.ts +15 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js +22 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/index.d.ts +5 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.d.ts +37 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.js +105 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.d.ts +39 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.js +26 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/useDeleteBankAccount.d.ts +13 -0
- package/dist/components/Employee/PaymentMethod/shared/useDeleteBankAccount.js +19 -0
- package/dist/components/Employee/PaymentMethod/shared/useDeleteBankAccount.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.d.ts +6 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.js +9 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/index.d.ts +5 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.d.ts +31 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.js +94 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.d.ts +31 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.js +22 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.d.ts +20 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.js +68 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/fields.d.ts +6 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/fields.js +9 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/fields.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/index.d.ts +6 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.d.ts +48 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js +46 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.d.ts +65 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.js +209 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.d.ts +53 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.js +93 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.js.map +1 -0
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js +88 -87
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js +2 -2
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js +19 -17
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.module.scss.js +8 -0
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.module.scss.js.map +1 -0
- package/dist/components/Employee/Taxes/FederalForm.js +27 -26
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalHead.js +13 -10
- package/dist/components/Employee/Taxes/FederalHead.js.map +1 -1
- package/dist/components/Employee/Taxes/StateForm.js +17 -14
- package/dist/components/Employee/Taxes/StateForm.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.js +75 -69
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +4 -20
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js +26 -26
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
- package/dist/components/Employee/exports/employeeManagement.d.ts +4 -1
- package/dist/components/Employee/exports/employeeManagement.js +22 -18
- package/dist/components/Employee/exports/employeeManagement.js.map +1 -1
- package/dist/components/Employee/exports/employeeOnboarding.d.ts +3 -3
- package/dist/components/Employee/exports/employeeOnboarding.js +4 -4
- package/dist/components/Employee/index.d.ts +4 -4
- package/dist/components/Employee/index.js +5 -5
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +26 -34
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +35 -35
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.d.ts +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +71 -54
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +22 -36
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js +84 -82
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.d.ts +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js +49 -48
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailTypes.d.ts +1 -0
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.js +39 -37
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.js.map +1 -1
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js +31 -31
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js.map +1 -1
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormTypes.d.ts +1 -0
- package/dist/components/TimeOff/PolicyList/PolicyList.js +27 -27
- package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js +50 -50
- package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js.map +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettings.d.ts +1 -0
- package/dist/components/TimeOff/PolicySettings/PolicySettings.js +66 -41
- package/dist/components/TimeOff/PolicySettings/PolicySettings.js.map +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.d.ts +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js +59 -48
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js.map +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettingsTypes.d.ts +3 -0
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js +34 -33
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +3 -0
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js +69 -61
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js +119 -75
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js +72 -61
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.d.ts +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +103 -84
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormTypes.d.ts +2 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js +51 -49
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.d.ts +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js +78 -59
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.module.scss.js +8 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.module.scss.js.map +1 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentationTypes.d.ts +6 -2
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js +209 -154
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.d.ts +3 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js +36 -34
- package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js +136 -134
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.module.scss.js +6 -6
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.d.ts +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.js +63 -65
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailTypes.d.ts +1 -0
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js +50 -49
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js.map +1 -1
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.module.scss.js +4 -4
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.d.ts +1 -1
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js +66 -55
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js.map +1 -1
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayoutTypes.d.ts +1 -0
- package/dist/contexts/ApiProvider/ApiProvider.js +33 -39
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
- package/dist/contexts/ApiProvider/createSdkQueryClient.d.ts +17 -0
- package/dist/contexts/ApiProvider/createSdkQueryClient.js +14 -0
- package/dist/contexts/ApiProvider/createSdkQueryClient.js.map +1 -0
- package/dist/helpers/dateFormatting.js +52 -56
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/helpers/formattedStrings.d.ts +12 -0
- package/dist/helpers/formattedStrings.js +55 -33
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/hooks/useClientPagination/useClientPagination.d.ts +44 -0
- package/dist/hooks/useClientPagination/useClientPagination.js +69 -0
- package/dist/hooks/useClientPagination/useClientPagination.js.map +1 -0
- package/dist/hooks/useClientPagination/useClientPagination.test.d.ts +1 -0
- package/dist/i18n/I18n.js +6 -5
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.PaySchedule.json.js +22 -20
- package/dist/i18n/en/Company.PaySchedule.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js +8 -6
- package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js +9 -9
- package/dist/i18n/en/Company.TimeOff.PolicyDetail.json.js +6 -4
- package/dist/i18n/en/Company.TimeOff.PolicyDetail.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js +17 -15
- package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.SelectPolicyType.json.js +10 -8
- package/dist/i18n/en/Company.TimeOff.SelectPolicyType.json.js.map +1 -1
- package/dist/i18n/en/Employee.Dashboard.json.js +16 -12
- package/dist/i18n/en/Employee.Dashboard.json.js.map +1 -1
- package/dist/i18n/en/Employee.Deductions.json.js +104 -76
- package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
- package/dist/i18n/en/Employee.DocumentManager.json.js +12 -0
- package/dist/i18n/en/Employee.DocumentManager.json.js.map +1 -0
- package/dist/i18n/en/Employee.PaymentMethod.json.js +76 -64
- package/dist/i18n/en/Employee.PaymentMethod.json.js.map +1 -1
- package/dist/i18n/en/common.json.d.ts +7 -0
- package/dist/i18n/en/common.json.js +19 -17
- package/dist/i18n/en/common.json.js.map +1 -1
- package/dist/index.d.ts +16 -6
- package/dist/index.js +138 -112
- package/dist/index.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.d.ts +2 -1
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +20 -18
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -1
- package/dist/shared/constants.d.ts +8 -2
- package/dist/shared/constants.js +11 -8
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/test-utils/assertions.d.ts +20 -0
- package/dist/types/i18next.d.ts +140 -4
- package/dist/types/sdkError.js +58 -47
- package/dist/types/sdkError.js.map +1 -1
- package/docs/reference/endpoint-inventory.json +980 -1170
- package/package.json +33 -22
- package/dist/components/Employee/Compensation/Compensation.js +0 -87
- package/dist/components/Employee/Compensation/Compensation.js.map +0 -1
- package/dist/components/Employee/Compensation/CompensationFlowComponents.js +0 -61
- package/dist/components/Employee/Compensation/CompensationFlowComponents.js.map +0 -1
- package/dist/components/Employee/Compensation/EditCompensation/EditCompensation.d.ts +0 -14
- package/dist/components/Employee/Compensation/EditCompensation/EditCompensation.js +0 -128
- package/dist/components/Employee/Compensation/EditCompensation/EditCompensation.js.map +0 -1
- package/dist/components/Employee/Compensation/EditCompensation/EditCompensationPresentation.d.ts +0 -17
- package/dist/components/Employee/Compensation/EditCompensation/EditCompensationPresentation.js +0 -224
- package/dist/components/Employee/Compensation/EditCompensation/EditCompensationPresentation.js.map +0 -1
- package/dist/components/Employee/Compensation/EditCompensation/index.d.ts +0 -5
- package/dist/components/Employee/Compensation/JobsList/JobsList.js +0 -47
- package/dist/components/Employee/Compensation/JobsList/JobsList.js.map +0 -1
- package/dist/components/Employee/Compensation/JobsList/JobsListPresentation.js.map +0 -1
- package/dist/components/Employee/Compensation/compensationSchema.d.ts +0 -29
- package/dist/components/Employee/Compensation/compensationSchema.js +0 -63
- package/dist/components/Employee/Compensation/compensationSchema.js.map +0 -1
- package/dist/components/Employee/Compensation/compensationStateMachine.js.map +0 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCurrentCompensationForm.d.ts +0 -15
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCurrentCompensationForm.js +0 -27
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCurrentCompensationForm.js.map +0 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/useCurrentJobForm.d.ts +0 -13
- package/dist/components/Employee/Compensation/shared/useJobForm/useCurrentJobForm.js +0 -26
- package/dist/components/Employee/Compensation/shared/useJobForm/useCurrentJobForm.js.map +0 -1
- package/dist/components/Employee/Deductions/Actions.d.ts +0 -1
- package/dist/components/Employee/Deductions/DeductionsComponents.js +0 -31
- package/dist/components/Employee/Deductions/DeductionsComponents.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.d.ts +0 -39
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +0 -237
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +0 -22
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +0 -162
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.d.ts +0 -34
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +0 -168
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +0 -1
- package/dist/components/Employee/Deductions/Head.d.ts +0 -1
- package/dist/components/Employee/Deductions/useDeductions.d.ts +0 -30
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Head.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +0 -24
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/countries.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/documentSignerStateMachine.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/fields.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/signEmployeeFormSchema.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/useSignEmployeeForm.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/stateMachine.js.map +0 -1
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocuments.js.map +0 -1
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +0 -115
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/Actions.d.ts +0 -1
- package/dist/components/Employee/PaymentMethod/Actions.js +0 -20
- package/dist/components/Employee/PaymentMethod/Actions.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/BankAccount.d.ts +0 -13
- package/dist/components/Employee/PaymentMethod/BankAccount.js +0 -13
- package/dist/components/Employee/PaymentMethod/BankAccount.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.d.ts +0 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +0 -58
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.d.ts +0 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +0 -51
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/Head.d.ts +0 -1
- package/dist/components/Employee/PaymentMethod/Head.js +0 -13
- package/dist/components/Employee/PaymentMethod/Head.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/PaymentMethod.d.ts +0 -9
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js +0 -183
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.d.ts +0 -10
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +0 -38
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/Split.d.ts +0 -1
- package/dist/components/Employee/PaymentMethod/Split.js +0 -175
- package/dist/components/Employee/PaymentMethod/Split.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.d.ts +0 -54
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +0 -68
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +0 -1
- /package/dist/components/Employee/Compensation/{JobsList → onboarding/JobsList}/JobsListPresentation.d.ts +0 -0
- /package/dist/components/Employee/Compensation/{JobsList → onboarding/JobsList}/index.d.ts +0 -0
- /package/dist/components/Employee/Compensation/{compensationStateMachine.d.ts → onboarding/compensationStateMachine.d.ts} +0 -0
- /package/dist/components/Employee/{DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.test.d.ts → Compensation/shared/derivePrimaryFlsaStatus.test.d.ts} +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/Actions.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/Head.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/List.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/useDocumentList.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibilityPresentation.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibilitySchema.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibilitySchema.js +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/countries.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/countries.js +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/index.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/I9SignatureForm/I9SignatureForm.module.scss.js +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/I9SignatureForm/I9SignatureForm.module.scss.js.map +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/index.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/stateMachine.d.ts +0 -0
- /package/dist/components/Employee/{EmployeeDocuments → Documents/onboarding/EmployeeDocuments}/EmployeeDocumentsPresentation.d.ts +0 -0
- /package/dist/components/Employee/{EmployeeDocuments → Documents/onboarding/EmployeeDocuments}/index.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/fields.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/fields.js +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/index.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/signEmployeeFormSchema.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/signEmployeeFormSchema.js +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/useSignEmployeeForm.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/useSignEmployeeForm.js +0 -0
|
@@ -1,86 +1,97 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { EmployeeTable as
|
|
1
|
+
import { jsx as i, jsxs as P, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as S } from "react-i18next";
|
|
3
|
+
import { EmployeeTable as D } from "../EmployeeTable/EmployeeTable.js";
|
|
4
4
|
import "classnames";
|
|
5
5
|
import "../../../../shared/constants.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
import { EmptyData as L } from "../../../Common/EmptyData/EmptyData.js";
|
|
7
|
+
import { useComponentContext as O } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
|
+
import { useI18n as T } from "../../../../i18n/I18n.js";
|
|
9
|
+
import x from "../../../../assets/icons/plus-circle.svg.js";
|
|
10
|
+
import { DetailViewLayout as A } from "../../../Common/DetailViewLayout/DetailViewLayout.js";
|
|
11
|
+
const v = "employees";
|
|
12
|
+
function w({
|
|
11
13
|
title: l,
|
|
12
|
-
subtitle:
|
|
14
|
+
subtitle: m,
|
|
13
15
|
onBack: c,
|
|
14
|
-
backLabel:
|
|
15
|
-
actions:
|
|
16
|
-
firstTab:
|
|
16
|
+
backLabel: s,
|
|
17
|
+
actions: p,
|
|
18
|
+
firstTab: a,
|
|
17
19
|
selectedTabId: d,
|
|
18
20
|
onTabChange: h,
|
|
19
|
-
employees:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
employees: t,
|
|
22
|
+
onAddEmployee: n,
|
|
23
|
+
removeDialog: o,
|
|
24
|
+
successAlert: r,
|
|
25
|
+
onDismissAlert: u
|
|
23
26
|
}) {
|
|
24
|
-
|
|
25
|
-
const { t } =
|
|
27
|
+
T("Company.TimeOff.PolicyDetail");
|
|
28
|
+
const { t: e } = S("Company.TimeOff.PolicyDetail"), { Alert: y, Dialog: C, Button: f } = O(), E = t.emptyState ?? (n ? () => /* @__PURE__ */ i(L, { title: e("emptyEmployees.title"), children: /* @__PURE__ */ i(
|
|
29
|
+
f,
|
|
26
30
|
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
variant: "secondary",
|
|
32
|
+
icon: /* @__PURE__ */ i(x, { "aria-hidden": !0 }),
|
|
33
|
+
onClick: n,
|
|
34
|
+
children: e("emptyEmployees.addEmployeeCta")
|
|
35
|
+
}
|
|
36
|
+
) }) : void 0), g = [
|
|
37
|
+
{
|
|
38
|
+
id: a.id,
|
|
39
|
+
label: a.label,
|
|
40
|
+
content: a.content
|
|
30
41
|
},
|
|
31
42
|
{
|
|
32
|
-
id:
|
|
33
|
-
label:
|
|
34
|
-
content: /* @__PURE__ */
|
|
35
|
-
|
|
43
|
+
id: v,
|
|
44
|
+
label: e("tabs.employees"),
|
|
45
|
+
content: /* @__PURE__ */ i(
|
|
46
|
+
D,
|
|
36
47
|
{
|
|
37
|
-
data:
|
|
38
|
-
searchValue:
|
|
39
|
-
onSearchChange:
|
|
40
|
-
onSearchClear:
|
|
41
|
-
searchPlaceholder:
|
|
42
|
-
itemMenu:
|
|
43
|
-
pagination:
|
|
44
|
-
isFetching:
|
|
45
|
-
emptyState:
|
|
46
|
-
additionalColumns:
|
|
47
|
-
hideJobTitle:
|
|
48
|
+
data: t.data,
|
|
49
|
+
searchValue: t.searchValue,
|
|
50
|
+
onSearchChange: t.onSearchChange,
|
|
51
|
+
onSearchClear: t.onSearchClear,
|
|
52
|
+
searchPlaceholder: t.searchPlaceholder,
|
|
53
|
+
itemMenu: t.itemMenu,
|
|
54
|
+
pagination: t.pagination,
|
|
55
|
+
isFetching: t.isFetching,
|
|
56
|
+
emptyState: E,
|
|
57
|
+
additionalColumns: t.additionalColumns,
|
|
58
|
+
hideJobTitle: t.hideJobTitle
|
|
48
59
|
}
|
|
49
|
-
)
|
|
60
|
+
)
|
|
50
61
|
}
|
|
51
62
|
];
|
|
52
|
-
return /* @__PURE__ */
|
|
53
|
-
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
|
|
63
|
+
return /* @__PURE__ */ P(b, { children: [
|
|
64
|
+
r && /* @__PURE__ */ i(y, { status: "success", label: r, onDismiss: u }),
|
|
65
|
+
/* @__PURE__ */ i(
|
|
66
|
+
A,
|
|
56
67
|
{
|
|
57
68
|
title: l,
|
|
58
|
-
subtitle:
|
|
69
|
+
subtitle: m,
|
|
59
70
|
onBack: c,
|
|
60
|
-
backLabel:
|
|
61
|
-
actions:
|
|
62
|
-
tabs:
|
|
71
|
+
backLabel: s,
|
|
72
|
+
actions: p,
|
|
73
|
+
tabs: g,
|
|
63
74
|
selectedTabId: d,
|
|
64
75
|
onTabChange: h
|
|
65
76
|
}
|
|
66
77
|
),
|
|
67
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ i(
|
|
68
79
|
C,
|
|
69
80
|
{
|
|
70
|
-
isOpen:
|
|
71
|
-
onClose:
|
|
72
|
-
onPrimaryActionClick:
|
|
73
|
-
isPrimaryActionLoading:
|
|
81
|
+
isOpen: o.isOpen,
|
|
82
|
+
onClose: o.onClose,
|
|
83
|
+
onPrimaryActionClick: o.onConfirm,
|
|
84
|
+
isPrimaryActionLoading: o.isPending,
|
|
74
85
|
isDestructive: !0,
|
|
75
|
-
title:
|
|
76
|
-
primaryActionLabel:
|
|
77
|
-
closeActionLabel:
|
|
78
|
-
children:
|
|
86
|
+
title: e("removeEmployeeDialog.title", { name: o.employeeName }),
|
|
87
|
+
primaryActionLabel: e("removeEmployeeDialog.confirmCta"),
|
|
88
|
+
closeActionLabel: e("removeEmployeeDialog.cancelCta"),
|
|
89
|
+
children: e("removeEmployeeDialog.description", { name: o.employeeName })
|
|
79
90
|
}
|
|
80
91
|
)
|
|
81
92
|
] });
|
|
82
93
|
}
|
|
83
94
|
export {
|
|
84
|
-
|
|
95
|
+
w as PolicyDetailLayout
|
|
85
96
|
};
|
|
86
97
|
//# sourceMappingURL=PolicyDetailLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolicyDetailLayout.js","sources":["../../../../../src/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { EmployeeTableItem } from '../EmployeeTable/EmployeeTableTypes'\nimport { EmployeeTable } from '../EmployeeTable/EmployeeTable'\nimport type { PolicyDetailLayoutProps } from './PolicyDetailLayoutTypes'\nimport { DetailViewLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nconst EMPLOYEES_TAB_ID = 'employees'\n\nexport function PolicyDetailLayout<T extends EmployeeTableItem>({\n title,\n subtitle,\n onBack,\n backLabel,\n actions,\n firstTab,\n selectedTabId,\n onTabChange,\n employees,\n removeDialog,\n successAlert,\n onDismissAlert,\n}: PolicyDetailLayoutProps<T>) {\n useI18n('Company.TimeOff.PolicyDetail')\n const { t } = useTranslation('Company.TimeOff.PolicyDetail')\n const { Alert, Dialog,
|
|
1
|
+
{"version":3,"file":"PolicyDetailLayout.js","sources":["../../../../../src/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { EmployeeTableItem } from '../EmployeeTable/EmployeeTableTypes'\nimport { EmployeeTable } from '../EmployeeTable/EmployeeTable'\nimport type { PolicyDetailLayoutProps } from './PolicyDetailLayoutTypes'\nimport { DetailViewLayout, EmptyData } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport PlusCircleIcon from '@/assets/icons/plus-circle.svg?react'\n\nconst EMPLOYEES_TAB_ID = 'employees'\n\nexport function PolicyDetailLayout<T extends EmployeeTableItem>({\n title,\n subtitle,\n onBack,\n backLabel,\n actions,\n firstTab,\n selectedTabId,\n onTabChange,\n employees,\n onAddEmployee,\n removeDialog,\n successAlert,\n onDismissAlert,\n}: PolicyDetailLayoutProps<T>) {\n useI18n('Company.TimeOff.PolicyDetail')\n const { t } = useTranslation('Company.TimeOff.PolicyDetail')\n const { Alert, Dialog, Button } = useComponentContext()\n\n const emptyEmployeesState =\n employees.emptyState ??\n (onAddEmployee\n ? () => (\n <EmptyData title={t('emptyEmployees.title')}>\n <Button\n variant=\"secondary\"\n icon={<PlusCircleIcon aria-hidden />}\n onClick={onAddEmployee}\n >\n {t('emptyEmployees.addEmployeeCta')}\n </Button>\n </EmptyData>\n )\n : undefined)\n\n const tabs = [\n {\n id: firstTab.id,\n label: firstTab.label,\n content: firstTab.content,\n },\n {\n id: EMPLOYEES_TAB_ID,\n label: t('tabs.employees'),\n content: (\n <EmployeeTable<T>\n data={employees.data}\n searchValue={employees.searchValue}\n onSearchChange={employees.onSearchChange}\n onSearchClear={employees.onSearchClear}\n searchPlaceholder={employees.searchPlaceholder}\n itemMenu={employees.itemMenu}\n pagination={employees.pagination}\n isFetching={employees.isFetching}\n emptyState={emptyEmployeesState}\n additionalColumns={employees.additionalColumns}\n hideJobTitle={employees.hideJobTitle}\n />\n ),\n },\n ]\n\n return (\n <>\n {successAlert && <Alert status=\"success\" label={successAlert} onDismiss={onDismissAlert} />}\n\n <DetailViewLayout\n title={title}\n subtitle={subtitle}\n onBack={onBack}\n backLabel={backLabel}\n actions={actions}\n tabs={tabs}\n selectedTabId={selectedTabId}\n onTabChange={onTabChange}\n />\n\n <Dialog\n isOpen={removeDialog.isOpen}\n onClose={removeDialog.onClose}\n onPrimaryActionClick={removeDialog.onConfirm}\n isPrimaryActionLoading={removeDialog.isPending}\n isDestructive\n title={t('removeEmployeeDialog.title', { name: removeDialog.employeeName })}\n primaryActionLabel={t('removeEmployeeDialog.confirmCta')}\n closeActionLabel={t('removeEmployeeDialog.cancelCta')}\n >\n {t('removeEmployeeDialog.description', { name: removeDialog.employeeName })}\n </Dialog>\n </>\n )\n}\n"],"names":["EMPLOYEES_TAB_ID","PolicyDetailLayout","title","subtitle","onBack","backLabel","actions","firstTab","selectedTabId","onTabChange","employees","onAddEmployee","removeDialog","successAlert","onDismissAlert","useI18n","t","useTranslation","Alert","Dialog","Button","useComponentContext","emptyEmployeesState","EmptyData","jsx","PlusCircleIcon","tabs","EmployeeTable","jsxs","Fragment","DetailViewLayout"],"mappings":";;;;;;;;;;AASA,MAAMA,IAAmB;AAElB,SAASC,EAAgD;AAAA,EAC9D,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AA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AAAhB,uBAAiBK,GAAA,EAAM,QAAO,WAAU,OAAOL,GAAc,WAAWC,GAAgB;AAAA,IAEzF,gBAAAU;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,OAAA5B;AAAA,QACA,UAAAC;AAAA,QACA,QAAAC;AAAA,QACA,WAAAC;AAAA,QACA,SAAAC;AAAA,QACA,MAAAoB;AAAA,QACA,eAAAlB;AAAA,QACA,aAAAC;AAAA,MAAA;AAAA,IAAA;AAAA,IAGF,gBAAAe;AAAA,MAACL;AAAA,MAAA;AAAA,QACC,QAAQP,EAAa;AAAA,QACrB,SAASA,EAAa;AAAA,QACtB,sBAAsBA,EAAa;AAAA,QACnC,wBAAwBA,EAAa;AAAA,QACrC,eAAa;AAAA,QACb,OAAOI,EAAE,8BAA8B,EAAE,MAAMJ,EAAa,cAAc;AAAA,QAC1E,oBAAoBI,EAAE,iCAAiC;AAAA,QACvD,kBAAkBA,EAAE,gCAAgC;AAAA,QAEnD,YAAE,oCAAoC,EAAE,MAAMJ,EAAa,cAAc;AAAA,MAAA;AAAA,IAAA;AAAA,EAC5E,GACF;AAEJ;"}
|
|
@@ -21,6 +21,7 @@ export interface PolicyDetailLayoutProps<T extends EmployeeTableItem> {
|
|
|
21
21
|
selectedTabId: string;
|
|
22
22
|
onTabChange: (id: string) => void;
|
|
23
23
|
employees: Pick<EmployeeTableProps<T>, 'data' | 'searchValue' | 'onSearchChange' | 'onSearchClear' | 'searchPlaceholder' | 'itemMenu' | 'pagination' | 'isFetching' | 'emptyState' | 'additionalColumns' | 'hideJobTitle'>;
|
|
24
|
+
onAddEmployee?: () => void;
|
|
24
25
|
removeDialog: RemoveDialogState;
|
|
25
26
|
successAlert?: string;
|
|
26
27
|
onDismissAlert?: () => void;
|
|
@@ -1,49 +1,43 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import { GustoEmbeddedProvider as
|
|
4
|
-
import { GustoEmbeddedCore as
|
|
5
|
-
import { SDKHooks as
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { QueryClientProvider as E } from "@tanstack/react-query";
|
|
3
|
+
import { GustoEmbeddedProvider as R } from "@gusto/embedded-api/react-query/_context";
|
|
4
|
+
import { GustoEmbeddedCore as q } from "@gusto/embedded-api/core";
|
|
5
|
+
import { SDKHooks as C } from "@gusto/embedded-api/hooks/hooks";
|
|
6
6
|
import { useMemo as a } from "react";
|
|
7
|
-
import { apiVersionHook as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
import { apiVersionHook as b } from "./apiVersionHook.js";
|
|
8
|
+
import { createSdkQueryClient as g } from "./createSdkQueryClient.js";
|
|
9
|
+
function G({
|
|
10
|
+
url: s,
|
|
11
|
+
headers: i,
|
|
11
12
|
hooks: e,
|
|
12
|
-
children:
|
|
13
|
-
queryClient:
|
|
13
|
+
children: m,
|
|
14
|
+
queryClient: f
|
|
14
15
|
}) {
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
serverURL:
|
|
18
|
-
}),
|
|
19
|
-
if (
|
|
20
|
-
const
|
|
21
|
-
beforeRequest: (
|
|
22
|
-
|
|
16
|
+
const d = a(() => {
|
|
17
|
+
const t = new q({
|
|
18
|
+
serverURL: s
|
|
19
|
+
}), o = t._options.hooks || new C();
|
|
20
|
+
if (o.registerBeforeRequestHook(b), i) {
|
|
21
|
+
const r = {
|
|
22
|
+
beforeRequest: (k, n) => (new Headers(i).forEach((c, H) => {
|
|
23
|
+
c && n.headers.set(H, c);
|
|
23
24
|
}), n)
|
|
24
25
|
};
|
|
25
|
-
|
|
26
|
+
o.registerBeforeRequestHook(r);
|
|
26
27
|
}
|
|
27
|
-
return e?.beforeCreateRequest && e.beforeCreateRequest.forEach((
|
|
28
|
-
|
|
29
|
-
}), e?.beforeRequest && e.beforeRequest.forEach((
|
|
30
|
-
|
|
31
|
-
}), e?.afterSuccess && e.afterSuccess.forEach((
|
|
32
|
-
|
|
33
|
-
}), e?.afterError && e.afterError.forEach((
|
|
34
|
-
|
|
35
|
-
}),
|
|
36
|
-
}, [
|
|
37
|
-
|
|
38
|
-
return i;
|
|
39
|
-
const r = new H(), t = async () => {
|
|
40
|
-
await r.invalidateQueries({ queryKey: ["@gusto/embedded-api"] });
|
|
41
|
-
};
|
|
42
|
-
return r.setQueryDefaults(["@gusto/embedded-api"], { retry: !1 }), r.setMutationDefaults(["@gusto/embedded-api"], { onSuccess: t, retry: !1 }), r;
|
|
43
|
-
}, [i]);
|
|
44
|
-
return /* @__PURE__ */ c(b, { client: p, children: /* @__PURE__ */ c(g, { client: m, children: d }) });
|
|
28
|
+
return e?.beforeCreateRequest && e.beforeCreateRequest.forEach((r) => {
|
|
29
|
+
o.registerBeforeCreateRequestHook(r);
|
|
30
|
+
}), e?.beforeRequest && e.beforeRequest.forEach((r) => {
|
|
31
|
+
o.registerBeforeRequestHook(r);
|
|
32
|
+
}), e?.afterSuccess && e.afterSuccess.forEach((r) => {
|
|
33
|
+
o.registerAfterSuccessHook(r);
|
|
34
|
+
}), e?.afterError && e.afterError.forEach((r) => {
|
|
35
|
+
o.registerAfterErrorHook(r);
|
|
36
|
+
}), t._options.hooks || (t._options.hooks = o), t;
|
|
37
|
+
}, [s, i, e]), p = a(() => f ?? g(), [f]);
|
|
38
|
+
return /* @__PURE__ */ u(E, { client: p, children: /* @__PURE__ */ u(R, { client: d, children: m }) });
|
|
45
39
|
}
|
|
46
40
|
export {
|
|
47
|
-
|
|
41
|
+
G as ApiProvider
|
|
48
42
|
};
|
|
49
43
|
//# sourceMappingURL=ApiProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiProvider.js","sources":["../../../src/contexts/ApiProvider/ApiProvider.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"ApiProvider.js","sources":["../../../src/contexts/ApiProvider/ApiProvider.tsx"],"sourcesContent":["import { QueryClientProvider, type QueryClient } from '@tanstack/react-query'\nimport { GustoEmbeddedProvider } from '@gusto/embedded-api/react-query/_context'\nimport { GustoEmbeddedCore } from '@gusto/embedded-api/core'\nimport { SDKHooks as NativeSDKHooks } from '@gusto/embedded-api/hooks/hooks'\nimport { useMemo } from 'react'\nimport { apiVersionHook } from './apiVersionHook'\nimport { createSdkQueryClient } from './createSdkQueryClient'\nimport type { SDKHooks, BeforeRequestHook } from '@/types/hooks'\n\nexport interface ApiProviderProps {\n url: string\n headers?: HeadersInit\n hooks?: SDKHooks\n children: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport function ApiProvider({\n url,\n headers,\n hooks,\n children,\n queryClient: queryClientFromProps,\n}: ApiProviderProps) {\n const gustoClient = useMemo(() => {\n const client = new GustoEmbeddedCore({\n serverURL: url,\n })\n\n const sdkHooks = client._options.hooks || new NativeSDKHooks()\n\n sdkHooks.registerBeforeRequestHook(apiVersionHook)\n\n if (headers) {\n const defaultHeaderHook: BeforeRequestHook = {\n beforeRequest: (context, request) => {\n const headersInstance = new Headers(headers)\n headersInstance.forEach((headerValue, headerName) => {\n if (headerValue) {\n request.headers.set(headerName, headerValue)\n }\n })\n return request\n },\n }\n sdkHooks.registerBeforeRequestHook(defaultHeaderHook)\n }\n\n if (hooks?.beforeCreateRequest) {\n hooks.beforeCreateRequest.forEach(hook => {\n sdkHooks.registerBeforeCreateRequestHook(hook)\n })\n }\n\n if (hooks?.beforeRequest) {\n hooks.beforeRequest.forEach(hook => {\n sdkHooks.registerBeforeRequestHook(hook)\n })\n }\n\n if (hooks?.afterSuccess) {\n hooks.afterSuccess.forEach(hook => {\n sdkHooks.registerAfterSuccessHook(hook)\n })\n }\n\n if (hooks?.afterError) {\n hooks.afterError.forEach(hook => {\n sdkHooks.registerAfterErrorHook(hook)\n })\n }\n\n if (!client._options.hooks) {\n client._options.hooks = sdkHooks\n }\n\n return client\n }, [url, headers, hooks])\n\n const queryClient = useMemo(() => {\n return queryClientFromProps ?? createSdkQueryClient()\n }, [queryClientFromProps])\n\n return (\n <QueryClientProvider client={queryClient}>\n <GustoEmbeddedProvider client={gustoClient}>{children}</GustoEmbeddedProvider>\n </QueryClientProvider>\n )\n}\n"],"names":["ApiProvider","url","headers","hooks","children","queryClientFromProps","gustoClient","useMemo","client","GustoEmbeddedCore","sdkHooks","NativeSDKHooks","apiVersionHook","defaultHeaderHook","context","request","headerValue","headerName","hook","queryClient","createSdkQueryClient","jsx","QueryClientProvider","GustoEmbeddedProvider"],"mappings":";;;;;;;;AAiBO,SAASA,EAAY;AAAA,EAC1B,KAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAaC;AACf,GAAqB;AACnB,QAAMC,IAAcC,EAAQ,MAAM;AAChC,UAAMC,IAAS,IAAIC,EAAkB;AAAA,MACnC,WAAWR;AAAA,IAAA,CACZ,GAEKS,IAAWF,EAAO,SAAS,SAAS,IAAIG,EAAA;AAI9C,QAFAD,EAAS,0BAA0BE,CAAc,GAE7CV,GAAS;AACX,YAAMW,IAAuC;AAAA,QAC3C,eAAe,CAACC,GAASC,OACC,IAAI,QAAQb,CAAO,EAC3B,QAAQ,CAACc,GAAaC,MAAe;AACnD,UAAID,KACFD,EAAQ,QAAQ,IAAIE,GAAYD,CAAW;AAAA,QAE/C,CAAC,GACMD;AAAA,MACT;AAEF,MAAAL,EAAS,0BAA0BG,CAAiB;AAAA,IACtD;AAEA,WAAIV,GAAO,uBACTA,EAAM,oBAAoB,QAAQ,CAAAe,MAAQ;AACxC,MAAAR,EAAS,gCAAgCQ,CAAI;AAAA,IAC/C,CAAC,GAGCf,GAAO,iBACTA,EAAM,cAAc,QAAQ,CAAAe,MAAQ;AAClC,MAAAR,EAAS,0BAA0BQ,CAAI;AAAA,IACzC,CAAC,GAGCf,GAAO,gBACTA,EAAM,aAAa,QAAQ,CAAAe,MAAQ;AACjC,MAAAR,EAAS,yBAAyBQ,CAAI;AAAA,IACxC,CAAC,GAGCf,GAAO,cACTA,EAAM,WAAW,QAAQ,CAAAe,MAAQ;AAC/B,MAAAR,EAAS,uBAAuBQ,CAAI;AAAA,IACtC,CAAC,GAGEV,EAAO,SAAS,UACnBA,EAAO,SAAS,QAAQE,IAGnBF;AAAA,EACT,GAAG,CAACP,GAAKC,GAASC,CAAK,CAAC,GAElBgB,IAAcZ,EAAQ,MACnBF,KAAwBe,EAAA,GAC9B,CAACf,CAAoB,CAAC;AAEzB,SACE,gBAAAgB,EAACC,KAAoB,QAAQH,GAC3B,4BAACI,GAAA,EAAsB,QAAQjB,GAAc,UAAAF,EAAA,CAAS,EAAA,CACxD;AAEJ;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a QueryClient pre-configured with the SDK's defaults for queries and
|
|
4
|
+
* mutations under the `['@gusto/embedded-api']` key:
|
|
5
|
+
*
|
|
6
|
+
* - `retry: false` on both queries and mutations.
|
|
7
|
+
* - On any successful mutation, all SDK queries are invalidated so the next
|
|
8
|
+
* read sees fresh data.
|
|
9
|
+
*
|
|
10
|
+
* `ApiProvider` uses this when no `queryClient` prop is supplied. `GustoTestProvider`
|
|
11
|
+
* uses it so tests faithfully replicate production mutation/refetch behavior.
|
|
12
|
+
*
|
|
13
|
+
* Partners who supply their own `QueryClient` to `ApiProvider` are responsible
|
|
14
|
+
* for configuring equivalent defaults if they want mutations to invalidate
|
|
15
|
+
* cached reads.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createSdkQueryClient(): QueryClient;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { QueryClient as t } from "@tanstack/react-query";
|
|
2
|
+
function a() {
|
|
3
|
+
const e = new t();
|
|
4
|
+
return e.setQueryDefaults(["@gusto/embedded-api"], { retry: !1 }), e.setMutationDefaults(["@gusto/embedded-api"], {
|
|
5
|
+
retry: !1,
|
|
6
|
+
onSuccess: async () => {
|
|
7
|
+
await e.invalidateQueries({ queryKey: ["@gusto/embedded-api"] });
|
|
8
|
+
}
|
|
9
|
+
}), e;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
a as createSdkQueryClient
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=createSdkQueryClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSdkQueryClient.js","sources":["../../../src/contexts/ApiProvider/createSdkQueryClient.ts"],"sourcesContent":["import { QueryClient } from '@tanstack/react-query'\n\n/**\n * Creates a QueryClient pre-configured with the SDK's defaults for queries and\n * mutations under the `['@gusto/embedded-api']` key:\n *\n * - `retry: false` on both queries and mutations.\n * - On any successful mutation, all SDK queries are invalidated so the next\n * read sees fresh data.\n *\n * `ApiProvider` uses this when no `queryClient` prop is supplied. `GustoTestProvider`\n * uses it so tests faithfully replicate production mutation/refetch behavior.\n *\n * Partners who supply their own `QueryClient` to `ApiProvider` are responsible\n * for configuring equivalent defaults if they want mutations to invalidate\n * cached reads.\n */\nexport function createSdkQueryClient(): QueryClient {\n const client = new QueryClient()\n client.setQueryDefaults(['@gusto/embedded-api'], { retry: false })\n client.setMutationDefaults(['@gusto/embedded-api'], {\n retry: false,\n onSuccess: async () => {\n await client.invalidateQueries({ queryKey: ['@gusto/embedded-api'] })\n },\n })\n return client\n}\n"],"names":["createSdkQueryClient","client","QueryClient"],"mappings":";AAiBO,SAASA,IAAoC;AAClD,QAAMC,IAAS,IAAIC,EAAA;AACnB,SAAAD,EAAO,iBAAiB,CAAC,qBAAqB,GAAG,EAAE,OAAO,IAAO,GACjEA,EAAO,oBAAoB,CAAC,qBAAqB,GAAG;AAAA,IAClD,OAAO;AAAA,IACP,WAAW,YAAY;AACrB,YAAMA,EAAO,kBAAkB,EAAE,UAAU,CAAC,qBAAqB,GAAG;AAAA,IACtE;AAAA,EAAA,CACD,GACMA;AACT;"}
|
|
@@ -4,40 +4,40 @@ const s = (t) => {
|
|
|
4
4
|
if (/^\d{4}-\d{2}-\d{2}$/.test(t)) {
|
|
5
5
|
const n = t.split("-");
|
|
6
6
|
if (n.length !== 3) return null;
|
|
7
|
-
const r = n.map(Number), o = r[0],
|
|
8
|
-
return o === void 0 ||
|
|
7
|
+
const r = n.map(Number), o = r[0], a = r[1], i = r[2];
|
|
8
|
+
return o === void 0 || a === void 0 || i === void 0 || isNaN(o) || isNaN(a) || isNaN(i) || a < 1 || a > 12 || i < 1 || i > 31 ? null : new Date(o, a - 1, i);
|
|
9
9
|
}
|
|
10
10
|
const e = new Date(t);
|
|
11
11
|
return isNaN(e.getTime()) ? null : e;
|
|
12
12
|
}
|
|
13
13
|
return t instanceof Date ? isNaN(t.getTime()) ? null : t : null;
|
|
14
|
-
},
|
|
14
|
+
}, c = (t) => (e, n) => {
|
|
15
15
|
const r = s(e);
|
|
16
16
|
return r ? r.toLocaleDateString(n, t) : "";
|
|
17
|
-
},
|
|
17
|
+
}, h = c({
|
|
18
18
|
weekday: "short",
|
|
19
19
|
month: "short",
|
|
20
20
|
day: "numeric"
|
|
21
|
-
}),
|
|
21
|
+
}), f = c({
|
|
22
22
|
weekday: "short",
|
|
23
23
|
month: "short",
|
|
24
24
|
day: "numeric",
|
|
25
25
|
year: "numeric"
|
|
26
|
-
}), y =
|
|
26
|
+
}), y = c({
|
|
27
27
|
month: "short",
|
|
28
28
|
day: "numeric"
|
|
29
|
-
}), S =
|
|
29
|
+
}), S = c({
|
|
30
30
|
month: "short",
|
|
31
31
|
day: "numeric",
|
|
32
32
|
year: "numeric"
|
|
33
|
-
}), N =
|
|
33
|
+
}), N = c({
|
|
34
34
|
month: "long",
|
|
35
35
|
day: "numeric"
|
|
36
|
-
}),
|
|
36
|
+
}), w = c({
|
|
37
37
|
month: "long",
|
|
38
38
|
day: "numeric",
|
|
39
39
|
year: "numeric"
|
|
40
|
-
}),
|
|
40
|
+
}), T = (t, e) => {
|
|
41
41
|
const n = s(t);
|
|
42
42
|
if (!n) return { time: "", date: "" };
|
|
43
43
|
const r = n.toLocaleTimeString(e, {
|
|
@@ -51,98 +51,94 @@ const s = (t) => {
|
|
|
51
51
|
day: "numeric"
|
|
52
52
|
});
|
|
53
53
|
return { time: r, date: o };
|
|
54
|
-
},
|
|
54
|
+
}, M = (t, e, n) => {
|
|
55
55
|
const r = s(t), o = s(e);
|
|
56
56
|
if (!r || !o)
|
|
57
57
|
return { startDate: "", endDate: "" };
|
|
58
|
-
const
|
|
58
|
+
const a = r.toLocaleDateString(n, {
|
|
59
59
|
month: "long",
|
|
60
60
|
day: "numeric"
|
|
61
|
-
}),
|
|
61
|
+
}), i = o.toLocaleDateString(n, {
|
|
62
62
|
month: "short",
|
|
63
63
|
day: "numeric",
|
|
64
64
|
year: "numeric"
|
|
65
65
|
});
|
|
66
|
-
return { startDate:
|
|
67
|
-
},
|
|
68
|
-
const o = s(t),
|
|
69
|
-
if (!o || !
|
|
70
|
-
const
|
|
71
|
-
month:
|
|
66
|
+
return { startDate: a, endDate: i };
|
|
67
|
+
}, $ = (t, e, n, r) => {
|
|
68
|
+
const o = s(t), a = s(e);
|
|
69
|
+
if (!o || !a) return "";
|
|
70
|
+
const i = r?.useShortMonth ? "short" : "long", u = o.toLocaleDateString(n, {
|
|
71
|
+
month: i,
|
|
72
72
|
day: "numeric"
|
|
73
|
-
}),
|
|
74
|
-
month:
|
|
73
|
+
}), D = a.toLocaleDateString(n, {
|
|
74
|
+
month: i,
|
|
75
75
|
day: "numeric",
|
|
76
76
|
year: "numeric"
|
|
77
77
|
});
|
|
78
|
-
return `${
|
|
79
|
-
},
|
|
78
|
+
return `${u}–${D}`;
|
|
79
|
+
}, L = (t) => {
|
|
80
|
+
if (isNaN(t.getTime()))
|
|
81
|
+
return null;
|
|
82
|
+
const e = String(t.getFullYear()).padStart(4, "0"), n = String(t.getMonth() + 1).padStart(2, "0"), r = String(t.getDate()).padStart(2, "0");
|
|
83
|
+
return `${e}-${n}-${r}`;
|
|
84
|
+
}, F = (t) => {
|
|
80
85
|
if (!t) return "";
|
|
81
86
|
const e = s(t);
|
|
82
87
|
if (!e) return "";
|
|
83
88
|
const n = e.getFullYear(), r = String(e.getMonth() + 1).padStart(2, "0"), o = String(e.getDate()).padStart(2, "0");
|
|
84
89
|
return `${n}-${r}-${o}`;
|
|
85
|
-
},
|
|
86
|
-
if (!t || isNaN(t.getTime()))
|
|
87
|
-
return null;
|
|
88
|
-
const e = t.toISOString(), [n] = e.split("T");
|
|
89
|
-
if (!n) return null;
|
|
90
|
-
const r = n.split("-");
|
|
91
|
-
if (r.length !== 3) return null;
|
|
92
|
-
const o = r.map(Number), i = o[0], a = o[1], c = o[2];
|
|
93
|
-
return isNaN(i) || isNaN(a) || isNaN(c) || a < 1 || a > 12 || c < 1 || c > 31 ? null : new Date(i, a - 1, c);
|
|
94
|
-
}, m = 1e3 * 60 * 60, d = m * 24, F = (t) => {
|
|
90
|
+
}, W = (t) => !t || isNaN(t.getTime()) ? null : new Date(t.getFullYear(), t.getMonth(), t.getDate()), m = 1e3 * 60 * 60, d = m * 24, Y = (t) => {
|
|
95
91
|
const e = s(t);
|
|
96
92
|
if (!e) return null;
|
|
97
93
|
const n = /* @__PURE__ */ new Date();
|
|
98
94
|
return (e.getTime() - n.getTime()) / m;
|
|
99
|
-
},
|
|
95
|
+
}, k = (t) => {
|
|
100
96
|
const e = s(t);
|
|
101
97
|
if (!e) return null;
|
|
102
98
|
const n = /* @__PURE__ */ new Date();
|
|
103
99
|
return (e.getTime() - n.getTime()) / d;
|
|
104
|
-
},
|
|
100
|
+
}, g = (t) => {
|
|
105
101
|
const e = t.getDay();
|
|
106
102
|
return e === 0 || e === 6;
|
|
107
|
-
},
|
|
103
|
+
}, l = (t, e) => {
|
|
108
104
|
const n = new Date(t);
|
|
109
105
|
return n.setDate(n.getDate() + e), n;
|
|
110
|
-
},
|
|
106
|
+
}, p = (t, e) => {
|
|
111
107
|
let n = new Date(t);
|
|
112
108
|
n.setHours(0, 0, 0, 0);
|
|
113
109
|
let r = 0;
|
|
114
110
|
for (; r < e; )
|
|
115
|
-
n =
|
|
111
|
+
n = l(n, 1), g(n) || r++;
|
|
116
112
|
return n;
|
|
117
113
|
};
|
|
118
|
-
function
|
|
114
|
+
function P(t, e) {
|
|
119
115
|
if (!(t == null || e == null))
|
|
120
116
|
return `${String(t).padStart(2, "0")}-${String(e).padStart(2, "0")}`;
|
|
121
117
|
}
|
|
122
|
-
function
|
|
118
|
+
function R(t) {
|
|
123
119
|
return new Date(2023, t, 0).getDate();
|
|
124
120
|
}
|
|
125
121
|
export {
|
|
126
122
|
m as MS_PER_HOUR,
|
|
127
|
-
|
|
128
|
-
|
|
123
|
+
p as addBusinessDays,
|
|
124
|
+
l as addDays,
|
|
129
125
|
N as formatDateLong,
|
|
130
|
-
|
|
126
|
+
w as formatDateLongWithYear,
|
|
131
127
|
y as formatDateShort,
|
|
132
|
-
|
|
133
|
-
|
|
128
|
+
h as formatDateShortWithWeekday,
|
|
129
|
+
f as formatDateShortWithWeekdayAndYear,
|
|
134
130
|
S as formatDateShortWithYear,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
131
|
+
L as formatDateToStringDate,
|
|
132
|
+
T as formatDateWithTime,
|
|
133
|
+
P as formatMonthDay,
|
|
134
|
+
M as formatPayPeriod,
|
|
135
|
+
$ as formatPayPeriodRange,
|
|
136
|
+
R as getDaysInMonth,
|
|
137
|
+
k as getDaysUntil,
|
|
138
|
+
Y as getHoursUntil,
|
|
139
|
+
g as isWeekend,
|
|
140
|
+
W as normalizeDateToLocal,
|
|
145
141
|
s as normalizeToDate,
|
|
146
|
-
|
|
142
|
+
F as normalizeToISOString
|
|
147
143
|
};
|
|
148
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 * 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\n/** Returns the number of days in a given month (1-indexed). Uses a non-leap year so February always returns 28. */\nexport function getDaysInMonth(month: number): number {\n return new Date(2023, month, 0).getDate()\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","getDaysInMonth"],"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,GA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AQ,KAAKA,MAAQ;AAC9B,GAEasC,IAAU,CAACjC,GAAYkC,MAAuB;AACzD,QAAMC,IAAS,IAAI,KAAKnC,CAAI;AAC5B,SAAAmC,EAAO,QAAQA,EAAO,QAAA,IAAYD,CAAI,GAC/BC;AACT,GAEaC,IAAkB,CAACvB,GAAiBwB,MAA+B;AAC9E,MAAIC,IAAc,IAAI,KAAKzB,CAAS;AACpC,EAAAyB,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,EAAe9C,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;AAGO,SAAS8C,EAAe/C,GAAuB;AACpD,SAAO,IAAI,KAAK,MAAMA,GAAO,CAAC,EAAE,QAAA;AAClC;"}
|
|
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 const year = String(date.getFullYear()).padStart(4, '0')\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 * 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 return new Date(date.getFullYear(), date.getMonth(), date.getDate())\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\n/** Returns the number of days in a given month (1-indexed). Uses a non-leap year so February always returns 28. */\nexport function getDaysInMonth(month: number): number {\n return new Date(2023, month, 0).getDate()\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","MS_PER_HOUR","MS_PER_DAY","getHoursUntil","deadline","deadlineDate","now","getDaysUntil","isWeekend","addDays","days","result","addBusinessDays","businessDays","currentDate","daysAdded","formatMonthDay","getDaysInMonth"],"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,KAA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"}
|
|
@@ -22,6 +22,18 @@ export declare const formatPayRate: ({ rate, paymentUnit, t, locale, }: {
|
|
|
22
22
|
locale?: string;
|
|
23
23
|
}) => string;
|
|
24
24
|
export declare const useFormatPayRate: () => (rate: number, paymentUnit: string) => string;
|
|
25
|
+
/**
|
|
26
|
+
* Formats a compensation rate as-is, without annualizing weekly or monthly
|
|
27
|
+
* values. Use this for displaying compensation card data where the stored rate
|
|
28
|
+
* should be shown directly (e.g. "$950 per week", "$3,500 per month").
|
|
29
|
+
*/
|
|
30
|
+
export declare const formatCompensationRate: ({ rate, paymentUnit, t, locale, }: {
|
|
31
|
+
rate: number;
|
|
32
|
+
paymentUnit: string;
|
|
33
|
+
t: TFunction;
|
|
34
|
+
locale?: string;
|
|
35
|
+
}) => string;
|
|
36
|
+
export declare const useFormatCompensationRate: () => (rate: number, paymentUnit: string) => string;
|
|
25
37
|
export declare function createMarkup(dirty: string): {
|
|
26
38
|
__html: string;
|
|
27
39
|
};
|