@gusto/embedded-react-sdk 0.44.2 → 0.46.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 +64 -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/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/BankAccount/BankAccountForm/Head.js +11 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Head.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/SignatureForm/SignatureForm.js +26 -26
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js +4 -4
- 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/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/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/PaySchedule/PayScheduleList.js +18 -18
- package/dist/components/Company/PaySchedule/PayScheduleList.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js +5 -5
- 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/Employee/Compensation/index.d.ts +1 -1
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.d.ts +11 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js +230 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js.map +1 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.module.scss.js +8 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.module.scss.js.map +1 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/index.d.ts +3 -0
- package/dist/components/Employee/Compensation/management/index.d.ts +3 -0
- 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/fields.js +4 -4
- 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 +203 -188
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/fields.js +6 -6
- package/dist/components/Employee/Compensation/shared/useJobForm/index.d.ts +0 -2
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.d.ts +16 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js +21 -15
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.d.ts +30 -3
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js +138 -130
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
- package/dist/components/Employee/Dashboard/BasicDetailsView.d.ts +19 -1
- package/dist/components/Employee/Dashboard/BasicDetailsView.js +93 -47
- 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.d.ts +2 -0
- package/dist/components/Employee/Dashboard/Dashboard.js +95 -109
- package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +19 -0
- package/dist/components/Employee/Dashboard/DashboardComponents.js +137 -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 +34 -20
- 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 +536 -135
- package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -1
- package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js +8 -0
- package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js.map +1 -0
- 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 +19 -1
- package/dist/components/Employee/Dashboard/TaxesView.js +92 -56
- 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 +238 -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.d.ts +12 -5
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js +21 -18
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +26 -10
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +61 -38
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.d.ts +10 -4
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js +10 -12
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.d.ts +10 -3
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js +19 -14
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.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/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/useDocumentList.js +6 -6
- 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 +13 -13
- 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 +14 -14
- 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/FederalTaxes/shared/useFederalTaxesForm/fields.js +4 -4
- 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/Profile/shared/useEmployeeDetailsForm/fields.js +8 -8
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +5 -5
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js +4 -4
- 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/useEmployeeStateTaxesForm/fieldComponents.js +8 -8
- 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/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/PayrollOverview/PayrollOverviewPresentation.js +35 -35
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.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 +78 -55
- 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/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.Compensation.json.js +48 -44
- package/dist/i18n/en/Employee.Compensation.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 +14 -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 +10 -2
- package/dist/shared/constants.js +30 -26
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/test-utils/assertions.d.ts +16 -0
- package/dist/types/i18next.d.ts +161 -5
- 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 +29 -21
- 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.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 +1 -1
- /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,70 +1,95 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useTimeOffPoliciesGetSuspense as
|
|
3
|
-
import { useTimeOffPoliciesUpdateMutation as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { useTimeOffPoliciesGetSuspense as g } from "@gusto/embedded-api/react-query/timeOffPoliciesGet";
|
|
3
|
+
import { useTimeOffPoliciesUpdateMutation as x } from "@gusto/embedded-api/react-query/timeOffPoliciesUpdate";
|
|
4
|
+
import { UnprocessableEntityError as T } from "@gusto/embedded-api/models/errors/unprocessableentityerror";
|
|
5
|
+
import { useQueryClient as E } from "@tanstack/react-query";
|
|
6
|
+
import { useTranslation as b } from "react-i18next";
|
|
7
|
+
import { PolicySettingsPresentation as M } from "./PolicySettingsPresentation.js";
|
|
8
|
+
import { BaseComponent as v } from "../../Base/Base.js";
|
|
9
|
+
import { useBase as C } from "../../Base/useBase.js";
|
|
10
|
+
import { SDKInternalError as c } from "../../../types/sdkError.js";
|
|
11
|
+
import { componentEvents as s } from "../../../shared/constants.js";
|
|
12
|
+
import { useI18n as w } from "../../../i18n/I18n.js";
|
|
13
|
+
function Q(e) {
|
|
14
|
+
return /* @__PURE__ */ u(v, { ...e, children: /* @__PURE__ */ u(I, { ...e }) });
|
|
11
15
|
}
|
|
12
|
-
const
|
|
16
|
+
const S = [
|
|
13
17
|
"per_hour_worked",
|
|
14
18
|
"per_hour_worked_no_overtime",
|
|
15
19
|
"per_hour_paid",
|
|
16
20
|
"per_hour_paid_no_overtime"
|
|
17
|
-
],
|
|
18
|
-
function
|
|
19
|
-
return
|
|
21
|
+
], h = ["per_anniversary_year", "per_calendar_year"];
|
|
22
|
+
function L(e) {
|
|
23
|
+
return S.includes(e) ? "hours_worked" : h.includes(e) ? "fixed_all_at_once" : "fixed_per_pay_period";
|
|
20
24
|
}
|
|
21
|
-
function
|
|
25
|
+
function A(e) {
|
|
22
26
|
const r = {};
|
|
23
27
|
return e.maxAccrualHoursPerYear != null && (r.accrualMaximumEnabled = !0, r.accrualMaximum = Number(e.maxAccrualHoursPerYear)), e.maxHours != null && (r.balanceMaximumEnabled = !0, r.balanceMaximum = Number(e.maxHours)), e.carryoverLimitHours != null && (r.carryOverLimitEnabled = !0, r.carryOverLimit = Number(e.carryoverLimitHours)), e.accrualWaitingPeriodDays != null && e.accrualWaitingPeriodDays > 0 && (r.waitingPeriodEnabled = !0, r.waitingPeriod = e.accrualWaitingPeriodDays), e.paidOutOnTermination != null && (r.paidOutOnTermination = e.paidOutOnTermination), r;
|
|
24
28
|
}
|
|
25
|
-
function
|
|
26
|
-
const
|
|
29
|
+
function H(e, r, o) {
|
|
30
|
+
const n = o === "fixed_all_at_once";
|
|
27
31
|
return {
|
|
28
|
-
maxAccrualHoursPerYear: !
|
|
32
|
+
maxAccrualHoursPerYear: !n && e.accrualMaximumEnabled && e.accrualMaximum != null ? String(e.accrualMaximum) : null,
|
|
29
33
|
maxHours: e.balanceMaximumEnabled && e.balanceMaximum != null ? String(e.balanceMaximum) : null,
|
|
30
34
|
carryoverLimitHours: e.carryOverLimitEnabled && e.carryOverLimit != null ? String(e.carryOverLimit) : null,
|
|
31
|
-
accrualWaitingPeriodDays: !
|
|
35
|
+
accrualWaitingPeriodDays: !n && e.waitingPeriodEnabled && e.waitingPeriod != null ? e.waitingPeriod : null,
|
|
32
36
|
paidOutOnTermination: e.paidOutOnTermination,
|
|
33
|
-
complete: !0,
|
|
34
37
|
version: r
|
|
35
38
|
};
|
|
36
39
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
40
|
+
function I({ policyId: e, mode: r }) {
|
|
41
|
+
w("Company.TimeOff.CreateTimeOffPolicy");
|
|
42
|
+
const { t: o } = b("Company.TimeOff.CreateTimeOffPolicy"), { onEvent: n, baseSubmitHandler: f } = C(), d = E(), { data: _ } = g({
|
|
39
43
|
timeOffPolicyUuid: e
|
|
40
|
-
}), { mutateAsync:
|
|
41
|
-
if (!
|
|
42
|
-
const
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
-
|
|
44
|
+
}), { mutateAsync: O, isPending: p } = x(), a = _.timeOffPolicy;
|
|
45
|
+
if (!a) throw new Error("Unexpected response: missing timeOffPolicy");
|
|
46
|
+
const m = L(a.accrualMethod), y = a.version ?? "";
|
|
47
|
+
return /* @__PURE__ */ u(
|
|
48
|
+
M,
|
|
45
49
|
{
|
|
46
|
-
accrualMethod:
|
|
47
|
-
onContinue: async (
|
|
48
|
-
await
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
accrualMethod: m,
|
|
51
|
+
onContinue: async (l) => {
|
|
52
|
+
await f(l, async () => {
|
|
53
|
+
try {
|
|
54
|
+
const { timeOffPolicy: i } = await O({
|
|
55
|
+
request: {
|
|
56
|
+
timeOffPolicyUuid: e,
|
|
57
|
+
requestBody: H(l, y, m)
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
d.invalidateQueries({
|
|
61
|
+
queryKey: ["@gusto/embedded-api", "timeOffPolicies", "get"]
|
|
62
|
+
}), n(s.TIME_OFF_POLICY_SETTINGS_DONE, i);
|
|
63
|
+
} catch (i) {
|
|
64
|
+
if (i instanceof T) {
|
|
65
|
+
if (i.errors.some((t) => t.message === "LIMIT_VIOLATION_MAX_HOURS"))
|
|
66
|
+
throw new c(
|
|
67
|
+
o("policySettings.errors.balanceExceedsMaximum"),
|
|
68
|
+
"api_error"
|
|
69
|
+
);
|
|
70
|
+
const P = [...new Set(i.errors.map((t) => t.message).filter(Boolean))];
|
|
71
|
+
throw new c(
|
|
72
|
+
o("errors.updatePolicySettingsFailed", {
|
|
73
|
+
details: P.join(". ")
|
|
74
|
+
}),
|
|
75
|
+
"api_error"
|
|
76
|
+
);
|
|
53
77
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
queryKey: ["@gusto/embedded-api", "timeOffPolicies", "get"]
|
|
57
|
-
}), r(l.TIME_OFF_POLICY_SETTINGS_DONE, d);
|
|
78
|
+
throw i;
|
|
79
|
+
}
|
|
58
80
|
});
|
|
59
81
|
},
|
|
60
82
|
onBack: () => {
|
|
61
|
-
|
|
83
|
+
n(s.TIME_OFF_POLICY_SETTINGS_BACK);
|
|
62
84
|
},
|
|
63
|
-
defaultValues:
|
|
85
|
+
defaultValues: A(a),
|
|
86
|
+
mode: r,
|
|
87
|
+
editingPolicyName: r === "edit" ? a.name : void 0,
|
|
88
|
+
isPending: p
|
|
64
89
|
}
|
|
65
90
|
);
|
|
66
91
|
}
|
|
67
92
|
export {
|
|
68
|
-
|
|
93
|
+
Q as PolicySettings
|
|
69
94
|
};
|
|
70
95
|
//# sourceMappingURL=PolicySettings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolicySettings.js","sources":["../../../../src/components/TimeOff/PolicySettings/PolicySettings.tsx"],"sourcesContent":["import { useTimeOffPoliciesGetSuspense } from '@gusto/embedded-api/react-query/timeOffPoliciesGet'\nimport { useTimeOffPoliciesUpdateMutation } from '@gusto/embedded-api/react-query/timeOffPoliciesUpdate'\nimport type { PutV1TimeOffPoliciesTimeOffPolicyUuidRequestBody } from '@gusto/embedded-api/models/operations/putv1timeoffpoliciestimeoffpolicyuuid'\nimport type { TimeOffPolicy } from '@gusto/embedded-api/models/components/timeoffpolicy'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { PolicySettingsPresentation } from './PolicySettingsPresentation'\nimport type { PolicySettingsFormData, PolicySettingsAccrualMethod } from './PolicySettingsTypes'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { componentEvents } from '@/shared/constants'\n\nexport interface PolicySettingsProps extends BaseComponentInterface {\n policyId: string\n}\n\nexport function PolicySettings(props: PolicySettingsProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nconst HOURLY_ACCRUAL_METHODS = [\n 'per_hour_worked',\n 'per_hour_worked_no_overtime',\n 'per_hour_paid',\n 'per_hour_paid_no_overtime',\n]\n\nconst ALL_AT_ONCE_ACCRUAL_METHODS = ['per_anniversary_year', 'per_calendar_year']\n\nfunction deriveAccrualMethodCategory(apiAccrualMethod: string): PolicySettingsAccrualMethod {\n if (HOURLY_ACCRUAL_METHODS.includes(apiAccrualMethod)) return 'hours_worked'\n if (ALL_AT_ONCE_ACCRUAL_METHODS.includes(apiAccrualMethod)) return 'fixed_all_at_once'\n return 'fixed_per_pay_period'\n}\n\nfunction deriveDefaultValues(policy: TimeOffPolicy): Partial<PolicySettingsFormData> {\n const defaults: Partial<PolicySettingsFormData> = {}\n\n if (policy.maxAccrualHoursPerYear != null) {\n defaults.accrualMaximumEnabled = true\n defaults.accrualMaximum = Number(policy.maxAccrualHoursPerYear)\n }\n\n if (policy.maxHours != null) {\n defaults.balanceMaximumEnabled = true\n defaults.balanceMaximum = Number(policy.maxHours)\n }\n\n if (policy.carryoverLimitHours != null) {\n defaults.carryOverLimitEnabled = true\n defaults.carryOverLimit = Number(policy.carryoverLimitHours)\n }\n\n if (policy.accrualWaitingPeriodDays != null && policy.accrualWaitingPeriodDays > 0) {\n defaults.waitingPeriodEnabled = true\n defaults.waitingPeriod = policy.accrualWaitingPeriodDays\n }\n\n if (policy.paidOutOnTermination != null) {\n defaults.paidOutOnTermination = policy.paidOutOnTermination\n }\n\n return defaults\n}\n\nfunction buildUpdateRequestBody(\n data: PolicySettingsFormData,\n version: string,\n accrualCategory: PolicySettingsAccrualMethod,\n): PutV1TimeOffPoliciesTimeOffPolicyUuidRequestBody {\n const isAllAtOnce = accrualCategory === 'fixed_all_at_once'\n\n return {\n maxAccrualHoursPerYear:\n !isAllAtOnce && data.accrualMaximumEnabled && data.accrualMaximum != null\n ? String(data.accrualMaximum)\n : null,\n maxHours:\n data.balanceMaximumEnabled && data.balanceMaximum != null\n ? String(data.balanceMaximum)\n : null,\n carryoverLimitHours:\n data.carryOverLimitEnabled && data.carryOverLimit != null\n ? String(data.carryOverLimit)\n : null,\n accrualWaitingPeriodDays:\n !isAllAtOnce && data.waitingPeriodEnabled && data.waitingPeriod != null\n ? data.waitingPeriod\n : null,\n paidOutOnTermination: data.paidOutOnTermination,\n
|
|
1
|
+
{"version":3,"file":"PolicySettings.js","sources":["../../../../src/components/TimeOff/PolicySettings/PolicySettings.tsx"],"sourcesContent":["import { useTimeOffPoliciesGetSuspense } from '@gusto/embedded-api/react-query/timeOffPoliciesGet'\nimport { useTimeOffPoliciesUpdateMutation } from '@gusto/embedded-api/react-query/timeOffPoliciesUpdate'\nimport type { PutV1TimeOffPoliciesTimeOffPolicyUuidRequestBody } from '@gusto/embedded-api/models/operations/putv1timeoffpoliciestimeoffpolicyuuid'\nimport type { TimeOffPolicy } from '@gusto/embedded-api/models/components/timeoffpolicy'\nimport { UnprocessableEntityError } from '@gusto/embedded-api/models/errors/unprocessableentityerror'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { useTranslation } from 'react-i18next'\nimport { PolicySettingsPresentation } from './PolicySettingsPresentation'\nimport type { PolicySettingsFormData, PolicySettingsAccrualMethod } from './PolicySettingsTypes'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { SDKInternalError } from '@/types/sdkError'\nimport { componentEvents } from '@/shared/constants'\nimport { useI18n } from '@/i18n'\n\nexport interface PolicySettingsProps extends BaseComponentInterface {\n policyId: string\n mode?: 'create' | 'edit'\n}\n\nexport function PolicySettings(props: PolicySettingsProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nconst HOURLY_ACCRUAL_METHODS = [\n 'per_hour_worked',\n 'per_hour_worked_no_overtime',\n 'per_hour_paid',\n 'per_hour_paid_no_overtime',\n]\n\nconst ALL_AT_ONCE_ACCRUAL_METHODS = ['per_anniversary_year', 'per_calendar_year']\n\nfunction deriveAccrualMethodCategory(apiAccrualMethod: string): PolicySettingsAccrualMethod {\n if (HOURLY_ACCRUAL_METHODS.includes(apiAccrualMethod)) return 'hours_worked'\n if (ALL_AT_ONCE_ACCRUAL_METHODS.includes(apiAccrualMethod)) return 'fixed_all_at_once'\n return 'fixed_per_pay_period'\n}\n\nfunction deriveDefaultValues(policy: TimeOffPolicy): Partial<PolicySettingsFormData> {\n const defaults: Partial<PolicySettingsFormData> = {}\n\n if (policy.maxAccrualHoursPerYear != null) {\n defaults.accrualMaximumEnabled = true\n defaults.accrualMaximum = Number(policy.maxAccrualHoursPerYear)\n }\n\n if (policy.maxHours != null) {\n defaults.balanceMaximumEnabled = true\n defaults.balanceMaximum = Number(policy.maxHours)\n }\n\n if (policy.carryoverLimitHours != null) {\n defaults.carryOverLimitEnabled = true\n defaults.carryOverLimit = Number(policy.carryoverLimitHours)\n }\n\n if (policy.accrualWaitingPeriodDays != null && policy.accrualWaitingPeriodDays > 0) {\n defaults.waitingPeriodEnabled = true\n defaults.waitingPeriod = policy.accrualWaitingPeriodDays\n }\n\n if (policy.paidOutOnTermination != null) {\n defaults.paidOutOnTermination = policy.paidOutOnTermination\n }\n\n return defaults\n}\n\nfunction buildUpdateRequestBody(\n data: PolicySettingsFormData,\n version: string,\n accrualCategory: PolicySettingsAccrualMethod,\n): PutV1TimeOffPoliciesTimeOffPolicyUuidRequestBody {\n const isAllAtOnce = accrualCategory === 'fixed_all_at_once'\n\n return {\n maxAccrualHoursPerYear:\n !isAllAtOnce && data.accrualMaximumEnabled && data.accrualMaximum != null\n ? String(data.accrualMaximum)\n : null,\n maxHours:\n data.balanceMaximumEnabled && data.balanceMaximum != null\n ? String(data.balanceMaximum)\n : null,\n carryoverLimitHours:\n data.carryOverLimitEnabled && data.carryOverLimit != null\n ? String(data.carryOverLimit)\n : null,\n accrualWaitingPeriodDays:\n !isAllAtOnce && data.waitingPeriodEnabled && data.waitingPeriod != null\n ? data.waitingPeriod\n : null,\n paidOutOnTermination: data.paidOutOnTermination,\n version,\n }\n}\n\nfunction Root({ policyId, mode }: PolicySettingsProps) {\n useI18n('Company.TimeOff.CreateTimeOffPolicy')\n const { t } = useTranslation('Company.TimeOff.CreateTimeOffPolicy')\n const { onEvent, baseSubmitHandler } = useBase()\n const queryClient = useQueryClient()\n\n const { data: policyResponse } = useTimeOffPoliciesGetSuspense({\n timeOffPolicyUuid: policyId,\n })\n\n const { mutateAsync: updateTimeOffPolicy, isPending } = useTimeOffPoliciesUpdateMutation()\n\n const policy = policyResponse.timeOffPolicy\n if (!policy) throw new Error('Unexpected response: missing timeOffPolicy')\n\n const accrualCategory = deriveAccrualMethodCategory(policy.accrualMethod)\n const version = policy.version ?? ''\n\n const handleContinue = async (data: PolicySettingsFormData) => {\n await baseSubmitHandler(data, async () => {\n try {\n const { timeOffPolicy } = await updateTimeOffPolicy({\n request: {\n timeOffPolicyUuid: policyId,\n requestBody: buildUpdateRequestBody(data, version, accrualCategory),\n },\n })\n\n void queryClient.invalidateQueries({\n queryKey: ['@gusto/embedded-api', 'timeOffPolicies', 'get'],\n })\n onEvent(componentEvents.TIME_OFF_POLICY_SETTINGS_DONE, timeOffPolicy)\n } catch (err) {\n if (err instanceof UnprocessableEntityError) {\n if (err.errors.some(e => e.message === 'LIMIT_VIOLATION_MAX_HOURS')) {\n throw new SDKInternalError(\n t('policySettings.errors.balanceExceedsMaximum'),\n 'api_error',\n )\n }\n const uniqueMessages = [...new Set(err.errors.map(e => e.message).filter(Boolean))]\n throw new SDKInternalError(\n t('errors.updatePolicySettingsFailed', {\n details: uniqueMessages.join('. '),\n }),\n 'api_error',\n )\n }\n throw err\n }\n })\n }\n\n const handleBack = () => {\n onEvent(componentEvents.TIME_OFF_POLICY_SETTINGS_BACK)\n }\n\n return (\n <PolicySettingsPresentation\n accrualMethod={accrualCategory}\n onContinue={handleContinue}\n onBack={handleBack}\n defaultValues={deriveDefaultValues(policy)}\n mode={mode}\n editingPolicyName={mode === 'edit' ? policy.name : undefined}\n isPending={isPending}\n />\n )\n}\n"],"names":["PolicySettings","props","jsx","BaseComponent","Root","HOURLY_ACCRUAL_METHODS","ALL_AT_ONCE_ACCRUAL_METHODS","deriveAccrualMethodCategory","apiAccrualMethod","deriveDefaultValues","policy","defaults","buildUpdateRequestBody","data","version","accrualCategory","isAllAtOnce","policyId","mode","useI18n","t","useTranslation","onEvent","baseSubmitHandler","useBase","queryClient","useQueryClient","policyResponse","useTimeOffPoliciesGetSuspense","updateTimeOffPolicy","isPending","useTimeOffPoliciesUpdateMutation","PolicySettingsPresentation","timeOffPolicy","componentEvents","err","UnprocessableEntityError","e","SDKInternalError","uniqueMessages"],"mappings":";;;;;;;;;;;;AAoBO,SAASA,EAAeC,GAA4B;AACzD,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,MAAMI,IAAyB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEMC,IAA8B,CAAC,wBAAwB,mBAAmB;AAEhF,SAASC,EAA4BC,GAAuD;AAC1F,SAAIH,EAAuB,SAASG,CAAgB,IAAU,iBAC1DF,EAA4B,SAASE,CAAgB,IAAU,sBAC5D;AACT;AAEA,SAASC,EAAoBC,GAAwD;AACnF,QAAMC,IAA4C,CAAA;AAElD,SAAID,EAAO,0BAA0B,SACnCC,EAAS,wBAAwB,IACjCA,EAAS,iBAAiB,OAAOD,EAAO,sBAAsB,IAG5DA,EAAO,YAAY,SACrBC,EAAS,wBAAwB,IACjCA,EAAS,iBAAiB,OAAOD,EAAO,QAAQ,IAG9CA,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
|
2
|
-
export declare function PolicySettingsPresentation({ accrualMethod, onContinue, onBack, defaultValues, }: PolicySettingsPresentationProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function PolicySettingsPresentation({ accrualMethod, onContinue, onBack, defaultValues, mode, editingPolicyName, isPending, }: PolicySettingsPresentationProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,62 +1,80 @@
|
|
|
1
|
-
import { jsx as e, jsxs as l, Fragment as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { useForm as
|
|
4
|
-
import { useTranslation as
|
|
1
|
+
import { jsx as e, jsxs as l, Fragment as O } from "react/jsx-runtime";
|
|
2
|
+
import { useId as t } from "react";
|
|
3
|
+
import { useForm as k, useWatch as s, FormProvider as U } from "react-hook-form";
|
|
4
|
+
import { useTranslation as W } from "react-i18next";
|
|
5
|
+
import { z as n } from "zod";
|
|
6
|
+
import { zodResolver as _ } from "@hookform/resolvers/zod";
|
|
5
7
|
import a from "./PolicySettings.module.scss.js";
|
|
6
|
-
import { Flex as
|
|
8
|
+
import { Flex as L } from "../../Common/Flex/Flex.js";
|
|
7
9
|
import "classnames";
|
|
8
10
|
import "../../../shared/constants.js";
|
|
9
|
-
import { ActionsLayout as
|
|
10
|
-
import { Form as
|
|
11
|
-
import { useComponentContext as
|
|
12
|
-
import { useI18n as
|
|
13
|
-
import { NumberInputField as
|
|
14
|
-
import { SwitchField as
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
import { ActionsLayout as j } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
12
|
+
import { Form as z } from "../../Common/Form/Form.js";
|
|
13
|
+
import { useComponentContext as A } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
+
import { useI18n as B } from "../../../i18n/I18n.js";
|
|
15
|
+
import { NumberInputField as c } from "../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
16
|
+
import { SwitchField as r } from "../../Common/Fields/SwitchField/SwitchField.js";
|
|
17
|
+
const q = n.object({
|
|
18
|
+
accrualMaximumEnabled: n.boolean(),
|
|
19
|
+
accrualMaximum: n.number().optional(),
|
|
20
|
+
balanceMaximumEnabled: n.boolean(),
|
|
21
|
+
balanceMaximum: n.number().optional(),
|
|
22
|
+
carryOverLimitEnabled: n.boolean(),
|
|
23
|
+
carryOverLimit: n.number().optional(),
|
|
24
|
+
waitingPeriodEnabled: n.boolean(),
|
|
25
|
+
waitingPeriod: n.number().int().optional(),
|
|
26
|
+
paidOutOnTermination: n.boolean()
|
|
27
|
+
});
|
|
28
|
+
function si({
|
|
29
|
+
accrualMethod: d,
|
|
30
|
+
onContinue: M,
|
|
31
|
+
onBack: E,
|
|
32
|
+
defaultValues: P,
|
|
33
|
+
mode: w,
|
|
34
|
+
editingPolicyName: u,
|
|
35
|
+
isPending: b = !1
|
|
20
36
|
}) {
|
|
21
|
-
|
|
22
|
-
const { t: i } =
|
|
37
|
+
B("Company.TimeOff.CreateTimeOffPolicy");
|
|
38
|
+
const { t: i } = W("Company.TimeOff.CreateTimeOffPolicy"), { Heading: N, Button: p } = A(), g = t(), y = t(), h = t(), f = t(), x = t(), m = k({
|
|
39
|
+
resolver: _(q),
|
|
23
40
|
defaultValues: {
|
|
24
41
|
accrualMaximumEnabled: !1,
|
|
25
42
|
balanceMaximumEnabled: !1,
|
|
26
43
|
carryOverLimitEnabled: !1,
|
|
27
44
|
waitingPeriodEnabled: !1,
|
|
28
45
|
paidOutOnTermination: !1,
|
|
29
|
-
...
|
|
46
|
+
...P
|
|
30
47
|
}
|
|
31
|
-
}), { control:
|
|
32
|
-
|
|
48
|
+
}), { control: o } = m, H = s({ control: o, name: "accrualMaximumEnabled" }), C = s({ control: o, name: "balanceMaximumEnabled" }), F = s({ control: o, name: "carryOverLimitEnabled" }), I = s({ control: o, name: "waitingPeriodEnabled" }), S = d === "hours_worked", v = d === "fixed_per_pay_period", T = S || v, D = S || v, R = (V) => {
|
|
49
|
+
M(V);
|
|
33
50
|
};
|
|
34
|
-
return /* @__PURE__ */ e(
|
|
35
|
-
/* @__PURE__ */ e(
|
|
36
|
-
/* @__PURE__ */ l(
|
|
37
|
-
|
|
51
|
+
return /* @__PURE__ */ e(U, { ...m, children: /* @__PURE__ */ e(z, { "aria-labelledby": g, onSubmit: m.handleSubmit(R), children: /* @__PURE__ */ e("div", { className: a.policySettings, children: /* @__PURE__ */ l(L, { flexDirection: "column", gap: 32, children: [
|
|
52
|
+
/* @__PURE__ */ e(N, { as: "h2", id: g, children: w === "edit" && u ? i("policySettings.editTitle", { name: u }) : i("policySettings.createTitle") }),
|
|
53
|
+
/* @__PURE__ */ l(L, { flexDirection: "column", gap: 20, children: [
|
|
54
|
+
T && /* @__PURE__ */ l(O, { children: [
|
|
38
55
|
/* @__PURE__ */ l("div", { className: a.settingRow, children: [
|
|
39
56
|
/* @__PURE__ */ e(
|
|
40
|
-
|
|
57
|
+
c,
|
|
41
58
|
{
|
|
42
59
|
className: a.settingField,
|
|
43
|
-
id:
|
|
60
|
+
id: y,
|
|
44
61
|
name: "accrualMaximum",
|
|
45
62
|
label: i("policySettings.accrualMaximumLabel"),
|
|
46
63
|
description: i("policySettings.accrualMaximumHint"),
|
|
47
64
|
adornmentEnd: i("policySettings.hoursUnit"),
|
|
48
65
|
placeholder: i("policySettings.numberOfHoursPlaceholder"),
|
|
49
|
-
isDisabled: !
|
|
50
|
-
min: 0
|
|
66
|
+
isDisabled: !H,
|
|
67
|
+
min: 0,
|
|
68
|
+
max: 2e4
|
|
51
69
|
}
|
|
52
70
|
),
|
|
53
71
|
/* @__PURE__ */ e("div", { className: a.toggleCell, children: /* @__PURE__ */ e(
|
|
54
|
-
|
|
72
|
+
r,
|
|
55
73
|
{
|
|
56
74
|
name: "accrualMaximumEnabled",
|
|
57
75
|
label: i("policySettings.accrualMaximumLabel"),
|
|
58
76
|
shouldVisuallyHideLabel: !0,
|
|
59
|
-
"aria-controls":
|
|
77
|
+
"aria-controls": y
|
|
60
78
|
}
|
|
61
79
|
) })
|
|
62
80
|
] }),
|
|
@@ -64,86 +82,91 @@ function ii({
|
|
|
64
82
|
] }),
|
|
65
83
|
/* @__PURE__ */ l("div", { className: a.settingRow, children: [
|
|
66
84
|
/* @__PURE__ */ e(
|
|
67
|
-
|
|
85
|
+
c,
|
|
68
86
|
{
|
|
69
87
|
className: a.settingField,
|
|
70
|
-
id:
|
|
88
|
+
id: h,
|
|
71
89
|
name: "balanceMaximum",
|
|
72
90
|
label: i("policySettings.balanceMaximumLabel"),
|
|
73
91
|
description: i("policySettings.balanceMaximumHint"),
|
|
74
92
|
adornmentEnd: i("policySettings.hoursUnit"),
|
|
75
93
|
placeholder: i("policySettings.numberOfHoursPlaceholder"),
|
|
76
|
-
isDisabled: !
|
|
77
|
-
min: 0
|
|
94
|
+
isDisabled: !C,
|
|
95
|
+
min: 0,
|
|
96
|
+
max: 2e4
|
|
78
97
|
}
|
|
79
98
|
),
|
|
80
99
|
/* @__PURE__ */ e("div", { className: a.toggleCell, children: /* @__PURE__ */ e(
|
|
81
|
-
|
|
100
|
+
r,
|
|
82
101
|
{
|
|
83
102
|
name: "balanceMaximumEnabled",
|
|
84
103
|
label: i("policySettings.balanceMaximumLabel"),
|
|
85
104
|
shouldVisuallyHideLabel: !0,
|
|
86
|
-
"aria-controls":
|
|
105
|
+
"aria-controls": h
|
|
87
106
|
}
|
|
88
107
|
) })
|
|
89
108
|
] }),
|
|
90
109
|
/* @__PURE__ */ e("hr", { className: a.divider }),
|
|
91
110
|
/* @__PURE__ */ l("div", { className: a.settingRow, children: [
|
|
92
111
|
/* @__PURE__ */ e(
|
|
93
|
-
|
|
112
|
+
c,
|
|
94
113
|
{
|
|
95
114
|
className: a.settingField,
|
|
96
|
-
id:
|
|
115
|
+
id: f,
|
|
97
116
|
name: "carryOverLimit",
|
|
98
117
|
label: i("policySettings.carryOverLimitLabel"),
|
|
99
118
|
description: i("policySettings.carryOverLimitHint"),
|
|
100
119
|
adornmentEnd: i("policySettings.hoursUnit"),
|
|
101
120
|
placeholder: i("policySettings.numberOfHoursPlaceholder"),
|
|
102
|
-
isDisabled: !
|
|
103
|
-
min: 0
|
|
121
|
+
isDisabled: !F,
|
|
122
|
+
min: 0,
|
|
123
|
+
max: 2e4
|
|
104
124
|
}
|
|
105
125
|
),
|
|
106
126
|
/* @__PURE__ */ e("div", { className: a.toggleCell, children: /* @__PURE__ */ e(
|
|
107
|
-
|
|
127
|
+
r,
|
|
108
128
|
{
|
|
109
129
|
name: "carryOverLimitEnabled",
|
|
110
130
|
label: i("policySettings.carryOverLimitLabel"),
|
|
111
131
|
shouldVisuallyHideLabel: !0,
|
|
112
|
-
"aria-controls":
|
|
132
|
+
"aria-controls": f
|
|
113
133
|
}
|
|
114
134
|
) })
|
|
115
135
|
] }),
|
|
116
136
|
/* @__PURE__ */ e("hr", { className: a.divider }),
|
|
117
|
-
|
|
137
|
+
D && /* @__PURE__ */ l(O, { children: [
|
|
118
138
|
/* @__PURE__ */ l("div", { className: a.settingRow, children: [
|
|
119
139
|
/* @__PURE__ */ e(
|
|
120
|
-
|
|
140
|
+
c,
|
|
121
141
|
{
|
|
122
142
|
className: a.settingField,
|
|
123
|
-
id:
|
|
143
|
+
id: x,
|
|
124
144
|
name: "waitingPeriod",
|
|
125
145
|
label: i("policySettings.waitingPeriodLabel"),
|
|
126
146
|
description: i("policySettings.waitingPeriodHint"),
|
|
127
147
|
adornmentEnd: i("policySettings.daysUnit"),
|
|
128
148
|
placeholder: i("policySettings.numberOfDaysPlaceholder"),
|
|
129
|
-
isDisabled: !
|
|
130
|
-
min: 0
|
|
149
|
+
isDisabled: !I,
|
|
150
|
+
min: 0,
|
|
151
|
+
max: 2e4,
|
|
152
|
+
maximumFractionDigits: 0,
|
|
153
|
+
errorMessage: i("policySettings.errors.waitingPeriodMustBeWholeNumber")
|
|
131
154
|
}
|
|
132
155
|
),
|
|
133
156
|
/* @__PURE__ */ e("div", { className: a.toggleCell, children: /* @__PURE__ */ e(
|
|
134
|
-
|
|
157
|
+
r,
|
|
135
158
|
{
|
|
136
159
|
name: "waitingPeriodEnabled",
|
|
137
160
|
label: i("policySettings.waitingPeriodLabel"),
|
|
138
161
|
shouldVisuallyHideLabel: !0,
|
|
139
|
-
"aria-controls":
|
|
162
|
+
"aria-controls": x
|
|
140
163
|
}
|
|
141
164
|
) })
|
|
142
165
|
] }),
|
|
143
166
|
/* @__PURE__ */ e("hr", { className: a.divider })
|
|
144
167
|
] }),
|
|
145
168
|
/* @__PURE__ */ e(
|
|
146
|
-
|
|
169
|
+
r,
|
|
147
170
|
{
|
|
148
171
|
name: "paidOutOnTermination",
|
|
149
172
|
label: i("policySettings.paidOutOnTerminationLabel"),
|
|
@@ -151,14 +174,14 @@ function ii({
|
|
|
151
174
|
}
|
|
152
175
|
),
|
|
153
176
|
/* @__PURE__ */ e("hr", { className: a.divider }),
|
|
154
|
-
/* @__PURE__ */ l(
|
|
155
|
-
/* @__PURE__ */ e(
|
|
156
|
-
/* @__PURE__ */ e(
|
|
177
|
+
/* @__PURE__ */ l(j, { children: [
|
|
178
|
+
/* @__PURE__ */ e(p, { variant: "secondary", onClick: E, isDisabled: b, children: i("backCta") }),
|
|
179
|
+
/* @__PURE__ */ e(p, { variant: "primary", type: "submit", isLoading: b, children: i("policySettings.continueCta") })
|
|
157
180
|
] })
|
|
158
181
|
] })
|
|
159
182
|
] }) }) }) });
|
|
160
183
|
}
|
|
161
184
|
export {
|
|
162
|
-
|
|
185
|
+
si as PolicySettingsPresentation
|
|
163
186
|
};
|
|
164
187
|
//# sourceMappingURL=PolicySettingsPresentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolicySettingsPresentation.js","sources":["../../../../src/components/TimeOff/PolicySettings/PolicySettingsPresentation.tsx"],"sourcesContent":["import { useId } from 'react'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type { PolicySettingsFormData, PolicySettingsPresentationProps } from './PolicySettingsTypes'\nimport styles from './PolicySettings.module.scss'\nimport { Flex, ActionsLayout, NumberInputField, SwitchField } from '@/components/Common'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nexport function PolicySettingsPresentation({\n accrualMethod,\n onContinue,\n onBack,\n defaultValues,\n}: PolicySettingsPresentationProps) {\n useI18n('Company.TimeOff.CreateTimeOffPolicy')\n const { t } = useTranslation('Company.TimeOff.CreateTimeOffPolicy')\n const { Heading, Button } = useComponentContext()\n const headingId = useId()\n\n const accrualMaxInputId = useId()\n const balanceMaxInputId = useId()\n const carryOverInputId = useId()\n const waitingPeriodInputId = useId()\n\n const formMethods = useForm<PolicySettingsFormData>({\n defaultValues: {\n accrualMaximumEnabled: false,\n balanceMaximumEnabled: false,\n carryOverLimitEnabled: false,\n waitingPeriodEnabled: false,\n paidOutOnTermination: false,\n ...defaultValues,\n },\n })\n\n const { control } = formMethods\n const accrualMaximumEnabled = useWatch({ control, name: 'accrualMaximumEnabled' })\n const balanceMaximumEnabled = useWatch({ control, name: 'balanceMaximumEnabled' })\n const carryOverLimitEnabled = useWatch({ control, name: 'carryOverLimitEnabled' })\n const waitingPeriodEnabled = useWatch({ control, name: 'waitingPeriodEnabled' })\n\n const isHoursWorked = accrualMethod === 'hours_worked'\n const isFixedPerPayPeriod = accrualMethod === 'fixed_per_pay_period'\n const showAccrualMaximum = isHoursWorked || isFixedPerPayPeriod\n const showWaitingPeriod = isHoursWorked || isFixedPerPayPeriod\n\n const handleSubmit = (data: PolicySettingsFormData) => {\n onContinue(data)\n }\n\n return (\n <FormProvider {...formMethods}>\n <HtmlForm aria-labelledby={headingId} onSubmit={formMethods.handleSubmit(handleSubmit)}>\n <div className={styles.policySettings}>\n <Flex flexDirection=\"column\" gap={32}>\n <Heading as=\"h2\" id={headingId}>\n {t('policySettings.title')}\n </Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n {showAccrualMaximum && (\n <>\n <div className={styles.settingRow}>\n <NumberInputField\n className={styles.settingField}\n id={accrualMaxInputId}\n name=\"accrualMaximum\"\n label={t('policySettings.accrualMaximumLabel')}\n description={t('policySettings.accrualMaximumHint')}\n adornmentEnd={t('policySettings.hoursUnit')}\n placeholder={t('policySettings.numberOfHoursPlaceholder')}\n isDisabled={!accrualMaximumEnabled}\n min={0}\n />\n <div className={styles.toggleCell}>\n <SwitchField\n name=\"accrualMaximumEnabled\"\n label={t('policySettings.accrualMaximumLabel')}\n shouldVisuallyHideLabel\n aria-controls={accrualMaxInputId}\n />\n </div>\n </div>\n\n <hr className={styles.divider} />\n </>\n )}\n\n <div className={styles.settingRow}>\n <NumberInputField\n className={styles.settingField}\n id={balanceMaxInputId}\n name=\"balanceMaximum\"\n label={t('policySettings.balanceMaximumLabel')}\n description={t('policySettings.balanceMaximumHint')}\n adornmentEnd={t('policySettings.hoursUnit')}\n placeholder={t('policySettings.numberOfHoursPlaceholder')}\n isDisabled={!balanceMaximumEnabled}\n min={0}\n />\n <div className={styles.toggleCell}>\n <SwitchField\n name=\"balanceMaximumEnabled\"\n label={t('policySettings.balanceMaximumLabel')}\n shouldVisuallyHideLabel\n aria-controls={balanceMaxInputId}\n />\n </div>\n </div>\n\n <hr className={styles.divider} />\n\n <div className={styles.settingRow}>\n <NumberInputField\n className={styles.settingField}\n id={carryOverInputId}\n name=\"carryOverLimit\"\n label={t('policySettings.carryOverLimitLabel')}\n description={t('policySettings.carryOverLimitHint')}\n adornmentEnd={t('policySettings.hoursUnit')}\n placeholder={t('policySettings.numberOfHoursPlaceholder')}\n isDisabled={!carryOverLimitEnabled}\n min={0}\n />\n <div className={styles.toggleCell}>\n <SwitchField\n name=\"carryOverLimitEnabled\"\n label={t('policySettings.carryOverLimitLabel')}\n shouldVisuallyHideLabel\n aria-controls={carryOverInputId}\n />\n </div>\n </div>\n\n <hr className={styles.divider} />\n\n {showWaitingPeriod && (\n <>\n <div className={styles.settingRow}>\n <NumberInputField\n className={styles.settingField}\n id={waitingPeriodInputId}\n name=\"waitingPeriod\"\n label={t('policySettings.waitingPeriodLabel')}\n description={t('policySettings.waitingPeriodHint')}\n adornmentEnd={t('policySettings.daysUnit')}\n placeholder={t('policySettings.numberOfDaysPlaceholder')}\n isDisabled={!waitingPeriodEnabled}\n min={0}\n />\n <div className={styles.toggleCell}>\n <SwitchField\n name=\"waitingPeriodEnabled\"\n label={t('policySettings.waitingPeriodLabel')}\n shouldVisuallyHideLabel\n aria-controls={waitingPeriodInputId}\n />\n </div>\n </div>\n\n <hr className={styles.divider} />\n </>\n )}\n\n <SwitchField\n name=\"paidOutOnTermination\"\n label={t('policySettings.paidOutOnTerminationLabel')}\n description={t('policySettings.paidOutOnTerminationHint')}\n />\n\n <hr className={styles.divider} />\n\n <ActionsLayout>\n <Button variant=\"secondary\" onClick={onBack}>\n {t('backCta')}\n </Button>\n <Button variant=\"primary\" type=\"submit\">\n {t('policySettings.continueCta')}\n </Button>\n </ActionsLayout>\n </Flex>\n </Flex>\n </div>\n </HtmlForm>\n </FormProvider>\n )\n}\n"],"names":["PolicySettingsPresentation","accrualMethod","onContinue","onBack","defaultValues","useI18n","t","useTranslation","Heading","Button","useComponentContext","headingId","useId","accrualMaxInputId","balanceMaxInputId","carryOverInputId","waitingPeriodInputId","formMethods","useForm","control","accrualMaximumEnabled","useWatch","balanceMaximumEnabled","carryOverLimitEnabled","waitingPeriodEnabled","isHoursWorked","isFixedPerPayPeriod","showAccrualMaximum","showWaitingPeriod","handleSubmit","data","jsx","FormProvider","HtmlForm","styles","Flex","jsxs","Fragment","NumberInputField","SwitchField","ActionsLayout"],"mappings":";;;;;;;;;;;;;;AAUO,SAASA,GAA2B;AAAA,EACzC,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,QAAAC;AAAA,EACA,eAAAC;AACF,GAAoC;AAClC,EAAAC,EAAQ,qCAAqC;AAC7C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qCAAqC,GAC5D,EAAE,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AC,OAAA,EAAI,WAAWG,EAAO,YACrB,UAAA,gBAAAH;AAAA,YAACQ;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,OAAOjC,EAAE,mCAAmC;AAAA,cAC5C,yBAAuB;AAAA,cACvB,iBAAeU;AAAA,YAAA;AAAA,UAAA,EACjB,CACF;AAAA,QAAA,GACF;AAAA,QAEA,gBAAAe,EAAC,MAAA,EAAG,WAAWG,EAAO,QAAA,CAAS;AAAA,MAAA,GACjC;AAAA,MAGF,gBAAAH;AAAA,QAACQ;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOjC,EAAE,0CAA0C;AAAA,UACnD,aAAaA,EAAE,yCAAyC;AAAA,QAAA;AAAA,MAAA;AAAA,MAG1D,gBAAAyB,EAAC,MAAA,EAAG,WAAWG,EAAO,QAAA,CAAS;AAAA,wBAE9BM,GAAA,EACC,UAAA;AAAA,QAAA,gBAAAT,EAACtB,KAAO,SAAQ,aAAY,SAASN,GAClC,UAAAG,EAAE,SAAS,GACd;AAAA,QACA,gBAAAyB,EAACtB,KAAO,SAAQ,WAAU,MAAK,UAC5B,UAAAH,EAAE,4BAA4B,EAAA,CACjC;AAAA,MAAA,EAAA,CACF;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"PolicySettingsPresentation.js","sources":["../../../../src/components/TimeOff/PolicySettings/PolicySettingsPresentation.tsx"],"sourcesContent":["import { useId } from 'react'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport type { PolicySettingsFormData, PolicySettingsPresentationProps } from './PolicySettingsTypes'\nimport styles from './PolicySettings.module.scss'\nimport { Flex, ActionsLayout, NumberInputField, SwitchField } from '@/components/Common'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nconst PolicySettingsSchema = z.object({\n accrualMaximumEnabled: z.boolean(),\n accrualMaximum: z.number().optional(),\n balanceMaximumEnabled: z.boolean(),\n balanceMaximum: z.number().optional(),\n carryOverLimitEnabled: z.boolean(),\n carryOverLimit: z.number().optional(),\n waitingPeriodEnabled: z.boolean(),\n waitingPeriod: z.number().int().optional(),\n paidOutOnTermination: z.boolean(),\n})\n\nexport function PolicySettingsPresentation({\n accrualMethod,\n onContinue,\n onBack,\n defaultValues,\n mode,\n editingPolicyName,\n isPending = false,\n}: PolicySettingsPresentationProps) {\n useI18n('Company.TimeOff.CreateTimeOffPolicy')\n const { t } = useTranslation('Company.TimeOff.CreateTimeOffPolicy')\n const { Heading, Button } = useComponentContext()\n const headingId = useId()\n\n const accrualMaxInputId = useId()\n const balanceMaxInputId = useId()\n const carryOverInputId = useId()\n const waitingPeriodInputId = useId()\n\n const formMethods = useForm<PolicySettingsFormData>({\n resolver: zodResolver(PolicySettingsSchema),\n defaultValues: {\n accrualMaximumEnabled: false,\n balanceMaximumEnabled: false,\n carryOverLimitEnabled: false,\n waitingPeriodEnabled: false,\n paidOutOnTermination: false,\n ...defaultValues,\n },\n })\n\n const { control } = formMethods\n const accrualMaximumEnabled = useWatch({ control, name: 'accrualMaximumEnabled' })\n const balanceMaximumEnabled = useWatch({ control, name: 'balanceMaximumEnabled' })\n const carryOverLimitEnabled = useWatch({ control, name: 'carryOverLimitEnabled' })\n const waitingPeriodEnabled = useWatch({ control, name: 'waitingPeriodEnabled' })\n\n const isHoursWorked = accrualMethod === 'hours_worked'\n const isFixedPerPayPeriod = accrualMethod === 'fixed_per_pay_period'\n const showAccrualMaximum = isHoursWorked || isFixedPerPayPeriod\n const showWaitingPeriod = isHoursWorked || isFixedPerPayPeriod\n\n const handleSubmit = (data: PolicySettingsFormData) => {\n onContinue(data)\n }\n\n return (\n <FormProvider {...formMethods}>\n <HtmlForm aria-labelledby={headingId} onSubmit={formMethods.handleSubmit(handleSubmit)}>\n <div className={styles.policySettings}>\n <Flex flexDirection=\"column\" gap={32}>\n <Heading as=\"h2\" id={headingId}>\n {mode === 'edit' && editingPolicyName\n ? t('policySettings.editTitle', { name: editingPolicyName })\n : t('policySettings.createTitle')}\n </Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n {showAccrualMaximum && (\n <>\n <div className={styles.settingRow}>\n <NumberInputField\n className={styles.settingField}\n id={accrualMaxInputId}\n name=\"accrualMaximum\"\n label={t('policySettings.accrualMaximumLabel')}\n description={t('policySettings.accrualMaximumHint')}\n adornmentEnd={t('policySettings.hoursUnit')}\n placeholder={t('policySettings.numberOfHoursPlaceholder')}\n isDisabled={!accrualMaximumEnabled}\n min={0}\n max={20000}\n />\n <div className={styles.toggleCell}>\n <SwitchField\n name=\"accrualMaximumEnabled\"\n label={t('policySettings.accrualMaximumLabel')}\n shouldVisuallyHideLabel\n aria-controls={accrualMaxInputId}\n />\n </div>\n </div>\n\n <hr className={styles.divider} />\n </>\n )}\n\n <div className={styles.settingRow}>\n <NumberInputField\n className={styles.settingField}\n id={balanceMaxInputId}\n name=\"balanceMaximum\"\n label={t('policySettings.balanceMaximumLabel')}\n description={t('policySettings.balanceMaximumHint')}\n adornmentEnd={t('policySettings.hoursUnit')}\n placeholder={t('policySettings.numberOfHoursPlaceholder')}\n isDisabled={!balanceMaximumEnabled}\n min={0}\n max={20000}\n />\n <div className={styles.toggleCell}>\n <SwitchField\n name=\"balanceMaximumEnabled\"\n label={t('policySettings.balanceMaximumLabel')}\n shouldVisuallyHideLabel\n aria-controls={balanceMaxInputId}\n />\n </div>\n </div>\n\n <hr className={styles.divider} />\n\n <div className={styles.settingRow}>\n <NumberInputField\n className={styles.settingField}\n id={carryOverInputId}\n name=\"carryOverLimit\"\n label={t('policySettings.carryOverLimitLabel')}\n description={t('policySettings.carryOverLimitHint')}\n adornmentEnd={t('policySettings.hoursUnit')}\n placeholder={t('policySettings.numberOfHoursPlaceholder')}\n isDisabled={!carryOverLimitEnabled}\n min={0}\n max={20000}\n />\n <div className={styles.toggleCell}>\n <SwitchField\n name=\"carryOverLimitEnabled\"\n label={t('policySettings.carryOverLimitLabel')}\n shouldVisuallyHideLabel\n aria-controls={carryOverInputId}\n />\n </div>\n </div>\n\n <hr className={styles.divider} />\n\n {showWaitingPeriod && (\n <>\n <div className={styles.settingRow}>\n <NumberInputField\n className={styles.settingField}\n id={waitingPeriodInputId}\n name=\"waitingPeriod\"\n label={t('policySettings.waitingPeriodLabel')}\n description={t('policySettings.waitingPeriodHint')}\n adornmentEnd={t('policySettings.daysUnit')}\n placeholder={t('policySettings.numberOfDaysPlaceholder')}\n isDisabled={!waitingPeriodEnabled}\n min={0}\n max={20000}\n maximumFractionDigits={0}\n errorMessage={t('policySettings.errors.waitingPeriodMustBeWholeNumber')}\n />\n <div className={styles.toggleCell}>\n <SwitchField\n name=\"waitingPeriodEnabled\"\n label={t('policySettings.waitingPeriodLabel')}\n shouldVisuallyHideLabel\n aria-controls={waitingPeriodInputId}\n />\n </div>\n </div>\n\n <hr className={styles.divider} />\n </>\n )}\n\n <SwitchField\n name=\"paidOutOnTermination\"\n label={t('policySettings.paidOutOnTerminationLabel')}\n description={t('policySettings.paidOutOnTerminationHint')}\n />\n\n <hr className={styles.divider} />\n\n <ActionsLayout>\n <Button variant=\"secondary\" onClick={onBack} isDisabled={isPending}>\n {t('backCta')}\n </Button>\n <Button variant=\"primary\" type=\"submit\" isLoading={isPending}>\n {t('policySettings.continueCta')}\n </Button>\n </ActionsLayout>\n </Flex>\n </Flex>\n </div>\n </HtmlForm>\n </FormProvider>\n )\n}\n"],"names":["PolicySettingsSchema","z","PolicySettingsPresentation","accrualMethod","onContinue","onBack","defaultValues","mode","editingPolicyName","isPending","useI18n","t","useTranslation","Heading","Button","useComponentContext","headingId","useId","accrualMaxInputId","balanceMaxInputId","carryOverInputId","waitingPeriodInputId","formMethods","useForm","zodResolver","control","accrualMaximumEnabled","useWatch","balanceMaximumEnabled","carryOverLimitEnabled","waitingPeriodEnabled","isHoursWorked","isFixedPerPayPeriod","showAccrualMaximum","showWaitingPeriod","handleSubmit","data","jsx","FormProvider","HtmlForm","styles","Flex","jsxs","Fragment","NumberInputField","SwitchField","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;AAYA,MAAMA,IAAuBC,EAAE,OAAO;AAAA,EACpC,uBAAuBA,EAAE,QAAA;AAAA,EACzB,gBAAgBA,EAAE,OAAA,EAAS,SAAA;AAAA,EAC3B,uBAAuBA,EAAE,QAAA;AAAA,EACzB,gBAAgBA,EAAE,OAAA,EAAS,SAAA;AAAA,EAC3B,uBAAuBA,EAAE,QAAA;AAAA,EACzB,gBAAgBA,EAAE,OAAA,EAAS,SAAA;AAAA,EAC3B,sBAAsBA,EAAE,QAAA;AAAA,EACxB,eAAeA,EAAE,OAAA,EAAS,IAAA,EAAM,SAAA;AAAA,EAChC,sBAAsBA,EAAE,QAAA;AAC1B,CAAC;AAEM,SAASC,GAA2B;AAAA,EACzC,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,QAAAC;AAAA,EACA,eAAAC;AAAA,EACA,MAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,WAAAC,IAAY;AACd,GAAoC;AAClC,EAAAC,EAAQ,qCAAqC;AAC7C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qCAAqC,GAC5D,EAAE,SAAAC,GAAS,QAAAC,EAAA,IAAWC,EAAA,GACtBC,IAAYC,EAAA,GAEZC,IAAoBD,EAAA,GACpBE,IAAoBF,EAAA,GACpBG,IAAmBH,EAAA,GACnBI,IAAuBJ,EAAA,GAEvBK,IAAcC,EAAgC;AAAA,IAClD,UAAUC,EAAYxB,CAAoB;AAAA,IAC1C,eAAe;AAAA,MACb,uBAAuB;AAAA,MACvB,uBAAuB;AAAA,MACvB,uBAAuB;AAAA,MACvB,sBAAsB;AAAA,MACtB,sBAAsB;AAAA,MACtB,GAAGM;AAAA,IAAA;AAAA,EACL,CACD,GA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ACvB,iBAAeU;AAAA,YAAA;AAAA,UAAA,EACjB,CACF;AAAA,QAAA,GACF;AAAA,QAEA,gBAAAgB,EAAC,MAAA,EAAG,WAAWG,EAAO,QAAA,CAAS;AAAA,MAAA,GACjC;AAAA,MAGF,gBAAAH;AAAA,QAACQ;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOlC,EAAE,0CAA0C;AAAA,UACnD,aAAaA,EAAE,yCAAyC;AAAA,QAAA;AAAA,MAAA;AAAA,MAG1D,gBAAA0B,EAAC,MAAA,EAAG,WAAWG,EAAO,QAAA,CAAS;AAAA,wBAE9BM,GAAA,EACC,UAAA;AAAA,QAAA,gBAAAT,EAACvB,GAAA,EAAO,SAAQ,aAAY,SAAST,GAAQ,YAAYI,GACtD,UAAAE,EAAE,SAAS,EAAA,CACd;AAAA,QACA,gBAAA0B,EAACvB,GAAA,EAAO,SAAQ,WAAU,MAAK,UAAS,WAAWL,GAChD,UAAAE,EAAE,4BAA4B,EAAA,CACjC;AAAA,MAAA,EAAA,CACF;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
@@ -15,4 +15,7 @@ export interface PolicySettingsPresentationProps {
|
|
|
15
15
|
onContinue: (data: PolicySettingsFormData) => void;
|
|
16
16
|
onBack: () => void;
|
|
17
17
|
defaultValues?: Partial<PolicySettingsFormData>;
|
|
18
|
+
mode?: 'create' | 'edit';
|
|
19
|
+
editingPolicyName?: string;
|
|
20
|
+
isPending?: boolean;
|
|
18
21
|
}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { useForm as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { Flex as
|
|
1
|
+
import { jsx as i, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { useId as T, useMemo as b } from "react";
|
|
3
|
+
import { useForm as v, useWatch as x, FormProvider as C } from "react-hook-form";
|
|
4
|
+
import { useTranslation as L } from "react-i18next";
|
|
5
|
+
import { Flex as c } from "../../Common/Flex/Flex.js";
|
|
6
6
|
import "classnames";
|
|
7
7
|
import "../../../shared/constants.js";
|
|
8
|
-
import { ActionsLayout as
|
|
9
|
-
import { Form as
|
|
10
|
-
import { useComponentContext as
|
|
11
|
-
import { useI18n as
|
|
12
|
-
import { RadioGroupField as
|
|
13
|
-
function
|
|
14
|
-
onContinue:
|
|
15
|
-
onCancel:
|
|
16
|
-
defaultPolicyType:
|
|
17
|
-
holidayPolicyExists:
|
|
8
|
+
import { ActionsLayout as g } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
9
|
+
import { Form as S } from "../../Common/Form/Form.js";
|
|
10
|
+
import { useComponentContext as F } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
|
+
import { useI18n as H } from "../../../i18n/I18n.js";
|
|
12
|
+
import { RadioGroupField as O } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
13
|
+
function W({
|
|
14
|
+
onContinue: p,
|
|
15
|
+
onCancel: s,
|
|
16
|
+
defaultPolicyType: m,
|
|
17
|
+
holidayPolicyExists: r = !1
|
|
18
18
|
}) {
|
|
19
|
-
|
|
20
|
-
const { t: e } =
|
|
19
|
+
H("Company.TimeOff.SelectPolicyType");
|
|
20
|
+
const { t: e } = L("Company.TimeOff.SelectPolicyType"), { Heading: d, Text: y, Button: l } = F(), a = T(), t = v({
|
|
21
21
|
defaultValues: {
|
|
22
|
-
policyType:
|
|
22
|
+
policyType: m
|
|
23
23
|
}
|
|
24
|
-
}),
|
|
24
|
+
}), u = x({ control: t.control, name: "policyType" }), f = b(() => {
|
|
25
25
|
const o = [];
|
|
26
|
-
return
|
|
26
|
+
return r || o.push({
|
|
27
27
|
value: "holiday",
|
|
28
28
|
label: e("holidayLabel"),
|
|
29
29
|
description: e("holidayHint")
|
|
@@ -39,30 +39,31 @@ function G({
|
|
|
39
39
|
description: e("sickLeaveHint")
|
|
40
40
|
}
|
|
41
41
|
), o;
|
|
42
|
-
}, [e,
|
|
43
|
-
|
|
42
|
+
}, [e, r]), h = (o) => {
|
|
43
|
+
p(o.policyType);
|
|
44
44
|
};
|
|
45
|
-
return /* @__PURE__ */ i(
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */ i(d, { as: "h2", id:
|
|
48
|
-
/* @__PURE__ */ i(
|
|
45
|
+
return /* @__PURE__ */ i(C, { ...t, children: /* @__PURE__ */ i(S, { "aria-labelledby": a, onSubmit: t.handleSubmit(h), children: /* @__PURE__ */ n(c, { flexDirection: "column", gap: 24, children: [
|
|
46
|
+
/* @__PURE__ */ n(c, { flexDirection: "column", gap: 4, children: [
|
|
47
|
+
/* @__PURE__ */ i(d, { as: "h2", id: a, children: e("title") }),
|
|
48
|
+
/* @__PURE__ */ i(y, { variant: "supporting", children: e("policyTypeHint") })
|
|
49
49
|
] }),
|
|
50
50
|
/* @__PURE__ */ i(
|
|
51
|
-
|
|
51
|
+
O,
|
|
52
52
|
{
|
|
53
53
|
name: "policyType",
|
|
54
54
|
label: e("policyTypeLabel"),
|
|
55
|
-
options:
|
|
56
|
-
isRequired: !0
|
|
55
|
+
options: f,
|
|
56
|
+
isRequired: !0,
|
|
57
|
+
errorMessage: e("validations.policyTypeRequired")
|
|
57
58
|
}
|
|
58
59
|
),
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */ i(
|
|
61
|
-
/* @__PURE__ */ i(
|
|
60
|
+
/* @__PURE__ */ n(g, { children: [
|
|
61
|
+
/* @__PURE__ */ i(l, { variant: "secondary", onClick: s, children: e("cancelCta") }),
|
|
62
|
+
/* @__PURE__ */ i(l, { variant: "primary", type: "submit", isDisabled: !u, children: e("continueCta") })
|
|
62
63
|
] })
|
|
63
64
|
] }) }) });
|
|
64
65
|
}
|
|
65
66
|
export {
|
|
66
|
-
|
|
67
|
+
W as PolicyTypeSelectorPresentation
|
|
67
68
|
};
|
|
68
69
|
//# sourceMappingURL=PolicyTypeSelectorPresentation.js.map
|