mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[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:
@@ -10,7 +10,19 @@ Last reviewed: 2019-01-22
|
||||
Requests a yes/no choice from the user.
|
||||
|
||||

|
||||

|
||||
|
||||
## 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
|
||||
|
Reference in New Issue
Block a user