projects/i-components/src/lib/components/child-window/child-window.component.ts
Angular Component for the ChildWindow Control.
OnInit
DoCheck
AfterViewInit
AfterContentInit
changeDetection | ChangeDetectionStrategy.OnPush |
selector | wm-child-window |
styleUrls | ./child-window.component.scss |
templateUrl | ./child-window.component.html |
Public
constructor(injectedModel: ChildWindowModel, cd: ChangeDetectorRef, dialog: DialogService, injector: Injector, element: ElementRef)
|
||||||||||||||||||
Creates an instance of ChildWindowComponent.
Parameters :
|
class | |
Type : string
|
|
Class input for the element in order to apply the class to the correct element |
content | |
Type : any
|
|
Gets/Sets the content model property for the control when the content is an input |
hasCloseButton | |
Type : boolean
|
|
Gets or sets a value that indicates whether the ChildWindow has a close button |
isModal | |
Type : boolean
|
|
Sets this ChildWindowComponent as modal or not. |
model | |
Type : ChildWindowModel
|
|
ChildWindow model |
name | |
Type : string
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:139
|
|
Sets the name model property for the control when the name is an input. |
title | |
Type : any
|
|
Sets display title. |
controlTemplate | |
Type : any
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:1197
|
|
Sets the controlTemplate Input property for changing the model's |
cursor | |
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:1451
|
|
Property used to save the cursor value |
dataContext | |
Type : any
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:952
|
|
Gets/sets the dataContext Input property for changing the model's |
dataGridRowHeight | |
Type : number
|
|
Default value : 22
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:507
|
|
Represents the row height of both the DataGrid and XamGrid components it affects the css and also an internal function that virtualized data, so do not change directly on css, use this variable instead. |
foreground | |
Type : any
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:1223
|
|
Sets the value of the Foreground property |
height | |
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:1394
|
|
Sets the height |
horizontalAlignment | |
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:1096
|
|
Sets the horizontal alignment. |
horizontalContentAlignment | |
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:1125
|
|
Sets the horizontal content alignment. |
hostHozSelfAlign | |
Type : boolean
|
|
Default value : false
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:380
|
|
Applies horizontal selfalign class. Flags indicates when the control should handle its own horizontal alignment and ignore container alignment. |
isEnabled | |
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:1008
|
|
Gets/sets the isEnabled property for the BaseComponent |
isTabStop | |
Type : boolean
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:760
|
|
Sets/gets IsTabStop property of the BaseComponent |
margin | |
Type : string
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:782
|
|
Sets Margin property of the BaseComponent. |
maxHeight | |
Type : any
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:1325
|
|
Sets maxHeight |
maxWidth | |
Type : any
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:1283
|
|
Sets maxWidth |
minHeight | |
Type : any
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:1304
|
|
Sets minHeight |
minWidth | |
Type : any
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:1262
|
|
Sets min Width |
opacity | |
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:1336
|
|
Sets Opacity value property of the component |
spellCheck | |
Type : boolean
|
|
Default value : false
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:186
|
|
Flag to determinate if the component should do the spell check or not. Default value is false. |
style | |
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:1434
|
|
Sets the style |
tabIndex | |
Type : number
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:733
|
|
Sets the property TabIndex of the control model. |
tag | |
Type : any
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:1171
|
|
Object used in the Tag property of the Button |
useCss | |
Type : boolean
|
|
Default value : false
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:177
|
|
Determines if the component uses CSS height/width values, instead of inputs |
verticalAlignment | |
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:1038
|
|
Sets the vertical alignment. |
verticalContentAlignment | |
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:1067
|
|
Sets the vertical content alignment. |
visibility | |
Type : any
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:980
|
|
Gets/sets the visibility property for the BaseComponent |
width | |
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:1365
|
|
Sets the width |
zindex | |
Type : number
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:1498
|
|
Property used to set the canvas zindex value. Note: Consider moving this @Input to canvas.direcive.ts, refactoring the directive so all inputs are declared in the directive, and all @HostBindings are declared here in baseComponent, the directive would be responsible for updating the models, while baseComponent will be responsible for binding the values: zIndex, Top, Left... |
bindingValidationError | |
Type : EventEmitter<any>
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:114
|
|
output to emit the new value of the bindingValidationError event |
layoutUpdated | |
Type : EventEmitter<any>
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:140
|
|
Output to emit when then component's layout is updated. |
loaded | |
Type : EventEmitter<any>
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:123
|
|
Output to emit when then component is loaded. |
mouseEnter | |
Type : EventEmitter<literal type>
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:157
|
|
Event Emitter. EventEmitter normally called in the mouseEnterHandler. |
mouseLeave | |
Type : EventEmitter<literal type>
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:167
|
|
Event Emitter Called in the mouseLeave handler |
mouseLeftButtonUp | |
Type : EventEmitter<literal type>
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:147
|
|
MouseLeftButtonUp event Emitter. |
sizeChanged | |
Type : EventEmitter<any>
|
|
Inherited from
BaseComponent
|
|
Defined in
BaseComponent:132
|
|
Output to emit when then component size is changed. |
class |
Type : string
|
Default value : null
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:407
|
Applies custom CSS classes |
class.defaultFontStyles |
Type : boolean
|
Default value : false
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:398
|
Applies default font styles class, used to allow specificity for each control css |
class.focusable |
Type : boolean
|
Default value : false
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:388
|
Display if the component is focusable or not |
class.hasDefinedCursor |
Type : boolean
|
Default value : false
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:415
|
Applies Defined Cursor class |
class.horizontal-center |
Type : boolean
|
Default value : false
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:308
|
Applies horizontal alignment left class |
class.horizontal-left |
Type : boolean
|
Default value : false
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:298
|
Applies horizontal alignment left class |
class.horizontal-right |
Type : boolean
|
Default value : false
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:368
|
Applies horizontal alignment right class |
class.horizontal-stretch |
Type : boolean
|
Default value : false
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:358
|
Applies horizontal alignment stretch class |
class.vertical-bottom |
Type : boolean
|
Default value : false
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:328
|
Applies vertical alignment bottom class |
class.vertical-center |
Type : boolean
|
Default value : false
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:338
|
Applies vertical alignment center class |
class.vertical-stretch |
Type : boolean
|
Default value : false
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:318
|
Applies horizontal alignment stretch class |
class.vertical-top |
Type : boolean
|
Default value : false
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:348
|
Applies vertical alignment top class |
style.display |
Type : any
|
Default value : null
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:243
|
Property use it to apply the host binding for the visibility |
style.font-family |
Type : any
|
Default value : null
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:261
|
Property use it to apply the host binding for the font-family |
style.font-size |
Type : any
|
Default value : null
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:270
|
Property use it to apply the host binding for the font-size |
style.font-style |
Type : any
|
Default value : null
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:279
|
Property use it to apply the host binding for the font-style |
style.font-weight |
Type : any
|
Default value : null
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:288
|
Property use it to apply the host binding for the font-weight |
style.height |
Type : string
|
Default value : null
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:218
|
Property use it to apply the host binding for the height |
style.max-height.px |
Type : number
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:234
|
Property used to apply the host binding for max-height |
style.max-width.px |
Type : number
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:210
|
Property used to apply the host binding for max-width |
style.min-height.px |
Type : number
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:226
|
Property used to apply the host binding for min-height |
style.min-width.px |
Type : number
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:202
|
Property used to apply the host binding for min-width |
style.opacity |
Type : any
|
Default value : null
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:252
|
Property use it to apply the host binding for the opacity |
style.width |
Type : string
|
Default value : null
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:194
|
Property use it to apply the host binding for the width |
style.z-index |
Type : string
|
Default value : null
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:424
|
Sets the z-index style. |
closeDialog |
closeDialog()
|
Close childWindow form when click close button.
Returns :
void
|
dragMoveEventHandler | ||||||
dragMoveEventHandler(event: IDragMoveEventArgs)
|
||||||
Drag move handler
Parameters :
Returns :
void
|
hasTitle |
hasTitle()
|
Check if the window have a title
Returns :
boolean
{boolean} |
modelChangeHandler | ||||||
modelChangeHandler(name: string)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:409
|
||||||
Change handler
Parameters :
Returns :
void
|
ngAfterContentInit |
ngAfterContentInit()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:309
|
Angular lifecycle
Returns :
void
|
ngAfterViewInit |
ngAfterViewInit()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:320
|
Angular lifecycle Sets render flag true
Returns :
void
|
ngDoCheck |
ngDoCheck()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:370
|
Angular lifecycle Validates if control needs to be created
Returns :
void
|
ngOnInit |
ngOnInit()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:282
|
Angular lifecycle Initialize model
Returns :
void
|
onDialogClosedHandler |
onDialogClosedHandler()
|
Action triggered when dialog is closed.
Returns :
void
|
onDialogOpenedHandler |
onDialogOpenedHandler()
|
Action triggered after dialog is opened.
Returns :
void
|
removeMe |
removeMe()
|
Removes instance of child windowcomponent parent reference.
Returns :
void
|
Private setStaticChild |
setStaticChild()
|
Sets the flag for rendering the static child
Returns :
void
|
Protected alignmentHandler |
alignmentHandler()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:2346
|
Calculate the values for the grid size behavior from the alignments
Returns :
void
|
Protected assignPendingPropertyValues |
assignPendingPropertyValues()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:2057
|
Apply pending assignments to properties with property values
Returns :
void
|
calculateActualSize | ||||||||
calculateActualSize(name?: string)
|
||||||||
Inherited from
BaseComponent
|
||||||||
Defined in
BaseComponent:1674
|
||||||||
If the name is equal to 'calculateActualSize', then call the handlerCalcActualSize function and pass in false to avoid the timer in the function. memberof BaseComponent
Parameters :
Returns :
void
|
Protected checkAndRegisterCompatibilityBinding | |||||||||
checkAndRegisterCompatibilityBinding(property: DependencyProperty, bindingObjectCandidate: any)
|
|||||||||
Inherited from
BaseComponent
|
|||||||||
Defined in
BaseComponent:2023
|
|||||||||
Verifies if the given object (bindingObjectCandidate) is a binding object. If so the binding will be registered.
Parameters :
Returns :
boolean
{boolean} true if the value is a binding info object and if the binding was registered, false if not |
Protected checkForStaticResource | ||||||||||||
checkForStaticResource(property: string, value: any)
|
||||||||||||
Inherited from
BaseComponent
|
||||||||||||
Defined in
BaseComponent:2043
|
||||||||||||
Checks if the given value is a static resource reference or not, if a reference then the value is queue for later assignment.
Parameters :
Returns :
boolean
true if the value is a static resource reference, otherwise false |
checkStaticItemInModelCollection | ||||||||||||
checkStaticItemInModelCollection(collection: any, itemToCheck: any)
|
||||||||||||
Inherited from
BaseComponent
|
||||||||||||
Defined in
BaseComponent:1889
|
||||||||||||
Checks if the element exists previously in the items collection
Parameters :
Returns :
number
number Returns -1 if the item is not present in the items collection otherwise the index value |
createElementInRoot |
createElementInRoot(injector: Injector, componentToCreate: any)
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:2698
|
Create a given component on the HTML body.
Returns :
ComponentRef<any>
|
cursorStyle |
cursorStyle()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:1549
|
Returns the correct CSS cursor style and sets the definedCursor flag if necessary
Returns :
string
{string} |
detectChanges |
detectChanges()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:813
|
Performs a single detect Changes over the component
Returns :
void
|
detectChangesAction |
detectChangesAction()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:1686
|
Handle subscription to the notifyDetectChanges action Refresh the component whenever a model modification was performed
Returns :
void
|
getForeground |
getForeground()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:1966
|
Calculates the Foreground color to be applied
Returns :
string
string |
getImageString | ||||||
getImageString(value: any)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:2221
|
||||||
Returns string path to the image.
Parameters :
Returns :
any
|
getTargetValue | ||||||
getTargetValue(e: Event)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:2239
|
||||||
Returns the value from a $event
Parameters :
Returns :
string
|
Protected handlerCalcActualSize | ||||||
handlerCalcActualSize(async: boolean)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:2391
|
||||||
Handler that calculates ActualHeight & ActualWidth based on its inner content.
Parameters :
Returns :
void
|
heightCalc |
heightCalc()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:1939
|
Applies the height CSS value
Returns :
any
|
heightDefaultStyle |
heightDefaultStyle()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:1914
|
Calculates the auto height value
Returns :
string
{string} |
Protected hostHorizontalAlignmentCall |
hostHorizontalAlignmentCall()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:2374
|
Assign all the horizontal bindings for the control
Returns :
void
|
Protected hostVerticalAlignmentCall |
hostVerticalAlignmentCall()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:2357
|
Assign all the vertical bindings for the control
Returns :
void
|
imageToPath | ||||||
imageToPath(value: any)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:2202
|
||||||
Returns the path of the given image.
Parameters :
Returns :
any
|
loadStaticItems | ||||||||||||
loadStaticItems(staticItems: any, itemsCollection: any)
|
||||||||||||
Inherited from
BaseComponent
|
||||||||||||
Defined in
BaseComponent:1634
|
||||||||||||
Parameters :
Returns :
void
void |
Private markForCheckComp |
markForCheckComp()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:2451
|
Marks current component
Returns :
void
|
mouseEnterHandler | ||||||||
mouseEnterHandler(event: any)
|
||||||||
Inherited from
BaseComponent
|
||||||||
Defined in
BaseComponent:1982
|
||||||||
Event Handler for when the mouse enter the Image component.
Parameters :
Returns :
void
|
mouseLeaveHandler | ||||||||
mouseLeaveHandler(event: any)
|
||||||||
Inherited from
BaseComponent
|
||||||||
Defined in
BaseComponent:2001
|
||||||||
Event Handler for when the mouse enter the Image component.
Parameters :
Returns :
void
|
Public ngAfterContentChecked |
ngAfterContentChecked()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:867
|
Angular Lifecycle Hooks
Returns :
void
|
Public ngAfterViewChecked |
ngAfterViewChecked()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:893
|
Angular Lifecycle Hooks
Returns :
void
|
Public ngOnChanges |
ngOnChanges()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:824
|
Angular Lifecycle Hooks
Returns :
void
|
Public ngOnDestroy |
ngOnDestroy()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:906
|
Cleanup operations for base component
Returns :
void
|
preventItemsDuplication | ||||||||||||||||||
preventItemsDuplication(itemsToRender: any, items: any, contentChildTemplate: any, afterContentInitCalled: boolean, injector: Injector)
|
||||||||||||||||||
Inherited from
BaseComponent
|
||||||||||||||||||
Defined in
BaseComponent:2170
|
||||||||||||||||||
Validates if coming models are the same, and prevents to be recreated on Ribbon DOM. (Needs to be checked, in some statics scenarios RibbonTab, RibbonGroup duplicates items)
Parameters :
Returns :
any[]
|
processAlignments | ||||||
processAlignments(name: string)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:1704
|
||||||
Method to check if the component should assign a alignment property
Parameters :
Returns :
void
{void} |
processCursor | ||||||
processCursor(name: string)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:1850
|
||||||
Method to set the cursor style of the component
Parameters :
Returns :
void
|
processCustomCssClasses | ||||||
processCustomCssClasses(name: string)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:1723
|
||||||
Method to set custom CSS Clases
Parameters :
Returns :
void
{void} |
processFocusable | ||||||
processFocusable(name: string)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:1816
|
||||||
Method to check and set the height of the grid
Parameters :
Returns :
void
|
Private processFontFamily | ||||||
processFontFamily(name: string)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:2784
|
||||||
Process the FontFamily property
Parameters :
Returns :
any
|
processFonts | ||||||
processFonts(name: string)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:1778
|
||||||
Method to apply the font styles for the component.
Parameters :
Returns :
void
|
Private processFontSize | ||||||
processFontSize(name: string)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:2798
|
||||||
Process the FontSize property
Parameters :
Returns :
any
|
Private processFontStyle | ||||||
processFontStyle(name: string)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:2815
|
||||||
Process the FontStyle property
Parameters :
Returns :
any
|
Private processFontWeight | ||||||
processFontWeight(name: string)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:2832
|
||||||
Process the FontWeight property
Parameters :
Returns :
any
|
processHeights | ||||||
processHeights(name: string)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:1797
|
||||||
Method to check and set the height of the grid
Parameters :
Returns :
void
|
processIsEnabled | ||||||
processIsEnabled(name: string)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:1764
|
||||||
Process changes to
Parameters :
Returns :
void
|
processOpacity | ||||||
processOpacity(name: string)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:1751
|
||||||
Method to apply the opacity for the component.
Parameters :
Returns :
void
|
processVisibility | ||||||
processVisibility(name: string)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:1737
|
||||||
Method to check if the component should be show or hide.
Parameters :
Returns :
void
|
processWidths | ||||||
processWidths(name: string)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:1829
|
||||||
Method to check and set the width of the grid
Parameters :
Returns :
void
|
Private processZIndex | ||||||
processZIndex(name: string)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:1872
|
||||||
Method to process the ZIndex when set through the model
Parameters :
Returns :
void
|
Private recreateInvalidBindings |
recreateInvalidBindings()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:2756
|
Execution of removeModelProxyHandlers in a previous instance of the component (that used the same model) could have set some bindings in an invalid state, this will check if some of them has to be recreated
Returns :
void
|
Private registerContextMenuActions | ||||||
registerContextMenuActions(ctxMenu: ContextMenuManager)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:2533
|
||||||
Enable the contextMenu actions to be displayed when the user perform an action Creates dinamically a new instance of XamContextMenu to be displayed in the screen
Parameters :
Returns :
void
|
Protected registerDomEventListenerOnElement |
registerDomEventListenerOnElement(eventName: string, handler: any)
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:2316
|
Registers a DOM handler on the current element
Returns :
void
|
Protected registerHandler | |||||||||
registerHandler(event: SubscriptionEvent<void>, arrowHandler: (s: any,a: any) => void)
|
|||||||||
Inherited from
BaseComponent
|
|||||||||
Defined in
BaseComponent:2298
|
|||||||||
Register arrow handler into the given
Parameters :
Returns :
void
|
Protected registerMouseEvents |
registerMouseEvents()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:2272
|
Registers mouse events if required
Returns :
void
|
Protected registerObservers | ||||||||||||
registerObservers(emitter: EventEmitter
|
||||||||||||
Inherited from
BaseComponent
|
||||||||||||
Defined in
BaseComponent:2252
|
||||||||||||
Register observers from the given
Parameters :
Returns :
void
|
Private registerToolTip | |||||||||
registerToolTip(element: ElementRef
|
|||||||||
Inherited from
BaseComponent
|
|||||||||
Defined in
BaseComponent:2607
|
|||||||||
Registers a tooltip to a component
Parameters :
Returns :
void
|
Private removeModelProxyHandlers |
removeModelProxyHandlers()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:2738
|
Clean up the handlers when the component is destroyed
Returns :
void
|
Private setComponentForDirectives |
setComponentForDirectives()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:2512
|
Sets an internal reference through the element ref to access the component in a directive
Returns :
void
|
Protected setPendingPropertyValue |
setPendingPropertyValue(property: string, value: any)
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:2336
|
Stores the pending property values for instance attach properties. Which will be applied when the model is available
Returns :
void
|
setupDependencyComponents | ||||||
setupDependencyComponents(model: FrameworkElement)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:1612
|
||||||
Adds the references to the dependency components
Parameters :
Returns :
void
|
setupModel | ||||||
setupModel(model: FrameworkElement)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:1559
|
||||||
Syncs the modelProxy with model
Parameters :
Returns :
void
void |
Private syncToolTip | ||||||
syncToolTip(tooltip: ToolTipModel)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:2587
|
||||||
Updates the tooltip associated to a component
Parameters :
Returns :
void
|
Private syncValidationError | ||||||
syncValidationError(name?: string)
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:2766
|
||||||
Syncs validation information with component properties
Parameters :
Returns :
void
|
Private tabSelectionSubscription |
tabSelectionSubscription()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:2471
|
Subscribe to the tabhandler event if Required When the component is inside a tab control it should trigger the load event every time the tab is selected
Returns :
void
|
trackByFn | ||||||||||||
trackByFn(index: any, item: any)
|
||||||||||||
Inherited from
BaseComponent
|
||||||||||||
Defined in
BaseComponent:1904
|
||||||||||||
Function used by Angular to track elements in the ngFor directive. We use the GUID property to compare elements.
Parameters :
Returns :
any
{*} -return the model or object itself |
Private unregisterToolTip | ||||||
unregisterToolTip(element: ElementRef
|
||||||
Inherited from
BaseComponent
|
||||||
Defined in
BaseComponent:2719
|
||||||
Unregisters a tooltip to a component
Parameters :
Returns :
void
|
Private updateSizePropertiesForActualSizeChange | ||||||||
updateSizePropertiesForActualSizeChange(element: Element)
|
||||||||
Inherited from
BaseComponent
|
||||||||
Defined in
BaseComponent:2421
|
||||||||
Updates the size properties of the component based on the initial size change
Parameters :
Returns :
void
|
validatesLoadingFlag |
validatesLoadingFlag()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:1519
|
Validates loading flag for components outside current tab index TabIndexService should be only tabItem provider, and when currentTabId is different from selectedTab IsFirstTimeLoad is set to false because tabService is going to be one in charge to trigger only one time when tab changes.
Returns :
void
|
widthCalc |
widthCalc()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:1953
|
Applies the width CSS value
Returns :
any
|
widthDefaultStyle |
widthDefaultStyle()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:1926
|
Calculates the auto width value
Returns :
string
{string} |
Private _verticalScrollbarRemoved |
Default value : false
|
Internal variable to control if vertical scrollbar has been eliminated |
cached |
Type : any
|
Property used to keep the current content that should be rendered in the control. Usually use in the internalContent to compare if the content property changes. |
childWindow |
Type : TemplateRef<any>
|
Decorators :
@ViewChild('childWindow')
|
IgxDialog Reference |
class |
Type : string
|
Decorators :
@Input()
|
Class input for the element in order to apply the class to the correct element |
contentChild |
Type : any
|
Decorators :
@ContentChild('contentChild')
|
Reference to the static child if exist |
Public dialog |
Type : DialogService
|
Public element |
Type : ElementRef
|
Public injectedModel |
Type : ChildWindowModel
|
Decorators :
@Optional()
|
Public injector |
Type : Injector
|
mainContent |
Type : any
|
Decorators :
@ViewChild('mainContent')
|
Gets a reference to the container div |
model |
Type : ChildWindowModel
|
Decorators :
@Input()
|
ChildWindow model |
Public modelProxy |
Type : ChildWindowModel
|
Default value : ModelProxy.create<ChildWindowModel>()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:201
|
Copy of the model |
openFlag |
Default value : false
|
Flag used to open the dialog |
parentRef |
Type : any
|
Parent view reference |
renderingFlag |
Default value : false
|
Flag use to prepare component to render |
Public renderStaticChild |
Default value : false
|
Flag to indicate if should render de ng-content or not |
actualSizeCalled |
Default value : false
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:481
|
Flag to know if the Angular event was called |
afterContentInitCalled |
Default value : false
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:465
|
Flag to know if the Angular event was called |
afterViewCheckedCalled |
Default value : false
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:473
|
Flag to know if the Angular event was called |
afterViewInitCalled |
Default value : false
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:457
|
Flag to know if the Angular event was called |
Private bindingValidationCallback |
Type : function
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:618
|
Callback for binding validation |
bindingValidationError |
Type : EventEmitter<any>
|
Default value : new EventEmitter()
|
Decorators :
@Output()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:114
|
output to emit the new value of the bindingValidationError event |
Private cdRefInjection |
Type : ChangeDetectorRef
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:659
|
Change Detector Reference for the component |
Private changeDetectionTimer |
Type : any
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:668
|
A timer to debounce changedetection actions |
Protected changeDetectorNotifier |
Type : ChangeDectionNotifierService
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:576
|
Change Detection Notifier Service instace. |
Private contextMenuUnlistener |
Type : function
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:676
|
Context Menu event unlisten action. |
Private ctxMenuInstance |
Type : any
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:630
|
Reference to the ctxMenuInstance |
customCssClasses |
Type : string
|
Default value : null
|
Decorators :
@HostBinding('class')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:407
|
Applies custom CSS classes |
Private customTooltipInstance |
Type : any
|
Default value : null
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:641
|
Reference to the custom tooltip instance this is used to render a popup with custom elements used when the content value is not a string |
dataGridRowHeight |
Type : number
|
Default value : 22
|
Decorators :
@Input()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:507
|
Represents the row height of both the DataGrid and XamGrid components it affects the css and also an internal function that virtualized data, so do not change directly on css, use this variable instead. |
Protected domHandlerUnListeners |
Type : Array<void>
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:567
|
A collection (possible undefined) of DOM unlistener functions . That is, functions to de register handlers |
fireLoadedSubscription |
Type : Subscription
|
Default value : null
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:449
|
Flag to control load event for components inside tab control |
focusable |
Default value : false
|
Decorators :
@HostBinding('class.focusable')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:388
|
Display if the component is focusable or not |
Protected handlersToUnregister |
Type : Array<>
|
Default value : []
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:558
|
handlers to unregister when the component is destroyed |
hasDefinedCursor |
Default value : false
|
Decorators :
@HostBinding('class.hasDefinedCursor')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:415
|
Applies Defined Cursor class |
hostFontFamily |
Type : any
|
Default value : null
|
Decorators :
@HostBinding('style.font-family')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:261
|
Property use it to apply the host binding for the font-family |
hostFontSize |
Type : any
|
Default value : null
|
Decorators :
@HostBinding('style.font-size')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:270
|
Property use it to apply the host binding for the font-size |
hostFontStyle |
Type : any
|
Default value : null
|
Decorators :
@HostBinding('style.font-style')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:279
|
Property use it to apply the host binding for the font-style |
hostFontStyles |
Default value : false
|
Decorators :
@HostBinding('class.defaultFontStyles')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:398
|
Applies default font styles class, used to allow specificity for each control css |
hostFontWeight |
Type : any
|
Default value : null
|
Decorators :
@HostBinding('style.font-weight')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:288
|
Property use it to apply the host binding for the font-weight |
hostHeight |
Type : string
|
Default value : null
|
Decorators :
@HostBinding('style.height')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:218
|
Property use it to apply the host binding for the height |
hostHozCenter |
Default value : false
|
Decorators :
@HostBinding('class.horizontal-center')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:308
|
Applies horizontal alignment left class |
hostHozLeft |
Default value : false
|
Decorators :
@HostBinding('class.horizontal-left')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:298
|
Applies horizontal alignment left class |
hostHozRight |
Default value : false
|
Decorators :
@HostBinding('class.horizontal-right')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:368
|
Applies horizontal alignment right class |
hostHozSelfAlign |
Default value : false
|
Decorators :
@HostBinding('class.horizontal-selfalign')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:380
|
Applies horizontal selfalign class. Flags indicates when the control should handle its own horizontal alignment and ignore container alignment. |
hostHozStretch |
Default value : false
|
Decorators :
@HostBinding('class.horizontal-stretch')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:358
|
Applies horizontal alignment stretch class |
hostMaxHeight |
Type : number
|
Decorators :
@HostBinding('style.max-height.px')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:234
|
Property used to apply the host binding for max-height |
hostMaxWidth |
Type : number
|
Decorators :
@HostBinding('style.max-width.px')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:210
|
Property used to apply the host binding for max-width |
hostMinHeight |
Type : number
|
Decorators :
@HostBinding('style.min-height.px')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:226
|
Property used to apply the host binding for min-height |
hostMinWidth |
Type : number
|
Decorators :
@HostBinding('style.min-width.px')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:202
|
Property used to apply the host binding for min-width |
hostOpacity |
Type : any
|
Default value : null
|
Decorators :
@HostBinding('style.opacity')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:252
|
Property use it to apply the host binding for the opacity |
hostVerBottom |
Default value : false
|
Decorators :
@HostBinding('class.vertical-bottom')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:328
|
Applies vertical alignment bottom class |
hostVerCenter |
Default value : false
|
Decorators :
@HostBinding('class.vertical-center')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:338
|
Applies vertical alignment center class |
hostVerStretch |
Default value : false
|
Decorators :
@HostBinding('class.vertical-stretch')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:318
|
Applies horizontal alignment stretch class |
hostVerTop |
Default value : false
|
Decorators :
@HostBinding('class.vertical-top')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:348
|
Applies vertical alignment top class |
hostVisibility |
Type : any
|
Default value : null
|
Decorators :
@HostBinding('style.display')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:243
|
Property use it to apply the host binding for the visibility |
hostWidth |
Type : string
|
Default value : null
|
Decorators :
@HostBinding('style.width')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:194
|
Property use it to apply the host binding for the width |
hostZIndex |
Type : string
|
Default value : null
|
Decorators :
@HostBinding('style.z-index')
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:424
|
Sets the z-index style. |
isInitialized |
Type : any
|
Default value : undefined
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:523
|
Flag to know if the component is ready to render |
isInternalInherit |
Default value : false
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:515
|
Flag which indicates that the component is an internal use for inheritance |
layoutUpdated |
Type : EventEmitter<any>
|
Default value : new EventEmitter()
|
Decorators :
@Output()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:140
|
Output to emit when then component's layout is updated. |
loaded |
Type : EventEmitter<any>
|
Default value : new EventEmitter()
|
Decorators :
@Output()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:123
|
Output to emit when then component is loaded. |
Protected modelChangeRef |
Type : function
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:601
|
Contains the reference of the function added for handle the model's change |
mouseEnter |
Type : EventEmitter<literal type>
|
Default value : new EventEmitter()
|
Decorators :
@Output()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:157
|
Event Emitter. EventEmitter normally called in the mouseEnterHandler. |
mouseLeave |
Type : EventEmitter<literal type>
|
Default value : new EventEmitter()
|
Decorators :
@Output()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:167
|
Event Emitter Called in the mouseLeave handler |
Private mouseLeaveTooltipUnlistener |
Type : function
|
Default value : null
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:684
|
Mouse over event for tooltip unlisten action. |
mouseLeftButtonUp |
Type : EventEmitter<literal type>
|
Default value : new EventEmitter<any>()
|
Decorators :
@Output()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:147
|
MouseLeftButtonUp event Emitter. |
Private mouseMoveTooltipUnlistener |
Type : function
|
Default value : null
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:701
|
Mouse move event for tooltip unlisten action. This should have a short lifespan, as much as it takes for the tooltip to be shown |
Private mouseOverTooltipUnlistener |
Type : function
|
Default value : null
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:692
|
Mouse over event for tooltip unlisten action. |
Protected ngZone |
Type : NgZone
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:585
|
Angular´s NgZone accessor |
Protected pendingDependencyPropertyValue |
Type : Array<>
|
Default value : []
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:549
|
A collection of pending dependency properties values to assign to the model |
Protected pendingSetValues |
Type : Array<>
|
Default value : []
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:540
|
A collection of pending values to assign to the model |
Protected renderer2 |
Type : Renderer2
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:594
|
Angular´s Renderer2 |
sizeChanged |
Type : EventEmitter<any>
|
Default value : new EventEmitter()
|
Decorators :
@Output()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:132
|
Output to emit when then component size is changed. |
Private sizeChangedPendingTimeout |
Type : any
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:610
|
Timeout id for triggering the sizechanged event |
spellCheck |
Default value : false
|
Decorators :
@Input()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:186
|
Flag to determinate if the component should do the spell check or not. Default value is false. |
staticContent |
Type : any
|
Default value : null
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:432
|
cache the static content of the control to validate if the current data is not equals. |
tabSubscription |
Type : Subscription
|
Default value : null
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:440
|
TabSelection event subscription |
Private tooltipMousePosition |
Type : DOMRect
|
Default value : null
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:710
|
To track the position of the mouse while the tooltip is being displayed |
Private toolTipTimeout |
Type : any
|
Default value : null
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:650
|
To control the timer to show the tooltip |
useCss |
Default value : false
|
Decorators :
@Input()
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:177
|
Determines if the component uses CSS height/width values, instead of inputs |
validationError |
Default value : false
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:488
|
Property to set the validationError class in the component |
validationErrorMessage |
Type : string
|
Default value : ''
|
Inherited from
BaseComponent
|
Defined in
BaseComponent:496
|
Property for specifying validation error message |
content | ||||||
getcontent()
|
||||||
setcontent(value: any)
|
||||||
Gets/Sets the content model property for the control when the content is an input
Parameters :
Returns :
void
|
isModal | ||||||
getisModal()
|
||||||
Indicates whether this ChildWindowComponent is modal or not.
Returns :
boolean
|
||||||
setisModal(value: boolean)
|
||||||
Sets this ChildWindowComponent as modal or not.
Parameters :
Returns :
void
|
name | ||||||
setname(value: string)
|
||||||
Sets the name model property for the control when the name is an input.
Parameters :
Returns :
void
|
title | ||||||
gettitle()
|
||||||
Display childWindow title.
Returns :
any
|
||||||
settitle(value: any)
|
||||||
Sets display title.
Parameters :
Returns :
void
|
hasCloseButton | ||||||
gethasCloseButton()
|
||||||
Gets or sets a value that indicates whether the ChildWindow has a close button
Returns :
boolean
|
||||||
sethasCloseButton(value: boolean)
|
||||||
Gets or sets a value that indicates whether the ChildWindow has a close button
Parameters :
Returns :
void
|
innerContent |
getinnerContent()
|
Gets the content that should be rendered in the contentControl Component
Returns :
any
|
import { useAnimation } from '@angular/animations';
import {
AfterContentInit,
AfterViewInit,
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ContentChild,
DoCheck,
ElementRef,
Injector,
Input,
OnInit,
Optional,
Renderer2,
TemplateRef,
ViewChild,
} from '@angular/core';
import {
AngularComponentId,
ChildWindowModel,
ChildWindowService,
ComponentId,
DialogService,
ModelProxy,
} from '@mobilize/wms-framework';
import {
HorizontalAlignment,
IDragMoveEventArgs,
PositionSettings,
scaleInCenter,
scaleOutCenter,
VerticalAlignment,
} from 'igniteui-angular';
import { Utils } from '../../utils/index';
import { BaseComponent } from '../base/base.component';
/**
* Angular Component for the ChildWindow Control.
*
* @export
* @class ChildWindowComponent
* @extends {BaseComponent}
* @implements {OnInit}
* @implements {DoCheck}
* @implements {AfterViewInit}
*/
@Component({
selector: 'wm-child-window',
templateUrl: './child-window.component.html',
styleUrls: ['./child-window.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
@ComponentId([AngularComponentId.childWindow])
export class ChildWindowComponent
extends BaseComponent
implements OnInit, DoCheck, AfterViewInit, AfterContentInit
{
/**
* Gets/Sets the content model property for the control when the content is an input
*
* @memberof ChildWindowComponent
*/
@Input() set content(value: any) {
this.modelProxy.Content = value;
this.setStaticChild();
}
get content(): any {
return this.model.Content;
}
/**
* Sets this {@link ChildWindowComponent} as modal or not.
*
* @memberof ChildWindowComponent
*/
@Input()
set isModal(value: boolean) {
/* istanbul ignore else */
if (
!this.checkAndRegisterCompatibilityBinding(
ChildWindowModel.IsModalProperty,
value
) &&
typeof value === 'boolean'
) {
this.modelProxy.IsModal = value;
}
}
/**
* Indicates whether this {@link ChildWindowComponent} is modal or not.
*
* @readonly
* @type {*}
* @memberof ChildWindowComponent
*/
get isModal(): boolean {
return this.model.IsModal;
}
/**
* Reference to the static child if exist
*
* @type {*}
* @memberof ChildWindowComponent
*/
@ContentChild('contentChild') contentChild: any;
/**
* Gets a reference to the container div
*
* @type {TemplateRef<any>}
* @memberof ChildWindowComponent
*/
@ViewChild('mainContent') mainContent: any;
/**
* Sets the name model property for the control when the name is an input.
*
* @memberof ChildWindowComponent
*/
@Input() set name(value: string) {
this.modelProxy.Name = value;
}
/**
* ChildWindow model
*
* @type {ChildWindowModel}
* @memberof ChildWindowComponent
*/
@Input()
model: ChildWindowModel;
/**
* Class input for the element
* in order to apply the class to the
* correct element
*
* @type {string}
* @memberof ChildWindowComponent
*/
@Input()
class: string;
/**
* IgxDialog Reference
*
* @type {TemplateRef<any>}
* @memberof ChildWindowComponent
*/
@ViewChild('childWindow')
childWindow: TemplateRef<any>;
/**
* Flag use to prepare component to render
*
* @memberof ChildWindowComponent
*/
renderingFlag = false;
/**
* Flag used to open the dialog
*
* @memberof ChildWindowComponent
*/
openFlag = false;
/**
* Parent view reference
*
* @type {*}
* @memberof ChildWindowComponent
*/
parentRef: any;
/**
* Copy of the model
*
* @private
* @type {ChildWindowModel}
* @memberof ChildWindowComponent
*/
public modelProxy: ChildWindowModel = ModelProxy.create<ChildWindowModel>();
/**
* Flag to indicate if should render de ng-content or not
*
* @protected
* @type {boolean}
* @memberof ChildWindowComponent
*/
public renderStaticChild = false;
/**
* Property used to keep the current content that should be rendered in the control.
* Usually use in the internalContent to compare if the content property changes.
*
* @type {*}
* @memberof ChildWindowComponent
*/
cached: any;
/**
* Configuration for opening/closing animations
*
* @type {PositionSettings}
* @memberof ChildWindowComponent
*/
public readonly positionSettings: PositionSettings = {
openAnimation: useAnimation(scaleInCenter, {
params: { duration: '300ms', fromScale: 0 },
}),
closeAnimation: useAnimation(scaleOutCenter, {
params: { duration: '300ms', toScale: 0 },
}),
horizontalDirection: HorizontalAlignment.Center,
verticalDirection: VerticalAlignment.Middle,
horizontalStartPoint: HorizontalAlignment.Center,
verticalStartPoint: VerticalAlignment.Middle,
};
/**
* Internal variable to control if vertical scrollbar has been eliminated
*
* @private
* @type {boolean}
* @memberof ChildWindowComponent
*/
private _verticalScrollbarRemoved = false;
/**
* Creates an instance of ChildWindowComponent.
*
* @param {ChildWindowModel} injectedModel
* @param {ChangeDetectorRef} cd
* @memberof ChildWindowComponent
*/
public constructor(
@Optional() public injectedModel: ChildWindowModel,
private cd: ChangeDetectorRef,
public dialog: DialogService,
public injector: Injector,
public element: ElementRef
) {
super(cd, injector);
this.model = injectedModel;
}
/**
* Removes instance of child windowcomponent parent reference.
*
* @memberof ChildWindowComponent
*/
removeMe(): void {
this.dialog.remove(this.model.parentRef);
}
/**
* Angular lifecycle
* Initialize model
*
* @memberof ChildWindowComponent
*/
ngOnInit(): void {
this.model = this.model || this.injectedModel || new ChildWindowModel();
// ModelProxy.copy(this.modelProxy, this.model);
// this.setupModel(this.model);
this.registerObservers(this.loaded, this.model, this.model.Loaded);
/* istanbul ignore else */
if (
!this._verticalScrollbarRemoved &&
this.constructor.name === 'ChildWindowComponent' &&
this.element.nativeElement?.parentElement
) {
const renderer = this.injectorBase.get(Renderer2);
renderer.setStyle(
this.element.nativeElement.parentElement,
'position',
'fixed'
);
this._verticalScrollbarRemoved = true;
}
super.ngOnInit();
}
/**
* Angular lifecycle
*
* @memberof ChildWindowComponent
*/
ngAfterContentInit(): void {
this.setStaticChild();
this.detectChangesAction();
}
/**
* Angular lifecycle
* Sets render flag true
*
* @memberof ChildWindowComponent
*/
ngAfterViewInit(): void {
setTimeout(() => {
this.renderingFlag = true;
this.setupModel(this.model);
this.setStaticChild();
// Force inherited child windows to execute the load event
// when the child-window component is displayed.
this.model['isFirstTimeLoad'] = true;
// Validates if there is no explicit sizes and calculates the dialog size using the margin against the screen size
/* istanbul ignore else */
const renderer = this.injectorBase.get(Renderer2);
if (
this.mainContent?.nativeElement &&
isNaN(this.model.Width) &&
isNaN(this.model.Height)
) {
if (this.model.Margin) {
renderer.setStyle(
this.mainContent.nativeElement,
'width',
`calc(100vw - ${
this.model.Margin.Left + this.model.Margin.Right
}px)`
);
renderer.setStyle(
this.mainContent.nativeElement,
'height',
`calc(100vh - ${
this.model.Margin.Top + this.model.Margin.Bottom
}px)`
);
renderer.setStyle(this.mainContent.nativeElement, 'margin', `0px`);
} else {
renderer.addClass(
this.mainContent.nativeElement,
'childWindowManualSize'
);
}
}
super.ngAfterViewInit();
this.detectChangesAction();
}, 0);
}
/**
* Angular lifecycle
* Validates if control needs to be created
*
* @memberof ChildWindowComponent
*/
ngDoCheck(): void {
if (this.childWindow && this.openFlag) {
this.childWindow['open']();
this.openFlag = false;
}
}
/**
* Display childWindow title.
*
* @type {any}
* @memberof ChildWindowComponent
*/
get title(): any {
return this.model.Title;
}
/**
* Sets display title.
*
* @memberof ChildWindowComponent
*/
@Input()
set title(value: any) {
if (
!this.checkAndRegisterCompatibilityBinding(
ChildWindowModel.TitleProperty,
value
)
) {
this.modelProxy.Title = value;
}
}
/**
* Change handler
*
* @memberof ChildWindowComponent
*/
modelChangeHandler(name: string) {
super.modelChangeHandler(name);
/* istanbul ignore else */
if (name === 'Close') {
this.closeDialog();
}
}
/**
* Close childWindow form when click close button.
*
* @memberof ChildWindowComponent
*/
closeDialog(): void {
this.childWindow['close']?.();
}
/**
* Action triggered after dialog is opened.
*
* @memberof ChildWindowComponent
*/
onDialogOpenedHandler(): void {
/* istanbul ignore else */
if (
!this._verticalScrollbarRemoved &&
this.element.nativeElement?.parentElement
) {
const renderer = this.injectorBase.get(Renderer2);
renderer.setStyle(
this.element.nativeElement.parentElement,
'position',
'fixed'
);
this._verticalScrollbarRemoved = true;
}
// This will focus the first focusable control.
const focusable = document.querySelector(
'.childContent .focusable:not(wm-label) *:not(.notfocusable,.focusable,label)'
);
(
(focusable?.querySelector('input,textarea,.inputClass') ??
focusable) as HTMLElement
)?.focus();
ChildWindowService.EndOpening();
}
/**
* Action triggered when dialog is closed.
*
* @memberof ChildWindowComponent
*/
onDialogClosedHandler(): void {
this.model.OnClosed({});
this.removeMe();
}
/**
* Check if the window have a title
*
* @return {*} {boolean}
* @memberof ChildWindowComponent
*/
hasTitle(): boolean {
return this.title !== '' || this.title != null;
}
/**
* Gets or sets a value that indicates whether the ChildWindow has a close button
*
* @memberof ChildWindowComponent
*/
@Input()
set hasCloseButton(value: boolean) {
if (
!this.checkAndRegisterCompatibilityBinding(
ChildWindowModel.HasCloseButtonProperty,
value
)
) {
this.modelProxy.HasCloseButton = value;
}
}
/**
* Gets or sets a value that indicates whether the ChildWindow has a close button
*
* @readonly
* @type {boolean}
* @memberof ChildWindowComponent
*/
get hasCloseButton(): boolean {
return this.model.HasCloseButton;
}
/**
* Gets the content that should be rendered in the contentControl Component
*
* @readonly
* @type {*}
* @memberof ChildWindowComponent
*/
get innerContent(): any {
if (
this.model?.Content &&
this.model.Content !== this.cached?.lastContent
) {
const modelToInject = this.model.Content;
const customInjector = Utils.createInjectorForDynamicComponent(
modelToInject,
this.injector
);
this.cached = {
component: Utils.resolveComponentType(this.model.Content),
customInjector,
lastContent: this.model.Content,
};
return this.cached;
} else {
return this.cached;
}
}
/**
* Sets the flag for rendering the static child
*
* @private
* @memberof ChildWindowComponent
*/
private setStaticChild() {
this.renderStaticChild =
this.contentChild?.model === this.model?.Content || !this.model?.Content;
}
/**
* Drag move handler
*
* @type {void}
* @memberof ChildWindowComponent
*/
dragMoveEventHandler(event: IDragMoveEventArgs): void {
const deltaX = event.nextPageX - event.pageX;
const deltaY = event.nextPageY - event.pageY;
event.cancel = true;
this.childWindow['toggleRef'].setOffset(deltaX, deltaY);
}
}
<igx-dialog
#childWindow
*ngIf="renderingFlag"
[isModal]="isModal"
[closeOnOutsideSelect]="false"
[closeOnEscape]="false"
(opened)="onDialogOpenedHandler()"
(closed)="onDialogClosedHandler()"
[positionSettings]="positionSettings"
>
<div
class="mainChild"
#mainContent
[ngClass]="class"
[style.height]="height | dimensionsPipe: 'undefined'"
[style.width]="width | dimensionsPipe: 'undefined'"
(dragMove)="dragMoveEventHandler($event)"
igxDrag
[ghost]="false"
>
<div *ngIf="hasTitle() || hasCloseButton" class="titleBar">
<span *ngIf="hasTitle()" class="title" igxDragHandle>{{ title }}</span>
<svg
*ngIf="hasCloseButton"
class="buttonClose"
version="1.1"
width="13"
height="10"
viewBox="0 0 13 10.4"
xmlns="http://www.w3.org/2000/svg"
(click)="closeDialog()"
>
<defs>
<linearGradient id="xgradient" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#8E9092" />
<stop offset="100%" stop-color="#313131" />
</linearGradient>
<path
id="xshape"
d="M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z"
/>
</defs>
<g id="fuzz" visibility="hidden">
<!-- X_Fuzz2 -->
<use
href="#xshape"
fill="#C5190014"
stroke="#C5190014"
transform="scale(1.3)"
/>
<!-- X_Fuzz1 -->
<use
href="#xshape"
fill="#C519001E"
stroke="#C519001E"
transform="translate(6.5 5.2) scale(1.1) translate(-5 -4)"
/>
<!-- X_Fuzz0 -->
<use
href="#xshape"
fill="#C51900FF"
stroke="#C51900FF"
transform="translate(6.5 5.2) translate(-5 -4)"
/>
</g>
<!-- X -->
<use
id="x"
href="#xshape"
fill="#FFFFFF"
stroke="url(#xgradient)"
opacity="0.7"
transform="translate(6.5 5.2) translate(-5 -4)"
/>
</svg>
</div>
<div class="childContent" igxDragIgnore>
<ng-container *ngIf="renderStaticChild">
<ng-content></ng-content>
</ng-container>
<ng-container *ngIf="content && !renderStaticChild">
<ng-container
*ngComponentOutlet="
innerContent.component;
injector: innerContent.customInjector
"
></ng-container>
</ng-container>
</div>
</div>
</igx-dialog>
./child-window.component.scss
@import '../../scss/variables';
.mainChild {
min-width: $child-window-min-width;
.titleBar {
height: $child-window-title-size;
background-color: $child-window-background-color;
width: 100%;
display: flex;
align-items: center;
.title {
position: absolute;
width: 100%;
font-weight: bold;
overflow: hidden;
white-space: nowrap;
}
.buttonClose {
position: relative;
margin-left: auto;
margin-right: 9px;
&:hover #fuzz {
visibility: visible;
}
&:hover #x {
opacity: 0.95;
}
&:active #x {
opacity: 0.85;
}
}
}
.childContent {
height: calc(100% - $child-window-title-size) !important;
width: 100% !important;
display: flex;
}
}
::ng-deep .igx-dialog__window-content {
padding: unset !important;
}