UNPKG

md2

Version:

Angular2 based Material Design components, directives and services are Accordion, Autocomplete, Chips(Tags), Collapse, Colorpicker, Data Table, Datepicker, Dialog(Modal), Menu, Multiselect, Select, Tabs, Tags(Chips), Toast and Tooltip.

72 lines 3.05 kB
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; }; import { Injectable, Optional, SkipSelf } from '@angular/core'; /** * The OverlayContainer is the container in which all overlays will load. * It should be provided in the root component to ensure it is properly shared. */ var OverlayContainer = (function () { function OverlayContainer() { } Object.defineProperty(OverlayContainer.prototype, "themeClass", { /** * Base theme to be applied to all overlay-based components. */ get: function () { return this._themeClass; }, set: function (value) { if (this._containerElement) { this._containerElement.classList.remove(this._themeClass); if (value) { this._containerElement.classList.add(value); } } this._themeClass = value; }, enumerable: true, configurable: true }); /** * This method returns the overlay container element. It will lazily * create the element the first time it is called to facilitate using * the container in non-browser environments. * @returns the container element */ OverlayContainer.prototype.getContainerElement = function () { if (!this._containerElement) { this._createContainer(); } return this._containerElement; }; /** * Create the overlay container element, which is simply a div * with the 'cdk-overlay-container' class on the document body. */ OverlayContainer.prototype._createContainer = function () { var container = document.createElement('div'); container.classList.add('cdk-overlay-container'); if (this._themeClass) { container.classList.add(this._themeClass); } document.body.appendChild(container); this._containerElement = container; }; return OverlayContainer; }()); OverlayContainer = __decorate([ Injectable() ], OverlayContainer); export { OverlayContainer }; export function OVERLAY_CONTAINER_PROVIDER_FACTORY(parentContainer) { return parentContainer || new OverlayContainer(); } export var OVERLAY_CONTAINER_PROVIDER = { // If there is already an OverlayContainer available, use that. Otherwise, provide a new one. provide: OverlayContainer, deps: [[new Optional(), new SkipSelf(), OverlayContainer]], useFactory: OVERLAY_CONTAINER_PROVIDER_FACTORY }; //# sourceMappingURL=overlay-container.js.map