first commit

This commit is contained in:
monjack
2025-06-20 18:01:48 +08:00
commit 6daa6d65c1
24611 changed files with 2512443 additions and 0 deletions

24
app_vue/node_modules/table/LICENSE generated vendored Normal file
View File

@ -0,0 +1,24 @@
Copyright (c) 2018, Gajus Kuizinas (http://gajus.com/)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Gajus Kuizinas (http://gajus.com/) nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL ANUARY BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

837
app_vue/node_modules/table/README.md generated vendored Normal file
View File

@ -0,0 +1,837 @@
<a name="table"></a>
# Table
> Produces a string that represents array data in a text table.
[![Github action status](https://github.com/gajus/table/actions/workflows/main.yml/badge.svg)](https://github.com/gajus/table/actions)
[![Coveralls](https://img.shields.io/coveralls/gajus/table.svg?style=flat-square)](https://coveralls.io/github/gajus/table)
[![NPM version](http://img.shields.io/npm/v/table.svg?style=flat-square)](https://www.npmjs.org/package/table)
[![Canonical Code Style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical)
[![Twitter Follow](https://img.shields.io/twitter/follow/kuizinas.svg?style=social&label=Follow)](https://twitter.com/kuizinas)
* [Table](#table)
* [Features](#table-features)
* [Install](#table-install)
* [Usage](#table-usage)
* [API](#table-api)
* [table](#table-api-table-1)
* [createStream](#table-api-createstream)
* [getBorderCharacters](#table-api-getbordercharacters)
![Demo of table displaying a list of missions to the Moon.](./.README/demo.png)
<a name="table-features"></a>
## Features
* Works with strings containing [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) characters.
* Works with strings containing [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code).
* Configurable border characters.
* Configurable content alignment per column.
* Configurable content padding per column.
* Configurable column width.
* Text wrapping.
<a name="table-install"></a>
## Install
```bash
npm install table
```
[![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/gajus)
[![Become a Patron](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://www.patreon.com/gajus)
<a name="table-usage"></a>
## Usage
```js
import { table } from 'table';
// Using commonjs?
// const { table } = require('table');
const data = [
['0A', '0B', '0C'],
['1A', '1B', '1C'],
['2A', '2B', '2C']
];
console.log(table(data));
```
```
╔════╤════╤════╗
║ 0A │ 0B │ 0C ║
╟────┼────┼────╢
║ 1A │ 1B │ 1C ║
╟────┼────┼────╢
║ 2A │ 2B │ 2C ║
╚════╧════╧════╝
```
<a name="table-api"></a>
## API
<a name="table-api-table-1"></a>
### table
Returns the string in the table format
**Parameters:**
- **_data_:** The data to display
- Type: `any[][]`
- Required: `true`
- **_config_:** Table configuration
- Type: `object`
- Required: `false`
<a name="table-api-table-1-config-border"></a>
##### config.border
Type: `{ [type: string]: string }`\
Default: `honeywell` [template](#getbordercharacters)
Custom borders. The keys are any of:
- `topLeft`, `topRight`, `topBody`,`topJoin`
- `bottomLeft`, `bottomRight`, `bottomBody`, `bottomJoin`
- `joinLeft`, `joinRight`, `joinBody`, `joinJoin`
- `bodyLeft`, `bodyRight`, `bodyJoin`
- `headerJoin`
```js
const data = [
['0A', '0B', '0C'],
['1A', '1B', '1C'],
['2A', '2B', '2C']
];
const config = {
border: {
topBody: `─`,
topJoin: `┬`,
topLeft: `┌`,
topRight: `┐`,
bottomBody: `─`,
bottomJoin: `┴`,
bottomLeft: `└`,
bottomRight: `┘`,
bodyLeft: `│`,
bodyRight: `│`,
bodyJoin: `│`,
joinBody: `─`,
joinLeft: `├`,
joinRight: `┤`,
joinJoin: `┼`
}
};
console.log(table(data, config));
```
```
┌────┬────┬────┐
│ 0A │ 0B │ 0C │
├────┼────┼────┤
│ 1A │ 1B │ 1C │
├────┼────┼────┤
│ 2A │ 2B │ 2C │
└────┴────┴────┘
```
<a name="table-api-table-1-config-drawverticalline"></a>
##### config.drawVerticalLine
Type: `(lineIndex: number, columnCount: number) => boolean`\
Default: `() => true`
It is used to tell whether to draw a vertical line. This callback is called for each vertical border of the table.
If the table has `n` columns, then the `index` parameter is alternatively received all numbers in range `[0, n]` inclusively.
```js
const data = [
['0A', '0B', '0C'],
['1A', '1B', '1C'],
['2A', '2B', '2C'],
['3A', '3B', '3C'],
['4A', '4B', '4C']
];
const config = {
drawVerticalLine: (lineIndex, columnCount) => {
return lineIndex === 0 || lineIndex === columnCount;
}
};
console.log(table(data, config));
```
```
╔════════════╗
║ 0A 0B 0C ║
╟────────────╢
║ 1A 1B 1C ║
╟────────────╢
║ 2A 2B 2C ║
╟────────────╢
║ 3A 3B 3C ║
╟────────────╢
║ 4A 4B 4C ║
╚════════════╝
```
<a name="table-api-table-1-config-drawhorizontalline"></a>
##### config.drawHorizontalLine
Type: `(lineIndex: number, rowCount: number) => boolean`\
Default: `() => true`
It is used to tell whether to draw a horizontal line. This callback is called for each horizontal border of the table.
If the table has `n` rows, then the `index` parameter is alternatively received all numbers in range `[0, n]` inclusively.
If the table has `n` rows and contains the header, then the range will be `[0, n+1]` inclusively.
```js
const data = [
['0A', '0B', '0C'],
['1A', '1B', '1C'],
['2A', '2B', '2C'],
['3A', '3B', '3C'],
['4A', '4B', '4C']
];
const config = {
drawHorizontalLine: (lineIndex, rowCount) => {
return lineIndex === 0 || lineIndex === 1 || lineIndex === rowCount - 1 || lineIndex === rowCount;
}
};
console.log(table(data, config));
```
```
╔════╤════╤════╗
║ 0A │ 0B │ 0C ║
╟────┼────┼────╢
║ 1A │ 1B │ 1C ║
║ 2A │ 2B │ 2C ║
║ 3A │ 3B │ 3C ║
╟────┼────┼────╢
║ 4A │ 4B │ 4C ║
╚════╧════╧════╝
```
<a name="table-api-table-1-config-singleline"></a>
##### config.singleLine
Type: `boolean`\
Default: `false`
If `true`, horizontal lines inside the table are not drawn. This option also overrides the `config.drawHorizontalLine` if specified.
```js
const data = [
['-rw-r--r--', '1', 'pandorym', 'staff', '1529', 'May 23 11:25', 'LICENSE'],
['-rw-r--r--', '1', 'pandorym', 'staff', '16327', 'May 23 11:58', 'README.md'],
['drwxr-xr-x', '76', 'pandorym', 'staff', '2432', 'May 23 12:02', 'dist'],
['drwxr-xr-x', '634', 'pandorym', 'staff', '20288', 'May 23 11:54', 'node_modules'],
['-rw-r--r--', '1,', 'pandorym', 'staff', '525688', 'May 23 11:52', 'package-lock.json'],
['-rw-r--r--@', '1', 'pandorym', 'staff', '2440', 'May 23 11:25', 'package.json'],
['drwxr-xr-x', '27', 'pandorym', 'staff', '864', 'May 23 11:25', 'src'],
['drwxr-xr-x', '20', 'pandorym', 'staff', '640', 'May 23 11:25', 'test'],
];
const config = {
singleLine: true
};
console.log(table(data, config));
```
```
╔═════════════╤═════╤══════════╤═══════╤════════╤══════════════╤═══════════════════╗
║ -rw-r--r-- │ 1 │ pandorym │ staff │ 1529 │ May 23 11:25 │ LICENSE ║
║ -rw-r--r-- │ 1 │ pandorym │ staff │ 16327 │ May 23 11:58 │ README.md ║
║ drwxr-xr-x │ 76 │ pandorym │ staff │ 2432 │ May 23 12:02 │ dist ║
║ drwxr-xr-x │ 634 │ pandorym │ staff │ 20288 │ May 23 11:54 │ node_modules ║
║ -rw-r--r-- │ 1, │ pandorym │ staff │ 525688 │ May 23 11:52 │ package-lock.json ║
║ -rw-r--r--@ │ 1 │ pandorym │ staff │ 2440 │ May 23 11:25 │ package.json ║
║ drwxr-xr-x │ 27 │ pandorym │ staff │ 864 │ May 23 11:25 │ src ║
║ drwxr-xr-x │ 20 │ pandorym │ staff │ 640 │ May 23 11:25 │ test ║
╚═════════════╧═════╧══════════╧═══════╧════════╧══════════════╧═══════════════════╝
```
<a name="table-api-table-1-config-columns"></a>
##### config.columns
Type: `Column[] | { [columnIndex: number]: Column }`
Column specific configurations.
<a name="table-api-table-1-config-columns-config-columns-width"></a>
###### config.columns[*].width
Type: `number`\
Default: the maximum cell widths of the column
Column width (excluding the paddings).
```js
const data = [
['0A', '0B', '0C'],
['1A', '1B', '1C'],
['2A', '2B', '2C']
];
const config = {
columns: {
1: { width: 10 }
}
};
console.log(table(data, config));
```
```
╔════╤════════════╤════╗
║ 0A │ 0B │ 0C ║
╟────┼────────────┼────╢
║ 1A │ 1B │ 1C ║
╟────┼────────────┼────╢
║ 2A │ 2B │ 2C ║
╚════╧════════════╧════╝
```
<a name="table-api-table-1-config-columns-config-columns-alignment"></a>
###### config.columns[*].alignment
Type: `'center' | 'justify' | 'left' | 'right'`\
Default: `'left'`
Cell content horizontal alignment
```js
const data = [
['0A', '0B', '0C', '0D 0E 0F'],
['1A', '1B', '1C', '1D 1E 1F'],
['2A', '2B', '2C', '2D 2E 2F'],
];
const config = {
columnDefault: {
width: 10,
},
columns: [
{ alignment: 'left' },
{ alignment: 'center' },
{ alignment: 'right' },
{ alignment: 'justify' }
],
};
console.log(table(data, config));
```
```
╔════════════╤════════════╤════════════╤════════════╗
║ 0A │ 0B │ 0C │ 0D 0E 0F ║
╟────────────┼────────────┼────────────┼────────────╢
║ 1A │ 1B │ 1C │ 1D 1E 1F ║
╟────────────┼────────────┼────────────┼────────────╢
║ 2A │ 2B │ 2C │ 2D 2E 2F ║
╚════════════╧════════════╧════════════╧════════════╝
```
<a name="table-api-table-1-config-columns-config-columns-verticalalignment"></a>
###### config.columns[*].verticalAlignment
Type: `'top' | 'middle' | 'bottom'`\
Default: `'top'`
Cell content vertical alignment
```js
const data = [
['A', 'B', 'C', 'DEF'],
];
const config = {
columnDefault: {
width: 1,
},
columns: [
{ verticalAlignment: 'top' },
{ verticalAlignment: 'middle' },
{ verticalAlignment: 'bottom' },
],
};
console.log(table(data, config));
```
```
╔═══╤═══╤═══╤═══╗
║ A │ │ │ D ║
║ │ B │ │ E ║
║ │ │ C │ F ║
╚═══╧═══╧═══╧═══╝
```
<a name="table-api-table-1-config-columns-config-columns-paddingleft"></a>
###### config.columns[*].paddingLeft
Type: `number`\
Default: `1`
The number of whitespaces used to pad the content on the left.
<a name="table-api-table-1-config-columns-config-columns-paddingright"></a>
###### config.columns[*].paddingRight
Type: `number`\
Default: `1`
The number of whitespaces used to pad the content on the right.
The `paddingLeft` and `paddingRight` options do not count on the column width. So the column has `width = 5`, `paddingLeft = 2` and `paddingRight = 2` will have the total width is `9`.
```js
const data = [
['0A', 'AABBCC', '0C'],
['1A', '1B', '1C'],
['2A', '2B', '2C']
];
const config = {
columns: [
{
paddingLeft: 3
},
{
width: 2,
paddingRight: 3
}
]
};
console.log(table(data, config));
```
```
╔══════╤══════╤════╗
║ 0A │ AA │ 0C ║
║ │ BB │ ║
║ │ CC │ ║
╟──────┼──────┼────╢
║ 1A │ 1B │ 1C ║
╟──────┼──────┼────╢
║ 2A │ 2B │ 2C ║
╚══════╧══════╧════╝
```
<a name="table-api-table-1-config-columns-config-columns-truncate"></a>
###### config.columns[*].truncate
Type: `number`\
Default: `Infinity`
The number of characters is which the content will be truncated.
To handle a content that overflows the container width, `table` package implements [text wrapping](#config.columns[*].wrapWord). However, sometimes you may want to truncate content that is too long to be displayed in the table.
```js
const data = [
['Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar nibh sed mauris convallis dapibus. Nunc venenatis tempus nulla sit amet viverra.']
];
const config = {
columns: [
{
width: 20,
truncate: 100
}
]
};
console.log(table(data, config));
```
```
╔══════════════════════╗
║ Lorem ipsum dolor si ║
║ t amet, consectetur ║
║ adipiscing elit. Pha ║
║ sellus pulvinar nibh ║
║ sed mauris convall… ║
╚══════════════════════╝
```
<a name="table-api-table-1-config-columns-config-columns-wrapword"></a>
###### config.columns[*].wrapWord
Type: `boolean`\
Default: `false`
The `table` package implements auto text wrapping, i.e., text that has the width greater than the container width will be separated into multiple lines at the nearest space or one of the special characters: `\|/_.,;-`.
When `wrapWord` is `false`:
```js
const data = [
['Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar nibh sed mauris convallis dapibus. Nunc venenatis tempus nulla sit amet viverra.']
];
const config = {
columns: [ { width: 20 } ]
};
console.log(table(data, config));
```
```
╔══════════════════════╗
║ Lorem ipsum dolor si ║
║ t amet, consectetur ║
║ adipiscing elit. Pha ║
║ sellus pulvinar nibh ║
║ sed mauris convallis ║
║ dapibus. Nunc venena ║
║ tis tempus nulla sit ║
║ amet viverra. ║
╚══════════════════════╝
```
When `wrapWord` is `true`:
```
╔══════════════════════╗
║ Lorem ipsum dolor ║
║ sit amet, ║
║ consectetur ║
║ adipiscing elit. ║
║ Phasellus pulvinar ║
║ nibh sed mauris ║
║ convallis dapibus. ║
║ Nunc venenatis ║
║ tempus nulla sit ║
║ amet viverra. ║
╚══════════════════════╝
```
<a name="table-api-table-1-config-columndefault"></a>
##### config.columnDefault
Type: `Column`\
Default: `{}`
The default configuration for all columns. Column-specific settings will overwrite the default values.
<a name="table-api-table-1-config-header"></a>
##### config.header
Type: `object`
Header configuration.
*Deprecated in favor of the new spanning cells API.*
The header configuration inherits the most of the column's, except:
- `content` **{string}**: the header content.
- `width:` calculate based on the content width automatically.
- `alignment:` `center` be default.
- `verticalAlignment:` is not supported.
- `config.border.topJoin` will be `config.border.topBody` for prettier.
```js
const data = [
['0A', '0B', '0C'],
['1A', '1B', '1C'],
['2A', '2B', '2C'],
];
const config = {
columnDefault: {
width: 10,
},
header: {
alignment: 'center',
content: 'THE HEADER\nThis is the table about something',
},
}
console.log(table(data, config));
```
```
╔══════════════════════════════════════╗
║ THE HEADER ║
║ This is the table about something ║
╟────────────┬────────────┬────────────╢
║ 0A │ 0B │ 0C ║
╟────────────┼────────────┼────────────╢
║ 1A │ 1B │ 1C ║
╟────────────┼────────────┼────────────╢
║ 2A │ 2B │ 2C ║
╚════════════╧════════════╧════════════╝
```
<a name="table-api-table-1-config-spanningcells"></a>
##### config.spanningCells
Type: `SpanningCellConfig[]`
Spanning cells configuration.
The configuration should be straightforward: just specify an array of minimal cell configurations including the position of top-left cell
and the number of columns and/or rows will be expanded from it.
The content of overlap cells will be ignored to make the `data` shape be consistent.
By default, the configuration of column that the top-left cell belongs to will be applied to the whole spanning cell, except:
* The `width` will be summed up of all spanning columns.
* The `paddingRight` will be received from the right-most column intentionally.
Advances customized column-like styles can be configurable to each spanning cell to overwrite the default behavior.
```js
const data = [
['Test Coverage Report', '', '', '', '', ''],
['Module', 'Component', 'Test Cases', 'Failures', 'Durations', 'Success Rate'],
['Services', 'User', '50', '30', '3m 7s', '60.0%'],
['', 'Payment', '100', '80', '7m 15s', '80.0%'],
['Subtotal', '', '150', '110', '10m 22s', '73.3%'],
['Controllers', 'User', '24', '18', '1m 30s', '75.0%'],
['', 'Payment', '30', '24', '50s', '80.0%'],
['Subtotal', '', '54', '42', '2m 20s', '77.8%'],
['Total', '', '204', '152', '12m 42s', '74.5%'],
];
const config = {
columns: [
{ alignment: 'center', width: 12 },
{ alignment: 'center', width: 10 },
{ alignment: 'right' },
{ alignment: 'right' },
{ alignment: 'right' },
{ alignment: 'right' }
],
spanningCells: [
{ col: 0, row: 0, colSpan: 6 },
{ col: 0, row: 2, rowSpan: 2, verticalAlignment: 'middle'},
{ col: 0, row: 4, colSpan: 2, alignment: 'right'},
{ col: 0, row: 5, rowSpan: 2, verticalAlignment: 'middle'},
{ col: 0, row: 7, colSpan: 2, alignment: 'right' },
{ col: 0, row: 8, colSpan: 2, alignment: 'right' }
],
};
console.log(table(data, config));
```
```
╔══════════════════════════════════════════════════════════════════════════════╗
║ Test Coverage Report ║
╟──────────────┬────────────┬────────────┬──────────┬───────────┬──────────────╢
║ Module │ Component │ Test Cases │ Failures │ Durations │ Success Rate ║
╟──────────────┼────────────┼────────────┼──────────┼───────────┼──────────────╢
║ │ User │ 50 │ 30 │ 3m 7s │ 60.0% ║
║ Services ├────────────┼────────────┼──────────┼───────────┼──────────────╢
║ │ Payment │ 100 │ 80 │ 7m 15s │ 80.0% ║
╟──────────────┴────────────┼────────────┼──────────┼───────────┼──────────────╢
║ Subtotal │ 150 │ 110 │ 10m 22s │ 73.3% ║
╟──────────────┬────────────┼────────────┼──────────┼───────────┼──────────────╢
║ │ User │ 24 │ 18 │ 1m 30s │ 75.0% ║
║ Controllers ├────────────┼────────────┼──────────┼───────────┼──────────────╢
║ │ Payment │ 30 │ 24 │ 50s │ 80.0% ║
╟──────────────┴────────────┼────────────┼──────────┼───────────┼──────────────╢
║ Subtotal │ 54 │ 42 │ 2m 20s │ 77.8% ║
╟───────────────────────────┼────────────┼──────────┼───────────┼──────────────╢
║ Total │ 204 │ 152 │ 12m 42s │ 74.5% ║
╚═══════════════════════════╧════════════╧══════════╧═══════════╧══════════════╝
```
<a name="table-api-createstream"></a>
### createStream
`table` package exports `createStream` function used to draw a table and append rows.
**Parameter:**
- _**config:**_ the same as `table`'s, except `config.columnDefault.width` and `config.columnCount` must be provided.
```js
import { createStream } from 'table';
const config = {
columnDefault: {
width: 50
},
columnCount: 1
};
const stream = createStream(config);
setInterval(() => {
stream.write([new Date()]);
}, 500);
```
![Streaming current date.](./.README/api/stream/streaming.gif)
`table` package uses ANSI escape codes to overwrite the output of the last line when a new row is printed.
The underlying implementation is explained in this [Stack Overflow answer](http://stackoverflow.com/a/32938658/368691).
Streaming supports all of the configuration properties and functionality of a static table (such as auto text wrapping, alignment and padding), e.g.
```js
import { createStream } from 'table';
import _ from 'lodash';
const config = {
columnDefault: {
width: 50
},
columnCount: 3,
columns: [
{
width: 10,
alignment: 'right'
},
{ alignment: 'center' },
{ width: 10 }
]
};
const stream = createStream(config);
let i = 0;
setInterval(() => {
let random;
random = _.sample('abcdefghijklmnopqrstuvwxyz', _.random(1, 30)).join('');
stream.write([i++, new Date(), random]);
}, 500);
```
![Streaming random data.](./.README/api/stream/streaming-random.gif)
<a name="table-api-getbordercharacters"></a>
### getBorderCharacters
**Parameter:**
- **_template_**
- Type: `'honeywell' | 'norc' | 'ramac' | 'void'`
- Required: `true`
You can load one of the predefined border templates using `getBorderCharacters` function.
```js
import { table, getBorderCharacters } from 'table';
const data = [
['0A', '0B', '0C'],
['1A', '1B', '1C'],
['2A', '2B', '2C']
];
const config = {
border: getBorderCharacters(`name of the template`)
};
console.log(table(data, config));
```
```
# honeywell
╔════╤════╤════╗
║ 0A │ 0B │ 0C ║
╟────┼────┼────╢
║ 1A │ 1B │ 1C ║
╟────┼────┼────╢
║ 2A │ 2B │ 2C ║
╚════╧════╧════╝
# norc
┌────┬────┬────┐
│ 0A │ 0B │ 0C │
├────┼────┼────┤
│ 1A │ 1B │ 1C │
├────┼────┼────┤
│ 2A │ 2B │ 2C │
└────┴────┴────┘
# ramac (ASCII; for use in terminals that do not support Unicode characters)
+----+----+----+
| 0A | 0B | 0C |
|----|----|----|
| 1A | 1B | 1C |
|----|----|----|
| 2A | 2B | 2C |
+----+----+----+
# void (no borders; see "borderless table" section of the documentation)
0A 0B 0C
1A 1B 1C
2A 2B 2C
```
Raise [an issue](https://github.com/gajus/table/issues) if you'd like to contribute a new border template.
<a name="table-api-getbordercharacters-borderless-table"></a>
#### Borderless Table
Simply using `void` border character template creates a table with a lot of unnecessary spacing.
To create a more pleasant to the eye table, reset the padding and remove the joining rows, e.g.
```js
const output = table(data, {
border: getBorderCharacters('void'),
columnDefault: {
paddingLeft: 0,
paddingRight: 1
},
drawHorizontalLine: () => false
}
);
console.log(output);
```
```
0A 0B 0C
1A 1B 1C
2A 2B 2C
```

View File

@ -0,0 +1,7 @@
import type { SpanningCellContext } from './spanningCellManager';
import type { RangeConfig } from './types/internal';
/**
* Fill content into all cells in range in order to calculate total height
*/
export declare const wrapRangeContent: (rangeConfig: RangeConfig, rangeWidth: number, context: SpanningCellContext) => string[];
export declare const alignVerticalRangeContent: (range: RangeConfig, content: string[], context: SpanningCellContext) => string[];

View File

@ -0,0 +1,48 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.alignVerticalRangeContent = exports.wrapRangeContent = void 0;
const string_width_1 = __importDefault(require("string-width"));
const alignString_1 = require("./alignString");
const mapDataUsingRowHeights_1 = require("./mapDataUsingRowHeights");
const padTableData_1 = require("./padTableData");
const truncateTableData_1 = require("./truncateTableData");
const utils_1 = require("./utils");
const wrapCell_1 = require("./wrapCell");
/**
* Fill content into all cells in range in order to calculate total height
*/
const wrapRangeContent = (rangeConfig, rangeWidth, context) => {
const { topLeft, paddingRight, paddingLeft, truncate, wrapWord, alignment } = rangeConfig;
const originalContent = context.rows[topLeft.row][topLeft.col];
const contentWidth = rangeWidth - paddingLeft - paddingRight;
return (0, wrapCell_1.wrapCell)((0, truncateTableData_1.truncateString)(originalContent, truncate), contentWidth, wrapWord).map((line) => {
const alignedLine = (0, alignString_1.alignString)(line, contentWidth, alignment);
return (0, padTableData_1.padString)(alignedLine, paddingLeft, paddingRight);
});
};
exports.wrapRangeContent = wrapRangeContent;
const alignVerticalRangeContent = (range, content, context) => {
const { rows, drawHorizontalLine, rowHeights } = context;
const { topLeft, bottomRight, verticalAlignment } = range;
// They are empty before calculateRowHeights function run
if (rowHeights.length === 0) {
return [];
}
const totalCellHeight = (0, utils_1.sumArray)(rowHeights.slice(topLeft.row, bottomRight.row + 1));
const totalBorderHeight = bottomRight.row - topLeft.row;
const hiddenHorizontalBorderCount = (0, utils_1.sequence)(topLeft.row + 1, bottomRight.row).filter((horizontalBorderIndex) => {
return !drawHorizontalLine(horizontalBorderIndex, rows.length);
}).length;
const availableRangeHeight = totalCellHeight + totalBorderHeight - hiddenHorizontalBorderCount;
return (0, mapDataUsingRowHeights_1.padCellVertically)(content, availableRangeHeight, verticalAlignment).map((line) => {
if (line.length === 0) {
return ' '.repeat((0, string_width_1.default)(content[0]));
}
return line;
});
};
exports.alignVerticalRangeContent = alignVerticalRangeContent;
//# sourceMappingURL=alignSpanningCell.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"alignSpanningCell.js","sourceRoot":"","sources":["../../src/alignSpanningCell.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAuC;AACvC,+CAEuB;AACvB,qEAEkC;AAClC,iDAEwB;AAIxB,2DAE6B;AAI7B,mCAEiB;AACjB,yCAEoB;AAEpB;;GAEG;AACI,MAAM,gBAAgB,GAAG,CAAC,WAAwB,EAAE,UAAkB,EAAE,OAA4B,EAAY,EAAE;IACvH,MAAM,EAAC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAC,GAAG,WAAW,CAAC;IAExF,MAAM,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC/D,MAAM,YAAY,GAAG,UAAU,GAAG,WAAW,GAAG,YAAY,CAAC;IAE7D,OAAO,IAAA,mBAAQ,EAAC,IAAA,kCAAc,EAAC,eAAe,EAAE,QAAQ,CAAC,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAC9F,MAAM,WAAW,GAAG,IAAA,yBAAW,EAAC,IAA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AG,CAAC,MAAM,CAAC,IAAA,sBAAW,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC5C;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAxBW,QAAA,yBAAyB,6BAwBpC"}

6
app_vue/node_modules/table/dist/src/alignString.d.ts generated vendored Normal file
View File

@ -0,0 +1,6 @@
import type { Alignment } from './types/api';
/**
* Pads a string to the left and/or right to position the subject
* text in a desired alignment within a container.
*/
export declare const alignString: (subject: string, containerWidth: number, alignment: Alignment) => string;

60
app_vue/node_modules/table/dist/src/alignString.js generated vendored Normal file
View File

@ -0,0 +1,60 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.alignString = void 0;
const string_width_1 = __importDefault(require("string-width"));
const utils_1 = require("./utils");
const alignLeft = (subject, width) => {
return subject + ' '.repeat(width);
};
const alignRight = (subject, width) => {
return ' '.repeat(width) + subject;
};
const alignCenter = (subject, width) => {
return ' '.repeat(Math.floor(width / 2)) + subject + ' '.repeat(Math.ceil(width / 2));
};
const alignJustify = (subject, width) => {
const spaceSequenceCount = (0, utils_1.countSpaceSequence)(subject);
if (spaceSequenceCount === 0) {
return alignLeft(subject, width);
}
const addingSpaces = (0, utils_1.distributeUnevenly)(width, spaceSequenceCount);
if (Math.max(...addingSpaces) > 3) {
return alignLeft(subject, width);
}
let spaceSequenceIndex = 0;
return subject.replace(/\s+/g, (groupSpace) => {
return groupSpace + ' '.repeat(addingSpaces[spaceSequenceIndex++]);
});
};
/**
* Pads a string to the left and/or right to position the subject
* text in a desired alignment within a container.
*/
const alignString = (subject, containerWidth, alignment) => {
const subjectWidth = (0, string_width_1.default)(subject);
if (subjectWidth === containerWidth) {
return subject;
}
if (subjectWidth > containerWidth) {
throw new Error('Subject parameter value width cannot be greater than the container width.');
}
if (subjectWidth === 0) {
return ' '.repeat(containerWidth);
}
const availableWidth = containerWidth - subjectWidth;
if (alignment === 'left') {
return alignLeft(subject, availableWidth);
}
if (alignment === 'right') {
return alignRight(subject, availableWidth);
}
if (alignment === 'justify') {
return alignJustify(subject, availableWidth);
}
return alignCenter(subject, availableWidth);
};
exports.alignString = alignString;
//# sourceMappingURL=alignString.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"alignString.js","sourceRoot":"","sources":["../../src/alignString.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAuC;AAIvC,mCAEiB;AAEjB,MAAM,SAAS,GAAG,CAAC,OAAe,EAAE,KAAa,EAAU,EAAE;IAC3D,OAAO,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,OAAe,EAAE,KAAa,EAAU,EAAE;IAC5D,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,OAAe,EAAE,KAAa,EAAU,EAAE;IAC7D,OAAO,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;AACxF,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,KAAa,EAAU,EAAE;IAC9D,MAAM,kBAAkB,GAAG,IAAA,0BAAkB,EAAC,OAAO,CAAC,CAAC;IAEvD,IAAI,kBAAkB,KAAK,CAAC,EAAE;QAC5B,OAAO,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KAClC;IAED,MAAM,YAAY,GAAG,IAAA,0BAAkB,EAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;IAEnE,IAAI,IAAI,CAAC,GAAG,CAA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al';
export declare const alignTableData: (rows: Row[], config: BaseConfig) => Row[];

20
app_vue/node_modules/table/dist/src/alignTableData.js generated vendored Normal file
View File

@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.alignTableData = void 0;
const alignString_1 = require("./alignString");
const alignTableData = (rows, config) => {
return rows.map((row, rowIndex) => {
return row.map((cell, cellIndex) => {
var _a;
const { width, alignment } = config.columns[cellIndex];
const containingRange = (_a = config.spanningCellManager) === null || _a === void 0 ? void 0 : _a.getContainingRange({ col: cellIndex,
row: rowIndex }, { mapped: true });
if (containingRange) {
return cell;
}
return (0, alignString_1.alignString)(cell, width, alignment);
});
});
};
exports.alignTableData = alignTableData;
//# sourceMappingURL=alignTableData.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"alignTableData.js","sourceRoot":"","sources":["../../src/alignTableData.ts"],"names":[],"mappings":";;;AAAA,+CAEuB;AAMhB,MAAM,cAAc,GAAG,CAAC,IAAW,EAAE,MAAkB,EAAS,EAAE;IACvE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE;QAChC,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;;YACjC,MAAM,EAAC,KAAK,EAAE,SAAS,EAAC,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YAErD,MAAM,eAAe,GAAG,MAAA,MAAM,CAAC,mBAAmB,0CAAE,kBAAkB,CAAC,EAAC,GAAG,EAAE,SAAS;gBACpF,GAAG,EAAE,QAAQ,EAAC,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC;YAClC,IAAI,eAAe,EAAE;gBACnB,OAAO,IAAI,CAAC;aACb;YAED,OAAO,IAAA,yBAAW,EAAC,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAdW,QAAA,cAAc,kBAczB"}

View File

@ -0,0 +1,4 @@
/**
* Calculates height of cell content in regard to its width and word wrapping.
*/
export declare const calculateCellHeight: (value: string, columnWidth: number, useWrapWord?: boolean) => number;

View File

@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.calculateCellHeight = void 0;
const wrapCell_1 = require("./wrapCell");
/**
* Calculates height of cell content in regard to its width and word wrapping.
*/
const calculateCellHeight = (value, columnWidth, useWrapWord = false) => {
return (0, wrapCell_1.wrapCell)(value, columnWidth, useWrapWord).length;
};
exports.calculateCellHeight = calculateCellHeight;
//# sourceMappingURL=calculateCellHeight.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"calculateCellHeight.js","sourceRoot":"","sources":["../../src/calculateCellHeight.ts"],"names":[],"mappings":";;;AAAA,yCAEoB;AAEpB;;GAEG;AACI,MAAM,mBAAmB,GAAG,CAAC,KAAa,EAAE,WAAmB,EAAE,WAAW,GAAG,KAAK,EAAU,EAAE;IACrG,OAAO,IAAA,mBAAQ,EAAC,KAAK,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,MAAM,CAAC;AAC1D,CAAC,CAAC;AAFW,QAAA,mBAAmB,uBAE9B"}

View File

@ -0,0 +1,7 @@
import type { SpanningCellConfig } from './types/api';
import type { Row, Cell } from './types/internal';
export declare const calculateMaximumCellWidth: (cell: Cell) => number;
/**
* Produces an array of values that describe the largest value length (width) in every column.
*/
export declare const calculateMaximumColumnWidths: (rows: Row[], spanningCellConfigs?: SpanningCellConfig[]) => number[];

View File

@ -0,0 +1,36 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.calculateMaximumColumnWidths = exports.calculateMaximumCellWidth = void 0;
const string_width_1 = __importDefault(require("string-width"));
const utils_1 = require("./utils");
const calculateMaximumCellWidth = (cell) => {
return Math.max(...cell.split('\n').map(string_width_1.default));
};
exports.calculateMaximumCellWidth = calculateMaximumCellWidth;
/**
* Produces an array of values that describe the largest value length (width) in every column.
*/
const calculateMaximumColumnWidths = (rows, spanningCellConfigs = []) => {
const columnWidths = new Array(rows[0].length).fill(0);
const rangeCoordinates = spanningCellConfigs.map(utils_1.calculateRangeCoordinate);
const isSpanningCell = (rowIndex, columnIndex) => {
return rangeCoordinates.some((rangeCoordinate) => {
return (0, utils_1.isCellInRange)({ col: columnIndex,
row: rowIndex }, rangeCoordinate);
});
};
rows.forEach((row, rowIndex) => {
row.forEach((cell, cellIndex) => {
if (isSpanningCell(rowIndex, cellIndex)) {
return;
}
columnWidths[cellIndex] = Math.max(columnWidths[cellIndex], (0, exports.calculateMaximumCellWidth)(cell));
});
});
return columnWidths;
};
exports.calculateMaximumColumnWidths = calculateMaximumColumnWidths;
//# sourceMappingURL=calculateMaximumColumnWidths.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"calculateMaximumColumnWidths.js","sourceRoot":"","sources":["../../src/calculateMaximumColumnWidths.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAuC;AAQvC,mCAEiB;AAEV,MAAM,yBAAyB,GAAG,CAAC,IAAU,EAAU,EAAE;IAC9D,OAAO,IAAI,CAAC,GAAG,CACb,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,sBAAW,CAAC,CACrC,CAAC;AACJ,CAAC,CAAC;AAJW,QAAA,yBAAyB,6BAIpC;AAEF;;GAEG;AACI,MAAM,4BAA4B,GAAG,CAAC,IAAW,EAAE,sBAA4C,EAAE,EAAY,EAAE;IACpH,MAAM,YAAY,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACvD,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,GAAG,CAAC,gCAAwB,CAAC,CAAC;IAC3E,MAAM,cAAc,GAAG,CAAC,QAAgB,EAAE,WAAmB,EAAW,EAAE;QACxE,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE;YAC/C,OAAO,IAAA,qBAAa,EAAC,EAAC,GAAG,EAAE,WAAW;gBACpC,GAAG,EAAE,QAAQ,EAAC,EAAE,eAAe,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE;QAC7B,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;YAC9B,IAAI,cAAc,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAE;gBACvC,OAAO;aACR;YACD,YAAY,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,IAAA,iCAAyB,EAAC,IAAI,CAAC,CAAC,CAAC;QAC/F,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AApBW,QAAA,4BAA4B,gCAoBvC"}

View File

@ -0,0 +1,2 @@
import type { TableConfig } from './types/internal';
export declare const calculateOutputColumnWidths: (config: TableConfig) => number[];

View File

@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.calculateOutputColumnWidths = void 0;
const calculateOutputColumnWidths = (config) => {
return config.columns.map((col) => {
return col.paddingLeft + col.width + col.paddingRight;
});
};
exports.calculateOutputColumnWidths = calculateOutputColumnWidths;
//# sourceMappingURL=calculateOutputColumnWidths.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"calculateOutputColumnWidths.js","sourceRoot":"","sources":["../../src/calculateOutputColumnWidths.ts"],"names":[],"mappings":";;;AAIO,MAAM,2BAA2B,GAAG,CAAC,MAAmB,EAAY,EAAE;IAC3E,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QAChC,OAAO,GAAG,CAAC,WAAW,GAAG,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,YAAY,CAAC;IACxD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAJW,QAAA,2BAA2B,+BAItC"}

View File

@ -0,0 +1,5 @@
import type { BaseConfig, Row } from './types/internal';
/**
* Produces an array of values that describe the largest value length (height) in every row.
*/
export declare const calculateRowHeights: (rows: Row[], config: BaseConfig) => number[];

View File

@ -0,0 +1,42 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.calculateRowHeights = void 0;
const calculateCellHeight_1 = require("./calculateCellHeight");
const utils_1 = require("./utils");
/**
* Produces an array of values that describe the largest value length (height) in every row.
*/
const calculateRowHeights = (rows, config) => {
const rowHeights = [];
for (const [rowIndex, row] of rows.entries()) {
let rowHeight = 1;
row.forEach((cell, cellIndex) => {
var _a;
const containingRange = (_a = config.spanningCellManager) === null || _a === void 0 ? void 0 : _a.getContainingRange({ col: cellIndex,
row: rowIndex });
if (!containingRange) {
const cellHeight = (0, calculateCellHeight_1.calculateCellHeight)(cell, config.columns[cellIndex].width, config.columns[cellIndex].wrapWord);
rowHeight = Math.max(rowHeight, cellHeight);
return;
}
const { topLeft, bottomRight, height } = containingRange;
// bottom-most cell of a range needs to contain all remain lines of spanning cells
if (rowIndex === bottomRight.row) {
const totalOccupiedSpanningCellHeight = (0, utils_1.sumArray)(rowHeights.slice(topLeft.row));
const totalHorizontalBorderHeight = bottomRight.row - topLeft.row;
const totalHiddenHorizontalBorderHeight = (0, utils_1.sequence)(topLeft.row + 1, bottomRight.row).filter((horizontalBorderIndex) => {
var _a;
/* istanbul ignore next */
return !((_a = config.drawHorizontalLine) === null || _a === void 0 ? void 0 : _a.call(config, horizontalBorderIndex, rows.length));
}).length;
const cellHeight = height - totalOccupiedSpanningCellHeight - totalHorizontalBorderHeight + totalHiddenHorizontalBorderHeight;
rowHeight = Math.max(rowHeight, cellHeight);
}
// otherwise, just depend on other sibling cell heights in the row
});
rowHeights.push(rowHeight);
}
return rowHeights;
};
exports.calculateRowHeights = calculateRowHeights;
//# sourceMappingURL=calculateRowHeights.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"calculateRowHeights.js","sourceRoot":"","sources":["../../src/calculateRowHeights.ts"],"names":[],"mappings":";;;AAAA,+DAE+B;AAK/B,mCAGiB;AAEjB;;GAEG;AACI,MAAM,mBAAmB,GAAG,CAAC,IAAW,EAAE,MAAkB,EAAY,EAAE;IAC/E,MAAM,UAAU,GAAa,EAAE,CAAC;IAEhC,KAAK,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE;QAC5C,IAAI,SAAS,GAAG,CAAC,CAAC;QAElB,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;;YAC9B,MAAM,eAAe,GAAG,MAAA,MAAM,CAAC,mBAAmB,0CAAE,kBAAkB,CAAC,EAAC,GAAG,EAAE,SAAS;gBACpF,GAAG,EAAE,QAAQ,EAAC,CAAC,CAAC;YAElB,IAAI,CAAC,eAAe,EAAE;gBACpB,MAAM,UAAU,GAAG,IAAA,yCAAmB,EAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC;gBAClH,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;gBAE5C,OAAO;aACR;YACD,MAAM,EAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAC,GAAG,eAAe,CAAC;YAEvD,kFAAkF;YAClF,IAAI,QAAQ,KAAK,WAAW,CAAC,GAAG,EAAE;gBAChC,MAAM,+BAA+B,GAAG,IAAA,gBAAQ,EAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;gBAChF,MAAM,2BAA2B,GAAG,WAAW,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;gBAClE,MAAM,iCAAiC,GAAG,IAAA,gBAAQ,EAAC,OAAO,CAAC,GAAG,GAAG,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,qBAAqB,EAAE,EAAE;;oBACpH,0BAA0B;oBAC1B,OAAO,CAAC,CAAA,MAAA,MAAM,CAAC,kBAAkB,+CAAzB,MAAM,EAAsB,qBAAqB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA,CAAC;gBAC1E,CAAC,CAAC,CAAC,MAAM,CAAC;gBAEV,MAAM,UAAU,GAAG,MAAM,GAAG,+BAA+B,GAAG,2BAA2B,GAAG,iCAAiC,CAAC;gBAC9H,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;aAC7C;YAED,kEAAkE;QACpE,CAAC,CAAC,CAAC;QAEH,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KAC5B;IAED,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAtCW,QAAA,mBAAmB,uBAsC9B"}

View File

@ -0,0 +1,3 @@
import type { SpanningCellParameters } from './spanningCellManager';
import type { RangeConfig } from './types/internal';
export declare const calculateSpanningCellWidth: (rangeConfig: RangeConfig, dependencies: SpanningCellParameters) => number;

View File

@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.calculateSpanningCellWidth = void 0;
const utils_1 = require("./utils");
const calculateSpanningCellWidth = (rangeConfig, dependencies) => {
const { columnsConfig, drawVerticalLine } = dependencies;
const { topLeft, bottomRight } = rangeConfig;
const totalWidth = (0, utils_1.sumArray)(columnsConfig.slice(topLeft.col, bottomRight.col + 1).map(({ width }) => {
return width;
}));
const totalPadding = topLeft.col === bottomRight.col ?
columnsConfig[topLeft.col].paddingRight +
columnsConfig[bottomRight.col].paddingLeft :
(0, utils_1.sumArray)(columnsConfig
.slice(topLeft.col, bottomRight.col + 1)
.map(({ paddingLeft, paddingRight }) => {
return paddingLeft + paddingRight;
}));
const totalBorderWidths = bottomRight.col - topLeft.col;
const totalHiddenVerticalBorders = (0, utils_1.sequence)(topLeft.col + 1, bottomRight.col).filter((verticalBorderIndex) => {
return !drawVerticalLine(verticalBorderIndex, columnsConfig.length);
}).length;
return totalWidth + totalPadding + totalBorderWidths - totalHiddenVerticalBorders;
};
exports.calculateSpanningCellWidth = calculateSpanningCellWidth;
//# sourceMappingURL=calculateSpanningCellWidth.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"calculateSpanningCellWidth.js","sourceRoot":"","sources":["../../src/calculateSpanningCellWidth.ts"],"names":[],"mappings":";;;AAMA,mCAEiB;AAEV,MAAM,0BAA0B,GAAG,CAAC,WAAwB,EAAE,YAAoC,EAAU,EAAE;IACnH,MAAM,EAAC,aAAa,EAAE,gBAAgB,EAAC,GAAG,YAAY,CAAC;IACvD,MAAM,EAAC,OAAO,EAAE,WAAW,EAAC,GAAG,WAAW,CAAC;IAE3C,MAAM,UAAU,GAAG,IAAA,gBAAQ,EACzB,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE;QACpE,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CACH,CAAC;IAEF,MAAM,YAAY,GAChB,OAAO,CAAC,GAAG,KAAK,WAAW,CAAC,GAAG,CAAC,CAAC;QAC/B,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,YAAY;YACvC,aAAa,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC;QAC5C,IAAA,gBAAQ,EACN,aAAa;aACV,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,GAAG,CAAC,CAAC;aACvC,GAAG,CAAC,CAAC,EAAC,WAAW,EAAE,YAAY,EAAC,EAAE,EAAE;YACnC,OAAO,WAAW,GAAG,YAAY,CAAC;QACpC,CAAC,CAAC,CACL,CAAC;IACN,MAAM,iBAAiB,GAAG,WAAW,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAExD,MAAM,0BAA0B,GAAG,IAAA,gBAAQ,EAAC,OAAO,CAAC,GAAG,GAAG,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,mBAAmB,EAAE,EAAE;QAC3G,OAAO,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC,MAAM,CAAC;IAEV,OAAO,UAAU,GAAG,YAAY,GAAG,iBAAiB,GAAG,0BAA0B,CAAC;AACpF,CAAC,CAAC;AA5BW,QAAA,0BAA0B,8BA4BrC"}

View File

@ -0,0 +1,2 @@
import type { StreamUserConfig, WritableStream } from './types/api';
export declare const createStream: (userConfig: StreamUserConfig) => WritableStream;

74
app_vue/node_modules/table/dist/src/createStream.js generated vendored Normal file
View File

@ -0,0 +1,74 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createStream = void 0;
const alignTableData_1 = require("./alignTableData");
const calculateRowHeights_1 = require("./calculateRowHeights");
const drawBorder_1 = require("./drawBorder");
const drawRow_1 = require("./drawRow");
const makeStreamConfig_1 = require("./makeStreamConfig");
const mapDataUsingRowHeights_1 = require("./mapDataUsingRowHeights");
const padTableData_1 = require("./padTableData");
const stringifyTableData_1 = require("./stringifyTableData");
const truncateTableData_1 = require("./truncateTableData");
const utils_1 = require("./utils");
const prepareData = (data, config) => {
let rows = (0, stringifyTableData_1.stringifyTableData)(data);
rows = (0, truncateTableData_1.truncateTableData)(rows, (0, utils_1.extractTruncates)(config));
const rowHeights = (0, calculateRowHeights_1.calculateRowHeights)(rows, config);
rows = (0, mapDataUsingRowHeights_1.mapDataUsingRowHeights)(rows, rowHeights, config);
rows = (0, alignTableData_1.alignTableData)(rows, config);
rows = (0, padTableData_1.padTableData)(rows, config);
return rows;
};
const create = (row, columnWidths, config) => {
const rows = prepareData([row], config);
const body = rows.map((literalRow) => {
return (0, drawRow_1.drawRow)(literalRow, config);
}).join('');
let output;
output = '';
output += (0, drawBorder_1.drawBorderTop)(columnWidths, config);
output += body;
output += (0, drawBorder_1.drawBorderBottom)(columnWidths, config);
output = output.trimEnd();
process.stdout.write(output);
};
const append = (row, columnWidths, config) => {
const rows = prepareData([row], config);
const body = rows.map((literalRow) => {
return (0, drawRow_1.drawRow)(literalRow, config);
}).join('');
let output = '';
const bottom = (0, drawBorder_1.drawBorderBottom)(columnWidths, config);
if (bottom !== '\n') {
output = '\r\u001B[K';
}
output += (0, drawBorder_1.drawBorderJoin)(columnWidths, config);
output += body;
output += bottom;
output = output.trimEnd();
process.stdout.write(output);
};
const createStream = (userConfig) => {
const config = (0, makeStreamConfig_1.makeStreamConfig)(userConfig);
const columnWidths = Object.values(config.columns).map((column) => {
return column.width + column.paddingLeft + column.paddingRight;
});
let empty = true;
return {
write: (row) => {
if (row.length !== config.columnCount) {
throw new Error('Row cell count does not match the config.columnCount.');
}
if (empty) {
empty = false;
create(row, columnWidths, config);
}
else {
append(row, columnWidths, config);
}
},
};
};
exports.createStream = createStream;
//# sourceMappingURL=createStream.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"createStream.js","sourceRoot":"","sources":["../../src/createStream.ts"],"names":[],"mappings":";;;AAAA,qDAE0B;AAC1B,+DAE+B;AAC/B,6CAIsB;AACtB,uCAEmB;AACnB,yDAE4B;AAC5B,qEAEkC;AAClC,iDAEwB;AACxB,6DAE8B;AAC9B,2DAE6B;AAQ7B,mCAEiB;AAEjB,MAAM,WAAW,GAAG,CAAC,IAAW,EAAE,MAAoB,EAAE,EAAE;IACxD,IAAI,IAAI,GAAG,IAAA,uCAAkB,EAAC,IAAI,CAAC,CAAC;IAEpC,IAAI,GAAG,IAAA,qCAAiB,EAAC,IAAI,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Ed,MAAM,CAAC,GAAG,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;aACnC;iBAAM;gBACL,MAAM,CAAC,GAAG,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;aACnC;QACH,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAxBW,QAAA,YAAY,gBAwBvB"}

34
app_vue/node_modules/table/dist/src/drawBorder.d.ts generated vendored Normal file
View File

@ -0,0 +1,34 @@
import type { SpanningCellManager } from './spanningCellManager';
import type { BorderConfig, DrawVerticalLine } from './types/api';
import type { SeparatorGetter } from './types/internal';
declare type Separator = {
readonly left: string;
readonly right: string;
readonly body: string;
readonly bodyJoinOuter?: string;
readonly bodyJoinInner?: string;
readonly join: string;
readonly joinUp?: string;
readonly joinDown?: string;
readonly joinLeft?: string;
readonly joinRight?: string;
};
export declare const drawBorderSegments: (columnWidths: number[], parameters: Parameters<typeof drawBorder>[1]) => string[];
export declare const createSeparatorGetter: (dependencies: Parameters<typeof drawBorder>[1]) => (verticalBorderIndex: number, columnCount: number) => string;
export declare const drawBorder: (columnWidths: number[], parameters: Omit<DrawBorderParameters, 'border'> & {
separator: Separator;
}) => string;
export declare const drawBorderTop: (columnWidths: number[], parameters: DrawBorderParameters) => string;
export declare const drawBorderJoin: (columnWidths: number[], parameters: DrawBorderParameters) => string;
export declare const drawBorderBottom: (columnWidths: number[], parameters: DrawBorderParameters) => string;
export declare type BorderGetterParameters = {
border: BorderConfig;
drawVerticalLine: DrawVerticalLine;
spanningCellManager?: SpanningCellManager;
rowCount?: number;
};
export declare type DrawBorderParameters = Omit<BorderGetterParameters, 'outputColumnWidths'> & {
horizontalBorderIndex?: number;
};
export declare const createTableBorderGetter: (columnWidths: number[], parameters: BorderGetterParameters) => SeparatorGetter;
export {};

202
app_vue/node_modules/table/dist/src/drawBorder.js generated vendored Normal file
View File

@ -0,0 +1,202 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createTableBorderGetter = exports.drawBorderBottom = exports.drawBorderJoin = exports.drawBorderTop = exports.drawBorder = exports.createSeparatorGetter = exports.drawBorderSegments = void 0;
const drawContent_1 = require("./drawContent");
const drawBorderSegments = (columnWidths, parameters) => {
const { separator, horizontalBorderIndex, spanningCellManager } = parameters;
return columnWidths.map((columnWidth, columnIndex) => {
const normalSegment = separator.body.repeat(columnWidth);
if (horizontalBorderIndex === undefined) {
return normalSegment;
}
/* istanbul ignore next */
const range = spanningCellManager === null || spanningCellManager === void 0 ? void 0 : spanningCellManager.getContainingRange({ col: columnIndex,
row: horizontalBorderIndex });
if (!range) {
return normalSegment;
}
const { topLeft } = range;
// draw border segments as usual for top border of spanning cell
if (horizontalBorderIndex === topLeft.row) {
return normalSegment;
}
// if for first column/row of spanning cell, just skip
if (columnIndex !== topLeft.col) {
return '';
}
return range.extractBorderContent(horizontalBorderIndex);
});
};
exports.drawBorderSegments = drawBorderSegments;
const createSeparatorGetter = (dependencies) => {
const { separator, spanningCellManager, horizontalBorderIndex, rowCount } = dependencies;
// eslint-disable-next-line complexity
return (verticalBorderIndex, columnCount) => {
const inSameRange = spanningCellManager === null || spanningCellManager === void 0 ? void 0 : spanningCellManager.inSameRange;
if (horizontalBorderIndex !== undefined && inSameRange) {
const topCell = { col: verticalBorderIndex,
row: horizontalBorderIndex - 1 };
const leftCell = { col: verticalBorderIndex - 1,
row: horizontalBorderIndex };
const oppositeCell = { col: verticalBorderIndex - 1,
row: horizontalBorderIndex - 1 };
const currentCell = { col: verticalBorderIndex,
row: horizontalBorderIndex };
const pairs = [
[oppositeCell, topCell],
[topCell, currentCell],
[currentCell, leftCell],
[leftCell, oppositeCell],
];
// left side of horizontal border
if (verticalBorderIndex === 0) {
if (inSameRange(currentCell, topCell) && separator.bodyJoinOuter) {
return separator.bodyJoinOuter;
}
return separator.left;
}
// right side of horizontal border
if (verticalBorderIndex === columnCount) {
if (inSameRange(oppositeCell, leftCell) && separator.bodyJoinOuter) {
return separator.bodyJoinOuter;
}
return separator.right;
}
// top horizontal border
if (horizontalBorderIndex === 0) {
if (inSameRange(currentCell, leftCell)) {
return separator.body;
}
return separator.join;
}
// bottom horizontal border
if (horizontalBorderIndex === rowCount) {
if (inSameRange(topCell, oppositeCell)) {
return separator.body;
}
return separator.join;
}
const sameRangeCount = pairs.map((pair) => {
return inSameRange(...pair);
}).filter(Boolean).length;
// four cells are belongs to different spanning cells
if (sameRangeCount === 0) {
return separator.join;
}
// belong to one spanning cell
if (sameRangeCount === 4) {
return '';
}
// belongs to two spanning cell
if (sameRangeCount === 2) {
if (inSameRange(...pairs[1]) && inSameRange(...pairs[3]) && separator.bodyJoinInner) {
return separator.bodyJoinInner;
}
return separator.body;
}
/* istanbul ignore next */
if (sameRangeCount === 1) {
if (!separator.joinRight || !separator.joinLeft || !separator.joinUp || !separator.joinDown) {
throw new Error(`Can not get border separator for position [${horizontalBorderIndex}, ${verticalBorderIndex}]`);
}
if (inSameRange(...pairs[0])) {
return separator.joinDown;
}
if (inSameRange(...pairs[1])) {
return separator.joinLeft;
}
if (inSameRange(...pairs[2])) {
return separator.joinUp;
}
return separator.joinRight;
}
/* istanbul ignore next */
throw new Error('Invalid case');
}
if (verticalBorderIndex === 0) {
return separator.left;
}
if (verticalBorderIndex === columnCount) {
return separator.right;
}
return separator.join;
};
};
exports.createSeparatorGetter = createSeparatorGetter;
const drawBorder = (columnWidths, parameters) => {
const borderSegments = (0, exports.drawBorderSegments)(columnWidths, parameters);
const { drawVerticalLine, horizontalBorderIndex, spanningCellManager } = parameters;
return (0, drawContent_1.drawContent)({
contents: borderSegments,
drawSeparator: drawVerticalLine,
elementType: 'border',
rowIndex: horizontalBorderIndex,
separatorGetter: (0, exports.createSeparatorGetter)(parameters),
spanningCellManager,
}) + '\n';
};
exports.drawBorder = drawBorder;
const drawBorderTop = (columnWidths, parameters) => {
const { border } = parameters;
const result = (0, exports.drawBorder)(columnWidths, {
...parameters,
separator: {
body: border.topBody,
join: border.topJoin,
left: border.topLeft,
right: border.topRight,
},
});
if (result === '\n') {
return '';
}
return result;
};
exports.drawBorderTop = drawBorderTop;
const drawBorderJoin = (columnWidths, parameters) => {
const { border } = parameters;
return (0, exports.drawBorder)(columnWidths, {
...parameters,
separator: {
body: border.joinBody,
bodyJoinInner: border.bodyJoin,
bodyJoinOuter: border.bodyLeft,
join: border.joinJoin,
joinDown: border.joinMiddleDown,
joinLeft: border.joinMiddleLeft,
joinRight: border.joinMiddleRight,
joinUp: border.joinMiddleUp,
left: border.joinLeft,
right: border.joinRight,
},
});
};
exports.drawBorderJoin = drawBorderJoin;
const drawBorderBottom = (columnWidths, parameters) => {
const { border } = parameters;
return (0, exports.drawBorder)(columnWidths, {
...parameters,
separator: {
body: border.bottomBody,
join: border.bottomJoin,
left: border.bottomLeft,
right: border.bottomRight,
},
});
};
exports.drawBorderBottom = drawBorderBottom;
const createTableBorderGetter = (columnWidths, parameters) => {
return (index, size) => {
const drawBorderParameters = { ...parameters,
horizontalBorderIndex: index };
if (index === 0) {
return (0, exports.drawBorderTop)(columnWidths, drawBorderParameters);
}
else if (index === size) {
return (0, exports.drawBorderBottom)(columnWidths, drawBorderParameters);
}
return (0, exports.drawBorderJoin)(columnWidths, drawBorderParameters);
};
};
exports.createTableBorderGetter = createTableBorderGetter;
//# sourceMappingURL=drawBorder.js.map

File diff suppressed because one or more lines are too long

14
app_vue/node_modules/table/dist/src/drawContent.d.ts generated vendored Normal file
View File

@ -0,0 +1,14 @@
import type { SpanningCellManager } from './spanningCellManager';
/**
* Shared function to draw horizontal borders, rows or the entire table
*/
declare type DrawContentParameters = {
contents: string[];
drawSeparator: (index: number, size: number) => boolean;
separatorGetter: (index: number, size: number) => string;
spanningCellManager?: SpanningCellManager;
rowIndex?: number;
elementType?: 'border' | 'cell' | 'row';
};
export declare const drawContent: (parameters: DrawContentParameters) => string;
export {};

51
app_vue/node_modules/table/dist/src/drawContent.js generated vendored Normal file
View File

@ -0,0 +1,51 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.drawContent = void 0;
const drawContent = (parameters) => {
const { contents, separatorGetter, drawSeparator, spanningCellManager, rowIndex, elementType } = parameters;
const contentSize = contents.length;
const result = [];
if (drawSeparator(0, contentSize)) {
result.push(separatorGetter(0, contentSize));
}
contents.forEach((content, contentIndex) => {
if (!elementType || elementType === 'border' || elementType === 'row') {
result.push(content);
}
if (elementType === 'cell' && rowIndex === undefined) {
result.push(content);
}
if (elementType === 'cell' && rowIndex !== undefined) {
/* istanbul ignore next */
const containingRange = spanningCellManager === null || spanningCellManager === void 0 ? void 0 : spanningCellManager.getContainingRange({ col: contentIndex,
row: rowIndex });
// when drawing content row, just add a cell when it is a normal cell
// or belongs to first column of spanning cell
if (!containingRange || contentIndex === containingRange.topLeft.col) {
result.push(content);
}
}
// Only append the middle separator if the content is not the last
if (contentIndex + 1 < contentSize && drawSeparator(contentIndex + 1, contentSize)) {
const separator = separatorGetter(contentIndex + 1, contentSize);
if (elementType === 'cell' && rowIndex !== undefined) {
const currentCell = { col: contentIndex + 1,
row: rowIndex };
/* istanbul ignore next */
const containingRange = spanningCellManager === null || spanningCellManager === void 0 ? void 0 : spanningCellManager.getContainingRange(currentCell);
if (!containingRange || containingRange.topLeft.col === currentCell.col) {
result.push(separator);
}
}
else {
result.push(separator);
}
}
});
if (drawSeparator(contentSize, contentSize)) {
result.push(separatorGetter(contentSize, contentSize));
}
return result.join('');
};
exports.drawContent = drawContent;
//# sourceMappingURL=drawContent.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"drawContent.js","sourceRoot":"","sources":["../../src/drawContent.ts"],"names":[],"mappings":";;;AAmBO,MAAM,WAAW,GAAG,CAAC,UAAiC,EAAU,EAAE;IACvE,MAAM,EAAC,QAAQ,EAAE,eAAe,EAAE,aAAa,EAAE,mBAAmB,EAAE,QAAQ,EAAE,WAAW,EAAC,GAAG,UAAU,CAAC;IAC1G,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC;IACpC,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,IAAI,aAAa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G,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC;gBAC7E,IAAI,CAAC,eAAe,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,KAAK,WAAW,CAAC,GAAG,EAAE;oBACvE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;iBACxB;aACF;iBAAM;gBACL,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aACxB;SACF;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,aAAa,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE;QAC3C,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;KACxD;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzB,CAAC,CAAC;AArDW,QAAA,WAAW,eAqDtB"}

10
app_vue/node_modules/table/dist/src/drawRow.d.ts generated vendored Normal file
View File

@ -0,0 +1,10 @@
import type { SpanningCellManager } from './spanningCellManager';
import type { DrawVerticalLine } from './types/api';
import type { BodyBorderConfig, Row } from './types/internal';
export declare type DrawRowConfig = {
border: BodyBorderConfig;
drawVerticalLine: DrawVerticalLine;
spanningCellManager?: SpanningCellManager;
rowIndex?: number;
};
export declare const drawRow: (row: Row, config: DrawRowConfig) => string;

25
app_vue/node_modules/table/dist/src/drawRow.js generated vendored Normal file
View File

@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.drawRow = void 0;
const drawContent_1 = require("./drawContent");
const drawRow = (row, config) => {
const { border, drawVerticalLine, rowIndex, spanningCellManager } = config;
return (0, drawContent_1.drawContent)({
contents: row,
drawSeparator: drawVerticalLine,
elementType: 'cell',
rowIndex,
separatorGetter: (index, columnCount) => {
if (index === 0) {
return border.bodyLeft;
}
if (index === columnCount) {
return border.bodyRight;
}
return border.bodyJoin;
},
spanningCellManager,
}) + '\n';
};
exports.drawRow = drawRow;
//# sourceMappingURL=drawRow.js.map

1
app_vue/node_modules/table/dist/src/drawRow.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"drawRow.js","sourceRoot":"","sources":["../../src/drawRow.ts"],"names":[],"mappings":";;;AAAA,+CAEuB;AAmBhB,MAAM,OAAO,GAAG,CAAC,GAAQ,EAAE,MAAqB,EAAU,EAAE;IACjE,MAAM,EAAC,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,mBAAmB,EAAC,GAAG,MAAM,CAAC;IAEzE,OAAO,IAAA,yBAAW,EAAC;QACjB,QAAQ,EAAE,GAAG;QACb,aAAa,EAAE,gBAAgB;QAC/B,WAAW,EAAE,MAAM;QACnB,QAAQ;QACR,eAAe,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE;YACtC,IAAI,KAAK,KAAK,CAAC,EAAE;gBACf,OAAO,MAAM,CAAC,QAAQ,CAAC;aACxB;YAED,IAAI,KAAK,KAAK,WAAW,EAAE;gBACzB,OAAO,MAAM,CAAC,SAAS,CAAC;aACzB;YAED,OAAO,MAAM,CAAC,QAAQ,CAAC;QACzB,CAAC;QACD,mBAAmB;KACpB,CAAC,GAAG,IAAI,CAAC;AACZ,CAAC,CAAC;AArBW,QAAA,OAAO,WAqBlB"}

2
app_vue/node_modules/table/dist/src/drawTable.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import type { TableConfig, Row } from './types/internal';
export declare const drawTable: (rows: Row[], outputColumnWidths: number[], rowHeights: number[], config: TableConfig) => string;

31
app_vue/node_modules/table/dist/src/drawTable.js generated vendored Normal file
View File

@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.drawTable = void 0;
const drawBorder_1 = require("./drawBorder");
const drawContent_1 = require("./drawContent");
const drawRow_1 = require("./drawRow");
const utils_1 = require("./utils");
const drawTable = (rows, outputColumnWidths, rowHeights, config) => {
const { drawHorizontalLine, singleLine, } = config;
const contents = (0, utils_1.groupBySizes)(rows, rowHeights).map((group, groupIndex) => {
return group.map((row) => {
return (0, drawRow_1.drawRow)(row, { ...config,
rowIndex: groupIndex });
}).join('');
});
return (0, drawContent_1.drawContent)({ contents,
drawSeparator: (index, size) => {
// Top/bottom border
if (index === 0 || index === size) {
return drawHorizontalLine(index, size);
}
return !singleLine && drawHorizontalLine(index, size);
},
elementType: 'row',
rowIndex: -1,
separatorGetter: (0, drawBorder_1.createTableBorderGetter)(outputColumnWidths, { ...config,
rowCount: contents.length }),
spanningCellManager: config.spanningCellManager });
};
exports.drawTable = drawTable;
//# sourceMappingURL=drawTable.js.map

1
app_vue/node_modules/table/dist/src/drawTable.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"drawTable.js","sourceRoot":"","sources":["../../src/drawTable.ts"],"names":[],"mappings":";;;AAAA,6CAEsB;AACtB,+CAEuB;AACvB,uCAEmB;AAInB,mCAEiB;AAEV,MAAM,SAAS,GAAG,CAAC,IAAW,EAAE,kBAA4B,EAAE,UAAoB,EAAE,MAAmB,EAAU,EAAE;IACxH,MAAM,EACJ,kBAAkB,EAClB,UAAU,GACX,GAAG,MAAM,CAAC;IAEX,MAAM,QAAQ,GAAG,IAAA,oBAAY,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE;QACxE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YACvB,OAAO,IAAA,iBAAO,EAAC,GAAG,EAAE,EAAC,GAAG,MAAM;gBAC5B,QAAQ,EAAE,UAAU,EAAC,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,OAAO,IAAA,yBAAW,EAAC,EAAC,QAAQ;QAC1B,aAAa,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;YAC7B,oBAAoB;YACpB,IAAI,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI,EAAE;gBACjC,OAAO,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;aACxC;YAED,OAAO,CAAC,UAAU,IAAI,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACxD,CAAC;QACD,WAAW,EAAE,KAAK;QAClB,QAAQ,EAAE,CAAC,CAAC;QACZ,eAAe,EAAE,IAAA,oCAAuB,EAAC,kBAAkB,EAAE,EAAC,GAAG,MAAM;YACrE,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAC,CAAC;QAC7B,mBAAmB,EAAE,MAAM,CAAC,mBAAmB,EAAC,CAAC,CAAC;AACtD,CAAC,CAAC;AA3BW,QAAA,SAAS,aA2BpB"}

View File

@ -0,0 +1,13 @@
declare function validate43(data: any, { instancePath, parentData, parentDataProperty, rootData }?: {
instancePath?: string | undefined;
parentData: any;
parentDataProperty: any;
rootData?: any;
}): boolean;
declare function validate86(data: any, { instancePath, parentData, parentDataProperty, rootData }?: {
instancePath?: string | undefined;
parentData: any;
parentDataProperty: any;
rootData?: any;
}): boolean;
export { validate43 as _config_json, validate86 as _streamConfig_json };

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
import type { BorderConfig } from './types/api';
export declare const getBorderCharacters: (name: string) => BorderConfig;

View File

@ -0,0 +1,105 @@
"use strict";
/* eslint-disable sort-keys-fix/sort-keys-fix */
Object.defineProperty(exports, "__esModule", { value: true });
exports.getBorderCharacters = void 0;
const getBorderCharacters = (name) => {
if (name === 'honeywell') {
return {
topBody: '═',
topJoin: '╤',
topLeft: '╔',
topRight: '╗',
bottomBody: '═',
bottomJoin: '╧',
bottomLeft: '╚',
bottomRight: '╝',
bodyLeft: '║',
bodyRight: '║',
bodyJoin: '│',
headerJoin: '┬',
joinBody: '─',
joinLeft: '╟',
joinRight: '╢',
joinJoin: '┼',
joinMiddleDown: '┬',
joinMiddleUp: '┴',
joinMiddleLeft: '┤',
joinMiddleRight: '├',
};
}
if (name === 'norc') {
return {
topBody: '─',
topJoin: '┬',
topLeft: '┌',
topRight: '┐',
bottomBody: '─',
bottomJoin: '┴',
bottomLeft: '└',
bottomRight: '┘',
bodyLeft: '│',
bodyRight: '│',
bodyJoin: '│',
headerJoin: '┬',
joinBody: '─',
joinLeft: '├',
joinRight: '┤',
joinJoin: '┼',
joinMiddleDown: '┬',
joinMiddleUp: '┴',
joinMiddleLeft: '┤',
joinMiddleRight: '├',
};
}
if (name === 'ramac') {
return {
topBody: '-',
topJoin: '+',
topLeft: '+',
topRight: '+',
bottomBody: '-',
bottomJoin: '+',
bottomLeft: '+',
bottomRight: '+',
bodyLeft: '|',
bodyRight: '|',
bodyJoin: '|',
headerJoin: '+',
joinBody: '-',
joinLeft: '|',
joinRight: '|',
joinJoin: '|',
joinMiddleDown: '+',
joinMiddleUp: '+',
joinMiddleLeft: '+',
joinMiddleRight: '+',
};
}
if (name === 'void') {
return {
topBody: '',
topJoin: '',
topLeft: '',
topRight: '',
bottomBody: '',
bottomJoin: '',
bottomLeft: '',
bottomRight: '',
bodyLeft: '',
bodyRight: '',
bodyJoin: '',
headerJoin: '',
joinBody: '',
joinLeft: '',
joinRight: '',
joinJoin: '',
joinMiddleDown: '',
joinMiddleUp: '',
joinMiddleLeft: '',
joinMiddleRight: '',
};
}
throw new Error('Unknown border template "' + name + '".');
};
exports.getBorderCharacters = getBorderCharacters;
//# sourceMappingURL=getBorderCharacters.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"getBorderCharacters.js","sourceRoot":"","sources":["../../src/getBorderCharacters.ts"],"names":[],"mappings":";AAAA,gDAAgD;;;AAMzC,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAgB,EAAE;IAChE,IAAI,IAAI,KAAK,WAAW,EAAE;QACxB,OAAO;YACL,OAAO,EAAE,GAAG;YACZ,OAAO,EAAE,GAAG;YACZ,OAAO,EAAE,GAAG;YACZ,QAAQ,EAAE,GAAG;YAEb,UAAU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AG;YACb,UAAU,EAAE,GAAG;YAEf,QAAQ,EAAE,GAAG;YACb,QAAQ,EAAE,GAAG;YACb,SAAS,EAAE,GAAG;YACd,QAAQ,EAAE,GAAG;YACb,cAAc,EAAE,GAAG;YACnB,YAAY,EAAE,GAAG;YACjB,cAAc,EAAE,GAAG;YACnB,eAAe,EAAE,GAAG;SACrB,CAAC;KACH;IAED,IAAI,IAAI,KAAK,MAAM,EAAE;QACnB,OAAO;YACL,OAAO,EAAE,EAAE;YACX,OAAO,EAAE,EAAE;YACX,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,EAAE;YAEZ,UAAU,EAAE,EAAE;YACd,UAAU,EAAE,EAAE;YACd,UAAU,EAAE,EAAE;YACd,WAAW,EAAE,EAAE;YAEf,QAAQ,EAAE,EAAE;YACZ,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,EAAE;YAEd,QAAQ,EAAE,EAAE;YACZ,QAAQ,EAAE,EAAE;YACZ,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,EAAE;YACZ,cAAc,EAAE,EAAE;YAClB,YAAY,EAAE,EAAE;YAChB,cAAc,EAAE,EAAE;YAClB,eAAe,EAAE,EAAE;SACpB,CAAC;KACH;IAED,MAAM,IAAI,KAAK,CAAC,2BAA2B,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AAC7D,CAAC,CAAC;AAlHW,QAAA,mBAAmB,uBAkH9B"}

5
app_vue/node_modules/table/dist/src/index.d.ts generated vendored Normal file
View File

@ -0,0 +1,5 @@
import { createStream } from './createStream';
import { getBorderCharacters } from './getBorderCharacters';
import { table } from './table';
export { table, createStream, getBorderCharacters, };
export * from './types/api';

21
app_vue/node_modules/table/dist/src/index.js generated vendored Normal file
View File

@ -0,0 +1,21 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getBorderCharacters = exports.createStream = exports.table = void 0;
const createStream_1 = require("./createStream");
Object.defineProperty(exports, "createStream", { enumerable: true, get: function () { return createStream_1.createStream; } });
const getBorderCharacters_1 = require("./getBorderCharacters");
Object.defineProperty(exports, "getBorderCharacters", { enumerable: true, get: function () { return getBorderCharacters_1.getBorderCharacters; } });
const table_1 = require("./table");
Object.defineProperty(exports, "table", { enumerable: true, get: function () { return table_1.table; } });
__exportStar(require("./types/api"), exports);
//# sourceMappingURL=index.js.map

1
app_vue/node_modules/table/dist/src/index.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,iDAEwB;AAUtB,6FAXA,2BAAY,OAWA;AATd,+DAE+B;AAQ7B,oGATA,yCAAmB,OASA;AAPrB,mCAEiB;AAGf,sFAJA,aAAK,OAIA;AAKP,8CAA4B"}

View File

@ -0,0 +1,3 @@
import type { SpanningCellConfig, TableUserConfig } from './types/api';
import type { Row } from './types/internal';
export declare const injectHeaderConfig: (rows: Row[], config: TableUserConfig) => [Row[], SpanningCellConfig[]];

View File

@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.injectHeaderConfig = void 0;
const injectHeaderConfig = (rows, config) => {
var _a;
let spanningCellConfig = (_a = config.spanningCells) !== null && _a !== void 0 ? _a : [];
const headerConfig = config.header;
const adjustedRows = [...rows];
if (headerConfig) {
spanningCellConfig = spanningCellConfig.map(({ row, ...rest }) => {
return { ...rest,
row: row + 1 };
});
const { content, ...headerStyles } = headerConfig;
spanningCellConfig.unshift({ alignment: 'center',
col: 0,
colSpan: rows[0].length,
paddingLeft: 1,
paddingRight: 1,
row: 0,
wrapWord: false,
...headerStyles });
adjustedRows.unshift([content, ...Array.from({ length: rows[0].length - 1 }).fill('')]);
}
return [adjustedRows,
spanningCellConfig];
};
exports.injectHeaderConfig = injectHeaderConfig;
//# sourceMappingURL=injectHeaderConfig.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"injectHeaderConfig.js","sourceRoot":"","sources":["../../src/injectHeaderConfig.ts"],"names":[],"mappings":";;;AAQO,MAAM,kBAAkB,GAAG,CAAC,IAAW,EAAE,MAAuB,EAAiC,EAAE;;IACxG,IAAI,kBAAkB,GAAG,MAAA,MAAM,CAAC,aAAa,mCAAI,EAAE,CAAC;IACpD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;IACnC,MAAM,YAAY,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IAE/B,IAAI,YAAY,EAAE;QAChB,kBAAkB,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC,EAAC,GAAG,EAAE,GAAG,IAAI,EAAC,EAAE,EAAE;YAC7D,OAAO,EAAC,GAAG,IAAI;gBACb,GAAG,EAAE,GAAG,GAAG,CAAC,EAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,MAAM,EAAC,OAAO,EAAE,GAAG,YAAY,EAAC,GAAG,YAAY,CAAC;QAEhD,kBAAkB,CAAC,OAAO,CAAC,EAAC,SAAS,EAAE,QAAQ;YAC7C,GAAG,EAAE,CAAC;YACN,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM;YACvB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,CAAC;YACf,GAAG,EAAE,CAAC;YACN,QAAQ,EAAE,KAAK;YACf,GAAG,YAAY,EAAC,CAAC,CAAC;QAEpB,YAAY,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC,IAAI,CAAS,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,EAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KAC/F;IAED,OAAO,CAAC,YAAY;QAClB,kBAAkB,CAAC,CAAC;AACxB,CAAC,CAAC;AA3BW,QAAA,kBAAkB,sBA2B7B"}

View File

@ -0,0 +1,3 @@
import type { SpanningCellConfig } from './types/api';
import type { ColumnConfig, RangeConfig } from './types/internal';
export declare const makeRangeConfig: (spanningCellConfig: SpanningCellConfig, columnsConfig: ColumnConfig[]) => RangeConfig;

18
app_vue/node_modules/table/dist/src/makeRangeConfig.js generated vendored Normal file
View File

@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeRangeConfig = void 0;
const utils_1 = require("./utils");
const makeRangeConfig = (spanningCellConfig, columnsConfig) => {
var _a;
const { topLeft, bottomRight } = (0, utils_1.calculateRangeCoordinate)(spanningCellConfig);
const cellConfig = {
...columnsConfig[topLeft.col],
...spanningCellConfig,
paddingRight: (_a = spanningCellConfig.paddingRight) !== null && _a !== void 0 ? _a : columnsConfig[bottomRight.col].paddingRight,
};
return { ...cellConfig,
bottomRight,
topLeft };
};
exports.makeRangeConfig = makeRangeConfig;
//# sourceMappingURL=makeRangeConfig.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"makeRangeConfig.js","sourceRoot":"","sources":["../../src/makeRangeConfig.ts"],"names":[],"mappings":";;;AAMA,mCAEiB;AAEV,MAAM,eAAe,GAAG,CAAC,kBAAsC,EAAE,aAA6B,EAAe,EAAE;;IACpH,MAAM,EAAC,OAAO,EAAE,WAAW,EAAC,GAAG,IAAA,gCAAwB,EAAC,kBAAkB,CAAC,CAAC;IAE5E,MAAM,UAAU,GAA6B;QAC3C,GAAG,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC;QAC7B,GAAG,kBAAkB;QACrB,YAAY,EACV,MAAA,kBAAkB,CAAC,YAAY,mCAC/B,aAAa,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,YAAY;KAC9C,CAAC;IAEF,OAAO,EAAC,GAAG,UAAU;QACnB,WAAW;QACX,OAAO,EAAC,CAAC;AACb,CAAC,CAAC;AAdW,QAAA,eAAe,mBAc1B"}

View File

@ -0,0 +1,7 @@
import type { StreamUserConfig } from './types/api';
import type { StreamConfig } from './types/internal';
/**
* Makes a new configuration object out of the userConfig object
* using default values for the missing configuration properties.
*/
export declare const makeStreamConfig: (config: StreamUserConfig) => StreamConfig;

View File

@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeStreamConfig = void 0;
const utils_1 = require("./utils");
const validateConfig_1 = require("./validateConfig");
/**
* Creates a configuration for every column using default
* values for the missing configuration properties.
*/
const makeColumnsConfig = (columnCount, columns = {}, columnDefault) => {
return Array.from({ length: columnCount }).map((_, index) => {
return {
alignment: 'left',
paddingLeft: 1,
paddingRight: 1,
truncate: Number.POSITIVE_INFINITY,
verticalAlignment: 'top',
wrapWord: false,
...columnDefault,
...columns[index],
};
});
};
/**
* Makes a new configuration object out of the userConfig object
* using default values for the missing configuration properties.
*/
const makeStreamConfig = (config) => {
(0, validateConfig_1.validateConfig)('streamConfig.json', config);
if (config.columnDefault.width === undefined) {
throw new Error('Must provide config.columnDefault.width when creating a stream.');
}
return {
drawVerticalLine: () => {
return true;
},
...config,
border: (0, utils_1.makeBorderConfig)(config.border),
columns: makeColumnsConfig(config.columnCount, config.columns, config.columnDefault),
};
};
exports.makeStreamConfig = makeStreamConfig;
//# sourceMappingURL=makeStreamConfig.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"makeStreamConfig.js","sourceRoot":"","sources":["../../src/makeStreamConfig.ts"],"names":[],"mappings":";;;AASA,mCAEiB;AACjB,qDAE0B;AAE1B;;;GAGG;AACH,MAAM,iBAAiB,GAAG,CAAC,WAAmB,EAC5C,UAAuC,EAAE,EACzC,aAAgD,EAAkB,EAAE;IACpE,OAAO,KAAK,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,WAAW,EAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE;QACxD,OAAO;YACL,SAAS,EAAE,MAAM;YACjB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,CAAC;YACf,QAAQ,EAAE,MAAM,CAAC,iBAAiB;YAClC,iBAAiB,EAAE,KAAK;YACxB,QAAQ,EAAE,KAAK;YACf,GAAG,aAAa;YAChB,GAAG,OAAO,CAAC,KAAK,CAAC;SAClB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;GAGG;AACI,MAAM,gBAAgB,GAAG,CAAC,MAAwB,EAAgB,EAAE;IACzE,IAAA,+BAAc,EAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IAE5C,IAAI,MAAM,CAAC,aAAa,CAAC,KAAK,KAAK,SAAS,EAAE;QAC5C,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAC;KACpF;IAED,OAAO;QACL,gBAAgB,EAAE,GAAG,EAAE;YACrB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,GAAG,MAAM;QACT,MAAM,EAAE,IAAA,wBAAgB,EAAC,MAAM,CAAC,MAAM,CAAC;QACvC,OAAO,EAAE,iBAAiB,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,aAAa,CAAC;KACrF,CAAC;AACJ,CAAC,CAAC;AAfW,QAAA,gBAAgB,oBAe3B"}

View File

@ -0,0 +1,7 @@
import type { SpanningCellConfig, TableUserConfig } from './types/api';
import type { Row, TableConfig } from './types/internal';
/**
* Makes a new configuration object out of the userConfig object
* using default values for the missing configuration properties.
*/
export declare const makeTableConfig: (rows: Row[], config?: TableUserConfig, injectedSpanningCellConfig?: SpanningCellConfig[] | undefined) => TableConfig;

62
app_vue/node_modules/table/dist/src/makeTableConfig.js generated vendored Normal file
View File

@ -0,0 +1,62 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeTableConfig = void 0;
const calculateMaximumColumnWidths_1 = require("./calculateMaximumColumnWidths");
const spanningCellManager_1 = require("./spanningCellManager");
const utils_1 = require("./utils");
const validateConfig_1 = require("./validateConfig");
const validateSpanningCellConfig_1 = require("./validateSpanningCellConfig");
/**
* Creates a configuration for every column using default
* values for the missing configuration properties.
*/
const makeColumnsConfig = (rows, columns, columnDefault, spanningCellConfigs) => {
const columnWidths = (0, calculateMaximumColumnWidths_1.calculateMaximumColumnWidths)(rows, spanningCellConfigs);
return rows[0].map((_, columnIndex) => {
return {
alignment: 'left',
paddingLeft: 1,
paddingRight: 1,
truncate: Number.POSITIVE_INFINITY,
verticalAlignment: 'top',
width: columnWidths[columnIndex],
wrapWord: false,
...columnDefault,
...columns === null || columns === void 0 ? void 0 : columns[columnIndex],
};
});
};
/**
* Makes a new configuration object out of the userConfig object
* using default values for the missing configuration properties.
*/
const makeTableConfig = (rows, config = {}, injectedSpanningCellConfig) => {
var _a, _b, _c, _d, _e;
(0, validateConfig_1.validateConfig)('config.json', config);
(0, validateSpanningCellConfig_1.validateSpanningCellConfig)(rows, (_a = config.spanningCells) !== null && _a !== void 0 ? _a : []);
const spanningCellConfigs = (_b = injectedSpanningCellConfig !== null && injectedSpanningCellConfig !== void 0 ? injectedSpanningCellConfig : config.spanningCells) !== null && _b !== void 0 ? _b : [];
const columnsConfig = makeColumnsConfig(rows, config.columns, config.columnDefault, spanningCellConfigs);
const drawVerticalLine = (_c = config.drawVerticalLine) !== null && _c !== void 0 ? _c : (() => {
return true;
});
const drawHorizontalLine = (_d = config.drawHorizontalLine) !== null && _d !== void 0 ? _d : (() => {
return true;
});
return {
...config,
border: (0, utils_1.makeBorderConfig)(config.border),
columns: columnsConfig,
drawHorizontalLine,
drawVerticalLine,
singleLine: (_e = config.singleLine) !== null && _e !== void 0 ? _e : false,
spanningCellManager: (0, spanningCellManager_1.createSpanningCellManager)({
columnsConfig,
drawHorizontalLine,
drawVerticalLine,
rows,
spanningCellConfigs,
}),
};
};
exports.makeTableConfig = makeTableConfig;
//# sourceMappingURL=makeTableConfig.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"makeTableConfig.js","sourceRoot":"","sources":["../../src/makeTableConfig.ts"],"names":[],"mappings":";;;AAAA,iFAEwC;AACxC,+DAE+B;AAS/B,mCAEiB;AACjB,qDAE0B;AAC1B,6EAEsC;AAEtC;;;GAGG;AACH,MAAM,iBAAiB,GAAG,CAAC,IAAW,EACpC,OAAqC,EACrC,aAAgC,EAChC,mBAA0C,EAAkB,EAAE;IAC9D,MAAM,YAAY,GAAG,IAAA,2DAA4B,EAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAE7E,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,EAAE;QACpC,OAAO;YACL,SAAS,EAAE,MAAM;YACjB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,CAAC;YACf,QAAQ,EAAE,MAAM,CAAC,iBAAiB;YAClC,iBAAiB,EAAE,KAAK;YACxB,KAAK,EAAE,YAAY,CAAC,WAAW,CAAC;YAChC,QAAQ,EAAE,KAAK;YACf,GAAG,aAAa;YAChB,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,WAAW,CAAC;SAC1B,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;GAGG;AAEI,MAAM,eAAe,GAAG,CAAC,IAAW,EAAE,SAA0B,EAAE,EAAE,0BAAiD,EAAe,EAAE;;IAC3I,IAAA,+BAAc,EAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACtC,IAAA,uDAA0B,EAAC,IAAI,EAAE,MAAA,MAAM,CAAC,aAAa,mCAAI,EAAE,CAAC,CAAC;IAE7D,MAAM,mBAAmB,GAAG,MAAA,0BAA0B,aAA1B,0BAA0B,cAA1B,0BAA0B,GAAI,MAAM,CAAC,aAAa,mCAAI,EAAE,CAAC;IAErF,MAAM,aAAa,GAAG,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAAC;IAEzG,MAAM,gBAAgB,GAAG,MAAA,MAAM,CAAC,gBAAgB,mCAAI,CAAC,GAAG,EAAE;QACxD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;IACH,MAAM,kBAAkB,GAAG,MAAA,MAAM,CAAC,kBAAkB,mCAAI,CAAC,GAAG,EAAE;QAC5D,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,MAAM;QACT,MAAM,EAAE,IAAA,wBAAgB,EAAC,MAAM,CAAC,MAAM,CAAC;QACvC,OAAO,EAAE,aAAa;QACtB,kBAAkB;QAClB,gBAAgB;QAChB,UAAU,EAAE,MAAA,MAAM,CAAC,UAAU,mCAAI,KAAK;QACtC,mBAAmB,EAAE,IAAA,+CAAyB,EAAC;YAC7C,aAAa;YACb,kBAAkB;YAClB,gBAAgB;YAChB,IAAI;YACJ,mBAAmB;SACpB,CAAC;KACH,CAAC;AACJ,CAAC,CAAC;AA9BW,QAAA,eAAe,mBA8B1B"}

View File

@ -0,0 +1,4 @@
import type { VerticalAlignment } from './types/api';
import type { BaseConfig, Row } from './types/internal';
export declare const padCellVertically: (lines: string[], rowHeight: number, verticalAlignment: VerticalAlignment) => string[];
export declare const mapDataUsingRowHeights: (unmappedRows: Row[], rowHeights: number[], config: BaseConfig) => Row[];

View File

@ -0,0 +1,52 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mapDataUsingRowHeights = exports.padCellVertically = void 0;
const utils_1 = require("./utils");
const wrapCell_1 = require("./wrapCell");
const createEmptyStrings = (length) => {
return new Array(length).fill('');
};
const padCellVertically = (lines, rowHeight, verticalAlignment) => {
const availableLines = rowHeight - lines.length;
if (verticalAlignment === 'top') {
return [...lines, ...createEmptyStrings(availableLines)];
}
if (verticalAlignment === 'bottom') {
return [...createEmptyStrings(availableLines), ...lines];
}
return [
...createEmptyStrings(Math.floor(availableLines / 2)),
...lines,
...createEmptyStrings(Math.ceil(availableLines / 2)),
];
};
exports.padCellVertically = padCellVertically;
const mapDataUsingRowHeights = (unmappedRows, rowHeights, config) => {
const nColumns = unmappedRows[0].length;
const mappedRows = unmappedRows.map((unmappedRow, unmappedRowIndex) => {
const outputRowHeight = rowHeights[unmappedRowIndex];
const outputRow = Array.from({ length: outputRowHeight }, () => {
return new Array(nColumns).fill('');
});
unmappedRow.forEach((cell, cellIndex) => {
var _a;
const containingRange = (_a = config.spanningCellManager) === null || _a === void 0 ? void 0 : _a.getContainingRange({ col: cellIndex,
row: unmappedRowIndex });
if (containingRange) {
containingRange.extractCellContent(unmappedRowIndex).forEach((cellLine, cellLineIndex) => {
outputRow[cellLineIndex][cellIndex] = cellLine;
});
return;
}
const cellLines = (0, wrapCell_1.wrapCell)(cell, config.columns[cellIndex].width, config.columns[cellIndex].wrapWord);
const paddedCellLines = (0, exports.padCellVertically)(cellLines, outputRowHeight, config.columns[cellIndex].verticalAlignment);
paddedCellLines.forEach((cellLine, cellLineIndex) => {
outputRow[cellLineIndex][cellIndex] = cellLine;
});
});
return outputRow;
});
return (0, utils_1.flatten)(mappedRows);
};
exports.mapDataUsingRowHeights = mapDataUsingRowHeights;
//# sourceMappingURL=mapDataUsingRowHeights.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"mapDataUsingRowHeights.js","sourceRoot":"","sources":["../../src/mapDataUsingRowHeights.ts"],"names":[],"mappings":";;;AAOA,mCAEiB;AACjB,yCAEoB;AAEpB,MAAM,kBAAkB,GAAG,CAAC,MAAc,EAAE,EAAE;IAC5C,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACpC,CAAC,CAAC;AAEK,MAAM,iBAAiB,GAAG,CAAC,KAAe,EAAE,SAAiB,EAAE,iBAAoC,EAAY,EAAE;IACtH,MAAM,cAAc,GAAG,S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CAAC;YAC1B,IAAI,eAAe,EAAE;gBACnB,eAAe,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAE;oBACvF,SAAS,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,GAAG,QAAQ,CAAC;gBACjD,CAAC,CAAC,CAAC;gBAEH,OAAO;aACR;YACD,MAAM,SAAS,GAAG,IAAA,mBAAQ,EAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC;YAEtG,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,SAAS,EAAE,eAAe,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,iBAAiB,CAAC,CAAC;YAEnH,eAAe,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAE;gBAClD,SAAS,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,GAAG,QAAQ,CAAC;YACjD,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,OAAO,IAAA,eAAO,EAAC,UAAU,CAAC,CAAC;AAC7B,CAAC,CAAC;AAhCW,QAAA,sBAAsB,0BAgCjC"}

View File

@ -0,0 +1,3 @@
import type { BaseConfig, Row } from './types/internal';
export declare const padString: (input: string, paddingLeft: number, paddingRight: number) => string;
export declare const padTableData: (rows: Row[], config: BaseConfig) => Row[];

23
app_vue/node_modules/table/dist/src/padTableData.js generated vendored Normal file
View File

@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.padTableData = exports.padString = void 0;
const padString = (input, paddingLeft, paddingRight) => {
return ' '.repeat(paddingLeft) + input + ' '.repeat(paddingRight);
};
exports.padString = padString;
const padTableData = (rows, config) => {
return rows.map((cells, rowIndex) => {
return cells.map((cell, cellIndex) => {
var _a;
const containingRange = (_a = config.spanningCellManager) === null || _a === void 0 ? void 0 : _a.getContainingRange({ col: cellIndex,
row: rowIndex }, { mapped: true });
if (containingRange) {
return cell;
}
const { paddingLeft, paddingRight } = config.columns[cellIndex];
return (0, exports.padString)(cell, paddingLeft, paddingRight);
});
});
};
exports.padTableData = padTableData;
//# sourceMappingURL=padTableData.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"padTableData.js","sourceRoot":"","sources":["../../src/padTableData.ts"],"names":[],"mappings":";;;AAKO,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,WAAmB,EAAE,YAAoB,EAAU,EAAE;IAC5F,OAAO,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AACpE,CAAC,CAAC;AAFW,QAAA,SAAS,aAEpB;AAEK,MAAM,YAAY,GAAG,CAAC,IAAW,EAAE,MAAkB,EAAS,EAAE;IACrE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAClC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;;YACnC,MAAM,eAAe,GAAG,MAAA,MAAM,CAAC,mBAAmB,0CAAE,kBAAkB,CAAC,EAAC,GAAG,EAAE,SAAS;gBACpF,GAAG,EAAE,QAAQ,EAAC,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC;YAClC,IAAI,eAAe,EAAE;gBACnB,OAAO,IAAI,CAAC;aACb;YAED,MAAM,EAAC,WAAW,EAAE,YAAY,EAAC,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YAE9D,OAAO,IAAA,iBAAS,EAAC,IAAI,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAdW,QAAA,YAAY,gBAcvB"}

View File

@ -0,0 +1,95 @@
{
"$id": "config.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"border": {
"$ref": "shared.json#/definitions/borders"
},
"header": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"alignment": {
"$ref": "shared.json#/definitions/alignment"
},
"wrapWord": {
"type": "boolean"
},
"truncate": {
"type": "integer"
},
"paddingLeft": {
"type": "integer"
},
"paddingRight": {
"type": "integer"
}
},
"required": ["content"],
"additionalProperties": false
},
"columns": {
"$ref": "shared.json#/definitions/columns"
},
"columnDefault": {
"$ref": "shared.json#/definitions/column"
},
"drawVerticalLine": {
"typeof": "function"
},
"drawHorizontalLine": {
"typeof": "function"
},
"singleLine": {
"typeof": "boolean"
},
"spanningCells": {
"type": "array",
"items": {
"type": "object",
"properties": {
"col": {
"type": "integer",
"minimum": 0
},
"row": {
"type": "integer",
"minimum": 0
},
"colSpan": {
"type": "integer",
"minimum": 1
},
"rowSpan": {
"type": "integer",
"minimum": 1
},
"alignment": {
"$ref": "shared.json#/definitions/alignment"
},
"verticalAlignment": {
"$ref": "shared.json#/definitions/verticalAlignment"
},
"wrapWord": {
"type": "boolean"
},
"truncate": {
"type": "integer"
},
"paddingLeft": {
"type": "integer"
},
"paddingRight": {
"type": "integer"
}
},
"required": ["row", "col"],
"additionalProperties": false
}
}
},
"additionalProperties": false
}

139
app_vue/node_modules/table/dist/src/schemas/shared.json generated vendored Normal file
View File

@ -0,0 +1,139 @@
{
"$id": "shared.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"columns": {
"oneOf": [
{
"type": "object",
"patternProperties": {
"^[0-9]+$": {
"$ref": "#/definitions/column"
}
},
"additionalProperties": false
},
{
"type": "array",
"items": {
"$ref": "#/definitions/column"
}
}
]
},
"column": {
"type": "object",
"properties": {
"alignment": {
"$ref": "#/definitions/alignment"
},
"verticalAlignment": {
"$ref": "#/definitions/verticalAlignment"
},
"width": {
"type": "integer",
"minimum": 1
},
"wrapWord": {
"type": "boolean"
},
"truncate": {
"type": "integer"
},
"paddingLeft": {
"type": "integer"
},
"paddingRight": {
"type": "integer"
}
},
"additionalProperties": false
},
"borders": {
"type": "object",
"properties": {
"topBody": {
"$ref": "#/definitions/border"
},
"topJoin": {
"$ref": "#/definitions/border"
},
"topLeft": {
"$ref": "#/definitions/border"
},
"topRight": {
"$ref": "#/definitions/border"
},
"bottomBody": {
"$ref": "#/definitions/border"
},
"bottomJoin": {
"$ref": "#/definitions/border"
},
"bottomLeft": {
"$ref": "#/definitions/border"
},
"bottomRight": {
"$ref": "#/definitions/border"
},
"bodyLeft": {
"$ref": "#/definitions/border"
},
"bodyRight": {
"$ref": "#/definitions/border"
},
"bodyJoin": {
"$ref": "#/definitions/border"
},
"headerJoin": {
"$ref": "#/definitions/border"
},
"joinBody": {
"$ref": "#/definitions/border"
},
"joinLeft": {
"$ref": "#/definitions/border"
},
"joinRight": {
"$ref": "#/definitions/border"
},
"joinJoin": {
"$ref": "#/definitions/border"
},
"joinMiddleUp": {
"$ref": "#/definitions/border"
},
"joinMiddleDown": {
"$ref": "#/definitions/border"
},
"joinMiddleLeft": {
"$ref": "#/definitions/border"
},
"joinMiddleRight": {
"$ref": "#/definitions/border"
}
},
"additionalProperties": false
},
"border": {
"type": "string"
},
"alignment": {
"type": "string",
"enum": [
"left",
"right",
"center",
"justify"
]
},
"verticalAlignment": {
"type": "string",
"enum": [
"top",
"middle",
"bottom"
]
}
}
}

View File

@ -0,0 +1,25 @@
{
"$id": "streamConfig.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"border": {
"$ref": "shared.json#/definitions/borders"
},
"columns": {
"$ref": "shared.json#/definitions/columns"
},
"columnDefault": {
"$ref": "shared.json#/definitions/column"
},
"columnCount": {
"type": "integer",
"minimum": 1
},
"drawVerticalLine": {
"typeof": "function"
}
},
"required": ["columnDefault", "columnCount"],
"additionalProperties": false
}

View File

@ -0,0 +1,23 @@
import type { DrawHorizontalLine, DrawVerticalLine, SpanningCellConfig } from './types/api';
import type { CellCoordinates, ColumnConfig, ResolvedRangeConfig, Row } from './types/internal';
export declare type SpanningCellManager = {
getContainingRange: (cell: CellCoordinates, options?: {
mapped: true;
}) => ResolvedRangeConfig | undefined;
inSameRange: (cell1: CellCoordinates, cell2: CellCoordinates) => boolean;
rowHeights: number[];
setRowHeights: (rowHeights: number[]) => void;
rowIndexMapping: number[];
setRowIndexMapping: (mappedRowHeights: number[]) => void;
};
export declare type SpanningCellParameters = {
spanningCellConfigs: SpanningCellConfig[];
rows: Row[];
columnsConfig: ColumnConfig[];
drawVerticalLine: DrawVerticalLine;
drawHorizontalLine: DrawHorizontalLine;
};
export declare type SpanningCellContext = SpanningCellParameters & {
rowHeights: number[];
};
export declare const createSpanningCellManager: (parameters: SpanningCellParameters) => SpanningCellManager;

View File

@ -0,0 +1,95 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createSpanningCellManager = void 0;
const alignSpanningCell_1 = require("./alignSpanningCell");
const calculateSpanningCellWidth_1 = require("./calculateSpanningCellWidth");
const makeRangeConfig_1 = require("./makeRangeConfig");
const utils_1 = require("./utils");
const findRangeConfig = (cell, rangeConfigs) => {
return rangeConfigs.find((rangeCoordinate) => {
return (0, utils_1.isCellInRange)(cell, rangeCoordinate);
});
};
const getContainingRange = (rangeConfig, context) => {
const width = (0, calculateSpanningCellWidth_1.calculateSpanningCellWidth)(rangeConfig, context);
const wrappedContent = (0, alignSpanningCell_1.wrapRangeContent)(rangeConfig, width, context);
const alignedContent = (0, alignSpanningCell_1.alignVerticalRangeContent)(rangeConfig, wrappedContent, context);
const getCellContent = (rowIndex) => {
const { topLeft } = rangeConfig;
const { drawHorizontalLine, rowHeights } = context;
const totalWithinHorizontalBorderHeight = rowIndex - topLeft.row;
const totalHiddenHorizontalBorderHeight = (0, utils_1.sequence)(topLeft.row + 1, rowIndex).filter((index) => {
/* istanbul ignore next */
return !(drawHorizontalLine === null || drawHorizontalLine === void 0 ? void 0 : drawHorizontalLine(index, rowHeights.length));
}).length;
const offset = (0, utils_1.sumArray)(rowHeights.slice(topLeft.row, rowIndex)) + totalWithinHorizontalBorderHeight - totalHiddenHorizontalBorderHeight;
return alignedContent.slice(offset, offset + rowHeights[rowIndex]);
};
const getBorderContent = (borderIndex) => {
const { topLeft } = rangeConfig;
const offset = (0, utils_1.sumArray)(context.rowHeights.slice(topLeft.row, borderIndex)) + (borderIndex - topLeft.row - 1);
return alignedContent[offset];
};
return {
...rangeConfig,
extractBorderContent: getBorderContent,
extractCellContent: getCellContent,
height: wrappedContent.length,
width,
};
};
const inSameRange = (cell1, cell2, ranges) => {
const range1 = findRangeConfig(cell1, ranges);
const range2 = findRangeConfig(cell2, ranges);
if (range1 && range2) {
return (0, utils_1.areCellEqual)(range1.topLeft, range2.topLeft);
}
return false;
};
const hashRange = (range) => {
const { row, col } = range.topLeft;
return `${row}/${col}`;
};
const createSpanningCellManager = (parameters) => {
const { spanningCellConfigs, columnsConfig } = parameters;
const ranges = spanningCellConfigs.map((config) => {
return (0, makeRangeConfig_1.makeRangeConfig)(config, columnsConfig);
});
const rangeCache = {};
let rowHeights = [];
let rowIndexMapping = [];
return { getContainingRange: (cell, options) => {
var _a;
const originalRow = (options === null || options === void 0 ? void 0 : options.mapped) ? rowIndexMapping[cell.row] : cell.row;
const range = findRangeConfig({ ...cell,
row: originalRow }, ranges);
if (!range) {
return undefined;
}
if (rowHeights.length === 0) {
return getContainingRange(range, { ...parameters,
rowHeights });
}
const hash = hashRange(range);
(_a = rangeCache[hash]) !== null && _a !== void 0 ? _a : (rangeCache[hash] = getContainingRange(range, { ...parameters,
rowHeights }));
return rangeCache[hash];
},
inSameRange: (cell1, cell2) => {
return inSameRange(cell1, cell2, ranges);
},
rowHeights,
rowIndexMapping,
setRowHeights: (_rowHeights) => {
rowHeights = _rowHeights;
},
setRowIndexMapping: (mappedRowHeights) => {
rowIndexMapping = (0, utils_1.flatten)(mappedRowHeights.map((height, index) => {
return Array.from({ length: height }, () => {
return index;
});
}));
} };
};
exports.createSpanningCellManager = createSpanningCellManager;
//# sourceMappingURL=spanningCellManager.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"spanningCellManager.js","sourceRoot":"","sources":["../../src/spanningCellManager.ts"],"names":[],"mappings":";;;AAAA,2DAE6B;AAC7B,6EAEsC;AACtC,uDAE2B;AAa3B,mCAIiB;AAuBjB,MAAM,eAAe,GAAG,CAAC,IAAqB,EAAE,YAA2B,EAA2B,EAAE;IACtG,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE;QAC3C,OAAO,IAAA,qBAAa,EAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,WAAwB,EAAE,OAA4B,EAAmC,EAAE;IACrH,MAAM,KAAK,GAAG,IAAA,uDAA0B,EAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAE/D,MAAM,cAAc,GAAG,IAAA,oCAAgB,EAAC,WAAW,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IAErE,MAAM,cAAc,GAAG,IAAA,6CAAyB,EAAC,WAAW,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IAEvF,MAAM,cAAc,GAAG,CAAC,QAAgB,EAAE,EAAE;QAC1C,MAAM,EAAC,OAAO,EAAC,GAAG,WAAW,CAAC;QAC9B,MAAM,EAAC,kBAAkB,EAAE,UAAU,EAAC,GAAG,OAAO,CAAC;QAEjD,MAAM,iCAAiC,GAAG,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;QACjE,MAAM,iCAAiC,GAAG,IAAA,gBAAQ,EAAC,OAAO,CAAC,GAAG,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;YAC7F,0BAA0B;YAC1B,OAAO,CAAC,CAA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,CAAC,CAAC;YAC9B,MAAA,UAAU,CAAC,IAAI,qCAAf,UAAU,CAAC,IAAI,IAAM,kBAAkB,CAAC,KAAK,EAAE,EAAC,GAAG,UAAU;gBAC3D,UAAU,EAAC,CAAC,EAAC;YAEf,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QACD,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YAC5B,OAAO,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QAC3C,CAAC;QACD,UAAU;QACV,eAAe;QACf,aAAa,EAAE,CAAC,WAAqB,EAAE,EAAE;YACvC,UAAU,GAAG,WAAW,CAAC;QAC3B,CAAC;QACD,kBAAkB,EAAE,CAAC,gBAA0B,EAAE,EAAE;YACjD,eAAe,GAAG,IAAA,eAAO,EAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;gBAC/D,OAAO,KAAK,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,MAAM,EAAC,EAAE,GAAG,EAAE;oBACvC,OAAO,KAAK,CAAC;gBACf,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC,CAAC;QACN,CAAC,EAAC,CAAC;AACL,CAAC,CAAC;AA9CW,QAAA,yBAAyB,6BA8CpC"}

View File

@ -0,0 +1,2 @@
import type { Row } from './types/internal';
export declare const stringifyTableData: (rows: ReadonlyArray<readonly unknown[]>) => Row[];

View File

@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.stringifyTableData = void 0;
const utils_1 = require("./utils");
const stringifyTableData = (rows) => {
return rows.map((cells) => {
return cells.map((cell) => {
return (0, utils_1.normalizeString)(String(cell));
});
});
};
exports.stringifyTableData = stringifyTableData;
//# sourceMappingURL=stringifyTableData.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"stringifyTableData.js","sourceRoot":"","sources":["../../src/stringifyTableData.ts"],"names":[],"mappings":";;;AAGA,mCAEiB;AAEV,MAAM,kBAAkB,GAAG,CAAC,IAAuC,EAAS,EAAE;IACnF,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACxB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACxB,OAAO,IAAA,uBAAe,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AANW,QAAA,kBAAkB,sBAM7B"}

2
app_vue/node_modules/table/dist/src/table.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import type { TableUserConfig } from './types/api';
export declare const table: (data: ReadonlyArray<readonly unknown[]>, userConfig?: TableUserConfig) => string;

32
app_vue/node_modules/table/dist/src/table.js generated vendored Normal file
View File

@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.table = void 0;
const alignTableData_1 = require("./alignTableData");
const calculateOutputColumnWidths_1 = require("./calculateOutputColumnWidths");
const calculateRowHeights_1 = require("./calculateRowHeights");
const drawTable_1 = require("./drawTable");
const injectHeaderConfig_1 = require("./injectHeaderConfig");
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 utils_1 = require("./utils");
const validateTableData_1 = require("./validateTableData");
const table = (data, userConfig = {}) => {
(0, validateTableData_1.validateTableData)(data);
let rows = (0, stringifyTableData_1.stringifyTableData)(data);
const [injectedRows, injectedSpanningCellConfig] = (0, injectHeaderConfig_1.injectHeaderConfig)(rows, userConfig);
const config = (0, makeTableConfig_1.makeTableConfig)(injectedRows, userConfig, injectedSpanningCellConfig);
rows = (0, truncateTableData_1.truncateTableData)(injectedRows, (0, utils_1.extractTruncates)(config));
const rowHeights = (0, calculateRowHeights_1.calculateRowHeights)(rows, config);
config.spanningCellManager.setRowHeights(rowHeights);
config.spanningCellManager.setRowIndexMapping(rowHeights);
rows = (0, mapDataUsingRowHeights_1.mapDataUsingRowHeights)(rows, rowHeights, config);
rows = (0, alignTableData_1.alignTableData)(rows, config);
rows = (0, padTableData_1.padTableData)(rows, config);
const outputColumnWidths = (0, calculateOutputColumnWidths_1.calculateOutputColumnWidths)(config);
return (0, drawTable_1.drawTable)(rows, outputColumnWidths, rowHeights, config);
};
exports.table = table;
//# sourceMappingURL=table.js.map

1
app_vue/node_modules/table/dist/src/table.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"table.js","sourceRoot":"","sources":["../../src/table.ts"],"names":[],"mappings":";;;AAAA,qDAE0B;AAC1B,+EAEuC;AACvC,+DAE+B;AAC/B,2CAEqB;AACrB,6DAE8B;AAC9B,uDAE2B;AAC3B,qEAEkC;AAClC,iDAEwB;AACxB,6DAE8B;AAC9B,2DAE6B;AAI7B,mCAEiB;AACjB,2DAE6B;AAEtB,MAAM,KAAK,GAAG,CAAC,IAAuC,EAAE,aAA8B,EAAE,EAAU,EAAE;IACzG,IAAA,qCAAiB,EAAC,IAAI,CAAC,CAAC;IAExB,IAAI,IAAI,GAAG,IAAA,uCAAkB,EAAC,IAAI,CAAC,CAAC;IAEpC,MAAM,CAAC,YAAY,EAAE,0BAA0B,CAAC,GAAG,IAAA,uCAAkB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAExF,MAAM,MAAM,GAAG,IAAA,iCAAe,EAAC,YAAY,EAAE,UAAU,EAAE,0BAA0B,CAAC,CAAC;IAErF,IAAI,GAAG,IAAA,qCAAiB,EAAC,YAAY,EAAE,IAAA,wBAAgB,EAAC,MAAM,CAAC,CAAC,CAAC;IAEjE,MAAM,UAAU,GAAG,IAAA,yCAAmB,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAErD,MAAM,CAAC,mBAAmB,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACrD,MAAM,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAE1D,IAAI,GAAG,IAAA,+CAAsB,EAAC,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IACxD,IAAI,GAAG,IAAA,+BAAc,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACpC,IAAI,GAAG,IAAA,2BAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAElC,MAAM,kBAAkB,GAAG,IAAA,yDAA2B,EAAC,MAAM,CAAC,CAAC;IAE/D,OAAO,IAAA,qBAAS,EAAC,IAAI,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC,CAAC;AAvBW,QAAA,KAAK,SAuBhB"}

View File

@ -0,0 +1,6 @@
import type { Row } from './types/internal';
export declare const truncateString: (input: string, length: number) => string;
/**
* @todo Make it work with ASCII content.
*/
export declare const truncateTableData: (rows: Row[], truncates: number[]) => Row[];

View File

@ -0,0 +1,24 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.truncateTableData = exports.truncateString = void 0;
const lodash_truncate_1 = __importDefault(require("lodash.truncate"));
const truncateString = (input, length) => {
return (0, lodash_truncate_1.default)(input, { length,
omission: '…' });
};
exports.truncateString = truncateString;
/**
* @todo Make it work with ASCII content.
*/
const truncateTableData = (rows, truncates) => {
return rows.map((cells) => {
return cells.map((cell, cellIndex) => {
return (0, exports.truncateString)(cell, truncates[cellIndex]);
});
});
};
exports.truncateTableData = truncateTableData;
//# sourceMappingURL=truncateTableData.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"truncateTableData.js","sourceRoot":"","sources":["../../src/truncateTableData.ts"],"names":[],"mappings":";;;;;;AAAA,sEAAuC;AAKhC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,MAAc,EAAU,EAAE;IACtE,OAAO,IAAA,yBAAQ,EAAC,KAAK,EAAE,EAAC,MAAM;QAC5B,QAAQ,EAAE,GAAG,EAAC,CAAC,CAAC;AACpB,CAAC,CAAC;AAHW,QAAA,cAAc,kBAGzB;AAEF;;GAEG;AACI,MAAM,iBAAiB,GAAG,CAAC,IAAW,EAAE,SAAmB,EAAS,EAAE;IAC3E,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACxB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;YACnC,OAAO,IAAA,sBAAc,EAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AANW,QAAA,iBAAiB,qBAM5B"}

130
app_vue/node_modules/table/dist/src/types/api.d.ts generated vendored Normal file
View File

@ -0,0 +1,130 @@
export declare type DrawLinePredicate = (index: number, size: number) => boolean;
export declare type DrawVerticalLine = DrawLinePredicate;
export declare type DrawHorizontalLine = DrawLinePredicate;
export declare type BorderUserConfig = {
readonly topLeft?: string;
readonly topRight?: string;
readonly topBody?: string;
readonly topJoin?: string;
readonly bottomLeft?: string;
readonly bottomRight?: string;
readonly bottomBody?: string;
readonly bottomJoin?: string;
readonly joinLeft?: string;
readonly joinRight?: string;
readonly joinBody?: string;
readonly joinJoin?: string;
readonly joinMiddleUp?: string;
readonly joinMiddleDown?: string;
readonly joinMiddleLeft?: string;
readonly joinMiddleRight?: string;
readonly headerJoin?: string;
readonly bodyRight?: string;
readonly bodyLeft?: string;
readonly bodyJoin?: string;
};
export declare type BorderConfig = Required<BorderUserConfig>;
export declare type Alignment = 'center' | 'justify' | 'left' | 'right';
export declare type VerticalAlignment = 'bottom' | 'middle' | 'top';
export declare type CellUserConfig = {
/**
* Cell content horizontal alignment (default: left)
*/
readonly alignment?: Alignment;
/**
* Cell content vertical alignment (default: top)
*/
readonly verticalAlignment?: VerticalAlignment;
/**
* Number of characters are which the content will be truncated (default: Infinity)
*/
readonly truncate?: number;
/**
* Cell content padding width left (default: 1)
*/
readonly paddingLeft?: number;
/**
* Cell content padding width right (default: 1)
*/
readonly paddingRight?: number;
/**
* If true, the text is broken at the nearest space or one of the special characters: "\|/_.,;-"
*/
readonly wrapWord?: boolean;
};
export declare type ColumnUserConfig = CellUserConfig & {
/**
* Column width (default: auto calculation based on the cell content)
*/
readonly width?: number;
};
/**
* @deprecated Use spanning cell API instead
*/
export declare type HeaderUserConfig = Omit<ColumnUserConfig, 'verticalAlignment' | 'width'> & {
readonly content: string;
};
export declare type BaseUserConfig = {
/**
* Custom border
*/
readonly border?: BorderUserConfig;
/**
* Default values for all columns. Column specific settings overwrite the default values.
*/
readonly columnDefault?: ColumnUserConfig;
/**
* Column specific configuration.
*/
readonly columns?: Indexable<ColumnUserConfig>;
/**
* Used to tell whether to draw a vertical line.
* This callback is called for each non-content line of the table.
* The default behavior is to always return true.
*/
readonly drawVerticalLine?: DrawVerticalLine;
};
export declare type TableUserConfig = BaseUserConfig & {
/**
* The header configuration
*/
readonly header?: HeaderUserConfig;
/**
* 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.
*/
readonly drawHorizontalLine?: DrawHorizontalLine;
/**
* Horizontal lines inside the table are not drawn.
*/
readonly singleLine?: boolean;
readonly spanningCells?: SpanningCellConfig[];
};
export declare type SpanningCellConfig = CellUserConfig & {
readonly row: number;
readonly col: number;
readonly rowSpan?: number;
readonly colSpan?: number;
};
export declare type StreamUserConfig = BaseUserConfig & {
/**
* The number of columns
*/
readonly columnCount: number;
/**
* Default values for all columns. Column specific settings overwrite the default values.
*/
readonly columnDefault: ColumnUserConfig & {
/**
* The default width for each column
*/
readonly width: number;
};
};
export declare type WritableStream = {
readonly write: (rows: string[]) => void;
};
export declare type Indexable<T> = {
readonly [index: number]: T;
};

3
app_vue/node_modules/table/dist/src/types/api.js generated vendored Normal file
View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=api.js.map

1
app_vue/node_modules/table/dist/src/types/api.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/types/api.ts"],"names":[],"mappings":""}

View File

@ -0,0 +1 @@
export {};

View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=internal.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/types/internal.ts"],"names":[],"mappings":""}

9
app_vue/node_modules/table/dist/src/utils.d.ts generated vendored Normal file
View File

@ -0,0 +1,9 @@
import type { SpanningCellConfig } from './types/api';
import type { BaseConfig, CellCoordinates, RangeCoordinate } from './types/internal';
export declare const sequence: (start: number, end: number) => number[];
export declare const sumArray: (array: number[]) => number;
export declare const extractTruncates: (config: BaseConfig) => number[];
export declare const flatten: <T>(array: T[][]) => T[];
export declare const calculateRangeCoordinate: (spanningCellConfig: SpanningCellConfig) => RangeCoordinate;
export declare const areCellEqual: (cell1: CellCoordinates, cell2: CellCoordinates) => boolean;
export declare const isCellInRange: (cell: CellCoordinates, { topLeft, bottomRight }: RangeCoordinate) => boolean;

134
app_vue/node_modules/table/dist/src/utils.js generated vendored Normal file
View File

@ -0,0 +1,134 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.isCellInRange = exports.areCellEqual = exports.calculateRangeCoordinate = exports.flatten = exports.extractTruncates = exports.sumArray = exports.sequence = exports.distributeUnevenly = exports.countSpaceSequence = exports.groupBySizes = exports.makeBorderConfig = exports.splitAnsi = exports.normalizeString = void 0;
const slice_ansi_1 = __importDefault(require("slice-ansi"));
const string_width_1 = __importDefault(require("string-width"));
const strip_ansi_1 = __importDefault(require("strip-ansi"));
const getBorderCharacters_1 = require("./getBorderCharacters");
/**
* Converts Windows-style newline to Unix-style
*
* @internal
*/
const normalizeString = (input) => {
return input.replace(/\r\n/g, '\n');
};
exports.normalizeString = normalizeString;
/**
* Splits ansi string by newlines
*
* @internal
*/
const splitAnsi = (input) => {
const lengths = (0, strip_ansi_1.default)(input).split('\n').map(string_width_1.default);
const result = [];
let startIndex = 0;
lengths.forEach((length) => {
result.push(length === 0 ? '' : (0, slice_ansi_1.default)(input, startIndex, startIndex + length));
// Plus 1 for the newline character itself
startIndex += length + 1;
});
return result;
};
exports.splitAnsi = splitAnsi;
/**
* Merges user provided border characters with the default border ("honeywell") characters.
*
* @internal
*/
const makeBorderConfig = (border) => {
return {
...(0, getBorderCharacters_1.getBorderCharacters)('honeywell'),
...border,
};
};
exports.makeBorderConfig = makeBorderConfig;
/**
* Groups the array into sub-arrays by sizes.
*
* @internal
* @example
* groupBySizes(['a', 'b', 'c', 'd', 'e'], [2, 1, 2]) = [ ['a', 'b'], ['c'], ['d', 'e'] ]
*/
const groupBySizes = (array, sizes) => {
let startIndex = 0;
return sizes.map((size) => {
const group = array.slice(startIndex, startIndex + size);
startIndex += size;
return group;
});
};
exports.groupBySizes = groupBySizes;
/**
* Counts the number of continuous spaces in a string
*
* @internal
* @example
* countGroupSpaces('a bc de f') = 3
*/
const countSpaceSequence = (input) => {
var _a, _b;
return (_b = (_a = input.match(/\s+/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
};
exports.countSpaceSequence = countSpaceSequence;
/**
* Creates the non-increasing number array given sum and length
* whose the difference between maximum and minimum is not greater than 1
*
* @internal
* @example
* distributeUnevenly(6, 3) = [2, 2, 2]
* distributeUnevenly(8, 3) = [3, 3, 2]
*/
const distributeUnevenly = (sum, length) => {
const result = Array.from({ length }).fill(Math.floor(sum / length));
return result.map((element, index) => {
return element + (index < sum % length ? 1 : 0);
});
};
exports.distributeUnevenly = distributeUnevenly;
const sequence = (start, end) => {
return Array.from({ length: end - start + 1 }, (_, index) => {
return index + start;
});
};
exports.sequence = sequence;
const sumArray = (array) => {
return array.reduce((accumulator, element) => {
return accumulator + element;
}, 0);
};
exports.sumArray = sumArray;
const extractTruncates = (config) => {
return config.columns.map(({ truncate }) => {
return truncate;
});
};
exports.extractTruncates = extractTruncates;
const flatten = (array) => {
return [].concat(...array);
};
exports.flatten = flatten;
const calculateRangeCoordinate = (spanningCellConfig) => {
const { row, col, colSpan = 1, rowSpan = 1 } = spanningCellConfig;
return { bottomRight: { col: col + colSpan - 1,
row: row + rowSpan - 1 },
topLeft: { col,
row } };
};
exports.calculateRangeCoordinate = calculateRangeCoordinate;
const areCellEqual = (cell1, cell2) => {
return cell1.row === cell2.row && cell1.col === cell2.col;
};
exports.areCellEqual = areCellEqual;
const isCellInRange = (cell, { topLeft, bottomRight }) => {
return (topLeft.row <= cell.row &&
cell.row <= bottomRight.row &&
topLeft.col <= cell.col &&
cell.col <= bottomRight.col);
};
exports.isCellInRange = isCellInRange;
//# sourceMappingURL=utils.js.map

1
app_vue/node_modules/table/dist/src/utils.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA+B;AAC/B,gEAAuC;AACvC,4DAAmC;AACnC,+DAE+B;AAY/B;;;;GAIG;AACI,MAAM,eAAe,GAAG,CAAC,KAAa,EAAU,EAAE;IACvD,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACtC,CAAC,CAAC;AAFW,QAAA,eAAe,mBAE1B;AAEF;;;;GAIG;AACI,MAAM,SAAS,GAAG,CAAC,KAAa,EAAY,EAAE;IACnD,MAAM,OAAO,GAAG,IAAA,oBAAS,EAAC,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,sBAAW,CAAC,CAAC;IAE9D,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,UAAU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AAM,OAAO,GAAG,CAAI,KAAY,EAAO,EAAE;IAC9C,OAAQ,EAAU,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC;AACtC,CAAC,CAAC;AAFW,QAAA,OAAO,WAElB;AAEK,MAAM,wBAAwB,GAAG,CAAC,kBAAsC,EAAmB,EAAE;IAClG,MAAM,EAAC,GAAG,EAAE,GAAG,EAAE,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC,EAAC,GAAG,kBAAkB,CAAC;IAEhE,OAAO,EAAC,WAAW,EAAE,EAAC,GAAG,EAAE,GAAG,GAAG,OAAO,GAAG,CAAC;YAC1C,GAAG,EAAE,GAAG,GAAG,OAAO,GAAG,CAAC,EAAC;QACzB,OAAO,EAAE,EAAC,GAAG;YACX,GAAG,EAAC,EAAC,CAAC;AACV,CAAC,CAAC;AAPW,QAAA,wBAAwB,4BAOnC;AAEK,MAAM,YAAY,GAAG,CAAC,KAAsB,EAAE,KAAsB,EAAW,EAAE;IACtF,OAAO,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,CAAC;AAC5D,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB;AAEK,MAAM,aAAa,GAAG,CAAC,IAAqB,EAAE,EAAC,OAAO,EAAE,WAAW,EAAkB,EAAW,EAAE;IACvG,OAAO,CACL,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG;QACvB,IAAI,CAAC,GAAG,IAAI,WAAW,CAAC,GAAG;QAC3B,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG;QACvB,IAAI,CAAC,GAAG,IAAI,WAAW,CAAC,GAAG,CAC5B,CAAC;AACJ,CAAC,CAAC;AAPW,QAAA,aAAa,iBAOxB"}

View File

@ -0,0 +1,2 @@
import type { TableUserConfig } from './types/api';
export declare const validateConfig: (schemaId: 'config.json' | 'streamConfig.json', config: TableUserConfig) => void;

27
app_vue/node_modules/table/dist/src/validateConfig.js generated vendored Normal file
View File

@ -0,0 +1,27 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateConfig = void 0;
const validators_1 = __importDefault(require("./generated/validators"));
const validateConfig = (schemaId, config) => {
const validate = validators_1.default[schemaId];
if (!validate(config) && validate.errors) {
// eslint-disable-next-line promise/prefer-await-to-callbacks
const errors = validate.errors.map((error) => {
return {
message: error.message,
params: error.params,
schemaPath: error.schemaPath,
};
});
/* eslint-disable no-console */
console.log('config', config);
console.log('errors', errors);
/* eslint-enable no-console */
throw new Error('Invalid config.');
}
};
exports.validateConfig = validateConfig;
//# sourceMappingURL=validateConfig.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"validateConfig.js","sourceRoot":"","sources":["../../src/validateConfig.ts"],"names":[],"mappings":";;;;;;AAIA,wEAAgD;AAKzC,MAAM,cAAc,GAAG,CAAC,QAA6C,EAAE,MAAuB,EAAQ,EAAE;IAC7G,MAAM,QAAQ,GAAG,oBAAU,CAAC,QAAQ,CAAqB,CAAC;IAC1D,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,MAAM,EAAE;QACxC,6DAA6D;QAC7D,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAkB,EAAE,EAAE;YACxD,OAAO;gBACL,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,UAAU,EAAE,KAAK,CAAC,UAAU;aAC7B,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,+BAA+B;QAC/B,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC9B,8BAA8B;QAE9B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;KACpC;AACH,CAAC,CAAC;AAnBW,QAAA,cAAc,kBAmBzB"}

View File

@ -0,0 +1,3 @@
import type { SpanningCellConfig } from './types/api';
import type { Row } from './types/internal';
export declare const validateSpanningCellConfig: (rows: Row[], configs: SpanningCellConfig[]) => void;

View File

@ -0,0 +1,46 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateSpanningCellConfig = void 0;
const utils_1 = require("./utils");
const inRange = (start, end, value) => {
return start <= value && value <= end;
};
const validateSpanningCellConfig = (rows, configs) => {
const [nRow, nCol] = [rows.length, rows[0].length];
configs.forEach((config, configIndex) => {
const { colSpan, rowSpan } = config;
if (colSpan === undefined && rowSpan === undefined) {
throw new Error(`Expect at least colSpan or rowSpan is provided in config.spanningCells[${configIndex}]`);
}
if (colSpan !== undefined && colSpan < 1) {
throw new Error(`Expect colSpan is not equal zero, instead got: ${colSpan} in config.spanningCells[${configIndex}]`);
}
if (rowSpan !== undefined && rowSpan < 1) {
throw new Error(`Expect rowSpan is not equal zero, instead got: ${rowSpan} in config.spanningCells[${configIndex}]`);
}
});
const rangeCoordinates = configs.map(utils_1.calculateRangeCoordinate);
rangeCoordinates.forEach(({ topLeft, bottomRight }, rangeIndex) => {
if (!inRange(0, nCol - 1, topLeft.col) ||
!inRange(0, nRow - 1, topLeft.row) ||
!inRange(0, nCol - 1, bottomRight.col) ||
!inRange(0, nRow - 1, bottomRight.row)) {
throw new Error(`Some cells in config.spanningCells[${rangeIndex}] are out of the table`);
}
});
const configOccupy = Array.from({ length: nRow }, () => {
return Array.from({ length: nCol });
});
rangeCoordinates.forEach(({ topLeft, bottomRight }, rangeIndex) => {
(0, utils_1.sequence)(topLeft.row, bottomRight.row).forEach((row) => {
(0, utils_1.sequence)(topLeft.col, bottomRight.col).forEach((col) => {
if (configOccupy[row][col] !== undefined) {
throw new Error(`Spanning cells in config.spanningCells[${configOccupy[row][col]}] and config.spanningCells[${rangeIndex}] are overlap each other`);
}
configOccupy[row][col] = rangeIndex;
});
});
});
};
exports.validateSpanningCellConfig = validateSpanningCellConfig;
//# sourceMappingURL=validateSpanningCellConfig.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"validateSpanningCellConfig.js","sourceRoot":"","sources":["../../src/validateSpanningCellConfig.ts"],"names":[],"mappings":";;;AAMA,mCAGiB;AAEjB,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,KAAa,EAAE,EAAE;IAC5D,OAAO,KAAK,IAAI,KAAK,IAAI,KAAK,IAAI,GAAG,CAAC;AACxC,CAAC,CAAC;AAEK,MAAM,0BAA0B,GAAG,CAAC,IAAW,EAAE,OAA6B,EAAQ,EAAE;IAC7F,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAEnD,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE;QACtC,MAAM,EAAC,OAAO,EAAE,OAAO,EAAC,GAAG,MAAM,CAAC;QAClC,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,EAAE;YAClD,MAAM,IAAI,KAAK,CAAC,0EAA0E,WAAW,GAAG,CAAC,CAAC;SAC3G;QACD,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,GAAG,CAAC,EAAE;YACxC,MAAM,IAAI,KAAK,CAAC,kDAAkD,OAAO,4BAA4B,WAAW,GAAG,CAAC,CAAC;SACtH;QACD,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,GAAG,CAAC,EAAE;YACxC,MAAM,IAAI,KAAK,CAAC,kDAAkD,OAAO,4BAA4B,WAAW,GAAG,CAAC,CAAC;SACtH;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,gCAAwB,CAAC,CAAC;IAE/D,gBAAgB,CAAC,OAAO,CAAC,CA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D,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC;YACtC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAzCW,QAAA,0BAA0B,8BAyCrC"}

View File

@ -0,0 +1 @@
export declare const validateTableData: (rows: ReadonlyArray<readonly unknown[]>) => void;

View File

@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateTableData = void 0;
const utils_1 = require("./utils");
const validateTableData = (rows) => {
if (!Array.isArray(rows)) {
throw new TypeError('Table data must be an array.');
}
if (rows.length === 0) {
throw new Error('Table must define at least one row.');
}
if (rows[0].length === 0) {
throw new Error('Table must define at least one column.');
}
const columnNumber = rows[0].length;
for (const row of rows) {
if (!Array.isArray(row)) {
throw new TypeError('Table row data must be an array.');
}
if (row.length !== columnNumber) {
throw new Error('Table must have a consistent number of cells.');
}
for (const cell of row) {
// eslint-disable-next-line no-control-regex
if (/[\u0001-\u0006\u0008\u0009\u000B-\u001A]/.test((0, utils_1.normalizeString)(String(cell)))) {
throw new Error('Table data must not contain control characters.');
}
}
}
};
exports.validateTableData = validateTableData;
//# sourceMappingURL=validateTableData.js.map

Some files were not shown because too many files have changed in this diff Show More