import React, { PropsWithChildren } from 'react'; import { EasyFormDialogOnSubmitReturn } from './dialog'; /** The props type of [[`EasyFormPopover`]]. */ export interface EasyFormPopoverProps { /** The text of the submit button. */ submitButtonText: string; /** * Allows you to disable the submit button even if `getSubmitEnabled()` * would return true. * * This can be useful if you want to disable the submit button while a query * is in progress. */ submitEnabled?: boolean; /** A boolean indicating if the form is valid. */ formIsValid: boolean; /** A boolean indicating if validation feedback is being shown. */ showValidation: boolean; /** A callback that fires when the dialog is submitted. */ onShowValidationChange(showValidation: boolean): void; /** * A callback that fires after the `submit` function succeeds. * * If the `submit` function returned `responseData`, it is passed to your * `onSuccess` function. * * Your `onSuccess` callback must return a promise. The submit button will * continue showing a loading indicator until the promise resolves. This is * to support refetching the data that was updated by the form submission. */ onSuccess(payload: unknown | undefined): Promise; /** * A callback that fires when the form is submitted. You will typically * perform an API call in your `submit` function. * * Your `submit` function can optionally return an object in the shape * * ``` * { * shouldClose?: boolean * responseData: unknown * } * ``` */ onSubmit(): Promise> | Promise; onClose(): void; /** * Set to `false` to disable the default behavior of focusing the first * input. */ focusFirst?: boolean; } /** * Like [[`EasyFormDialog`]], but a popover. For small forms. * * There must be an empty `div` in the document with ID `easyFormPopoverPortalDestination`. */ export declare function EasyFormPopover({ submitButtonText, submitEnabled: propsSubmitEnabled, formIsValid, showValidation, onShowValidationChange, onSuccess, focusFirst, onSubmit, onClose, children, }: PropsWithChildren): React.ReactElement;