@gusto/embedded-react-sdk 0.40.0 → 0.41.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 +51 -42
- package/dist/components/Base/Base.js +3 -2
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/Form/Form.d.ts +1 -1
- package/dist/components/Common/Form/Form.js +15 -5
- package/dist/components/Common/Form/Form.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +6 -4
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +13 -10
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +13 -10
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +8 -6
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +8 -6
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +10 -8
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +7 -6
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +3 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +8 -6
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +6 -5
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +10 -9
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +3 -2
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +8 -7
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +12 -10
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +13 -11
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -4
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +7 -5
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +10 -8
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +80 -61
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/index.d.ts +1 -1
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.d.ts +7 -6
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.js +54 -54
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +9 -7
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +9 -7
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +3 -2
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +6 -5
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +7 -5
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +7 -6
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +12 -10
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +8 -6
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +5 -4
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +4 -2
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +8 -6
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +10 -8
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +8 -6
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.d.ts +1 -1
- package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +6 -5
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +6 -5
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +4 -2
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +4 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.d.ts +6 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +31 -148
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleComponents.d.ts +10 -0
- package/dist/components/Company/PaySchedule/PayScheduleComponents.js +26 -0
- package/dist/components/Company/PaySchedule/PayScheduleComponents.js.map +1 -0
- package/dist/components/Company/PaySchedule/PayScheduleForm.d.ts +8 -0
- package/dist/components/Company/PaySchedule/PayScheduleForm.js +199 -0
- package/dist/components/Company/PaySchedule/PayScheduleForm.js.map +1 -0
- package/dist/components/Company/PaySchedule/{_parts/Edit.module.scss.js → PayScheduleForm.module.scss.js} +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleForm.module.scss.js.map +1 -0
- package/dist/components/Company/PaySchedule/PayScheduleList.d.ts +8 -0
- package/dist/components/Company/PaySchedule/PayScheduleList.js +103 -0
- package/dist/components/Company/PaySchedule/PayScheduleList.js.map +1 -0
- package/dist/components/Company/PaySchedule/{_parts/List.module.scss.js → PayScheduleList.module.scss.js} +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleList.module.scss.js.map +1 -0
- package/dist/components/Company/PaySchedule/payScheduleStateMachine.d.ts +6 -0
- package/dist/components/Company/PaySchedule/payScheduleStateMachine.js +49 -0
- package/dist/components/Company/PaySchedule/payScheduleStateMachine.js.map +1 -0
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +7 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +8 -6
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +7 -5
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +4 -2
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +7 -6
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +6 -5
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +3 -2
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +3 -2
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +6 -4
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -2
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +3 -2
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +3 -2
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +3 -2
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +3 -2
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +3 -2
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +14 -13
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +3 -2
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +3 -2
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +3 -2
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +3 -2
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +6 -5
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +23 -22
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +25 -23
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +3 -2
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +3 -2
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +3 -2
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +7 -6
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +3 -2
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +8 -6
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +11 -9
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +3 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +8 -7
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +11 -10
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +13 -11
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +3 -2
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Actions.js +8 -6
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +6 -4
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -3
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +7 -6
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Actions.js +9 -7
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +5 -4
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +7 -6
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +7 -6
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +4 -3
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/AdminProfile.js +124 -126
- package/dist/components/Employee/Profile/AdminProfile.js.map +1 -1
- package/dist/components/Employee/Profile/EmployeeProfile.js +8 -8
- package/dist/components/Employee/StateTaxes/Actions.js +10 -8
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -3
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +10 -8
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +6 -4
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +4 -3
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +3 -2
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +9 -8
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +3 -2
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -1
- package/dist/components/Employee/employee-list/management/ManagementEmployeeListView.js +3 -2
- package/dist/components/Employee/employee-list/management/ManagementEmployeeListView.js.map +1 -1
- package/dist/components/Employee/employee-list/onboarding/EmployeeListView.js +35 -34
- package/dist/components/Employee/employee-list/onboarding/EmployeeListView.js.map +1 -1
- package/dist/components/Flow/Flow.js +12 -11
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +18 -17
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +8 -7
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +3 -2
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +1 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +9 -8
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +3 -2
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +19 -18
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +12 -10
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +8 -6
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +4 -2
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +8 -7
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +3 -2
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +3 -2
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +5 -4
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +3 -2
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +13 -12
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +30 -29
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +3 -2
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +3 -2
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +3 -2
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +3 -2
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +3 -2
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +7 -6
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js +13 -12
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.js +3 -2
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js +3 -2
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js +24 -22
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +3 -2
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +12 -10
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/i18n/en/Company.PaySchedule.json.js +15 -13
- package/dist/i18n/en/Company.PaySchedule.json.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js +18 -15
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +24 -21
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js +18 -15
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SelectHookField.js +20 -17
- package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js +19 -16
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js +25 -22
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +9 -0
- package/docs/reference/endpoint-inventory.json +16 -35
- package/package.json +6 -6
- package/dist/components/Company/DocumentSigner/SignatureForm/Actions.d.ts +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/Actions.js +0 -20
- package/dist/components/Company/DocumentSigner/SignatureForm/Actions.js.map +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/Form.d.ts +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/Form.js +0 -20
- package/dist/components/Company/DocumentSigner/SignatureForm/Form.js.map +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/Head.d.ts +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/Head.js +0 -35
- package/dist/components/Company/DocumentSigner/SignatureForm/Head.js.map +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/Preview.d.ts +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/Preview.js +0 -20
- package/dist/components/Company/DocumentSigner/SignatureForm/Preview.js.map +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.d.ts +0 -9
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +0 -22
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +0 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.d.ts +0 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +0 -62
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +0 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.d.ts +0 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +0 -134
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +0 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.module.scss.js.map +0 -1
- package/dist/components/Company/PaySchedule/_parts/Head.d.ts +0 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +0 -47
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +0 -1
- package/dist/components/Company/PaySchedule/_parts/List.d.ts +0 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +0 -57
- package/dist/components/Company/PaySchedule/_parts/List.js.map +0 -1
- package/dist/components/Company/PaySchedule/_parts/List.module.scss.js.map +0 -1
- package/dist/components/Company/PaySchedule/_parts/index.d.ts +0 -5
- package/dist/components/Company/PaySchedule/usePaySchedule.d.ts +0 -39
- package/dist/components/Company/PaySchedule/usePaySchedule.js +0 -30
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState as b, useRef as
|
|
1
|
+
import { useState as b, useRef as m, useMemo as M, useCallback as y, useEffect as _ } from "react";
|
|
2
2
|
import { usePayrollsPrepareMutation as L } from "@gusto/embedded-api/react-query/payrollsPrepare";
|
|
3
3
|
import { usePaySchedulesGet as D } from "@gusto/embedded-api/react-query/paySchedulesGet";
|
|
4
4
|
import { UnprocessableEntityErrorObject as T } from "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
@@ -12,16 +12,17 @@ import "@gusto/embedded-api/models/errors/gustoembeddederror";
|
|
|
12
12
|
import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
13
13
|
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
14
14
|
import "../../shared/constants.js";
|
|
15
|
+
import "classnames";
|
|
15
16
|
import "../../contexts/ComponentAdapter/useComponentContext.js";
|
|
16
17
|
import { retryAsync as j } from "../../helpers/retryAsync.js";
|
|
17
|
-
const q = 4, v = 1500, w = (e) => e instanceof T ? e.errors.some((r) => r.category === "invalid_operation") : !1,
|
|
18
|
+
const q = 4, v = 1500, w = (e) => e instanceof T ? e.errors.some((r) => r.category === "invalid_operation") : !1, W = ({
|
|
18
19
|
companyId: e,
|
|
19
20
|
payrollId: r,
|
|
20
21
|
employeeUuids: a,
|
|
21
22
|
sortBy: n,
|
|
22
23
|
onDataReady: l
|
|
23
24
|
}) => {
|
|
24
|
-
const { mutateAsync: c, isPending: p } = L(), [o, f] = b(), t =
|
|
25
|
+
const { mutateAsync: c, isPending: p } = L(), [o, f] = b(), t = m(!1), u = m(!1), { baseSubmitHandler: d } = x(), h = M(() => a?.join(",") ?? "", [a]), { data: S, isLoading: E } = D(
|
|
25
26
|
{
|
|
26
27
|
companyId: e,
|
|
27
28
|
payScheduleId: o?.payPeriod?.payScheduleUuid || ""
|
|
@@ -29,7 +30,7 @@ const q = 4, v = 1500, w = (e) => e instanceof T ? e.errors.some((r) => r.catego
|
|
|
29
30
|
{
|
|
30
31
|
enabled: !!o?.payPeriod?.payScheduleUuid
|
|
31
32
|
}
|
|
32
|
-
), P =
|
|
33
|
+
), P = y(async () => {
|
|
33
34
|
const i = await c({
|
|
34
35
|
request: {
|
|
35
36
|
companyId: e,
|
|
@@ -41,7 +42,7 @@ const q = 4, v = 1500, w = (e) => e instanceof T ? e.errors.some((r) => r.catego
|
|
|
41
42
|
}
|
|
42
43
|
});
|
|
43
44
|
f(i.payrollPrepared), i.payrollPrepared && (t.current = !0, l?.(i.payrollPrepared));
|
|
44
|
-
}, [e, r, c, h, n, l]), s =
|
|
45
|
+
}, [e, r, c, h, n, l]), s = y(async () => {
|
|
45
46
|
await d(
|
|
46
47
|
null,
|
|
47
48
|
() => j(P, {
|
|
@@ -65,6 +66,6 @@ const q = 4, v = 1500, w = (e) => e instanceof T ? e.errors.some((r) => r.catego
|
|
|
65
66
|
};
|
|
66
67
|
};
|
|
67
68
|
export {
|
|
68
|
-
|
|
69
|
+
W as usePreparedPayrollData
|
|
69
70
|
};
|
|
70
71
|
//# sourceMappingURL=usePreparedPayrollData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePreparedPayrollData.js","sources":["../../../src/components/Payroll/usePreparedPayrollData.ts"],"sourcesContent":["import { useState, useEffect, useCallback, useRef, useMemo } from 'react'\nimport { usePayrollsPrepareMutation } from '@gusto/embedded-api/react-query/payrollsPrepare'\nimport { usePaySchedulesGet } from '@gusto/embedded-api/react-query/paySchedulesGet'\nimport type { PayrollPrepared } from '@gusto/embedded-api/models/components/payroll'\nimport type { PaySchedule } from '@gusto/embedded-api/models/components/payschedule'\nimport type { QueryParamSortBy } from '@gusto/embedded-api/models/operations/putv1companiescompanyidpayrollspayrollidprepare'\nimport { UnprocessableEntityErrorObject } from '@gusto/embedded-api/models/errors/unprocessableentityerrorobject'\nimport { useBase } from '../Base'\nimport { retryAsync } from '@/helpers/retryAsync'\n\ninterface UsePreparedPayrollDataParams {\n companyId: string\n payrollId: string\n employeeUuids?: string[]\n sortBy?: QueryParamSortBy\n onDataReady?: (preparedPayroll: PayrollPrepared) => void\n}\n\ninterface UsePreparedPayrollDataReturn {\n handlePreparePayroll: () => Promise<void>\n preparedPayroll: PayrollPrepared | undefined\n paySchedule: PaySchedule | undefined\n isLoading: boolean\n isPaginating: boolean\n hasInitialData: boolean\n}\n\nconst PREPARE_MAX_ATTEMPTS = 4\nconst PREPARE_RETRY_DELAY_MS = 1500\n\nconst isPayrollBeingProcessedError = (error: unknown): boolean => {\n if (!(error instanceof UnprocessableEntityErrorObject)) return false\n return error.errors.some(e => e.category === 'invalid_operation')\n}\n\nexport const usePreparedPayrollData = ({\n companyId,\n payrollId,\n employeeUuids,\n sortBy,\n onDataReady,\n}: UsePreparedPayrollDataParams): UsePreparedPayrollDataReturn => {\n const { mutateAsync: preparePayroll, isPending: isPreparePayrollPending } =\n usePayrollsPrepareMutation()\n const [preparedPayroll, setPreparedPayroll] = useState<PayrollPrepared | undefined>()\n const hasInitialDataRef = useRef(false)\n const hasFiredRef = useRef(false)\n const { baseSubmitHandler } = useBase()\n\n const employeeUuidsKey = useMemo(() => employeeUuids?.join(',') ?? '', [employeeUuids])\n\n const { data: payScheduleData, isLoading: isPayScheduleLoading } = usePaySchedulesGet(\n {\n companyId,\n payScheduleId: preparedPayroll?.payPeriod?.payScheduleUuid || '',\n },\n {\n enabled: !!preparedPayroll?.payPeriod?.payScheduleUuid,\n },\n )\n\n const executePrepare = useCallback(async () => {\n const result = await preparePayroll({\n request: {\n companyId,\n payrollId,\n sortBy,\n requestBody: {\n employeeUuids,\n },\n },\n })\n setPreparedPayroll(result.payrollPrepared)\n if (result.payrollPrepared) {\n hasInitialDataRef.current = true\n onDataReady?.(result.payrollPrepared)\n }\n }, [companyId, payrollId, preparePayroll, employeeUuidsKey, sortBy, onDataReady])\n\n const handlePreparePayroll = useCallback(async () => {\n await baseSubmitHandler(null, () =>\n retryAsync(executePrepare, {\n maxAttempts: PREPARE_MAX_ATTEMPTS,\n delayMs: PREPARE_RETRY_DELAY_MS,\n shouldRetry: isPayrollBeingProcessedError,\n }),\n )\n }, [baseSubmitHandler, executePrepare])\n\n useEffect(() => {\n if (hasFiredRef.current) return\n hasFiredRef.current = true\n void handlePreparePayroll()\n }, [handlePreparePayroll])\n\n const isInitialLoading = isPreparePayrollPending && !hasInitialDataRef.current\n const isPaginating = isPreparePayrollPending && hasInitialDataRef.current\n const isLoading = isInitialLoading || isPayScheduleLoading\n\n return {\n handlePreparePayroll,\n preparedPayroll,\n paySchedule: payScheduleData?.paySchedule,\n isLoading,\n isPaginating,\n hasInitialData: hasInitialDataRef.current,\n }\n}\n"],"names":["PREPARE_MAX_ATTEMPTS","PREPARE_RETRY_DELAY_MS","isPayrollBeingProcessedError","error","UnprocessableEntityErrorObject","e","usePreparedPayrollData","companyId","payrollId","employeeUuids","sortBy","onDataReady","preparePayroll","isPreparePayrollPending","usePayrollsPrepareMutation","preparedPayroll","setPreparedPayroll","useState","hasInitialDataRef","useRef","hasFiredRef","baseSubmitHandler","useBase","employeeUuidsKey","useMemo","payScheduleData","isPayScheduleLoading","usePaySchedulesGet","executePrepare","useCallback","result","handlePreparePayroll","retryAsync","useEffect","isInitialLoading","isPaginating","isLoading"],"mappings":"
|
|
1
|
+
{"version":3,"file":"usePreparedPayrollData.js","sources":["../../../src/components/Payroll/usePreparedPayrollData.ts"],"sourcesContent":["import { useState, useEffect, useCallback, useRef, useMemo } from 'react'\nimport { usePayrollsPrepareMutation } from '@gusto/embedded-api/react-query/payrollsPrepare'\nimport { usePaySchedulesGet } from '@gusto/embedded-api/react-query/paySchedulesGet'\nimport type { PayrollPrepared } from '@gusto/embedded-api/models/components/payroll'\nimport type { PaySchedule } from '@gusto/embedded-api/models/components/payschedule'\nimport type { QueryParamSortBy } from '@gusto/embedded-api/models/operations/putv1companiescompanyidpayrollspayrollidprepare'\nimport { UnprocessableEntityErrorObject } from '@gusto/embedded-api/models/errors/unprocessableentityerrorobject'\nimport { useBase } from '../Base'\nimport { retryAsync } from '@/helpers/retryAsync'\n\ninterface UsePreparedPayrollDataParams {\n companyId: string\n payrollId: string\n employeeUuids?: string[]\n sortBy?: QueryParamSortBy\n onDataReady?: (preparedPayroll: PayrollPrepared) => void\n}\n\ninterface UsePreparedPayrollDataReturn {\n handlePreparePayroll: () => Promise<void>\n preparedPayroll: PayrollPrepared | undefined\n paySchedule: PaySchedule | undefined\n isLoading: boolean\n isPaginating: boolean\n hasInitialData: boolean\n}\n\nconst PREPARE_MAX_ATTEMPTS = 4\nconst PREPARE_RETRY_DELAY_MS = 1500\n\nconst isPayrollBeingProcessedError = (error: unknown): boolean => {\n if (!(error instanceof UnprocessableEntityErrorObject)) return false\n return error.errors.some(e => e.category === 'invalid_operation')\n}\n\nexport const usePreparedPayrollData = ({\n companyId,\n payrollId,\n employeeUuids,\n sortBy,\n onDataReady,\n}: UsePreparedPayrollDataParams): UsePreparedPayrollDataReturn => {\n const { mutateAsync: preparePayroll, isPending: isPreparePayrollPending } =\n usePayrollsPrepareMutation()\n const [preparedPayroll, setPreparedPayroll] = useState<PayrollPrepared | undefined>()\n const hasInitialDataRef = useRef(false)\n const hasFiredRef = useRef(false)\n const { baseSubmitHandler } = useBase()\n\n const employeeUuidsKey = useMemo(() => employeeUuids?.join(',') ?? '', [employeeUuids])\n\n const { data: payScheduleData, isLoading: isPayScheduleLoading } = usePaySchedulesGet(\n {\n companyId,\n payScheduleId: preparedPayroll?.payPeriod?.payScheduleUuid || '',\n },\n {\n enabled: !!preparedPayroll?.payPeriod?.payScheduleUuid,\n },\n )\n\n const executePrepare = useCallback(async () => {\n const result = await preparePayroll({\n request: {\n companyId,\n payrollId,\n sortBy,\n requestBody: {\n employeeUuids,\n },\n },\n })\n setPreparedPayroll(result.payrollPrepared)\n if (result.payrollPrepared) {\n hasInitialDataRef.current = true\n onDataReady?.(result.payrollPrepared)\n }\n }, [companyId, payrollId, preparePayroll, employeeUuidsKey, sortBy, onDataReady])\n\n const handlePreparePayroll = useCallback(async () => {\n await baseSubmitHandler(null, () =>\n retryAsync(executePrepare, {\n maxAttempts: PREPARE_MAX_ATTEMPTS,\n delayMs: PREPARE_RETRY_DELAY_MS,\n shouldRetry: isPayrollBeingProcessedError,\n }),\n )\n }, [baseSubmitHandler, executePrepare])\n\n useEffect(() => {\n if (hasFiredRef.current) return\n hasFiredRef.current = true\n void handlePreparePayroll()\n }, [handlePreparePayroll])\n\n const isInitialLoading = isPreparePayrollPending && !hasInitialDataRef.current\n const isPaginating = isPreparePayrollPending && hasInitialDataRef.current\n const isLoading = isInitialLoading || isPayScheduleLoading\n\n return {\n handlePreparePayroll,\n preparedPayroll,\n paySchedule: payScheduleData?.paySchedule,\n isLoading,\n isPaginating,\n hasInitialData: hasInitialDataRef.current,\n }\n}\n"],"names":["PREPARE_MAX_ATTEMPTS","PREPARE_RETRY_DELAY_MS","isPayrollBeingProcessedError","error","UnprocessableEntityErrorObject","e","usePreparedPayrollData","companyId","payrollId","employeeUuids","sortBy","onDataReady","preparePayroll","isPreparePayrollPending","usePayrollsPrepareMutation","preparedPayroll","setPreparedPayroll","useState","hasInitialDataRef","useRef","hasFiredRef","baseSubmitHandler","useBase","employeeUuidsKey","useMemo","payScheduleData","isPayScheduleLoading","usePaySchedulesGet","executePrepare","useCallback","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Y;AACnD,UAAMR;AAAA,MAAkB;AAAA,MAAM,MAC5BW,EAAWJ,GAAgB;AAAA,QACzB,aAAa5B;AAAA,QACb,SAASC;AAAA,QACT,aAAaC;AAAA,MAAA,CACd;AAAA,IAAA;AAAA,EAEL,GAAG,CAACmB,GAAmBO,CAAc,CAAC;AAEtC,EAAAK,EAAU,MAAM;AACd,IAAIb,EAAY,YAChBA,EAAY,UAAU,IACjBW,EAAA;AAAA,EACP,GAAG,CAACA,CAAoB,CAAC;AAEzB,QAAMG,IAAmBrB,KAA2B,CAACK,EAAkB,SACjEiB,IAAetB,KAA2BK,EAAkB,SAC5DkB,IAAYF,KAAoBR;AAEtC,SAAO;AAAA,IACL,sBAAAK;AAAA,IACA,iBAAAhB;AAAA,IACA,aAAaU,GAAiB;AAAA,IAC9B,WAAAW;AAAA,IACA,cAAAD;AAAA,IACA,gBAAgBjB,EAAkB;AAAA,EAAA;AAEtC;"}
|
package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { useTranslation as
|
|
1
|
+
import { jsx as t, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as f } from "react";
|
|
3
|
+
import { useTranslation as h } from "react-i18next";
|
|
4
4
|
import { Flex as c } from "../../Common/Flex/Flex.js";
|
|
5
|
+
import "classnames";
|
|
5
6
|
import { ActionsLayout as y } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
6
7
|
import { useComponentContext as b } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
7
8
|
import { useI18n as v } from "../../../i18n/I18n.js";
|
|
8
9
|
import { useDataView as x } from "../../Common/DataView/useDataView.js";
|
|
9
10
|
import { DataView as C } from "../../Common/DataView/DataView.js";
|
|
10
|
-
function
|
|
11
|
+
function I(o) {
|
|
11
12
|
v("Company.TimeOff.HolidayPolicy");
|
|
12
|
-
const { t: e } =
|
|
13
|
+
const { t: e } = h("Company.TimeOff.HolidayPolicy"), { Heading: s, Text: n, Button: l } = b(), { holidays: d } = o, r = o.mode === "view", m = f(
|
|
13
14
|
() => [
|
|
14
15
|
{
|
|
15
16
|
key: "name",
|
|
@@ -28,28 +29,28 @@ function V(o) {
|
|
|
28
29
|
}
|
|
29
30
|
],
|
|
30
31
|
[e, n]
|
|
31
|
-
), u =
|
|
32
|
+
), u = r ? {} : {
|
|
32
33
|
selectionMode: "multiple",
|
|
33
34
|
onSelect: o.onSelectionChange,
|
|
34
35
|
getIsItemSelected: (i) => o.selectedHolidayUuids.has(i.uuid)
|
|
35
|
-
},
|
|
36
|
+
}, p = x({
|
|
36
37
|
data: d,
|
|
37
38
|
columns: m,
|
|
38
39
|
...u
|
|
39
40
|
});
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
!
|
|
41
|
+
return /* @__PURE__ */ a(c, { flexDirection: "column", gap: 32, children: [
|
|
42
|
+
!r && /* @__PURE__ */ a(c, { flexDirection: "column", gap: 4, children: [
|
|
42
43
|
/* @__PURE__ */ t(s, { as: "h2", children: e("title") }),
|
|
43
44
|
/* @__PURE__ */ t(n, { variant: "supporting", children: e("description") })
|
|
44
45
|
] }),
|
|
45
|
-
/* @__PURE__ */ t(C, { label: e("tableLabel"), ...
|
|
46
|
-
!
|
|
46
|
+
/* @__PURE__ */ t(C, { label: e("tableLabel"), ...p }),
|
|
47
|
+
!r && /* @__PURE__ */ a(y, { children: [
|
|
47
48
|
/* @__PURE__ */ t(l, { variant: "secondary", onClick: o.onBack, children: e("backCta") }),
|
|
48
49
|
/* @__PURE__ */ t(l, { variant: "primary", onClick: o.onContinue, children: e("continueCta") })
|
|
49
50
|
] })
|
|
50
51
|
] });
|
|
51
52
|
}
|
|
52
53
|
export {
|
|
53
|
-
|
|
54
|
+
I as HolidaySelectionFormPresentation
|
|
54
55
|
};
|
|
55
56
|
//# sourceMappingURL=HolidaySelectionFormPresentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HolidaySelectionFormPresentation.js","sources":["../../../../src/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type {\n HolidayItem,\n HolidaySelectionFormPresentationProps,\n} from './HolidaySelectionFormTypes'\nimport { DataView, Flex, ActionsLayout, useDataView } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nexport function HolidaySelectionFormPresentation(props: HolidaySelectionFormPresentationProps) {\n useI18n('Company.TimeOff.HolidayPolicy')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n const { Heading, Text, Button } = useComponentContext()\n\n const { holidays } = props\n const isViewMode = props.mode === 'view'\n\n const columns = useMemo(\n () => [\n {\n key: 'name' as keyof HolidayItem,\n title: t('tableHeaders.holidayName'),\n render: (item: HolidayItem) => <Text weight=\"medium\">{item.name}</Text>,\n },\n {\n key: 'observedDate' as keyof HolidayItem,\n title: t('tableHeaders.observedDate'),\n render: (item: HolidayItem) => <Text variant=\"supporting\">{item.observedDate}</Text>,\n },\n {\n key: 'nextObservation' as keyof HolidayItem,\n title: t('tableHeaders.nextObservation'),\n render: (item: HolidayItem) => <Text variant=\"supporting\">{item.nextObservation}</Text>,\n },\n ],\n [t, Text],\n )\n\n const selectionProps = !isViewMode\n ? {\n selectionMode: 'multiple' as const,\n onSelect: props.onSelectionChange,\n getIsItemSelected: (item: HolidayItem) => props.selectedHolidayUuids.has(item.uuid),\n }\n : {}\n\n const dataViewProps = useDataView<HolidayItem>({\n data: holidays,\n columns,\n ...selectionProps,\n })\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n {!isViewMode && (\n <Flex flexDirection=\"column\" gap={4}>\n <Heading as=\"h2\">{t('title')}</Heading>\n <Text variant=\"supporting\">{t('description')}</Text>\n </Flex>\n )}\n\n <DataView label={t('tableLabel')} {...dataViewProps} />\n\n {!isViewMode && (\n <ActionsLayout>\n <Button variant=\"secondary\" onClick={props.onBack}>\n {t('backCta')}\n </Button>\n <Button variant=\"primary\" onClick={props.onContinue}>\n {t('continueCta')}\n </Button>\n </ActionsLayout>\n )}\n </Flex>\n )\n}\n"],"names":["HolidaySelectionFormPresentation","props","useI18n","t","useTranslation","Heading","Text","Button","useComponentContext","holidays","isViewMode","columns","useMemo","item","jsx","selectionProps","dataViewProps","useDataView","jsxs","Flex","DataView","ActionsLayout"],"mappings":"
|
|
1
|
+
{"version":3,"file":"HolidaySelectionFormPresentation.js","sources":["../../../../src/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type {\n HolidayItem,\n HolidaySelectionFormPresentationProps,\n} from './HolidaySelectionFormTypes'\nimport { DataView, Flex, ActionsLayout, useDataView } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nexport function HolidaySelectionFormPresentation(props: HolidaySelectionFormPresentationProps) {\n useI18n('Company.TimeOff.HolidayPolicy')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n const { Heading, Text, Button } = useComponentContext()\n\n const { holidays } = props\n const isViewMode = props.mode === 'view'\n\n const columns = useMemo(\n () => [\n {\n key: 'name' as keyof HolidayItem,\n title: t('tableHeaders.holidayName'),\n render: (item: HolidayItem) => <Text weight=\"medium\">{item.name}</Text>,\n },\n {\n key: 'observedDate' as keyof HolidayItem,\n title: t('tableHeaders.observedDate'),\n render: (item: HolidayItem) => <Text variant=\"supporting\">{item.observedDate}</Text>,\n },\n {\n key: 'nextObservation' as keyof HolidayItem,\n title: t('tableHeaders.nextObservation'),\n render: (item: HolidayItem) => <Text variant=\"supporting\">{item.nextObservation}</Text>,\n },\n ],\n [t, Text],\n )\n\n const selectionProps = !isViewMode\n ? {\n selectionMode: 'multiple' as const,\n onSelect: props.onSelectionChange,\n getIsItemSelected: (item: HolidayItem) => props.selectedHolidayUuids.has(item.uuid),\n }\n : {}\n\n const dataViewProps = useDataView<HolidayItem>({\n data: holidays,\n columns,\n ...selectionProps,\n })\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n {!isViewMode && (\n <Flex flexDirection=\"column\" gap={4}>\n <Heading as=\"h2\">{t('title')}</Heading>\n <Text variant=\"supporting\">{t('description')}</Text>\n </Flex>\n )}\n\n <DataView label={t('tableLabel')} {...dataViewProps} />\n\n {!isViewMode && (\n <ActionsLayout>\n <Button variant=\"secondary\" onClick={props.onBack}>\n {t('backCta')}\n </Button>\n <Button variant=\"primary\" onClick={props.onContinue}>\n {t('continueCta')}\n </Button>\n </ActionsLayout>\n )}\n </Flex>\n )\n}\n"],"names":["HolidaySelectionFormPresentation","props","useI18n","t","useTranslation","Heading","Text","Button","useComponentContext","holidays","isViewMode","columns","useMemo","item","jsx","selectionProps","dataViewProps","useDataView","jsxs","Flex","DataView","ActionsLayout"],"mappings":";;;;;;;;;;AAUO,SAASA,EAAiCC,GAA8C;AAC7F,EAAAC,EAAQ,+BAA+B;AACvC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,+BAA+B,GACtD,EAAE,SAAAC,GAAS,MAAAC,GAAM,QAAAC,EAAA,IAAWC,EAAA,GAE5B,EAAE,UAAAC,MAAaR,GACfS,IAAaT,EAAM,SAAS,QAE5BU,IAAUC;AAAA,IACd,MAAM;AAAA,MACJ;AAAA,QACE,KAAK;AAAA,QACL,OAAOT,EAAE,0BAA0B;AAAA,QACnC,QAAQ,CAACU,MAAsB,gBAAAC,EAACR,KAAK,QAAO,UAAU,YAAK,KAAA,CAAK;AAAA,MAAA;AAAA,MAElE;AAAA,QACE,KAAK;AAAA,QACL,OAAOH,EAAE,2BAA2B;AAAA,QACpC,QAAQ,CAACU,MAAsB,gBAAAC,EAACR,KAAK,SAAQ,c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|
|
|
3
3
|
import { useTranslation as k } from "react-i18next";
|
|
4
4
|
import v from "./PolicyListPresentation.module.scss.js";
|
|
5
5
|
import { Flex as p } from "../../Common/Flex/Flex.js";
|
|
6
|
+
import "classnames";
|
|
6
7
|
import { EmptyData as w } from "../../Common/EmptyData/EmptyData.js";
|
|
7
8
|
import { ActionsLayout as S } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
8
9
|
import { useComponentContext as A } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
@@ -10,7 +11,7 @@ import { useI18n as j } from "../../../i18n/I18n.js";
|
|
|
10
11
|
import { HamburgerMenu as V } from "../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
11
12
|
import { useDataView as I } from "../../Common/DataView/useDataView.js";
|
|
12
13
|
import { DataView as M } from "../../Common/DataView/DataView.js";
|
|
13
|
-
function
|
|
14
|
+
function X({
|
|
14
15
|
policies: a,
|
|
15
16
|
onCreatePolicy: r,
|
|
16
17
|
onEditPolicy: y,
|
|
@@ -119,6 +120,6 @@ function W({
|
|
|
119
120
|
] });
|
|
120
121
|
}
|
|
121
122
|
export {
|
|
122
|
-
|
|
123
|
+
X as PolicyListPresentation
|
|
123
124
|
};
|
|
124
125
|
//# sourceMappingURL=PolicyListPresentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolicyListPresentation.js","sources":["../../../../src/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { PolicyListPresentationProps, PolicyListItem } from './PolicyListTypes'\nimport styles from './PolicyListPresentation.module.scss'\nimport {\n DataView,\n Flex,\n EmptyData,\n ActionsLayout,\n HamburgerMenu,\n useDataView,\n} from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nexport function PolicyListPresentation({\n policies,\n onCreatePolicy,\n onEditPolicy,\n onFinishSetup,\n onDeletePolicy,\n deleteSuccessAlert,\n onDismissDeleteAlert,\n isDeletingPolicyId,\n isPending,\n}: PolicyListPresentationProps) {\n const { Button, Heading, Text, Alert, Dialog } = useComponentContext()\n useI18n('Company.TimeOff.TimeOffPolicies')\n const { t } = useTranslation('Company.TimeOff.TimeOffPolicies')\n\n const [deletePolicyDialogState, setDeletePolicyDialogState] = useState<{\n isOpen: boolean\n policy: PolicyListItem | null\n }>({\n isOpen: false,\n policy: null,\n })\n\n const handleOpenDeleteDialog = (policy: PolicyListItem) => {\n setDeletePolicyDialogState({ isOpen: true, policy })\n }\n\n const handleCloseDeleteDialog = () => {\n setDeletePolicyDialogState({ isOpen: false, policy: null })\n }\n\n const handleConfirmDelete = () => {\n if (deletePolicyDialogState.policy) {\n onDeletePolicy(deletePolicyDialogState.policy)\n handleCloseDeleteDialog()\n }\n }\n\n const { ...dataViewProps } = useDataView({\n data: policies,\n columns: [\n {\n title: t('tableHeaders.name'),\n render: (policy: PolicyListItem) => <Text weight=\"medium\">{policy.name}</Text>,\n },\n {\n title: t('tableHeaders.enrolled'),\n render: (policy: PolicyListItem) => (\n <Text variant=\"supporting\">{policy.enrolledDisplay}</Text>\n ),\n },\n ],\n itemMenu: (policy: PolicyListItem) => {\n const isDeleting = isDeletingPolicyId === policy.uuid\n\n return (\n <div className={styles.actionsCell}>\n {!policy.isComplete && (\n <Button\n variant=\"secondary\"\n onClick={() => {\n onFinishSetup(policy)\n }}\n >\n {t('finishSetupCta')}\n </Button>\n )}\n <HamburgerMenu\n isLoading={isDeleting}\n menuLabel={t('tableLabel')}\n items={[\n {\n label: t('actions.editPolicy'),\n onClick: () => {\n onEditPolicy(policy)\n },\n },\n {\n label: t('actions.deletePolicy'),\n onClick: () => {\n handleOpenDeleteDialog(policy)\n },\n },\n ]}\n />\n </div>\n )\n },\n emptyState: () => (\n <EmptyData title={t('emptyState.heading')} description={t('emptyState.body')}>\n <ActionsLayout justifyContent=\"center\">\n <Button variant=\"secondary\" onClick={onCreatePolicy}>\n {t('createPolicyCta')}\n </Button>\n </ActionsLayout>\n </EmptyData>\n ),\n })\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {deleteSuccessAlert && (\n <Alert status=\"success\" label={deleteSuccessAlert} onDismiss={onDismissDeleteAlert} />\n )}\n\n <Flex\n flexDirection={{ base: 'column', medium: 'row' }}\n justifyContent=\"space-between\"\n alignItems=\"flex-start\"\n gap={{ base: 12, medium: 24 }}\n >\n <Heading as=\"h2\">{t('pageTitle')}</Heading>\n {policies.length > 0 && (\n <Button variant=\"primary\" onClick={onCreatePolicy}>\n {t('createPolicyCta')}\n </Button>\n )}\n </Flex>\n\n <DataView label={t('tableLabel')} {...dataViewProps} />\n\n <Dialog\n isOpen={deletePolicyDialogState.isOpen}\n onClose={handleCloseDeleteDialog}\n onPrimaryActionClick={handleConfirmDelete}\n isPrimaryActionLoading={isPending}\n isDestructive\n title={\n deletePolicyDialogState.policy?.isHoliday\n ? t('deleteHolidayDialog.title')\n : t('deletePolicyDialog.title', {\n name: deletePolicyDialogState.policy?.name ?? '',\n })\n }\n primaryActionLabel={t('deletePolicyDialog.confirmCta')}\n closeActionLabel={t('deletePolicyDialog.cancelCta')}\n >\n {deletePolicyDialogState.policy?.isHoliday\n ? t('deleteHolidayDialog.description')\n : t('deletePolicyDialog.description', {\n name: deletePolicyDialogState.policy?.name ?? '',\n })}\n </Dialog>\n </Flex>\n )\n}\n"],"names":["PolicyListPresentation","policies","onCreatePolicy","onEditPolicy","onFinishSetup","onDeletePolicy","deleteSuccessAlert","onDismissDeleteAlert","isDeletingPolicyId","isPending","Button","Heading","Text","Alert","Dialog","useComponentContext","useI18n","t","useTranslation","deletePolicyDialogState","setDeletePolicyDialogState","useState","handleOpenDeleteDialog","policy","handleCloseDeleteDialog","handleConfirmDelete","dataViewProps","useDataView","jsx","isDeleting","jsxs","styles","HamburgerMenu","EmptyData","ActionsLayout","Flex","DataView"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PolicyListPresentation.js","sources":["../../../../src/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { PolicyListPresentationProps, PolicyListItem } from './PolicyListTypes'\nimport styles from './PolicyListPresentation.module.scss'\nimport {\n DataView,\n Flex,\n EmptyData,\n ActionsLayout,\n HamburgerMenu,\n useDataView,\n} from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nexport function PolicyListPresentation({\n policies,\n onCreatePolicy,\n onEditPolicy,\n onFinishSetup,\n onDeletePolicy,\n deleteSuccessAlert,\n onDismissDeleteAlert,\n isDeletingPolicyId,\n isPending,\n}: PolicyListPresentationProps) {\n const { Button, Heading, Text, Alert, Dialog } = useComponentContext()\n useI18n('Company.TimeOff.TimeOffPolicies')\n const { t } = useTranslation('Company.TimeOff.TimeOffPolicies')\n\n const [deletePolicyDialogState, setDeletePolicyDialogState] = useState<{\n isOpen: boolean\n policy: PolicyListItem | null\n }>({\n isOpen: false,\n policy: null,\n })\n\n const handleOpenDeleteDialog = (policy: PolicyListItem) => {\n setDeletePolicyDialogState({ isOpen: true, policy })\n }\n\n const handleCloseDeleteDialog = () => {\n setDeletePolicyDialogState({ isOpen: false, policy: null })\n }\n\n const handleConfirmDelete = () => {\n if (deletePolicyDialogState.policy) {\n onDeletePolicy(deletePolicyDialogState.policy)\n handleCloseDeleteDialog()\n }\n }\n\n const { ...dataViewProps } = useDataView({\n data: policies,\n columns: [\n {\n title: t('tableHeaders.name'),\n render: (policy: PolicyListItem) => <Text weight=\"medium\">{policy.name}</Text>,\n },\n {\n title: t('tableHeaders.enrolled'),\n render: (policy: PolicyListItem) => (\n <Text variant=\"supporting\">{policy.enrolledDisplay}</Text>\n ),\n },\n ],\n itemMenu: (policy: PolicyListItem) => {\n const isDeleting = isDeletingPolicyId === policy.uuid\n\n return (\n <div className={styles.actionsCell}>\n {!policy.isComplete && (\n <Button\n variant=\"secondary\"\n onClick={() => {\n onFinishSetup(policy)\n }}\n >\n {t('finishSetupCta')}\n </Button>\n )}\n <HamburgerMenu\n isLoading={isDeleting}\n menuLabel={t('tableLabel')}\n items={[\n {\n label: t('actions.editPolicy'),\n onClick: () => {\n onEditPolicy(policy)\n },\n },\n {\n label: t('actions.deletePolicy'),\n onClick: () => {\n handleOpenDeleteDialog(policy)\n },\n },\n ]}\n />\n </div>\n )\n },\n emptyState: () => (\n <EmptyData title={t('emptyState.heading')} description={t('emptyState.body')}>\n <ActionsLayout justifyContent=\"center\">\n <Button variant=\"secondary\" onClick={onCreatePolicy}>\n {t('createPolicyCta')}\n </Button>\n </ActionsLayout>\n </EmptyData>\n ),\n })\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {deleteSuccessAlert && (\n <Alert status=\"success\" label={deleteSuccessAlert} onDismiss={onDismissDeleteAlert} />\n )}\n\n <Flex\n flexDirection={{ base: 'column', medium: 'row' }}\n justifyContent=\"space-between\"\n alignItems=\"flex-start\"\n gap={{ base: 12, medium: 24 }}\n >\n <Heading as=\"h2\">{t('pageTitle')}</Heading>\n {policies.length > 0 && (\n <Button variant=\"primary\" onClick={onCreatePolicy}>\n {t('createPolicyCta')}\n </Button>\n )}\n </Flex>\n\n <DataView label={t('tableLabel')} {...dataViewProps} />\n\n <Dialog\n isOpen={deletePolicyDialogState.isOpen}\n onClose={handleCloseDeleteDialog}\n onPrimaryActionClick={handleConfirmDelete}\n isPrimaryActionLoading={isPending}\n isDestructive\n title={\n deletePolicyDialogState.policy?.isHoliday\n ? t('deleteHolidayDialog.title')\n : t('deletePolicyDialog.title', {\n name: deletePolicyDialogState.policy?.name ?? '',\n })\n }\n primaryActionLabel={t('deletePolicyDialog.confirmCta')}\n closeActionLabel={t('deletePolicyDialog.cancelCta')}\n >\n {deletePolicyDialogState.policy?.isHoliday\n ? t('deleteHolidayDialog.description')\n : t('deletePolicyDialog.description', {\n name: deletePolicyDialogState.policy?.name ?? '',\n })}\n </Dialog>\n </Flex>\n )\n}\n"],"names":["PolicyListPresentation","policies","onCreatePolicy","onEditPolicy","onFinishSetup","onDeletePolicy","deleteSuccessAlert","onDismissDeleteAlert","isDeletingPolicyId","isPending","Button","Heading","Text","Alert","Dialog","useComponentContext","useI18n","t","useTranslation","deletePolicyDialogState","setDeletePolicyDialogState","useState","handleOpenDeleteDialog","policy","handleCloseDeleteDialog","handleConfirmDelete","dataViewProps","useDataView","jsx","isDeleting","jsxs","styles","HamburgerMenu","EmptyData","ActionsLayout","Flex","DataView"],"mappings":";;;;;;;;;;;;;AAeO,SAASA,EAAuB;AAAA,EACrC,UAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,eAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,WAAAC;AACF,GAAgC;AAC9B,QAAM,EAAE,QAAAC,GAAQ,SAAAC,GAAS,MAAAC,GAAM,OAAAC,GAAO,QAAAC,EAAA,IAAWC,EAAA;AACjD,EAAAC,EAAQ,iCAAiC;AACzC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,iCAAiC,GAExD,CAACC,GAAyBC,CAA0B,IAAIC,EAG3D;AAAA,IACD,QAAQ;AAAA,IACR,QAAQ;AAAA,EAAA,CACT,GAEKC,IAAyB,CAACC,MAA2B;AACzD,IAAAH,EAA2B,EAAE,QAAQ,IAAM,QAAAG,EAAA,CAAQ;AAAA,EACrD,GAEMC,IAA0B,MAAM;AACpC,IAAAJ,EAA2B,EAAE,QAAQ,IAAO,QAAQ,MAAM;AAAA,EAC5D,GAEMK,IAAsB,MAAM;AAChC,IAAIN,EAAwB,WAC1Bd,EAAec,EAAwB,MAAM,GAC7CK,EAAA;AAAA,EAEJ,GAEM,EAAE,GAAGE,EAAA,IAAkBC,EAAY;AAAA,IACvC,MAAM1B;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,O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P,GACF;AAEJ;"}
|
package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js
CHANGED
|
@@ -3,12 +3,13 @@ import { useMemo as u } from "react";
|
|
|
3
3
|
import { useForm as f, FormProvider as h } from "react-hook-form";
|
|
4
4
|
import { useTranslation as T } from "react-i18next";
|
|
5
5
|
import { Flex as r } from "../../Common/Flex/Flex.js";
|
|
6
|
+
import "classnames";
|
|
6
7
|
import { ActionsLayout as b } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
7
8
|
import { Form as v } from "../../Common/Form/Form.js";
|
|
8
9
|
import { useComponentContext as x } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
10
|
import { useI18n as C } from "../../../i18n/I18n.js";
|
|
10
11
|
import { RadioGroupField as L } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
11
|
-
function
|
|
12
|
+
function q({
|
|
12
13
|
onContinue: l,
|
|
13
14
|
onCancel: a,
|
|
14
15
|
defaultPolicyType: c
|
|
@@ -61,6 +62,6 @@ function R({
|
|
|
61
62
|
] }) }) });
|
|
62
63
|
}
|
|
63
64
|
export {
|
|
64
|
-
|
|
65
|
+
q as PolicyTypeSelectorPresentation
|
|
65
66
|
};
|
|
66
67
|
//# sourceMappingURL=PolicyTypeSelectorPresentation.js.map
|
package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolicyTypeSelectorPresentation.js","sources":["../../../../src/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type { PolicyType, PolicyTypeSelectorPresentationProps } from './PolicyTypeSelectorTypes'\nimport { Flex, ActionsLayout, RadioGroupField } from '@/components/Common'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\ninterface PolicyTypeSelectorFormData {\n policyType: PolicyType\n}\n\nexport function PolicyTypeSelectorPresentation({\n onContinue,\n onCancel,\n defaultPolicyType,\n}: PolicyTypeSelectorPresentationProps) {\n useI18n('Company.TimeOff.SelectPolicyType')\n const { t } = useTranslation('Company.TimeOff.SelectPolicyType')\n const { Heading, Text, Button } = useComponentContext()\n\n const formMethods = useForm<PolicyTypeSelectorFormData>({\n defaultValues: {\n policyType: defaultPolicyType as PolicyType,\n },\n })\n\n const policyTypeOptions = useMemo(\n () => [\n {\n value: 'holiday' as PolicyType,\n label: t('holidayLabel'),\n description: t('holidayHint'),\n },\n {\n value: 'vacation' as PolicyType,\n label: t('timeOffLabel'),\n description: t('timeOffHint'),\n },\n {\n value: 'sick' as PolicyType,\n label: t('sickLeaveLabel'),\n description: t('sickLeaveHint'),\n },\n ],\n [t],\n )\n\n const handleSubmit = (data: PolicyTypeSelectorFormData) => {\n onContinue(data.policyType)\n }\n\n return (\n <FormProvider {...formMethods}>\n <HtmlForm onSubmit={formMethods.handleSubmit(handleSubmit)}>\n <Flex flexDirection=\"column\" gap={24}>\n <Flex flexDirection=\"column\" gap={4}>\n <Heading as=\"h2\">{t('title')}</Heading>\n <Text variant=\"supporting\">{t('policyTypeHint')}</Text>\n </Flex>\n\n <RadioGroupField<PolicyType>\n name=\"policyType\"\n label={t('policyTypeLabel')}\n options={policyTypeOptions}\n isRequired\n />\n\n <ActionsLayout>\n <Button variant=\"secondary\" onClick={onCancel}>\n {t('cancelCta')}\n </Button>\n <Button variant=\"primary\" type=\"submit\">\n {t('continueCta')}\n </Button>\n </ActionsLayout>\n </Flex>\n </HtmlForm>\n </FormProvider>\n )\n}\n"],"names":["PolicyTypeSelectorPresentation","onContinue","onCancel","defaultPolicyType","useI18n","t","useTranslation","Heading","Text","Button","useComponentContext","formMethods","useForm","policyTypeOptions","useMemo","handleSubmit","data","FormProvider","jsx","HtmlForm","jsxs","Flex","RadioGroupField","ActionsLayout"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PolicyTypeSelectorPresentation.js","sources":["../../../../src/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type { PolicyType, PolicyTypeSelectorPresentationProps } from './PolicyTypeSelectorTypes'\nimport { Flex, ActionsLayout, RadioGroupField } from '@/components/Common'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\ninterface PolicyTypeSelectorFormData {\n policyType: PolicyType\n}\n\nexport function PolicyTypeSelectorPresentation({\n onContinue,\n onCancel,\n defaultPolicyType,\n}: PolicyTypeSelectorPresentationProps) {\n useI18n('Company.TimeOff.SelectPolicyType')\n const { t } = useTranslation('Company.TimeOff.SelectPolicyType')\n const { Heading, Text, Button } = useComponentContext()\n\n const formMethods = useForm<PolicyTypeSelectorFormData>({\n defaultValues: {\n policyType: defaultPolicyType as PolicyType,\n },\n })\n\n const policyTypeOptions = useMemo(\n () => [\n {\n value: 'holiday' as PolicyType,\n label: t('holidayLabel'),\n description: t('holidayHint'),\n },\n {\n value: 'vacation' as PolicyType,\n label: t('timeOffLabel'),\n description: t('timeOffHint'),\n },\n {\n value: 'sick' as PolicyType,\n label: t('sickLeaveLabel'),\n description: t('sickLeaveHint'),\n },\n ],\n [t],\n )\n\n const handleSubmit = (data: PolicyTypeSelectorFormData) => {\n onContinue(data.policyType)\n }\n\n return (\n <FormProvider {...formMethods}>\n <HtmlForm onSubmit={formMethods.handleSubmit(handleSubmit)}>\n <Flex flexDirection=\"column\" gap={24}>\n <Flex flexDirection=\"column\" gap={4}>\n <Heading as=\"h2\">{t('title')}</Heading>\n <Text variant=\"supporting\">{t('policyTypeHint')}</Text>\n </Flex>\n\n <RadioGroupField<PolicyType>\n name=\"policyType\"\n label={t('policyTypeLabel')}\n options={policyTypeOptions}\n isRequired\n />\n\n <ActionsLayout>\n <Button variant=\"secondary\" onClick={onCancel}>\n {t('cancelCta')}\n </Button>\n <Button variant=\"primary\" type=\"submit\">\n {t('continueCta')}\n </Button>\n </ActionsLayout>\n </Flex>\n </HtmlForm>\n </FormProvider>\n )\n}\n"],"names":["PolicyTypeSelectorPresentation","onContinue","onCancel","defaultPolicyType","useI18n","t","useTranslation","Heading","Text","Button","useComponentContext","formMethods","useForm","policyTypeOptions","useMemo","handleSubmit","data","FormProvider","jsx","HtmlForm","jsxs","Flex","RadioGroupField","ActionsLayout"],"mappings":";;;;;;;;;;;AAaO,SAASA,EAA+B;AAAA,EAC7C,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,mBAAAC;AACF,GAAwC;AACtC,EAAAC,EAAQ,kCAAkC;AAC1C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kCAAkC,GACzD,EAAE,SAAAC,GAAS,MAAAC,GAAM,QAAAC,EAAA,IAAWC,EAAA,GAE5BC,IAAcC,EAAoC;AAAA,IACtD,eAAe;AAAA,MACb,YAAYT;AAAA,IAAA;AAAA,EACd,CACD,GAEKU,IAAoBC;AAAA,IACxB,MAAM;AAAA,MACJ;AAAA,QACE,OAAO;AAAA,QACP,OAAOT,EAAE,cAAc;AAAA,QACvB,aAAaA,EAAE,aAAa;AAAA,MAAA;AAAA,MAE9B;AAAA,QACE,OAAO;AAAA,QACP,OAAOA,EAAE,cAAc;AAAA,QACvB,aAAaA,EAAE,aAAa;AAAA,MAAA;AAAA,MAE9B;AAAA,QACE,OAAO;AAAA,QACP,OAAOA,EAAE,gBAAgB;AAAA,QACzB,aAAaA,EAAE,eAAe;AAAA,MAAA;AAAA,IAChC;AAAA,IAEF,CAACA,CAAC;AAAA,EAAA,GAGEU,IAAe,CAACC,MAAqC;AACzD,IAAAf,EAAWe,EAAK,UAAU;AAAA,EAC5B;AAEA,2BACGC,GAAA,EAAc,GAAGN,GAChB,UAAA,gBAAAO,EAACC,KAAS,UAAUR,EAAY,aAAaI,CAAY,GACvD,UAAA,gBAAAK,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAAH,EAACX,GAAA,EAAQ,IAAG,MAAM,UAAAF,EAAE,OAAO,GAAE;AAAA,wBAC5BG,GAAA,EAAK,SAAQ,cAAc,UAAAH,EAAE,gBAAgB,EAAA,CAAE;AAAA,IAAA,GAClD;AAAA,IAEA,gBAAAa;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOjB,EAAE,iBAAiB;AAAA,QAC1B,SAASQ;AAAA,QACT,YAAU;AAAA,MAAA;AAAA,IAAA;AAAA,sBAGXU,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAL,EAACT,KAAO,SAAQ,aAAY,SAASP,GAClC,UAAAG,EAAE,WAAW,GAChB;AAAA,MACA,gBAAAa,EAACT,KAAO,SAAQ,WAAU,MAAK,UAC5B,UAAAJ,EAAE,aAAa,EAAA,CAClB;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
@@ -11,17 +11,19 @@ import { ViewHolidayEmployees as h } from "../ViewHolidayEmployees/ViewHolidayEm
|
|
|
11
11
|
import { ViewHolidaySchedule as v } from "../ViewHolidaySchedule/ViewHolidaySchedule.js";
|
|
12
12
|
import { useFlow as c } from "../../Flow/useFlow.js";
|
|
13
13
|
import { Flex as y } from "../../Common/Flex/Flex.js";
|
|
14
|
+
import "react-i18next";
|
|
15
|
+
import "classnames";
|
|
14
16
|
import { ensureRequired as l } from "../../../helpers/ensureRequired.js";
|
|
15
17
|
import { useComponentContext as a } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
16
18
|
import { PolicyConfigurationForm as w } from "../TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js";
|
|
17
|
-
function
|
|
19
|
+
function K() {
|
|
18
20
|
const { onEvent: o, companyId: t, alerts: r } = c(), { Alert: p } = a();
|
|
19
21
|
return /* @__PURE__ */ m(y, { flexDirection: "column", gap: 8, children: [
|
|
20
22
|
r?.map((e, i) => /* @__PURE__ */ n(p, { status: e.type, label: e.title, children: e.content }, i)),
|
|
21
23
|
/* @__PURE__ */ n(s, { onEvent: o, companyId: l(t) })
|
|
22
24
|
] });
|
|
23
25
|
}
|
|
24
|
-
function
|
|
26
|
+
function M() {
|
|
25
27
|
const { onEvent: o, companyId: t, policyType: r, alerts: p } = c(), { Alert: e } = a();
|
|
26
28
|
return /* @__PURE__ */ m(y, { flexDirection: "column", gap: 8, children: [
|
|
27
29
|
p?.map((i, d) => /* @__PURE__ */ n(e, { status: i.type, label: i.title, children: i.content }, d)),
|
|
@@ -35,7 +37,7 @@ function J() {
|
|
|
35
37
|
)
|
|
36
38
|
] });
|
|
37
39
|
}
|
|
38
|
-
function
|
|
40
|
+
function N() {
|
|
39
41
|
const { onEvent: o, companyId: t, policyType: r, alerts: p } = c(), { Alert: e } = a();
|
|
40
42
|
return /* @__PURE__ */ m(y, { flexDirection: "column", gap: 8, children: [
|
|
41
43
|
p?.map((i, d) => /* @__PURE__ */ n(e, { status: i.type, label: i.title, children: i.content }, d)),
|
|
@@ -49,55 +51,55 @@ function K() {
|
|
|
49
51
|
)
|
|
50
52
|
] });
|
|
51
53
|
}
|
|
52
|
-
function
|
|
54
|
+
function O() {
|
|
53
55
|
const { onEvent: o, policyId: t, alerts: r } = c(), { Alert: p } = a();
|
|
54
56
|
return /* @__PURE__ */ m(y, { flexDirection: "column", gap: 8, children: [
|
|
55
57
|
r?.map((e, i) => /* @__PURE__ */ n(p, { status: e.type, label: e.title, children: e.content }, i)),
|
|
56
58
|
/* @__PURE__ */ n(f, { onEvent: o, policyId: l(t) })
|
|
57
59
|
] });
|
|
58
60
|
}
|
|
59
|
-
function
|
|
61
|
+
function Q() {
|
|
60
62
|
const { onEvent: o, policyId: t } = c();
|
|
61
63
|
return /* @__PURE__ */ n(I, { onEvent: o, policyId: l(t) });
|
|
62
64
|
}
|
|
63
|
-
function
|
|
65
|
+
function U() {
|
|
64
66
|
const { onEvent: o, policyId: t } = c();
|
|
65
67
|
return /* @__PURE__ */ n(x, { onEvent: o, policyId: l(t) });
|
|
66
68
|
}
|
|
67
|
-
function
|
|
69
|
+
function W() {
|
|
68
70
|
const { onEvent: o, policyId: t } = c();
|
|
69
71
|
return /* @__PURE__ */ n(E, { onEvent: o, policyId: l(t) });
|
|
70
72
|
}
|
|
71
|
-
function
|
|
73
|
+
function X() {
|
|
72
74
|
const { onEvent: o, companyId: t, alerts: r } = c(), { Alert: p } = a();
|
|
73
75
|
return /* @__PURE__ */ m(y, { flexDirection: "column", gap: 8, children: [
|
|
74
76
|
r?.map((e, i) => /* @__PURE__ */ n(p, { status: e.type, label: e.title, children: e.content }, i)),
|
|
75
77
|
/* @__PURE__ */ n(P, { onEvent: o, companyId: l(t) })
|
|
76
78
|
] });
|
|
77
79
|
}
|
|
78
|
-
function
|
|
80
|
+
function Y() {
|
|
79
81
|
const { onEvent: o, companyId: t } = c();
|
|
80
82
|
return /* @__PURE__ */ n(C, { onEvent: o, companyId: l(t) });
|
|
81
83
|
}
|
|
82
|
-
function
|
|
84
|
+
function Z() {
|
|
83
85
|
const { onEvent: o, companyId: t } = c();
|
|
84
86
|
return /* @__PURE__ */ n(h, { onEvent: o, companyId: l(t) });
|
|
85
87
|
}
|
|
86
|
-
function
|
|
88
|
+
function _() {
|
|
87
89
|
const { onEvent: o, companyId: t } = c();
|
|
88
90
|
return /* @__PURE__ */ n(v, { onEvent: o, companyId: l(t) });
|
|
89
91
|
}
|
|
90
92
|
export {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
93
|
+
Y as AddEmployeesHolidayContextual,
|
|
94
|
+
Q as AddEmployeesToPolicyContextual,
|
|
95
|
+
X as HolidaySelectionFormContextual,
|
|
96
|
+
N as PolicyDetailsFormContextual,
|
|
97
|
+
K as PolicyListContextual,
|
|
98
|
+
O as PolicySettingsContextual,
|
|
99
|
+
M as SelectPolicyTypeContextual,
|
|
100
|
+
Z as ViewHolidayEmployeesContextual,
|
|
101
|
+
_ as ViewHolidayScheduleContextual,
|
|
102
|
+
U as ViewPolicyDetailsContextual,
|
|
103
|
+
W as ViewPolicyEmployeesContextual
|
|
102
104
|
};
|
|
103
105
|
//# sourceMappingURL=TimeOffFlowComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeOffFlowComponents.js","sources":["../../../../src/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { PolicyList } from '../PolicyList/PolicyList'\nimport { PolicyTypeSelector } from '../PolicyTypeSelector/PolicyTypeSelector'\nimport { PolicyConfigurationForm } from '../TimeOffManagement/PolicyConfigurationForm'\nimport { PolicySettings } from '../PolicySettings/PolicySettings'\nimport { AddEmployeesToPolicy } from '../AddEmployeesToPolicy/AddEmployeesToPolicy'\nimport { ViewPolicyDetails } from '../ViewPolicyDetails/ViewPolicyDetails'\nimport { ViewPolicyEmployees } from '../ViewPolicyEmployees/ViewPolicyEmployees'\nimport { HolidaySelectionForm } from '../HolidaySelectionForm/HolidaySelectionForm'\nimport { AddEmployeesHoliday } from '../AddEmployeesHoliday/AddEmployeesHoliday'\nimport { ViewHolidayEmployees } from '../ViewHolidayEmployees/ViewHolidayEmployees'\nimport { ViewHolidaySchedule } from '../ViewHolidaySchedule/ViewHolidaySchedule'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport interface TimeOffFlowProps extends BaseComponentInterface {\n companyId: string\n}\n\nexport type TimeOffFlowAlert = {\n type: 'error' | 'info' | 'success'\n title: string\n content?: ReactNode\n}\n\nexport type TimeOffPolicyType = 'sick' | 'vacation' | 'holiday'\n\nexport interface TimeOffFlowContextInterface extends FlowContextInterface {\n companyId: string\n policyType?: TimeOffPolicyType\n policyId?: string\n alerts?: TimeOffFlowAlert[]\n}\n\nexport function PolicyListContextual() {\n const { onEvent, companyId, alerts } = useFlow<TimeOffFlowContextInterface>()\n const { Alert } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n {alerts?.map((alert, index) => (\n <Alert key={index} status={alert.type} label={alert.title}>\n {alert.content}\n </Alert>\n ))}\n <PolicyList onEvent={onEvent} companyId={ensureRequired(companyId)} />\n </Flex>\n )\n}\n\nexport function SelectPolicyTypeContextual() {\n const { onEvent, companyId, policyType, alerts } = useFlow<TimeOffFlowContextInterface>()\n const { Alert } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n {alerts?.map((alert, index) => (\n <Alert key={index} status={alert.type} label={alert.title}>\n {alert.content}\n </Alert>\n ))}\n <PolicyTypeSelector\n onEvent={onEvent}\n companyId={ensureRequired(companyId)}\n defaultPolicyType={policyType}\n />\n </Flex>\n )\n}\n\nexport function PolicyDetailsFormContextual() {\n const { onEvent, companyId, policyType, alerts } = useFlow<TimeOffFlowContextInterface>()\n const { Alert } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n {alerts?.map((alert, index) => (\n <Alert key={index} status={alert.type} label={alert.title}>\n {alert.content}\n </Alert>\n ))}\n <PolicyConfigurationForm\n onEvent={onEvent}\n companyId={ensureRequired(companyId)}\n policyType={ensureRequired(policyType) as 'sick' | 'vacation'}\n />\n </Flex>\n )\n}\n\nexport function PolicySettingsContextual() {\n const { onEvent, policyId, alerts } = useFlow<TimeOffFlowContextInterface>()\n const { Alert } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n {alerts?.map((alert, index) => (\n <Alert key={index} status={alert.type} label={alert.title}>\n {alert.content}\n </Alert>\n ))}\n <PolicySettings onEvent={onEvent} policyId={ensureRequired(policyId)} />\n </Flex>\n )\n}\n\nexport function AddEmployeesToPolicyContextual() {\n const { onEvent, policyId } = useFlow<TimeOffFlowContextInterface>()\n return <AddEmployeesToPolicy onEvent={onEvent} policyId={ensureRequired(policyId)} />\n}\n\nexport function ViewPolicyDetailsContextual() {\n const { onEvent, policyId } = useFlow<TimeOffFlowContextInterface>()\n return <ViewPolicyDetails onEvent={onEvent} policyId={ensureRequired(policyId)} />\n}\n\nexport function ViewPolicyEmployeesContextual() {\n const { onEvent, policyId } = useFlow<TimeOffFlowContextInterface>()\n return <ViewPolicyEmployees onEvent={onEvent} policyId={ensureRequired(policyId)} />\n}\n\nexport function HolidaySelectionFormContextual() {\n const { onEvent, companyId, alerts } = useFlow<TimeOffFlowContextInterface>()\n const { Alert } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n {alerts?.map((alert, index) => (\n <Alert key={index} status={alert.type} label={alert.title}>\n {alert.content}\n </Alert>\n ))}\n <HolidaySelectionForm onEvent={onEvent} companyId={ensureRequired(companyId)} />\n </Flex>\n )\n}\n\nexport function AddEmployeesHolidayContextual() {\n const { onEvent, companyId } = useFlow<TimeOffFlowContextInterface>()\n return <AddEmployeesHoliday onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\n\nexport function ViewHolidayEmployeesContextual() {\n const { onEvent, companyId } = useFlow<TimeOffFlowContextInterface>()\n return <ViewHolidayEmployees onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\n\nexport function ViewHolidayScheduleContextual() {\n const { onEvent, companyId } = useFlow<TimeOffFlowContextInterface>()\n return <ViewHolidaySchedule onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\n"],"names":["PolicyListContextual","onEvent","companyId","alerts","useFlow","Alert","useComponentContext","jsxs","Flex","alert","index","PolicyList","ensureRequired","SelectPolicyTypeContextual","policyType","jsx","PolicyTypeSelector","PolicyDetailsFormContextual","PolicyConfigurationForm","PolicySettingsContextual","policyId","PolicySettings","AddEmployeesToPolicyContextual","AddEmployeesToPolicy","ViewPolicyDetailsContextual","ViewPolicyDetails","ViewPolicyEmployeesContextual","ViewPolicyEmployees","HolidaySelectionFormContextual","HolidaySelectionForm","AddEmployeesHolidayContextual","AddEmployeesHoliday","ViewHolidayEmployeesContextual","ViewHolidayEmployees","ViewHolidayScheduleContextual","ViewHolidaySchedule"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TimeOffFlowComponents.js","sources":["../../../../src/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { PolicyList } from '../PolicyList/PolicyList'\nimport { PolicyTypeSelector } from '../PolicyTypeSelector/PolicyTypeSelector'\nimport { PolicyConfigurationForm } from '../TimeOffManagement/PolicyConfigurationForm'\nimport { PolicySettings } from '../PolicySettings/PolicySettings'\nimport { AddEmployeesToPolicy } from '../AddEmployeesToPolicy/AddEmployeesToPolicy'\nimport { ViewPolicyDetails } from '../ViewPolicyDetails/ViewPolicyDetails'\nimport { ViewPolicyEmployees } from '../ViewPolicyEmployees/ViewPolicyEmployees'\nimport { HolidaySelectionForm } from '../HolidaySelectionForm/HolidaySelectionForm'\nimport { AddEmployeesHoliday } from '../AddEmployeesHoliday/AddEmployeesHoliday'\nimport { ViewHolidayEmployees } from '../ViewHolidayEmployees/ViewHolidayEmployees'\nimport { ViewHolidaySchedule } from '../ViewHolidaySchedule/ViewHolidaySchedule'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport interface TimeOffFlowProps extends BaseComponentInterface {\n companyId: string\n}\n\nexport type TimeOffFlowAlert = {\n type: 'error' | 'info' | 'success'\n title: string\n content?: ReactNode\n}\n\nexport type TimeOffPolicyType = 'sick' | 'vacation' | 'holiday'\n\nexport interface TimeOffFlowContextInterface extends FlowContextInterface {\n companyId: string\n policyType?: TimeOffPolicyType\n policyId?: string\n alerts?: TimeOffFlowAlert[]\n}\n\nexport function PolicyListContextual() {\n const { onEvent, companyId, alerts } = useFlow<TimeOffFlowContextInterface>()\n const { Alert } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n {alerts?.map((alert, index) => (\n <Alert key={index} status={alert.type} label={alert.title}>\n {alert.content}\n </Alert>\n ))}\n <PolicyList onEvent={onEvent} companyId={ensureRequired(companyId)} />\n </Flex>\n )\n}\n\nexport function SelectPolicyTypeContextual() {\n const { onEvent, companyId, policyType, alerts } = useFlow<TimeOffFlowContextInterface>()\n const { Alert } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n {alerts?.map((alert, index) => (\n <Alert key={index} status={alert.type} label={alert.title}>\n {alert.content}\n </Alert>\n ))}\n <PolicyTypeSelector\n onEvent={onEvent}\n companyId={ensureRequired(companyId)}\n defaultPolicyType={policyType}\n />\n </Flex>\n )\n}\n\nexport function PolicyDetailsFormContextual() {\n const { onEvent, companyId, policyType, alerts } = useFlow<TimeOffFlowContextInterface>()\n const { Alert } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n {alerts?.map((alert, index) => (\n <Alert key={index} status={alert.type} label={alert.title}>\n {alert.content}\n </Alert>\n ))}\n <PolicyConfigurationForm\n onEvent={onEvent}\n companyId={ensureRequired(companyId)}\n policyType={ensureRequired(policyType) as 'sick' | 'vacation'}\n />\n </Flex>\n )\n}\n\nexport function PolicySettingsContextual() {\n const { onEvent, policyId, alerts } = useFlow<TimeOffFlowContextInterface>()\n const { Alert } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n {alerts?.map((alert, index) => (\n <Alert key={index} status={alert.type} label={alert.title}>\n {alert.content}\n </Alert>\n ))}\n <PolicySettings onEvent={onEvent} policyId={ensureRequired(policyId)} />\n </Flex>\n )\n}\n\nexport function AddEmployeesToPolicyContextual() {\n const { onEvent, policyId } = useFlow<TimeOffFlowContextInterface>()\n return <AddEmployeesToPolicy onEvent={onEvent} policyId={ensureRequired(policyId)} />\n}\n\nexport function ViewPolicyDetailsContextual() {\n const { onEvent, policyId } = useFlow<TimeOffFlowContextInterface>()\n return <ViewPolicyDetails onEvent={onEvent} policyId={ensureRequired(policyId)} />\n}\n\nexport function ViewPolicyEmployeesContextual() {\n const { onEvent, policyId } = useFlow<TimeOffFlowContextInterface>()\n return <ViewPolicyEmployees onEvent={onEvent} policyId={ensureRequired(policyId)} />\n}\n\nexport function HolidaySelectionFormContextual() {\n const { onEvent, companyId, alerts } = useFlow<TimeOffFlowContextInterface>()\n const { Alert } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n {alerts?.map((alert, index) => (\n <Alert key={index} status={alert.type} label={alert.title}>\n {alert.content}\n </Alert>\n ))}\n <HolidaySelectionForm onEvent={onEvent} companyId={ensureRequired(companyId)} />\n </Flex>\n )\n}\n\nexport function AddEmployeesHolidayContextual() {\n const { onEvent, companyId } = useFlow<TimeOffFlowContextInterface>()\n return <AddEmployeesHoliday onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\n\nexport function ViewHolidayEmployeesContextual() {\n const { onEvent, companyId } = useFlow<TimeOffFlowContextInterface>()\n return <ViewHolidayEmployees onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\n\nexport function ViewHolidayScheduleContextual() {\n const { onEvent, companyId } = useFlow<TimeOffFlowContextInterface>()\n return <ViewHolidaySchedule onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\n"],"names":["PolicyListContextual","onEvent","companyId","alerts","useFlow","Alert","useComponentContext","jsxs","Flex","alert","index","PolicyList","ensureRequired","SelectPolicyTypeContextual","policyType","jsx","PolicyTypeSelector","PolicyDetailsFormContextual","PolicyConfigurationForm","PolicySettingsContextual","policyId","PolicySettings","AddEmployeesToPolicyContextual","AddEmployeesToPolicy","ViewPolicyDetailsContextual","ViewPolicyDetails","ViewPolicyEmployeesContextual","ViewPolicyEmployees","HolidaySelectionFormContextual","HolidaySelectionForm","AddEmployeesHolidayContextual","AddEmployeesHoliday","ViewHolidayEmployeesContextual","ViewHolidayEmployees","ViewHolidayScheduleContextual","ViewHolidaySchedule"],"mappings":";;;;;;;;;;;;;;;;;;AAqCO,SAASA,IAAuB;AACrC,QAAM,EAAE,SAAAC,GAAS,WAAAC,GAAW,QAAAC,EAAA,IAAWC,EAAA,GACjC,EAAE,OAAAC,EAAA,IAAUC,EAAA;AAElB,SACE,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAC/B,UAAA;AAAA,IAAAL,GAAQ,IAAI,CAACM,GAAOC,wBAClBL,GAAA,EAAkB,QAAQI,EAAM,MAAM,OAAOA,EAAM,OACjD,UAAAA,EAAM,QAAA,GADGC,CAEZ,CACD;AAAA,sBACAC,GAAA,EAAW,SAAAV,GAAkB,WAAWW,EAAeV,CAAS,EAAA,CAAG;AAAA,EAAA,GACtE;AAEJ;AAEO,SAASW,IAA6B;AAC3C,QAAM,EAAE,SAAAZ,GAAS,WAAAC,GAAW,YAAAY,GAAY,QAAAX,EAAA,IAAWC,EAAA,GAC7C,EAAE,OAAAC,EAAA,IAAUC,EAAA;AAElB,SACE,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAC/B,UAAA;AAAA,IAAAL,GAAQ,IAAI,CAACM,GAAOC,wBAClBL,GAAA,EAAkB,QAAQI,EAAM,MAAM,OAAOA,EAAM,OACjD,UAAAA,EAAM,QAAA,GADGC,CAEZ,CACD;AAAA,IACD,gBAAAK;AAAA,MAACC;AAAA,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WW,EAAeV,CAAS,GAAG;AACtF;"}
|
|
@@ -4,6 +4,7 @@ import { useForm as I, useWatch as v, FormProvider as S } from "react-hook-form"
|
|
|
4
4
|
import { useTranslation as q } from "react-i18next";
|
|
5
5
|
import l from "./PolicyConfigurationForm.module.scss.js";
|
|
6
6
|
import { Flex as r } from "../../../Common/Flex/Flex.js";
|
|
7
|
+
import "classnames";
|
|
7
8
|
import { ActionsLayout as w } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
8
9
|
import { Form as Y } from "../../../Common/Form/Form.js";
|
|
9
10
|
import { useComponentContext as E } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
@@ -18,7 +19,7 @@ const j = Array.from({ length: 31 }, (d, t) => ({
|
|
|
18
19
|
value: t + 1,
|
|
19
20
|
label: String(t + 1)
|
|
20
21
|
}));
|
|
21
|
-
function
|
|
22
|
+
function ce({
|
|
22
23
|
onContinue: d,
|
|
23
24
|
onCancel: t,
|
|
24
25
|
defaultValues: F
|
|
@@ -201,6 +202,6 @@ function ne({
|
|
|
201
202
|
] }) }) });
|
|
202
203
|
}
|
|
203
204
|
export {
|
|
204
|
-
|
|
205
|
+
ce as PolicyConfigurationFormPresentation
|
|
205
206
|
};
|
|
206
207
|
//# sourceMappingURL=PolicyConfigurationFormPresentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolicyConfigurationFormPresentation.js","sources":["../../../../../src/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type {\n AccrualMethod,\n AccrualMethodFixed,\n PolicyConfigurationFormData,\n PolicyConfigurationFormPresentationProps,\n ResetDateType,\n} from './PolicyConfigurationFormTypes'\nimport styles from './PolicyConfigurationForm.module.scss'\nimport {\n Flex,\n ActionsLayout,\n RadioGroupField,\n NumberInputField,\n CheckboxField,\n SelectField,\n TextInputField,\n} from '@/components/Common'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { useI18n } from '@/i18n'\n\nconst DAY_OPTIONS = Array.from({ length: 31 }, (_, i) => ({\n value: i + 1,\n label: String(i + 1),\n}))\n\nexport function PolicyConfigurationFormPresentation({\n onContinue,\n onCancel,\n defaultValues,\n}: PolicyConfigurationFormPresentationProps) {\n useI18n('Company.TimeOff.CreateTimeOffPolicy')\n const { t } = useTranslation('Company.TimeOff.CreateTimeOffPolicy')\n const { Heading, Text, Button } = useComponentContext()\n const { locale } = useLocale()\n\n const monthOptions = useMemo(() => {\n const formatter = new Intl.DateTimeFormat(locale, { month: 'long' })\n return Array.from({ length: 12 }, (_, i) => ({\n value: i + 1,\n label: formatter.format(new Date(2024, i)),\n }))\n }, [locale])\n\n const formMethods = useForm<PolicyConfigurationFormData>({\n defaultValues: {\n name: '',\n resetMonth: 1,\n resetDay: 1,\n ...defaultValues,\n },\n })\n\n const { control } = formMethods\n const accrualMethod = useWatch({ control, name: 'accrualMethod' })\n const resetDateType = useWatch({ control, name: 'resetDateType' })\n\n const accrualMethodOptions = useMemo(\n () => [\n {\n value: 'per_hour_paid' as AccrualMethod,\n label: t('policyDetails.perHourPaidLabel'),\n description: t('policyDetails.perHourPaidHint'),\n },\n {\n value: 'per_calendar_year' as AccrualMethod,\n label: t('policyDetails.perYearLabel'),\n description: t('policyDetails.perYearHint'),\n },\n {\n value: 'unlimited' as AccrualMethod,\n label: t('policyDetails.unlimitedLabel'),\n description: t('policyDetails.unlimitedHint'),\n },\n ],\n [t],\n )\n\n const accrualMethodFixedOptions = useMemo(\n () => [\n {\n value: 'per_pay_period' as AccrualMethodFixed,\n label: t('policyDetails.perPayPeriodLabel'),\n description: t('policyDetails.perPayPeriodHint'),\n },\n {\n value: 'all_at_once' as AccrualMethodFixed,\n label: t('policyDetails.allAtOnceLabel'),\n description: t('policyDetails.allAtOnceHint'),\n },\n ],\n [t],\n )\n\n const resetDateTypeOptions = useMemo(\n () => [\n {\n value: 'per_anniversary_year' as ResetDateType,\n label: t('policyDetails.perAnniversaryYearLabel'),\n },\n {\n value: 'per_calendar_year' as ResetDateType,\n label: t('policyDetails.perCalendarYearLabel'),\n },\n ],\n [t],\n )\n\n const handleSubmit = (data: PolicyConfigurationFormData) => {\n onContinue(data)\n }\n\n const isHourlyMethod = accrualMethod === 'per_hour_paid'\n const isFixedMethod = accrualMethod === 'per_calendar_year'\n const showResetDate = isHourlyMethod || isFixedMethod\n const showCustomDateFields = resetDateType === 'per_calendar_year'\n\n return (\n <FormProvider {...formMethods}>\n <HtmlForm onSubmit={formMethods.handleSubmit(handleSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n <Heading as=\"h2\">{t('policyDetails.title')}</Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n <TextInputField name=\"name\" label={t('policyDetails.policyNameLabel')} isRequired />\n\n <RadioGroupField<AccrualMethod>\n name=\"accrualMethod\"\n label={t('policyDetails.accrualMethodLabel')}\n description={t('policyDetails.accrualMethodHint')}\n options={accrualMethodOptions}\n isRequired\n />\n\n {isHourlyMethod && (\n <>\n <hr className={styles.divider} />\n\n <NumberInputField\n className={styles.narrowInput}\n name=\"accrualRate\"\n label={t('policyDetails.employeesWillAccrueLabel')}\n adornmentEnd={t('policyDetails.hoursUnit')}\n isRequired\n min={0}\n />\n\n <NumberInputField\n className={styles.narrowInput}\n name=\"accrualRateUnit\"\n label={t('policyDetails.forEveryLabel')}\n adornmentEnd={t('policyDetails.hoursWorkedUnit')}\n isRequired\n min={1}\n />\n\n <Flex flexDirection=\"column\" gap={8}>\n <Text>{t('policyDetails.additionalOptionsLabel')}</Text>\n <CheckboxField\n name=\"includeOvertime\"\n label={t('policyDetails.includeOvertimeLabel')}\n />\n <CheckboxField name=\"allPaidHours\" label={t('policyDetails.allPaidHoursLabel')} />\n </Flex>\n </>\n )}\n\n {isFixedMethod && (\n <>\n <hr className={styles.divider} />\n\n <NumberInputField\n className={styles.narrowInput}\n name=\"accrualRate\"\n label={t('policyDetails.fixedAccrualRateLabel')}\n description={t('policyDetails.fixedAccrualRateHint')}\n adornmentEnd={t('policyDetails.hoursUnit')}\n isRequired\n min={0}\n />\n\n <RadioGroupField<AccrualMethodFixed>\n name=\"accrualMethodFixed\"\n label={t('policyDetails.accrualMethodFixed')}\n description={t('policyDetails.accrualMethodFixedHint')}\n options={accrualMethodFixedOptions}\n isRequired\n />\n </>\n )}\n\n {showResetDate && (\n <>\n <hr className={styles.divider} />\n\n <RadioGroupField<ResetDateType>\n name=\"resetDateType\"\n label={t('policyDetails.policyResetDateType')}\n description={t('policyDetails.policyResetDateTypeHint')}\n options={resetDateTypeOptions}\n isRequired\n />\n\n {showCustomDateFields && (\n <Flex gap={8}>\n <SelectField<number>\n className={styles.dateSelect}\n name=\"resetMonth\"\n label={t('policyDetails.monthLabel')}\n options={monthOptions}\n />\n <SelectField<number>\n className={styles.dateSelect}\n name=\"resetDay\"\n label={t('policyDetails.dayLabel')}\n options={DAY_OPTIONS}\n />\n </Flex>\n )}\n </>\n )}\n\n <ActionsLayout>\n <Button variant=\"secondary\" onClick={onCancel}>\n {t('cancelCta')}\n </Button>\n <Button variant=\"primary\" type=\"submit\">\n {t('continueCta')}\n </Button>\n </ActionsLayout>\n </Flex>\n </Flex>\n </HtmlForm>\n </FormProvider>\n )\n}\n"],"names":["DAY_OPTIONS","_","i","PolicyConfigurationFormPresentation","onContinue","onCancel","defaultValues","useI18n","t","useTranslation","Heading","Text","Button","useComponentContext","locale","useLocale","monthOptions","useMemo","formatter","formMethods","useForm","control","accrualMethod","useWatch","resetDateType","accrualMethodOptions","accrualMethodFixedOptions","resetDateTypeOptions","handleSubmit","data","isHourlyMethod","isFixedMethod","showResetDate","showCustomDateFields","FormProvider","jsx","HtmlForm","jsxs","Flex","TextInputField","RadioGro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AA,cACjC,SAASR;AAAA,YAAA;AAAA,UAAA;AAAA,QACX,EAAA,CACF;AAAA,MAAA,GAEJ;AAAA,wBAGD8C,GAAA,EACC,UAAA;AAAA,QAAA,gBAAAX,EAACvB,KAAO,SAAQ,aAAY,SAASP,GAClC,UAAAG,EAAE,WAAW,GAChB;AAAA,QACA,gBAAA2B,EAACvB,KAAO,SAAQ,WAAU,MAAK,UAC5B,UAAAJ,EAAE,aAAa,EAAA,CAClB;AAAA,MAAA,EAAA,CACF;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"PolicyConfigurationFormPresentation.js","sources":["../../../../../src/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type {\n AccrualMethod,\n AccrualMethodFixed,\n PolicyConfigurationFormData,\n PolicyConfigurationFormPresentationProps,\n ResetDateType,\n} from './PolicyConfigurationFormTypes'\nimport styles from './PolicyConfigurationForm.module.scss'\nimport {\n Flex,\n ActionsLayout,\n RadioGroupField,\n NumberInputField,\n CheckboxField,\n SelectField,\n TextInputField,\n} from '@/components/Common'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { useI18n } from '@/i18n'\n\nconst DAY_OPTIONS = Array.from({ length: 31 }, (_, i) => ({\n value: i + 1,\n label: String(i + 1),\n}))\n\nexport function PolicyConfigurationFormPresentation({\n onContinue,\n onCancel,\n defaultValues,\n}: PolicyConfigurationFormPresentationProps) {\n useI18n('Company.TimeOff.CreateTimeOffPolicy')\n const { t } = useTranslation('Company.TimeOff.CreateTimeOffPolicy')\n const { Heading, Text, Button } = useComponentContext()\n const { locale } = useLocale()\n\n const monthOptions = useMemo(() => {\n const formatter = new Intl.DateTimeFormat(locale, { month: 'long' })\n return Array.from({ length: 12 }, (_, i) => ({\n value: i + 1,\n label: formatter.format(new Date(2024, i)),\n }))\n }, [locale])\n\n const formMethods = useForm<PolicyConfigurationFormData>({\n defaultValues: {\n name: '',\n resetMonth: 1,\n resetDay: 1,\n ...defaultValues,\n },\n })\n\n const { control } = formMethods\n const accrualMethod = useWatch({ control, name: 'accrualMethod' })\n const resetDateType = useWatch({ control, name: 'resetDateType' })\n\n const accrualMethodOptions = useMemo(\n () => [\n {\n value: 'per_hour_paid' as AccrualMethod,\n label: t('policyDetails.perHourPaidLabel'),\n description: t('policyDetails.perHourPaidHint'),\n },\n {\n value: 'per_calendar_year' as AccrualMethod,\n label: t('policyDetails.perYearLabel'),\n description: t('policyDetails.perYearHint'),\n },\n {\n value: 'unlimited' as AccrualMethod,\n label: t('policyDetails.unlimitedLabel'),\n description: t('policyDetails.unlimitedHint'),\n },\n ],\n [t],\n )\n\n const accrualMethodFixedOptions = useMemo(\n () => [\n {\n value: 'per_pay_period' as AccrualMethodFixed,\n label: t('policyDetails.perPayPeriodLabel'),\n description: t('policyDetails.perPayPeriodHint'),\n },\n {\n value: 'all_at_once' as AccrualMethodFixed,\n label: t('policyDetails.allAtOnceLabel'),\n description: t('policyDetails.allAtOnceHint'),\n },\n ],\n [t],\n )\n\n const resetDateTypeOptions = useMemo(\n () => [\n {\n value: 'per_anniversary_year' as ResetDateType,\n label: t('policyDetails.perAnniversaryYearLabel'),\n },\n {\n value: 'per_calendar_year' as ResetDateType,\n label: t('policyDetails.perCalendarYearLabel'),\n },\n ],\n [t],\n )\n\n const handleSubmit = (data: PolicyConfigurationFormData) => {\n onContinue(data)\n }\n\n const isHourlyMethod = accrualMethod === 'per_hour_paid'\n const isFixedMethod = accrualMethod === 'per_calendar_year'\n const showResetDate = isHourlyMethod || isFixedMethod\n const showCustomDateFields = resetDateType === 'per_calendar_year'\n\n return (\n <FormProvider {...formMethods}>\n <HtmlForm onSubmit={formMethods.handleSubmit(handleSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n <Heading as=\"h2\">{t('policyDetails.title')}</Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n <TextInputField name=\"name\" label={t('policyDetails.policyNameLabel')} isRequired />\n\n <RadioGroupField<AccrualMethod>\n name=\"accrualMethod\"\n label={t('policyDetails.accrualMethodLabel')}\n description={t('policyDetails.accrualMethodHint')}\n options={accrualMethodOptions}\n isRequired\n />\n\n {isHourlyMethod && (\n <>\n <hr className={styles.divider} />\n\n <NumberInputField\n className={styles.narrowInput}\n name=\"accrualRate\"\n label={t('policyDetails.employeesWillAccrueLabel')}\n adornmentEnd={t('policyDetails.hoursUnit')}\n isRequired\n min={0}\n />\n\n <NumberInputField\n className={styles.narrowInput}\n name=\"accrualRateUnit\"\n label={t('policyDetails.forEveryLabel')}\n adornmentEnd={t('policyDetails.hoursWorkedUnit')}\n isRequired\n min={1}\n />\n\n <Flex flexDirection=\"column\" gap={8}>\n <Text>{t('policyDetails.additionalOptionsLabel')}</Text>\n <CheckboxField\n name=\"includeOvertime\"\n label={t('policyDetails.includeOvertimeLabel')}\n />\n <CheckboxField name=\"allPaidHours\" label={t('policyDetails.allPaidHoursLabel')} />\n </Flex>\n </>\n )}\n\n {isFixedMethod && (\n <>\n <hr className={styles.divider} />\n\n <NumberInputField\n className={styles.narrowInput}\n name=\"accrualRate\"\n label={t('policyDetails.fixedAccrualRateLabel')}\n description={t('policyDetails.fixedAccrualRateHint')}\n adornmentEnd={t('policyDetails.hoursUnit')}\n isRequired\n min={0}\n />\n\n <RadioGroupField<AccrualMethodFixed>\n name=\"accrualMethodFixed\"\n label={t('policyDetails.accrualMethodFixed')}\n description={t('policyDetails.accrualMethodFixedHint')}\n options={accrualMethodFixedOptions}\n isRequired\n />\n </>\n )}\n\n {showResetDate && (\n <>\n <hr className={styles.divider} />\n\n <RadioGroupField<ResetDateType>\n name=\"resetDateType\"\n label={t('policyDetails.policyResetDateType')}\n description={t('policyDetails.policyResetDateTypeHint')}\n options={resetDateTypeOptions}\n isRequired\n />\n\n {showCustomDateFields && (\n <Flex gap={8}>\n <SelectField<number>\n className={styles.dateSelect}\n name=\"resetMonth\"\n label={t('policyDetails.monthLabel')}\n options={monthOptions}\n />\n <SelectField<number>\n className={styles.dateSelect}\n name=\"resetDay\"\n label={t('policyDetails.dayLabel')}\n options={DAY_OPTIONS}\n />\n </Flex>\n )}\n </>\n )}\n\n <ActionsLayout>\n <Button variant=\"secondary\" onClick={onCancel}>\n {t('cancelCta')}\n </Button>\n <Button variant=\"primary\" type=\"submit\">\n {t('continueCta')}\n </Button>\n </ActionsLayout>\n </Flex>\n </Flex>\n </HtmlForm>\n </FormProvider>\n )\n}\n"],"names":["DAY_OPTIONS","_","i","PolicyConfigurationFormPresentation","onContinue","onCancel","defaultValues","useI18n","t","useTranslation","Heading","Text","Button","useComponentContext","locale","useLocale","monthOptions","useMemo","formatter","formMethods","useForm","control","accrualMethod","useWatch","resetDateType","accrualMethodOptions","accrualMethodFixedOptions","resetDateTypeOptions","handleSubmit","data","isHourlyMethod","isFixedMethod","showResetDate","showCustomDateFields","FormProvider","jsx","HtmlForm","jsxs","Flex","TextInputField","RadioGroupField","Fragment","styles","NumberInputField","CheckboxField","SelectField","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;AAyBA,MAAMA,IAAc,MAAM,KAAK,EAAE,QAAQ,MAAM,CAACC,GAAGC,OAAO;AAAA,EACxD,OAAOA,IAAI;AAAA,EACX,OAAO,OAAOA,IAAI,CAAC;AACrB,EAAE;AAEK,SAASC,GAAoC;AAAA,EAClD,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AACF,GAA6C;AAC3C,EAAAC,EAAQ,qCAAqC;AAC7C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qCAAqC,GAC5D,EAAE,SAAAC,GAAS,MAAAC,GAAM,QAAAC,EAAA,IAAWC,EAAA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|
import { LoadingIndicatorProvider as I } from "../LoadingIndicatorProvider/LoadingIndicatorProvider.js";
|
|
8
8
|
import { sanitizeError as L } from "../ObservabilityProvider/sanitization.js";
|
|
9
9
|
import { SDKI18next as m } from "./SDKI18next.js";
|
|
10
|
+
import "../../shared/constants.js";
|
|
11
|
+
import "classnames";
|
|
10
12
|
import { InternalError as x } from "../../components/Common/InternalError/InternalError.js";
|
|
11
13
|
import { LocaleProvider as z } from "../LocaleProvider/LocaleProvider.js";
|
|
12
14
|
import "../LocaleProvider/useLocale.js";
|
|
13
15
|
import { ThemeProvider as D } from "../ThemeProvider/ThemeProvider.js";
|
|
14
16
|
import { normalizeToSDKError as U } from "../../types/sdkError.js";
|
|
15
17
|
import { ObservabilityProvider as T } from "../ObservabilityProvider/ObservabilityProvider.js";
|
|
16
|
-
const
|
|
18
|
+
const X = (s) => {
|
|
17
19
|
const {
|
|
18
20
|
children: l,
|
|
19
21
|
config: r,
|
|
20
22
|
dictionary: i,
|
|
21
|
-
lng:
|
|
23
|
+
lng: t = "en",
|
|
22
24
|
locale: c = "en-US",
|
|
23
25
|
currency: d = "USD",
|
|
24
26
|
theme: p,
|
|
@@ -27,8 +29,8 @@ const V = (s) => {
|
|
|
27
29
|
queryClient: b
|
|
28
30
|
} = s;
|
|
29
31
|
if (i)
|
|
30
|
-
for (const
|
|
31
|
-
const e =
|
|
32
|
+
for (const n in i) {
|
|
33
|
+
const e = n;
|
|
32
34
|
for (const a in i[e])
|
|
33
35
|
m.addResourceBundle(
|
|
34
36
|
e,
|
|
@@ -39,14 +41,14 @@ const V = (s) => {
|
|
|
39
41
|
);
|
|
40
42
|
}
|
|
41
43
|
P(() => {
|
|
42
|
-
(async () => await m.changeLanguage(
|
|
43
|
-
}, [
|
|
44
|
+
(async () => await m.changeLanguage(t))();
|
|
45
|
+
}, [t]);
|
|
44
46
|
const u = k(() => {
|
|
45
47
|
if (r.observability?.onError)
|
|
46
|
-
return (
|
|
48
|
+
return (n, e) => {
|
|
47
49
|
if (!r.observability?.onError) return;
|
|
48
50
|
const h = {
|
|
49
|
-
...U(
|
|
51
|
+
...U(n),
|
|
50
52
|
timestamp: Date.now(),
|
|
51
53
|
componentStack: e.componentStack ?? void 0
|
|
52
54
|
}, y = L(h, r.observability.sanitization);
|
|
@@ -62,9 +64,9 @@ const V = (s) => {
|
|
|
62
64
|
queryClient: b,
|
|
63
65
|
children: l
|
|
64
66
|
}
|
|
65
|
-
) },
|
|
67
|
+
) }, t) }) }) }) }) }) });
|
|
66
68
|
};
|
|
67
69
|
export {
|
|
68
|
-
|
|
70
|
+
X as GustoProviderCustomUIAdapter
|
|
69
71
|
};
|
|
70
72
|
//# sourceMappingURL=GustoProviderCustomUIAdapter.js.map
|