UNPKG

angular2-mdl

Version:

Angular 2 components, directives and styles based on material design lite https://getmdl.io.

970 lines (922 loc) 383 kB
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("@angular/common"), require("@angular/core"), require("@angular/forms"), require("@angular/platform-browser"), require("rxjs/Subject")); else if(typeof define === 'function' && define.amd) define(["@angular/common", "@angular/core", "@angular/forms", "@angular/platform-browser", "rxjs/Subject"], factory); else if(typeof exports === 'object') exports["angular2Mdl"] = factory(require("@angular/common"), require("@angular/core"), require("@angular/forms"), require("@angular/platform-browser"), require("rxjs/Subject")); else root["angular2Mdl"] = factory(root["ng"]["common"], root["ng"]["core"], root["ng"]["forms"], root["ng"]["platformBrowser"], root["rx"]["Subject"]); })(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_3__, __WEBPACK_EXTERNAL_MODULE_63__, __WEBPACK_EXTERNAL_MODULE_14__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // identity function for calling harmory imports with the correct context /******/ __webpack_require__.i = function(value) { return value; }; /******/ /******/ // define getter function for harmory exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 67); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_0__; /***/ }, /* 1 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_1__; /***/ }, /* 2 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return booleanProperty; }); function booleanProperty() { return function booleanFieldValueMetadata(target, key) { var defaultValue = target[key]; var localKey = "__mdl_private_symbol_" + key; target[localKey] = defaultValue; Object.defineProperty(target, key, { get: function () { return this[localKey]; }, set: function (value) { this[localKey] = value != null && "" + value !== 'false'; } }); }; } /***/ }, /* 3 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_3__; /***/ }, /* 4 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__angular_core__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_mdl_error__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__common_boolean_property__ = __webpack_require__(2); /* harmony export (binding) */ __webpack_require__.d(exports, "c", function() { return MdlUnsupportedButtonTypeError; }); /* harmony export (binding) */ __webpack_require__.d(exports, "d", function() { return MdlUnsupportedColoredTypeError; }); /* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return MdlButtonComponent; }); /* harmony export (binding) */ __webpack_require__.d(exports, "b", function() { return MdlButtonModule; }); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 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; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var MdlUnsupportedButtonTypeError = (function (_super) { __extends(MdlUnsupportedButtonTypeError, _super); function MdlUnsupportedButtonTypeError(type) { _super.call(this, "Button type \"" + type + "\" isn't supported (allowed: raised, fab, mini-fab, icon, '')."); } return MdlUnsupportedButtonTypeError; }(__WEBPACK_IMPORTED_MODULE_1__common_mdl_error__["a" /* MdlError */])); var MdlUnsupportedColoredTypeError = (function (_super) { __extends(MdlUnsupportedColoredTypeError, _super); function MdlUnsupportedColoredTypeError(type) { _super.call(this, "Colored type \"" + type + "\" isn't supported (allowed: primary, accent, '')."); } return MdlUnsupportedColoredTypeError; }(__WEBPACK_IMPORTED_MODULE_1__common_mdl_error__["a" /* MdlError */])); var MDL_BUTTON_TYPES = [ 'raised', 'fab', 'mini-fab', 'icon', '' ]; var MDL_COLORED_TYPES = [ 'primary', 'accent', '' ]; var MdlButtonComponent = (function () { function MdlButtonComponent(elementRef, renderer) { this.elementRef = elementRef; this.renderer = renderer; this.disabled = false; this.element = elementRef.nativeElement; } MdlButtonComponent.prototype.ngOnChanges = function () { if (this.mdlButtonType && MDL_BUTTON_TYPES.indexOf(this.mdlButtonType) === -1) { throw new MdlUnsupportedButtonTypeError(this.mdlButtonType); } if (this.mdlColoredType && MDL_COLORED_TYPES.indexOf(this.mdlColoredType) === -1) { throw new MdlUnsupportedColoredTypeError(this.mdlColoredType); } }; MdlButtonComponent.prototype.onMouseUp = function () { this.blurIt(); }; MdlButtonComponent.prototype.onMouseLeave = function () { this.blurIt(); }; MdlButtonComponent.prototype.blurIt = function () { this.renderer.invokeElementMethod(this.element, 'blur', []); }; __decorate([ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])('mdl-button-type'), __metadata('design:type', Object) ], MdlButtonComponent.prototype, "mdlButtonType", void 0); __decorate([ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])('mdl-colored'), __metadata('design:type', Object) ], MdlButtonComponent.prototype, "mdlColoredType", void 0); __decorate([ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__common_boolean_property__["a" /* BooleanProperty */])(), __metadata('design:type', Object) ], MdlButtonComponent.prototype, "disabled", void 0); MdlButtonComponent = __decorate([ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({ selector: 'mdl-button, button[mdl-button], a[mdl-button]', host: { '[attr.disabled]': 'disabled ? "disabled" : null', '(mouseup)': 'onMouseUp()', '(mouseleave)': 'onMouseLeave()', '[class.mdl-button]': 'true', '[class.mdl-button--raised]': 'mdlButtonType == "raised"', '[class.mdl-button--fab]': 'mdlButtonType == "fab" || mdlButtonType == "mini-fab"', '[class.mdl-button--mini-fab]': 'mdlButtonType == "mini-fab"', '[class.mdl-button--icon]': 'mdlButtonType == "icon"', '[class.mdl-button--primary]': 'mdlColoredType == "primary"', '[class.mdl-button--accent]': 'mdlColoredType == "accent"' }, exportAs: 'mdlButton', template: '<ng-content></ng-content>', encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewEncapsulation"].None }), __metadata('design:paramtypes', [(typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"]) === 'function' && _a) || Object, (typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer"] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer"]) === 'function' && _b) || Object]) ], MdlButtonComponent); return MdlButtonComponent; var _a, _b; }()); var MDL_BUTTON_DIRECTIVES = [MdlButtonComponent]; var MdlButtonModule = (function () { function MdlButtonModule() { } MdlButtonModule.forRoot = function () { return { ngModule: MdlButtonModule, providers: [] }; }; MdlButtonModule = __decorate([ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"])({ imports: [], exports: MDL_BUTTON_DIRECTIVES, declarations: MDL_BUTTON_DIRECTIVES, }), __metadata('design:paramtypes', []) ], MdlButtonModule); return MdlButtonModule; }()); /***/ }, /* 5 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__angular_core__); /* harmony export (binding) */ __webpack_require__.d(exports, "b", function() { return MdlIconComponent; }); /* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return MdlIconModule; }); var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 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; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var MdlIconComponent = (function () { function MdlIconComponent() { } MdlIconComponent = __decorate([ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({ selector: 'mdl-icon', host: { '[class.material-icons]': 'true' }, template: '<ng-content></ng-content>', encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewEncapsulation"].None }), __metadata('design:paramtypes', []) ], MdlIconComponent); return MdlIconComponent; }()); var MDL_ICON_DIRECTIVES = [MdlIconComponent]; var MdlIconModule = (function () { function MdlIconModule() { } MdlIconModule.forRoot = function () { return { ngModule: MdlIconModule, providers: [] }; }; MdlIconModule = __decorate([ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"])({ imports: [], exports: MDL_ICON_DIRECTIVES, declarations: MDL_ICON_DIRECTIVES, }), __metadata('design:paramtypes', []) ], MdlIconModule); return MdlIconModule; }()); /***/ }, /* 6 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return MdlError; }); /* harmony export (binding) */ __webpack_require__.d(exports, "b", function() { return MdlStructureError; }); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; /** * Wrapper for mdl error messages. */ var MdlError = (function (_super) { __extends(MdlError, _super); function MdlError(value) { _super.call(this); _super.prototype.message = value; } return MdlError; }(Error)); var MdlStructureError = (function (_super) { __extends(MdlStructureError, _super); function MdlStructureError(child, requiredParent) { _super.call(this, "\"" + child + "\" requires \"" + requiredParent + "\" as a parent."); } return MdlStructureError; }(MdlError)); /***/ }, /* 7 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return numberProperty; }); function numberProperty() { return function numberFieldValueMetadata(target, key) { var defaultValue = target[key]; var localKey = "__mdl_private_symbol_" + key; target[localKey] = defaultValue; Object.defineProperty(target, key, { get: function () { return this[localKey]; }, set: function (value) { if (typeof value === 'undefined') { value = null; } else if (typeof value === 'string') { value = parseInt(value); } this[localKey] = value; } }); }; } /***/ }, /* 8 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__angular_core__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_platform_browser__ = __webpack_require__(63); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_platform_browser___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__angular_platform_browser__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Subject__ = __webpack_require__(14); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_Subject__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__mdl_simple_dialog_component__ = __webpack_require__(20); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__mdl_dialog_host_component__ = __webpack_require__(19); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__internal_dialog_reference__ = __webpack_require__(52); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__dialog_outlet_mdl_dialog_outlet_service__ = __webpack_require__(13); /* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return MDL_CONFIGUARTION; }); /* harmony export (binding) */ __webpack_require__.d(exports, "c", function() { return MIN_DIALOG_Z_INDEX; }); /* harmony export (binding) */ __webpack_require__.d(exports, "b", function() { return MdlDialogReference; }); /* harmony export (binding) */ __webpack_require__.d(exports, "d", function() { return MdlDialogService; }); var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 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; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; var MDL_CONFIGUARTION = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["OpaqueToken"]('MDL_CONFIGUARTION'); var MIN_DIALOG_Z_INDEX = 100000; /** * The reference to the created and displayed dialog. */ var MdlDialogReference = (function () { function MdlDialogReference(internaleRef) { this.internaleRef = internaleRef; internaleRef.dialogRef = this; } /** * closes the dialog */ MdlDialogReference.prototype.hide = function (data) { this.internaleRef.hide(data); }; /** * Observable that emits, if the dialog was closed. * @returns {Observable<void>} */ MdlDialogReference.prototype.onHide = function () { return this.internaleRef.onHide(); }; /** * Observable that emits, if the dialog is really visible and not only created. * @returns {Observable<void>} */ MdlDialogReference.prototype.onVisible = function () { return this.internaleRef.onVisible(); }; return MdlDialogReference; }()); /** * The MdlDialogService is used to open different kind of dialogs. SimpleDialogs and Custom Dialogs. * @experimental */ var MdlDialogService = (function () { function MdlDialogService(componentFactoryResolver, doc, appRef, mdlDialogOutletService) { var _this = this; this.componentFactoryResolver = componentFactoryResolver; this.doc = doc; this.appRef = appRef; this.mdlDialogOutletService = mdlDialogOutletService; this.openDialogs = new Array(); this.mdlDialogOutletService.backdropClickEmitter.subscribe(function () { _this.onBackdropClick(); }); } /** * Shows a dialog that is just an alert - e.g. with one button. * @param alertMessage The message that should be displayed. * @param okTex The text that the button should have * @param title The optional title of the dialog * @returns An Observable that is called if the user hits the Ok button. */ MdlDialogService.prototype.alert = function (alertMessage, okText, title) { if (okText === void 0) { okText = 'Ok'; } var result = new __WEBPACK_IMPORTED_MODULE_2_rxjs_Subject__["Subject"](); this.showDialog({ title: title, message: alertMessage, actions: [ { handler: function () { result.next(null); result.complete(); }, text: okText } ], isModal: true }); return result; }; /** * Shows a dialog that is just a confirm message - e.g. with two button. * @param question The question that should be displayed. * @param title The title that should be displayed on top of Question. * @param declineText The text for decline button. defaults to Cancel * @param confirmText The text for the confirm button . defaults to Ok * @returns An Observable that is called if the user hits the Ok button. */ MdlDialogService.prototype.confirm = function (question, declineText, confirmText, title) { if (declineText === void 0) { declineText = 'Cancel'; } if (confirmText === void 0) { confirmText = 'Ok'; } var result = new __WEBPACK_IMPORTED_MODULE_2_rxjs_Subject__["Subject"](); this.showDialog({ title: title, message: question, actions: [ { handler: function () { result.next(null); result.complete(); }, text: confirmText }, { handler: function () { result.error(null); }, text: declineText, isClosingAction: true } ], isModal: true }); return result.asObservable(); }; /** * Shows a dialog that is specified by the provided configuration. * @param config The simple dialog configuration. * @returns An Observable that returns the MdlDialogReference. */ MdlDialogService.prototype.showDialog = function (config) { if (config.actions.length === 0) { throw new Error('a dialog mus have at least one action'); } var internalDialogRef = new __WEBPACK_IMPORTED_MODULE_5__internal_dialog_reference__["a" /* InternalMdlDialogReference */](config); var providers = [ { provide: MdlDialogReference, useValue: new MdlDialogReference(internalDialogRef) }, { provide: MDL_CONFIGUARTION, useValue: config } ]; var hostComponentRef = this.createHostDialog(internalDialogRef, config); var cRef = this.createComponentInstance(hostComponentRef.instance.dialogTarget, providers, __WEBPACK_IMPORTED_MODULE_3__mdl_simple_dialog_component__["a" /* MdlSimpleDialogComponent */]); return this.showHostDialog(internalDialogRef.dialogRef, hostComponentRef); }; /** * Shows a dialog that is specified by the provided configuration. * @param config The custom dialog configuration. * @returns An Observable that returns the MdlDialogReference. */ MdlDialogService.prototype.showCustomDialog = function (config) { var internalDialogRef = new __WEBPACK_IMPORTED_MODULE_5__internal_dialog_reference__["a" /* InternalMdlDialogReference */](config); var providers = [ { provide: MdlDialogReference, useValue: new MdlDialogReference(internalDialogRef) } ]; if (config.providers) { providers.push.apply(providers, config.providers); } var hostComponentRef = this.createHostDialog(internalDialogRef, config); this.createComponentInstance(hostComponentRef.instance.dialogTarget, providers, config.component); return this.showHostDialog(internalDialogRef.dialogRef, hostComponentRef); }; MdlDialogService.prototype.showDialogTemplate = function (template, config) { var internalDialogRef = new __WEBPACK_IMPORTED_MODULE_5__internal_dialog_reference__["a" /* InternalMdlDialogReference */](config); var hostComponentRef = this.createHostDialog(internalDialogRef, config); hostComponentRef.instance.dialogTarget.createEmbeddedView(template); return this.showHostDialog(internalDialogRef.dialogRef, hostComponentRef); }; MdlDialogService.prototype.showHostDialog = function (dialogRef, hostComponentRef) { var result = new __WEBPACK_IMPORTED_MODULE_2_rxjs_Subject__["Subject"](); setTimeout(function () { result.next(dialogRef); result.complete(); hostComponentRef.instance.show(); }); return result.asObservable(); }; MdlDialogService.prototype.createHostDialog = function (internalDialogRef, dialogConfig) { var _this = this; var viewContainerRef = this.mdlDialogOutletService.viewContainerRef; if (!viewContainerRef) { throw new Error('You did not provide a ViewContainerRef. ' + 'Please see https://github.com/mseemann/angular2-mdl/wiki/How-to-use-the-MdlDialogService'); } var providers = [ { provide: MDL_CONFIGUARTION, useValue: dialogConfig }, { provide: __WEBPACK_IMPORTED_MODULE_5__internal_dialog_reference__["a" /* InternalMdlDialogReference */], useValue: internalDialogRef } ]; var hostDialogComponent = this.createComponentInstance(viewContainerRef, providers, __WEBPACK_IMPORTED_MODULE_4__mdl_dialog_host_component__["a" /* MdlDialogHostComponent */]); internalDialogRef.hostDialogComponentRef = hostDialogComponent; internalDialogRef.isModal = dialogConfig.isModal; internalDialogRef.closeCallback = function () { _this.popDialog(internalDialogRef); hostDialogComponent.instance.hide(hostDialogComponent); }; this.pushDialog(internalDialogRef); return hostDialogComponent; }; MdlDialogService.prototype.pushDialog = function (dialogRef) { this.openDialogs.push(dialogRef); this.orderDialogStack(); }; MdlDialogService.prototype.popDialog = function (dialogRef) { this.openDialogs.splice(this.openDialogs.indexOf(dialogRef), 1); this.orderDialogStack(); }; MdlDialogService.prototype.orderDialogStack = function () { // +1 because the overlay may have MIN_DIALOG_Z_INDEX if the dialog is modal. var zIndex = MIN_DIALOG_Z_INDEX + 1; this.openDialogs.forEach(function (iDialogRef) { iDialogRef.hostDialog.zIndex = zIndex; // +2 to make room for the overlay if a dialog is modal zIndex += 2; }); this.mdlDialogOutletService.hideBackdrop(); // if there is a modal dialog append the overloay to the dom - if not remove the overlay from the body var topMostModalDialog = this.getTopMostInternalDialogRef(); if (topMostModalDialog) { // move the overlay diredct under the topmos modal dialog this.mdlDialogOutletService.showBackdropWithZIndex(topMostModalDialog.hostDialog.zIndex - 1); } }; MdlDialogService.prototype.getTopMostInternalDialogRef = function () { var topMostModalDialog = null; for (var i = (this.openDialogs.length - 1); i >= 0; i--) { if (this.openDialogs[i].isModal) { topMostModalDialog = this.openDialogs[i]; break; } } return topMostModalDialog; }; MdlDialogService.prototype.onBackdropClick = function () { var topMostModalDialog = this.getTopMostInternalDialogRef(); if (topMostModalDialog.config.clickOutsideToClose) { topMostModalDialog.hide(); } }; MdlDialogService.prototype.createComponentInstance = function (viewContainerRef, providers, component) { var cFactory = this.componentFactoryResolver.resolveComponentFactory(component); var resolvedProviders = __WEBPACK_IMPORTED_MODULE_0__angular_core__["ReflectiveInjector"].resolve(providers); var parentInjector = viewContainerRef.parentInjector; var childInjector = __WEBPACK_IMPORTED_MODULE_0__angular_core__["ReflectiveInjector"].fromResolvedProviders(resolvedProviders, parentInjector); return viewContainerRef.createComponent(cFactory, viewContainerRef.length, childInjector); }; MdlDialogService = __decorate([ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"])(), __param(1, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"])(__WEBPACK_IMPORTED_MODULE_1__angular_platform_browser__["DOCUMENT"])), __metadata('design:paramtypes', [(typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["ComponentFactoryResolver"] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_0__angular_core__["ComponentFactoryResolver"]) === 'function' && _a) || Object, Object, (typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["ApplicationRef"] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_0__angular_core__["ApplicationRef"]) === 'function' && _b) || Object, (typeof (_c = typeof __WEBPACK_IMPORTED_MODULE_6__dialog_outlet_mdl_dialog_outlet_service__["a" /* MdlDialogOutletService */] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_6__dialog_outlet_mdl_dialog_outlet_service__["a" /* MdlDialogOutletService */]) === 'function' && _c) || Object]) ], MdlDialogService); return MdlDialogService; var _a, _b, _c; }()); /***/ }, /* 9 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__angular_core__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__angular_forms__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_common__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_common___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__angular_common__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__common_boolean_property__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__common_number_property__ = __webpack_require__(7); /* harmony export (binding) */ __webpack_require__.d(exports, "c", function() { return CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR; }); /* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return MdlCheckboxComponent; }); /* harmony export (binding) */ __webpack_require__.d(exports, "b", function() { return MdlCheckboxModule; }); var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 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; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var noop = function (_) { }; var IS_FOCUSED = 'is-focused'; var CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR = { provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__["NG_VALUE_ACCESSOR"], useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["forwardRef"])(function () { return MdlCheckboxComponent; }), multi: true }; var MdlCheckboxComponent = (function () { function MdlCheckboxComponent(elementRef, renderer) { this.elementRef = elementRef; this.renderer = renderer; this.disabled = false; this.tabindex = 1; this.change = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); this.value_ = false; this.onTouchedCallback = noop; this.onChangeCallback = noop; this.el = elementRef.nativeElement; } Object.defineProperty(MdlCheckboxComponent.prototype, "value", { get: function () { return this.value_; }, set: function (v) { this.value_ = v; this.onChangeCallback(v); this.change.emit(v); }, enumerable: true, configurable: true }); ; MdlCheckboxComponent.prototype.writeValue = function (value) { this.value_ = value; }; MdlCheckboxComponent.prototype.registerOnChange = function (fn) { this.onChangeCallback = fn; }; MdlCheckboxComponent.prototype.registerOnTouched = function (fn) { this.onTouchedCallback = fn; }; MdlCheckboxComponent.prototype.setDisabledState = function (isDisabled) { this.disabled = isDisabled; }; MdlCheckboxComponent.prototype.onFocus = function () { this.renderer.setElementClass(this.el, IS_FOCUSED, true); }; MdlCheckboxComponent.prototype.onBlur = function () { this.renderer.setElementClass(this.el, IS_FOCUSED, false); this.onTouchedCallback(); }; MdlCheckboxComponent.prototype.onClick = function () { if (this.disabled) { return; } this.value = !this.value; }; __decorate([ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common_boolean_property__["a" /* BooleanProperty */])(), __metadata('design:type', Object) ], MdlCheckboxComponent.prototype, "disabled", void 0); __decorate([ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__common_number_property__["a" /* NumberProperty */])(), __metadata('design:type', Number) ], MdlCheckboxComponent.prototype, "tabindex", void 0); MdlCheckboxComponent = __decorate([ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({ selector: 'mdl-checkbox', providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR], host: { '(click)': 'onClick()', '[class.mdl-checkbox]': 'true', '[class.is-upgraded]': 'true', '[class.is-checked]': 'value', '[class.is-disabled]': 'disabled' }, template: "\n <input type=\"checkbox\" class=\"mdl-checkbox__input\" \n (focus)=\"onFocus()\" \n (blur)=\"onBlur()\"\n [disabled]=\"disabled\"\n [tabindex]=\"tabindex\"\n [ngModel]=\"value\">\n <span class=\"mdl-checkbox__label\"><ng-content></ng-content></span>\n <span class=\"mdl-checkbox__focus-helper\"></span>\n <span class=\"mdl-checkbox__box-outline\">\n <span class=\"mdl-checkbox__tick-outline\"></span>\n </span>\n ", inputs: ['value'], outputs: ['change'], encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewEncapsulation"].None, changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectionStrategy"].OnPush }), __metadata('design:paramtypes', [(typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"]) === 'function' && _a) || Object, (typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer"] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer"]) === 'function' && _b) || Object]) ], MdlCheckboxComponent); return MdlCheckboxComponent; var _a, _b; }()); var MDL_CHECKBOX_DIRECTIVES = [MdlCheckboxComponent]; var MdlCheckboxModule = (function () { function MdlCheckboxModule() { } MdlCheckboxModule.forRoot = function () { return { ngModule: MdlCheckboxModule, providers: [] }; }; MdlCheckboxModule = __decorate([ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"])({ imports: [__WEBPACK_IMPORTED_MODULE_2__angular_common__["CommonModule"], __WEBPACK_IMPORTED_MODULE_1__angular_forms__["FormsModule"]], exports: MDL_CHECKBOX_DIRECTIVES, declarations: MDL_CHECKBOX_DIRECTIVES, }), __metadata('design:paramtypes', []) ], MdlCheckboxModule); return MdlCheckboxModule; }()); /***/ }, /* 10 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__angular_core__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ripple_vendor__ = __webpack_require__(64); /* harmony export (binding) */ __webpack_require__.d(exports, "b", function() { return MdlRippleDirective; }); /* harmony export (binding) */ __webpack_require__.d(exports, "c", function() { return MdlButtonRippleDirective; }); /* harmony export (binding) */ __webpack_require__.d(exports, "d", function() { return MdlCheckboxRippleDirective; }); /* harmony export (binding) */ __webpack_require__.d(exports, "e", function() { return MdlRadioRippleDirective; }); /* harmony export (binding) */ __webpack_require__.d(exports, "f", function() { return MdlIconToggleRippleDirective; }); /* harmony export (binding) */ __webpack_require__.d(exports, "g", function() { return MdlSwitchRippleDirective; }); /* harmony export (binding) */ __webpack_require__.d(exports, "h", function() { return MdlMenuItemRippleDirective; }); /* harmony export (binding) */ __webpack_require__.d(exports, "i", function() { return MdlAnchorRippleDirective; }); /* harmony export (binding) */ __webpack_require__.d(exports, "j", function() { return MdlListItemRippleDirective; }); /* harmony export (binding) */ __webpack_require__.d(exports, "a", function() { return MdlRippleModule; }); var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 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; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; // known bugs: https://github.com/google/material-design-lite/issues/4215 var MdlRippleDirective = (function () { function MdlRippleDirective(elementRef, renderer, cssContainerClasses) { this.elementRef = elementRef; this.renderer = renderer; this.cssContainerClasses = cssContainerClasses; this.RIPPLE = 'mdl-ripple'; this.rippleActive = true; this.el = elementRef.nativeElement; } MdlRippleDirective.prototype.ngOnChanges = function () { var _this = this; // remove any existing ripple container if (this.rippleContainer) { this.el.removeChild(this.rippleContainer); delete this.rippleContainer; delete this.ripple; } // if used as mdl-ripple without property binding it is an empty string // otherwise (e.g. [mdl-ripple] it is a boolean - may be with the default value true. if (this.rippleActive === '' || this.rippleActive) { this.rippleContainer = this.renderer.createElement(null, 'span'); this.cssContainerClasses.forEach(function (cssClass) { _this.renderer.setElementClass(_this.rippleContainer, cssClass, true); }); var rippleElement = this.renderer.createElement(null, 'span'); this.renderer.setElementClass(rippleElement, this.RIPPLE, true); this.rippleContainer.appendChild(rippleElement); this.el.appendChild(this.rippleContainer); this.ripple = new __WEBPACK_IMPORTED_MODULE_1__ripple_vendor__["a" /* MaterialRipple */](this.renderer, this.el); } }; return MdlRippleDirective; }()); var MdlButtonRippleDirective = (function (_super) { __extends(MdlButtonRippleDirective, _super); function MdlButtonRippleDirective(elementRef, renderer) { _super.call(this, elementRef, renderer, ['mdl-button__ripple-container']); this.rippleActive = true; } // AOT is not able to call lifecycle hooks if a base class :( MdlButtonRippleDirective.prototype.ngOnChanges = function () { _super.prototype.ngOnChanges.call(this); }; __decorate([ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])('mdl-ripple'), __metadata('design:type', Object) ], MdlButtonRippleDirective.prototype, "rippleActive", void 0); MdlButtonRippleDirective = __decorate([ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"])({ selector: 'mdl-button[mdl-ripple], button[mdl-ripple]' }), __metadata('design:paramtypes', [(typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"]) === 'function' && _a) || Object, (typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer"] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer"]) === 'function' && _b) || Object]) ], MdlButtonRippleDirective); return MdlButtonRippleDirective; var _a, _b; }(MdlRippleDirective)); var MdlCheckboxRippleDirective = (function (_super) { __extends(MdlCheckboxRippleDirective, _super); function MdlCheckboxRippleDirective(elementRef, renderer) { _super.call(this, elementRef, renderer, ['mdl-checkbox__ripple-container', 'mdl-ripple--center']); this.rippleActive = true; } // AOT is not able to call lifecycle hooks if a base class :( MdlCheckboxRippleDirective.prototype.ngOnChanges = function () { _super.prototype.ngOnChanges.call(this); }; __decorate([ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])('mdl-ripple'), __metadata('design:type', Object) ], MdlCheckboxRippleDirective.prototype, "rippleActive", void 0); MdlCheckboxRippleDirective = __decorate([ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"])({ selector: 'mdl-checkbox[mdl-ripple]' }), __metadata('design:paramtypes', [(typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"]) === 'function' && _a) || Object, (typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer"] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer"]) === 'function' && _b) || Object]) ], MdlCheckboxRippleDirective); return MdlCheckboxRippleDirective; var _a, _b; }(MdlRippleDirective)); var MdlRadioRippleDirective = (function (_super) { __extends(MdlRadioRippleDirective, _super); function MdlRadioRippleDirective(elementRef, renderer) { _super.call(this, elementRef, renderer, ['mdl-radio__ripple-container', 'mdl-ripple--center']); this.rippleActive = true; } // AOT is not able to call lifecycle hooks if a base class :( MdlRadioRippleDirective.prototype.ngOnChanges = function () { _super.prototype.ngOnChanges.call(this); }; __decorate([ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])('mdl-ripple'), __metadata('design:type', Object) ], MdlRadioRippleDirective.prototype, "rippleActive", void 0); MdlRadioRippleDirective = __decorate([ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"])({ selector: 'mdl-radio[mdl-ripple]' }), __metadata('design:paramtypes', [(typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"]) === 'function' && _a) || Object, (typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer"] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer"]) === 'function' && _b) || Object]) ], MdlRadioRippleDirective); return MdlRadioRippleDirective; var _a, _b; }(MdlRippleDirective)); var MdlIconToggleRippleDirective = (function (_super) { __extends(MdlIconToggleRippleDirective, _super); function MdlIconToggleRippleDirective(elementRef, renderer) { _super.call(this, elementRef, renderer, ['mdl-icon-toggle__ripple-container', 'mdl-ripple--center']); this.rippleActive = true; } // AOT is not able to call lifecycle hooks if a base class :( MdlIconToggleRippleDirective.prototype.ngOnChanges = function () { _super.prototype.ngOnChanges.call(this); }; __decorate([ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])('mdl-ripple'), __metadata('design:type', Object) ], MdlIconToggleRippleDirective.prototype, "rippleActive", void 0); MdlIconToggleRippleDirective = __decorate([ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"])({ selector: 'mdl-icon-toggle[mdl-ripple]' }), __metadata('design:paramtypes', [(typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"]) === 'function' && _a) || Object, (typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer"] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer"]) === 'function' && _b) || Object]) ], MdlIconToggleRippleDirective); return MdlIconToggleRippleDirective; var _a, _b; }(MdlRippleDirective)); var MdlSwitchRippleDirective = (function (_super) { __extends(MdlSwitchRippleDirective, _super); function MdlSwitchRippleDirective(elementRef, renderer) { _super.call(this, elementRef, renderer, ['mdl-switch__ripple-container', 'mdl-ripple--center']); this.rippleActive = true; } // AOT is not able to call lifecycle hooks if a base class :( MdlSwitchRippleDirective.prototype.ngOnChanges = function () { _super.prototype.ngOnChanges.call(this); }; __decorate([ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])('mdl-ripple'), __metadata('design:type', Object) ], MdlSwitchRippleDirective.prototype, "rippleActive", void 0); MdlSwitchRippleDirective = __decorate([ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"])({ selector: 'mdl-switch[mdl-ripple]' }), __metadata('design:paramtypes', [(typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"]) === 'function' && _a) || Object, (typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer"] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer"]) === 'function' && _b) || Object]) ], MdlSwitchRippleDirective); return MdlSwitchRippleDirective; var _a, _b; }(MdlRippleDirective)); var MdlMenuItemRippleDirective = (function (_super) { __extends(MdlMenuItemRippleDirective, _super); function MdlMenuItemRippleDirective(elementRef, renderer) { _super.call(this, elementRef, renderer, ['mdl-menu__item--ripple-container']); this.rippleActive = true; } // AOT is not able to call lifecycle hooks if a base class :( MdlMenuItemRippleDirective.prototype.ngOnChanges = function () { _super.prototype.ngOnChanges.call(this); }; __decorate([ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])('mdl-ripple'), __metadata('design:type', Object) ], MdlMenuItemRippleDirective.prototype, "rippleActive", void 0); MdlMenuItemRippleDirective = __decorate([ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"])({ selector: 'mdl-menu-item[mdl-ripple]' }), __metadata('design:paramtypes', [(typeof (_a =