ConvertFieldAPIRulesToJoi.ts
2 years ago
PrepareFormData.ts
2 years ago
amountFormatter.ts
2 years ago
buildRegisterValidationOptions.ts
2 years ago
conditionOperatorFunctions.js
2 years ago
convertValuesToFormData.ts
2 years ago
createValidationObjectFromFields.js
2 years ago
generateRequestErrors.ts
2 years ago
getCurrentFormUrlData.js
2 years ago
getDefaultValuesFromSections.ts
2 years ago
getDonationFormNodeSettings.ts
2 years ago
getErrorByFieldName.ts
2 years ago
getWindowData.ts
2 years ago
groups.ts
2 years ago
handleFormRedirect.ts
2 years ago
handleFormSubmitRequest.ts
2 years ago
handleValidationRequest.ts
2 years ago
isRouteInlineRedirect.ts
2 years ago
memoNode.ts
2 years ago
mountWindowData.ts
2 years ago
postData.ts
2 years ago
postFormData.ts
2 years ago
registerFieldAndBuildProps.tsx
2 years ago
mountWindowData.ts
22 lines
| 1 | import {useFormContext, useFormState, useWatch} from 'react-hook-form'; |
| 2 | import useCurrencyFormatter from '@givewp/forms/app/hooks/useCurrencyFormatter'; |
| 3 | import useDonationSummary from '@givewp/forms/app/hooks/useDonationSummary'; |
| 4 | import {useDonationFormSettings} from '@givewp/forms/app/store/form-settings'; |
| 5 | |
| 6 | /** |
| 7 | * |
| 8 | * This mounts data to the window object, so it can be accessed by form designs and add-ons |
| 9 | * |
| 10 | * @since 3.0.0 |
| 11 | */ |
| 12 | export default function mountWindowData(): void { |
| 13 | window.givewp.form.hooks = { |
| 14 | useFormContext, |
| 15 | useWatch, |
| 16 | useFormState, |
| 17 | useCurrencyFormatter, |
| 18 | useDonationSummary, |
| 19 | useDonationFormSettings, |
| 20 | }; |
| 21 | } |
| 22 |