@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HolidayPolicyDetail.js","sources":["../../../../src/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.tsx"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useQueryClient } from '@tanstack/react-query'\nimport {\n useHolidayPayPoliciesGetSuspense,\n invalidateAllHolidayPayPoliciesGet,\n} from '@gusto/embedded-api/react-query/holidayPayPoliciesGet'\nimport { useHolidayPayPoliciesRemoveEmployeesMutation } from '@gusto/embedded-api/react-query/holidayPayPoliciesRemoveEmployees'\nimport { useEmployeesListSuspense } from '@gusto/embedded-api/react-query/employeesList'\nimport { getDefaultHolidayItems } from '../shared/holidayHelpers'\nimport { HolidayPolicyDetailPresentation } from './HolidayPolicyDetailPresentation'\nimport type { HolidayPolicyDetailEmployee } from './HolidayPolicyDetailTypes'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { firstLastName } from '@/helpers/formattedStrings'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport EditIcon from '@/assets/icons/edit-02.svg?react'\nimport PlusCircleIcon from '@/assets/icons/plus-circle.svg?react'\n\nexport interface HolidayPolicyDetailProps extends BaseComponentInterface {\n companyId: string\n defaultTab?: 'holidays' | 'employees'\n}\n\nexport function HolidayPolicyDetail(props: HolidayPolicyDetailProps) {\n return (\n <BaseComponent {...props} componentName=\"Company.TimeOff.HolidayPolicy\">\n <Root {...props} />\n </BaseComponent>\n )\n}\n\ninterface RemoveDialogTarget {\n uuid: string\n name: string\n}\n\nfunction Root({ companyId, defaultTab = 'holidays' }: HolidayPolicyDetailProps) {\n useI18n('Company.TimeOff.HolidayPolicy')\n useI18n('Company.TimeOff.PolicyDetail')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n const { t: tShared } = useTranslation('Company.TimeOff.PolicyDetail')\n const { Button } = useComponentContext()\n const { locale } = useLocale()\n const queryClient = useQueryClient()\n const { onEvent, baseSubmitHandler } = useBase()\n\n const [selectedTabId, setSelectedTabId] = useState<string>(defaultTab)\n const [searchValue, setSearchValue] = useState('')\n const [successAlert, setSuccessAlert] = useState<string | null>(null)\n const [removeDialogTarget, setRemoveDialogTarget] = useState<RemoveDialogTarget | null>(null)\n\n const holidayQuery = useHolidayPayPoliciesGetSuspense({ companyUuid: companyId })\n const holidayPayPolicy = holidayQuery.data.holidayPayPolicy!\n\n const { data: employeesData } = useEmployeesListSuspense({\n companyId,\n terminated: false,\n })\n\n const removeEmployeesMutation = useHolidayPayPoliciesRemoveEmployeesMutation()\n\n const holidays = useMemo(() => {\n const allHolidays = getDefaultHolidayItems(t, undefined, locale)\n const { federalHolidays } = holidayPayPolicy\n return allHolidays.filter(holiday => {\n const holidayData = federalHolidays[holiday.uuid as keyof typeof federalHolidays]\n return holidayData?.selected === true\n })\n }, [t, holidayPayPolicy, locale])\n\n const policyEmployeeUuids = useMemo(\n () => new Set(holidayPayPolicy.employees.map(e => e.uuid)),\n [holidayPayPolicy.employees],\n )\n\n const employees: HolidayPolicyDetailEmployee[] = useMemo(() => {\n const allEmployees = employeesData.showEmployees ?? []\n return allEmployees\n .filter(emp => policyEmployeeUuids.has(emp.uuid))\n .map(emp => ({\n uuid: emp.uuid,\n firstName: emp.firstName,\n lastName: emp.lastName,\n jobTitle: emp.title ?? null,\n }))\n }, [employeesData.showEmployees, policyEmployeeUuids])\n\n const filteredEmployees = useMemo(() => {\n if (!searchValue) return employees\n const query = searchValue.toLowerCase()\n return employees.filter(emp => {\n const name = firstLastName({\n first_name: emp.firstName,\n last_name: emp.lastName,\n }).toLowerCase()\n return name.includes(query)\n })\n }, [employees, searchValue])\n\n const handleRemoveEmployee = async () => {\n if (!removeDialogTarget) return\n\n const targetUuid = removeDialogTarget.uuid\n const targetName = removeDialogTarget.name\n setRemoveDialogTarget(null)\n\n await baseSubmitHandler({}, async () => {\n await removeEmployeesMutation.mutateAsync({\n request: {\n companyUuid: companyId,\n requestBody: {\n version: holidayPayPolicy.version!,\n employees: [{ uuid: targetUuid }],\n },\n },\n })\n await invalidateAllHolidayPayPoliciesGet(queryClient)\n setSuccessAlert(t('flash.employeeRemoved', { name: targetName }))\n })\n }\n\n const handleBack = () => {\n onEvent(componentEvents.TIME_OFF_BACK_TO_LIST)\n }\n\n const handleAddEmployees = () => {\n onEvent(componentEvents.TIME_OFF_HOLIDAY_ADD_EMPLOYEES)\n }\n\n const handleEditPolicy = () => {\n onEvent(componentEvents.TIME_OFF_EDIT_HOLIDAY_POLICY)\n }\n\n const actions = [\n <Button\n key=\"add\"\n variant=\"secondary\"\n icon={<PlusCircleIcon aria-hidden />}\n onClick={handleAddEmployees}\n >\n {t('show.addEmployeesCta')}\n </Button>,\n <Button\n key=\"edit\"\n variant=\"secondary\"\n icon={<EditIcon aria-hidden />}\n onClick={handleEditPolicy}\n >\n {t('show.editPolicyCta')}\n </Button>,\n ]\n\n return (\n <HolidayPolicyDetailPresentation\n title={t('show.title')}\n onBack={handleBack}\n backLabel={tShared('backLabel')}\n actions={actions}\n holidays={holidays}\n selectedTabId={selectedTabId}\n onTabChange={setSelectedTabId}\n employees={{\n data: filteredEmployees,\n searchValue,\n onSearchChange: setSearchValue,\n onSearchClear: () => {\n setSearchValue('')\n },\n itemMenu: employee => (\n <HamburgerMenu\n items={[\n {\n label: tShared('removeEmployeeDialog.confirmCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n setRemoveDialogTarget({\n uuid: employee.uuid,\n name: firstLastName({\n first_name: employee.firstName,\n last_name: employee.lastName,\n }),\n })\n },\n },\n ]}\n triggerLabel={tShared('employeeActions', {\n name: firstLastName({ first_name: employee.firstName, last_name: employee.lastName }),\n })}\n />\n ),\n }}\n removeDialog={{\n isOpen: removeDialogTarget !== null,\n employeeName: removeDialogTarget?.name ?? '',\n onConfirm: handleRemoveEmployee,\n onClose: () => {\n setRemoveDialogTarget(null)\n },\n isPending: removeEmployeesMutation.isPending,\n }}\n successAlert={successAlert ?? undefined}\n onDismissAlert={() => {\n setSuccessAlert(null)\n }}\n />\n )\n}\n"],"names":["HolidayPolicyDetail","props","jsx","BaseComponent","Root","companyId","defaultTab","useI18n","t","useTranslation","tShared","Button","useComponentContext","locale","useLocale","queryClient","useQueryClient","onEvent","baseSubmitHandler","useBase","selectedTabId","setSelectedTabId","useState","searchValue","setSearchValue","successAlert","setSuccessAlert","removeDialogTarget","setRemoveDialogTarget","holidayPayPolicy","useHolidayPayPoliciesGetSuspense","employeesData","useEmployeesListSuspense","removeEmployeesMutation","useHolidayPayPoliciesRemoveEmployeesMutation","holidays","useMemo","allHolidays","getDefaultHolidayItems","federalHolidays","holiday","policyEmployeeUuids","employees","emp","filteredEmployees","query","firstLastName","handleRemoveEmployee","targetUuid","targetName","invalidateAllHolidayPayPoliciesGet","handleBack","componentEvents","handleAddEmployees","handleEditPolicy","actions","PlusCircleIcon","EditIcon","HolidayPolicyDetailPresentation","employee","HamburgerMenu","TrashCanSvg"],"mappings":";;;;;;;;;;;;;;;;;;;;AA6BO,SAASA,GAAoBC,GAAiC;AACnE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GAAO,eAAc,iCACtC,UAAA,gBAAAC,EAACE,IAAA,EAAM,GAAGH,EAAA,CAAO,EAAA,CACnB;AAEJ;AAOA,SAASG,GAAK,EAAE,WAAAC,GAAW,YAAAC,IAAa,cAAwC;AAC9E,EAAAC,EAAQ,+BAA+B,GACvCA,EAAQ,8BAA8B;AACtC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,+BAA+B,GACtD,EAAE,GAAGC,MAAYD,EAAe,8BAA8B,GAC9D,EAAE,QAAAE,EAAA,IAAWC,EAAA,GACb,EAAE,QAAAC,EAAA,IAAWC,EAAA,GACbC,IAAcC,EAAA,GACd,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GAEjC,CAACC,GAAeC,CAAgB,IAAIC,EAAiBhB,CAAU,GAC/D,CAACiB,GAAaC,CAAc,IAAIF,EAAS,EAAE,GAC3C,CAACG,GAAcC,CAAe,IAAIJ,EAAwB,IAAI,GAC9D,CAACK,GAAoBC,CAAqB,IAAIN,EAAoC,IAAI,GA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AAAA,MACA,aAAaC;AAAA,MACb,WAAW;AAAA,QACT,MAAMuB;AAAA,QACN,aAAArB;AAAA,QACA,gBAAgBC;AAAA,QAChB,eAAe,MAAM;AACnB,UAAAA,EAAe,EAAE;AAAA,QACnB;AAAA,QACA,UAAU,CAAAmC,MACR,gBAAAzD;AAAA,UAAC0D;AAAA,UAAA;AAAA,YACC,OAAO;AAAA,cACL;AAAA,gBACE,OAAOlD,EAAQ,iCAAiC;AAAA,gBAChD,MAAM,gBAAAR,EAAC2D,GAAA,EAAY,eAAW,GAAA,CAAC;AAAA,gBAC/B,SAAS,MAAM;AACb,kBAAAjC,EAAsB;AAAA,oBACpB,MAAM+B,EAAS;AAAA,oBACf,MAAMb,EAAc;AAAA,sBAClB,YAAYa,EAAS;AAAA,sBACrB,WAAWA,EAAS;AAAA,oBAAA,CACrB;AAAA,kBAAA,CACF;AAAA,gBACH;AAAA,cAAA;AAAA,YACF;AAAA,YAEF,cAAcjD,EAAQ,mBAAmB;AAAA,cACvC,MAAMoC,EAAc,EAAE,YAAYa,EAAS,WAAW,WAAWA,EAAS,SAAA,CAAU;AAAA,YAAA,CACrF;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,MAGJ,cAAc;AAAA,QACZ,QAAQhC,MAAuB;AAAA,QAC/B,cAAcA,GAAoB,QAAQ;AAAA,QAC1C,WAAWoB;AAAA,QACX,SAAS,MAAM;AACb,UAAAnB,EAAsB,IAAI;AAAA,QAC5B;AAAA,QACA,WAAWK,EAAwB;AAAA,MAAA;AAAA,MAErC,cAAcR,KAAgB;AAAA,MAC9B,gBAAgB,MAAM;AACpB,QAAAC,EAAgB,IAAI;AAAA,MACtB;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
1
|
+
{"version":3,"file":"HolidayPolicyDetail.js","sources":["../../../../src/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.tsx"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useQueryClient } from '@tanstack/react-query'\nimport {\n useHolidayPayPoliciesGetSuspense,\n invalidateAllHolidayPayPoliciesGet,\n} from '@gusto/embedded-api/react-query/holidayPayPoliciesGet'\nimport { useHolidayPayPoliciesRemoveEmployeesMutation } from '@gusto/embedded-api/react-query/holidayPayPoliciesRemoveEmployees'\nimport { useEmployeesListSuspense } from '@gusto/embedded-api/react-query/employeesList'\nimport { getDefaultHolidayItems } from '../shared/holidayHelpers'\nimport { HolidayPolicyDetailPresentation } from './HolidayPolicyDetailPresentation'\nimport type { HolidayPolicyDetailEmployee } from './HolidayPolicyDetailTypes'\nimport { useClientPagination } from '@/hooks/useClientPagination/useClientPagination'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { firstLastName } from '@/helpers/formattedStrings'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport EditIcon from '@/assets/icons/edit-02.svg?react'\nimport PlusCircleIcon from '@/assets/icons/plus-circle.svg?react'\n\nexport interface HolidayPolicyDetailProps extends BaseComponentInterface {\n companyId: string\n defaultTab?: 'holidays' | 'employees'\n}\n\nexport function HolidayPolicyDetail(props: HolidayPolicyDetailProps) {\n return (\n <BaseComponent {...props} componentName=\"Company.TimeOff.HolidayPolicy\">\n <Root {...props} />\n </BaseComponent>\n )\n}\n\ninterface RemoveDialogTarget {\n uuid: string\n name: string\n}\n\nfunction Root({ companyId, defaultTab = 'holidays' }: HolidayPolicyDetailProps) {\n useI18n('Company.TimeOff.HolidayPolicy')\n useI18n('Company.TimeOff.PolicyDetail')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n const { t: tShared } = useTranslation('Company.TimeOff.PolicyDetail')\n const { Button } = useComponentContext()\n const { locale } = useLocale()\n const queryClient = useQueryClient()\n const { onEvent, baseSubmitHandler } = useBase()\n\n const [selectedTabId, setSelectedTabId] = useState<string>(defaultTab)\n const [successAlert, setSuccessAlert] = useState<string | null>(null)\n const [removeDialogTarget, setRemoveDialogTarget] = useState<RemoveDialogTarget | null>(null)\n\n const holidayQuery = useHolidayPayPoliciesGetSuspense({ companyUuid: companyId })\n const holidayPayPolicy = holidayQuery.data.holidayPayPolicy!\n\n const { data: employeesData } = useEmployeesListSuspense({\n companyId,\n terminated: false,\n })\n\n const removeEmployeesMutation = useHolidayPayPoliciesRemoveEmployeesMutation()\n\n const holidays = useMemo(() => {\n const allHolidays = getDefaultHolidayItems(t, undefined, locale)\n const { federalHolidays } = holidayPayPolicy\n return allHolidays.filter(holiday => {\n const holidayData = federalHolidays[holiday.uuid as keyof typeof federalHolidays]\n return holidayData?.selected === true\n })\n }, [t, holidayPayPolicy, locale])\n\n const policyEmployeeUuids = useMemo(\n () => new Set(holidayPayPolicy.employees.map(e => e.uuid)),\n [holidayPayPolicy.employees],\n )\n\n const employees: HolidayPolicyDetailEmployee[] = useMemo(() => {\n const allEmployees = employeesData.showEmployees ?? []\n return allEmployees\n .filter(emp => policyEmployeeUuids.has(emp.uuid))\n .map(emp => ({\n uuid: emp.uuid,\n firstName: emp.firstName,\n lastName: emp.lastName,\n jobTitle: emp.jobs?.find(job => job.primary)?.title ?? null,\n }))\n }, [employeesData.showEmployees, policyEmployeeUuids])\n\n const {\n data: pagedEmployees,\n pagination,\n searchValue,\n actions: paginationActions,\n } = useClientPagination(employees, {\n defaultItemsPerPage: 10,\n searchPredicate: (emp, query) =>\n `${emp.firstName ?? ''} ${emp.lastName ?? ''}`.toLowerCase().includes(query.toLowerCase()),\n })\n\n const handleRemoveEmployee = async () => {\n if (!removeDialogTarget) return\n\n const targetUuid = removeDialogTarget.uuid\n const targetName = removeDialogTarget.name\n setRemoveDialogTarget(null)\n\n await baseSubmitHandler({}, async () => {\n await removeEmployeesMutation.mutateAsync({\n request: {\n companyUuid: companyId,\n requestBody: {\n version: holidayPayPolicy.version!,\n employees: [{ uuid: targetUuid }],\n },\n },\n })\n await invalidateAllHolidayPayPoliciesGet(queryClient)\n setSuccessAlert(t('flash.employeeRemoved', { name: targetName }))\n })\n }\n\n const handleBack = () => {\n onEvent(componentEvents.TIME_OFF_BACK_TO_LIST)\n }\n\n const handleAddEmployees = () => {\n onEvent(componentEvents.TIME_OFF_HOLIDAY_ADD_EMPLOYEES)\n }\n\n const handleEditPolicy = () => {\n onEvent(componentEvents.TIME_OFF_EDIT_HOLIDAY_POLICY)\n }\n\n const actions = [\n <Button\n key=\"add\"\n variant=\"secondary\"\n icon={<PlusCircleIcon aria-hidden />}\n onClick={handleAddEmployees}\n >\n {t('show.addEmployeesCta')}\n </Button>,\n <Button\n key=\"edit\"\n variant=\"secondary\"\n icon={<EditIcon aria-hidden />}\n onClick={handleEditPolicy}\n >\n {t('show.editPolicyCta')}\n </Button>,\n ]\n\n return (\n <HolidayPolicyDetailPresentation\n title={t('show.title')}\n onBack={handleBack}\n backLabel={tShared('backLabel')}\n actions={actions}\n onAddEmployee={handleAddEmployees}\n holidays={holidays}\n selectedTabId={selectedTabId}\n onTabChange={setSelectedTabId}\n employees={{\n data: pagedEmployees,\n searchValue,\n onSearchChange: paginationActions.onSearchChange,\n onSearchClear: paginationActions.onSearchClear,\n pagination,\n itemMenu: employee => (\n <HamburgerMenu\n items={[\n {\n label: tShared('removeEmployeeDialog.confirmCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n setRemoveDialogTarget({\n uuid: employee.uuid,\n name: firstLastName({\n first_name: employee.firstName,\n last_name: employee.lastName,\n }),\n })\n },\n },\n ]}\n triggerLabel={tShared('employeeActions', {\n name: firstLastName({ first_name: employee.firstName, last_name: employee.lastName }),\n })}\n />\n ),\n }}\n removeDialog={{\n isOpen: removeDialogTarget !== null,\n employeeName: removeDialogTarget?.name ?? '',\n onConfirm: handleRemoveEmployee,\n onClose: () => {\n setRemoveDialogTarget(null)\n },\n isPending: removeEmployeesMutation.isPending,\n }}\n successAlert={successAlert ?? undefined}\n onDismissAlert={() => {\n setSuccessAlert(null)\n }}\n />\n )\n}\n"],"names":["HolidayPolicyDetail","props","jsx","BaseComponent","Root","companyId","defaultTab","useI18n","t","useTranslation","tShared","Button","useComponentContext","locale","useLocale","queryClient","useQueryClient","onEvent","baseSubmitHandler","useBase","selectedTabId","setSelectedTabId","useState","successAlert","setSuccessAlert","removeDialogTarget","setRemoveDialogTarget","holidayPayPolicy","useHolidayPayPoliciesGetSuspense","employeesData","useEmployeesListSuspense","removeEmployeesMutation","useHolidayPayPoliciesRemoveEmployeesMutation","holidays","useMemo","allHolidays","getDefaultHolidayItems","federalHolidays","holiday","policyEmployeeUuids","employees","emp","job","pagedEmployees","pagination","searchValue","paginationActions","useClientPagination","query","handleRemoveEmployee","targetUuid","targetName","invalidateAllHolidayPayPoliciesGet","handleBack","componentEvents","handleAddEmployees","handleEditPolicy","actions","PlusCircleIcon","EditIcon","HolidayPolicyDetailPresentation","employee","HamburgerMenu","TrashCanSvg","firstLastName"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA8BO,SAASA,GAAoBC,GAAiC;AACnE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GAAO,eAAc,iCACtC,UAAA,gBAAAC,EAACE,IAAA,EAAM,GAAGH,EAAA,CAAO,EAAA,CACnB;AAEJ;AAOA,SAASG,GAAK,EAAE,WAAAC,GAAW,YAAAC,IAAa,cAAwC;AAC9E,EAAAC,EAAQ,+BAA+B,GACvCA,EAAQ,8BAA8B;AACtC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,+BAA+B,GACtD,EAAE,GAAGC,MAAYD,EAAe,8BAA8B,GAC9D,EAAE,QAAAE,EAAA,IAAWC,EAAA,GACb,EAAE,QAAAC,EAAA,IAAWC,EAAA,GACbC,IAAcC,EAAA,GACd,EAAE,SAAAC,GAAS,mBAAAC,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I;AAAA,MACtB;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { HolidayPolicyDetailPresentationProps } from './HolidayPolicyDetailTypes';
|
|
2
|
-
export declare function HolidayPolicyDetailPresentation({ title, subtitle, onBack, backLabel, actions, holidays, selectedTabId, onTabChange, employees, removeDialog, successAlert, onDismissAlert, }: HolidayPolicyDetailPresentationProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function HolidayPolicyDetailPresentation({ title, subtitle, onBack, backLabel, actions, holidays, selectedTabId, onTabChange, employees, onAddEmployee, removeDialog, successAlert, onDismissAlert, }: HolidayPolicyDetailPresentationProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,80 +1,81 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { useTranslation as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as D } from "react";
|
|
3
|
+
import { useTranslation as n } from "react-i18next";
|
|
4
4
|
import "classnames";
|
|
5
5
|
import "../../../shared/constants.js";
|
|
6
|
-
import {
|
|
7
|
-
import { useI18n as d } from "../../../i18n/I18n.js";
|
|
6
|
+
import { useI18n as l } from "../../../i18n/I18n.js";
|
|
8
7
|
import { PolicyDetailLayout as T } from "../shared/PolicyDetailLayout/PolicyDetailLayout.js";
|
|
9
|
-
import { useDataView as
|
|
10
|
-
import { DataView as
|
|
11
|
-
const
|
|
12
|
-
function
|
|
13
|
-
title:
|
|
8
|
+
import { useDataView as O } from "../../Common/DataView/useDataView.js";
|
|
9
|
+
import { DataView as P } from "../../Common/DataView/DataView.js";
|
|
10
|
+
const v = "holidays";
|
|
11
|
+
function j({
|
|
12
|
+
title: t,
|
|
14
13
|
subtitle: e,
|
|
15
|
-
onBack:
|
|
16
|
-
backLabel:
|
|
17
|
-
actions:
|
|
18
|
-
holidays:
|
|
19
|
-
selectedTabId:
|
|
20
|
-
onTabChange:
|
|
21
|
-
employees:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
onBack: a,
|
|
15
|
+
backLabel: i,
|
|
16
|
+
actions: o,
|
|
17
|
+
holidays: s,
|
|
18
|
+
selectedTabId: m,
|
|
19
|
+
onTabChange: y,
|
|
20
|
+
employees: d,
|
|
21
|
+
onAddEmployee: f,
|
|
22
|
+
removeDialog: b,
|
|
23
|
+
successAlert: c,
|
|
24
|
+
onDismissAlert: p
|
|
25
25
|
}) {
|
|
26
|
-
|
|
27
|
-
const { t:
|
|
28
|
-
return /* @__PURE__ */
|
|
26
|
+
l("Company.TimeOff.HolidayPolicy");
|
|
27
|
+
const { t: u } = n("Company.TimeOff.HolidayPolicy"), H = /* @__PURE__ */ r(x, { holidays: s });
|
|
28
|
+
return /* @__PURE__ */ r(
|
|
29
29
|
T,
|
|
30
30
|
{
|
|
31
|
-
title:
|
|
31
|
+
title: t,
|
|
32
32
|
subtitle: e,
|
|
33
|
-
onBack:
|
|
34
|
-
backLabel:
|
|
35
|
-
actions:
|
|
33
|
+
onBack: a,
|
|
34
|
+
backLabel: i,
|
|
35
|
+
actions: o,
|
|
36
36
|
firstTab: {
|
|
37
|
-
id:
|
|
38
|
-
label:
|
|
39
|
-
content:
|
|
37
|
+
id: v,
|
|
38
|
+
label: u("tabs.holidays"),
|
|
39
|
+
content: H
|
|
40
40
|
},
|
|
41
|
-
selectedTabId:
|
|
42
|
-
onTabChange:
|
|
43
|
-
employees:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
selectedTabId: m,
|
|
42
|
+
onTabChange: y,
|
|
43
|
+
employees: d,
|
|
44
|
+
onAddEmployee: f,
|
|
45
|
+
removeDialog: b,
|
|
46
|
+
successAlert: c,
|
|
47
|
+
onDismissAlert: p
|
|
47
48
|
}
|
|
48
49
|
);
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
const { t: e } =
|
|
51
|
+
function x({ holidays: t }) {
|
|
52
|
+
l("Company.TimeOff.HolidayPolicy");
|
|
53
|
+
const { t: e } = n("Company.TimeOff.HolidayPolicy"), a = D(
|
|
53
54
|
() => [
|
|
54
55
|
{
|
|
55
56
|
key: "name",
|
|
56
57
|
title: e("tableHeaders.holidayName"),
|
|
57
|
-
render: (
|
|
58
|
+
render: (o) => o.name
|
|
58
59
|
},
|
|
59
60
|
{
|
|
60
61
|
key: "observedDate",
|
|
61
62
|
title: e("tableHeaders.observedDate"),
|
|
62
|
-
render: (
|
|
63
|
+
render: (o) => o.observedDate
|
|
63
64
|
},
|
|
64
65
|
{
|
|
65
66
|
key: "nextObservation",
|
|
66
67
|
title: e("tableHeaders.nextObservation"),
|
|
67
|
-
render: (
|
|
68
|
+
render: (o) => o.nextObservation
|
|
68
69
|
}
|
|
69
70
|
],
|
|
70
|
-
[e
|
|
71
|
-
),
|
|
72
|
-
data:
|
|
73
|
-
columns:
|
|
71
|
+
[e]
|
|
72
|
+
), i = O({
|
|
73
|
+
data: t,
|
|
74
|
+
columns: a
|
|
74
75
|
});
|
|
75
|
-
return /* @__PURE__ */
|
|
76
|
+
return /* @__PURE__ */ r(P, { label: e("tableLabel"), ...i });
|
|
76
77
|
}
|
|
77
78
|
export {
|
|
78
|
-
|
|
79
|
+
j as HolidayPolicyDetailPresentation
|
|
79
80
|
};
|
|
80
81
|
//# sourceMappingURL=HolidayPolicyDetailPresentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HolidayPolicyDetailPresentation.js","sources":["../../../../src/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { HolidayItem } from '../HolidaySelectionForm/HolidaySelectionFormTypes'\nimport { PolicyDetailLayout } from '../shared/PolicyDetailLayout'\nimport type { HolidayPolicyDetailPresentationProps } from './HolidayPolicyDetailTypes'\nimport { DataView, useDataView } from '@/components/Common'\nimport {
|
|
1
|
+
{"version":3,"file":"HolidayPolicyDetailPresentation.js","sources":["../../../../src/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { HolidayItem } from '../HolidaySelectionForm/HolidaySelectionFormTypes'\nimport { PolicyDetailLayout } from '../shared/PolicyDetailLayout'\nimport type { HolidayPolicyDetailPresentationProps } from './HolidayPolicyDetailTypes'\nimport { DataView, useDataView } from '@/components/Common'\nimport { useI18n } from '@/i18n'\n\nconst HOLIDAYS_TAB_ID = 'holidays'\n\nexport function HolidayPolicyDetailPresentation({\n title,\n subtitle,\n onBack,\n backLabel,\n actions,\n holidays,\n selectedTabId,\n onTabChange,\n employees,\n onAddEmployee,\n removeDialog,\n successAlert,\n onDismissAlert,\n}: HolidayPolicyDetailPresentationProps) {\n useI18n('Company.TimeOff.HolidayPolicy')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n\n const holidaysTabContent = <HolidaysTab holidays={holidays} />\n\n return (\n <PolicyDetailLayout\n title={title}\n subtitle={subtitle}\n onBack={onBack}\n backLabel={backLabel}\n actions={actions}\n firstTab={{\n id: HOLIDAYS_TAB_ID,\n label: t('tabs.holidays'),\n content: holidaysTabContent,\n }}\n selectedTabId={selectedTabId}\n onTabChange={onTabChange}\n employees={employees}\n onAddEmployee={onAddEmployee}\n removeDialog={removeDialog}\n successAlert={successAlert}\n onDismissAlert={onDismissAlert}\n />\n )\n}\n\nfunction HolidaysTab({ holidays }: { holidays: HolidayItem[] }) {\n useI18n('Company.TimeOff.HolidayPolicy')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n\n const columns = useMemo(\n () => [\n {\n key: 'name' as keyof HolidayItem,\n title: t('tableHeaders.holidayName'),\n render: (item: HolidayItem) => item.name,\n },\n {\n key: 'observedDate' as keyof HolidayItem,\n title: t('tableHeaders.observedDate'),\n render: (item: HolidayItem) => item.observedDate,\n },\n {\n key: 'nextObservation' as keyof HolidayItem,\n title: t('tableHeaders.nextObservation'),\n render: (item: HolidayItem) => item.nextObservation,\n },\n ],\n [t],\n )\n\n const dataViewProps = useDataView<HolidayItem>({\n data: holidays,\n columns,\n })\n\n return <DataView label={t('tableLabel')} {...dataViewProps} />\n}\n"],"names":["HOLIDAYS_TAB_ID","HolidayPolicyDetailPresentation","title","subtitle","onBack","backLabel","actions","holidays","selectedTabId","onTabChange","employees","onAddEmployee","removeDialog","successAlert","onDismissAlert","useI18n","t","useTranslation","holidaysTabContent","jsx","HolidaysTab","PolicyDetailLayout","columns","useMemo","item","dataViewProps","useDataView","DataView"],"mappings":";;;;;;;;;AAQA,MAAMA,IAAkB;AAEjB,SAASC,EAAgC;AAAA,EAC9C,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AACF,GAAyC;AACvC,EAAAC,EAAQ,+BAA+B;AACvC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,+BAA+B,GAEtDC,IAAqB,gBAAAC,EAACC,GAAA,EAAY,UAAAb,EAAA,CAAoB;AAE5D,SACE,gBAAAY;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,OAAAnB;AAAA,MACA,UAAAC;AAAA,MACA,QAAAC;AAAA,MACA,WAAAC;AAAA,MACA,SAAAC;AAAA,MACA,UAAU;AAAA,QACR,IAAIN;AAAA,QACJ,OAAOgB,EAAE,eAAe;AAAA,QACxB,SAASE;AAAA,MAAA;AAAA,MAEX,eAAAV;AAAA,MACA,aAAAC;AAAA,MACA,WAAAC;AAAA,MACA,eAAAC;AAAA,MACA,cAAAC;AAAA,MACA,cAAAC;AAAA,MACA,gBAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;AAEA,SAASM,EAAY,EAAE,UAAAb,KAAyC;AAC9D,EAAAQ,EAAQ,+BAA+B;AACvC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,+BAA+B,GAEtDK,IAAUC;AAAA,IACd,MAAM;AAAA,MACJ;AAAA,QACE,KAAK;AAAA,QACL,OAAOP,EAAE,0BAA0B;AAAA,QACnC,QAAQ,CAACQ,MAAsBA,EAAK;AAAA,MAAA;AAAA,MAEtC;AAAA,QACE,KAAK;AAAA,QACL,OAAOR,EAAE,2BAA2B;AAAA,QACpC,QAAQ,CAACQ,MAAsBA,EAAK;AAAA,MAAA;AAAA,MAEtC;AAAA,QACE,KAAK;AAAA,QACL,OAAOR,EAAE,8BAA8B;AAAA,QACvC,QAAQ,CAACQ,MAAsBA,EAAK;AAAA,MAAA;AAAA,IACtC;AAAA,IAEF,CAACR,CAAC;AAAA,EAAA,GAGES,IAAgBC,EAAyB;AAAA,IAC7C,MAAMnB;AAAA,IACN,SAAAe;AAAA,EAAA,CACD;AAED,2BAAQK,GAAA,EAAS,OAAOX,EAAE,YAAY,GAAI,GAAGS,GAAe;AAC9D;"}
|
|
@@ -15,6 +15,7 @@ export interface HolidayPolicyDetailPresentationProps {
|
|
|
15
15
|
selectedTabId: string;
|
|
16
16
|
onTabChange: (id: string) => void;
|
|
17
17
|
employees: Pick<EmployeeTableProps<HolidayPolicyDetailEmployee>, 'data' | 'searchValue' | 'onSearchChange' | 'onSearchClear' | 'searchPlaceholder' | 'itemMenu' | 'pagination' | 'isFetching' | 'emptyState'>;
|
|
18
|
+
onAddEmployee?: () => void;
|
|
18
19
|
removeDialog: RemoveDialogState;
|
|
19
20
|
successAlert?: string;
|
|
20
21
|
onDismissAlert?: () => void;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsx as u } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as C, useCallback as r, useState as b } from "react";
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { useQueryClient as
|
|
5
|
-
import { useHolidayPayPoliciesCreateMutation as
|
|
6
|
-
import { useHolidayPayPoliciesGetSuspense as
|
|
7
|
-
import { useHolidayPayPoliciesUpdateMutation as
|
|
8
|
-
import { getDefaultHolidayItems as
|
|
9
|
-
import { HolidaySelectionFormPresentation as
|
|
10
|
-
import { BaseComponent as
|
|
11
|
-
import { useBase as
|
|
3
|
+
import { useTranslation as A } from "react-i18next";
|
|
4
|
+
import { useQueryClient as O } from "@tanstack/react-query";
|
|
5
|
+
import { useHolidayPayPoliciesCreateMutation as k } from "@gusto/embedded-api/react-query/holidayPayPoliciesCreate";
|
|
6
|
+
import { useHolidayPayPoliciesGetSuspense as N, invalidateAllHolidayPayPoliciesGet as _, queryKeyHolidayPayPoliciesGet as x } from "@gusto/embedded-api/react-query/holidayPayPoliciesGet";
|
|
7
|
+
import { useHolidayPayPoliciesUpdateMutation as M } from "@gusto/embedded-api/react-query/holidayPayPoliciesUpdate";
|
|
8
|
+
import { getDefaultHolidayItems as w, FEDERAL_HOLIDAY_KEYS as T, buildFederalHolidaysPayload as U } from "../shared/holidayHelpers.js";
|
|
9
|
+
import { HolidaySelectionFormPresentation as v } from "./HolidaySelectionFormPresentation.js";
|
|
10
|
+
import { BaseComponent as R } from "../../Base/Base.js";
|
|
11
|
+
import { useBase as D } from "../../Base/useBase.js";
|
|
12
12
|
import { componentEvents as S } from "../../../shared/constants.js";
|
|
13
|
-
import { useI18n as
|
|
14
|
-
import { useLocale as
|
|
15
|
-
function
|
|
16
|
-
return /* @__PURE__ */ u(
|
|
13
|
+
import { useI18n as I } from "../../../i18n/I18n.js";
|
|
14
|
+
import { useLocale as L } from "../../../contexts/LocaleProvider/useLocale.js";
|
|
15
|
+
function ae(e) {
|
|
16
|
+
return /* @__PURE__ */ u(R, { ...e, children: e.mode === "edit" ? /* @__PURE__ */ u(G, { companyId: e.companyId }) : /* @__PURE__ */ u(Y, { companyId: e.companyId }) });
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function g(e) {
|
|
19
19
|
const [l, o] = b(e), i = r((n, c) => {
|
|
20
20
|
o((a) => {
|
|
21
21
|
const t = new Set(a);
|
|
@@ -33,58 +33,59 @@ function L(e) {
|
|
|
33
33
|
}
|
|
34
34
|
function F(e, l, o) {
|
|
35
35
|
o && e.setQueryData(
|
|
36
|
-
|
|
36
|
+
x(l, {}),
|
|
37
37
|
(i) => i ? { ...i, holidayPayPolicy: o } : void 0
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
const { t: l } =
|
|
40
|
+
function Y({ companyId: e }) {
|
|
41
|
+
I("Company.TimeOff.HolidayPolicy");
|
|
42
|
+
const { t: l } = A("Company.TimeOff.HolidayPolicy"), { onEvent: o, baseSubmitHandler: i } = D(), { locale: s } = L(), n = O(), c = C(() => w(l, void 0, s), [l, s]), a = C(() => new Set(T), []), { selectedUuids: t, handleSelectionChange: d, handleSelectAll: y } = g(a), { mutateAsync: m, isPending: H } = k(), f = r(async () => {
|
|
43
43
|
await i({}, async () => {
|
|
44
|
-
const
|
|
44
|
+
const p = await m({
|
|
45
45
|
request: {
|
|
46
46
|
companyUuid: e,
|
|
47
47
|
holidayPayPolicyRequest: {
|
|
48
|
-
federalHolidays:
|
|
48
|
+
federalHolidays: U(t)
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
|
-
F(n, e,
|
|
52
|
+
F(n, e, p.holidayPayPolicy), await _(n), o(S.TIME_OFF_HOLIDAY_SELECTION_DONE);
|
|
53
53
|
});
|
|
54
|
-
}, [i, m, e, t, n, o]),
|
|
54
|
+
}, [i, m, e, t, n, o]), h = r(() => {
|
|
55
55
|
o(S.CANCEL);
|
|
56
56
|
}, [o]);
|
|
57
57
|
return /* @__PURE__ */ u(
|
|
58
|
-
|
|
58
|
+
v,
|
|
59
59
|
{
|
|
60
60
|
holidays: c,
|
|
61
61
|
selectedHolidayUuids: t,
|
|
62
62
|
onSelectionChange: d,
|
|
63
63
|
onSelectAll: y,
|
|
64
|
-
onContinue:
|
|
65
|
-
onBack:
|
|
64
|
+
onContinue: f,
|
|
65
|
+
onBack: h,
|
|
66
|
+
isPending: H
|
|
66
67
|
}
|
|
67
68
|
);
|
|
68
69
|
}
|
|
69
|
-
function
|
|
70
|
-
|
|
71
|
-
const { t: l } =
|
|
70
|
+
function G({ companyId: e }) {
|
|
71
|
+
I("Company.TimeOff.HolidayPolicy");
|
|
72
|
+
const { t: l } = A("Company.TimeOff.HolidayPolicy"), { onEvent: o, baseSubmitHandler: i } = D(), { locale: s } = L(), n = O(), { data: c } = N({ companyUuid: e }), a = c.holidayPayPolicy, t = C(() => w(l, void 0, s), [l, s]), d = C(() => {
|
|
72
73
|
const P = /* @__PURE__ */ new Set(), B = a.federalHolidays;
|
|
73
|
-
for (const
|
|
74
|
-
B[
|
|
74
|
+
for (const E of T)
|
|
75
|
+
B[E]?.selected === !0 && P.add(E);
|
|
75
76
|
return P;
|
|
76
|
-
}, [a.federalHolidays]), { selectedUuids: y, handleSelectionChange: m, handleSelectAll: H } =
|
|
77
|
+
}, [a.federalHolidays]), { selectedUuids: y, handleSelectionChange: m, handleSelectAll: H } = g(d), { mutateAsync: f, isPending: h } = M(), p = r(async () => {
|
|
77
78
|
await i({}, async () => {
|
|
78
79
|
const P = await f({
|
|
79
80
|
request: {
|
|
80
81
|
companyUuid: e,
|
|
81
82
|
requestBody: {
|
|
82
83
|
version: a.version,
|
|
83
|
-
federalHolidays:
|
|
84
|
+
federalHolidays: U(y)
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
});
|
|
87
|
-
F(n, e, P.holidayPayPolicy), await
|
|
88
|
+
F(n, e, P.holidayPayPolicy), await _(n), o(S.TIME_OFF_HOLIDAY_SELECTION_EDIT_DONE);
|
|
88
89
|
});
|
|
89
90
|
}, [
|
|
90
91
|
i,
|
|
@@ -98,18 +99,19 @@ function Y({ companyId: e }) {
|
|
|
98
99
|
o(S.CANCEL);
|
|
99
100
|
}, [o]);
|
|
100
101
|
return /* @__PURE__ */ u(
|
|
101
|
-
|
|
102
|
+
v,
|
|
102
103
|
{
|
|
103
104
|
holidays: t,
|
|
104
105
|
selectedHolidayUuids: y,
|
|
105
106
|
onSelectionChange: m,
|
|
106
107
|
onSelectAll: H,
|
|
107
|
-
onContinue:
|
|
108
|
-
onBack: q
|
|
108
|
+
onContinue: p,
|
|
109
|
+
onBack: q,
|
|
110
|
+
isPending: h
|
|
109
111
|
}
|
|
110
112
|
);
|
|
111
113
|
}
|
|
112
114
|
export {
|
|
113
|
-
|
|
115
|
+
ae as HolidaySelectionForm
|
|
114
116
|
};
|
|
115
117
|
//# sourceMappingURL=HolidaySelectionForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HolidaySelectionForm.js","sources":["../../../../src/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.tsx"],"sourcesContent":["import { useCallback, useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { useHolidayPayPoliciesCreateMutation } from '@gusto/embedded-api/react-query/holidayPayPoliciesCreate'\nimport {\n useHolidayPayPoliciesGetSuspense,\n queryKeyHolidayPayPoliciesGet,\n invalidateAllHolidayPayPoliciesGet,\n type HolidayPayPoliciesGetQueryData,\n} from '@gusto/embedded-api/react-query/holidayPayPoliciesGet'\nimport { useHolidayPayPoliciesUpdateMutation } from '@gusto/embedded-api/react-query/holidayPayPoliciesUpdate'\nimport type { HolidayPayPolicy } from '@gusto/embedded-api/models/components/holidaypaypolicy'\nimport {\n getDefaultHolidayItems,\n buildFederalHolidaysPayload,\n FEDERAL_HOLIDAY_KEYS,\n} from '../shared/holidayHelpers'\nimport { HolidaySelectionFormPresentation } from './HolidaySelectionFormPresentation'\nimport type { HolidayItem } from './HolidaySelectionFormTypes'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { componentEvents } from '@/shared/constants'\nimport { useI18n } from '@/i18n'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\n\nexport interface HolidaySelectionFormProps extends BaseComponentInterface {\n companyId: string\n mode?: 'create' | 'edit'\n}\n\nexport function HolidaySelectionForm(props: HolidaySelectionFormProps) {\n return (\n <BaseComponent {...props}>\n {props.mode === 'edit' ? (\n <EditRoot companyId={props.companyId} />\n ) : (\n <CreateRoot companyId={props.companyId} />\n )}\n </BaseComponent>\n )\n}\n\ninterface RootProps {\n companyId: string\n}\n\nfunction useHolidaySelection(initialKeys: Set<string>) {\n const [selectedUuids, setSelectedUuids] = useState(initialKeys)\n\n const handleSelectionChange = useCallback((item: HolidayItem, selected: boolean) => {\n setSelectedUuids(prev => {\n const next = new Set(prev)\n if (selected) {\n next.add(item.uuid)\n } else {\n next.delete(item.uuid)\n }\n return next\n })\n }, [])\n\n const handleSelectAll = useCallback((selected: boolean, visibleItems: HolidayItem[]) => {\n setSelectedUuids(prev => {\n const next = new Set(prev)\n for (const item of visibleItems) {\n if (selected) next.add(item.uuid)\n else next.delete(item.uuid)\n }\n return next\n })\n }, [])\n\n return { selectedUuids, handleSelectionChange, handleSelectAll }\n}\n\nfunction seedPolicyCache(\n queryClient: ReturnType<typeof useQueryClient>,\n companyId: string,\n policy: HolidayPayPolicy | undefined,\n) {\n if (!policy) return\n queryClient.setQueryData<HolidayPayPoliciesGetQueryData>(\n queryKeyHolidayPayPoliciesGet(companyId, {}),\n prev =>\n prev\n ? { ...prev, holidayPayPolicy: policy }\n : (undefined as unknown as HolidayPayPoliciesGetQueryData),\n )\n}\n\nfunction CreateRoot({ companyId }: RootProps) {\n useI18n('Company.TimeOff.HolidayPolicy')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n const { onEvent, baseSubmitHandler } = useBase()\n const { locale } = useLocale()\n const queryClient = useQueryClient()\n\n const holidays = useMemo(() => getDefaultHolidayItems(t, undefined, locale), [t, locale])\n const allKeys = useMemo(() => new Set(FEDERAL_HOLIDAY_KEYS), [])\n const { selectedUuids, handleSelectionChange, handleSelectAll } = useHolidaySelection(allKeys)\n\n const { mutateAsync: createPolicy } = useHolidayPayPoliciesCreateMutation()\n\n const handleContinue = useCallback(async () => {\n await baseSubmitHandler({}, async () => {\n const response = await createPolicy({\n request: {\n companyUuid: companyId,\n holidayPayPolicyRequest: {\n federalHolidays: buildFederalHolidaysPayload(selectedUuids),\n },\n },\n })\n // Seed the GET cache so the next mount of SelectEmployeesHoliday's\n // StandaloneLoader (in addEmployeesHoliday state) reads the freshly\n // created policy instead of a stale `{ holidayPayPolicy: undefined }`\n // left over from PolicyList's pre-create GET.\n seedPolicyCache(queryClient, companyId, response.holidayPayPolicy)\n await invalidateAllHolidayPayPoliciesGet(queryClient)\n onEvent(componentEvents.TIME_OFF_HOLIDAY_SELECTION_DONE)\n })\n }, [baseSubmitHandler, createPolicy, companyId, selectedUuids, queryClient, onEvent])\n\n const handleBack = useCallback(() => {\n onEvent(componentEvents.CANCEL)\n }, [onEvent])\n\n return (\n <HolidaySelectionFormPresentation\n holidays={holidays}\n selectedHolidayUuids={selectedUuids}\n onSelectionChange={handleSelectionChange}\n onSelectAll={handleSelectAll}\n onContinue={handleContinue}\n onBack={handleBack}\n />\n )\n}\n\nfunction EditRoot({ companyId }: RootProps) {\n useI18n('Company.TimeOff.HolidayPolicy')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n const { onEvent, baseSubmitHandler } = useBase()\n const { locale } = useLocale()\n const queryClient = useQueryClient()\n\n const { data } = useHolidayPayPoliciesGetSuspense({ companyUuid: companyId })\n const policy = data.holidayPayPolicy!\n\n const holidays = useMemo(() => getDefaultHolidayItems(t, undefined, locale), [t, locale])\n\n const initialSelected = useMemo(() => {\n const next = new Set<string>()\n const federal = policy.federalHolidays\n for (const key of FEDERAL_HOLIDAY_KEYS) {\n const entry = federal[key as keyof typeof federal]\n if (entry?.selected === true) {\n next.add(key)\n }\n }\n return next\n }, [policy.federalHolidays])\n\n const { selectedUuids, handleSelectionChange, handleSelectAll } =\n useHolidaySelection(initialSelected)\n\n const { mutateAsync: updatePolicy } = useHolidayPayPoliciesUpdateMutation()\n\n const handleContinue = useCallback(async () => {\n await baseSubmitHandler({}, async () => {\n const response = await updatePolicy({\n request: {\n companyUuid: companyId,\n requestBody: {\n version: policy.version!,\n federalHolidays: buildFederalHolidaysPayload(selectedUuids),\n },\n },\n })\n seedPolicyCache(queryClient, companyId, response.holidayPayPolicy)\n await invalidateAllHolidayPayPoliciesGet(queryClient)\n onEvent(componentEvents.TIME_OFF_HOLIDAY_SELECTION_EDIT_DONE)\n })\n }, [\n baseSubmitHandler,\n updatePolicy,\n companyId,\n policy.version,\n selectedUuids,\n queryClient,\n onEvent,\n ])\n\n const handleBack = useCallback(() => {\n onEvent(componentEvents.CANCEL)\n }, [onEvent])\n\n return (\n <HolidaySelectionFormPresentation\n holidays={holidays}\n selectedHolidayUuids={selectedUuids}\n onSelectionChange={handleSelectionChange}\n onSelectAll={handleSelectAll}\n onContinue={handleContinue}\n onBack={handleBack}\n />\n )\n}\n"],"names":["HolidaySelectionForm","props","BaseComponent","jsx","EditRoot","CreateRoot","useHolidaySelection","initialKeys","selectedUuids","setSelectedUuids","useState","handleSelectionChange","useCallback","item","selected","prev","next","handleSelectAll","visibleItems","seedPolicyCache","queryClient","companyId","policy","queryKeyHolidayPayPoliciesGet","useI18n","t","useTranslation","onEvent","baseSubmitHandler","useBase","locale","useLocale","useQueryClient","holidays","useMemo","getDefaultHolidayItems","allKeys","FEDERAL_HOLIDAY_KEYS","createPolicy","useHolidayPayPoliciesCreateMutation","handleContinue","response","buildFederalHolidaysPayload","invalidateAllHolidayPayPoliciesGet","componentEvents","handleBack","HolidaySelectionFormPresentation","data","useHolidayPayPoliciesGetSuspense","initialSelected","federal","key","updatePolicy","useHolidayPayPoliciesUpdateMutation"],"mappings":";;;;;;;;;;;;;;AA8BO,SAASA,GAAqBC,GAAkC;AACrE,2BACGC,GAAA,EAAe,GAAGD,GAChB,UAAAA,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AAaM;AAAA,MACb,YAAYuB;AAAA,MACZ,QAAQK;AAAA,IAAA;AAAA,EAAA;AAGd;"}
|
|
1
|
+
{"version":3,"file":"HolidaySelectionForm.js","sources":["../../../../src/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.tsx"],"sourcesContent":["import { useCallback, useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { useHolidayPayPoliciesCreateMutation } from '@gusto/embedded-api/react-query/holidayPayPoliciesCreate'\nimport {\n useHolidayPayPoliciesGetSuspense,\n queryKeyHolidayPayPoliciesGet,\n invalidateAllHolidayPayPoliciesGet,\n type HolidayPayPoliciesGetQueryData,\n} from '@gusto/embedded-api/react-query/holidayPayPoliciesGet'\nimport { useHolidayPayPoliciesUpdateMutation } from '@gusto/embedded-api/react-query/holidayPayPoliciesUpdate'\nimport type { HolidayPayPolicy } from '@gusto/embedded-api/models/components/holidaypaypolicy'\nimport {\n getDefaultHolidayItems,\n buildFederalHolidaysPayload,\n FEDERAL_HOLIDAY_KEYS,\n} from '../shared/holidayHelpers'\nimport { HolidaySelectionFormPresentation } from './HolidaySelectionFormPresentation'\nimport type { HolidayItem } from './HolidaySelectionFormTypes'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { componentEvents } from '@/shared/constants'\nimport { useI18n } from '@/i18n'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\n\nexport interface HolidaySelectionFormProps extends BaseComponentInterface {\n companyId: string\n mode?: 'create' | 'edit'\n}\n\nexport function HolidaySelectionForm(props: HolidaySelectionFormProps) {\n return (\n <BaseComponent {...props}>\n {props.mode === 'edit' ? (\n <EditRoot companyId={props.companyId} />\n ) : (\n <CreateRoot companyId={props.companyId} />\n )}\n </BaseComponent>\n )\n}\n\ninterface RootProps {\n companyId: string\n}\n\nfunction useHolidaySelection(initialKeys: Set<string>) {\n const [selectedUuids, setSelectedUuids] = useState(initialKeys)\n\n const handleSelectionChange = useCallback((item: HolidayItem, selected: boolean) => {\n setSelectedUuids(prev => {\n const next = new Set(prev)\n if (selected) {\n next.add(item.uuid)\n } else {\n next.delete(item.uuid)\n }\n return next\n })\n }, [])\n\n const handleSelectAll = useCallback((selected: boolean, visibleItems: HolidayItem[]) => {\n setSelectedUuids(prev => {\n const next = new Set(prev)\n for (const item of visibleItems) {\n if (selected) next.add(item.uuid)\n else next.delete(item.uuid)\n }\n return next\n })\n }, [])\n\n return { selectedUuids, handleSelectionChange, handleSelectAll }\n}\n\nfunction seedPolicyCache(\n queryClient: ReturnType<typeof useQueryClient>,\n companyId: string,\n policy: HolidayPayPolicy | undefined,\n) {\n if (!policy) return\n queryClient.setQueryData<HolidayPayPoliciesGetQueryData>(\n queryKeyHolidayPayPoliciesGet(companyId, {}),\n prev =>\n prev\n ? { ...prev, holidayPayPolicy: policy }\n : (undefined as unknown as HolidayPayPoliciesGetQueryData),\n )\n}\n\nfunction CreateRoot({ companyId }: RootProps) {\n useI18n('Company.TimeOff.HolidayPolicy')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n const { onEvent, baseSubmitHandler } = useBase()\n const { locale } = useLocale()\n const queryClient = useQueryClient()\n\n const holidays = useMemo(() => getDefaultHolidayItems(t, undefined, locale), [t, locale])\n const allKeys = useMemo(() => new Set(FEDERAL_HOLIDAY_KEYS), [])\n const { selectedUuids, handleSelectionChange, handleSelectAll } = useHolidaySelection(allKeys)\n\n const { mutateAsync: createPolicy, isPending } = useHolidayPayPoliciesCreateMutation()\n\n const handleContinue = useCallback(async () => {\n await baseSubmitHandler({}, async () => {\n const response = await createPolicy({\n request: {\n companyUuid: companyId,\n holidayPayPolicyRequest: {\n federalHolidays: buildFederalHolidaysPayload(selectedUuids),\n },\n },\n })\n // Seed the GET cache so the next mount of SelectEmployeesHoliday's\n // StandaloneLoader (in addEmployeesHoliday state) reads the freshly\n // created policy instead of a stale `{ holidayPayPolicy: undefined }`\n // left over from PolicyList's pre-create GET.\n seedPolicyCache(queryClient, companyId, response.holidayPayPolicy)\n await invalidateAllHolidayPayPoliciesGet(queryClient)\n onEvent(componentEvents.TIME_OFF_HOLIDAY_SELECTION_DONE)\n })\n }, [baseSubmitHandler, createPolicy, companyId, selectedUuids, queryClient, onEvent])\n\n const handleBack = useCallback(() => {\n onEvent(componentEvents.CANCEL)\n }, [onEvent])\n\n return (\n <HolidaySelectionFormPresentation\n holidays={holidays}\n selectedHolidayUuids={selectedUuids}\n onSelectionChange={handleSelectionChange}\n onSelectAll={handleSelectAll}\n onContinue={handleContinue}\n onBack={handleBack}\n isPending={isPending}\n />\n )\n}\n\nfunction EditRoot({ companyId }: RootProps) {\n useI18n('Company.TimeOff.HolidayPolicy')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n const { onEvent, baseSubmitHandler } = useBase()\n const { locale } = useLocale()\n const queryClient = useQueryClient()\n\n const { data } = useHolidayPayPoliciesGetSuspense({ companyUuid: companyId })\n const policy = data.holidayPayPolicy!\n\n const holidays = useMemo(() => getDefaultHolidayItems(t, undefined, locale), [t, locale])\n\n const initialSelected = useMemo(() => {\n const next = new Set<string>()\n const federal = policy.federalHolidays\n for (const key of FEDERAL_HOLIDAY_KEYS) {\n const entry = federal[key as keyof typeof federal]\n if (entry?.selected === true) {\n next.add(key)\n }\n }\n return next\n }, [policy.federalHolidays])\n\n const { selectedUuids, handleSelectionChange, handleSelectAll } =\n useHolidaySelection(initialSelected)\n\n const { mutateAsync: updatePolicy, isPending } = useHolidayPayPoliciesUpdateMutation()\n\n const handleContinue = useCallback(async () => {\n await baseSubmitHandler({}, async () => {\n const response = await updatePolicy({\n request: {\n companyUuid: companyId,\n requestBody: {\n version: policy.version!,\n federalHolidays: buildFederalHolidaysPayload(selectedUuids),\n },\n },\n })\n seedPolicyCache(queryClient, companyId, response.holidayPayPolicy)\n await invalidateAllHolidayPayPoliciesGet(queryClient)\n onEvent(componentEvents.TIME_OFF_HOLIDAY_SELECTION_EDIT_DONE)\n })\n }, [\n baseSubmitHandler,\n updatePolicy,\n companyId,\n policy.version,\n selectedUuids,\n queryClient,\n onEvent,\n ])\n\n const handleBack = useCallback(() => {\n onEvent(componentEvents.CANCEL)\n }, [onEvent])\n\n return (\n <HolidaySelectionFormPresentation\n holidays={holidays}\n selectedHolidayUuids={selectedUuids}\n onSelectionChange={handleSelectionChange}\n onSelectAll={handleSelectAll}\n onContinue={handleContinue}\n onBack={handleBack}\n isPending={isPending}\n />\n )\n}\n"],"names":["HolidaySelectionForm","props","BaseComponent","jsx","EditRoot","CreateRoot","useHolidaySelection","initialKeys","selectedUuids","setSelectedUuids","useState","handleSelectionChange","useCallback","item","selected","prev","next","handleSelectAll","visibleItems","seedPolicyCache","queryClient","companyId","policy","queryKeyHolidayPayPoliciesGet","useI18n","t","useTranslation","onEvent","baseSubmitHandler","useBase","locale","useLocale","useQueryClient","holidays","useMemo","getDefaultHolidayItems","allKeys","FEDERAL_HOLIDAY_KEYS","createPolicy","isPending","useHolidayPayPoliciesCreateMutation","handleContinue","response","buildFederalHolidaysPayload","invalidateAllHolidayPayPoliciesGet","componentEvents","handleBack","HolidaySelectionFormPresentation","data","useHolidayPayPoliciesGetSuspense","initialSelected","federal","key","updatePolicy","useHolidayPayPoliciesUpdateMutation"],"mappings":";;;;;;;;;;;;;;AA8BO,SAASA,GAAqBC,GAAkC;AACrE,2BACGC,GAAA,EAAe,GAAGD,GAChB,UAAAA,EAAM,SAAS,SACd,gBAAAE,EAACC,GAAA,EAAS,WAAWH,EAAM,WAAW,IAEtC,gBAAAE,EAACE,KAAW,WAAWJ,EAAM,WAAW,GAE5C;AAEJ;AAMA,SAASK,EAAoBC,GAA0B;AACrD,QAAM,CAACC,GAAeC,CAAgB,IAAIC,EAASH,CAAW,GAExDI,IAAwBC,EAAY,CAACC,GAAmBC,MAAsB;AAClF,IAAAL,EAAiB,CAAAM,MAAQ;AACvB,YAAMC,IAAO,IAAI,IAAID,CAAI;AACzB,aAAID,IACFE,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,IAAIoC,CAAG;AAGhB,WAAOpC;AAAA,EACT,GAAG,CAACM,EAAO,eAAe,CAAC,GAErB,EAAE,eAAAd,GAAe,uBAAAG,GAAuB,iBAAAM,EAAA,IAC5CX,EAAoB4C,CAAe,GAE/B,EAAE,aAAaG,GAAc,WAAAd,EAAA,IAAce,EAAA,GAE3Cb,IAAiB7B,EAAY,YAAY;AAC7C,UAAMgB,EAAkB,CAAA,GAAI,YAAY;AACtC,YAAMc,IAAW,MAAMW,EAAa;AAAA,QAClC,SAAS;AAAA,UACP,aAAahC;AAAA,UACb,aAAa;AAAA,YACX,SAASC,EAAO;AAAA,YAChB,iBAAiBqB,EAA4BnC,CAAa;AAAA,UAAA;AAAA,QAC5D;AAAA,MACF,CACD;AACD,MAAAW,EAAgBC,GAAaC,GAAWqB,EAAS,gBAAgB,GACjE,MAAME,EAAmCxB,CAAW,GACpDO,EAAQkB,EAAgB,oCAAoC;AAAA,IAC9D,CAAC;AAAA,EACH,GAAG;AAAA,IACDjB;AAAA,IACAyB;AAAA,IACAhC;AAAA,IACAC,EAAO;AAAA,IACPd;AAAA,IACAY;AAAA,IACAO;AAAA,EAAA,CACD,GAEKmB,IAAalC,EAAY,MAAM;AACnC,IAAAe,EAAQkB,EAAgB,MAAM;AAAA,EAChC,GAAG,CAAClB,CAAO,CAAC;AAEZ,SACE,gBAAAxB;AAAA,IAAC4C;AAAA,IAAA;AAAA,MACC,UAAAd;AAAA,MACA,sBAAsBzB;AAAA,MACtB,mBAAmBG;AAAA,MACnB,aAAaM;AAAA,MACb,YAAYwB;AAAA,MACZ,QAAQK;AAAA,MACR,WAAAP;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { Flex as
|
|
1
|
+
import { jsxs as a, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as y } from "react";
|
|
3
|
+
import { useTranslation as b } from "react-i18next";
|
|
4
|
+
import { Flex as l } from "../../Common/Flex/Flex.js";
|
|
5
5
|
import "classnames";
|
|
6
6
|
import "../../../shared/constants.js";
|
|
7
|
-
import { ActionsLayout as
|
|
8
|
-
import { useComponentContext as
|
|
7
|
+
import { ActionsLayout as h } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
8
|
+
import { useComponentContext as x } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
9
|
import { useI18n as v } from "../../../i18n/I18n.js";
|
|
10
|
-
import { useDataView as
|
|
11
|
-
import { DataView as
|
|
12
|
-
function I(
|
|
10
|
+
import { useDataView as C } from "../../Common/DataView/useDataView.js";
|
|
11
|
+
import { DataView as g } from "../../Common/DataView/DataView.js";
|
|
12
|
+
function I(e) {
|
|
13
13
|
v("Company.TimeOff.HolidayPolicy");
|
|
14
|
-
const { t
|
|
14
|
+
const { t } = b("Company.TimeOff.HolidayPolicy"), { Heading: c, Text: s, Button: r } = x(), { holidays: d } = e, n = e.mode === "view", m = y(
|
|
15
15
|
() => [
|
|
16
16
|
{
|
|
17
17
|
key: "name",
|
|
18
|
-
title:
|
|
19
|
-
render: (i) =>
|
|
18
|
+
title: t("tableHeaders.holidayName"),
|
|
19
|
+
render: (i) => i.name
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
key: "observedDate",
|
|
23
|
-
title:
|
|
24
|
-
render: (i) =>
|
|
23
|
+
title: t("tableHeaders.observedDate"),
|
|
24
|
+
render: (i) => i.observedDate
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
key: "nextObservation",
|
|
28
|
-
title:
|
|
29
|
-
render: (i) =>
|
|
28
|
+
title: t("tableHeaders.nextObservation"),
|
|
29
|
+
render: (i) => i.nextObservation
|
|
30
30
|
}
|
|
31
31
|
],
|
|
32
|
-
[
|
|
33
|
-
), u =
|
|
32
|
+
[t]
|
|
33
|
+
), u = n ? {} : {
|
|
34
34
|
selectionMode: "multiple",
|
|
35
|
-
onSelect:
|
|
36
|
-
onSelectAll:
|
|
37
|
-
getIsItemSelected: (i) =>
|
|
38
|
-
}, f =
|
|
35
|
+
onSelect: e.onSelectionChange,
|
|
36
|
+
onSelectAll: e.onSelectAll,
|
|
37
|
+
getIsItemSelected: (i) => e.selectedHolidayUuids.has(i.uuid)
|
|
38
|
+
}, f = C({
|
|
39
39
|
data: d,
|
|
40
|
-
columns:
|
|
40
|
+
columns: m,
|
|
41
41
|
...u
|
|
42
42
|
});
|
|
43
|
-
return /* @__PURE__ */ a(
|
|
44
|
-
!
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ a(l, { flexDirection: "column", gap: 32, children: [
|
|
44
|
+
!n && /* @__PURE__ */ a(l, { flexDirection: "column", gap: 4, children: [
|
|
45
|
+
/* @__PURE__ */ o(c, { as: "h2", children: t("title") }),
|
|
46
|
+
/* @__PURE__ */ o(s, { variant: "supporting", children: t("description") })
|
|
47
47
|
] }),
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
!
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ o(g, { label: t("tableLabel"), ...f }),
|
|
49
|
+
!n && /* @__PURE__ */ a(h, { children: [
|
|
50
|
+
/* @__PURE__ */ o(r, { variant: "secondary", onClick: e.onBack, isDisabled: e.isPending, children: t("backCta") }),
|
|
51
|
+
/* @__PURE__ */ o(r, { variant: "primary", onClick: e.onContinue, isLoading: e.isPending, children: t("continueCta") })
|
|
52
52
|
] })
|
|
53
53
|
] });
|
|
54
54
|
}
|
package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HolidaySelectionFormPresentation.js","sources":["../../../../src/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type {\n HolidayItem,\n HolidaySelectionFormPresentationProps,\n} from './HolidaySelectionFormTypes'\nimport { DataView, Flex, ActionsLayout, useDataView } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nexport function HolidaySelectionFormPresentation(props: HolidaySelectionFormPresentationProps) {\n useI18n('Company.TimeOff.HolidayPolicy')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n const { Heading, Text, Button } = useComponentContext()\n\n const { holidays } = props\n const isViewMode = props.mode === 'view'\n\n const columns = useMemo(\n () => [\n {\n key: 'name' as keyof HolidayItem,\n title: t('tableHeaders.holidayName'),\n render: (item: HolidayItem) =>
|
|
1
|
+
{"version":3,"file":"HolidaySelectionFormPresentation.js","sources":["../../../../src/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type {\n HolidayItem,\n HolidaySelectionFormPresentationProps,\n} from './HolidaySelectionFormTypes'\nimport { DataView, Flex, ActionsLayout, useDataView } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nexport function HolidaySelectionFormPresentation(props: HolidaySelectionFormPresentationProps) {\n useI18n('Company.TimeOff.HolidayPolicy')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n const { Heading, Text, Button } = useComponentContext()\n\n const { holidays } = props\n const isViewMode = props.mode === 'view'\n\n const columns = useMemo(\n () => [\n {\n key: 'name' as keyof HolidayItem,\n title: t('tableHeaders.holidayName'),\n render: (item: HolidayItem) => item.name,\n },\n {\n key: 'observedDate' as keyof HolidayItem,\n title: t('tableHeaders.observedDate'),\n render: (item: HolidayItem) => item.observedDate,\n },\n {\n key: 'nextObservation' as keyof HolidayItem,\n title: t('tableHeaders.nextObservation'),\n render: (item: HolidayItem) => item.nextObservation,\n },\n ],\n [t],\n )\n\n const selectionProps = !isViewMode\n ? {\n selectionMode: 'multiple' as const,\n onSelect: props.onSelectionChange,\n onSelectAll: props.onSelectAll,\n getIsItemSelected: (item: HolidayItem) => props.selectedHolidayUuids.has(item.uuid),\n }\n : {}\n\n const dataViewProps = useDataView<HolidayItem>({\n data: holidays,\n columns,\n ...selectionProps,\n })\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n {!isViewMode && (\n <Flex flexDirection=\"column\" gap={4}>\n <Heading as=\"h2\">{t('title')}</Heading>\n <Text variant=\"supporting\">{t('description')}</Text>\n </Flex>\n )}\n\n <DataView label={t('tableLabel')} {...dataViewProps} />\n\n {!isViewMode && (\n <ActionsLayout>\n <Button variant=\"secondary\" onClick={props.onBack} isDisabled={props.isPending}>\n {t('backCta')}\n </Button>\n <Button variant=\"primary\" onClick={props.onContinue} isLoading={props.isPending}>\n {t('continueCta')}\n </Button>\n </ActionsLayout>\n )}\n </Flex>\n )\n}\n"],"names":["HolidaySelectionFormPresentation","props","useI18n","useTranslation","Heading","Text","Button","useComponentContext","holidays","isViewMode","columns","useMemo","item","selectionProps","dataViewProps","useDataView","jsxs","Flex","jsx","DataView","ActionsLayout"],"mappings":";;;;;;;;;;;AAUO,SAASA,EAAiCC,GAA8C;AAC7F,EAAAC,EAAQ,+BAA+B;AACvC,QAAM,EAAE,EAAA,IAAMC,EAAe,+BAA+B,GACtD,EAAE,SAAAC,GAAS,MAAAC,GAAM,QAAAC,EAAA,IAAWC,EAAA,GAE5B,EAAE,UAAAC,MAAaP,GACfQ,IAAaR,EAAM,SAAS,QAE5BS,IAAUC;AAAA,IACd,MAAM;AAAA,MACJ;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,0BAA0B;AAAA,QACnC,QAAQ,CAACC,MAAsBA,EAAK;AAAA,MAAA;AAAA,MAEtC;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,2BAA2B;AAAA,QACpC,QAAQ,CAACA,MAAsBA,EAAK;AA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electionFormBasePr
|
|
|
14
14
|
onSelectAll: (selected: boolean, visibleItems: HolidayItem[]) => void;
|
|
15
15
|
onContinue: () => void;
|
|
16
16
|
onBack: () => void;
|
|
17
|
+
isPending?: boolean;
|
|
17
18
|
}
|
|
18
19
|
interface HolidaySelectionFormViewModeProps extends HolidaySelectionFormBaseProps {
|
|
19
20
|
mode: 'view';
|