You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|renderAlert|Required. Provideafunction which renders the alert component. See [renderAlert](#renderAlert) |
99
-
| renderConfirm | Required. Provide a function which renders the confirmation component. See [renderConfirm](#renderConfirm) |
100
-
| renderChoice | Optional. Provide a function which renders the choice component. See [renderChoice](#renderChoice) |
101
-
| strings | Takes an object to provide default values for `yes`, `no`, and `cancel` button captions. Use this to localize these texts. |
96
+
|Property|Required|Description|
97
+
|---|---|---|
98
+
|renderAlert|yes|Provideafunction which renders the alert component. See [renderAlert](#renderAlert) |
99
+
| renderConfirm | yes | Provide a function which renders the confirmation component. See [renderConfirm](#renderConfirm) |
100
+
| renderChoice | no | Provide a function which renders the choice component. See [renderChoice](#renderChoice) |
101
+
| strings | no | Takes an object to provide default values for `yes`, `no`, and `cancel` button captions. Use this to localize these texts. |
102
+
| alertDurations | no | You can provide an object to set the durations of an alert for each severity in ms. The defaults are: info: 3000, success: 3000, warning: 10000, error: 10000. |
102
103
103
104
### renderAlert
104
105
@@ -145,32 +146,32 @@ The `ConfirmComponentHost` accepts the following props:
145
146
146
147
To show an alert to the user, call the `alert` function. It has the following parameters:
147
148
148
-
| Parameter | Description |
149
-
| --- | ---
150
-
| message | The message to display. |
151
-
| severity | The severity of the alert. |
149
+
| Parameter | Required | Description |
150
+
| --- | --- | --- |
151
+
| message | yes | The message to display. |
152
+
| severity | yes | The severity of the alert. |
152
153
153
154
### Confirm
154
155
155
156
To show a confirmation to the user, use the `confirm` function. It takes one options parameter:
156
157
157
-
| Property | Description |
158
-
| --- | --- |
159
-
| title | The optional title of the confirmation. |
160
-
| message | The message of the confirmation. |
161
-
| yes | The caption of the button to accept. If not provided the `yes` property of `strings` is used. The default is "Yes". |
162
-
| no | The caption of the button to deny. If not provided the `no` property of `strings` is used. The default is "No". If you pass `null`, the button is not displayed. |
158
+
| Property | Required | Description |
159
+
| --- | --- | --- |
160
+
| title | no | The title of the confirmation. |
161
+
| message | yes | The message of the confirmation. |
162
+
| yes | no | The caption of the button to accept. If not provided the `yes` property of `strings` is used. The default is "Yes". |
163
+
| no | no | The caption of the button to deny. If not provided the `no` property of `strings` is used. The default is "No". If you pass `null`, the button is not displayed. |
163
164
164
165
This function returns a `Promise`. It will be resolved if the confirmation is accepted and rejected if the confirmation is denied.
165
166
166
167
### Choose
167
168
168
169
To show a choice to the user, use the `choose` function. It takes one options parameter:
169
170
170
-
| Property | Description |
171
-
| --- | --- |
172
-
| title | The optional title of the choice. |
173
-
| options | The possible choices. |
174
-
| cancelCaption | The optional caption of the cancel action. If not provided the `cancel` property of `strings` is used. The default is "Cancel". |
171
+
| Property | Required | Description |
172
+
| --- | --- | --- |
173
+
| title | no | The title of the choice. |
174
+
| options | yes | The possible choices. |
175
+
| cancelCaption | no | The caption of the cancel action. If not provided the `cancel` property of `strings` is used. The default is "Cancel". |
175
176
176
177
This function returns a `Promise`. It will be resolved with the selected option and rejected if the choice is cancelled.
0 commit comments