npm package diff
Package: @forge/cli-shared
Versions: 6.6.1-next.10 - 6.6.1-next.11
File: package/out/ui/table-prompt.js
Index: package/out/ui/table-prompt.js
===================================================================
--- package/out/ui/table-prompt.js
+++ package/out/ui/table-prompt.js
@@ -6,8 +6,25 @@
const events_1 = tslib_1.__importDefault(require("inquirer/lib/utils/events"));
const readline_1 = tslib_1.__importDefault(require("inquirer/lib/utils/readline"));
const cli_table3_1 = tslib_1.__importDefault(require("cli-table3"));
const text_1 = require("./text");
+const NO_BORDERS = {
+ top: '',
+ 'top-mid': '',
+ 'top-left': '',
+ 'top-right': '',
+ bottom: '',
+ 'bottom-mid': '',
+ 'bottom-left': '',
+ 'bottom-right': '',
+ left: '',
+ 'left-mid': '',
+ mid: '',
+ 'mid-mid': '',
+ right: '',
+ 'right-mid': '',
+ middle: ' '
+};
class TablePrompt extends base_1.default {
done;
columns;
rows;
@@ -15,16 +32,18 @@
infoMessage;
pointer = 1;
options;
hasMultipleChoices;
+ isBorderless;
constructor(questions, readline, answers) {
super(questions, readline, answers);
this.options = this.opt;
this.promptMessage = text_1.Text.customPrompts.table.promptMessage(this.options.message);
this.infoMessage = this.options.infoMessage;
this.columns = [...this.options.columns];
this.rows = [...this.options.choices.choices];
this.hasMultipleChoices = this.rows.length > 1;
+ this.isBorderless = this.options.isBorderless || false;
}
_run(callback) {
this.done = callback;
void this.attachEventHandlers();
@@ -68,15 +87,17 @@
rows: this.rows,
hasMultipleChoices: this.hasMultipleChoices,
promptMessage: this.promptMessage,
infoMessage: this.infoMessage,
- isDone
+ isDone,
+ isBorderless: this.isBorderless
});
}
renderTable({ pointer, columns, rows, isDone }, getRowSymbol, formatRow, isSelected) {
const table = new cli_table3_1.default({
head: [...columns],
- style: { head: [] }
+ style: { head: [] },
+ chars: this.isBorderless ? NO_BORDERS : {}
});
rows.forEach((row, rowIndex) => {
const isHover = pointer === rowIndex + 1;
const rowSymbol = getRowSymbol(isDone, isHover, isSelected(rowIndex));