1 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
4 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6 | };
|
7 | var __metadata = (this && this.__metadata) || function (k, v) {
|
8 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
9 | };
|
10 | import { NgModule, Directive } from '@angular/core';
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | export var MdLine = (function () {
|
17 | function MdLine() {
|
18 | }
|
19 | MdLine = __decorate([
|
20 | Directive({ selector: '[md-line]' }),
|
21 | __metadata('design:paramtypes', [])
|
22 | ], MdLine);
|
23 | return MdLine;
|
24 | }());
|
25 |
|
26 | export var MdLineSetter = (function () {
|
27 | function MdLineSetter(_lines, _renderer, _element) {
|
28 | var _this = this;
|
29 | this._lines = _lines;
|
30 | this._renderer = _renderer;
|
31 | this._element = _element;
|
32 | this._setLineClass(this._lines.length);
|
33 | this._lines.changes.subscribe(function () {
|
34 | _this._setLineClass(_this._lines.length);
|
35 | });
|
36 | }
|
37 | MdLineSetter.prototype._setLineClass = function (count) {
|
38 | this._resetClasses();
|
39 | if (count === 2 || count === 3) {
|
40 | this._setClass("md-" + count + "-line", true);
|
41 | }
|
42 | };
|
43 | MdLineSetter.prototype._resetClasses = function () {
|
44 | this._setClass('md-2-line', false);
|
45 | this._setClass('md-3-line', false);
|
46 | };
|
47 | MdLineSetter.prototype._setClass = function (className, bool) {
|
48 | this._renderer.setElementClass(this._element.nativeElement, className, bool);
|
49 | };
|
50 | return MdLineSetter;
|
51 | }());
|
52 | export var MdLineModule = (function () {
|
53 | function MdLineModule() {
|
54 | }
|
55 | MdLineModule = __decorate([
|
56 | NgModule({
|
57 | exports: [MdLine],
|
58 | declarations: [MdLine],
|
59 | }),
|
60 | __metadata('design:paramtypes', [])
|
61 | ], MdLineModule);
|
62 | return MdLineModule;
|
63 | }());
|
64 |
|
65 |
|