define(["require", "exports", "@syncfusion/ej2-base", "@syncfusion/ej2-popups", "../base/css-constant"], function (require, exports, ej2_base_1, ej2_popups_1, cls) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var KanbanTooltip = (function () {
function KanbanTooltip(parent) {
this.parent = parent;
this.renderTooltip();
}
KanbanTooltip.prototype.renderTooltip = function () {
this.tooltipObj = new ej2_popups_1.Tooltip({
cssClass: this.parent.cssClass + ' ' + cls.TOOLTIP_CLASS,
enableRtl: this.parent.enableRtl,
mouseTrail: !this.parent.isAdaptive,
offsetY: 5,
position: 'BottomCenter',
showTipPointer: true,
target: '.' + cls.TOOLTIP_TEXT_CLASS,
beforeRender: this.onBeforeRender.bind(this),
beforeClose: this.onBeforeClose.bind(this)
});
this.tooltipObj.appendTo(this.parent.element);
this.tooltipObj.isStringTemplate = true;
};
KanbanTooltip.prototype.onBeforeRender = function (args) {
if (this.parent.dragAndDropModule.isDragging) {
args.cancel = true;
return;
}
var tooltipContent;
if (this.parent.tooltipTemplate) {
tooltipContent = ej2_base_1.createElement('div');
var target = ej2_base_1.closest(args.target, '.' + cls.CARD_CLASS);
var data = this.parent.getCardDetails(target);
var templateId = this.parent.element.id + '_tooltipTemplate';
var tooltipTemplate = this.parent.templateParser(this.parent.tooltipTemplate)(data, this.parent, 'tooltipTemplate', templateId, false);
ej2_base_1.append(tooltipTemplate, tooltipContent);
this.parent.renderTemplates();
}
else {
tooltipContent = ej2_base_1.initializeCSPTemplate(function () {
return "<div class=\"e-card-header-caption\">" + args.target.innerText + "</div>";
});
}
this.tooltipObj.setProperties({ content: tooltipContent }, true);
};
KanbanTooltip.prototype.onBeforeClose = function () {
this.parent.resetTemplates(['tooltipTemplate']);
};
KanbanTooltip.prototype.destroy = function () {
this.tooltipObj.destroy();
ej2_base_1.addClass([this.parent.element], 'e-control');
this.tooltipObj = null;
};
return KanbanTooltip;
}());
exports.KanbanTooltip = KanbanTooltip;
});
|