@gusto/embedded-react-sdk 0.39.0 → 0.40.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 +118 -0
- package/dist/components/Common/Fields/hooks/useField.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +7 -8
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +4 -5
- 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/AssignSignatorySelection.js +6 -7
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -9
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +11 -11
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -7
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +6 -6
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +6 -7
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -8
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -6
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.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 +0 -2
- 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/{UNSTABLE_Hooks/hooks → Company/DocumentSigner/shared}/useSignCompanyForm/useSignCompanyForm.d.ts +6 -31
- package/dist/components/{UNSTABLE_Hooks/hooks → Company/DocumentSigner/shared}/useSignCompanyForm/useSignCompanyForm.js +24 -19
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.js.map +1 -0
- package/dist/components/Company/FederalTaxes/Actions.js +6 -7
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +5 -6
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +10 -11
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +2 -3
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +6 -7
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +2 -3
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +6 -6
- 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 +5 -6
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -7
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +2 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/List.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/Form.js +4 -4
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -3
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
- package/dist/components/Contractor/Submit/Submit.js +73 -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 +1 -1
- package/dist/components/Employee/Compensation/List.js +5 -6
- 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/DocumentSigner/DocumentList/Actions.js +4 -5
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +16 -16
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +8 -8
- 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/FederalTaxes/Actions.js +2 -3
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +4 -5
- package/dist/components/Employee/FederalTaxes/FederalForm.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 +5 -6
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +4 -4
- package/dist/components/Employee/PaymentMethod/Split.js +1 -1
- package/dist/components/Employee/Profile/AdminProfile.d.ts +2 -0
- package/dist/components/Employee/Profile/AdminProfile.js +360 -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 +6 -7
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +7 -8
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +4 -5
- package/dist/components/Employee/Taxes/FederalForm.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 +10 -10
- 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 +12 -12
- 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/{EmployeeList → employee-list/onboarding}/EmployeeListView.js +12 -12
- 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/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +10 -10
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +11 -12
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +0 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +2 -3
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.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/PayrollReceipts/PayrollReceiptsPresentation.js +106 -108
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +10 -10
- package/dist/components/Payroll/usePreparedPayrollData.js +4 -4
- package/dist/components/Payroll/usePreparedPayrollData.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 +47 -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/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 +2 -3
- 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.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/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/CheckboxHookField.js +8 -9
- 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/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/NumberInputHookField.js +12 -13
- 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/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/RadioGroupHookField.js +3 -4
- 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 +8 -9
- 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/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/SwitchHookField.js +8 -9
- 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 +38 -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 +15 -252
- package/dist/types/sdkError.js.map +1 -1
- package/docs/reference/endpoint-inventory.json +542 -162
- package/package.json +13 -17
- 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/Employee/EmployeeList/EmployeeList.js.map +0 -1
- 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.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js.map +0 -1
- 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.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/PayScheduleForm.module.scss.js +0 -14
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/PayScheduleForm.module.scss.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.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 → 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
package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/NumberInputHookField.d.ts
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
|
-
import { BaseFieldProps, ValidationMessages,
|
|
3
|
-
import { NumberInputProps } from '../../../Common/UI/NumberInput/NumberInputTypes';
|
|
2
|
+
import { BaseFieldProps, ValidationMessages, FormHookResult } from '../../types';
|
|
3
|
+
import { NumberInputProps } from '../../../components/Common/UI/NumberInput/NumberInputTypes';
|
|
4
4
|
export interface NumberInputHookFieldProps<TErrorCode extends string = never> extends BaseFieldProps {
|
|
5
5
|
name: string;
|
|
6
|
-
formHookResult?:
|
|
6
|
+
formHookResult?: FormHookResult;
|
|
7
7
|
format?: NumberInputProps['format'];
|
|
8
8
|
min?: NumberInputProps['min'];
|
|
9
9
|
max?: NumberInputProps['max'];
|
package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/NumberInputHookField.js
RENAMED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as f } from "react/jsx-runtime";
|
|
2
2
|
import { useHookFieldResolution as b } from "../useHookFieldResolution.js";
|
|
3
|
-
import "
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
name: o,
|
|
3
|
+
import { NumberInputField as c } from "../../../components/Common/Fields/NumberInputField/NumberInputField.js";
|
|
4
|
+
function q({
|
|
5
|
+
name: e,
|
|
7
6
|
formHookResult: i,
|
|
8
7
|
label: r,
|
|
9
8
|
description: t,
|
|
@@ -11,31 +10,31 @@ function x({
|
|
|
11
10
|
min: d,
|
|
12
11
|
max: u,
|
|
13
12
|
validationMessages: l,
|
|
14
|
-
FieldComponent:
|
|
13
|
+
FieldComponent: a
|
|
15
14
|
}) {
|
|
16
|
-
const { metadata:
|
|
17
|
-
|
|
15
|
+
const { metadata: m, control: n, errorMessage: p } = b(
|
|
16
|
+
e,
|
|
18
17
|
i,
|
|
19
18
|
l
|
|
20
|
-
),
|
|
19
|
+
), o = m[e];
|
|
21
20
|
return /* @__PURE__ */ f(
|
|
22
21
|
c,
|
|
23
22
|
{
|
|
24
|
-
name:
|
|
23
|
+
name: e,
|
|
25
24
|
control: n,
|
|
26
25
|
label: r,
|
|
27
26
|
description: t,
|
|
28
27
|
errorMessage: p,
|
|
29
|
-
isRequired:
|
|
30
|
-
isDisabled:
|
|
28
|
+
isRequired: o?.isRequired,
|
|
29
|
+
isDisabled: o?.isDisabled,
|
|
31
30
|
format: s,
|
|
32
31
|
min: d,
|
|
33
32
|
max: u,
|
|
34
|
-
FieldComponent:
|
|
33
|
+
FieldComponent: a
|
|
35
34
|
}
|
|
36
35
|
);
|
|
37
36
|
}
|
|
38
37
|
export {
|
|
39
|
-
|
|
38
|
+
q as NumberInputHookField
|
|
40
39
|
};
|
|
41
40
|
//# sourceMappingURL=NumberInputHookField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberInputHookField.js","sources":["../../../../src/partner-hook-utils/form/fields/NumberInputHookField.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\nimport { useHookFieldResolution } from '../useHookFieldResolution'\nimport type { BaseFieldProps, ValidationMessages, FormHookResult } from '../../types'\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?: FormHookResult\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":";;;AAkBO,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;"}
|
package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/RadioGroupHookField.d.ts
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
|
-
import { BaseFieldProps, ValidationMessages,
|
|
3
|
-
import { RadioGroupProps } from '../../../Common/UI/RadioGroup/RadioGroupTypes';
|
|
2
|
+
import { BaseFieldProps, ValidationMessages, FormHookResult } from '../../types';
|
|
3
|
+
import { RadioGroupProps } from '../../../components/Common/UI/RadioGroup/RadioGroupTypes';
|
|
4
4
|
export interface RadioGroupHookFieldProps<TErrorCode extends string = never, TEntry = unknown> extends BaseFieldProps {
|
|
5
5
|
name: string;
|
|
6
|
-
formHookResult?:
|
|
6
|
+
formHookResult?: FormHookResult;
|
|
7
7
|
validationMessages?: ValidationMessages<TErrorCode>;
|
|
8
8
|
getOptionLabel?: (entry: TEntry) => string;
|
|
9
9
|
FieldComponent?: ComponentType<RadioGroupProps>;
|
package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/RadioGroupHookField.js
RENAMED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as R } from "react/jsx-runtime";
|
|
2
2
|
import { useHookFieldResolution as F } from "../useHookFieldResolution.js";
|
|
3
3
|
import { getFieldWithOptions as b } from "../getFieldWithOptions.js";
|
|
4
|
-
import "
|
|
5
|
-
|
|
6
|
-
function H({
|
|
4
|
+
import { RadioGroupField as k } from "../../../components/Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
5
|
+
function G({
|
|
7
6
|
name: i,
|
|
8
7
|
formHookResult: r,
|
|
9
8
|
label: s,
|
|
@@ -36,6 +35,6 @@ function H({
|
|
|
36
35
|
);
|
|
37
36
|
}
|
|
38
37
|
export {
|
|
39
|
-
|
|
38
|
+
G as RadioGroupHookField
|
|
40
39
|
};
|
|
41
40
|
//# sourceMappingURL=RadioGroupHookField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroupHookField.js","sources":["../../../../src/partner-hook-utils/form/fields/RadioGroupHookField.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\nimport { useHookFieldResolution } from '../useHookFieldResolution'\nimport { getFieldWithOptions } from '../getFieldWithOptions'\nimport type { BaseFieldProps, ValidationMessages, FormHookResult } from '../../types'\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?: FormHookResult\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":";;;;AAkBO,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;"}
|
package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/SelectHookField.d.ts
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
|
-
import { BaseFieldProps, ValidationMessages,
|
|
3
|
-
import { SelectProps } from '../../../Common/UI/Select/SelectTypes';
|
|
2
|
+
import { BaseFieldProps, ValidationMessages, FormHookResult } from '../../types';
|
|
3
|
+
import { SelectProps } from '../../../components/Common/UI/Select/SelectTypes';
|
|
4
4
|
export interface SelectHookFieldProps<TErrorCode extends string = never, TEntry = unknown> extends BaseFieldProps {
|
|
5
5
|
name: string;
|
|
6
|
-
formHookResult?:
|
|
6
|
+
formHookResult?: FormHookResult;
|
|
7
7
|
validationMessages?: ValidationMessages<TErrorCode>;
|
|
8
8
|
getOptionLabel?: (entry: TEntry) => string;
|
|
9
9
|
FieldComponent?: ComponentType<SelectProps>;
|
package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/SelectHookField.js
RENAMED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as F } from "react/jsx-runtime";
|
|
2
2
|
import { useHookFieldResolution as R } from "../useHookFieldResolution.js";
|
|
3
3
|
import { getFieldWithOptions as b } from "../getFieldWithOptions.js";
|
|
4
|
-
import "
|
|
5
|
-
|
|
6
|
-
function M({
|
|
4
|
+
import { SelectField as k } from "../../../components/Common/Fields/SelectField/SelectField.js";
|
|
5
|
+
function H({
|
|
7
6
|
name: o,
|
|
8
7
|
formHookResult: s,
|
|
9
8
|
label: r,
|
|
@@ -12,13 +11,13 @@ function M({
|
|
|
12
11
|
getOptionLabel: t,
|
|
13
12
|
FieldComponent: n
|
|
14
13
|
}) {
|
|
15
|
-
const { metadata: a, control: p, errorMessage:
|
|
14
|
+
const { metadata: a, control: p, errorMessage: u } = R(
|
|
16
15
|
o,
|
|
17
16
|
s,
|
|
18
17
|
d
|
|
19
|
-
), e = b(a, o), i = e?.options ?? [],
|
|
18
|
+
), e = b(a, o), i = e?.options ?? [], c = t && e?.entries ? e.entries.map((m, f) => ({
|
|
20
19
|
value: i[f]?.value ?? "",
|
|
21
|
-
label: t(
|
|
20
|
+
label: t(m)
|
|
22
21
|
})) : i;
|
|
23
22
|
return /* @__PURE__ */ F(
|
|
24
23
|
k,
|
|
@@ -27,15 +26,15 @@ function M({
|
|
|
27
26
|
control: p,
|
|
28
27
|
label: r,
|
|
29
28
|
description: l,
|
|
30
|
-
errorMessage:
|
|
29
|
+
errorMessage: u,
|
|
31
30
|
isRequired: e?.isRequired,
|
|
32
31
|
isDisabled: e?.isDisabled,
|
|
33
|
-
options:
|
|
32
|
+
options: c,
|
|
34
33
|
FieldComponent: n
|
|
35
34
|
}
|
|
36
35
|
);
|
|
37
36
|
}
|
|
38
37
|
export {
|
|
39
|
-
|
|
38
|
+
H as SelectHookField
|
|
40
39
|
};
|
|
41
40
|
//# sourceMappingURL=SelectHookField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectHookField.js","sources":["../../../../src/partner-hook-utils/form/fields/SelectHookField.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\nimport { useHookFieldResolution } from '../useHookFieldResolution'\nimport { getFieldWithOptions } from '../getFieldWithOptions'\nimport type { BaseFieldProps, ValidationMessages, FormHookResult } from '../../types'\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?: FormHookResult\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":";;;;AAkBO,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;"}
|
package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/SwitchHookField.d.ts
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
|
-
import { BaseFieldProps, ValidationMessages,
|
|
3
|
-
import { SwitchProps } from '../../../Common/UI/Switch/SwitchTypes';
|
|
2
|
+
import { BaseFieldProps, ValidationMessages, FormHookResult } from '../../types';
|
|
3
|
+
import { SwitchProps } from '../../../components/Common/UI/Switch/SwitchTypes';
|
|
4
4
|
export interface SwitchHookFieldProps<TErrorCode extends string = never> extends BaseFieldProps {
|
|
5
5
|
name: string;
|
|
6
|
-
formHookResult?:
|
|
6
|
+
formHookResult?: FormHookResult;
|
|
7
7
|
validationMessages?: ValidationMessages<TErrorCode>;
|
|
8
8
|
FieldComponent?: ComponentType<SwitchProps>;
|
|
9
9
|
}
|
package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/SwitchHookField.js
RENAMED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useHookFieldResolution as
|
|
3
|
-
import "
|
|
4
|
-
|
|
5
|
-
function b({
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { useHookFieldResolution as f } from "../useHookFieldResolution.js";
|
|
3
|
+
import { SwitchField as m } from "../../../components/Common/Fields/SwitchField/SwitchField.js";
|
|
4
|
+
function R({
|
|
6
5
|
name: i,
|
|
7
6
|
formHookResult: e,
|
|
8
7
|
label: t,
|
|
@@ -10,13 +9,13 @@ function b({
|
|
|
10
9
|
validationMessages: s,
|
|
11
10
|
FieldComponent: d
|
|
12
11
|
}) {
|
|
13
|
-
const { metadata: l, control: a, errorMessage: c } =
|
|
12
|
+
const { metadata: l, control: a, errorMessage: c } = f(
|
|
14
13
|
i,
|
|
15
14
|
e,
|
|
16
15
|
s
|
|
17
16
|
), o = l[i];
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
|
|
17
|
+
return /* @__PURE__ */ u(
|
|
18
|
+
m,
|
|
20
19
|
{
|
|
21
20
|
name: i,
|
|
22
21
|
control: a,
|
|
@@ -30,6 +29,6 @@ function b({
|
|
|
30
29
|
);
|
|
31
30
|
}
|
|
32
31
|
export {
|
|
33
|
-
|
|
32
|
+
R as SwitchHookField
|
|
34
33
|
};
|
|
35
34
|
//# sourceMappingURL=SwitchHookField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwitchHookField.js","sources":["../../../../src/partner-hook-utils/form/fields/SwitchHookField.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\nimport { useHookFieldResolution } from '../useHookFieldResolution'\nimport type { BaseFieldProps, ValidationMessages, FormHookResult } from '../../types'\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?: FormHookResult\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":";;;AAaO,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;"}
|
package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/fields/TextInputHookField.d.ts
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
|
-
import { BaseFieldProps, ValidationMessages,
|
|
3
|
-
import { TextInputProps } from '../../../Common/UI/TextInput/TextInputTypes';
|
|
2
|
+
import { BaseFieldProps, ValidationMessages, FormHookResult } from '../../types';
|
|
3
|
+
import { TextInputProps } from '../../../components/Common/UI/TextInput/TextInputTypes';
|
|
4
4
|
export interface TextInputHookFieldProps<TErrorCode extends string = never, TOptionalErrorCode extends string = never> extends BaseFieldProps {
|
|
5
5
|
name: string;
|
|
6
|
-
formHookResult?:
|
|
6
|
+
formHookResult?: FormHookResult;
|
|
7
7
|
validationMessages?: ValidationMessages<TErrorCode, TOptionalErrorCode>;
|
|
8
8
|
transform?: (value: string) => string;
|
|
9
9
|
placeholder?: string;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { useHookFieldResolution as m } from "../useHookFieldResolution.js";
|
|
3
|
+
import { TextInputField as c } from "../../../components/Common/Fields/TextInputField/TextInputField.js";
|
|
4
|
+
function b({
|
|
5
|
+
name: e,
|
|
6
|
+
formHookResult: t,
|
|
7
|
+
label: i,
|
|
8
|
+
description: r,
|
|
9
|
+
validationMessages: s,
|
|
10
|
+
transform: d,
|
|
11
|
+
placeholder: l,
|
|
12
|
+
FieldComponent: u
|
|
13
|
+
}) {
|
|
14
|
+
const { metadata: a, control: n, errorMessage: p } = m(
|
|
15
|
+
e,
|
|
16
|
+
t,
|
|
17
|
+
s
|
|
18
|
+
), o = a[e];
|
|
19
|
+
return /* @__PURE__ */ f(
|
|
20
|
+
c,
|
|
21
|
+
{
|
|
22
|
+
name: e,
|
|
23
|
+
control: n,
|
|
24
|
+
label: i,
|
|
25
|
+
description: r,
|
|
26
|
+
errorMessage: p,
|
|
27
|
+
isRequired: o?.isRequired,
|
|
28
|
+
isDisabled: o?.isDisabled,
|
|
29
|
+
transform: d,
|
|
30
|
+
placeholder: l,
|
|
31
|
+
FieldComponent: u
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
b as TextInputHookField
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=TextInputHookField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextInputHookField.js","sources":["../../../../src/partner-hook-utils/form/fields/TextInputHookField.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\nimport { useHookFieldResolution } from '../useHookFieldResolution'\nimport type { BaseFieldProps, ValidationMessages, FormHookResult } from '../../types'\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?: FormHookResult\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":";;;AAkBO,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;"}
|
|
@@ -6,10 +6,10 @@ export { NumberInputHookField, type NumberInputHookFieldProps } from './NumberIn
|
|
|
6
6
|
export { DatePickerHookField, type DatePickerHookFieldProps } from './DatePickerHookField';
|
|
7
7
|
export { RadioGroupHookField, type RadioGroupHookFieldProps } from './RadioGroupHookField';
|
|
8
8
|
export { SwitchHookField, type SwitchHookFieldProps } from './SwitchHookField';
|
|
9
|
-
export type { TextInputProps } from '../../../Common/UI/TextInput/TextInputTypes';
|
|
10
|
-
export type { SelectProps, SelectOption } from '../../../Common/UI/Select/SelectTypes';
|
|
11
|
-
export type { CheckboxProps } from '../../../Common/UI/Checkbox/CheckboxTypes';
|
|
12
|
-
export type { NumberInputProps } from '../../../Common/UI/NumberInput/NumberInputTypes';
|
|
13
|
-
export type { DatePickerProps } from '../../../Common/UI/DatePicker/DatePickerTypes';
|
|
14
|
-
export type { RadioGroupProps, RadioGroupOption, } from '../../../Common/UI/RadioGroup/RadioGroupTypes';
|
|
15
|
-
export type { SwitchProps } from '../../../Common/UI/Switch/SwitchTypes';
|
|
9
|
+
export type { TextInputProps } from '../../../components/Common/UI/TextInput/TextInputTypes';
|
|
10
|
+
export type { SelectProps, SelectOption } from '../../../components/Common/UI/Select/SelectTypes';
|
|
11
|
+
export type { CheckboxProps } from '../../../components/Common/UI/Checkbox/CheckboxTypes';
|
|
12
|
+
export type { NumberInputProps } from '../../../components/Common/UI/NumberInput/NumberInputTypes';
|
|
13
|
+
export type { DatePickerProps } from '../../../components/Common/UI/DatePicker/DatePickerTypes';
|
|
14
|
+
export type { RadioGroupProps, RadioGroupOption, } from '../../../components/Common/UI/RadioGroup/RadioGroupTypes';
|
|
15
|
+
export type { SwitchProps } from '../../../components/Common/UI/Switch/SwitchTypes';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FieldMetadataWithOptions, FieldsMetadata } from '
|
|
1
|
+
import { FieldMetadataWithOptions, FieldsMetadata } from '../types';
|
|
2
2
|
export declare function getFieldWithOptions<TEntry = unknown>(metadata: FieldsMetadata, name: string): FieldMetadataWithOptions<TEntry> | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFieldWithOptions.js","sources":["../../../src/partner-hook-utils/form/getFieldWithOptions.ts"],"sourcesContent":["import type { FieldMetadataWithOptions, FieldsMetadata } from '../types'\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;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFormSubmissionValues.js","sources":["../../../src/partner-hook-utils/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,5 +1,5 @@
|
|
|
1
1
|
import "./types/i18next.d.ts"
|
|
2
|
-
export type { FieldMetadata, FieldMetadataWithOptions, FieldsMetadata, ValidationMessages, BaseFieldProps, HookFieldProps, } from '
|
|
2
|
+
export type { FieldMetadata, FieldMetadataWithOptions, FieldsMetadata, ValidationMessages, BaseFieldProps, HookFieldProps, } from '../types';
|
|
3
3
|
export { withOptions } from './withOptions';
|
|
4
4
|
export type { FormFieldsMetadataContextValue } from './FormFieldsMetadataContext';
|
|
5
5
|
export { FormFieldsMetadataProvider } from './FormFieldsMetadataProvider';
|
|
@@ -9,6 +9,6 @@ export { useFieldErrorMessage } from './useFieldErrorMessage';
|
|
|
9
9
|
export { resolveFieldError } from './resolveFieldError';
|
|
10
10
|
export { useHookFieldResolution } from './useHookFieldResolution';
|
|
11
11
|
export type { FormMode, RequiredFieldRule, RequiredFieldConfig, OptionalFieldsToRequire, FieldsMetadataConfig, BuildFormSchemaResult, } from './buildFormSchema';
|
|
12
|
-
export { composeSubmitHandler } from './composeSubmitHandler';
|
|
12
|
+
export { composeSubmitHandler, type ComposeSubmitHandlerResult } from './composeSubmitHandler';
|
|
13
13
|
export { createGetFormSubmissionValues } from './getFormSubmissionValues';
|
|
14
14
|
export { TextInputHookField, type TextInputHookFieldProps, SelectHookField, type SelectHookFieldProps, CheckboxHookField, type CheckboxHookFieldProps, NumberInputHookField, type NumberInputHookFieldProps, DatePickerHookField, type DatePickerHookFieldProps, RadioGroupHookField, type RadioGroupHookFieldProps, type TextInputProps, type SelectProps, type SelectOption, type CheckboxProps, type NumberInputProps, type DatePickerProps, type RadioGroupProps, type RadioGroupOption, SwitchHookField, type SwitchHookFieldProps, type SwitchProps, } from './fields';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preprocessors.js","sources":["../../../src/partner-hook-utils/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,4 +1,4 @@
|
|
|
1
1
|
import { FieldErrors } from 'react-hook-form';
|
|
2
|
-
import { ValidationMessages } from '
|
|
3
|
-
import { SDKError } from '
|
|
2
|
+
import { ValidationMessages } from '../types';
|
|
3
|
+
import { SDKError } from '../../types/sdkError';
|
|
4
4
|
export declare function resolveFieldError<TErrorCode extends string, TOptionalErrorCode extends string = never>(fieldName: string, formErrors: FieldErrors, sdkErrors: SDKError[], validationMessages?: ValidationMessages<TErrorCode, TOptionalErrorCode>): string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveFieldError.js","sources":["../../../src/partner-hook-utils/form/resolveFieldError.ts"],"sourcesContent":["import type { FieldErrors } from 'react-hook-form'\nimport { get } from 'react-hook-form'\nimport type { ValidationMessages } from '../types'\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;"}
|
package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/useDeriveFieldsMetadata.d.ts
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Control, FieldValues } from 'react-hook-form';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import { FieldMetadata } from '../types';
|
|
3
4
|
import { FieldsMetadataConfig } from './buildFormSchema';
|
|
4
|
-
import { FieldMetadata } from '../../../types/sdkHooks';
|
|
5
5
|
/**
|
|
6
6
|
* Resolves dynamic field metadata (e.g. `isRequired` driven by predicate
|
|
7
7
|
* rules) by watching only the form fields that predicates actually read.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useMemo as c } from "react";
|
|
2
|
+
import { useWatch as d } from "react-hook-form";
|
|
3
|
+
function u(t, o) {
|
|
4
|
+
const { predicateDeps: e } = t, s = e.length > 0, a = d({
|
|
5
|
+
control: o,
|
|
6
|
+
name: s ? e : [],
|
|
7
|
+
disabled: !s
|
|
8
|
+
});
|
|
9
|
+
return c(() => {
|
|
10
|
+
if (!s)
|
|
11
|
+
return t.getFieldsMetadata();
|
|
12
|
+
const n = {};
|
|
13
|
+
for (let r = 0; r < e.length; r++)
|
|
14
|
+
n[e[r]] = a[r];
|
|
15
|
+
return t.getFieldsMetadata(n);
|
|
16
|
+
}, [t, s, e, a]);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
u as useDeriveFieldsMetadata
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=useDeriveFieldsMetadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDeriveFieldsMetadata.js","sources":["../../../src/partner-hook-utils/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 { FieldMetadata } from '../types'\nimport type { FieldsMetadataConfig } from './buildFormSchema'\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]!] = (watchedValues as unknown[])[i]\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,IAAKJ,EAA4BI,CAAC;AAE1D,WAAOR,EAAe,kBAAkBO,CAAI;AAAA,EAC9C,GAAG,CAACP,GAAgBG,GAASD,GAAeE,CAAa,CAAC;AAC5D;"}
|
package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/useFieldErrorMessage.d.ts
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ValidationMessages } from '
|
|
1
|
+
import { ValidationMessages } from '../types';
|
|
2
2
|
export declare function useFieldErrorMessage<TErrorCode extends string>(fieldName: string, validationMessages?: ValidationMessages<TErrorCode>): string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFieldErrorMessage.js","sources":["../../../src/partner-hook-utils/form/useFieldErrorMessage.ts"],"sourcesContent":["import { useFormContext, get } from 'react-hook-form'\nimport type { ValidationMessages } from '../types'\nimport { useFormFieldsMetadataContext } from './FormFieldsMetadataContext'\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;"}
|
package/dist/{components/UNSTABLE_Hooks → partner-hook-utils}/form/useHookFieldResolution.d.ts
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Control } from 'react-hook-form';
|
|
2
|
-
import { FieldsMetadata, ValidationMessages,
|
|
2
|
+
import { FieldsMetadata, ValidationMessages, FormHookResult } from '../types';
|
|
3
3
|
interface HookFieldResolution {
|
|
4
4
|
metadata: FieldsMetadata;
|
|
5
5
|
control: Control | undefined;
|
|
@@ -18,5 +18,5 @@ interface HookFieldResolution {
|
|
|
18
18
|
* the control object. When absent (context path), it falls back to useFormContext
|
|
19
19
|
* internally. The `name` parameter scopes the subscription to this field.
|
|
20
20
|
*/
|
|
21
|
-
export declare function useHookFieldResolution<TErrorCode extends string, TOptionalErrorCode extends string = never>(name: string, formHookResult:
|
|
21
|
+
export declare function useHookFieldResolution<TErrorCode extends string, TOptionalErrorCode extends string = never>(name: string, formHookResult: FormHookResult | undefined, validationMessages?: ValidationMessages<TErrorCode, TOptionalErrorCode>): HookFieldResolution;
|
|
22
22
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHookFieldResolution.js","sources":["../../../src/partner-hook-utils/form/useHookFieldResolution.ts"],"sourcesContent":["import type { Control } from 'react-hook-form'\nimport { useFormState } from 'react-hook-form'\nimport type { FieldsMetadata, ValidationMessages, FormHookResult } from '../types'\nimport { useFormFieldsMetadataContext } from './FormFieldsMetadataContext'\nimport { resolveFieldError } from './resolveFieldError'\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: FormHookResult | 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 as Control | undefined\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,4 +1,4 @@
|
|
|
1
|
-
import { FieldMetadata, FieldMetadataWithOptions } from '
|
|
1
|
+
import { FieldMetadata, FieldMetadataWithOptions } from '../types';
|
|
2
2
|
export declare function withOptions<TEntry = unknown>(base: FieldMetadata, options: Array<{
|
|
3
3
|
label: string;
|
|
4
4
|
value: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withOptions.js","sources":["../../../src/partner-hook-utils/form/withOptions.ts"],"sourcesContent":["import type { FieldMetadata, FieldMetadataWithOptions } from '../types'\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,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { UseFormReturn, FieldValues } from 'react-hook-form';
|
|
3
|
-
import { SDKError } from '
|
|
3
|
+
import { SDKError } from '../types/sdkError';
|
|
4
4
|
export interface FieldMetadata {
|
|
5
5
|
name: string;
|
|
6
6
|
isRequired?: boolean;
|
|
@@ -47,15 +47,25 @@ export interface HookErrorHandling {
|
|
|
47
47
|
retryQueries: () => void;
|
|
48
48
|
clearSubmitError: () => void;
|
|
49
49
|
}
|
|
50
|
-
/**
|
|
51
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Base shape for non-form hooks in the ready (loaded) state.
|
|
52
|
+
* Pass `TData` / `TStatus` so each hook narrows payload and status without `Omit` + rewrite.
|
|
53
|
+
*/
|
|
54
|
+
export interface BaseHookReady<TData extends Record<string, unknown> = Record<string, unknown>, TStatus extends Record<string, unknown> = Record<string, unknown>> {
|
|
52
55
|
isLoading: false;
|
|
53
|
-
data:
|
|
54
|
-
status:
|
|
56
|
+
data: TData;
|
|
57
|
+
status: TStatus;
|
|
55
58
|
errorHandling: HookErrorHandling;
|
|
56
59
|
}
|
|
57
|
-
/**
|
|
58
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Base shape for form hooks in the ready state.
|
|
62
|
+
* Individual hooks override `data`, `actions`, and `form`.
|
|
63
|
+
*
|
|
64
|
+
* `status.mode` matches {@link HookSubmitResult} (`create` | `update`). Document-sign hooks
|
|
65
|
+
* surface `mode: 'create'` only — that reflects the submit/API contract, not “create entity”
|
|
66
|
+
* in the domain sense.
|
|
67
|
+
*/
|
|
68
|
+
export interface BaseFormHookReady<TFieldsMetadata extends FieldsMetadata = FieldsMetadata, TFormData extends FieldValues = FieldValues, TFields extends object = Record<string, unknown>> {
|
|
59
69
|
isLoading: false;
|
|
60
70
|
data: Record<string, unknown>;
|
|
61
71
|
status: {
|
|
@@ -65,9 +75,27 @@ export interface BaseFormHookReady<TFieldsMetadata extends FieldsMetadata = Fiel
|
|
|
65
75
|
actions: Record<string, unknown>;
|
|
66
76
|
errorHandling: HookErrorHandling;
|
|
67
77
|
form: {
|
|
68
|
-
Fields:
|
|
78
|
+
Fields: TFields;
|
|
69
79
|
fieldsMetadata: TFieldsMetadata;
|
|
70
|
-
hookFormInternals: HookFormInternals
|
|
80
|
+
hookFormInternals: HookFormInternals<TFormData>;
|
|
71
81
|
getFormSubmissionValues: () => Record<string, unknown> | undefined;
|
|
72
82
|
};
|
|
73
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Narrowed shape for `formHookResult` props on HookField components.
|
|
86
|
+
*
|
|
87
|
+
* Derived from {@link BaseFormHookReady} so `errorHandling` and `fieldsMetadata`
|
|
88
|
+
* stay in sync with hook return types. `control` is typed as `unknown` because
|
|
89
|
+
* react-hook-form's `Control<T>` is invariant on `T` — the single `as Control`
|
|
90
|
+
* cast lives in {@link useHookFieldResolution}, the only consumer.
|
|
91
|
+
*/
|
|
92
|
+
export type FormHookResult = {
|
|
93
|
+
errorHandling: Pick<BaseFormHookReady['errorHandling'], 'errors'>;
|
|
94
|
+
form: Pick<BaseFormHookReady['form'], 'fieldsMetadata'> & {
|
|
95
|
+
hookFormInternals: {
|
|
96
|
+
formMethods: {
|
|
97
|
+
control: unknown;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
};
|
|
@@ -465,7 +465,7 @@ export declare const ContractorOnboardingStatus: {
|
|
|
465
465
|
readonly SELF_ONBOARDING_REVIEW: "self_onboarding_review";
|
|
466
466
|
readonly ONBOARDING_COMPLETED: "onboarding_completed";
|
|
467
467
|
};
|
|
468
|
-
export declare const ContractorSelfOnboardingStatuses: Set<"self_onboarding_invited" | "
|
|
468
|
+
export declare const ContractorSelfOnboardingStatuses: Set<"self_onboarding_invited" | "self_onboarding_not_invited" | "self_onboarding_started" | "self_onboarding_review">;
|
|
469
469
|
/**Map of API response flsa statuses */
|
|
470
470
|
export declare const FlsaStatus: {
|
|
471
471
|
readonly EXEMPT: "Exempt";
|