| 83 | |
| 84 | /** The props type of {@link EasyFormDialog | `EasyFormDialog`}. */ |
| 85 | export interface EasyFormDialogProps { |
| 86 | /** The title of the dialog. Can be a JSX element. */ |
| 87 | title: React.ReactNode; |
| 88 | |
| 89 | /** The text of the submit button. */ |
| 90 | submitButtonText: string; |
| 91 | |
| 92 | /** The CSS class of the submit button. */ |
| 93 | submitButtonClass?: string; |
| 94 | |
| 95 | /** The text of the cancel button. Defaults to "Cancel". */ |
| 96 | cancelButtonText?: string; |
| 97 | |
| 98 | /** |
| 99 | * Allows you to disable the submit button even if `getSubmitEnabled()` |
| 100 | * would return true. |
| 101 | * |
| 102 | * This can be useful if you want to disable the submit button while a query |
| 103 | * is in progress. |
| 104 | */ |
| 105 | submitEnabled?: boolean; |
| 106 | |
| 107 | /** A boolean indicating if the form is valid. */ |
| 108 | formIsValid: boolean; |
| 109 | |
| 110 | /** A boolean indicating if validation feedback is being shown. */ |
| 111 | showValidation: boolean; |
| 112 | |
| 113 | /** A callback that fires when the dialog is submitted. */ |
| 114 | onShowValidationChange(showValidation: boolean): void; |
| 115 | |
| 116 | /** |
| 117 | * A callback that fires after the `submit` function succeeds. |
| 118 | * |
| 119 | * If the `submit` function returned `responseData`, it is passed to your |
| 120 | * `onSuccess` function. |
| 121 | * |
| 122 | * Your `onSuccess` callback must return a promise. The submit button will |
| 123 | * continue showing a loading indicator until the promise resolves. This is |
| 124 | * to support refetching the data that was updated by the form submission. |
| 125 | */ |
| 126 | onSuccess(payload: unknown | undefined): Promise<void>; |
| 127 | |
| 128 | /** |
| 129 | * A callback that fires when the dialog has completely closed. Your |
| 130 | * `onClose` callback should update call, for example, |
| 131 | * `setDialogVisible(false)` so that the `EasyFormDialog` is no longer |
| 132 | * rendered. |
| 133 | */ |
| 134 | onClose(): void; |
| 135 | |
| 136 | /** |
| 137 | * A callback that fires when the form is submitted. You will typically |
| 138 | * perform an API call in your `submit` function. |
| 139 | * |
| 140 | * Your `submit` function can optionally return an object in the shape |
| 141 | * |
| 142 | * ``` |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…