1 | var __extends = (this && this.__extends) || function (d, b) {
|
2 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
3 | function __() { this.constructor = d; }
|
4 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
5 | };
|
6 | import { Component, ElementRef, Renderer, forwardRef, NgModule, ViewEncapsulation } from '@angular/core';
|
7 | import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
8 | import { MdlCheckboxComponent } from '../checkbox/mdl-checkbox.component';
|
9 | import { CommonModule } from '@angular/common';
|
10 | export var MdlSwitchComponent = (function (_super) {
|
11 | __extends(MdlSwitchComponent, _super);
|
12 | function MdlSwitchComponent(elementRef, renderer) {
|
13 | _super.call(this, elementRef, renderer);
|
14 | }
|
15 | MdlSwitchComponent.decorators = [
|
16 | { type: Component, args: [{
|
17 | selector: 'mdl-switch',
|
18 | providers: [{
|
19 | provide: NG_VALUE_ACCESSOR,
|
20 | useExisting: forwardRef(function () { return MdlSwitchComponent; }),
|
21 | multi: true
|
22 | }],
|
23 | host: {
|
24 | '(click)': 'onClick()',
|
25 | '[class.mdl-switch]': 'true',
|
26 | '[class.is-upgraded]': 'true',
|
27 | '[class.is-checked]': 'value',
|
28 | '[class.is-disabled]': 'disabled'
|
29 | },
|
30 | outputs: ['change'],
|
31 | template: "\n <input type=\"checkbox\" class=\"mdl-switch__input\" \n (focus)=\"onFocus()\" \n (blur)=\"onBlur()\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"value\">\n <span class=\"mdl-switch__label\"><ng-content></ng-content></span>\n <div class=\"mdl-switch__track\"></div>\n <div class=\"mdl-switch__thumb\"><span class=\"mdl-switch__focus-helper\"></span></div>\n ",
|
32 | encapsulation: ViewEncapsulation.None
|
33 | },] },
|
34 | ];
|
35 |
|
36 | MdlSwitchComponent.ctorParameters = function () { return [
|
37 | { type: ElementRef, },
|
38 | { type: Renderer, },
|
39 | ]; };
|
40 | return MdlSwitchComponent;
|
41 | }(MdlCheckboxComponent));
|
42 | var MDL_SWITCH_DIRECTIVES = [MdlSwitchComponent];
|
43 | export var MdlSwitchModule = (function () {
|
44 | function MdlSwitchModule() {
|
45 | }
|
46 | MdlSwitchModule.forRoot = function () {
|
47 | return {
|
48 | ngModule: MdlSwitchModule,
|
49 | providers: []
|
50 | };
|
51 | };
|
52 | MdlSwitchModule.decorators = [
|
53 | { type: NgModule, args: [{
|
54 | imports: [CommonModule, FormsModule],
|
55 | exports: MDL_SWITCH_DIRECTIVES,
|
56 | declarations: MDL_SWITCH_DIRECTIVES,
|
57 | },] },
|
58 | ];
|
59 |
|
60 | MdlSwitchModule.ctorParameters = function () { return []; };
|
61 | return MdlSwitchModule;
|
62 | }());
|
63 |
|
\ | No newline at end of file |