(columns, fixed)
| 13 | } |
| 14 | |
| 15 | reset(columns, fixed) { |
| 16 | this._columns = columns.map(column => { |
| 17 | let width = column.width; |
| 18 | if (column.resizable) { |
| 19 | // don't reset column's `width` if `width` prop doesn't change |
| 20 | const idx = this._origColumns.findIndex(x => x.key === column.key); |
| 21 | if (idx >= 0 && this._origColumns[idx].width === column.width) { |
| 22 | width = this._columns[idx].width; |
| 23 | } |
| 24 | } |
| 25 | return { ...column, width }; |
| 26 | }); |
| 27 | this._origColumns = columns; |
| 28 | this._fixed = fixed; |
| 29 | this._cached = {}; |
| 30 | this._columnStyles = this.recomputeColumnStyles(); |
| 31 | } |
| 32 | |
| 33 | resetCache() { |
| 34 | this._cached = {}; |
no test coverage detected