Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private _updateInput(
calc: BotCalculationContext,
bot: Bot,
tag: string,
options: Partial
) {
this.inputDialogInput = tag;
this.inputDialogType = options.type || 'text';
this.inputDialogSubtype = options.subtype || 'basic';
this._inputDialogTarget = bot;
this.inputDialogInputValue =
calculateFormattedBotValue(
calc,
this._inputDialogTarget,
this.inputDialogInput
) || '';
if (typeof options.placeholder !== 'undefined') {
this.inputDialogPlaceholder = options.placeholder;
} else {
this.inputDialogPlaceholder = this.inputDialogInput;
}
}
private _updateLabel(calc: BotCalculationContext, bot: Bot) {
let label = bot.tags['aux.label'];
if (label) {
this.label = calculateFormattedBotValue(calc, bot, 'aux.label');
const labelColor = bot.tags['aux.label.color'];
if (labelColor) {
this.labelColor = calculateFormattedBotValue(
calc,
bot,
'aux.label.color'
);
} else {
this.labelColor = '#000';
}
} else {
this.label = '';
}
}
}
private _updateLabel(calc: BotCalculationContext, bot: Bot) {
let label = bot.tags['aux.label'];
if (label) {
this.label = calculateFormattedBotValue(calc, bot, 'aux.label');
const labelColor = bot.tags['aux.label.color'];
if (labelColor) {
this.labelColor = calculateFormattedBotValue(
calc,
bot,
'aux.label.color'
);
} else {
this.labelColor = '#000';
}
} else {
this.label = '';
}
}
}