mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-24 01:38:54 +00:00
readme. comments. temporary workaround for non-autoPadding list-table.
This commit is contained in:
parent
8793be5562
commit
b067845242
36
README.md
36
README.md
@ -1068,22 +1068,22 @@ A stylized table of text elements.
|
||||
|
||||
- inherits all from Box.
|
||||
- __setRows/setData(rows)__ - set rows in table. array of arrays of strings.
|
||||
```
|
||||
table.setData([
|
||||
[ 'Animals', 'Foods' ],
|
||||
[ 'Elephant', 'Apple' ],
|
||||
[ 'Bird', 'Orange' ]
|
||||
]);
|
||||
```
|
||||
``` js
|
||||
table.setData([
|
||||
[ 'Animals', 'Foods' ],
|
||||
[ 'Elephant', 'Apple' ],
|
||||
[ 'Bird', 'Orange' ]
|
||||
]);
|
||||
```
|
||||
|
||||
|
||||
#### ListTable (from Box)
|
||||
#### ListTable (from List)
|
||||
|
||||
A stylized table of text elements with a list.
|
||||
|
||||
##### Options:
|
||||
|
||||
- inherits all from Box.
|
||||
- inherits all from List.
|
||||
- __rows/data__ - array of array of strings representing rows.
|
||||
- __pad__ - spaces to attempt to pad on the sides of each cell. `2` by default:
|
||||
one space on each side.
|
||||
@ -1092,23 +1092,23 @@ A stylized table of text elements with a list.
|
||||
|
||||
##### Properties:
|
||||
|
||||
- inherits all from Box.
|
||||
- inherits all from List.
|
||||
|
||||
##### Events:
|
||||
|
||||
- inherits all from Box.
|
||||
- inherits all from List.
|
||||
|
||||
##### Methods:
|
||||
|
||||
- inherits all from Box.
|
||||
- __setRows/setData(rows)__ - set rows in table. array of arrays of strings.
|
||||
```
|
||||
table.setData([
|
||||
[ 'Animals', 'Foods' ],
|
||||
[ 'Elephant', 'Apple' ],
|
||||
[ 'Bird', 'Orange' ]
|
||||
]);
|
||||
```
|
||||
``` js
|
||||
table.setData([
|
||||
[ 'Animals', 'Foods' ],
|
||||
[ 'Elephant', 'Apple' ],
|
||||
[ 'Bird', 'Orange' ]
|
||||
]);
|
||||
```
|
||||
|
||||
|
||||
#### Terminal (from Box)
|
||||
|
@ -3272,6 +3272,15 @@ Element.prototype._getShrinkBox = function(xi, xl, yi, yl, get) {
|
||||
xl = mxl;
|
||||
if (!this.screen.autoPadding) {
|
||||
xl += this.padding.left + this.padding.right;
|
||||
// XXX Temporary workaround until we decide to make autoPadding default.
|
||||
// See widget-listtable.js for an example of why this is necessary.
|
||||
// XXX Maybe just to this for all this being that this would affect
|
||||
// width shrunken normal shrunken lists as well.
|
||||
// if (this._isList) {
|
||||
if (this.type === 'list-table') {
|
||||
xl -= this.padding.left + this.padding.right;
|
||||
xl += this.iright;
|
||||
}
|
||||
} else {
|
||||
//xl += this.padding.right;
|
||||
xl += this.iright;
|
||||
@ -4659,6 +4668,7 @@ List.prototype.appendItem = function(item) {
|
||||
}
|
||||
|
||||
// if (this.shrink) {
|
||||
// XXX NOTE: Maybe just do this on all shrinkage once autoPadding is default?
|
||||
if (this.shrink && this.options.normalShrink) {
|
||||
delete options.right;
|
||||
options.width = 'shrink';
|
||||
|
Loading…
x
Reference in New Issue
Block a user