Update checked-in dependencies
This commit is contained in:
parent
6b0d45a5c6
commit
cc1adb825a
4247 changed files with 144820 additions and 149530 deletions
130
node_modules/table/dist/table.js
generated
vendored
130
node_modules/table/dist/table.js
generated
vendored
|
|
@ -1,110 +1,26 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _drawTable = _interopRequireDefault(require("./drawTable"));
|
||||
|
||||
var _calculateCellWidthIndex = _interopRequireDefault(require("./calculateCellWidthIndex"));
|
||||
|
||||
var _makeConfig = _interopRequireDefault(require("./makeConfig"));
|
||||
|
||||
var _calculateRowHeightIndex = _interopRequireDefault(require("./calculateRowHeightIndex"));
|
||||
|
||||
var _mapDataUsingRowHeightIndex = _interopRequireDefault(require("./mapDataUsingRowHeightIndex"));
|
||||
|
||||
var _alignTableData = _interopRequireDefault(require("./alignTableData"));
|
||||
|
||||
var _padTableData = _interopRequireDefault(require("./padTableData"));
|
||||
|
||||
var _validateTableData = _interopRequireDefault(require("./validateTableData"));
|
||||
|
||||
var _stringifyTableData = _interopRequireDefault(require("./stringifyTableData"));
|
||||
|
||||
var _truncateTableData = _interopRequireDefault(require("./truncateTableData"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* @typedef {string} table~cell
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {table~cell[]} table~row
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} table~columns
|
||||
* @property {string} alignment Cell content alignment (enum: left, center, right) (default: left).
|
||||
* @property {number} width Column width (default: auto).
|
||||
* @property {number} truncate Number of characters are which the content will be truncated (default: Infinity).
|
||||
* @property {boolean} wrapWord When true the text is broken at the nearest space or one of the special characters
|
||||
* @property {number} paddingLeft Cell content padding width left (default: 1).
|
||||
* @property {number} paddingRight Cell content padding width right (default: 1).
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} table~border
|
||||
* @property {string} topBody
|
||||
* @property {string} topJoin
|
||||
* @property {string} topLeft
|
||||
* @property {string} topRight
|
||||
* @property {string} bottomBody
|
||||
* @property {string} bottomJoin
|
||||
* @property {string} bottomLeft
|
||||
* @property {string} bottomRight
|
||||
* @property {string} bodyLeft
|
||||
* @property {string} bodyRight
|
||||
* @property {string} bodyJoin
|
||||
* @property {string} joinBody
|
||||
* @property {string} joinLeft
|
||||
* @property {string} joinRight
|
||||
* @property {string} joinJoin
|
||||
*/
|
||||
|
||||
/**
|
||||
* Used to tell whether to draw a horizontal line.
|
||||
* This callback is called for each non-content line of the table.
|
||||
* The default behavior is to always return true.
|
||||
*
|
||||
* @typedef {Function} drawHorizontalLine
|
||||
* @param {number} index
|
||||
* @param {number} size
|
||||
* @returns {boolean}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} table~config
|
||||
* @property {table~border} border
|
||||
* @property {table~columns[]} columns Column specific configuration.
|
||||
* @property {table~columns} columnDefault Default values for all columns. Column specific settings overwrite the default values.
|
||||
* @property {table~drawHorizontalLine} drawHorizontalLine
|
||||
* @property {table~singleLine} singleLine Horizontal lines inside the table are not drawn.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Generates a text table.
|
||||
*
|
||||
* @param {table~row[]} data
|
||||
* @param {table~config} userConfig
|
||||
* @returns {string}
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.table = void 0;
|
||||
const alignTableData_1 = require("./alignTableData");
|
||||
const calculateCellWidths_1 = require("./calculateCellWidths");
|
||||
const calculateRowHeights_1 = require("./calculateRowHeights");
|
||||
const drawTable_1 = require("./drawTable");
|
||||
const makeTableConfig_1 = require("./makeTableConfig");
|
||||
const mapDataUsingRowHeights_1 = require("./mapDataUsingRowHeights");
|
||||
const padTableData_1 = require("./padTableData");
|
||||
const stringifyTableData_1 = require("./stringifyTableData");
|
||||
const truncateTableData_1 = require("./truncateTableData");
|
||||
const validateTableData_1 = require("./validateTableData");
|
||||
const table = (data, userConfig = {}) => {
|
||||
let rows;
|
||||
(0, _validateTableData.default)(data);
|
||||
rows = (0, _stringifyTableData.default)(data);
|
||||
const config = (0, _makeConfig.default)(rows, userConfig);
|
||||
rows = (0, _truncateTableData.default)(data, config);
|
||||
const rowHeightIndex = (0, _calculateRowHeightIndex.default)(rows, config);
|
||||
rows = (0, _mapDataUsingRowHeightIndex.default)(rows, rowHeightIndex, config);
|
||||
rows = (0, _alignTableData.default)(rows, config);
|
||||
rows = (0, _padTableData.default)(rows, config);
|
||||
const cellWidthIndex = (0, _calculateCellWidthIndex.default)(rows[0]);
|
||||
return (0, _drawTable.default)(rows, config.border, cellWidthIndex, rowHeightIndex, config.drawHorizontalLine, config.singleLine);
|
||||
validateTableData_1.validateTableData(data);
|
||||
let rows = stringifyTableData_1.stringifyTableData(data);
|
||||
const config = makeTableConfig_1.makeTableConfig(rows, userConfig);
|
||||
rows = truncateTableData_1.truncateTableData(rows, config);
|
||||
const rowHeights = calculateRowHeights_1.calculateRowHeights(rows, config);
|
||||
rows = mapDataUsingRowHeights_1.mapDataUsingRowHeights(rows, rowHeights, config);
|
||||
rows = alignTableData_1.alignTableData(rows, config);
|
||||
rows = padTableData_1.padTableData(rows, config);
|
||||
const cellWidths = calculateCellWidths_1.calculateCellWidths(rows[0]);
|
||||
return drawTable_1.drawTable(rows, cellWidths, rowHeights, config);
|
||||
};
|
||||
|
||||
var _default = table;
|
||||
exports.default = _default;
|
||||
//# sourceMappingURL=table.js.map
|
||||
exports.table = table;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue