(itemsDomRefs: Array<TabInStrip | TabSeparatorInStrip>, containerWidth: number, selectedItemWidth: number, startIndex = 0)
| 1263 | } |
| 1264 | |
| 1265 | _findLastVisibleItem(itemsDomRefs: Array<TabInStrip | TabSeparatorInStrip>, containerWidth: number, selectedItemWidth: number, startIndex = 0) { |
| 1266 | let lastVisibleIndex = startIndex - 1; |
| 1267 | let index = startIndex; |
| 1268 | |
| 1269 | for (; index < itemsDomRefs.length; index++) { |
| 1270 | const itemWidth = this._getItemWidth(itemsDomRefs[index]); |
| 1271 | |
| 1272 | if (containerWidth < selectedItemWidth + itemWidth) { |
| 1273 | break; |
| 1274 | } |
| 1275 | |
| 1276 | selectedItemWidth += itemWidth; |
| 1277 | lastVisibleIndex = index; |
| 1278 | } |
| 1279 | |
| 1280 | // if prev item is separator - hide it |
| 1281 | const prevItem = itemsDomRefs[index - 1]; |
| 1282 | if (prevItem && prevItem.realTabReference.isSeparator) { |
| 1283 | lastVisibleIndex -= 1; |
| 1284 | } |
| 1285 | |
| 1286 | return lastVisibleIndex; |
| 1287 | } |
| 1288 | |
| 1289 | get isModeStartAndEnd() { |
| 1290 | return this.overflowMode === OverflowMode.StartAndEnd; |
no test coverage detected