mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-02-03 06:34:05 +00:00
readme. comments. temporary workaround for non-autoPadding list-table.
This commit is contained in:
parent
8793be5562
commit
b067845242
16
README.md
16
README.md
@ -1068,22 +1068,22 @@ A stylized table of text elements.
|
|||||||
|
|
||||||
- inherits all from Box.
|
- inherits all from Box.
|
||||||
- __setRows/setData(rows)__ - set rows in table. array of arrays of strings.
|
- __setRows/setData(rows)__ - set rows in table. array of arrays of strings.
|
||||||
```
|
``` js
|
||||||
table.setData([
|
table.setData([
|
||||||
[ 'Animals', 'Foods' ],
|
[ 'Animals', 'Foods' ],
|
||||||
[ 'Elephant', 'Apple' ],
|
[ 'Elephant', 'Apple' ],
|
||||||
[ 'Bird', 'Orange' ]
|
[ 'Bird', 'Orange' ]
|
||||||
]);
|
]);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
#### ListTable (from Box)
|
#### ListTable (from List)
|
||||||
|
|
||||||
A stylized table of text elements with a list.
|
A stylized table of text elements with a list.
|
||||||
|
|
||||||
##### Options:
|
##### Options:
|
||||||
|
|
||||||
- inherits all from Box.
|
- inherits all from List.
|
||||||
- __rows/data__ - array of array of strings representing rows.
|
- __rows/data__ - array of array of strings representing rows.
|
||||||
- __pad__ - spaces to attempt to pad on the sides of each cell. `2` by default:
|
- __pad__ - spaces to attempt to pad on the sides of each cell. `2` by default:
|
||||||
one space on each side.
|
one space on each side.
|
||||||
@ -1092,23 +1092,23 @@ A stylized table of text elements with a list.
|
|||||||
|
|
||||||
##### Properties:
|
##### Properties:
|
||||||
|
|
||||||
- inherits all from Box.
|
- inherits all from List.
|
||||||
|
|
||||||
##### Events:
|
##### Events:
|
||||||
|
|
||||||
- inherits all from Box.
|
- inherits all from List.
|
||||||
|
|
||||||
##### Methods:
|
##### Methods:
|
||||||
|
|
||||||
- inherits all from Box.
|
- inherits all from Box.
|
||||||
- __setRows/setData(rows)__ - set rows in table. array of arrays of strings.
|
- __setRows/setData(rows)__ - set rows in table. array of arrays of strings.
|
||||||
```
|
``` js
|
||||||
table.setData([
|
table.setData([
|
||||||
[ 'Animals', 'Foods' ],
|
[ 'Animals', 'Foods' ],
|
||||||
[ 'Elephant', 'Apple' ],
|
[ 'Elephant', 'Apple' ],
|
||||||
[ 'Bird', 'Orange' ]
|
[ 'Bird', 'Orange' ]
|
||||||
]);
|
]);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
#### Terminal (from Box)
|
#### Terminal (from Box)
|
||||||
|
@ -3272,6 +3272,15 @@ Element.prototype._getShrinkBox = function(xi, xl, yi, yl, get) {
|
|||||||
xl = mxl;
|
xl = mxl;
|
||||||
if (!this.screen.autoPadding) {
|
if (!this.screen.autoPadding) {
|
||||||
xl += this.padding.left + this.padding.right;
|
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 {
|
} else {
|
||||||
//xl += this.padding.right;
|
//xl += this.padding.right;
|
||||||
xl += this.iright;
|
xl += this.iright;
|
||||||
@ -4659,6 +4668,7 @@ List.prototype.appendItem = function(item) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if (this.shrink) {
|
// if (this.shrink) {
|
||||||
|
// XXX NOTE: Maybe just do this on all shrinkage once autoPadding is default?
|
||||||
if (this.shrink && this.options.normalShrink) {
|
if (this.shrink && this.options.normalShrink) {
|
||||||
delete options.right;
|
delete options.right;
|
||||||
options.width = 'shrink';
|
options.width = 'shrink';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user