mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-22 20:40:08 +00:00
28 lines
793 B
TypeScript
28 lines
793 B
TypeScript
import { Component, Input, Output, EventEmitter, ViewChild } from '@angular/core'
|
|
import { NgbPopover } from '@ng-bootstrap/ng-bootstrap'
|
|
|
|
/** @hidden */
|
|
@Component({
|
|
selector: 'color-picker',
|
|
template: require('./colorPicker.component.pug'),
|
|
styles: [require('./colorPicker.component.scss')],
|
|
})
|
|
export class ColorPickerComponent {
|
|
@Input() model: string
|
|
@Input() title: string
|
|
@Input() hint: string
|
|
@Output() modelChange = new EventEmitter<string>()
|
|
@ViewChild('popover') popover: NgbPopover
|
|
|
|
open (): void {
|
|
setImmediate(() => {
|
|
this.popover.open()
|
|
this.popover['_windowRef'].location.nativeElement.querySelector('input').focus()
|
|
})
|
|
}
|
|
|
|
onChange (): void {
|
|
this.modelChange.emit(this.model)
|
|
}
|
|
}
|