1
|
import {Component, EventEmitter, Input, OnInit, Output,} from '@angular/core';
|
2
|
|
3
|
|
4
|
@Component({
|
5
|
selector: 'border',
|
6
|
template: `
|
7
|
<div class="uk-grid uk-child-width-1-2">
|
8
|
<div class="uk-margin-remove">
|
9
|
<div class="uk-text-bold uk-form-label uk-margin-small-bottom"> Border radius (px)</div>
|
10
|
<!-- <div class="uk-margin-bottom uk-form-hint ">hint</div>-->
|
11
|
<div class="input-box">
|
12
|
<input class="uk-input" [(ngModel)]="radius" (input)="borderChanged()" type="number" min="0"/>
|
13
|
</div>
|
14
|
</div>
|
15
|
<div class="uk-margin-remove">
|
16
|
<div class="uk-text-bold uk-form-label uk-margin-small-bottom"> Border width (px)</div>
|
17
|
<!-- <div class="uk-margin-bottom uk-form-hint "> hint</div>-->
|
18
|
<div class="input-box">
|
19
|
<input class="uk-input" [(ngModel)]="width" (input)="borderChanged()" type="number" min="0"/>
|
20
|
</div>
|
21
|
</div>
|
22
|
<div class="uk-margin-small-top">
|
23
|
<div class="uk-text-bold uk-form-label uk-margin-small-bottom"> Border style</div>
|
24
|
<!-- <div class="uk-margin-bottom uk-form-hint "> hint</div>-->
|
25
|
<div class="input-box ">
|
26
|
<mat-form-field class="uk-width-1-1">
|
27
|
<mat-select class="" [(ngModel)]="style" name="{{'select_type_'}}"
|
28
|
(ngModelChange)="borderChanged()"
|
29
|
[disableOptionCentering]="true"
|
30
|
panelClass="">
|
31
|
<mat-option [value]="'solid'">solid</mat-option>
|
32
|
<mat-option [value]="'dotted'">dotted</mat-option>
|
33
|
<mat-option [value]="'dashed'">dashed</mat-option>
|
34
|
|
35
|
</mat-select>
|
36
|
</mat-form-field>
|
37
|
</div>
|
38
|
</div>
|
39
|
</div>
|
40
|
`
|
41
|
})
|
42
|
|
43
|
export class BorderComponent implements OnInit {
|
44
|
@Input() radius: number = 0;
|
45
|
@Input() width: number = 0;
|
46
|
@Input() style = 'solid';
|
47
|
// @Input() addMargin: boolean = false;
|
48
|
@Output() borderChange = new EventEmitter();
|
49
|
|
50
|
|
51
|
constructor() {
|
52
|
}
|
53
|
|
54
|
|
55
|
ngOnInit() {
|
56
|
}
|
57
|
|
58
|
borderChanged() {
|
59
|
console.log(this.radius);
|
60
|
this.borderChange.emit({radius: this.radius, width: this.width, style: this.style});
|
61
|
}
|
62
|
|
63
|
|
64
|
}
|