@@ -5,7 +5,12 @@ import { BehaviorSubject } from 'rxjs';
55import { PopupProps } from './popup' ;
66
77export interface PopupApi {
8- confirm ( title : string , message : string | React . ComponentType ) : Promise < boolean > ;
8+ confirm (
9+ title : string ,
10+ message : string | React . ComponentType ,
11+ customIcon ?: { name : string , color : string } ,
12+ titleColor ?: string ,
13+ ) : Promise < boolean > ;
914 prompt (
1015 title : string ,
1116 form : ( formApi : FormApi ) => RenderReturn , settings ?: {
@@ -25,7 +30,12 @@ export class PopupManager implements PopupApi {
2530 return this . popupPropsSubject . asObservable ( ) ;
2631 }
2732
28- public confirm ( title : string , message : string | React . ComponentType ) : Promise < boolean > {
33+ public confirm (
34+ title : string ,
35+ message : string | React . ComponentType ,
36+ customIcon ?: { name : string , color : string } ,
37+ titleColor ?: string ,
38+ ) : Promise < boolean > {
2939 const content = typeof message === 'string' && ( ( ) => ( < p > { message } </ p > ) ) || message as React . ComponentType ;
3040
3141 return new Promise ( ( resolve ) => {
@@ -36,15 +46,17 @@ export class PopupManager implements PopupApi {
3646
3747 this . popupPropsSubject . next ( {
3848 title : (
39- < span > { title } < i className = 'argo-icon-close' onClick = { ( ) => closeAndResolve ( false ) } /> </ span >
49+ < span style = { { display : 'flex' , alignItems : 'center' , justifyContent : 'space-between' } } > < div > { title } </ div > < i className = 'argo-icon-close' onClick = { ( ) => closeAndResolve ( false ) } /> </ span >
4050 ) ,
4151 content,
4252 footer : (
43- < div >
53+ < div style = { { display : 'flex' , gap : '8px' } } >
4454 < button qe-id = 'argo-popup-ok-button' className = 'argo-button argo-button--base' onClick = { ( ) => closeAndResolve ( true ) } > OK</ button >
4555 < button qe-id = 'argo-popup-cancel-button' className = 'argo-button argo-button--base-o' onClick = { ( ) => closeAndResolve ( false ) } > Cancel</ button >
4656 </ div >
4757 ) ,
58+ titleColor : titleColor ? titleColor : 'normal' ,
59+ icon : customIcon ? { name : customIcon ?. name , color : customIcon ?. color } : undefined ,
4860 } ) ;
4961 } ) ;
5062 }
@@ -79,7 +91,7 @@ export class PopupManager implements PopupApi {
7991 this . popupPropsSubject . next ( {
8092 children : undefined ,
8193 title : (
82- < span > { title } < i className = 'argo-icon-close' onClick = { ( ) => closeAndResolve ( null ) } /> </ span >
94+ < span style = { { display : 'flex' , alignItems : 'center' , justifyContent : 'space-between' , width : '100%' } } > < div > { title } </ div > < i className = 'argo-icon-close' onClick = { ( ) => closeAndResolve ( null ) } /> </ span >
8395 ) ,
8496 titleColor : titleColor ? titleColor : 'normal' ,
8597 icon : customIcon ? { name : customIcon ?. name , color : customIcon ?. color } : undefined ,
@@ -97,7 +109,7 @@ export class PopupManager implements PopupApi {
97109 </ Form >
98110 ) ,
99111 footer : (
100- < div >
112+ < div style = { { display : 'flex' , gap : '8px' } } >
101113 < button qe-id = 'prompt-popup-ok-button' className = 'argo-button argo-button--base' onClick = { ( e ) => formApi . submitForm ( e ) } > OK</ button >
102114 < button qe-id = 'prompt-popup-cancel-button' className = 'argo-button argo-button--base-o' onClick = { ( ) => closeAndResolve ( null ) } > Cancel</ button >
103115 </ div >
0 commit comments