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C;IAEH,mBAAC;AAAD,CA3BA,AA2BC,IAAA;AAMD;IAAA;IAA4B,CAAC;IAJ7B;QAAC,QAAQ,CAAC;YACR,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,YAAY,EAAE,CAAC,MAAM,CAAC;SACvB,CAAC;;oBAAA;IAC0B,mBAAC;AAAD,CAA5B,AAA6B,IAAA","file":"core/line/line.js","sourcesContent":["import {\n NgModule,\n Directive,\n Renderer,\n ElementRef,\n QueryList\n} from '@angular/core';\n\n/**\n * Shared directive to count lines inside a text area, such as a list item.\n * Line elements can be extracted with a @ContentChildren(MdLine) query, then\n * counted by checking the query list's length.\n */\n@Directive({ selector: '[md-line]' })\nexport class MdLine {}\n\n/* Helper that takes a query list of lines and sets the correct class on the host */\nexport class MdLineSetter {\n constructor(private _lines: QueryList<MdLine>, private _renderer: Renderer,\n private _element: ElementRef) {\n this._setLineClass(this._lines.length);\n\n this._lines.changes.subscribe(() => {\n this._setLineClass(this._lines.length);\n });\n }\n\n\n private _setLineClass(count: number): void {\n this._resetClasses();\n if (count === 2 || count === 3) {\n this._setClass(`md-${count}-line`, true);\n }\n }\n\n private _resetClasses(): void {\n this._setClass('md-2-line', false);\n this._setClass('md-3-line', false);\n }\n\n private _setClass(className: string, bool: boolean): void {\n this._renderer.setElementClass(this._element.nativeElement, className, bool);\n }\n\n}\n\n@NgModule({\n exports: [MdLine],\n declarations: [MdLine],\n})\nexport class MdLineModule { }\n"],"sourceRoot":"/source/"} |