(invalidationContext: InvalidationContext<O>)
| 134 | } |
| 135 | |
| 136 | update(invalidationContext: InvalidationContext<O>): void { |
| 137 | let newCollection = this.virtualizer!.collection as TableCollection<T>; |
| 138 | |
| 139 | // If columnWidths were provided via layoutOptions, update those. |
| 140 | // Otherwise, calculate column widths ourselves. |
| 141 | if (invalidationContext.layoutOptions?.columnWidths) { |
| 142 | for (const [key, val] of invalidationContext.layoutOptions.columnWidths) { |
| 143 | if (this.columnWidths.get(key) !== val) { |
| 144 | this.columnWidths = invalidationContext.layoutOptions.columnWidths; |
| 145 | invalidationContext.sizeChanged = true; |
| 146 | break; |
| 147 | } |
| 148 | } |
| 149 | } else if ( |
| 150 | invalidationContext.sizeChanged || |
| 151 | this.columnsChanged(newCollection, this.lastCollection) |
| 152 | ) { |
| 153 | let columnLayout = new TableColumnLayout({}); |
| 154 | this.columnWidths = columnLayout.buildColumnWidths( |
| 155 | this.virtualizer!.size.width - this.padding * 2, |
| 156 | newCollection, |
| 157 | new Map() |
| 158 | ); |
| 159 | invalidationContext.sizeChanged = true; |
| 160 | } |
| 161 | |
| 162 | super.update(invalidationContext); |
| 163 | } |
| 164 | |
| 165 | protected buildCollection(): LayoutNode[] { |
| 166 | this.stickyColumnIndices = []; |
nothing calls this directly
no test coverage detected