[ADF-4406] - Confirm Dialog doesn't support a third extra button option to be customised (#4608)

* [ADF-4406] - Confirm Dialog doesn't support a third extra button option to be customised

* * comments fixed

* * docs and test added
This commit is contained in:
dhrn
2019-04-23 04:13:10 +05:30
committed by Eugenio Romano
parent b58e040d7e
commit 64391a48fa
7 changed files with 89 additions and 0 deletions

View File

@@ -10,7 +10,19 @@ Last reviewed: 2019-01-22
Requests a yes/no choice from the user.
![Confirm dialog](../../docassets/images/ConfirmDialog.png)
![Confirm dialog](../../docassets/images/ConfirmDialogYesAll.png)
## Dialog inputs
| Name | Type | Default value | Description |
| ---- | ---- | ---- | ----------- |
| title | `string` | `Confirm` | It will be placed in the dialog title section. |
| yesLabel | `string` | `yes` | It will be placed first in the dialog action section |
| noLabel | `string` | `no`| It will be placed last in the dialog action section |
| thirdOptionLabel (optional) | `string` | | It is not a mandatory input. it will be rendered in between yes and no label |
| message | `string` | `Do you want to proceed?` | It will be rendered in the dialog content area |
| htmlContent | `html` | | It will be rendered in the dialog content area |
*note*: `if input is not passed, default value will be rendered`
## Basic Usage
```ts
@@ -65,6 +77,26 @@ dialogRef.afterClosed().subscribe((result) => {
});
```
### Rendering with thirdOptionLabel
```
const thirdOptionLabel = "YES. DON'T SHOW IT AGAIN";
const dialog = this.dialog.open(ConfirmDialogComponent, {
data: {
title: 'Upload',
thirdOptionLabel: thirdOptionLabel,
message: `This is the default message`
},
minWidth: '250px'
});
dialog.afterClosed().subscribe((status) => {
// do the third option label operation
if ( status === thirdOptionLabel) {
// console.log('third option clicked');
}
});
```
## Details
This component lets the user make a yes/no choice to confirm an action. Use the

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB