@@ -36,61 +36,55 @@ export class DialogDirective implements OnInit, OnDestroy, OnChanges {
3636 /**
3737 * Title for the dialog
3838 * @type {string }
39- * @memberof DialogDirective
4039 */
4140 @Input ( ) title = "" ;
4241 /**
4342 * Dialog body content.
4443 * @type {(string | TemplateRef<any>) }
45- * @memberof DialogDirective
4644 */
4745 @Input ( ) ibmDialog : string | TemplateRef < any > ;
4846 /**
4947 * Defines how the Dialog is triggered.(Hover and click behave the same on mobile - both respond to a single tap)
5048 * @type {("click" | "hover" | "mouseenter") }
51- * @memberof DialogDirective
5249 */
5350 @Input ( ) trigger : "click" | "hover" | "mouseenter" = "click" ;
5451 /**
5552 * Placement of the dialog, usually relative to the element the directive is on.
56- * @memberof DialogDirective
5753 */
5854 @Input ( ) placement = "left" ;
5955 /**
6056 * Class to add to the dialog container
6157 * @type {string }
62- * @memberof DialogDirective
6358 */
6459 @Input ( ) wrapperClass : string ;
6560 /**
6661 * Spacing between the dialog and it's triggering element
6762 * @type {number }
68- * @memberof DialogDirective
6963 */
7064 @Input ( ) gap = 0 ;
7165 /**
66+ * Deprecated. Defaults to true. Use appendInline to keep dialogs within page flow
7267 * Value `true` sets Dialog be appened to the body (to break out of containers)
73- * @type {boolean }
74- * @memberof DialogDirective
7568 */
76- @Input ( ) appendToBody = false ;
69+ @Input ( ) set appendToBody ( v : boolean ) {
70+ console . log ( "`appendToBody` has been deprecated. Dialogs now append to the body by default." ) ;
71+ console . log ( "Ensure you have an `ibm-placeholder` in your app." ) ;
72+ console . log ( "Use `appendInline` if you need to position your dialogs within the normal page flow." ) ;
73+ this . appendInline = ! v ;
74+ }
75+ get appendToBody ( ) {
76+ return ! this . appendInline ;
77+ }
7778 /**
78- * Determines if the Dialog will attempt to place itself for maximum visibility.
79- * TODO: remove - this doesn't actually do anything
80- * @type {boolean }
81- * @memberof DialogDirective
82- * @deprecated
79+ * Set to `true` to open the dialog next to the triggering component
8380 */
84- @Input ( ) autoPosition : boolean ;
81+ @Input ( ) appendInline = false ;
8582 /**
8683 * Optional data for templates
87- * @memberof DialogDirective
8884 */
8985 @Input ( ) data = { } ;
9086 /**
9187 * Config object passed to the rendered component
92- * @type {DialogConfig }
93- * @memberof DialogDirective
9488 */
9589 @Output ( ) onClose : EventEmitter < any > = new EventEmitter < any > ( ) ;
9690 dialogConfig : DialogConfig ;
@@ -103,7 +97,6 @@ export class DialogDirective implements OnInit, OnDestroy, OnChanges {
10397 * @param {ElementRef } elementRef
10498 * @param {ViewContainerRef } viewContainerRef
10599 * @param {DialogService } dialogService
106- * @memberof DialogDirective
107100 */
108101 constructor (
109102 protected elementRef : ElementRef ,
@@ -113,7 +106,6 @@ export class DialogDirective implements OnInit, OnDestroy, OnChanges {
113106 /**
114107 * Overrides 'touchstart' event to trigger a toggle on the Dialog.
115108 * @param {any } evt
116- * @memberof DialogDirective
117109 */
118110 @HostListener ( "touchstart" , [ "$event" ] )
119111 onTouchStart ( evt ) {
@@ -131,8 +123,7 @@ export class DialogDirective implements OnInit, OnDestroy, OnChanges {
131123 parentRef : this . elementRef ,
132124 gap : this . gap ,
133125 trigger : this . trigger ,
134- appendToBody : this . appendToBody ,
135- autoPosition : this . autoPosition ,
126+ appendInline : this . appendInline ,
136127 wrapperClass : this . wrapperClass ,
137128 data : this . data
138129 } ;
@@ -141,7 +132,6 @@ export class DialogDirective implements OnInit, OnDestroy, OnChanges {
141132 /**
142133 * Sets the config object and binds events for hovering or clicking before
143134 * running code from child class.
144- * @memberof DialogDirective
145135 */
146136 ngOnInit ( ) {
147137 // fix for safari hijacking clicks
@@ -173,7 +163,6 @@ export class DialogDirective implements OnInit, OnDestroy, OnChanges {
173163 /**
174164 * When the host dies, kill the popover.
175165 * - Useful for use in a modal or similar.
176- * @memberof DialogDirective
177166 */
178167 ngOnDestroy ( ) {
179168 this . close ( ) ;
@@ -182,7 +171,6 @@ export class DialogDirective implements OnInit, OnDestroy, OnChanges {
182171 /**
183172 * Helper method to call dialogService 'open'.
184173 * - Enforce accessibility by updating an aria attr for nativeElement.
185- * @memberof DialogDirective
186174 */
187175 open ( ) {
188176 this . dialogService . open ( this . viewContainerRef , this . dialogConfig ) ;
@@ -192,7 +180,6 @@ export class DialogDirective implements OnInit, OnDestroy, OnChanges {
192180 /**
193181 * Helper method to call dialogService 'toggle'.
194182 * - Enforce accessibility by updating an aria attr for nativeElement.
195- * @memberof DialogDirective
196183 */
197184 toggle ( ) {
198185 this . dialogService . toggle ( this . viewContainerRef , this . dialogConfig ) ;
@@ -202,7 +189,6 @@ export class DialogDirective implements OnInit, OnDestroy, OnChanges {
202189 /**
203190 * Helper method to call dialogService 'close'.
204191 * - Enforce accessibility by updating an aria attr for nativeElement.
205- * @memberof DialogDirective
206192 */
207193 close ( ) {
208194 this . dialogService . close ( this . viewContainerRef ) ;
@@ -213,7 +199,6 @@ export class DialogDirective implements OnInit, OnDestroy, OnChanges {
213199 * Empty method for child classes to override and specify additional init steps.
214200 * Run after DialogDirective completes it's ngOnInit.
215201 * @protected
216- * @memberof DialogDirective
217202 */
218203 protected onDialogInit ( ) { }
219204}
0 commit comments