@gusto/embedded-react-sdk 0.39.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +127 -0
- package/dist/components/Base/Base.js +3 -2
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/Fields/hooks/useField.js.map +1 -1
- package/dist/components/Common/Form/Form.d.ts +1 -1
- package/dist/components/Common/Form/Form.js +15 -5
- package/dist/components/Common/Form/Form.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +6 -4
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +11 -9
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +12 -10
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/Alert/Alert.module.scss.js +12 -12
- package/dist/components/Common/UI/Box/Box.module.scss.js +4 -4
- package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +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 +3 -2
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +3 -2
- 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 +14 -13
- 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 +3 -2
- 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 +9 -8
- 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 +3 -2
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +10 -8
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +80 -61
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/{UNSTABLE_Hooks/hooks → Company/DocumentSigner/shared}/useSignCompanyForm/fields.d.ts +3 -3
- package/dist/components/{UNSTABLE_Hooks/hooks → Company/DocumentSigner/shared}/useSignCompanyForm/fields.js +2 -2
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Company/DocumentSigner/shared}/useSignCompanyForm/index.d.ts +1 -3
- package/dist/components/{UNSTABLE_Hooks/hooks → Company/DocumentSigner/shared}/useSignCompanyForm/signCompanyFormSchema.d.ts +2 -2
- package/dist/components/{UNSTABLE_Hooks/hooks → Company/DocumentSigner/shared}/useSignCompanyForm/signCompanyFormSchema.js +1 -1
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/signCompanyFormSchema.js.map +1 -0
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.d.ts +33 -0
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.js +106 -0
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.js.map +1 -0
- package/dist/components/Company/FederalTaxes/Actions.js +6 -5
- 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 +3 -2
- 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 +5 -4
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +7 -6
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +5 -4
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +4 -2
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +7 -6
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +7 -6
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +8 -6
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.d.ts +1 -1
- package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +6 -5
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +6 -5
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +4 -2
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +4 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.d.ts +6 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +31 -148
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleComponents.d.ts +10 -0
- package/dist/components/Company/PaySchedule/PayScheduleComponents.js +26 -0
- package/dist/components/Company/PaySchedule/PayScheduleComponents.js.map +1 -0
- package/dist/components/Company/PaySchedule/PayScheduleForm.d.ts +8 -0
- package/dist/components/Company/PaySchedule/PayScheduleForm.js +199 -0
- package/dist/components/Company/PaySchedule/PayScheduleForm.js.map +1 -0
- package/dist/components/Company/PaySchedule/PayScheduleList.d.ts +8 -0
- package/dist/components/Company/PaySchedule/PayScheduleList.js +103 -0
- package/dist/components/Company/PaySchedule/PayScheduleList.js.map +1 -0
- package/dist/components/Company/PaySchedule/{_parts/List.module.scss.js → PayScheduleList.module.scss.js} +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleList.module.scss.js.map +1 -0
- package/dist/components/Company/PaySchedule/payScheduleStateMachine.d.ts +6 -0
- package/dist/components/Company/PaySchedule/payScheduleStateMachine.js +49 -0
- package/dist/components/Company/PaySchedule/payScheduleStateMachine.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Company/PaySchedule/shared}/usePayScheduleForm/fields.d.ts +6 -6
- package/dist/components/{UNSTABLE_Hooks/hooks → Company/PaySchedule/shared}/usePayScheduleForm/fields.js +5 -5
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Company/PaySchedule/shared}/usePayScheduleForm/index.d.ts +0 -2
- package/dist/components/{UNSTABLE_Hooks/hooks → Company/PaySchedule/shared}/usePayScheduleForm/payScheduleSchema.d.ts +2 -2
- package/dist/components/{UNSTABLE_Hooks/hooks → Company/PaySchedule/shared}/usePayScheduleForm/payScheduleSchema.js +2 -2
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.js.map +1 -0
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.d.ts +33 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Company/PaySchedule/shared}/usePayScheduleForm/usePayScheduleForm.js +30 -26
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js.map +1 -0
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +3 -2
- 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 +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +6 -5
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/exports/companyOnboarding.d.ts +14 -0
- package/dist/components/Company/exports/companyOnboarding.js +31 -0
- package/dist/components/Company/exports/companyOnboarding.js.map +1 -0
- package/dist/components/Contractor/Address/Address.js +4 -2
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +3 -2
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +6 -5
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +3 -2
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +3 -2
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +5 -4
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -2
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +3 -2
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +3 -2
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +3 -2
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +3 -2
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +3 -2
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +14 -13
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +3 -2
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +3 -2
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
- 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 +74 -50
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Contractor/exports/contractorOnboarding.d.ts +7 -0
- package/dist/components/Contractor/exports/contractorOnboarding.js +17 -0
- package/dist/components/Contractor/exports/contractorOnboarding.js.map +1 -0
- 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 +23 -22
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +23 -22
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Compensation/shared}/useCompensationForm/compensationSchema.d.ts +2 -2
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Compensation/shared}/useCompensationForm/compensationSchema.js +4 -4
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Compensation/shared}/useCompensationForm/fields.d.ts +8 -8
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Compensation/shared}/useCompensationForm/fields.js +6 -6
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Compensation/shared}/useCompensationForm/index.d.ts +0 -2
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.d.ts +43 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Compensation/shared}/useCompensationForm/useCompensationForm.js +28 -24
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -0
- package/dist/components/Employee/Dashboard/Dashboard.js +79 -79
- package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Employee/Dashboard/DocumentsView.js +2 -5
- package/dist/components/Employee/Dashboard/DocumentsView.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.d.ts +8 -11
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js +8 -8
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +10 -12
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +11 -11
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.d.ts +6 -9
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js +10 -10
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.d.ts +7 -10
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js +8 -8
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +3 -2
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +3 -2
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +3 -2
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +7 -6
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +3 -2
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +7 -6
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +11 -9
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +3 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +23 -22
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +3 -2
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +13 -11
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/DocumentSigner/shared}/useSignEmployeeForm/fields.d.ts +5 -5
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/DocumentSigner/shared}/useSignEmployeeForm/fields.js +4 -4
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/fields.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/DocumentSigner/shared}/useSignEmployeeForm/index.d.ts +0 -4
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/DocumentSigner/shared}/useSignEmployeeForm/signEmployeeFormSchema.d.ts +1 -1
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/DocumentSigner/shared}/useSignEmployeeForm/signEmployeeFormSchema.js +1 -1
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/signEmployeeFormSchema.js.map +1 -0
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/useSignEmployeeForm.d.ts +47 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/DocumentSigner/shared}/useSignEmployeeForm/useSignEmployeeForm.js +66 -59
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/useSignEmployeeForm.js.map +1 -0
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +3 -2
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Actions.js +7 -6
- 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/Landing/Landing.js +7 -6
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.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.d.ts +2 -0
- package/dist/components/Employee/Profile/AdminProfile.js +358 -0
- package/dist/components/Employee/Profile/AdminProfile.js.map +1 -0
- package/dist/components/Employee/Profile/AdminProfile.module.scss.js +10 -0
- package/dist/components/Employee/Profile/AdminProfile.module.scss.js.map +1 -0
- package/dist/components/Employee/Profile/EmployeeProfile.d.ts +2 -0
- package/dist/components/Employee/Profile/EmployeeProfile.js +211 -0
- package/dist/components/Employee/Profile/EmployeeProfile.js.map +1 -0
- package/dist/components/Employee/Profile/EmployeeProfile.module.scss.js +10 -0
- package/dist/components/Employee/Profile/EmployeeProfile.module.scss.js.map +1 -0
- package/dist/components/Employee/Profile/Profile.d.ts +3 -3
- package/dist/components/Employee/Profile/Profile.js +25 -261
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useEmployeeDetailsForm/employeeDetailsSchema.d.ts +2 -2
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useEmployeeDetailsForm/employeeDetailsSchema.js +2 -2
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useEmployeeDetailsForm/fields.d.ts +4 -4
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useEmployeeDetailsForm/fields.js +5 -5
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useEmployeeDetailsForm/index.d.ts +0 -2
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +15 -33
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useEmployeeDetailsForm/useEmployeeDetailsForm.js +31 -27
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.d.ts +22 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +36 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js.map +1 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.d.ts +41 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.js +32 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.js.map +1 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/index.d.ts +5 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.d.ts +44 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js +161 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useWorkAddressForm/fields.d.ts +3 -3
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useWorkAddressForm/fields.js +2 -2
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useWorkAddressForm/index.d.ts +0 -2
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useWorkAddressForm/useWorkAddressForm.d.ts +11 -32
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useWorkAddressForm/useWorkAddressForm.js +34 -30
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js.map +1 -0
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useWorkAddressForm/workAddressSchema.d.ts +3 -5
- package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Profile/shared}/useWorkAddressForm/workAddressSchema.js +7 -9
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/workAddressSchema.js.map +1 -0
- package/dist/components/Employee/StateTaxes/Actions.js +8 -7
- 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 +9 -8
- 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/TerminateEmployee.js +5 -5
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +13 -12
- 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/{EmployeeList → employee-list/management}/ManagementEmployeeList.d.ts +1 -1
- package/dist/components/Employee/{EmployeeList → employee-list/management}/ManagementEmployeeList.js +7 -7
- package/dist/components/Employee/employee-list/management/ManagementEmployeeList.js.map +1 -0
- package/dist/components/Employee/{EmployeeList → employee-list/management}/ManagementEmployeeListView.d.ts +1 -1
- package/dist/components/Employee/{EmployeeList → employee-list/management}/ManagementEmployeeListView.js +15 -14
- package/dist/components/Employee/employee-list/management/ManagementEmployeeListView.js.map +1 -0
- package/dist/components/Employee/{EmployeeList → employee-list/onboarding}/EmployeeList.d.ts +1 -1
- package/dist/components/Employee/{EmployeeList → employee-list/onboarding}/EmployeeList.js +7 -7
- package/dist/components/Employee/employee-list/onboarding/EmployeeList.js.map +1 -0
- package/dist/components/Employee/{EmployeeList → employee-list/onboarding}/EmployeeListView.d.ts +1 -1
- package/dist/components/Employee/employee-list/onboarding/EmployeeListView.js +131 -0
- package/dist/components/Employee/employee-list/onboarding/EmployeeListView.js.map +1 -0
- package/dist/components/Employee/employee-list/shared/index.d.ts +2 -0
- package/dist/components/Employee/{EmployeeList → employee-list/shared}/useEmployeeList.d.ts +8 -10
- package/dist/components/Employee/{EmployeeList → employee-list/shared}/useEmployeeList.js +32 -28
- package/dist/components/Employee/employee-list/shared/useEmployeeList.js.map +1 -0
- package/dist/components/Employee/exports/employeeManagement.d.ts +6 -0
- package/dist/components/Employee/exports/employeeManagement.js +15 -0
- package/dist/components/Employee/exports/employeeManagement.js.map +1 -0
- package/dist/components/Employee/exports/employeeOnboarding.d.ts +14 -0
- package/dist/components/Employee/exports/employeeOnboarding.js +31 -0
- package/dist/components/Employee/exports/employeeOnboarding.js.map +1 -0
- package/dist/components/Employee/index.d.ts +1 -2
- package/dist/components/Employee/index.js +35 -37
- package/dist/components/Employee/index.js.map +1 -1
- package/dist/components/Flow/Flow.js +12 -11
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +18 -17
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +8 -7
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +3 -2
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +11 -10
- 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 +2 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +7 -6
- 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/PayrollBlocker/payrollHelpers.js +17 -17
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.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/PayrollReceipts/PayrollReceiptsPresentation.js +106 -108
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.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 +13 -12
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +10 -9
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js +13 -12
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyList.d.ts +1 -1
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyList.js +96 -62
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyList.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.d.ts +1 -1
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.js +48 -45
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListTypes.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettings.module.scss.js +18 -0
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettings.module.scss.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettingsPresentation.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettingsPresentation.js +166 -0
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettingsPresentation.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettingsTypes.d.ts +18 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js +3 -2
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js +24 -22
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +3 -2
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/index.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/index.js +24 -22
- package/dist/components/UNSTABLE_TimeOff/index.js.map +1 -1
- package/dist/components/index.d.ts +7 -0
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +11 -10
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/ObservabilityProvider/useObservability.js +6 -6
- package/dist/contexts/ObservabilityProvider/useObservability.js.map +1 -1
- package/dist/i18n/I18n.js +9 -9
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.PaySchedule.json.js +15 -13
- package/dist/i18n/en/Company.PaySchedule.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js +1 -1
- package/dist/i18n/en/Contractor.Submit.json.js +16 -12
- package/dist/i18n/en/Contractor.Submit.json.js.map +1 -1
- package/dist/i18n/en/common.json.d.ts +1 -0
- package/dist/i18n/en/common.json.js +1 -1
- package/dist/index.d.ts +16 -0
- package/dist/index.js +102 -26
- package/dist/index.js.map +1 -1
- package/dist/partner-hook-utils/collectErrors.js.map +1 -0
- package/dist/partner-hook-utils/composeErrorHandler.d.ts +24 -0
- package/dist/partner-hook-utils/composeErrorHandler.js +30 -0
- package/dist/partner-hook-utils/composeErrorHandler.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/FormFieldsMetadataContext.d.ts +2 -2
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/FormFieldsMetadataContext.js +3 -3
- package/dist/partner-hook-utils/form/FormFieldsMetadataContext.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/FormFieldsMetadataProvider.d.ts +2 -2
- package/dist/partner-hook-utils/form/FormFieldsMetadataProvider.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/SDKFormProvider.d.ts +2 -2
- package/dist/partner-hook-utils/form/SDKFormProvider.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/buildFormSchema.d.ts +1 -1
- package/dist/partner-hook-utils/form/buildFormSchema.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/composeSubmitHandler.d.ts +29 -3
- package/dist/partner-hook-utils/form/composeSubmitHandler.js +40 -0
- package/dist/partner-hook-utils/form/composeSubmitHandler.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/CheckboxHookField.d.ts +3 -3
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js +37 -0
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/DatePickerHookField.d.ts +3 -3
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/DatePickerHookField.js +1 -1
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/NumberInputHookField.d.ts +3 -3
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +43 -0
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/RadioGroupHookField.d.ts +3 -3
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js +43 -0
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/SelectHookField.d.ts +3 -3
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/SelectHookField.js +18 -16
- package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/SwitchHookField.d.ts +3 -3
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js +37 -0
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/TextInputHookField.d.ts +3 -3
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js +41 -0
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/index.d.ts +7 -7
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/getFieldWithOptions.d.ts +1 -1
- package/dist/partner-hook-utils/form/getFieldWithOptions.js.map +1 -0
- package/dist/partner-hook-utils/form/getFormSubmissionValues.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/index.d.ts +2 -2
- package/dist/partner-hook-utils/form/preprocessors.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/resolveFieldError.d.ts +2 -2
- package/dist/partner-hook-utils/form/resolveFieldError.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/useDeriveFieldsMetadata.d.ts +1 -1
- package/dist/partner-hook-utils/form/useDeriveFieldsMetadata.js +21 -0
- package/dist/partner-hook-utils/form/useDeriveFieldsMetadata.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/useFieldErrorMessage.d.ts +1 -1
- package/dist/partner-hook-utils/form/useFieldErrorMessage.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/useHookFieldResolution.d.ts +2 -2
- package/dist/partner-hook-utils/form/useHookFieldResolution.js.map +1 -0
- package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/withOptions.d.ts +1 -1
- package/dist/partner-hook-utils/form/withOptions.js.map +1 -0
- package/dist/partner-hook-utils/index.d.ts +5 -0
- package/dist/{types/sdkHooks.d.ts → partner-hook-utils/types.d.ts} +37 -9
- package/dist/shared/constants.d.ts +1 -1
- package/dist/shared/constants.js +15 -16
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +24 -252
- package/dist/types/sdkError.js.map +1 -1
- package/docs/reference/endpoint-inventory.json +531 -170
- package/package.json +15 -19
- package/dist/UNSTABLE_Hooks.d.ts +0 -1
- package/dist/UNSTABLE_Hooks.js +0 -71
- package/dist/UNSTABLE_Hooks.js.map +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/Actions.d.ts +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/Actions.js +0 -20
- package/dist/components/Company/DocumentSigner/SignatureForm/Actions.js.map +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/Form.d.ts +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/Form.js +0 -20
- package/dist/components/Company/DocumentSigner/SignatureForm/Form.js.map +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/Head.d.ts +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/Head.js +0 -35
- package/dist/components/Company/DocumentSigner/SignatureForm/Head.js.map +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/Preview.d.ts +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/Preview.js +0 -20
- package/dist/components/Company/DocumentSigner/SignatureForm/Preview.js.map +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.d.ts +0 -9
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +0 -22
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +0 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.d.ts +0 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +0 -63
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +0 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.d.ts +0 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +0 -134
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +0 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.module.scss.js +0 -14
- package/dist/components/Company/PaySchedule/_parts/Edit.module.scss.js.map +0 -1
- package/dist/components/Company/PaySchedule/_parts/Head.d.ts +0 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +0 -47
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +0 -1
- package/dist/components/Company/PaySchedule/_parts/List.d.ts +0 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +0 -57
- package/dist/components/Company/PaySchedule/_parts/List.js.map +0 -1
- package/dist/components/Company/PaySchedule/_parts/List.module.scss.js.map +0 -1
- package/dist/components/Company/PaySchedule/_parts/index.d.ts +0 -5
- package/dist/components/Company/PaySchedule/usePaySchedule.d.ts +0 -39
- package/dist/components/Company/PaySchedule/usePaySchedule.js +0 -30
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +0 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +0 -1
- package/dist/components/Employee/EmployeeList/EmployeeListView.js +0 -130
- package/dist/components/Employee/EmployeeList/EmployeeListView.js.map +0 -1
- package/dist/components/Employee/EmployeeList/ManagementEmployeeList.js.map +0 -1
- package/dist/components/Employee/EmployeeList/ManagementEmployeeListView.js.map +0 -1
- package/dist/components/Employee/EmployeeList/index.d.ts +0 -3
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +0 -1
- package/dist/components/Employee/Profile/Actions.d.ts +0 -1
- package/dist/components/Employee/Profile/Actions.js +0 -14
- package/dist/components/Employee/Profile/Actions.js.map +0 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +0 -33
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +0 -59
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +0 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.module.scss.js +0 -8
- package/dist/components/Employee/Profile/AdminPersonalDetails.module.scss.js.map +0 -1
- package/dist/components/Employee/Profile/Head.d.ts +0 -1
- package/dist/components/Employee/Profile/Head.js +0 -14
- package/dist/components/Employee/Profile/Head.js.map +0 -1
- package/dist/components/Employee/Profile/HomeAddress.d.ts +0 -31
- package/dist/components/Employee/Profile/HomeAddress.js +0 -128
- package/dist/components/Employee/Profile/HomeAddress.js.map +0 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +0 -49
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +0 -146
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +0 -1
- package/dist/components/Employee/Profile/SelfPersonalDetails.d.ts +0 -16
- package/dist/components/Employee/Profile/SelfPersonalDetails.js +0 -29
- package/dist/components/Employee/Profile/SelfPersonalDetails.js.map +0 -1
- package/dist/components/Employee/Profile/WorkAddress.d.ts +0 -1
- package/dist/components/Employee/Profile/WorkAddress.js +0 -21
- package/dist/components/Employee/Profile/WorkAddress.js.map +0 -1
- package/dist/components/Employee/Profile/WorkAddress.module.scss.js +0 -8
- package/dist/components/Employee/Profile/WorkAddress.module.scss.js.map +0 -1
- package/dist/components/Employee/Profile/getEmployeeAddressForProfile.d.ts +0 -2
- package/dist/components/Employee/Profile/getEmployeeAddressForProfile.js +0 -8
- package/dist/components/Employee/Profile/getEmployeeAddressForProfile.js.map +0 -1
- package/dist/components/Employee/Profile/useProfile.d.ts +0 -16
- package/dist/components/Employee/Profile/useProfile.js +0 -20
- package/dist/components/Employee/Profile/useProfile.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/buildFormSchema.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js +0 -34
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js +0 -35
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js +0 -41
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js +0 -41
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js +0 -35
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js +0 -39
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/preprocessors.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/useDeriveFieldsMetadata.js +0 -21
- package/dist/components/UNSTABLE_Hooks/form/useDeriveFieldsMetadata.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/useHookFieldResolution.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/withOptions.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.d.ts +0 -5
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js +0 -149
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.d.ts +0 -102
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.d.ts +0 -5
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js +0 -112
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/PayScheduleForm.d.ts +0 -5
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/PayScheduleForm.js +0 -172
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/PayScheduleForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/fields.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/payScheduleSchema.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/usePayScheduleForm.d.ts +0 -69
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/usePayScheduleForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/SignCompanyForm.d.ts +0 -5
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/SignCompanyForm.js +0 -69
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/SignCompanyForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/fields.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/signCompanyFormSchema.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/useSignCompanyForm.d.ts +0 -57
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/useSignCompanyForm.js +0 -101
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/useSignCompanyForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeForm.d.ts +0 -5
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeForm.js +0 -71
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeI9Form.d.ts +0 -5
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeI9Form.js +0 -179
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeI9Form.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/fields.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/signEmployeeFormSchema.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/useSignEmployeeForm.d.ts +0 -151
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/useSignEmployeeForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.d.ts +0 -5
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js +0 -69
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/index.d.ts +0 -12
- package/dist/helpers/buildQueryErrorHandling.d.ts +0 -22
- package/dist/helpers/buildQueryErrorHandling.js +0 -11
- package/dist/helpers/buildQueryErrorHandling.js.map +0 -1
- package/dist/helpers/collectErrors.js.map +0 -1
- package/dist/hooks/useErrorHandling.d.ts +0 -9
- package/dist/hooks/useErrorHandling.js +0 -12
- package/dist/hooks/useErrorHandling.js.map +0 -1
- package/dist/hooks/useErrorHandling.test.d.ts +0 -1
- package/dist/i18n/en/UNSTABLE.CompensationForm.json.js +0 -58
- package/dist/i18n/en/UNSTABLE.CompensationForm.json.js.map +0 -1
- package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js +0 -34
- package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js.map +0 -1
- package/dist/i18n/en/UNSTABLE.PayScheduleForm.json.js +0 -24
- package/dist/i18n/en/UNSTABLE.PayScheduleForm.json.js.map +0 -1
- package/dist/i18n/en/UNSTABLE.SignCompanyForm.json.js +0 -20
- package/dist/i18n/en/UNSTABLE.SignCompanyForm.json.js.map +0 -1
- package/dist/i18n/en/UNSTABLE.SignEmployeeForm.json.js +0 -22
- package/dist/i18n/en/UNSTABLE.SignEmployeeForm.json.js.map +0 -1
- package/dist/i18n/en/UNSTABLE.SignEmployeeI9Form.json.js +0 -70
- package/dist/i18n/en/UNSTABLE.SignEmployeeI9Form.json.js.map +0 -1
- package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js +0 -24
- package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js.map +0 -1
- /package/dist/components/{UNSTABLE_Hooks/hooks/usePayScheduleForm → Company/PaySchedule}/PayScheduleForm.module.scss.js +0 -0
- /package/dist/components/{UNSTABLE_Hooks/hooks/usePayScheduleForm → Company/PaySchedule}/PayScheduleForm.module.scss.js.map +0 -0
- /package/dist/components/{UNSTABLE_Hooks/hooks → Employee/Compensation/shared}/useCompensationForm/compensationSchemaParity.test.d.ts +0 -0
- /package/dist/{helpers → partner-hook-utils}/collectErrors.d.ts +0 -0
- /package/dist/{helpers → partner-hook-utils}/collectErrors.js +0 -0
- /package/dist/{components/Employee/Profile/getEmployeeAddressForProfile.test.d.ts → partner-hook-utils/composeErrorHandler.test.d.ts} +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/FormFieldsMetadataProvider.js +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/SDKFormProvider.js +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/buildFormSchema.js +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/buildFormSchema.test.d.ts +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/composeSubmitHandler.test.d.ts +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/getFieldWithOptions.js +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/getFormSubmissionValues.d.ts +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/getFormSubmissionValues.js +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/getFormSubmissionValues.test.d.ts +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/preprocessors.d.ts +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/preprocessors.js +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/resolveFieldError.js +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/useFieldErrorMessage.js +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/useHookFieldResolution.js +0 -0
- /package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/withOptions.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildFormSchema.js","sources":["../../../../src/components/UNSTABLE_Hooks/form/buildFormSchema.ts"],"sourcesContent":["import { z } from 'zod'\nimport type { FieldMetadata } from '@/types/sdkHooks'\n\n// ── Types ────────────────────────────────────────────────────────────\n\nexport type FormMode = 'create' | 'update'\n\nexport type RequiredFieldRule<TData = Record<string, unknown>> =\n | 'create'\n | 'update'\n | 'always'\n | 'never'\n | ((data: TData, mode: FormMode) => boolean)\n\nexport type RequiredFieldConfig<TSchema extends Record<string, z.ZodType>> = Partial<{\n [K in keyof TSchema & string]: RequiredFieldRule<{\n [F in keyof TSchema]: z.infer<TSchema[F]>\n }>\n}>\n\ntype OptionalOnCreate<TConfig> = {\n [K in keyof TConfig & string]: TConfig[K] extends 'update' | 'never' ? K : never\n}[keyof TConfig & string]\n\ntype OptionalOnUpdate<TConfig> = {\n [K in keyof TConfig & string]: TConfig[K] extends 'create' | 'never' ? K : never\n}[keyof TConfig & string]\n\nexport type OptionalFieldsToRequire<TConfig> = {\n create?: Array<OptionalOnCreate<TConfig>>\n update?: Array<OptionalOnUpdate<TConfig>>\n}\n\n// ── buildFormSchema ──────────────────────────────────────────────────\n\ninterface BuildFormSchemaOptions<\n T extends Record<string, z.ZodType>,\n TConfig extends RequiredFieldConfig<T>,\n> {\n requiredFieldsConfig?: TConfig\n requiredErrorCode?: string\n mode: FormMode\n optionalFieldsToRequire?: OptionalFieldsToRequire<TConfig>\n excludeFields?: Array<keyof T & string>\n /** Fields with existing server-side values that are redacted in the API response\n * (e.g. SSN, EIN). These fields remain in the schema for format validation and\n * appear in metadata (with `hasRedactedValue: true`) but are exempt from required\n * validation — an empty submission is valid because a value already exists. */\n fieldsWithRedactedValues?: Array<keyof T & string>\n superRefine?: (data: { [K in keyof T]: z.infer<T[K]> }, ctx: z.RefinementCtx) => void\n}\n\nexport interface FieldsMetadataConfig<T extends Record<string, z.ZodType>> {\n getFieldsMetadata: (data?: Record<string, unknown>) => Record<keyof T, FieldMetadata>\n /** Form field names that predicate-based requiredness rules read at runtime. */\n predicateDeps: string[]\n}\n\ntype FormDataFromValidators<T extends Record<string, z.ZodType>> = {\n [K in keyof T]: z.infer<T[K]>\n}\n\nexport type BuildFormSchemaResult<T extends Record<string, z.ZodType>> = [\n schema: z.ZodType<FormDataFromValidators<T>, FormDataFromValidators<T>>,\n metadataConfig: FieldsMetadataConfig<T>,\n]\n\nexport function buildFormSchema<\n T extends Record<string, z.ZodType>,\n TConfig extends RequiredFieldConfig<T>,\n>(fieldValidators: T, options: BuildFormSchemaOptions<T, TConfig>): BuildFormSchemaResult<T> {\n const {\n mode,\n requiredFieldsConfig = {} as Record<string, RequiredFieldRule>,\n requiredErrorCode = 'REQUIRED',\n excludeFields = [],\n } = options\n const excluded = new Set(excludeFields.map(String))\n const redacted = new Set((options.fieldsWithRedactedValues ?? []).map(String))\n const partnerRequired = new Set(\n resolveOptionalFieldsToRequire(options.optionalFieldsToRequire, mode),\n )\n\n const shape: Record<string, z.ZodType> = {}\n const dynamicRequired: Array<{\n name: string\n predicate: (data: Record<string, unknown>, mode: FormMode) => boolean\n }> = []\n const includedFieldNames: string[] = []\n const config = requiredFieldsConfig as Record<string, RequiredFieldRule>\n\n for (const [name, validator] of Object.entries(fieldValidators)) {\n if (excluded.has(name)) continue\n includedFieldNames.push(name)\n\n const effectiveRule = config[name] ?? 'always'\n\n shape[name] = makeOptional(validator)\n\n if (!redacted.has(name)) {\n const isPartnerRequired = partnerRequired.has(name)\n\n if (typeof effectiveRule === 'function') {\n dynamicRequired.push({\n name,\n predicate: isPartnerRequired ? () => true : effectiveRule,\n })\n } else {\n const isRequired = effectiveRule === 'always' || effectiveRule === mode || isPartnerRequired\n if (isRequired) {\n dynamicRequired.push({ name, predicate: () => true })\n }\n }\n }\n }\n\n const hasSuperRefine = dynamicRequired.length > 0 || options.superRefine\n let schema: z.ZodType = z.object(shape)\n\n if (hasSuperRefine) {\n schema = (schema as z.ZodObject).superRefine(\n (data: Record<string, unknown>, ctx: z.RefinementCtx) => {\n for (const { name, predicate } of dynamicRequired) {\n if (predicate(data, mode) && isEmpty(data[name])) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [name],\n message: requiredErrorCode,\n })\n }\n }\n\n options.superRefine?.(data as { [K in keyof T]: z.infer<T[K]> }, ctx)\n },\n )\n }\n\n const predicateDeps = detectPredicateDeps(dynamicRequired, mode)\n\n function getFieldsMetadata(data?: Record<string, unknown>) {\n const metadata: Record<string, FieldMetadata> = {}\n\n for (const name of includedFieldNames) {\n const effectiveRule = config[name] ?? 'always'\n\n if (partnerRequired.has(name)) {\n metadata[name] = { name, isRequired: true }\n } else if (typeof effectiveRule === 'function') {\n metadata[name] = { name, isRequired: data ? effectiveRule(data, mode) : false }\n } else {\n metadata[name] = {\n name,\n isRequired: effectiveRule === 'always' || effectiveRule === mode,\n }\n }\n\n if (redacted.has(name)) {\n metadata[name].hasRedactedValue = true\n }\n }\n\n return metadata as Record<keyof T, FieldMetadata>\n }\n\n // makeOptional wraps fields with z.preprocess, which causes z.input to infer\n // `unknown`. Cast the schema to carry the original field types so zodResolver\n // infers correct form data types — consumers don't need per-hook casts.\n return [\n schema as z.ZodType<FormDataFromValidators<T>, FormDataFromValidators<T>>,\n { getFieldsMetadata, predicateDeps },\n ]\n}\n\n// ── Internal helpers ─────────────────────────────────────────────────\n\nfunction resolveOptionalFieldsToRequire<TConfig>(\n value: OptionalFieldsToRequire<TConfig> | undefined,\n mode: FormMode,\n): string[] {\n if (!value) return []\n return ((mode === 'create' ? value.create : value.update) ?? []) as string[]\n}\n\nfunction makeOptional(validator: z.ZodType): z.ZodType {\n return z.preprocess(v => (v === '' || v === null ? undefined : v), validator.optional())\n}\n\nfunction isEmpty(value: unknown): boolean {\n if (value === undefined || value === null) return true\n if (typeof value === 'string' && value.trim() === '') return true\n return false\n}\n\n/**\n * Determines which form field names are read by predicate-based requiredness\n * rules. This enables `useDeriveFieldsMetadata` to watch only the specific\n * fields that predicates depend on, rather than subscribing to every form\n * value change (which defeats react-hook-form's per-field render optimization).\n *\n * Works by running each predicate against a recording Proxy. The Proxy\n * intercepts property access and logs the keys, giving us the dependency list\n * without requiring manual declaration.\n *\n * Limitation: JavaScript short-circuit evaluation (`a && b`) can prevent the\n * Proxy from seeing later operands when earlier ones are falsy. In practice\n * this is acceptable — our predicate rules read a single form value each\n * (e.g. `data => data.adjustForMinimumWage`). Multi-field predicates with\n * equality guards should be expressed as `superRefine` rules instead.\n */\nfunction detectPredicateDeps(\n dynamicRequired: Array<{\n name: string\n predicate: (data: Record<string, unknown>, mode: FormMode) => boolean\n }>,\n mode: FormMode,\n): string[] {\n const deps = new Set<string>()\n\n for (const { predicate } of dynamicRequired) {\n if (isConstantPredicate(predicate)) continue\n\n const accessed: string[] = []\n const proxy = new Proxy({} as Record<string, unknown>, {\n get(_target, prop) {\n if (typeof prop === 'string') accessed.push(prop)\n return undefined\n },\n })\n\n try {\n predicate(proxy, mode)\n } catch {\n /* Predicate may throw on undefined values — that's fine, we already captured the property accesses */\n }\n\n for (const key of accessed) deps.add(key)\n }\n\n return [...deps]\n}\n\n/**\n * Static predicates (e.g. `() => true` from 'always' / mode rules / partner\n * overrides) don't access form data, so we skip them during dependency\n * detection. We identify them by running against an empty proxy and checking\n * whether any properties were accessed.\n */\nfunction isConstantPredicate(\n predicate: (data: Record<string, unknown>, mode: FormMode) => boolean,\n): boolean {\n const accessed: string[] = []\n const proxy = new Proxy({} as Record<string, unknown>, {\n get(_target, prop) {\n if (typeof prop === 'string') accessed.push(prop)\n return undefined\n },\n })\n try {\n predicate(proxy, 'create')\n } catch {\n /* ignore */\n }\n return accessed.length === 0\n}\n"],"names":["buildFormSchema","fieldValidators","options","mode","requiredFieldsConfig","requiredErrorCode","excludeFields","excluded","redacted","partnerRequired","resolveOptionalFieldsToRequire","shape","dynamicRequired","includedFieldNames","config","name","validator","effectiveRule","makeOptional","isPartnerRequired","hasSuperRefine","schema","z","data","ctx","predicate","isEmpty","predicateDeps","detectPredicateDeps","getFieldsMetadata","metadata","value","v","deps","isConstantPredicate","accessed","proxy","_target","prop","key"],"mappings":"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"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
function l(t, e) {
|
|
2
|
-
return async (a) => {
|
|
3
|
-
if (a.preventDefault(), !(await Promise.all(
|
|
4
|
-
t.map(
|
|
5
|
-
(r) => new Promise((o) => {
|
|
6
|
-
r.form.hookFormInternals.formMethods.handleSubmit(
|
|
7
|
-
() => {
|
|
8
|
-
o(!0);
|
|
9
|
-
},
|
|
10
|
-
() => {
|
|
11
|
-
o(!1);
|
|
12
|
-
}
|
|
13
|
-
)();
|
|
14
|
-
})
|
|
15
|
-
)
|
|
16
|
-
)).every(Boolean)) {
|
|
17
|
-
for (const r of t) {
|
|
18
|
-
const o = Object.keys(
|
|
19
|
-
r.form.hookFormInternals.formMethods.formState.errors
|
|
20
|
-
)[0];
|
|
21
|
-
if (o) {
|
|
22
|
-
r.form.hookFormInternals.formMethods.setFocus(o);
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
await e();
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
export {
|
|
32
|
-
l as composeSubmitHandler
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=composeSubmitHandler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"composeSubmitHandler.js","sources":["../../../../src/components/UNSTABLE_Hooks/form/composeSubmitHandler.ts"],"sourcesContent":["import type { SyntheticEvent } from 'react'\n\n/**\n * Minimal shape required for a form hook result to participate in `composeSubmitHandler`.\n * Any hook returning `BaseFormHookReady` satisfies this interface.\n *\n * Uses method syntax so TypeScript applies bivariant checking on parameter types,\n * allowing hooks with specific form data generics to be passed without casts.\n */\ninterface ComposableFormHookResult {\n form: {\n hookFormInternals: {\n formMethods: {\n handleSubmit(onValid: () => void, onInvalid?: () => void): () => Promise<void>\n setFocus(name: string): void\n formState: { errors: Record<string, unknown> }\n }\n }\n }\n}\n\n/**\n * Coordinates validation and submission across multiple form hooks on the same page.\n *\n * Validates all forms simultaneously via `handleSubmit()`, then focuses the first invalid\n * field across all forms (in array order). Only calls `onAllValid` when every form passes.\n *\n * Uses `handleSubmit` rather than `trigger` so that react-hook-form sets\n * `formState.isSubmitted = true`, which enables `reValidateMode` (default: `onChange`).\n * Without this, errors set by manual `trigger()` calls would never clear as the user types.\n *\n * Each hook passed to `forms` should be initialized with `shouldFocusError: false` so that\n * react-hook-form's built-in per-form focus is disabled and `composeSubmitHandler` can manage\n * cross-form focus instead.\n *\n * @example\n * ```ts\n * const detailsForm = useEmployeeDetailsForm({ employeeId, shouldFocusError: false })\n * const addressForm = useHomeAddressForm({ employeeId, shouldFocusError: false })\n *\n * const handleSubmit = composeSubmitHandler(\n * [detailsForm, addressForm],\n * async () => {\n * await detailsForm.actions.onSubmit()\n * await addressForm.actions.onSubmit()\n * },\n * )\n *\n * return <form onSubmit={handleSubmit}>...</form>\n * ```\n */\nexport function composeSubmitHandler(\n forms: ComposableFormHookResult[],\n onAllValid: () => Promise<void>,\n): (e: SyntheticEvent) => Promise<void> {\n return async (e: SyntheticEvent) => {\n e.preventDefault()\n\n const validationResults = await Promise.all(\n forms.map(\n form =>\n new Promise<boolean>(resolve => {\n void form.form.hookFormInternals.formMethods.handleSubmit(\n () => {\n resolve(true)\n },\n () => {\n resolve(false)\n },\n )()\n }),\n ),\n )\n\n const allValid = validationResults.every(Boolean)\n\n if (!allValid) {\n for (const form of forms) {\n const firstErrorField = Object.keys(\n form.form.hookFormInternals.formMethods.formState.errors,\n )[0]\n if (firstErrorField) {\n form.form.hookFormInternals.formMethods.setFocus(firstErrorField)\n return\n }\n }\n return\n }\n\n await onAllValid()\n }\n}\n"],"names":["composeSubmitHandler","forms","onAllValid","e","form","resolve","firstErrorField"],"mappings":"AAmDO,SAASA,EACdC,GACAC,GACsC;AACtC,SAAO,OAAOC,MAAsB;AAqBlC,QApBAA,EAAE,eAAA,GAoBE,EAlBsB,MAAM,QAAQ;AAAA,MACtCF,EAAM;AAAA,QACJ,CAAAG,MACE,IAAI,QAAiB,CAAAC,MAAW;AAC9B,UAAKD,EAAK,KAAK,kBAAkB,YAAY;AAAA,YAC3C,MAAM;AACJ,cAAAC,EAAQ,EAAI;AAAA,YACd;AAAA,YACA,MAAM;AACJ,cAAAA,EAAQ,EAAK;AAAA,YACf;AAAA,UAAA,EACF;AAAA,QACF,CAAC;AAAA,MAAA;AAAA,IACL,GAGiC,MAAM,OAAO,GAEjC;AACb,iBAAWD,KAAQH,GAAO;AACxB,cAAMK,IAAkB,OAAO;AAAA,UAC7BF,EAAK,KAAK,kBAAkB,YAAY,UAAU;AAAA,QAAA,EAClD,CAAC;AACH,YAAIE,GAAiB;AACnB,UAAAF,EAAK,KAAK,kBAAkB,YAAY,SAASE,CAAe;AAChE;AAAA,QACF;AAAA,MACF;AACA;AAAA,IACF;AAEA,UAAMJ,EAAA;AAAA,EACR;AACF;"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import { useHookFieldResolution as u } from "../useHookFieldResolution.js";
|
|
3
|
-
import "../../../../shared/constants.js";
|
|
4
|
-
import { CheckboxField as f } from "../../../Common/Fields/CheckboxField/CheckboxField.js";
|
|
5
|
-
function x({
|
|
6
|
-
name: o,
|
|
7
|
-
formHookResult: i,
|
|
8
|
-
label: r,
|
|
9
|
-
description: t,
|
|
10
|
-
validationMessages: s,
|
|
11
|
-
FieldComponent: d
|
|
12
|
-
}) {
|
|
13
|
-
const { metadata: l, control: a, errorMessage: c } = u(
|
|
14
|
-
o,
|
|
15
|
-
i,
|
|
16
|
-
s
|
|
17
|
-
), e = l[o];
|
|
18
|
-
return /* @__PURE__ */ m(
|
|
19
|
-
f,
|
|
20
|
-
{
|
|
21
|
-
name: o,
|
|
22
|
-
control: a,
|
|
23
|
-
label: r,
|
|
24
|
-
description: t,
|
|
25
|
-
errorMessage: c,
|
|
26
|
-
isRequired: e?.isRequired,
|
|
27
|
-
isDisabled: e?.isDisabled,
|
|
28
|
-
FieldComponent: d
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
export {
|
|
33
|
-
x as CheckboxHookField
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=CheckboxHookField.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxHookField.js","sources":["../../../../../src/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\nimport { useHookFieldResolution } from '../useHookFieldResolution'\nimport type { BaseFieldProps, ValidationMessages } from '@/types/sdkHooks'\nimport type { BaseFormHookReady } from '@/types/sdkHooks'\nimport { CheckboxField } from '@/components/Common'\nimport type { CheckboxProps } from '@/components/Common/UI/Checkbox/CheckboxTypes'\n\nexport interface CheckboxHookFieldProps<TErrorCode extends string = never> extends BaseFieldProps {\n name: string\n formHookResult?: BaseFormHookReady\n validationMessages?: ValidationMessages<TErrorCode>\n FieldComponent?: ComponentType<CheckboxProps>\n}\n\nexport function CheckboxHookField<TErrorCode extends string>({\n name,\n formHookResult,\n label,\n description,\n validationMessages,\n FieldComponent,\n}: CheckboxHookFieldProps<TErrorCode>) {\n const { metadata, control, errorMessage } = useHookFieldResolution(\n name,\n formHookResult,\n validationMessages,\n )\n const fieldMetadata = metadata[name]\n\n return (\n <CheckboxField\n name={name}\n control={control}\n label={label}\n description={description}\n errorMessage={errorMessage}\n isRequired={fieldMetadata?.isRequired}\n isDisabled={fieldMetadata?.isDisabled}\n FieldComponent={FieldComponent}\n />\n )\n}\n"],"names":["CheckboxHookField","name","formHookResult","label","description","validationMessages","FieldComponent","metadata","control","errorMessage","useHookFieldResolution","fieldMetadata","jsx","CheckboxField"],"mappings":";;;;AAcO,SAASA,EAA6C;AAAA,EAC3D,MAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,gBAAAC;AACF,GAAuC;AACrC,QAAM,EAAE,UAAAC,GAAU,SAAAC,GAAS,cAAAC,EAAA,IAAiBC;AAAA,IAC1CT;AAAA,IACAC;AAAA,IACAG;AAAA,EAAA,GAEIM,IAAgBJ,EAASN,CAAI;AAEnC,SACE,gBAAAW;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAZ;AAAA,MACA,SAAAO;AAAA,MACA,OAAAL;AAAA,MACA,aAAAC;AAAA,MACA,cAAAK;AAAA,MACA,YAAYE,GAAe;AAAA,MAC3B,YAAYA,GAAe;AAAA,MAC3B,gBAAAL;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerHookField.js","sources":["../../../../../src/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\nimport { useHookFieldResolution } from '../useHookFieldResolution'\nimport type { BaseFieldProps, ValidationMessages } from '@/types/sdkHooks'\nimport type { BaseFormHookReady } from '@/types/sdkHooks'\nimport { DatePickerField } from '@/components/Common/Fields/DatePickerField'\nimport type { DatePickerProps } from '@/components/Common/UI/DatePicker/DatePickerTypes'\n\nexport interface DatePickerHookFieldProps<\n TErrorCode extends string = never,\n> extends BaseFieldProps {\n name: string\n formHookResult?: BaseFormHookReady\n validationMessages?: ValidationMessages<TErrorCode>\n FieldComponent?: ComponentType<DatePickerProps>\n}\n\nexport function DatePickerHookField<TErrorCode extends string>({\n name,\n formHookResult,\n label,\n description,\n validationMessages,\n FieldComponent,\n}: DatePickerHookFieldProps<TErrorCode>) {\n const { metadata, control, errorMessage } = useHookFieldResolution(\n name,\n formHookResult,\n validationMessages,\n )\n const fieldMetadata = metadata[name]\n\n return (\n <DatePickerField\n name={name}\n control={control}\n label={label}\n description={description}\n errorMessage={errorMessage}\n isRequired={fieldMetadata?.isRequired}\n isDisabled={fieldMetadata?.isDisabled}\n FieldComponent={FieldComponent}\n />\n )\n}\n"],"names":["DatePickerHookField","name","formHookResult","label","description","validationMessages","FieldComponent","metadata","control","errorMessage","useHookFieldResolution","fieldMetadata","jsx","DatePickerField"],"mappings":";;;AAgBO,SAASA,EAA+C;AAAA,EAC7D,MAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,gBAAAC;AACF,GAAyC;AACvC,QAAM,EAAE,UAAAC,GAAU,SAAAC,GAAS,cAAAC,EAAA,IAAiBC;AAAA,IAC1CT;AAAA,IACAC;AAAA,IACAG;AAAA,EAAA,GAEIM,IAAgBJ,EAASN,CAAI;AAEnC,SACE,gBAAAW;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAZ;AAAA,MACA,SAAAO;AAAA,MACA,OAAAL;AAAA,MACA,aAAAC;AAAA,MACA,cAAAK;AAAA,MACA,YAAYE,GAAe;AAAA,MAC3B,YAAYA,GAAe;AAAA,MAC3B,gBAAAL;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
-
import { useHookFieldResolution as b } from "../useHookFieldResolution.js";
|
|
3
|
-
import "../../../../shared/constants.js";
|
|
4
|
-
import { NumberInputField as c } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
5
|
-
function x({
|
|
6
|
-
name: o,
|
|
7
|
-
formHookResult: i,
|
|
8
|
-
label: r,
|
|
9
|
-
description: t,
|
|
10
|
-
format: s,
|
|
11
|
-
min: d,
|
|
12
|
-
max: u,
|
|
13
|
-
validationMessages: l,
|
|
14
|
-
FieldComponent: m
|
|
15
|
-
}) {
|
|
16
|
-
const { metadata: a, control: n, errorMessage: p } = b(
|
|
17
|
-
o,
|
|
18
|
-
i,
|
|
19
|
-
l
|
|
20
|
-
), e = a[o];
|
|
21
|
-
return /* @__PURE__ */ f(
|
|
22
|
-
c,
|
|
23
|
-
{
|
|
24
|
-
name: o,
|
|
25
|
-
control: n,
|
|
26
|
-
label: r,
|
|
27
|
-
description: t,
|
|
28
|
-
errorMessage: p,
|
|
29
|
-
isRequired: e?.isRequired,
|
|
30
|
-
isDisabled: e?.isDisabled,
|
|
31
|
-
format: s,
|
|
32
|
-
min: d,
|
|
33
|
-
max: u,
|
|
34
|
-
FieldComponent: m
|
|
35
|
-
}
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
export {
|
|
39
|
-
x as NumberInputHookField
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=NumberInputHookField.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInputHookField.js","sources":["../../../../../src/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\nimport { useHookFieldResolution } from '../useHookFieldResolution'\nimport type { BaseFieldProps, ValidationMessages } from '@/types/sdkHooks'\nimport type { BaseFormHookReady } from '@/types/sdkHooks'\nimport { NumberInputField } from '@/components/Common'\nimport type { NumberInputProps } from '@/components/Common/UI/NumberInput/NumberInputTypes'\n\nexport interface NumberInputHookFieldProps<\n TErrorCode extends string = never,\n> extends BaseFieldProps {\n name: string\n formHookResult?: BaseFormHookReady\n format?: NumberInputProps['format']\n min?: NumberInputProps['min']\n max?: NumberInputProps['max']\n validationMessages?: ValidationMessages<TErrorCode>\n FieldComponent?: ComponentType<NumberInputProps>\n}\n\nexport function NumberInputHookField<TErrorCode extends string>({\n name,\n formHookResult,\n label,\n description,\n format,\n min,\n max,\n validationMessages,\n FieldComponent,\n}: NumberInputHookFieldProps<TErrorCode>) {\n const { metadata, control, errorMessage } = useHookFieldResolution(\n name,\n formHookResult,\n validationMessages,\n )\n const fieldMetadata = metadata[name]\n\n return (\n <NumberInputField\n name={name}\n control={control}\n label={label}\n description={description}\n errorMessage={errorMessage}\n isRequired={fieldMetadata?.isRequired}\n isDisabled={fieldMetadata?.isDisabled}\n format={format}\n min={min}\n max={max}\n FieldComponent={FieldComponent}\n />\n )\n}\n"],"names":["NumberInputHookField","name","formHookResult","label","description","format","min","max","validationMessages","FieldComponent","metadata","control","errorMessage","useHookFieldResolution","fieldMetadata","jsx","NumberInputField"],"mappings":";;;;AAmBO,SAASA,EAAgD;AAAA,EAC9D,MAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,QAAAC;AAAA,EACA,KAAAC;AAAA,EACA,KAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,gBAAAC;AACF,GAA0C;AACxC,QAAM,EAAE,UAAAC,GAAU,SAAAC,GAAS,cAAAC,EAAA,IAAiBC;AAAA,IAC1CZ;AAAA,IACAC;AAAA,IACAM;AAAA,EAAA,GAEIM,IAAgBJ,EAAST,CAAI;AAEnC,SACE,gBAAAc;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAf;AAAA,MACA,SAAAU;AAAA,MACA,OAAAR;AAAA,MACA,aAAAC;AAAA,MACA,cAAAQ;AAAA,MACA,YAAYE,GAAe;AAAA,MAC3B,YAAYA,GAAe;AAAA,MAC3B,QAAAT;AAAA,MACA,KAAAC;AAAA,MACA,KAAAC;AAAA,MACA,gBAAAE;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { jsx as R } from "react/jsx-runtime";
|
|
2
|
-
import { useHookFieldResolution as F } from "../useHookFieldResolution.js";
|
|
3
|
-
import { getFieldWithOptions as b } from "../getFieldWithOptions.js";
|
|
4
|
-
import "../../../../shared/constants.js";
|
|
5
|
-
import { RadioGroupField as k } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
6
|
-
function H({
|
|
7
|
-
name: i,
|
|
8
|
-
formHookResult: r,
|
|
9
|
-
label: s,
|
|
10
|
-
description: d,
|
|
11
|
-
validationMessages: a,
|
|
12
|
-
getOptionLabel: e,
|
|
13
|
-
FieldComponent: l
|
|
14
|
-
}) {
|
|
15
|
-
const { metadata: n, control: p, errorMessage: u } = F(
|
|
16
|
-
i,
|
|
17
|
-
r,
|
|
18
|
-
a
|
|
19
|
-
), o = b(n, i), t = o?.options ?? [], m = e && o?.entries ? o.entries.map((f, c) => ({
|
|
20
|
-
value: t[c]?.value ?? "",
|
|
21
|
-
label: e(f)
|
|
22
|
-
})) : t;
|
|
23
|
-
return /* @__PURE__ */ R(
|
|
24
|
-
k,
|
|
25
|
-
{
|
|
26
|
-
name: i,
|
|
27
|
-
control: p,
|
|
28
|
-
label: s,
|
|
29
|
-
description: d,
|
|
30
|
-
errorMessage: u,
|
|
31
|
-
isRequired: o?.isRequired,
|
|
32
|
-
isDisabled: o?.isDisabled,
|
|
33
|
-
options: m,
|
|
34
|
-
FieldComponent: l
|
|
35
|
-
}
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
export {
|
|
39
|
-
H as RadioGroupHookField
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=RadioGroupHookField.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroupHookField.js","sources":["../../../../../src/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\nimport { useHookFieldResolution } from '../useHookFieldResolution'\nimport { getFieldWithOptions } from '../getFieldWithOptions'\nimport type { BaseFieldProps, ValidationMessages } from '@/types/sdkHooks'\nimport type { BaseFormHookReady } from '@/types/sdkHooks'\nimport { RadioGroupField } from '@/components/Common'\nimport type { RadioGroupProps } from '@/components/Common/UI/RadioGroup/RadioGroupTypes'\n\nexport interface RadioGroupHookFieldProps<\n TErrorCode extends string = never,\n TEntry = unknown,\n> extends BaseFieldProps {\n name: string\n formHookResult?: BaseFormHookReady\n validationMessages?: ValidationMessages<TErrorCode>\n getOptionLabel?: (entry: TEntry) => string\n FieldComponent?: ComponentType<RadioGroupProps>\n}\n\nexport function RadioGroupHookField<TErrorCode extends string, TEntry = unknown>({\n name,\n formHookResult,\n label,\n description,\n validationMessages,\n getOptionLabel,\n FieldComponent,\n}: RadioGroupHookFieldProps<TErrorCode, TEntry>) {\n const { metadata, control, errorMessage } = useHookFieldResolution(\n name,\n formHookResult,\n validationMessages,\n )\n const fieldMetadata = getFieldWithOptions<TEntry>(metadata, name)\n\n const defaultOptions = fieldMetadata?.options ?? []\n const options =\n getOptionLabel && fieldMetadata?.entries\n ? fieldMetadata.entries.map((entry, index) => ({\n value: defaultOptions[index]?.value ?? '',\n label: getOptionLabel(entry),\n }))\n : defaultOptions\n\n return (\n <RadioGroupField\n name={name}\n control={control}\n label={label}\n description={description}\n errorMessage={errorMessage}\n isRequired={fieldMetadata?.isRequired}\n isDisabled={fieldMetadata?.isDisabled}\n options={options}\n FieldComponent={FieldComponent}\n />\n )\n}\n"],"names":["RadioGroupHookField","name","formHookResult","label","description","validationMessages","getOptionLabel","FieldComponent","metadata","control","errorMessage","useHookFieldResolution","fieldMetadata","getFieldWithOptions","defaultOptions","options","entry","index","jsx","RadioGroupField"],"mappings":";;;;;AAmBO,SAASA,EAAiE;AAAA,EAC/E,MAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,gBAAAC;AACF,GAAiD;AAC/C,QAAM,EAAE,UAAAC,GAAU,SAAAC,GAAS,cAAAC,EAAA,IAAiBC;AAAA,IAC1CV;AAAA,IACAC;AAAA,IACAG;AAAA,EAAA,GAEIO,IAAgBC,EAA4BL,GAAUP,CAAI,GAE1Da,IAAiBF,GAAe,WAAW,CAAA,GAC3CG,IACJT,KAAkBM,GAAe,UAC7BA,EAAc,QAAQ,IAAI,CAACI,GAAOC,OAAW;AAAA,IAC3C,OAAOH,EAAeG,CAAK,GAAG,SAAS;AAAA,IACvC,OAAOX,EAAeU,CAAK;AAAA,EAAA,EAC3B,IACFF;AAEN,SACE,gBAAAI;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAlB;AAAA,MACA,SAAAQ;AAAA,MACA,OAAAN;AAAA,MACA,aAAAC;AAAA,MACA,cAAAM;AAAA,MACA,YAAYE,GAAe;AAAA,MAC3B,YAAYA,GAAe;AAAA,MAC3B,SAAAG;AAAA,MACA,gBAAAR;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectHookField.js","sources":["../../../../../src/components/UNSTABLE_Hooks/form/fields/SelectHookField.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\nimport { useHookFieldResolution } from '../useHookFieldResolution'\nimport { getFieldWithOptions } from '../getFieldWithOptions'\nimport type { BaseFieldProps, ValidationMessages } from '@/types/sdkHooks'\nimport type { BaseFormHookReady } from '@/types/sdkHooks'\nimport { SelectField } from '@/components/Common'\nimport type { SelectProps } from '@/components/Common/UI/Select/SelectTypes'\n\nexport interface SelectHookFieldProps<\n TErrorCode extends string = never,\n TEntry = unknown,\n> extends BaseFieldProps {\n name: string\n formHookResult?: BaseFormHookReady\n validationMessages?: ValidationMessages<TErrorCode>\n getOptionLabel?: (entry: TEntry) => string\n FieldComponent?: ComponentType<SelectProps>\n}\n\nexport function SelectHookField<TErrorCode extends string, TEntry = unknown>({\n name,\n formHookResult,\n label,\n description,\n validationMessages,\n getOptionLabel,\n FieldComponent,\n}: SelectHookFieldProps<TErrorCode, TEntry>) {\n const { metadata, control, errorMessage } = useHookFieldResolution(\n name,\n formHookResult,\n validationMessages,\n )\n const fieldMetadata = getFieldWithOptions<TEntry>(metadata, name)\n\n const defaultOptions = fieldMetadata?.options ?? []\n const options =\n getOptionLabel && fieldMetadata?.entries\n ? fieldMetadata.entries.map((entry, index) => ({\n value: defaultOptions[index]?.value ?? '',\n label: getOptionLabel(entry),\n }))\n : defaultOptions\n\n return (\n <SelectField\n name={name}\n control={control}\n label={label}\n description={description}\n errorMessage={errorMessage}\n isRequired={fieldMetadata?.isRequired}\n isDisabled={fieldMetadata?.isDisabled}\n options={options}\n FieldComponent={FieldComponent}\n />\n )\n}\n"],"names":["SelectHookField","name","formHookResult","label","description","validationMessages","getOptionLabel","FieldComponent","metadata","control","errorMessage","useHookFieldResolution","fieldMetadata","getFieldWithOptions","defaultOptions","options","entry","index","jsx","SelectField"],"mappings":";;;;;AAmBO,SAASA,EAA6D;AAAA,EAC3E,MAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,gBAAAC;AACF,GAA6C;AAC3C,QAAM,EAAE,UAAAC,GAAU,SAAAC,GAAS,cAAAC,EAAA,IAAiBC;AAAA,IAC1CV;AAAA,IACAC;AAAA,IACAG;AAAA,EAAA,GAEIO,IAAgBC,EAA4BL,GAAUP,CAAI,GAE1Da,IAAiBF,GAAe,WAAW,CAAA,GAC3CG,IACJT,KAAkBM,GAAe,UAC7BA,EAAc,QAAQ,IAAI,CAACI,GAAOC,OAAW;AAAA,IAC3C,OAAOH,EAAeG,CAAK,GAAG,SAAS;AAAA,IACvC,OAAOX,EAAeU,CAAK;AAAA,EAAA,EAC3B,IACFF;AAEN,SACE,gBAAAI;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAlB;AAAA,MACA,SAAAQ;AAAA,MACA,OAAAN;AAAA,MACA,aAAAC;AAAA,MACA,cAAAM;AAAA,MACA,YAAYE,GAAe;AAAA,MAC3B,YAAYA,GAAe;AAAA,MAC3B,SAAAG;AAAA,MACA,gBAAAR;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import { useHookFieldResolution as u } from "../useHookFieldResolution.js";
|
|
3
|
-
import "../../../../shared/constants.js";
|
|
4
|
-
import { SwitchField as f } from "../../../Common/Fields/SwitchField/SwitchField.js";
|
|
5
|
-
function b({
|
|
6
|
-
name: i,
|
|
7
|
-
formHookResult: e,
|
|
8
|
-
label: t,
|
|
9
|
-
description: r,
|
|
10
|
-
validationMessages: s,
|
|
11
|
-
FieldComponent: d
|
|
12
|
-
}) {
|
|
13
|
-
const { metadata: l, control: a, errorMessage: c } = u(
|
|
14
|
-
i,
|
|
15
|
-
e,
|
|
16
|
-
s
|
|
17
|
-
), o = l[i];
|
|
18
|
-
return /* @__PURE__ */ m(
|
|
19
|
-
f,
|
|
20
|
-
{
|
|
21
|
-
name: i,
|
|
22
|
-
control: a,
|
|
23
|
-
label: t,
|
|
24
|
-
description: r,
|
|
25
|
-
errorMessage: c,
|
|
26
|
-
isRequired: o?.isRequired,
|
|
27
|
-
isDisabled: o?.isDisabled,
|
|
28
|
-
FieldComponent: d
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
export {
|
|
33
|
-
b as SwitchHookField
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=SwitchHookField.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SwitchHookField.js","sources":["../../../../../src/components/UNSTABLE_Hooks/form/fields/SwitchHookField.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\nimport { useHookFieldResolution } from '../useHookFieldResolution'\nimport type { BaseFieldProps, ValidationMessages } from '@/types/sdkHooks'\nimport type { BaseFormHookReady } from '@/types/sdkHooks'\nimport { SwitchField } from '@/components/Common'\nimport type { SwitchProps } from '@/components/Common/UI/Switch/SwitchTypes'\n\nexport interface SwitchHookFieldProps<TErrorCode extends string = never> extends BaseFieldProps {\n name: string\n formHookResult?: BaseFormHookReady\n validationMessages?: ValidationMessages<TErrorCode>\n FieldComponent?: ComponentType<SwitchProps>\n}\n\nexport function SwitchHookField<TErrorCode extends string>({\n name,\n formHookResult,\n label,\n description,\n validationMessages,\n FieldComponent,\n}: SwitchHookFieldProps<TErrorCode>) {\n const { metadata, control, errorMessage } = useHookFieldResolution(\n name,\n formHookResult,\n validationMessages,\n )\n const fieldMetadata = metadata[name]\n\n return (\n <SwitchField\n name={name}\n control={control}\n label={label}\n description={description}\n errorMessage={errorMessage}\n isRequired={fieldMetadata?.isRequired}\n isDisabled={fieldMetadata?.isDisabled}\n FieldComponent={FieldComponent}\n />\n )\n}\n"],"names":["SwitchHookField","name","formHookResult","label","description","validationMessages","FieldComponent","metadata","control","errorMessage","useHookFieldResolution","fieldMetadata","jsx","SwitchField"],"mappings":";;;;AAcO,SAASA,EAA2C;AAAA,EACzD,MAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,gBAAAC;AACF,GAAqC;AACnC,QAAM,EAAE,UAAAC,GAAU,SAAAC,GAAS,cAAAC,EAAA,IAAiBC;AAAA,IAC1CT;AAAA,IACAC;AAAA,IACAG;AAAA,EAAA,GAEIM,IAAgBJ,EAASN,CAAI;AAEnC,SACE,gBAAAW;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAZ;AAAA,MACA,SAAAO;AAAA,MACA,OAAAL;AAAA,MACA,aAAAC;AAAA,MACA,cAAAK;AAAA,MACA,YAAYE,GAAe;AAAA,MAC3B,YAAYA,GAAe;AAAA,MAC3B,gBAAAL;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import { useHookFieldResolution as f } from "../useHookFieldResolution.js";
|
|
3
|
-
import "../../../../shared/constants.js";
|
|
4
|
-
import { TextInputField as c } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
5
|
-
function k({
|
|
6
|
-
name: o,
|
|
7
|
-
formHookResult: t,
|
|
8
|
-
label: i,
|
|
9
|
-
description: r,
|
|
10
|
-
validationMessages: s,
|
|
11
|
-
transform: d,
|
|
12
|
-
placeholder: l,
|
|
13
|
-
FieldComponent: u
|
|
14
|
-
}) {
|
|
15
|
-
const { metadata: a, control: n, errorMessage: p } = f(
|
|
16
|
-
o,
|
|
17
|
-
t,
|
|
18
|
-
s
|
|
19
|
-
), e = a[o];
|
|
20
|
-
return /* @__PURE__ */ m(
|
|
21
|
-
c,
|
|
22
|
-
{
|
|
23
|
-
name: o,
|
|
24
|
-
control: n,
|
|
25
|
-
label: i,
|
|
26
|
-
description: r,
|
|
27
|
-
errorMessage: p,
|
|
28
|
-
isRequired: e?.isRequired,
|
|
29
|
-
isDisabled: e?.isDisabled,
|
|
30
|
-
transform: d,
|
|
31
|
-
placeholder: l,
|
|
32
|
-
FieldComponent: u
|
|
33
|
-
}
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
export {
|
|
37
|
-
k as TextInputHookField
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=TextInputHookField.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TextInputHookField.js","sources":["../../../../../src/components/UNSTABLE_Hooks/form/fields/TextInputHookField.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\nimport { useHookFieldResolution } from '../useHookFieldResolution'\nimport type { BaseFieldProps, ValidationMessages } from '@/types/sdkHooks'\nimport type { BaseFormHookReady } from '@/types/sdkHooks'\nimport { TextInputField } from '@/components/Common'\nimport type { TextInputProps } from '@/components/Common/UI/TextInput/TextInputTypes'\n\nexport interface TextInputHookFieldProps<\n TErrorCode extends string = never,\n TOptionalErrorCode extends string = never,\n> extends BaseFieldProps {\n name: string\n formHookResult?: BaseFormHookReady\n validationMessages?: ValidationMessages<TErrorCode, TOptionalErrorCode>\n transform?: (value: string) => string\n placeholder?: string\n FieldComponent?: ComponentType<TextInputProps>\n}\n\nexport function TextInputHookField<\n TErrorCode extends string,\n TOptionalErrorCode extends string = never,\n>({\n name,\n formHookResult,\n label,\n description,\n validationMessages,\n transform,\n placeholder,\n FieldComponent,\n}: TextInputHookFieldProps<TErrorCode, TOptionalErrorCode>) {\n const { metadata, control, errorMessage } = useHookFieldResolution(\n name,\n formHookResult,\n validationMessages,\n )\n const fieldMetadata = metadata[name]\n\n return (\n <TextInputField\n name={name}\n control={control}\n label={label}\n description={description}\n errorMessage={errorMessage}\n isRequired={fieldMetadata?.isRequired}\n isDisabled={fieldMetadata?.isDisabled}\n transform={transform}\n placeholder={placeholder}\n FieldComponent={FieldComponent}\n />\n )\n}\n"],"names":["TextInputHookField","name","formHookResult","label","description","validationMessages","transform","placeholder","FieldComponent","metadata","control","errorMessage","useHookFieldResolution","fieldMetadata","jsx","TextInputField"],"mappings":";;;;AAmBO,SAASA,EAGd;AAAA,EACA,MAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,gBAAAC;AACF,GAA4D;AAC1D,QAAM,EAAE,UAAAC,GAAU,SAAAC,GAAS,cAAAC,EAAA,IAAiBC;AAAA,IAC1CX;AAAA,IACAC;AAAA,IACAG;AAAA,EAAA,GAEIQ,IAAgBJ,EAASR,CAAI;AAEnC,SACE,gBAAAa;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAd;AAAA,MACA,SAAAS;AAAA,MACA,OAAAP;AAAA,MACA,aAAAC;AAAA,MACA,cAAAO;AAAA,MACA,YAAYE,GAAe;AAAA,MAC3B,YAAYA,GAAe;AAAA,MAC3B,WAAAP;AAAA,MACA,aAAAC;AAAA,MACA,gBAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getFieldWithOptions.js","sources":["../../../../src/components/UNSTABLE_Hooks/form/getFieldWithOptions.ts"],"sourcesContent":["import type { FieldMetadataWithOptions, FieldsMetadata } from '@/types/sdkHooks'\n\nexport function getFieldWithOptions<TEntry = unknown>(\n metadata: FieldsMetadata,\n name: string,\n): FieldMetadataWithOptions<TEntry> | undefined {\n const field = metadata[name]\n if (field && 'options' in field) return field as FieldMetadataWithOptions<TEntry>\n return undefined\n}\n"],"names":["getFieldWithOptions","metadata","name","field"],"mappings":"AAEO,SAASA,EACdC,GACAC,GAC8C;AAC9C,QAAMC,IAAQF,EAASC,CAAI;AAC3B,MAAIC,KAAS,aAAaA,EAAO,QAAOA;AAE1C;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getFormSubmissionValues.js","sources":["../../../../src/components/UNSTABLE_Hooks/form/getFormSubmissionValues.ts"],"sourcesContent":["import type { FieldValues, UseFormReturn } from 'react-hook-form'\nimport type { ZodTypeAny } from 'zod'\n\n/**\n * Creates a typed getter that returns the current form values parsed through\n * the Zod schema. The result matches what `handleSubmit` would provide to its\n * valid callback — all preprocessing transforms (e.g. string→boolean coercion)\n * are applied.\n *\n * Returns `undefined` when the current form state does not satisfy the schema\n * (e.g. required fields are empty, cross-field rules fail). This is safe to call\n * at any time — it never throws.\n *\n * **Side effects:** None. `getValues()` is a synchronous read from react-hook-form's\n * internal store — it does not trigger re-renders, mutate form state, or update\n * validation errors. `safeParse()` is a pure validation/transform that creates\n * a new object without mutating the input.\n */\nexport function createGetFormSubmissionValues<TFormData extends FieldValues, TFormOutputs>(\n formMethods: UseFormReturn<TFormData, unknown, TFormOutputs>,\n schema: ZodTypeAny,\n): () => TFormOutputs | undefined {\n return () => {\n const result = schema.safeParse(formMethods.getValues())\n return result.success ? (result.data as TFormOutputs) : undefined\n }\n}\n"],"names":["createGetFormSubmissionValues","formMethods","schema","result"],"mappings":"AAkBO,SAASA,EACdC,GACAC,GACgC;AAChC,SAAO,MAAM;AACX,UAAMC,IAASD,EAAO,UAAUD,EAAY,WAAW;AACvD,WAAOE,EAAO,UAAWA,EAAO,OAAwB;AAAA,EAC1D;AACF;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preprocessors.js","sources":["../../../../src/components/UNSTABLE_Hooks/form/preprocessors.ts"],"sourcesContent":["export function coerceNaN(fallback: number) {\n return (val: unknown): number => {\n if (val === undefined || val === null) return fallback\n if (typeof val === 'number' && Number.isNaN(val)) return fallback\n return val as number\n }\n}\n\nexport function coerceToISODate(val: unknown): string | null {\n if (val instanceof Date) return val.toISOString().split('T')[0]!\n if (val === null || val === '' || val === undefined) return null\n return val as string\n}\n\nexport function coerceStringBoolean(val: unknown): boolean | undefined {\n if (typeof val === 'string') return val === 'true'\n return val as boolean | undefined\n}\n"],"names":["coerceNaN","fallback","val","coerceToISODate","coerceStringBoolean"],"mappings":"AAAO,SAASA,EAAUC,GAAkB;AAC1C,SAAO,CAACC,MACmBA,KAAQ,QAC7B,OAAOA,KAAQ,YAAY,OAAO,MAAMA,CAAG,IAAUD,IAClDC;AAEX;AAEO,SAASC,EAAgBD,GAA6B;AAC3D,SAAIA,aAAe,OAAaA,EAAI,cAAc,MAAM,GAAG,EAAE,CAAC,IAC1DA,MAAQ,QAAQA,MAAQ,MAAMA,MAAQ,SAAkB,OACrDA;AACT;AAEO,SAASE,EAAoBF,GAAmC;AACrE,SAAI,OAAOA,KAAQ,WAAiBA,MAAQ,SACrCA;AACT;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveFieldError.js","sources":["../../../../src/components/UNSTABLE_Hooks/form/resolveFieldError.ts"],"sourcesContent":["import type { FieldErrors } from 'react-hook-form'\nimport { get } from 'react-hook-form'\nimport type { ValidationMessages } from '@/types/sdkHooks'\nimport type { SDKError } from '@/types/sdkError'\n\nexport function resolveFieldError<\n TErrorCode extends string,\n TOptionalErrorCode extends string = never,\n>(\n fieldName: string,\n formErrors: FieldErrors,\n sdkErrors: SDKError[],\n validationMessages?: ValidationMessages<TErrorCode, TOptionalErrorCode>,\n): string | undefined {\n const fieldError = get(formErrors, fieldName) as { message?: string } | undefined\n const errorCode = fieldError?.message as TErrorCode | undefined\n if (errorCode && validationMessages?.[errorCode]) {\n return validationMessages[errorCode]\n }\n\n for (const sdkError of sdkErrors) {\n const sdkFieldError = sdkError.fieldErrors.find(fe => fe.field === fieldName)\n if (sdkFieldError?.message) return sdkFieldError.message\n }\n\n return undefined\n}\n"],"names":["resolveFieldError","fieldName","formErrors","sdkErrors","validationMessages","errorCode","get","sdkError","sdkFieldError","fe"],"mappings":";AAKO,SAASA,EAIdC,GACAC,GACAC,GACAC,GACoB;AAEpB,QAAMC,IADaC,EAAIJ,GAAYD,CAAS,GACd;AAC9B,MAAII,KAAaD,IAAqBC,CAAS;AAC7C,WAAOD,EAAmBC,CAAS;AAGrC,aAAWE,KAAYJ,GAAW;AAChC,UAAMK,IAAgBD,EAAS,YAAY,KAAK,CAAAE,MAAMA,EAAG,UAAUR,CAAS;AAC5E,QAAIO,GAAe,QAAS,QAAOA,EAAc;AAAA,EACnD;AAGF;"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { useMemo as o } from "react";
|
|
2
|
-
import { useWatch as c } from "react-hook-form";
|
|
3
|
-
function u(t, n) {
|
|
4
|
-
const { predicateDeps: e } = t, r = e.length > 0, s = c({
|
|
5
|
-
control: n,
|
|
6
|
-
name: r ? e : [],
|
|
7
|
-
disabled: !r
|
|
8
|
-
});
|
|
9
|
-
return o(() => {
|
|
10
|
-
if (!r)
|
|
11
|
-
return t.getFieldsMetadata();
|
|
12
|
-
const i = {};
|
|
13
|
-
for (let a = 0; a < e.length; a++)
|
|
14
|
-
i[e[a]] = Array.isArray(s) ? s[a] : s;
|
|
15
|
-
return t.getFieldsMetadata(i);
|
|
16
|
-
}, [t, r, e, s]);
|
|
17
|
-
}
|
|
18
|
-
export {
|
|
19
|
-
u as useDeriveFieldsMetadata
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=useDeriveFieldsMetadata.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDeriveFieldsMetadata.js","sources":["../../../../src/components/UNSTABLE_Hooks/form/useDeriveFieldsMetadata.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport type { Control, FieldPath, FieldValues } from 'react-hook-form'\nimport { useWatch } from 'react-hook-form'\nimport type { z } from 'zod'\nimport type { FieldsMetadataConfig } from './buildFormSchema'\nimport type { FieldMetadata } from '@/types/sdkHooks'\n\n/**\n * Resolves dynamic field metadata (e.g. `isRequired` driven by predicate\n * rules) by watching only the form fields that predicates actually read.\n *\n * `buildFormSchema` auto-detects predicate dependencies via a recording\n * Proxy and exposes them as `predicateDeps`. This hook subscribes to only\n * those fields, so typing into unrelated inputs does not trigger re-renders\n * — preserving react-hook-form's per-field optimization.\n *\n * When no predicates exist (`predicateDeps` is empty), the hook skips\n * `useWatch` entirely and returns static metadata.\n */\nexport function useDeriveFieldsMetadata<\n T extends Record<string, z.ZodType>,\n TFormData extends FieldValues = FieldValues,\n>(\n metadataConfig: FieldsMetadataConfig<T>,\n control: Control<TFormData>,\n): Record<keyof T, FieldMetadata> {\n const { predicateDeps } = metadataConfig\n const hasDeps = predicateDeps.length > 0\n\n const watchedValues = useWatch({\n control,\n name: hasDeps ? (predicateDeps as FieldPath<TFormData>[]) : ([] as never[]),\n disabled: !hasDeps,\n })\n\n return useMemo(() => {\n if (!hasDeps) {\n return metadataConfig.getFieldsMetadata()\n }\n\n const data: Record<string, unknown> = {}\n for (let i = 0; i < predicateDeps.length; i++) {\n data[predicateDeps[i]!] = Array.isArray(watchedValues) ? watchedValues[i] : watchedValues\n }\n return metadataConfig.getFieldsMetadata(data)\n }, [metadataConfig, hasDeps, predicateDeps, watchedValues])\n}\n"],"names":["useDeriveFieldsMetadata","metadataConfig","control","predicateDeps","hasDeps","watchedValues","useWatch","useMemo","data","i"],"mappings":";;AAmBO,SAASA,EAIdC,GACAC,GACgC;AAChC,QAAM,EAAE,eAAAC,MAAkBF,GACpBG,IAAUD,EAAc,SAAS,GAEjCE,IAAgBC,EAAS;AAAA,IAC7B,SAAAJ;AAAA,IACA,MAAME,IAAWD,IAA4C,CAAA;AAAA,IAC7D,UAAU,CAACC;AAAA,EAAA,CACZ;AAED,SAAOG,EAAQ,MAAM;AACnB,QAAI,CAACH;AACH,aAAOH,EAAe,kBAAA;AAGxB,UAAMO,IAAgC,CAAA;AACtC,aAASC,IAAI,GAAGA,IAAIN,EAAc,QAAQM;AACxC,MAAAD,EAAKL,EAAcM,CAAC,CAAE,IAAI,MAAM,QAAQJ,CAAa,IAAIA,EAAcI,CAAC,IAAIJ;AAE9E,WAAOJ,EAAe,kBAAkBO,CAAI;AAAA,EAC9C,GAAG,CAACP,GAAgBG,GAASD,GAAeE,CAAa,CAAC;AAC5D;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFieldErrorMessage.js","sources":["../../../../src/components/UNSTABLE_Hooks/form/useFieldErrorMessage.ts"],"sourcesContent":["import { useFormContext, get } from 'react-hook-form'\nimport { useFormFieldsMetadataContext } from './FormFieldsMetadataContext'\nimport type { ValidationMessages } from '@/types/sdkHooks'\n\nexport function useFieldErrorMessage<TErrorCode extends string>(\n fieldName: string,\n validationMessages?: ValidationMessages<TErrorCode>,\n): string | undefined {\n const {\n formState: { errors },\n } = useFormContext()\n const context = useFormFieldsMetadataContext()\n const sdkErrors = context?.errors ?? []\n\n const fieldError = get(errors, fieldName) as { message?: string } | undefined\n const errorCode = fieldError?.message as TErrorCode | undefined\n if (errorCode && validationMessages?.[errorCode]) {\n return validationMessages[errorCode]\n }\n\n for (const sdkError of sdkErrors) {\n const sdkFieldError = sdkError.fieldErrors.find(fe => fe.field === fieldName)\n if (sdkFieldError?.message) return sdkFieldError.message\n }\n\n return undefined\n}\n"],"names":["useFieldErrorMessage","fieldName","validationMessages","errors","useFormContext","sdkErrors","useFormFieldsMetadataContext","errorCode","get","sdkError","sdkFieldError","fe"],"mappings":";;AAIO,SAASA,EACdC,GACAC,GACoB;AACpB,QAAM;AAAA,IACJ,WAAW,EAAE,QAAAC,EAAA;AAAA,EAAO,IAClBC,EAAA,GAEEC,IADUC,EAAA,GACW,UAAU,CAAA,GAG/BC,IADaC,EAAIL,GAAQF,CAAS,GACV;AAC9B,MAAIM,KAAaL,IAAqBK,CAAS;AAC7C,WAAOL,EAAmBK,CAAS;AAGrC,aAAWE,KAAYJ,GAAW;AAChC,UAAMK,IAAgBD,EAAS,YAAY,KAAK,CAAAE,MAAMA,EAAG,UAAUV,CAAS;AAC5E,QAAIS,GAAe,QAAS,QAAOA,EAAc;AAAA,EACnD;AAGF;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useHookFieldResolution.js","sources":["../../../../src/components/UNSTABLE_Hooks/form/useHookFieldResolution.ts"],"sourcesContent":["import type { Control } from 'react-hook-form'\nimport { useFormState } from 'react-hook-form'\nimport { useFormFieldsMetadataContext } from './FormFieldsMetadataContext'\nimport { resolveFieldError } from './resolveFieldError'\nimport type { FieldsMetadata, ValidationMessages, BaseFormHookReady } from '@/types/sdkHooks'\n\ninterface HookFieldResolution {\n metadata: FieldsMetadata\n control: Control | undefined\n errorMessage: string | undefined\n}\n\n/**\n * Resolves all data a HookField needs from either a `formHookResult` prop or\n * the standard context providers (FormProvider + FormFieldsMetadataProvider).\n *\n * When `formHookResult` is provided, metadata/errors/control are read from\n * the prop — no context providers required. When absent, falls back to the\n * existing context-based path.\n *\n * Uses `useFormState` to establish a proper RHF subscription for error updates.\n * When `control` is provided (prop path), useFormState subscribes directly via\n * the control object. When absent (context path), it falls back to useFormContext\n * internally. The `name` parameter scopes the subscription to this field.\n */\nexport function useHookFieldResolution<\n TErrorCode extends string,\n TOptionalErrorCode extends string = never,\n>(\n name: string,\n formHookResult: BaseFormHookReady | undefined,\n validationMessages?: ValidationMessages<TErrorCode, TOptionalErrorCode>,\n): HookFieldResolution {\n const metadataContext = useFormFieldsMetadataContext()\n\n const metadata = formHookResult?.form.fieldsMetadata ?? metadataContext?.metadata ?? {}\n\n const control = formHookResult?.form.hookFormInternals.formMethods.control\n\n const { errors: formErrors } = useFormState({ control, name })\n\n const sdkErrors = formHookResult\n ? formHookResult.errorHandling.errors\n : (metadataContext?.errors ?? [])\n\n const errorMessage = resolveFieldError(name, formErrors, sdkErrors, validationMessages)\n\n return { metadata, control, errorMessage }\n}\n"],"names":["useHookFieldResolution","name","formHookResult","validationMessages","metadataContext","useFormFieldsMetadataContext","metadata","control","formErrors","useFormState","sdkErrors","errorMessage","resolveFieldError"],"mappings":";;;AAyBO,SAASA,EAIdC,GACAC,GACAC,GACqB;AACrB,QAAMC,IAAkBC,EAAA,GAElBC,IAAWJ,GAAgB,KAAK,kBAAkBE,GAAiB,YAAY,CAAA,GAE/EG,IAAUL,GAAgB,KAAK,kBAAkB,YAAY,SAE7D,EAAE,QAAQM,EAAA,IAAeC,EAAa,EAAE,SAAAF,GAAS,MAAAN,GAAM,GAEvDS,IAAYR,IACdA,EAAe,cAAc,SAC5BE,GAAiB,UAAU,CAAA,GAE1BO,IAAeC,EAAkBX,GAAMO,GAAYE,GAAWP,CAAkB;AAEtF,SAAO,EAAE,UAAAG,GAAU,SAAAC,GAAS,cAAAI,EAAA;AAC9B;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withOptions.js","sources":["../../../../src/components/UNSTABLE_Hooks/form/withOptions.ts"],"sourcesContent":["import type { FieldMetadata, FieldMetadataWithOptions } from '@/types/sdkHooks'\n\nexport function withOptions<TEntry = unknown>(\n base: FieldMetadata,\n options: Array<{ label: string; value: string }>,\n entries?: TEntry[],\n): FieldMetadataWithOptions<TEntry> {\n if (entries !== undefined) {\n return { ...base, options, entries }\n }\n return { ...base, options }\n}\n"],"names":["withOptions","base","options","entries"],"mappings":"AAEO,SAASA,EACdC,GACAC,GACAC,GACkC;AAClC,SAAIA,MAAY,SACP,EAAE,GAAGF,GAAM,SAAAC,GAAS,SAAAC,EAAA,IAEtB,EAAE,GAAGF,GAAM,SAAAC,EAAA;AACpB;"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { UseCompensationFormProps } from './useCompensationForm';
|
|
2
|
-
import { BaseComponentInterface } from '../../../Base';
|
|
3
|
-
export interface CompensationFormProps extends UseCompensationFormProps, Omit<BaseComponentInterface, 'defaultValues'> {
|
|
4
|
-
}
|
|
5
|
-
export declare function CompensationForm({ FallbackComponent, ...props }: CompensationFormProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { jsx as t, jsxs as u } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as R, Trans as C } from "react-i18next";
|
|
3
|
-
import { SDKFormProvider as D } from "../../form/SDKFormProvider.js";
|
|
4
|
-
import { useCompensationForm as f } from "./useCompensationForm.js";
|
|
5
|
-
import { useComponentContext as b } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
-
import { BaseBoundaries as L, BaseLayout as d } from "../../../Base/Base.js";
|
|
7
|
-
import "../../../Base/useBase.js";
|
|
8
|
-
import { Form as M } from "../../../Common/Form/Form.js";
|
|
9
|
-
import { FLSA_OVERTIME_SALARY_LIMIT as U, componentEvents as r } from "../../../../shared/constants.js";
|
|
10
|
-
import { ActionsLayout as T } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
11
|
-
import { useI18n as I, useComponentDictionary as S } from "../../../../i18n/I18n.js";
|
|
12
|
-
import g from "../../../../hooks/useNumberFormatter.js";
|
|
13
|
-
function W({ onEvent: n, dictionary: l, ...E }) {
|
|
14
|
-
I("UNSTABLE.CompensationForm"), S("UNSTABLE.CompensationForm", l);
|
|
15
|
-
const { t: e } = R("UNSTABLE.CompensationForm"), m = b(), c = g("currency"), a = f(E);
|
|
16
|
-
if (a.isLoading)
|
|
17
|
-
return /* @__PURE__ */ t(d, { isLoading: !0, error: a.errorHandling.errors });
|
|
18
|
-
const { Fields: i } = a.form, p = async () => {
|
|
19
|
-
const o = await a.actions.onSubmit({
|
|
20
|
-
onJobCreated: (s) => {
|
|
21
|
-
n(r.EMPLOYEE_JOB_CREATED, s);
|
|
22
|
-
},
|
|
23
|
-
onJobUpdated: (s) => {
|
|
24
|
-
n(r.EMPLOYEE_JOB_UPDATED, s);
|
|
25
|
-
},
|
|
26
|
-
onCompensationUpdated: (s) => {
|
|
27
|
-
n(r.EMPLOYEE_COMPENSATION_UPDATED, s);
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
o && n(r.EMPLOYEE_COMPENSATION_DONE, o.data);
|
|
31
|
-
};
|
|
32
|
-
return /* @__PURE__ */ t(d, { error: a.errorHandling.errors, children: /* @__PURE__ */ t(D, { formHookResult: a, children: /* @__PURE__ */ u(
|
|
33
|
-
M,
|
|
34
|
-
{
|
|
35
|
-
onSubmit: (o) => {
|
|
36
|
-
o.preventDefault(), p();
|
|
37
|
-
},
|
|
38
|
-
children: [
|
|
39
|
-
/* @__PURE__ */ t(m.Heading, { as: "h2", children: a.status.mode === "create" ? e("addTitle") : e("editTitle") }),
|
|
40
|
-
i.StartDate && /* @__PURE__ */ t(
|
|
41
|
-
i.StartDate,
|
|
42
|
-
{
|
|
43
|
-
label: e("startDateLabel"),
|
|
44
|
-
validationMessages: {
|
|
45
|
-
REQUIRED: e("fieldValidations.startDate.REQUIRED")
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
),
|
|
49
|
-
/* @__PURE__ */ t(
|
|
50
|
-
i.JobTitle,
|
|
51
|
-
{
|
|
52
|
-
label: e("jobTitle"),
|
|
53
|
-
validationMessages: {
|
|
54
|
-
REQUIRED: e("fieldValidations.jobTitle.REQUIRED")
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
),
|
|
58
|
-
i.FlsaStatus && /* @__PURE__ */ t(
|
|
59
|
-
i.FlsaStatus,
|
|
60
|
-
{
|
|
61
|
-
label: e("employeeClassification"),
|
|
62
|
-
description: /* @__PURE__ */ t(
|
|
63
|
-
C,
|
|
64
|
-
{
|
|
65
|
-
t: e,
|
|
66
|
-
i18nKey: "classificationLink",
|
|
67
|
-
components: {
|
|
68
|
-
ClassificationLink: /* @__PURE__ */ t(m.Link, {})
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
),
|
|
72
|
-
getOptionLabel: (o) => e(`flsaStatusLabels.${o}`, o),
|
|
73
|
-
validationMessages: {
|
|
74
|
-
REQUIRED: e("fieldValidations.flsaStatus.REQUIRED")
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
),
|
|
78
|
-
/* @__PURE__ */ t(
|
|
79
|
-
i.Rate,
|
|
80
|
-
{
|
|
81
|
-
label: e("amount"),
|
|
82
|
-
validationMessages: {
|
|
83
|
-
REQUIRED: e("fieldValidations.rate.REQUIRED"),
|
|
84
|
-
RATE_MINIMUM: e("fieldValidations.rate.RATE_MINIMUM"),
|
|
85
|
-
RATE_EXEMPT_THRESHOLD: e("fieldValidations.rate.RATE_EXEMPT_THRESHOLD", {
|
|
86
|
-
limit: c(U)
|
|
87
|
-
})
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
),
|
|
91
|
-
/* @__PURE__ */ t(
|
|
92
|
-
i.PaymentUnit,
|
|
93
|
-
{
|
|
94
|
-
label: e("paymentUnitLabel"),
|
|
95
|
-
description: e("paymentUnitDescription"),
|
|
96
|
-
getOptionLabel: (o) => e(`paymentUnitOptions.${o}`, o),
|
|
97
|
-
validationMessages: {
|
|
98
|
-
REQUIRED: e("fieldValidations.paymentUnit.REQUIRED")
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
),
|
|
102
|
-
i.AdjustForMinimumWage && /* @__PURE__ */ t(
|
|
103
|
-
i.AdjustForMinimumWage,
|
|
104
|
-
{
|
|
105
|
-
label: e("adjustForMinimumWage"),
|
|
106
|
-
description: e("adjustForMinimumWageDescription")
|
|
107
|
-
}
|
|
108
|
-
),
|
|
109
|
-
i.MinimumWageId && /* @__PURE__ */ t(
|
|
110
|
-
i.MinimumWageId,
|
|
111
|
-
{
|
|
112
|
-
label: e("minimumWageLabel"),
|
|
113
|
-
description: e("minimumWageDescription"),
|
|
114
|
-
validationMessages: {
|
|
115
|
-
REQUIRED: e("fieldValidations.minimumWageId.REQUIRED")
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
),
|
|
119
|
-
i.TwoPercentShareholder && /* @__PURE__ */ t(i.TwoPercentShareholder, { label: e("twoPercentStakeholderLabel") }),
|
|
120
|
-
i.StateWcCovered && /* @__PURE__ */ t(
|
|
121
|
-
i.StateWcCovered,
|
|
122
|
-
{
|
|
123
|
-
label: e("stateWcCoveredLabel"),
|
|
124
|
-
description: e("stateWcCoveredDescription"),
|
|
125
|
-
getOptionLabel: (o) => e(o ? "stateWcCoveredYes" : "stateWcCoveredNo")
|
|
126
|
-
}
|
|
127
|
-
),
|
|
128
|
-
i.StateWcClassCode && /* @__PURE__ */ t(
|
|
129
|
-
i.StateWcClassCode,
|
|
130
|
-
{
|
|
131
|
-
label: e("stateWcClassCodeLabel"),
|
|
132
|
-
description: e("stateWcClassCodeDescription"),
|
|
133
|
-
validationMessages: {
|
|
134
|
-
REQUIRED: e("fieldValidations.stateWcClassCode.REQUIRED")
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
),
|
|
138
|
-
/* @__PURE__ */ t(T, { children: /* @__PURE__ */ t(m.Button, { type: "submit", isLoading: a.status.isPending, children: e("saveNewJobCta") }) })
|
|
139
|
-
]
|
|
140
|
-
}
|
|
141
|
-
) }) });
|
|
142
|
-
}
|
|
143
|
-
function j({ FallbackComponent: n, ...l }) {
|
|
144
|
-
return /* @__PURE__ */ t(L, { componentName: "UNSTABLE.CompensationForm", FallbackComponent: n, children: /* @__PURE__ */ t(W, { ...l }) });
|
|
145
|
-
}
|
|
146
|
-
export {
|
|
147
|
-
j as CompensationForm
|
|
148
|
-
};
|
|
149
|
-
//# sourceMappingURL=CompensationForm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CompensationForm.js","sources":["../../../../../src/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { SDKFormProvider } from '../../form/SDKFormProvider'\nimport { useCompensationForm } from './useCompensationForm'\nimport type { UseCompensationFormProps } from './useCompensationForm'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { BaseBoundaries, BaseLayout, type BaseComponentInterface } from '@/components/Base'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { componentEvents, FLSA_OVERTIME_SALARY_LIMIT } from '@/shared/constants'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\n\nexport interface CompensationFormProps\n extends UseCompensationFormProps, Omit<BaseComponentInterface, 'defaultValues'> {}\n\nfunction CompensationFormRoot({ onEvent, dictionary, ...hookProps }: CompensationFormProps) {\n useI18n('UNSTABLE.CompensationForm')\n useComponentDictionary('UNSTABLE.CompensationForm', dictionary)\n const { t } = useTranslation('UNSTABLE.CompensationForm')\n const Components = useComponentContext()\n const formatCurrency = useNumberFormatter('currency')\n const compensation = useCompensationForm(hookProps)\n\n if (compensation.isLoading) {\n return <BaseLayout isLoading error={compensation.errorHandling.errors} />\n }\n\n const { Fields } = compensation.form\n\n const handleSubmit = async () => {\n const result = await compensation.actions.onSubmit({\n onJobCreated: job => {\n onEvent(componentEvents.EMPLOYEE_JOB_CREATED, job)\n },\n onJobUpdated: job => {\n onEvent(componentEvents.EMPLOYEE_JOB_UPDATED, job)\n },\n onCompensationUpdated: comp => {\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_UPDATED, comp)\n },\n })\n if (result) {\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_DONE, result.data)\n }\n }\n\n return (\n <BaseLayout error={compensation.errorHandling.errors}>\n <SDKFormProvider formHookResult={compensation}>\n <Form\n onSubmit={e => {\n e.preventDefault()\n void handleSubmit()\n }}\n >\n <Components.Heading as=\"h2\">\n {compensation.status.mode === 'create' ? t('addTitle') : t('editTitle')}\n </Components.Heading>\n\n {Fields.StartDate && (\n <Fields.StartDate\n label={t('startDateLabel')}\n validationMessages={{\n REQUIRED: t('fieldValidations.startDate.REQUIRED'),\n }}\n />\n )}\n\n <Fields.JobTitle\n label={t('jobTitle')}\n validationMessages={{\n REQUIRED: t('fieldValidations.jobTitle.REQUIRED'),\n }}\n />\n\n {Fields.FlsaStatus && (\n <Fields.FlsaStatus\n label={t('employeeClassification')}\n description={\n <Trans\n t={t}\n i18nKey=\"classificationLink\"\n components={{\n ClassificationLink: <Components.Link />,\n }}\n />\n }\n getOptionLabel={status => t(`flsaStatusLabels.${status}`, status)}\n validationMessages={{\n REQUIRED: t('fieldValidations.flsaStatus.REQUIRED'),\n }}\n />\n )}\n\n <Fields.Rate\n label={t('amount')}\n validationMessages={{\n REQUIRED: t('fieldValidations.rate.REQUIRED'),\n RATE_MINIMUM: t('fieldValidations.rate.RATE_MINIMUM'),\n RATE_EXEMPT_THRESHOLD: t('fieldValidations.rate.RATE_EXEMPT_THRESHOLD', {\n limit: formatCurrency(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n />\n\n <Fields.PaymentUnit\n label={t('paymentUnitLabel')}\n description={t('paymentUnitDescription')}\n getOptionLabel={unit => t(`paymentUnitOptions.${unit}`, unit)}\n validationMessages={{\n REQUIRED: t('fieldValidations.paymentUnit.REQUIRED'),\n }}\n />\n\n {Fields.AdjustForMinimumWage && (\n <Fields.AdjustForMinimumWage\n label={t('adjustForMinimumWage')}\n description={t('adjustForMinimumWageDescription')}\n />\n )}\n\n {Fields.MinimumWageId && (\n <Fields.MinimumWageId\n label={t('minimumWageLabel')}\n description={t('minimumWageDescription')}\n validationMessages={{\n REQUIRED: t('fieldValidations.minimumWageId.REQUIRED'),\n }}\n />\n )}\n\n {Fields.TwoPercentShareholder && (\n <Fields.TwoPercentShareholder label={t('twoPercentStakeholderLabel')} />\n )}\n\n {Fields.StateWcCovered && (\n <Fields.StateWcCovered\n label={t('stateWcCoveredLabel')}\n description={t('stateWcCoveredDescription')}\n getOptionLabel={key => (key ? t('stateWcCoveredYes') : t('stateWcCoveredNo'))}\n />\n )}\n\n {Fields.StateWcClassCode && (\n <Fields.StateWcClassCode\n label={t('stateWcClassCodeLabel')}\n description={t('stateWcClassCodeDescription')}\n validationMessages={{\n REQUIRED: t('fieldValidations.stateWcClassCode.REQUIRED'),\n }}\n />\n )}\n\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={compensation.status.isPending}>\n {t('saveNewJobCta')}\n </Components.Button>\n </ActionsLayout>\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n )\n}\n\nexport function CompensationForm({ FallbackComponent, ...props }: CompensationFormProps) {\n return (\n <BaseBoundaries componentName=\"UNSTABLE.CompensationForm\" FallbackComponent={FallbackComponent}>\n <CompensationFormRoot {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["CompensationFormRoot","onEvent","dictionary","hookProps","useI18n","useComponentDictionary","t","useTranslation","Components","useComponentContext","formatCurrency","useNumberFormatter","compensation","useCompensationForm","BaseLayout","Fields","handleSubmit","result","job","componentEvents","comp","jsx","SDKFormProvider","jsxs","Form","e","Trans","status","FLSA_OVERTIME_SALARY_LIMIT","unit","key","ActionsLayout","CompensationForm","FallbackComponent","props","BaseBoundaries"],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compensationSchema.js","sources":["../../../../../src/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n buildFormSchema,\n type RequiredFieldConfig,\n type OptionalFieldsToRequire,\n} from '../../form/buildFormSchema'\nimport { coerceNaN, coerceToISODate, coerceStringBoolean } from '../../form/preprocessors'\nimport { FLSA_OVERTIME_SALARY_LIMIT, FlsaStatus, PAY_PERIODS } from '@/shared/constants'\nimport { yearlyRate } from '@/helpers/payRateCalculator'\n\n// ── Error codes ────────────────────────────────────────────────────────\n\nexport const CompensationErrorCodes = {\n REQUIRED: 'REQUIRED',\n RATE_MINIMUM: 'RATE_MINIMUM',\n RATE_EXEMPT_THRESHOLD: 'RATE_EXEMPT_THRESHOLD',\n PAYMENT_UNIT_OWNER: 'PAYMENT_UNIT_OWNER',\n PAYMENT_UNIT_COMMISSION: 'PAYMENT_UNIT_COMMISSION',\n RATE_COMMISSION_ZERO: 'RATE_COMMISSION_ZERO',\n} as const\n\nexport type CompensationErrorCode =\n (typeof CompensationErrorCodes)[keyof typeof CompensationErrorCodes]\n\nconst fieldValidators = {\n jobTitle: z.string(),\n flsaStatus: z.enum([\n FlsaStatus.EXEMPT,\n FlsaStatus.SALARIED_NONEXEMPT,\n FlsaStatus.NONEXEMPT,\n FlsaStatus.OWNER,\n FlsaStatus.COMMISSION_ONLY_EXEMPT,\n FlsaStatus.COMMISSION_ONLY_NONEXEMPT,\n ]),\n paymentUnit: z.enum([\n PAY_PERIODS.HOUR,\n PAY_PERIODS.WEEK,\n PAY_PERIODS.MONTH,\n PAY_PERIODS.YEAR,\n PAY_PERIODS.PAYCHECK,\n ]),\n rate: z.preprocess(coerceNaN(0), z.number()),\n startDate: z.preprocess(coerceToISODate, z.iso.date().nullable()),\n adjustForMinimumWage: z.boolean(),\n minimumWageId: z.string(),\n // Radio group delivers 'true'/'false' strings; coerceStringBoolean converts to boolean\n stateWcCovered: z.preprocess(coerceStringBoolean, z.boolean()),\n stateWcClassCode: z.string(),\n twoPercentShareholder: z.boolean(),\n}\n\nexport type CompensationFormData = {\n [K in keyof typeof fieldValidators]: z.infer<(typeof fieldValidators)[K]>\n}\n\n// ── Required fields config (requiredness rules per field) ────────────\n\nconst requiredFieldsConfig = {\n jobTitle: 'create',\n flsaStatus: 'create',\n paymentUnit: 'create',\n rate: 'create',\n startDate: 'create',\n minimumWageId: data => data.adjustForMinimumWage,\n stateWcClassCode: data => String(data.stateWcCovered) === 'true',\n} satisfies RequiredFieldConfig<typeof fieldValidators>\n\nfunction validateFlsaRules(data: CompensationFormData, ctx: z.RefinementCtx) {\n const { flsaStatus, paymentUnit, rate } = data\n\n if (\n flsaStatus === FlsaStatus.EXEMPT ||\n flsaStatus === FlsaStatus.SALARIED_NONEXEMPT ||\n flsaStatus === FlsaStatus.NONEXEMPT\n ) {\n if (rate < 1) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_MINIMUM,\n })\n } else if (\n flsaStatus === FlsaStatus.EXEMPT &&\n yearlyRate(rate, paymentUnit) < FLSA_OVERTIME_SALARY_LIMIT\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_EXEMPT_THRESHOLD,\n })\n }\n } else if (flsaStatus === FlsaStatus.OWNER) {\n if (paymentUnit !== PAY_PERIODS.PAYCHECK) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['paymentUnit'],\n message: CompensationErrorCodes.PAYMENT_UNIT_OWNER,\n })\n }\n if (rate < 1) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_MINIMUM,\n })\n }\n /* eslint-disable @typescript-eslint/no-unnecessary-condition -- explicit match prevents a future FLSA status from silently falling into commission rules */\n } else if (\n flsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT ||\n flsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT\n ) {\n /* eslint-enable @typescript-eslint/no-unnecessary-condition */\n if (paymentUnit !== PAY_PERIODS.YEAR) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['paymentUnit'],\n message: CompensationErrorCodes.PAYMENT_UNIT_COMMISSION,\n })\n }\n if (rate !== 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_COMMISSION_ZERO,\n })\n }\n }\n}\n\n// ── Schema factory ───────────────────────────────────────────────────\n\nexport type CompensationOptionalFieldsToRequire = OptionalFieldsToRequire<\n typeof requiredFieldsConfig\n>\nexport type CompensationFormOutputs = CompensationFormData\n\ninterface CompensationSchemaOptions {\n mode?: 'create' | 'update'\n optionalFieldsToRequire?: CompensationOptionalFieldsToRequire\n withStartDateField?: boolean\n}\n\nexport function createCompensationSchema(options: CompensationSchemaOptions = {}) {\n const { mode = 'create', optionalFieldsToRequire, withStartDateField = true } = options\n\n return buildFormSchema(fieldValidators, {\n requiredFieldsConfig,\n requiredErrorCode: CompensationErrorCodes.REQUIRED,\n mode,\n optionalFieldsToRequire,\n excludeFields: withStartDateField ? [] : ['startDate'],\n superRefine: validateFlsaRules,\n })\n}\n"],"names":["CompensationErrorCodes","fieldValidators","z","FlsaStatus","PAY_PERIODS","coerceNaN","coerceToISODate","coerceStringBoolean","requiredFieldsConfig","data","validateFlsaRules","ctx","flsaStatus","paymentUnit","rate","yearlyRate","FLSA_OVERTIME_SALARY_LIMIT","createCompensationSchema","options","mode","optionalFieldsToRequire","withStartDateField","buildFormSchema"],"mappings":"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"}
|