@gusto/embedded-react-sdk 0.42.0 → 0.43.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 +27 -0
- package/dist/assets/icons/search-lg.svg.js +10 -0
- package/dist/assets/icons/search-lg.svg.js.map +1 -0
- package/dist/components/Base/Base.js +3 -2
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/DataView/DataCards/DataCards.d.ts +3 -1
- package/dist/components/Common/DataView/DataCards/DataCards.js +55 -45
- package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js +16 -10
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js.map +1 -1
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.js +1 -1
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.js.map +1 -1
- package/dist/components/Common/UI/Box/Box.module.scss.js +4 -4
- package/dist/components/Common/UI/ComboBox/ComboBox.d.ts +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBox.js +26 -25
- package/dist/components/Common/UI/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBoxTypes.d.ts +5 -0
- package/dist/components/Common/UI/DatePicker/DatePicker.js +4 -4
- package/dist/components/Common/UI/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/Common/UI/Menu/Menu.js +18 -17
- package/dist/components/Common/UI/Menu/Menu.js.map +1 -1
- package/dist/components/Common/UI/Menu/MenuTypes.d.ts +5 -0
- package/dist/components/Common/UI/Menu/MenuTypes.js.map +1 -1
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.js +1 -1
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.js.map +1 -1
- package/dist/components/Common/UI/Select/Select.js +9 -9
- package/dist/components/Common/UI/Select/Select.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 +7 -6
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +9 -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 +7 -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 +3 -2
- 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 +7 -6
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +8 -7
- 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 +6 -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 +3 -2
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +7 -6
- 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 +6 -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 +11 -10
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +3 -2
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.d.ts +6 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +30 -27
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +61 -55
- 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 +3 -2
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +40 -38
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.module.scss.js +8 -0
- package/dist/components/Company/Locations/LocationsList/List.module.scss.js.map +1 -0
- 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/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/PayScheduleForm.js +3 -2
- package/dist/components/Company/PaySchedule/PayScheduleForm.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleList.js +3 -2
- package/dist/components/Company/PaySchedule/PayScheduleList.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +6 -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 +7 -6
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +3 -2
- 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 +10 -8
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +3 -2
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/Head.js +10 -8
- package/dist/components/Contractor/Address/Head.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 +42 -41
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +12 -10
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +17 -17
- 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/ContractorProfileForm.js +48 -49
- package/dist/components/Contractor/Profile/ContractorProfileForm.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/Contractor/Submit/SubmitDone.js +14 -12
- package/dist/components/Contractor/Submit/SubmitDone.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +5 -4
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +15 -14
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +6 -5
- 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/DeductionsForm.js +26 -26
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.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 +5 -4
- 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 +36 -34
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +8 -7
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/fields.d.ts +1 -1
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/fields.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/useSignEmployeeForm.js +98 -98
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/useSignEmployeeForm.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/EmployeeList/management/ManagementEmployeeListView.js +3 -2
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js.map +1 -1
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.js +35 -34
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Actions.js +3 -2
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +5 -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/HomeAddress/management/HomeAddressView.js +3 -2
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.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 +6 -5
- 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 +3 -2
- 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 +3 -2
- 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 +121 -127
- package/dist/components/Employee/Profile/AdminProfile.js.map +1 -1
- package/dist/components/Employee/Profile/EmployeeProfile.js +57 -63
- package/dist/components/Employee/Profile/EmployeeProfile.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.d.ts +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js +47 -47
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js.map +1 -1
- package/dist/components/Employee/StateTaxes/Actions.js +7 -6
- 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 +8 -7
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +5 -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/WorkAddress/management/WorkAddressView.js +3 -2
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
- package/dist/components/Flow/FlowHeader.js +3 -2
- package/dist/components/Flow/FlowHeader.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 +11 -10
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +1 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +3 -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/AddEmployeesHoliday/AddEmployeesHoliday.js +6 -41
- package/dist/components/UNSTABLE_TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.d.ts +1 -0
- package/dist/components/UNSTABLE_TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.js +12 -40
- package/dist/components/UNSTABLE_TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.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/PolicySettings/PolicySettings.js +61 -41
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettings.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettings.module.scss.js +6 -8
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettings.module.scss.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettingsPresentation.js +32 -44
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettingsPresentation.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 +59 -50
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/timeOffStateMachine.js +50 -23
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js +26 -25
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +55 -40
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployees.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.d.ts +6 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js +66 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js +82 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentationTypes.d.ts +24 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.d.ts +7 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js +70 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTypes.d.ts +24 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.d.ts +11 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js +56 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/index.d.ts +2 -4
- package/dist/components/UNSTABLE_TimeOff/index.js +19 -21
- package/dist/components/UNSTABLE_TimeOff/index.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/shared/EmployeeTable/EmployeeTable.js +90 -0
- package/dist/components/UNSTABLE_TimeOff/shared/EmployeeTable/EmployeeTable.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/shared/EmployeeTable/EmployeeTable.module.scss.js +10 -0
- package/dist/components/UNSTABLE_TimeOff/shared/EmployeeTable/EmployeeTable.module.scss.js.map +1 -0
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +1 -0
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +27 -25
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/ThemeProvider/ThemeProvider.d.ts +8 -0
- package/dist/contexts/ThemeProvider/ThemeProvider.js +26 -21
- package/dist/contexts/ThemeProvider/ThemeProvider.js.map +1 -1
- package/dist/contexts/ThemeProvider/useTheme.d.ts +1 -1
- package/dist/contexts/ThemeProvider/useTheme.js.map +1 -1
- package/dist/i18n/I18n.js +1 -0
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.Locations.json.js +43 -39
- package/dist/i18n/en/Company.Locations.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js +5 -5
- package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js +22 -0
- package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js.map +1 -0
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js +11 -9
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +17 -15
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js +11 -9
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SelectHookField.js +17 -15
- package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js +15 -13
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js +19 -17
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/withOptions.d.ts +1 -1
- package/dist/partner-hook-utils/form/withOptions.js.map +1 -1
- package/dist/partner-hook-utils/types.d.ts +1 -1
- package/dist/shared/constants.d.ts +2 -0
- package/dist/shared/constants.js +8 -7
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +21 -1
- package/docs/reference/endpoint-inventory.json +169 -30
- package/package.json +6 -6
- package/dist/components/Contractor/Profile/ContractorProfileForm.module.scss.js +0 -8
- package/dist/components/Contractor/Profile/ContractorProfileForm.module.scss.js.map +0 -1
|
@@ -48,4 +48,9 @@ export interface ComboBoxProps extends SharedFieldLayoutProps, Pick<InputHTMLAtt
|
|
|
48
48
|
* The options list becomes a suggestion helper rather than a strict constraint.
|
|
49
49
|
*/
|
|
50
50
|
allowsCustomValue?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Element to use as the portal container for the dropdown popover.
|
|
53
|
+
* Overrides the default SDK root container from context.
|
|
54
|
+
*/
|
|
55
|
+
portalContainer?: HTMLElement;
|
|
51
56
|
}
|
|
@@ -55,9 +55,9 @@ const Cr = ({
|
|
|
55
55
|
inputId: y,
|
|
56
56
|
errorMessage: l,
|
|
57
57
|
description: o
|
|
58
|
-
}), { container: B } = X(),
|
|
59
|
-
const
|
|
60
|
-
return
|
|
58
|
+
}), { container: B } = X(), v = p ? or(p) : "", L = v ? T(v) : null, M = f ? C(f) : void 0, E = h ? C(h) : void 0, G = u ? (e) => {
|
|
59
|
+
const D = N(e);
|
|
60
|
+
return D ? u(D) : !1;
|
|
61
61
|
} : void 0, U = (e) => {
|
|
62
62
|
m && m(N(e));
|
|
63
63
|
};
|
|
@@ -99,7 +99,7 @@ const Cr = ({
|
|
|
99
99
|
Y,
|
|
100
100
|
{
|
|
101
101
|
className: S(i.popover, "react-aria-Popover"),
|
|
102
|
-
UNSTABLE_portalContainer: w
|
|
102
|
+
UNSTABLE_portalContainer: w ?? B.current ?? void 0,
|
|
103
103
|
children: /* @__PURE__ */ r(_, { children: /* @__PURE__ */ n($, { children: [
|
|
104
104
|
/* @__PURE__ */ n("header", { children: [
|
|
105
105
|
/* @__PURE__ */ r(c, { slot: "previous", children: /* @__PURE__ */ r(tr, { title: a("icons.previousMonth") }) }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.js","sources":["../../../../../src/components/Common/UI/DatePicker/DatePicker.tsx"],"sourcesContent":["import {\n DatePicker as AriaDatePicker,\n Button,\n Calendar,\n CalendarCell,\n CalendarGrid,\n DateInput,\n DateSegment,\n Dialog,\n Group,\n Heading,\n Popover,\n type DateValue,\n} from 'react-aria-components'\nimport { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport { parseDate, type CalendarDate } from '@internationalized/date'\nimport { useFieldIds } from '../hooks/useFieldIds'\nimport styles from './DatePicker.module.scss'\nimport type { DatePickerProps } from './DatePickerTypes'\nimport { FieldLayout } from '@/components/Common/FieldLayout'\nimport { useTheme } from '@/contexts/ThemeProvider'\nimport CaretDown from '@/assets/icons/caret-down.svg?react'\nimport CaretRight from '@/assets/icons/caret-right.svg?react'\nimport CaretLeft from '@/assets/icons/caret-left.svg?react'\nimport AlertCircle from '@/assets/icons/alert-circle.svg?react'\nimport { formatDateToStringDate } from '@/helpers/dateFormatting'\n\nfunction dateToCalendarDate(date: Date): CalendarDate | undefined {\n if (!(date instanceof Date) || isNaN(date.getTime())) {\n return undefined\n }\n\n // Use local date parts to avoid UTC timezone shift from toISOString()\n const dateString = [\n String(date.getFullYear()).padStart(4, '0'),\n String(date.getMonth() + 1).padStart(2, '0'),\n String(date.getDate()).padStart(2, '0'),\n ].join('-')\n\n return parseDate(dateString)\n}\n\nfunction calendarDateValueToDate(dateValue: DateValue | null): Date | null {\n if (!dateValue) return null\n\n const date = new Date(\n dateValue.year,\n dateValue.month - 1, // DateValue months are 1-indexed\n dateValue.day,\n )\n\n return date\n}\n\nexport const DatePicker = ({\n className,\n description,\n errorMessage,\n id,\n inputRef,\n isDisabled,\n isInvalid,\n isRequired,\n label,\n onChange,\n onBlur,\n value,\n portalContainer,\n minDate,\n maxDate,\n isDateDisabled,\n ...props\n}: DatePickerProps) => {\n const { t } = useTranslation()\n const { inputId, errorMessageId, descriptionId, ariaDescribedBy } = useFieldIds({\n inputId: id,\n errorMessage,\n description,\n })\n const { container } = useTheme()\n\n // Convert JavaScript Date to DateValue for internal use\n // Format the date as YYYY-MM-DD for parseDate\n const formattedDate = value ? formatDateToStringDate(value) : ''\n const internalValue = formattedDate ? parseDate(formattedDate) : null\n\n // Convert date constraint props to react-aria DateValue format\n const minValue = minDate ? dateToCalendarDate(minDate) : undefined\n const maxValue = maxDate ? dateToCalendarDate(maxDate) : undefined\n const isDateUnavailable = isDateDisabled\n ? (dateValue: DateValue) => {\n const jsDate = calendarDateValueToDate(dateValue)\n return jsDate ? isDateDisabled(jsDate) : false\n }\n : undefined\n\n // Handle internal onChange to convert DateValue back to Date\n const handleChange = (dateValue: DateValue | null) => {\n if (onChange) {\n onChange(calendarDateValueToDate(dateValue))\n }\n }\n\n return (\n <FieldLayout\n label={label}\n htmlFor={inputId}\n errorMessage={errorMessage}\n errorMessageId={errorMessageId}\n descriptionId={descriptionId}\n isRequired={isRequired}\n description={description}\n className={classNames(styles.root, className)}\n withErrorIcon={false}\n >\n <div className={styles.container}>\n <AriaDatePicker\n aria-label={label}\n aria-describedby={ariaDescribedBy}\n id={inputId}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n value={internalValue}\n onChange={handleChange}\n minValue={minValue}\n maxValue={maxValue}\n isDateUnavailable={isDateUnavailable}\n {...props}\n >\n <Group>\n <DateInput ref={inputRef}>{segment => <DateSegment segment={segment} />}</DateInput>\n\n <div className={styles.icons}>\n {isInvalid && <AlertCircle aria-hidden=\"true\" fontSize={16} />}\n <Button onBlur={onBlur}>\n <CaretDown title={t('icons.calendarArrow')} />\n </Button>\n </div>\n </Group>\n <Popover\n className={classNames(styles.popover, 'react-aria-Popover')}\n UNSTABLE_portalContainer={portalContainer
|
|
1
|
+
{"version":3,"file":"DatePicker.js","sources":["../../../../../src/components/Common/UI/DatePicker/DatePicker.tsx"],"sourcesContent":["import {\n DatePicker as AriaDatePicker,\n Button,\n Calendar,\n CalendarCell,\n CalendarGrid,\n DateInput,\n DateSegment,\n Dialog,\n Group,\n Heading,\n Popover,\n type DateValue,\n} from 'react-aria-components'\nimport { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport { parseDate, type CalendarDate } from '@internationalized/date'\nimport { useFieldIds } from '../hooks/useFieldIds'\nimport styles from './DatePicker.module.scss'\nimport type { DatePickerProps } from './DatePickerTypes'\nimport { FieldLayout } from '@/components/Common/FieldLayout'\nimport { useTheme } from '@/contexts/ThemeProvider'\nimport CaretDown from '@/assets/icons/caret-down.svg?react'\nimport CaretRight from '@/assets/icons/caret-right.svg?react'\nimport CaretLeft from '@/assets/icons/caret-left.svg?react'\nimport AlertCircle from '@/assets/icons/alert-circle.svg?react'\nimport { formatDateToStringDate } from '@/helpers/dateFormatting'\n\nfunction dateToCalendarDate(date: Date): CalendarDate | undefined {\n if (!(date instanceof Date) || isNaN(date.getTime())) {\n return undefined\n }\n\n // Use local date parts to avoid UTC timezone shift from toISOString()\n const dateString = [\n String(date.getFullYear()).padStart(4, '0'),\n String(date.getMonth() + 1).padStart(2, '0'),\n String(date.getDate()).padStart(2, '0'),\n ].join('-')\n\n return parseDate(dateString)\n}\n\nfunction calendarDateValueToDate(dateValue: DateValue | null): Date | null {\n if (!dateValue) return null\n\n const date = new Date(\n dateValue.year,\n dateValue.month - 1, // DateValue months are 1-indexed\n dateValue.day,\n )\n\n return date\n}\n\nexport const DatePicker = ({\n className,\n description,\n errorMessage,\n id,\n inputRef,\n isDisabled,\n isInvalid,\n isRequired,\n label,\n onChange,\n onBlur,\n value,\n portalContainer,\n minDate,\n maxDate,\n isDateDisabled,\n ...props\n}: DatePickerProps) => {\n const { t } = useTranslation()\n const { inputId, errorMessageId, descriptionId, ariaDescribedBy } = useFieldIds({\n inputId: id,\n errorMessage,\n description,\n })\n const { container } = useTheme()\n\n // Convert JavaScript Date to DateValue for internal use\n // Format the date as YYYY-MM-DD for parseDate\n const formattedDate = value ? formatDateToStringDate(value) : ''\n const internalValue = formattedDate ? parseDate(formattedDate) : null\n\n // Convert date constraint props to react-aria DateValue format\n const minValue = minDate ? dateToCalendarDate(minDate) : undefined\n const maxValue = maxDate ? dateToCalendarDate(maxDate) : undefined\n const isDateUnavailable = isDateDisabled\n ? (dateValue: DateValue) => {\n const jsDate = calendarDateValueToDate(dateValue)\n return jsDate ? isDateDisabled(jsDate) : false\n }\n : undefined\n\n // Handle internal onChange to convert DateValue back to Date\n const handleChange = (dateValue: DateValue | null) => {\n if (onChange) {\n onChange(calendarDateValueToDate(dateValue))\n }\n }\n\n return (\n <FieldLayout\n label={label}\n htmlFor={inputId}\n errorMessage={errorMessage}\n errorMessageId={errorMessageId}\n descriptionId={descriptionId}\n isRequired={isRequired}\n description={description}\n className={classNames(styles.root, className)}\n withErrorIcon={false}\n >\n <div className={styles.container}>\n <AriaDatePicker\n aria-label={label}\n aria-describedby={ariaDescribedBy}\n id={inputId}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n value={internalValue}\n onChange={handleChange}\n minValue={minValue}\n maxValue={maxValue}\n isDateUnavailable={isDateUnavailable}\n {...props}\n >\n <Group>\n <DateInput ref={inputRef}>{segment => <DateSegment segment={segment} />}</DateInput>\n\n <div className={styles.icons}>\n {isInvalid && <AlertCircle aria-hidden=\"true\" fontSize={16} />}\n <Button onBlur={onBlur}>\n <CaretDown title={t('icons.calendarArrow')} />\n </Button>\n </div>\n </Group>\n <Popover\n className={classNames(styles.popover, 'react-aria-Popover')}\n UNSTABLE_portalContainer={portalContainer ?? container.current ?? undefined}\n >\n <Dialog>\n <Calendar>\n <header>\n <Button slot=\"previous\">\n <CaretLeft title={t('icons.previousMonth')} />\n </Button>\n <Heading />\n <Button slot=\"next\">\n <CaretRight title={t('icons.nextMonth')} />\n </Button>\n </header>\n <CalendarGrid>{date => <CalendarCell date={date} />}</CalendarGrid>\n </Calendar>\n </Dialog>\n </Popover>\n </AriaDatePicker>\n </div>\n </FieldLayout>\n )\n}\n"],"names":["dateToCalendarDate","date","dateString","parseDate","calendarDateValueToDate","dateValue","DatePicker","className","description","errorMessage","id","inputRef","isDisabled","isInvalid","isRequired","label","onChange","onBlur","value","portalContainer","minDate","maxDate","isDateDisabled","props","t","useTranslation","inputId","errorMessageId","descriptionId","ariaDescribedBy","useFieldIds","container","useTheme","formattedDate","formatDateToStringDate","internalValue","minValue","maxValue","isDateUnavailable","jsDate","handleChange","jsx","FieldLayout","classNames","styles","jsxs","AriaDatePicker","Group","DateInput","DateSegment","segment","AlertCircle","Button","CaretDown","Popover","Dialog","Calendar","CaretLeft","Heading","CaretRight","CalendarGrid","CalendarCell"],"mappings":";;;;;;;;;;;;;;;;AA4BA,SAASA,EAAmBC,GAAsC;AAChE,MAAI,EAAEA,aAAgB,SAAS,MAAMA,EAAK,QAAA,CAAS;AACjD;AAIF,QAAMC,IAAa;AAAA,IACjB,OAAOD,EAAK,YAAA,CAAa,EAAE,SAAS,GAAG,GAAG;AAAA,IAC1C,OAAOA,EAAK,SAAA,IAAa,CAAC,EAAE,SAAS,GAAG,GAAG;AAAA,IAC3C,OAAOA,EAAK,QAAA,CAAS,EAAE,SAAS,GAAG,GAAG;AAAA,EAAA,EACtC,KAAK,GAAG;AAEV,SAAOE,EAAUD,CAAU;AAC7B;AAEA,SAASE,EAAwBC,GAA0C;AACzE,SAAKA,IAEQ,IAAI;AAAA,IACfA,EAAU;AAAA,IACVA,EAAU,QAAQ;AAAA;AAAA,IAClBA,EAAU;AAAA,EAAA,IALW;AASzB;AAEO,MAAMC,KAAa,CAAC;AAAA,EACzB,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,IAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,iB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A,CACF;AAAA,cAAA;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MAAA,EACF,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,46 +1,47 @@
|
|
|
1
1
|
import { jsx as o, jsxs as P } from "react/jsx-runtime";
|
|
2
|
-
import { Popover as b, Menu as
|
|
2
|
+
import { Popover as b, Menu as x, MenuItem as I } from "react-aria-components";
|
|
3
3
|
import r from "./Menu.module.scss.js";
|
|
4
|
-
import { MenuDefaults as
|
|
5
|
-
import { applyMissingDefaults as
|
|
4
|
+
import { MenuDefaults as O } from "./MenuTypes.js";
|
|
5
|
+
import { applyMissingDefaults as j } from "../../../../helpers/applyMissingDefaults.js";
|
|
6
6
|
import "react";
|
|
7
|
-
import { useTheme as
|
|
7
|
+
import { useTheme as y } from "../../../../contexts/ThemeProvider/useTheme.js";
|
|
8
8
|
/* empty css */
|
|
9
|
-
function
|
|
10
|
-
const
|
|
9
|
+
function S(a) {
|
|
10
|
+
const s = j(a, O), {
|
|
11
11
|
triggerRef: i,
|
|
12
12
|
items: m,
|
|
13
13
|
isOpen: l,
|
|
14
14
|
onClose: n,
|
|
15
15
|
placement: p,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
portalContainer: c,
|
|
17
|
+
"aria-label": u,
|
|
18
|
+
...f
|
|
19
|
+
} = s, { container: d } = y(), h = (e) => {
|
|
19
20
|
e || n?.();
|
|
20
21
|
};
|
|
21
22
|
return /* @__PURE__ */ o(
|
|
22
23
|
b,
|
|
23
24
|
{
|
|
24
|
-
UNSTABLE_portalContainer:
|
|
25
|
+
UNSTABLE_portalContainer: c ?? d.current ?? void 0,
|
|
25
26
|
onOpenChange: h,
|
|
26
27
|
isOpen: l,
|
|
27
28
|
triggerRef: i,
|
|
28
29
|
placement: p,
|
|
29
30
|
offset: 8,
|
|
30
31
|
shouldUpdatePosition: !0,
|
|
31
|
-
children: /* @__PURE__ */ o(
|
|
32
|
-
|
|
32
|
+
children: /* @__PURE__ */ o(x, { onClose: n, "aria-label": u, className: r.root, ...f, children: m?.map(({ onClick: e, isDisabled: M, href: g, icon: t, label: C, ...v }, N) => /* @__PURE__ */ P(
|
|
33
|
+
I,
|
|
33
34
|
{
|
|
34
35
|
onAction: () => {
|
|
35
36
|
e();
|
|
36
37
|
},
|
|
37
|
-
isDisabled:
|
|
38
|
-
href:
|
|
38
|
+
isDisabled: M,
|
|
39
|
+
href: g,
|
|
39
40
|
className: r.menuItem,
|
|
40
|
-
...
|
|
41
|
+
...v,
|
|
41
42
|
children: [
|
|
42
43
|
t && /* @__PURE__ */ o("div", { className: r.menuIcon, children: t }),
|
|
43
|
-
|
|
44
|
+
C
|
|
44
45
|
]
|
|
45
46
|
},
|
|
46
47
|
N
|
|
@@ -49,6 +50,6 @@ function R(s) {
|
|
|
49
50
|
);
|
|
50
51
|
}
|
|
51
52
|
export {
|
|
52
|
-
|
|
53
|
+
S as Menu
|
|
53
54
|
};
|
|
54
55
|
//# sourceMappingURL=Menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.js","sources":["../../../../../src/components/Common/UI/Menu/Menu.tsx"],"sourcesContent":["import { Menu as AriaMenu, MenuItem as AriaMenuItem, Popover } from 'react-aria-components'\nimport styles from './Menu.module.scss'\nimport { type MenuProps, MenuDefaults } from './MenuTypes'\nimport { applyMissingDefaults } from '@/helpers/applyMissingDefaults'\nimport { useTheme } from '@/contexts/ThemeProvider'\n\nexport function Menu(rawProps: MenuProps) {\n const resolvedProps = applyMissingDefaults(rawProps, MenuDefaults)\n const {\n triggerRef,\n items,\n isOpen,\n onClose,\n placement,\n 'aria-label': ariaLabel,\n ...otherProps\n } = resolvedProps\n const { container } = useTheme()\n\n const handleOpenChange = (isOpen: boolean) => {\n if (!isOpen) {\n onClose?.()\n }\n }\n\n return (\n <Popover\n UNSTABLE_portalContainer={container.current}\n onOpenChange={handleOpenChange}\n isOpen={isOpen}\n triggerRef={triggerRef}\n placement={placement}\n offset={8}\n shouldUpdatePosition={true}\n >\n <AriaMenu onClose={onClose} aria-label={ariaLabel} className={styles.root} {...otherProps}>\n {items?.map(({ onClick, isDisabled, href, icon, label, ...itemProps }, index) => (\n <AriaMenuItem\n key={index}\n onAction={() => {\n onClick()\n }}\n isDisabled={isDisabled}\n href={href}\n className={styles.menuItem}\n {...itemProps}\n >\n {icon && <div className={styles.menuIcon}>{icon}</div>}\n {label}\n </AriaMenuItem>\n ))}\n </AriaMenu>\n </Popover>\n )\n}\n"],"names":["Menu","rawProps","resolvedProps","applyMissingDefaults","MenuDefaults","triggerRef","items","isOpen","onClose","placement","ariaLabel","otherProps","container","useTheme","handleOpenChange","jsx","Popover","AriaMenu","styles","onClick","isDisabled","href","icon","label","itemProps","index","jsxs","AriaMenuItem"],"mappings":";;;;;;;;AAMO,SAASA,EAAKC,GAAqB;AACxC,QAAMC,IAAgBC,EAAqBF,GAAUG,CAAY,GAC3D;AAAA,IACJ,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,SAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAcC;AAAA,IACd,GAAGC;AAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"Menu.js","sources":["../../../../../src/components/Common/UI/Menu/Menu.tsx"],"sourcesContent":["import { Menu as AriaMenu, MenuItem as AriaMenuItem, Popover } from 'react-aria-components'\nimport styles from './Menu.module.scss'\nimport { type MenuProps, MenuDefaults } from './MenuTypes'\nimport { applyMissingDefaults } from '@/helpers/applyMissingDefaults'\nimport { useTheme } from '@/contexts/ThemeProvider'\n\nexport function Menu(rawProps: MenuProps) {\n const resolvedProps = applyMissingDefaults(rawProps, MenuDefaults)\n const {\n triggerRef,\n items,\n isOpen,\n onClose,\n placement,\n portalContainer,\n 'aria-label': ariaLabel,\n ...otherProps\n } = resolvedProps\n const { container } = useTheme()\n\n const handleOpenChange = (isOpen: boolean) => {\n if (!isOpen) {\n onClose?.()\n }\n }\n\n return (\n <Popover\n UNSTABLE_portalContainer={portalContainer ?? container.current ?? undefined}\n onOpenChange={handleOpenChange}\n isOpen={isOpen}\n triggerRef={triggerRef}\n placement={placement}\n offset={8}\n shouldUpdatePosition={true}\n >\n <AriaMenu onClose={onClose} aria-label={ariaLabel} className={styles.root} {...otherProps}>\n {items?.map(({ onClick, isDisabled, href, icon, label, ...itemProps }, index) => (\n <AriaMenuItem\n key={index}\n onAction={() => {\n onClick()\n }}\n isDisabled={isDisabled}\n href={href}\n className={styles.menuItem}\n {...itemProps}\n >\n {icon && <div className={styles.menuIcon}>{icon}</div>}\n {label}\n </AriaMenuItem>\n ))}\n </AriaMenu>\n </Popover>\n )\n}\n"],"names":["Menu","rawProps","resolvedProps","applyMissingDefaults","MenuDefaults","triggerRef","items","isOpen","onClose","placement","portalContainer","ariaLabel","otherProps","container","useTheme","handleOpenChange","jsx","Popover","AriaMenu","styles","onClick","isDisabled","href","icon","label","itemProps","index","jsxs","AriaMenuItem"],"mappings":";;;;;;;;AAMO,SAASA,EAAKC,GAAqB;AACxC,QAAMC,IAAgBC,EAAqBF,GAAUG,CAAY,GAC3D;AAAA,IACJ,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,SAAAC;AAAA,IACA,WAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAcC;AAAA,IACd,GAAGC;AAAA,EAAA,IACDV,GACE,EAAE,WAAAW,EAAA,IAAcC,EAAA,GAEhBC,IAAmB,CAACR,MAAoB;AAC5C,IAAKA,KACHC,IAAA;AAAA,EAEJ;AAEA,SACE,gBAAAQ;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,0BAA0BP,KAAmBG,EAAU,WAAW;AAAA,MAClE,cAAcE;AAAA,MACd,QAAAR;AAAA,MACA,YAAAF;AAAA,MACA,WAAAI;AAAA,MACA,QAAQ;AAAA,MACR,sBAAsB;AAAA,MAEtB,UAAA,gBAAAO,EAACE,KAAS,SAAAV,GAAkB,cAAYG,GAAW,WAAWQ,EAAO,MAAO,GAAGP,GAC5E,UAAAN,GAAO,IAAI,CAAC,EAAE,SAAAc,GAAS,YAAAC,GAAY,MAAAC,GAAM,MAAAC,GAAM,OAAAC,GAAO,GAAGC,EAAA,GAAaC,MACrE,gBAAAC;AAAA,QAACC;AAAAA,QAAA;AAAA,UAEC,UAAU,MAAM;AACd,YAAAR,EAAA;AAAA,UACF;AAAA,UACA,YAAAC;AAAA,UACA,MAAAC;AAAA,UACA,WAAWH,EAAO;AAAA,UACjB,GAAGM;AAAA,UAEH,UAAA;AAAA,YAAAF,KAAQ,gBAAAP,EAAC,OAAA,EAAI,WAAWG,EAAO,UAAW,UAAAI,GAAK;AAAA,YAC/CC;AAAA,UAAA;AAAA,QAAA;AAAA,QAVIE;AAAA,MAAA,CAYR,EAAA,CACH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -43,6 +43,11 @@ export interface MenuProps extends DataAttributes {
|
|
|
43
43
|
* Accessible label describing the menu's purpose
|
|
44
44
|
*/
|
|
45
45
|
'aria-label': string;
|
|
46
|
+
/**
|
|
47
|
+
* Element to use as the portal container for the menu popover.
|
|
48
|
+
* Overrides the default SDK root container from context.
|
|
49
|
+
*/
|
|
50
|
+
portalContainer?: HTMLElement;
|
|
46
51
|
/**
|
|
47
52
|
* Controls the placement of the menu popover relative to the trigger
|
|
48
53
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuTypes.js","sources":["../../../../../src/components/Common/UI/Menu/MenuTypes.ts"],"sourcesContent":["import type { ReactNode, RefObject } from 'react'\nimport type { DataAttributes } from '@/types/Helpers'\n\nexport interface MenuItem extends DataAttributes {\n /**\n * Text label for the menu item\n */\n label: string\n /**\n * Optional icon to display before the label\n */\n icon?: ReactNode\n /**\n * Callback function when the menu item is clicked\n */\n onClick: () => void\n /**\n * Disables the menu item and prevents interaction\n */\n isDisabled?: boolean\n /**\n * Optional URL to navigate to when clicked\n */\n href?: string\n}\n\nexport interface MenuProps extends DataAttributes {\n /**\n * Reference to the element that triggers the menu\n */\n triggerRef?: RefObject<Element | null>\n /**\n * Array of menu items to display\n */\n items?: MenuItem[]\n /**\n * Controls whether the menu is currently open\n */\n isOpen?: boolean\n /**\n * Callback when the menu is closed\n */\n onClose?: () => void\n /**\n * Accessible label describing the menu's purpose\n */\n 'aria-label': string\n /**\n * Controls the placement of the menu popover relative to the trigger\n */\n placement?:\n | 'top'\n | 'top start'\n | 'top end'\n | 'bottom'\n | 'bottom start'\n | 'bottom end'\n | 'left'\n | 'right'\n}\n\n/**\n * Default prop values for Menu component.\n */\nexport const MenuDefaults = {\n isOpen: false,\n placement: 'bottom start',\n} as const satisfies Partial<MenuProps>\n"],"names":["MenuDefaults"],"mappings":"
|
|
1
|
+
{"version":3,"file":"MenuTypes.js","sources":["../../../../../src/components/Common/UI/Menu/MenuTypes.ts"],"sourcesContent":["import type { ReactNode, RefObject } from 'react'\nimport type { DataAttributes } from '@/types/Helpers'\n\nexport interface MenuItem extends DataAttributes {\n /**\n * Text label for the menu item\n */\n label: string\n /**\n * Optional icon to display before the label\n */\n icon?: ReactNode\n /**\n * Callback function when the menu item is clicked\n */\n onClick: () => void\n /**\n * Disables the menu item and prevents interaction\n */\n isDisabled?: boolean\n /**\n * Optional URL to navigate to when clicked\n */\n href?: string\n}\n\nexport interface MenuProps extends DataAttributes {\n /**\n * Reference to the element that triggers the menu\n */\n triggerRef?: RefObject<Element | null>\n /**\n * Array of menu items to display\n */\n items?: MenuItem[]\n /**\n * Controls whether the menu is currently open\n */\n isOpen?: boolean\n /**\n * Callback when the menu is closed\n */\n onClose?: () => void\n /**\n * Accessible label describing the menu's purpose\n */\n 'aria-label': string\n /**\n * Element to use as the portal container for the menu popover.\n * Overrides the default SDK root container from context.\n */\n portalContainer?: HTMLElement\n /**\n * Controls the placement of the menu popover relative to the trigger\n */\n placement?:\n | 'top'\n | 'top start'\n | 'top end'\n | 'bottom'\n | 'bottom start'\n | 'bottom end'\n | 'left'\n | 'right'\n}\n\n/**\n * Default prop values for Menu component.\n */\nexport const MenuDefaults = {\n isOpen: false,\n placement: 'bottom start',\n} as const satisfies Partial<MenuProps>\n"],"names":["MenuDefaults"],"mappings":"AAqEO,MAAMA,IAAe;AAAA,EAC1B,QAAQ;AAAA,EACR,WAAW;AACb;"}
|
|
@@ -111,7 +111,7 @@ function ye({
|
|
|
111
111
|
Z,
|
|
112
112
|
{
|
|
113
113
|
className: N(i.popover, "react-aria-Popover"),
|
|
114
|
-
UNSTABLE_portalContainer: z.current,
|
|
114
|
+
UNSTABLE_portalContainer: z.current ?? void 0,
|
|
115
115
|
maxHeight: 320,
|
|
116
116
|
children: /* @__PURE__ */ t($, { layout: V, children: /* @__PURE__ */ t(ee, { items: H, children: (e) => /* @__PURE__ */ t(te, { children: e.name }, e.id) }) })
|
|
117
117
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelectComboBox.js","sources":["../../../../../src/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.tsx"],"sourcesContent":["import { useCallback, useMemo, useRef, useState } from 'react'\nimport type { Key } from 'react-aria-components'\nimport {\n ComboBox as AriaComboBox,\n Button,\n Input,\n ListBox,\n ListBoxItem,\n ListLayout,\n Popover,\n Virtualizer,\n} from 'react-aria-components'\nimport classNames from 'classnames'\nimport { useTranslation } from 'react-i18next'\nimport { useFieldIds } from '../hooks/useFieldIds'\nimport styles from './MultiSelectComboBox.module.scss'\nimport type { MultiSelectComboBoxProps } from './MultiSelectComboBoxTypes'\nimport { FieldLayout } from '@/components/Common/FieldLayout'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useTheme } from '@/contexts/ThemeProvider'\nimport { useForkRef } from '@/hooks/useForkRef/useForkRef'\nimport AlertCircle from '@/assets/icons/alert-circle.svg?react'\nimport CaretDown from '@/assets/icons/caret-down.svg?react'\n\nexport function MultiSelectComboBox({\n className,\n description,\n errorMessage,\n id,\n inputRef: inputRefFromProps,\n isDisabled,\n isInvalid,\n isLoading,\n isRequired,\n label,\n name,\n onBlur,\n onChange,\n options,\n placeholder,\n value: selectedValues = [],\n shouldVisuallyHideLabel,\n}: MultiSelectComboBoxProps) {\n const Components = useComponentContext()\n const { t } = useTranslation('common')\n const { container } = useTheme()\n const [inputValue, setInputValue] = useState('')\n const blurTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null)\n const internalInputRef = useRef<HTMLInputElement>(null)\n const inputRef = useForkRef(inputRefFromProps, internalInputRef)\n\n const handleInputBlur = useCallback(() => {\n blurTimeoutRef.current = setTimeout(() => {\n blurTimeoutRef.current = null\n onBlur?.()\n }, 50)\n }, [onBlur])\n\n const handleInputFocus = useCallback(() => {\n if (blurTimeoutRef.current) {\n clearTimeout(blurTimeoutRef.current)\n blurTimeoutRef.current = null\n }\n }, [])\n\n const selectedSet = useMemo(() => new Set(selectedValues), [selectedValues])\n\n const availableOptions = useMemo(\n () =>\n options\n .filter(option => !selectedSet.has(option.value))\n .map(option => ({\n label: option.label,\n value: option.value,\n })),\n [options, selectedSet],\n )\n\n const selectedOptions = useMemo(\n () => options.filter(option => selectedSet.has(option.value)),\n [options, selectedSet],\n )\n\n const items = useMemo(\n () => availableOptions.map(option => ({ name: option.label, id: option.value })),\n [availableOptions],\n )\n\n const handleSelectionChange = useCallback(\n (key: Key | null) => {\n if (!key) return\n onChange?.([...selectedValues, key.toString()])\n setInputValue('')\n internalInputRef.current?.blur()\n },\n [selectedValues, onChange],\n )\n\n const handleDismiss = useCallback(\n (value: string) => {\n onChange?.(selectedValues.filter(v => v !== value))\n },\n [selectedValues, onChange],\n )\n\n const loadingDescription = isLoading ? t('status.loadingOptions') : undefined\n const displayDescription = loadingDescription ?? description\n\n const { inputId, errorMessageId, descriptionId, ariaDescribedBy } = useFieldIds({\n inputId: id,\n errorMessage,\n description: displayDescription,\n })\n\n return (\n <div className={classNames(styles.root, className)}>\n <FieldLayout\n label={label}\n htmlFor={inputId}\n errorMessage={errorMessage}\n errorMessageId={errorMessageId}\n descriptionId={descriptionId}\n isRequired={isRequired}\n description={displayDescription}\n shouldVisuallyHideLabel={shouldVisuallyHideLabel}\n className={styles.comboBoxField}\n withErrorIcon={false}\n >\n <AriaComboBox\n aria-label={label}\n aria-describedby={ariaDescribedBy}\n className={'react-aria-ComboBox-root'}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n menuTrigger=\"focus\"\n inputValue={inputValue}\n onInputChange={setInputValue}\n selectedKey={null}\n onSelectionChange={handleSelectionChange}\n id={inputId}\n name={name}\n >\n <Input\n ref={inputRef}\n placeholder={placeholder}\n onBlur={handleInputBlur}\n onFocus={handleInputFocus}\n />\n <Button>\n <div aria-hidden=\"true\" className={styles.icons}>\n {isInvalid && <AlertCircle fontSize={16} />}\n <CaretDown title={t('icons.selectArrow')} />\n </div>\n </Button>\n\n <Popover\n className={classNames(styles.popover, 'react-aria-Popover')}\n UNSTABLE_portalContainer={container.current}\n maxHeight={320}\n >\n <Virtualizer layout={ListLayout}>\n <ListBox items={items}>\n {item => <ListBoxItem key={item.id}>{item.name}</ListBoxItem>}\n </ListBox>\n </Virtualizer>\n </Popover>\n </AriaComboBox>\n </FieldLayout>\n\n {selectedOptions.length > 0 && (\n <div className={styles.chips} role=\"list\" aria-label={t('labels.selectedItems', { label })}>\n {selectedOptions.map(option => (\n <span key={option.value} role=\"listitem\">\n <Components.Badge\n status=\"info\"\n onDismiss={() => {\n handleDismiss(option.value)\n }}\n dismissAriaLabel={t('labels.removeItem', { label: option.label })}\n isDisabled={isDisabled}\n >\n {option.label}\n </Components.Badge>\n </span>\n ))}\n </div>\n )}\n </div>\n )\n}\n"],"names":["MultiSelectComboBox","className","description","errorMessage","id","inputRefFromProps","isDisabled","isInvalid","isLoading","isRequired","label","name","onBlur","onChange","options","placeholder","selectedValues","shouldVisuallyHideLabel","Components","useComponentContext","t","useTranslation","container","useTheme","inputValue","setInputValue","useState","blurTimeoutRef","useRef","internalInputRef","inputRef","useForkRef","handleInputBlur","useCallback","handleInputFocus","selectedSet","useMemo","availableOptions","option","selectedOptions","items","handleSelectionChange","key","handleDismiss","value","v","displayDescription","inputId","errorMessageId","descriptionId","ariaDescribedBy","useFieldIds","classNames","styles","jsx","FieldLayout","jsxs","AriaComboBox","Input","Button","AlertCircle","CaretDown","Popover","Virtualizer","ListLayout","ListBox","item","ListBoxItem"],"mappings":";;;;;;;;;;;;;;AAwBO,SAASA,GAAoB;AAAA,EAClC,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,IAAAC;AAAA,EACA,UAAUC;AAAA,EACV,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAOC,IAAiB,CAAA;AAAA,EACxB,yBAAAC;AACF,GAA6B;AAC3B,QAAMC,IAAaC,GAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,GAAe,QAAQ,GAC/B,EAAE,WAAAC,EAAA,IAAcC,GAAA,GAChB,CAACC,GAAYC,CAAa,IAAIC,EAAS,EAAE,GACzCC,IAAiBC,EAA6C,IAAI,GAClEC,IAAmBD,EAAyB,IAAI,GAChDE,IAAWC,GAAW1B,GAAmBwB,CAAgB,GAEzDG,IAAkBC,EAAY,MAAM;AACxC,IAAAN,EAAe,UAAU,WAAW,MAAM;AACxC,MAAAA,EAAe,UAAU,MACzBf,IAAA;AAAA,IACF,GAAG,EAAE;AAAA,EACP,GAAG,CAACA,CAAM,CAAC,GAELsB,IAAmBD,EAAY,MAAM;AACzC,IAAIN,EAAe,YACjB,aAAaA,EAAe,OAAO,GACnCA,EAAe,UAAU;AAAA,EAE7B,GAAG,CAAA,CAAE,GAECQ,IAAcC,EAAQ,MAAM,IAAI,IAAIpB,CAAc,GAAG,CAACA,CAAc,CAAC,GAErEqB,IAAmBD;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KAAA,GAAfA,EAAK,EAAe,GACjD,EAAA,CACF;AAAA,gBAAA;AAAA,cAAA;AAAA,YACF;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,IAGD3B,EAAgB,SAAS,KACxB,gBAAAe,EAAC,SAAI,WAAWD,EAAO,OAAO,MAAK,QAAO,cAAYjC,EAAE,wBAAwB,EAAE,OAAAV,EAAA,CAAO,GACtF,UAAA6B,EAAgB,IAAI,CAAAD,MACnB,gBAAAgB,EAAC,QAAA,EAAwB,MAAK,YAC5B,UAAA,gBAAAA;AAAA,MAACpC,EAAW;AAAA,MAAX;AAAA,QACC,QAAO;AAAA,QACP,WAAW,MAAM;AACf,UAAAyB,EAAcL,EAAO,KAAK;AAAA,QAC5B;AAAA,QACA,kBAAkBlB,EAAE,qBAAqB,EAAE,OAAOkB,EAAO,OAAO;AAAA,QAChE,YAAAhC;AAAA,QAEC,UAAAgC,EAAO;AAAA,MAAA;AAAA,IAAA,KATDA,EAAO,KAWlB,CACD,EAAA,CACH;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"MultiSelectComboBox.js","sources":["../../../../../src/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.tsx"],"sourcesContent":["import { useCallback, useMemo, useRef, useState } from 'react'\nimport type { Key } from 'react-aria-components'\nimport {\n ComboBox as AriaComboBox,\n Button,\n Input,\n ListBox,\n ListBoxItem,\n ListLayout,\n Popover,\n Virtualizer,\n} from 'react-aria-components'\nimport classNames from 'classnames'\nimport { useTranslation } from 'react-i18next'\nimport { useFieldIds } from '../hooks/useFieldIds'\nimport styles from './MultiSelectComboBox.module.scss'\nimport type { MultiSelectComboBoxProps } from './MultiSelectComboBoxTypes'\nimport { FieldLayout } from '@/components/Common/FieldLayout'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useTheme } from '@/contexts/ThemeProvider'\nimport { useForkRef } from '@/hooks/useForkRef/useForkRef'\nimport AlertCircle from '@/assets/icons/alert-circle.svg?react'\nimport CaretDown from '@/assets/icons/caret-down.svg?react'\n\nexport function MultiSelectComboBox({\n className,\n description,\n errorMessage,\n id,\n inputRef: inputRefFromProps,\n isDisabled,\n isInvalid,\n isLoading,\n isRequired,\n label,\n name,\n onBlur,\n onChange,\n options,\n placeholder,\n value: selectedValues = [],\n shouldVisuallyHideLabel,\n}: MultiSelectComboBoxProps) {\n const Components = useComponentContext()\n const { t } = useTranslation('common')\n const { container } = useTheme()\n const [inputValue, setInputValue] = useState('')\n const blurTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null)\n const internalInputRef = useRef<HTMLInputElement>(null)\n const inputRef = useForkRef(inputRefFromProps, internalInputRef)\n\n const handleInputBlur = useCallback(() => {\n blurTimeoutRef.current = setTimeout(() => {\n blurTimeoutRef.current = null\n onBlur?.()\n }, 50)\n }, [onBlur])\n\n const handleInputFocus = useCallback(() => {\n if (blurTimeoutRef.current) {\n clearTimeout(blurTimeoutRef.current)\n blurTimeoutRef.current = null\n }\n }, [])\n\n const selectedSet = useMemo(() => new Set(selectedValues), [selectedValues])\n\n const availableOptions = useMemo(\n () =>\n options\n .filter(option => !selectedSet.has(option.value))\n .map(option => ({\n label: option.label,\n value: option.value,\n })),\n [options, selectedSet],\n )\n\n const selectedOptions = useMemo(\n () => options.filter(option => selectedSet.has(option.value)),\n [options, selectedSet],\n )\n\n const items = useMemo(\n () => availableOptions.map(option => ({ name: option.label, id: option.value })),\n [availableOptions],\n )\n\n const handleSelectionChange = useCallback(\n (key: Key | null) => {\n if (!key) return\n onChange?.([...selectedValues, key.toString()])\n setInputValue('')\n internalInputRef.current?.blur()\n },\n [selectedValues, onChange],\n )\n\n const handleDismiss = useCallback(\n (value: string) => {\n onChange?.(selectedValues.filter(v => v !== value))\n },\n [selectedValues, onChange],\n )\n\n const loadingDescription = isLoading ? t('status.loadingOptions') : undefined\n const displayDescription = loadingDescription ?? description\n\n const { inputId, errorMessageId, descriptionId, ariaDescribedBy } = useFieldIds({\n inputId: id,\n errorMessage,\n description: displayDescription,\n })\n\n return (\n <div className={classNames(styles.root, className)}>\n <FieldLayout\n label={label}\n htmlFor={inputId}\n errorMessage={errorMessage}\n errorMessageId={errorMessageId}\n descriptionId={descriptionId}\n isRequired={isRequired}\n description={displayDescription}\n shouldVisuallyHideLabel={shouldVisuallyHideLabel}\n className={styles.comboBoxField}\n withErrorIcon={false}\n >\n <AriaComboBox\n aria-label={label}\n aria-describedby={ariaDescribedBy}\n className={'react-aria-ComboBox-root'}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n menuTrigger=\"focus\"\n inputValue={inputValue}\n onInputChange={setInputValue}\n selectedKey={null}\n onSelectionChange={handleSelectionChange}\n id={inputId}\n name={name}\n >\n <Input\n ref={inputRef}\n placeholder={placeholder}\n onBlur={handleInputBlur}\n onFocus={handleInputFocus}\n />\n <Button>\n <div aria-hidden=\"true\" className={styles.icons}>\n {isInvalid && <AlertCircle fontSize={16} />}\n <CaretDown title={t('icons.selectArrow')} />\n </div>\n </Button>\n\n <Popover\n className={classNames(styles.popover, 'react-aria-Popover')}\n UNSTABLE_portalContainer={container.current ?? undefined}\n maxHeight={320}\n >\n <Virtualizer layout={ListLayout}>\n <ListBox items={items}>\n {item => <ListBoxItem key={item.id}>{item.name}</ListBoxItem>}\n </ListBox>\n </Virtualizer>\n </Popover>\n </AriaComboBox>\n </FieldLayout>\n\n {selectedOptions.length > 0 && (\n <div className={styles.chips} role=\"list\" aria-label={t('labels.selectedItems', { label })}>\n {selectedOptions.map(option => (\n <span key={option.value} role=\"listitem\">\n <Components.Badge\n status=\"info\"\n onDismiss={() => {\n handleDismiss(option.value)\n }}\n dismissAriaLabel={t('labels.removeItem', { label: option.label })}\n isDisabled={isDisabled}\n >\n {option.label}\n </Components.Badge>\n </span>\n ))}\n </div>\n )}\n </div>\n )\n}\n"],"names":["MultiSelectComboBox","className","description","errorMessage","id","inputRefFromProps","isDisabled","isInvalid","isLoading","isRequired","label","name","onBlur","onChange","options","placeholder","selectedValues","shouldVisuallyHideLabel","Components","useComponentContext","t","useTranslation","container","useTheme","inputValue","setInputValue","useState","blurTimeoutRef","useRef","internalInputRef","inputRef","useForkRef","handleInputBlur","useCallback","handleInputFocus","selectedSet","useMemo","availableOptions","option","selectedOptions","items","handleSelectionChange","key","handleDismiss","value","v","displayDescription","inputId","errorMessageId","descriptionId","ariaDescribedBy","useFieldIds","classNames","styles","jsx","FieldLayout","jsxs","AriaComboBox","Input","Button","AlertCircle","CaretDown","Popover","Virtualizer","ListLayout","ListBox","item","ListBoxItem"],"mappings":";;;;;;;;;;;;;;AAwBO,SAASA,GAAoB;AAAA,EAClC,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,IAAAC;AAAA,EACA,UAAUC;AAAA,EACV,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAOC,IAAiB,CAAA;AAAA,EACxB,yBAAAC;AACF,GAA6B;AAC3B,QAAMC,IAAaC,GAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,GAAe,QAAQ,GAC/B,EAAE,WAAAC,EAAA,IAAcC,GAAA,GAChB,CAACC,GAAYC,CAAa,IAAIC,EAAS,EAAE,GACzCC,IAAiBC,EAA6C,IAAI,GAClEC,IAAmBD,EAAyB,IAAI,GAChDE,IAAWC,GAAW1B,GAAmBwB,CAAgB,GAEzDG,IAAkBC,EAAY,MAAM;AACxC,IAAAN,EAAe,UAAU,WAAW,MAAM;AACxC,MAAAA,EAAe,UAAU,MACzBf,IAAA;AAAA,IACF,GAAG,EAAE;AAAA,EACP,GAAG,CAACA,CAAM,CAAC,GAELsB,IAAmBD,EAAY,MAAM;AACzC,IAAIN,EAAe,YACjB,aAAaA,EAAe,OAAO,GACnCA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X,UAAA,gBAAAgC,EAACS,GAAA,EAAY,QAAQC,GACnB,4BAACC,IAAA,EAAQ,OAAAzB,GACN,UAAA,CAAA0B,MAAQ,gBAAAZ,EAACa,MAA2B,UAAAD,EAAK,KAAA,GAAfA,EAAK,EAAe,GACjD,EAAA,CACF;AAAA,gBAAA;AAAA,cAAA;AAAA,YACF;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,IAGD3B,EAAgB,SAAS,KACxB,gBAAAe,EAAC,SAAI,WAAWD,EAAO,OAAO,MAAK,QAAO,cAAYjC,EAAE,wBAAwB,EAAE,OAAAV,EAAA,CAAO,GACtF,UAAA6B,EAAgB,IAAI,CAAAD,MACnB,gBAAAgB,EAAC,QAAA,EAAwB,MAAK,YAC5B,UAAA,gBAAAA;AAAA,MAACpC,EAAW;AAAA,MAAX;AAAA,QACC,QAAO;AAAA,QACP,WAAW,MAAM;AACf,UAAAyB,EAAcL,EAAO,KAAK;AAAA,QAC5B;AAAA,QACA,kBAAkBlB,EAAE,qBAAqB,EAAE,OAAOkB,EAAO,OAAO;AAAA,QAChE,YAAAhC;AAAA,QAEC,UAAAgC,EAAO;AAAA,MAAA;AAAA,IAAA,KATDA,EAAO,KAWlB,CACD,EAAA,CACH;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -19,13 +19,13 @@ const te = ({
|
|
|
19
19
|
isRequired: h,
|
|
20
20
|
label: m,
|
|
21
21
|
onChange: S,
|
|
22
|
-
onBlur:
|
|
22
|
+
onBlur: v,
|
|
23
23
|
options: s,
|
|
24
24
|
placeholder: c,
|
|
25
25
|
value: l,
|
|
26
|
-
shouldVisuallyHideLabel:
|
|
27
|
-
name:
|
|
28
|
-
className:
|
|
26
|
+
shouldVisuallyHideLabel: x,
|
|
27
|
+
name: I,
|
|
28
|
+
className: g,
|
|
29
29
|
inputRef: B,
|
|
30
30
|
portalContainer: C,
|
|
31
31
|
...N
|
|
@@ -45,8 +45,8 @@ const te = ({
|
|
|
45
45
|
descriptionId: w,
|
|
46
46
|
isRequired: h,
|
|
47
47
|
description: i,
|
|
48
|
-
shouldVisuallyHideLabel:
|
|
49
|
-
className: p(o.root, "react-aria-CustomSelect",
|
|
48
|
+
shouldVisuallyHideLabel: x,
|
|
49
|
+
className: p(o.root, "react-aria-CustomSelect", g),
|
|
50
50
|
withErrorIcon: !1,
|
|
51
51
|
...N,
|
|
52
52
|
children: /* @__PURE__ */ t(
|
|
@@ -58,11 +58,11 @@ const te = ({
|
|
|
58
58
|
onSelectionChange: (e) => {
|
|
59
59
|
e && S?.(e.toString());
|
|
60
60
|
},
|
|
61
|
-
onBlur:
|
|
61
|
+
onBlur: v,
|
|
62
62
|
id: d,
|
|
63
63
|
selectedKey: l || null,
|
|
64
64
|
"aria-describedby": A,
|
|
65
|
-
name:
|
|
65
|
+
name: I,
|
|
66
66
|
children: [
|
|
67
67
|
/* @__PURE__ */ t(D, { ref: B, children: [
|
|
68
68
|
/* @__PURE__ */ r(E, { children: ({ defaultChildren: e, isPlaceholder: T }) => T && c ? c : e }),
|
|
@@ -75,7 +75,7 @@ const te = ({
|
|
|
75
75
|
P,
|
|
76
76
|
{
|
|
77
77
|
className: p(o.popover, "react-aria-Popover"),
|
|
78
|
-
UNSTABLE_portalContainer: C
|
|
78
|
+
UNSTABLE_portalContainer: C ?? y.current ?? void 0,
|
|
79
79
|
maxHeight: 320,
|
|
80
80
|
children: /* @__PURE__ */ r(z, { items: F, children: (e) => /* @__PURE__ */ r(H, { children: e.name }, e.id) })
|
|
81
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sources":["../../../../../src/components/Common/UI/Select/Select.tsx"],"sourcesContent":["import type { Key } from 'react-aria-components'\nimport {\n Select as AriaSelect,\n Button,\n ListBox,\n ListBoxItem,\n Popover,\n SelectValue,\n} from 'react-aria-components'\nimport { useTranslation } from 'react-i18next'\nimport { useMemo } from 'react'\nimport classNames from 'classnames'\nimport { useFieldIds } from '../hooks/useFieldIds'\nimport styles from './Select.module.scss'\nimport type { SelectProps } from './SelectTypes'\nimport { FieldLayout } from '@/components/Common/FieldLayout'\nimport CaretDown from '@/assets/icons/caret-down.svg?react'\nimport AlertCircle from '@/assets/icons/alert-circle.svg?react'\nimport { useTheme } from '@/contexts/ThemeProvider'\n\nexport const Select = ({\n description,\n errorMessage,\n id,\n isDisabled,\n isInvalid,\n isRequired,\n label,\n onChange,\n onBlur,\n options,\n placeholder,\n value,\n shouldVisuallyHideLabel,\n name,\n className,\n inputRef,\n portalContainer,\n ...props\n}: SelectProps) => {\n const { t } = useTranslation()\n const { container } = useTheme()\n const { inputId, errorMessageId, descriptionId, ariaDescribedBy } = useFieldIds({\n inputId: id,\n errorMessage,\n description,\n })\n\n const items = useMemo(() => {\n return options.map(o => ({ name: o.label, id: o.value }))\n }, [options])\n\n return (\n <FieldLayout\n label={label}\n htmlFor={inputId}\n errorMessage={errorMessage}\n errorMessageId={errorMessageId}\n descriptionId={descriptionId}\n isRequired={isRequired}\n description={description}\n shouldVisuallyHideLabel={shouldVisuallyHideLabel}\n className={classNames(styles.root, 'react-aria-CustomSelect', className)}\n withErrorIcon={false}\n {...props}\n >\n <AriaSelect\n aria-label={label}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n onSelectionChange={key => {\n if (key) {\n onChange?.(key.toString())\n }\n }}\n onBlur={onBlur}\n id={inputId}\n selectedKey={value ? (value as Key) : null}\n aria-describedby={ariaDescribedBy}\n name={name}\n >\n <Button ref={inputRef}>\n <SelectValue>\n {({ defaultChildren, isPlaceholder }) => {\n return isPlaceholder && placeholder ? placeholder : defaultChildren\n }}\n </SelectValue>\n <div className={styles.icons} aria-hidden=\"true\">\n {isInvalid && <AlertCircle fontSize={16} />}\n <CaretDown title={t('icons.selectArrow')} />\n </div>\n </Button>\n <Popover\n className={classNames(styles.popover, 'react-aria-Popover')}\n UNSTABLE_portalContainer={portalContainer
|
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../../../../src/components/Common/UI/Select/Select.tsx"],"sourcesContent":["import type { Key } from 'react-aria-components'\nimport {\n Select as AriaSelect,\n Button,\n ListBox,\n ListBoxItem,\n Popover,\n SelectValue,\n} from 'react-aria-components'\nimport { useTranslation } from 'react-i18next'\nimport { useMemo } from 'react'\nimport classNames from 'classnames'\nimport { useFieldIds } from '../hooks/useFieldIds'\nimport styles from './Select.module.scss'\nimport type { SelectProps } from './SelectTypes'\nimport { FieldLayout } from '@/components/Common/FieldLayout'\nimport CaretDown from '@/assets/icons/caret-down.svg?react'\nimport AlertCircle from '@/assets/icons/alert-circle.svg?react'\nimport { useTheme } from '@/contexts/ThemeProvider'\n\nexport const Select = ({\n description,\n errorMessage,\n id,\n isDisabled,\n isInvalid,\n isRequired,\n label,\n onChange,\n onBlur,\n options,\n placeholder,\n value,\n shouldVisuallyHideLabel,\n name,\n className,\n inputRef,\n portalContainer,\n ...props\n}: SelectProps) => {\n const { t } = useTranslation()\n const { container } = useTheme()\n const { inputId, errorMessageId, descriptionId, ariaDescribedBy } = useFieldIds({\n inputId: id,\n errorMessage,\n description,\n })\n\n const items = useMemo(() => {\n return options.map(o => ({ name: o.label, id: o.value }))\n }, [options])\n\n return (\n <FieldLayout\n label={label}\n htmlFor={inputId}\n errorMessage={errorMessage}\n errorMessageId={errorMessageId}\n descriptionId={descriptionId}\n isRequired={isRequired}\n description={description}\n shouldVisuallyHideLabel={shouldVisuallyHideLabel}\n className={classNames(styles.root, 'react-aria-CustomSelect', className)}\n withErrorIcon={false}\n {...props}\n >\n <AriaSelect\n aria-label={label}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n onSelectionChange={key => {\n if (key) {\n onChange?.(key.toString())\n }\n }}\n onBlur={onBlur}\n id={inputId}\n selectedKey={value ? (value as Key) : null}\n aria-describedby={ariaDescribedBy}\n name={name}\n >\n <Button ref={inputRef}>\n <SelectValue>\n {({ defaultChildren, isPlaceholder }) => {\n return isPlaceholder && placeholder ? placeholder : defaultChildren\n }}\n </SelectValue>\n <div className={styles.icons} aria-hidden=\"true\">\n {isInvalid && <AlertCircle fontSize={16} />}\n <CaretDown title={t('icons.selectArrow')} />\n </div>\n </Button>\n <Popover\n className={classNames(styles.popover, 'react-aria-Popover')}\n UNSTABLE_portalContainer={portalContainer ?? container.current ?? undefined}\n maxHeight={320}\n >\n <ListBox items={items}>\n {item => <ListBoxItem key={item.id}>{item.name}</ListBoxItem>}\n </ListBox>\n </Popover>\n </AriaSelect>\n </FieldLayout>\n )\n}\n"],"names":["Select","description","errorMessage","id","isDisabled","isInvalid","isRequired","label","onChange","onBlur","options","placeholder","value","shouldVisuallyHideLabel","name","className","inputRef","portalContainer","props","t","useTranslation","container","useTheme","inputId","errorMessageId","descriptionId","ariaDescribedBy","useFieldIds","items","useMemo","o","jsx","FieldLayout","classNames","styles","jsxs","AriaSelect","key","Button","SelectValue","defaultChildren","isPlaceholder","AlertCircle","CaretDown","Popover","ListBox","item","ListBoxItem"],"mappings":";;;;;;;;;;;;AAoBO,MAAMA,KAAS,CAAC;AAAA,EACrB,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,IAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAC;AAAA,EACA,yBAAAC;AAAA,EACA,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,GAAGC;AACL,MAAmB;AACjB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACR,EAAE,WAAAC,EAAA,IAAcC,EAAA,GAChB,EAAE,SAAAC,GAAS,gBAAAC,GAAgB,eAAAC,GAAe,iBAAAC,EAAA,IAAoBC,EAAY;AAAA,IAC9E,SAASxB;AAAA,IACT,cAAAD;AAAA,IACA,aAAAD;AAAA,EAAA,CACD,GAEK2B,IAAQC,EAAQ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oB;AAAA,gBAC1D,0BAA0BjB,KAAmBI,EAAU,WAAW;AAAA,gBAClE,WAAW;AAAA,gBAEX,UAAA,gBAAAU,EAACc,GAAA,EAAQ,OAAAjB,GACN,UAAA,CAAAkB,MAAQ,gBAAAf,EAACgB,KAA2B,UAAAD,EAAK,KAAA,GAAfA,EAAK,EAAe,EAAA,CACjD;AAAA,cAAA;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { jsx as o, jsxs as y, Fragment as f } from "react/jsx-runtime";
|
|
2
2
|
import { z as e } from "zod";
|
|
3
|
-
import { useForm as d, FormProvider as
|
|
4
|
-
import { zodResolver as
|
|
3
|
+
import { useForm as d, FormProvider as p } from "react-hook-form";
|
|
4
|
+
import { zodResolver as N } from "@hookform/resolvers/zod";
|
|
5
5
|
import { SignatoryForm as _ } from "./SignatoryForm.js";
|
|
6
6
|
import { Head as O } from "./Head.js";
|
|
7
7
|
import { AssignSignatorySelection as u } from "./AssignSignatorySelection.js";
|
|
8
8
|
import { SignatoryAssignmentMode as m, AssignSignatoryProvider as E } from "./useAssignSignatory.js";
|
|
9
9
|
import { companyEvents as i } from "../../../shared/constants.js";
|
|
10
10
|
import { Flex as C } from "../../Common/Flex/Flex.js";
|
|
11
|
+
import "react-i18next";
|
|
12
|
+
import "classnames";
|
|
11
13
|
import { BaseComponent as M } from "../../Base/Base.js";
|
|
12
14
|
import { useBase as h } from "../../Base/useBase.js";
|
|
13
15
|
import { useI18n as I, useComponentDictionary as Y } from "../../../i18n/I18n.js";
|
|
14
|
-
function
|
|
16
|
+
function K(n) {
|
|
15
17
|
return /* @__PURE__ */ o(M, { ...n, children: /* @__PURE__ */ o(v, { ...n, children: n.children }) });
|
|
16
18
|
}
|
|
17
19
|
const D = e.object({
|
|
@@ -30,7 +32,7 @@ function v({
|
|
|
30
32
|
}) {
|
|
31
33
|
I("Company.AssignSignatory"), Y("Company.AssignSignatory", A);
|
|
32
34
|
const { onEvent: t } = h(), c = d({
|
|
33
|
-
resolver:
|
|
35
|
+
resolver: N(D),
|
|
34
36
|
defaultValues: {
|
|
35
37
|
signatoryAssignmentMode: m.createSignatory
|
|
36
38
|
}
|
|
@@ -49,7 +51,7 @@ function v({
|
|
|
49
51
|
r === i.COMPANY_CREATE_SIGNATORY_DONE ? t(i.COMPANY_ASSIGN_SIGNATORY_DONE) : r === i.COMPANY_INVITE_SIGNATORY_DONE ? t(i.COMPANY_ASSIGN_SIGNATORY_DONE) : t(r, l);
|
|
50
52
|
}
|
|
51
53
|
},
|
|
52
|
-
children: /* @__PURE__ */ o(C, { flexDirection: "column", gap: 32, children: /* @__PURE__ */ o(
|
|
54
|
+
children: /* @__PURE__ */ o(C, { flexDirection: "column", gap: 32, children: /* @__PURE__ */ o(p, { ...c, children: s || /* @__PURE__ */ y(f, { children: [
|
|
53
55
|
/* @__PURE__ */ o(O, {}),
|
|
54
56
|
/* @__PURE__ */ o(u, {}),
|
|
55
57
|
/* @__PURE__ */ o(_, {})
|
|
@@ -58,6 +60,6 @@ function v({
|
|
|
58
60
|
) });
|
|
59
61
|
}
|
|
60
62
|
export {
|
|
61
|
-
|
|
63
|
+
K as AssignSignatory
|
|
62
64
|
};
|
|
63
65
|
//# sourceMappingURL=AssignSignatory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssignSignatory.js","sources":["../../../../src/components/Company/AssignSignatory/AssignSignatory.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { SignatoryForm } from './SignatoryForm'\nimport { Head } from './Head'\nimport { AssignSignatorySelection } from './AssignSignatorySelection'\nimport type { AssignSignatoryDefaultValues } from './useAssignSignatory'\nimport { AssignSignatoryProvider, SignatoryAssignmentMode } from './useAssignSignatory'\nimport { companyEvents } from '@/shared/constants'\nimport { Flex } from '@/components/Common'\nimport { useBase, BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useI18n, useComponentDictionary } from '@/i18n'\n\ninterface AssignSignatoryProps extends BaseComponentInterface<'Company.AssignSignatory'> {\n companyId: string\n signatoryId?: string\n defaultValues?: AssignSignatoryDefaultValues\n}\n\nexport function AssignSignatory(props: AssignSignatoryProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst AssignSignatorySelectionSchema = z.object({\n signatoryAssignmentMode: z.union([\n z.literal(SignatoryAssignmentMode.createSignatory),\n z.literal(SignatoryAssignmentMode.inviteSignatory),\n ]),\n})\n\ntype AssignSignatorySelectionInputs = z.infer<typeof AssignSignatorySelectionSchema>\n\nfunction Root({\n companyId,\n signatoryId,\n defaultValues,\n className,\n children,\n dictionary,\n}: AssignSignatoryProps) {\n useI18n('Company.AssignSignatory')\n useComponentDictionary('Company.AssignSignatory', dictionary)\n\n const { onEvent } = useBase()\n\n const formMethods = useForm<AssignSignatorySelectionInputs>({\n resolver: zodResolver(AssignSignatorySelectionSchema),\n defaultValues: {\n signatoryAssignmentMode: SignatoryAssignmentMode.createSignatory,\n },\n })\n\n const onSignatoryAssignmentModeChange = (mode: string) => {\n onEvent(companyEvents.COMPANY_ASSIGN_SIGNATORY_MODE_UPDATED, mode)\n }\n\n const onSignatoryFormEvent: BaseComponentInterface['onEvent'] = (event, data) => {\n if (event === companyEvents.COMPANY_CREATE_SIGNATORY_DONE) {\n onEvent(companyEvents.COMPANY_ASSIGN_SIGNATORY_DONE)\n } else if (event === companyEvents.COMPANY_INVITE_SIGNATORY_DONE) {\n onEvent(companyEvents.COMPANY_ASSIGN_SIGNATORY_DONE)\n } else {\n onEvent(event, data)\n }\n }\n\n return (\n <section className={className}>\n <AssignSignatoryProvider\n value={{\n companyId,\n signatoryId,\n defaultValues,\n onSignatoryAssignmentModeChange,\n onSignatoryFormEvent,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n <FormProvider {...formMethods}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <AssignSignatorySelection />\n <SignatoryForm />\n </>\n )}\n </FormProvider>\n </Flex>\n </AssignSignatoryProvider>\n </section>\n )\n}\n"],"names":["AssignSignatory","props","jsx","BaseComponent","Root","AssignSignatorySelectionSchema","z","SignatoryAssignmentMode","companyId","signatoryId","defaultValues","className","children","dictionary","useI18n","useComponentDictionary","onEvent","useBase","formMethods","useForm","zodResolver","AssignSignatoryProvider","mode","companyEvents","event","data","Flex","FormProvider","jsxs","Fragment","Head","AssignSignatorySelection","SignatoryForm"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AssignSignatory.js","sources":["../../../../src/components/Company/AssignSignatory/AssignSignatory.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { SignatoryForm } from './SignatoryForm'\nimport { Head } from './Head'\nimport { AssignSignatorySelection } from './AssignSignatorySelection'\nimport type { AssignSignatoryDefaultValues } from './useAssignSignatory'\nimport { AssignSignatoryProvider, SignatoryAssignmentMode } from './useAssignSignatory'\nimport { companyEvents } from '@/shared/constants'\nimport { Flex } from '@/components/Common'\nimport { useBase, BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useI18n, useComponentDictionary } from '@/i18n'\n\ninterface AssignSignatoryProps extends BaseComponentInterface<'Company.AssignSignatory'> {\n companyId: string\n signatoryId?: string\n defaultValues?: AssignSignatoryDefaultValues\n}\n\nexport function AssignSignatory(props: AssignSignatoryProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst AssignSignatorySelectionSchema = z.object({\n signatoryAssignmentMode: z.union([\n z.literal(SignatoryAssignmentMode.createSignatory),\n z.literal(SignatoryAssignmentMode.inviteSignatory),\n ]),\n})\n\ntype AssignSignatorySelectionInputs = z.infer<typeof AssignSignatorySelectionSchema>\n\nfunction Root({\n companyId,\n signatoryId,\n defaultValues,\n className,\n children,\n dictionary,\n}: AssignSignatoryProps) {\n useI18n('Company.AssignSignatory')\n useComponentDictionary('Company.AssignSignatory', dictionary)\n\n const { onEvent } = useBase()\n\n const formMethods = useForm<AssignSignatorySelectionInputs>({\n resolver: zodResolver(AssignSignatorySelectionSchema),\n defaultValues: {\n signatoryAssignmentMode: SignatoryAssignmentMode.createSignatory,\n },\n })\n\n const onSignatoryAssignmentModeChange = (mode: string) => {\n onEvent(companyEvents.COMPANY_ASSIGN_SIGNATORY_MODE_UPDATED, mode)\n }\n\n const onSignatoryFormEvent: BaseComponentInterface['onEvent'] = (event, data) => {\n if (event === companyEvents.COMPANY_CREATE_SIGNATORY_DONE) {\n onEvent(companyEvents.COMPANY_ASSIGN_SIGNATORY_DONE)\n } else if (event === companyEvents.COMPANY_INVITE_SIGNATORY_DONE) {\n onEvent(companyEvents.COMPANY_ASSIGN_SIGNATORY_DONE)\n } else {\n onEvent(event, data)\n }\n }\n\n return (\n <section className={className}>\n <AssignSignatoryProvider\n value={{\n companyId,\n signatoryId,\n defaultValues,\n onSignatoryAssignmentModeChange,\n onSignatoryFormEvent,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n <FormProvider {...formMethods}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <AssignSignatorySelection />\n <SignatoryForm />\n </>\n )}\n </FormProvider>\n </Flex>\n </AssignSignatoryProvider>\n </section>\n )\n}\n"],"names":["AssignSignatory","props","jsx","BaseComponent","Root","AssignSignatorySelectionSchema","z","SignatoryAssignmentMode","companyId","signatoryId","defaultValues","className","children","dictionary","useI18n","useComponentDictionary","onEvent","useBase","formMethods","useForm","zodResolver","AssignSignatoryProvider","mode","companyEvents","event","data","Flex","FormProvider","jsxs","Fragment","Head","AssignSignatorySelection","SignatoryForm"],"mappings":";;;;;;;;;;;;;;;AAmBO,SAASA,EAAgBC,GAA6B;AAC3D,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GAC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B,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAA3B,EAAC4B,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAyB;AAAA,0BACzBC,GAAA,CAAA,CAAc;AAAA,MAAA,EAAA,CACjB,GAEJ,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as e } from "react-i18next";
|
|
3
3
|
import { useAssignSignatory as s, SignatoryAssignmentMode as o } from "./useAssignSignatory.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
4
|
+
import r from "./AssignSignatorySelection.module.scss.js";
|
|
5
|
+
import "classnames";
|
|
6
|
+
import { RadioGroupField as a } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
7
|
+
const u = () => {
|
|
7
8
|
const { t: n } = e("Company.AssignSignatory"), { onSignatoryAssignmentModeChange: t } = s();
|
|
8
|
-
return /* @__PURE__ */ i("section", { className:
|
|
9
|
-
|
|
9
|
+
return /* @__PURE__ */ i("section", { className: r.container, children: /* @__PURE__ */ i(
|
|
10
|
+
a,
|
|
10
11
|
{
|
|
11
12
|
onChange: t,
|
|
12
13
|
label: n("signingOptions.label"),
|
|
@@ -26,6 +27,6 @@ const c = () => {
|
|
|
26
27
|
) });
|
|
27
28
|
};
|
|
28
29
|
export {
|
|
29
|
-
|
|
30
|
+
u as AssignSignatorySelection
|
|
30
31
|
};
|
|
31
32
|
//# sourceMappingURL=AssignSignatorySelection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssignSignatorySelection.js","sources":["../../../../src/components/Company/AssignSignatory/AssignSignatorySelection.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { SignatoryAssignmentMode, useAssignSignatory } from './useAssignSignatory'\nimport styles from './AssignSignatorySelection.module.scss'\nimport { RadioGroupField } from '@/components/Common'\n\nexport const AssignSignatorySelection = () => {\n const { t } = useTranslation('Company.AssignSignatory')\n const { onSignatoryAssignmentModeChange } = useAssignSignatory()\n\n return (\n <section className={styles.container}>\n <RadioGroupField\n onChange={onSignatoryAssignmentModeChange}\n label={t('signingOptions.label')}\n shouldVisuallyHideLabel\n name=\"signatoryAssignmentMode\"\n options={[\n {\n label: t('signingOptions.selfSign'),\n value: SignatoryAssignmentMode.createSignatory,\n },\n {\n label: t('signingOptions.appointOther'),\n value: SignatoryAssignmentMode.inviteSignatory,\n },\n ]}\n />\n </section>\n )\n}\n"],"names":["AssignSignatorySelection","t","useTranslation","onSignatoryAssignmentModeChange","useAssignSignatory","jsx","styles","RadioGroupField","SignatoryAssignmentMode"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AssignSignatorySelection.js","sources":["../../../../src/components/Company/AssignSignatory/AssignSignatorySelection.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { SignatoryAssignmentMode, useAssignSignatory } from './useAssignSignatory'\nimport styles from './AssignSignatorySelection.module.scss'\nimport { RadioGroupField } from '@/components/Common'\n\nexport const AssignSignatorySelection = () => {\n const { t } = useTranslation('Company.AssignSignatory')\n const { onSignatoryAssignmentModeChange } = useAssignSignatory()\n\n return (\n <section className={styles.container}>\n <RadioGroupField\n onChange={onSignatoryAssignmentModeChange}\n label={t('signingOptions.label')}\n shouldVisuallyHideLabel\n name=\"signatoryAssignmentMode\"\n options={[\n {\n label: t('signingOptions.selfSign'),\n value: SignatoryAssignmentMode.createSignatory,\n },\n {\n label: t('signingOptions.appointOther'),\n value: SignatoryAssignmentMode.inviteSignatory,\n },\n ]}\n />\n </section>\n )\n}\n"],"names":["AssignSignatorySelection","t","useTranslation","onSignatoryAssignmentModeChange","useAssignSignatory","jsx","styles","RadioGroupField","SignatoryAssignmentMode"],"mappings":";;;;;;AAKO,MAAMA,IAA2B,MAAM;AAC5C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAChD,EAAE,iCAAAC,EAAA,IAAoCC,EAAA;AAE5C,SACE,gBAAAC,EAAC,WAAA,EAAQ,WAAWC,EAAO,WACzB,UAAA,gBAAAD;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,UAAUJ;AAAA,MACV,OAAOF,EAAE,sBAAsB;AAAA,MAC/B,yBAAuB;AAAA,MACvB,MAAK;AAAA,MACL,SAAS;AAAA,QACP;AAAA,UACE,OAAOA,EAAE,yBAAyB;AAAA,UAClC,OAAOO,EAAwB;AAAA,QAAA;AAAA,QAEjC;AAAA,UACE,OAAOP,EAAE,6BAA6B;AAAA,UACtC,OAAOO,EAAwB;AAAA,QAAA;AAAA,MACjC;AAAA,IACF;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { useCreateSignatory as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { useTranslation as r } from "react-i18next";
|
|
3
|
+
import { useCreateSignatory as s } from "./useCreateSignatory.js";
|
|
4
|
+
import "classnames";
|
|
5
|
+
import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
6
|
+
import { useComponentContext as e } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
7
|
+
const y = () => {
|
|
8
|
+
const { t } = r("Company.AssignSignatory"), { isPending: n } = s(), i = e();
|
|
9
|
+
return /* @__PURE__ */ o(m, { children: /* @__PURE__ */ o(i.Button, { type: "submit", isLoading: n, children: t("buttons.signDocuments") }) });
|
|
9
10
|
};
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
y as Actions
|
|
12
13
|
};
|
|
13
14
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/AssignSignatory/CreateSignatory/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useCreateSignatory } from './useCreateSignatory'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.AssignSignatory')\n const { isPending } = useCreateSignatory()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('buttons.signDocuments')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","useCreateSignatory","Components","useComponentContext","jsx","ActionsLayout"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/AssignSignatory/CreateSignatory/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useCreateSignatory } from './useCreateSignatory'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.AssignSignatory')\n const { isPending } = useCreateSignatory()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('buttons.signDocuments')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","useCreateSignatory","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,EAAA,IAAMC,EAAe,yBAAyB,GAChD,EAAE,WAAAC,EAAA,IAAcC,EAAA,GAChBC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAA,EAAE,uBAAuB,GAC5B,GACF;AAEJ;"}
|
|
@@ -17,10 +17,11 @@ import { useI18n as Z } from "../../../../i18n/I18n.js";
|
|
|
17
17
|
import { BaseComponent as $ } from "../../../Base/Base.js";
|
|
18
18
|
import { useBase as V } from "../../../Base/useBase.js";
|
|
19
19
|
import { Flex as tt } from "../../../Common/Flex/Flex.js";
|
|
20
|
+
import "react-i18next";
|
|
20
21
|
import { companyEvents as c } from "../../../../shared/constants.js";
|
|
21
22
|
import { formatDateToStringDate as et } from "../../../../helpers/dateFormatting.js";
|
|
22
23
|
import { useMaskedTransform as rt, commonMasks as ot } from "../../../../helpers/mask.js";
|
|
23
|
-
function
|
|
24
|
+
function Ut(o) {
|
|
24
25
|
return /* @__PURE__ */ r($, { ...o, children: /* @__PURE__ */ r(it, { ...o, children: o.children }) });
|
|
25
26
|
}
|
|
26
27
|
function it({
|
|
@@ -35,7 +36,7 @@ function it({
|
|
|
35
36
|
data: { signatories: C }
|
|
36
37
|
} = G({
|
|
37
38
|
companyUuid: o
|
|
38
|
-
}), n = C, t = n.find((s) => s.uuid === f),
|
|
39
|
+
}), n = C, t = n.find((s) => s.uuid === f), p = j(), y = L(), g = H(), u = t?.birthday ?? e?.birthday, D = {
|
|
39
40
|
firstName: t?.firstName ?? e?.firstName ?? "",
|
|
40
41
|
lastName: t?.lastName ?? e?.lastName ?? "",
|
|
41
42
|
email: t?.email ?? e?.email ?? "",
|
|
@@ -65,7 +66,7 @@ function it({
|
|
|
65
66
|
}
|
|
66
67
|
};
|
|
67
68
|
if (t) {
|
|
68
|
-
const m = await
|
|
69
|
+
const m = await y.mutateAsync({
|
|
69
70
|
request: {
|
|
70
71
|
companyUuid: o,
|
|
71
72
|
signatoryUuid: t.uuid,
|
|
@@ -84,7 +85,7 @@ function it({
|
|
|
84
85
|
signatoryUuid: n[0].uuid
|
|
85
86
|
}
|
|
86
87
|
});
|
|
87
|
-
const m = await
|
|
88
|
+
const m = await p.mutateAsync({
|
|
88
89
|
request: {
|
|
89
90
|
companyUuid: o,
|
|
90
91
|
signatoryCreateRequest: {
|
|
@@ -103,7 +104,7 @@ function it({
|
|
|
103
104
|
Q,
|
|
104
105
|
{
|
|
105
106
|
value: {
|
|
106
|
-
isPending:
|
|
107
|
+
isPending: p.isPending || g.isPending || y.isPending,
|
|
107
108
|
currentSignatory: t
|
|
108
109
|
},
|
|
109
110
|
children: /* @__PURE__ */ r(x, { ...h, children: /* @__PURE__ */ r(X, { onSubmit: h.handleSubmit(M), children: /* @__PURE__ */ r(tt, { flexDirection: "column", gap: 32, children: d || /* @__PURE__ */ w(Y, { children: [
|
|
@@ -114,6 +115,6 @@ function it({
|
|
|
114
115
|
) });
|
|
115
116
|
}
|
|
116
117
|
export {
|
|
117
|
-
|
|
118
|
+
Ut as CreateSignatory
|
|
118
119
|
};
|
|
119
120
|
//# sourceMappingURL=CreateSignatory.js.map
|