UNPKG

ngx-foundation

Version:

Native Angular Foundation for Sites Components

50 lines 2.44 kB
import { Component, ChangeDetectionStrategy } from '@angular/core'; import { TooltipConfig } from './tooltip.config'; import { isBs3 } from '../utils/theme-provider'; var TooltipContainerComponent = /** @class */ (function () { function TooltipContainerComponent(config) { Object.assign(this, config); } Object.defineProperty(TooltipContainerComponent.prototype, "isBs3", { get: function () { return isBs3(); }, enumerable: true, configurable: true }); TooltipContainerComponent.prototype.ngAfterViewInit = function () { this.classMap = { in: false, fade: false }; this.classMap[this.placement] = true; this.classMap["tooltip-" + this.placement] = true; this.classMap.in = true; if (this.animation) { this.classMap.fade = true; } if (this.containerClass) { this.classMap[this.containerClass] = true; } }; TooltipContainerComponent.decorators = [ { type: Component, args: [{ selector: 'bs-tooltip-container', changeDetection: ChangeDetectionStrategy.OnPush, // tslint:disable-next-line host: { '[class]': '"tooltip tooltip-" + placement + " " + placement + " " + containerClass', '[class.show]': '!isBs3', role: 'tooltip' }, styles: [ "\n :host.tooltip {\n display: block;\n }\n :host.tooltip.top:before, :host.tooltip.bottom:before {\n left: 40%;\n }\n :host.tooltip.top {\n margin-bottom: 13px;\n } :host.tooltip.bottom {\n margin-top: 13px;\n } :host.tooltip.left {\n margin-right: 13px;\n } :host.tooltip.right {\n margin-left: 13px;\n } :host.tooltip.left:before, :host.tooltip.right:before {\n top: 35%;\n }\n " ], template: "\n <div class=\"tooltip-arrow arrow\"></div>\n <div class=\"tooltip-inner\"><ng-content></ng-content></div>\n " },] }, ]; /** @nocollapse */ TooltipContainerComponent.ctorParameters = function () { return [ { type: TooltipConfig, }, ]; }; return TooltipContainerComponent; }()); export { TooltipContainerComponent }; //# sourceMappingURL=tooltip-container.component.js.map