rsanchez
2017-03-19 280daa7f3f858ecfef9c91ffd5dea1007f021048
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import {Component, Input} from '@angular/core';
import {LocaleService} from './i18n';
@Component({
  selector: 'field-readonly',
  template: `
  <div layout="column" class="mat-input-container readonly" >
       <div class="mat-input-wrapper">
           <div class="mat-input-table">
               <div class="mat-input-prefix"></div>
               <div class="mat-input-infix">
                   <div class="label-value mat-input-element">{{value}}</div>
                   <span class="mat-input-placeholder-wrapper" >
                       <label class="mat-input-placeholder mat-float">
                           <span class="placeholder">{{label}}</span>
                       </label>
                   </span>
               </div>
               <div class="mat-input-suffix"></div>
           </div>
           <div class="mat-input-underline"></div>
       </div>
   </div>`,
   styles: [`.readonly .mat-input-element {
               margin-top: 0px !important;
               color: rgba(0, 0, 0, 0.50);
           }`,
           `.readonly .mat-input-element {
               margin-top: 0px;
               color: rgba(0, 0, 0, 0.50);
           }`,
           `.readonly.mat-input-container {
               width: 100%;
           }`]
})
export class FieldReadonlyComponent {
   @Input('value') value: any;
   private _label : string;
    @Input('label')
   set label(txt: string) {
       this._label = this.$L.get(txt);
   }
   get label(): string { return this._label; }
   constructor(private $L : LocaleService) {
   }
}