ngx-bootstrap
Version:
Native Angular Bootstrap Components
89 lines • 6.93 kB
JavaScript
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
import { Component, ChangeDetectionStrategy } from '@angular/core';
import { TooltipConfig } from './tooltip.config';
import { isBs3 } from 'ngx-bootstrap/utils';
export class TooltipContainerComponent {
/**
* @param {?} config
*/
constructor(config) {
Object.assign(this, config);
}
/**
* @return {?}
*/
get isBs3() {
return isBs3();
}
/**
* @return {?}
*/
ngAfterViewInit() {
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 in tooltip-" + placement + " " + "bs-tooltip-" + placement + " " + placement + " " + containerClass',
'[class.show]': '!isBs3',
'[class.bs3]': 'isBs3',
'[attr.id]': 'this.id',
role: 'tooltip'
},
template: `
<div class="tooltip-arrow arrow"></div>
<div class="tooltip-inner"><ng-content></ng-content></div>
`,
styles: [`
:host.tooltip {
display: block;
pointer-events: none;
}
:host.bs3.tooltip.top>.arrow {
margin-left: -2px;
}
:host.bs3.tooltip.bottom {
margin-top: 0px;
}
:host.bs3.bs-tooltip-left, :host.bs3.bs-tooltip-right{
margin: 0px;
}
:host.bs3.bs-tooltip-right .arrow, :host.bs3.bs-tooltip-left .arrow {
margin: .3rem 0;
}
`]
}] }
];
/** @nocollapse */
TooltipContainerComponent.ctorParameters = () => [
{ type: TooltipConfig }
];
if (false) {
/** @type {?} */
TooltipContainerComponent.prototype.classMap;
/** @type {?} */
TooltipContainerComponent.prototype.placement;
/** @type {?} */
TooltipContainerComponent.prototype.containerClass;
/** @type {?} */
TooltipContainerComponent.prototype.animation;
/** @type {?} */
TooltipContainerComponent.prototype.id;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbHRpcC1jb250YWluZXIuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vbmd4LWJvb3RzdHJhcC90b29sdGlwLyIsInNvdXJjZXMiOlsidG9vbHRpcC1jb250YWluZXIuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBRUwsU0FBUyxFQUNULHVCQUF1QixFQUN4QixNQUFNLGVBQWUsQ0FBQztBQUN2QixPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDakQsT0FBTyxFQUFFLEtBQUssRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBdUM1QyxNQUFNLE9BQU8seUJBQXlCOzs7O0lBV3BDLFlBQVksTUFBcUI7UUFDL0IsTUFBTSxDQUFDLE1BQU0sQ0FBQyxJQUFJLEVBQUUsTUFBTSxDQUFDLENBQUM7SUFDOUIsQ0FBQzs7OztJQU5ELElBQUksS0FBSztRQUNQLE9BQU8sS0FBSyxFQUFFLENBQUM7SUFDakIsQ0FBQzs7OztJQU1ELGVBQWU7UUFDYixJQUFJLENBQUMsUUFBUSxHQUFHLEVBQUUsRUFBRSxFQUFFLEtBQUssRUFBRSxJQUFJLEVBQUUsS0FBSyxFQUFFLENBQUM7UUFDM0MsSUFBSSxDQUFDLFFBQVEsQ0FBQyxJQUFJLENBQUMsU0FBUyxDQUFDLEdBQUcsSUFBSSxDQUFDO1FBQ3JDLElBQUksQ0FBQyxRQUFRLENBQUMsV0FBVyxJQUFJLENBQUMsU0FBUyxFQUFFLENBQUMsR0FBRyxJQUFJLENBQUM7UUFFbEQsSUFBSSxDQUFDLFFBQVEsQ0FBQyxFQUFFLEdBQUcsSUFBSSxDQUFDO1FBQ3hCLElBQUksSUFB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