UNPKG

2.93 kBJavaScriptView Raw
1var __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};
6import { Component, ElementRef, Renderer, forwardRef, NgModule, ViewEncapsulation } from '@angular/core';
7import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
8import { MdlCheckboxComponent } from '../checkbox/mdl-checkbox.component';
9import { CommonModule } from '@angular/common';
10export 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 /** @nocollapse */
36 MdlSwitchComponent.ctorParameters = function () { return [
37 { type: ElementRef, },
38 { type: Renderer, },
39 ]; };
40 return MdlSwitchComponent;
41}(MdlCheckboxComponent));
42var MDL_SWITCH_DIRECTIVES = [MdlSwitchComponent];
43export 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 /** @nocollapse */
60 MdlSwitchModule.ctorParameters = function () { return []; };
61 return MdlSwitchModule;
62}());
63//# sourceMappingURL=mdl-switch.component.js.map
\No newline at end of file