1 import {Component, Input, ViewChild, OnInit, TemplateRef} from '@angular/core';
2 import {DialogComponent} from '@eg/share/dialog/dialog.component';
5 selector: 'eg-prompt-dialog',
6 templateUrl: './prompt.component.html'
10 * Promptation dialog that requests user input.
12 export class PromptDialogComponent extends DialogComponent implements OnInit {
15 @Input() inputDomId = 'eg-prompt-dialog-' + PromptDialogComponent.domId++;
17 // What question are we asking?
18 @Input() public dialogBody: string;
19 // Value to return to the caller
20 @Input() public promptValue: string;
22 @Input() promptType = 'text';
24 // May be used when promptType == 'number'
25 @Input() promptMin: number = null;
26 @Input() promptMax: number = null;
29 this.onOpen$.subscribe(_ => {
30 const node = document.getElementById(this.inputDomId) as HTMLInputElement;
31 if (node) { node.focus(); node.select(); }