prodap-chatbot-domain
Version:
Classes utilizadas na resposta de todas as Intents do Assistente Virtual
47 lines • 1.82 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Message_1 = require("../base/Message");
const MessageTypes_1 = require("../types/MessageTypes");
class CardAbstract extends Message_1.default {
constructor({ key, cardText, filter, filterId, isClosable, legend, style, subtitle, title, tooltip, urlUpdate, timeUpdate, textMetric, isWidgetDashboard, closeButtonCustom, keyStorageCardId, intent, clickType, }, cardType) {
super(cardText ? cardText : '', MessageTypes_1.default.CARD);
this.key = key;
this.cardType = cardType;
this.filter = filter;
this.filterId = filterId;
this.isClosable = isClosable;
this.legend = legend;
this.style = style;
this.subtitle = subtitle;
this.tooltip = tooltip;
this.urlUpdate = urlUpdate;
this.timeUpdate = timeUpdate;
this.textMetric = textMetric;
this.isWidgetDashboard = isWidgetDashboard;
this.closeButtonCustom = closeButtonCustom;
this.keyStorageCardId = keyStorageCardId;
this.intent = intent;
this.clickType = clickType;
if (title) {
this.title = this.setContent(title);
}
}
setContent(prop) {
return {
value: this.setValue(prop),
color: this.setColor(prop),
icon: this.setTitleIcon(prop),
};
}
setValue(prop) {
return typeof prop === 'object' ? (prop.value ? prop.value : '') : prop;
}
setColor(prop) {
return typeof prop === 'object' ? (prop.color ? prop.color : '') : prop;
}
setTitleIcon(prop) {
return typeof prop === 'object' ? (prop.icon ? prop.icon : undefined) : undefined;
}
}
exports.default = CardAbstract;
//# sourceMappingURL=CardAbstract.js.map