* Calculate what the z-index should be for the element, depending on what directions (top, * bottom, left, right) have been set. It should be true that elements with a top direction * should have the highest index since these are elements like a table header. If any of those * elements are
(element: HTMLElement)
| 411 | * elements. |
| 412 | */ |
| 413 | _getCalculatedZIndex(element: HTMLElement): string { |
| 414 | const zIndexIncrements = { |
| 415 | top: 100, |
| 416 | bottom: 10, |
| 417 | left: 1, |
| 418 | right: 1, |
| 419 | }; |
| 420 | |
| 421 | let zIndex = 0; |
| 422 | // Use `Iterable` instead of `Array` because TypeScript, as of 3.6.3, |
| 423 | // loses the array generic type in the `for of`. But we *also* have to use `Array` because |
| 424 | // typescript won't iterate over an `Iterable` unless you compile with `--downlevelIteration` |
| 425 | for (const dir of STICKY_DIRECTIONS as Iterable<StickyDirection> & StickyDirection[]) { |
| 426 | if (element.style[dir]) { |
| 427 | zIndex += zIndexIncrements[dir]; |
| 428 | } |
| 429 | } |
| 430 | |
| 431 | return zIndex ? `${zIndex}` : ''; |
| 432 | } |
| 433 | |
| 434 | /** Gets the widths for each cell in the provided row. */ |
| 435 | _getCellWidths(row: HTMLElement, recalculateCellWidths = true): number[] { |
no outgoing calls
no test coverage detected