File

src/ui/dialog/smart-dialog.component.ts

Description

A modal dialog component that supports remote templates and dynamic context

Implements

OnInit

Example

Metadata

selector smart-dialog
styleUrls ./smart-dialog.component.css
templateUrl ./smart-dialog.component.html
viewProviders SmartDialogInstanceService

Index

Properties
Methods
Inputs
HostListeners
Accessors

Constructor

constructor(factoryResolver: ComponentFactoryResolver, inj: Injector, dialogInstanceService: SmartDialogInstanceService)
Parameters :
Name Type Optional
factoryResolver ComponentFactoryResolver No
inj Injector No
dialogInstanceService SmartDialogInstanceService No

Inputs

buttons
Type : string

A comma delimited list of buttons that should be visible on the dialog.

component
Type : any
context
Type : any
height
Type : number
hideCloseButton
Type : boolean

If set to true, the Smart Dialog will hide the close (X) button.

injector
Type : Injector
opened
Type : boolean

Indicates whether the dialog is opened. Updating this property will also hide/show the dialog accordingly.

smart-dialog-dependencies
Type : any[]
Default value : []

(optional) Allows for injecting additional modules as imports in the resulting dialog component.

submit-on-enter
Type : string
templateRef
Type : TemplateRef<any>
textContent
Type : string
title
Type : string

The dialog title.

width
Type : number

HostListeners

keyup
Arguments : '$event'
keyup(event: KeyboardEvent)

Methods

closeDialog
closeDialog(button: DialogButtons)

Closes the dialog.

param button

Parameters :
Name Type Optional
button DialogButtons No
Returns : void
openDialog
openDialog()

Displays the dialog. The returned promise resolves when the dialog has been closed, returning a DialogButtons value indicating which button has been clicked.

Properties

closeButton
Type : DialogButtons
container
Type : SmartDialogContainer
Decorators :
@ViewChild(SmartDialogContainer)
containerStyle
Type : any
Default value : {}
dialog
Type : DialogComponent
Decorators :
@ViewChild(DialogComponent)
dialogButtons
Type : DialogButtons[]
Default value : []

The buttons displayed on the dialog, as objects.

dialogContext
Type : any
Default value : { templateUrl: null, template: null, opened: false, title: '', }
dummyTemplate
Type : TemplateRef<any>
Decorators :
@ViewChild('dummyTemplate', {read: TemplateRef, static: true})

Accessors

opened
setopened(value: boolean)

Indicates whether the dialog is opened. Updating this property will also hide/show the dialog accordingly.

Parameters :
Name Type Optional
value boolean No
Returns : void
title
settitle(value: string)

The dialog title.

Parameters :
Name Type Optional
value string No
Returns : void
width
getwidth()
Returns : number
setwidth(value: number)
Parameters :
Name Type Optional
value number No
Returns : void
height
getheight()
Returns : number
setheight(value: number)
Parameters :
Name Type Optional
value number No
Returns : void
buttons
getbuttons()
Returns : string
setbuttons(value: string)

A comma delimited list of buttons that should be visible on the dialog.

Parameters :
Name Type Optional
value string No
Returns : void
<kendo-dialog 
    [ngClass]="{ 'no-close-btn': !!hideCloseButton }" 
    [width]="width" 
    [height]="height" 
    style="z-index: 9999;" 
    [title]="dialogContext.title" 
    *ngIf="dialogContext.opened === true && (dialogContext.template || templateRef || component || textContent)" 
    (close)="closeDialog(closeButton)">
        <p *ngIf="!!textContent && !templateRef">{{textContent}}</p>
        <div smartDialogContainer></div>
        <kendo-dialog-actions *ngIf="dialogContext.opened">
            <button kendoButton *ngFor="let btn of dialogButtons" primary="true" (click)="closeDialog(btn)">{{btn.toString()}}</button>
        </kendo-dialog-actions>
</kendo-dialog>
<ng-template #dummyTemplate></ng-template>

./smart-dialog.component.css

/*
::ng-deep ::-webkit-scrollbar {
    width: 2px;
    height: 2px;
}

 ::ng-deep ::-webkit-scrollbar-button {
    width: 0px;
    height: 0px;
}


 ::ng-deep ::-webkit-scrollbar-thumb {
    background: #fb5942;
    border: 0px none #ffffff;
    border-radius: 50px;
}

 ::ng-deep ::-webkit-scrollbar-track {
    background: #ffffff;
    border: 0px none #ffffff;
    border-radius: 50px;
}

 ::ng-deep ::-webkit-scrollbar-corner {
    background: transparent;
}
*/
 ::ng-deep .padded {
    padding-right: 20px !important;
}

/*
::ng-deep kendo-dialog-actions,
 ::ng-deep .k-action-buttons {
    position: absolute!important;
    bottom: 0!important;
    width: 100%!important
}*/

 ::ng-deep .k-dialog-title {
    overflow: visible !important;
}

 ::ng-deep .k-dialog.k-dialog-centered {
    position: absolute !important;
}

 ::ng-deep .no-close-btn .k-window.k-dialog .k-dialog-titlebar.k-header .k-dialog-actions.k-window-actions a.k-button.k-bare.k-button-icon.k-window-action.k-dialog-action.k-dialog-close {
    display: none !important;
}

/*
::ng-deep .k-content {
    height: 80% !important;
}
*/
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""