( optionIndex: number, options: QueryList<MatOption>, optionGroups: QueryList<MatOptgroup>, )
| 298 | * @docs-private |
| 299 | */ |
| 300 | export function _countGroupLabelsBeforeOption( |
| 301 | optionIndex: number, |
| 302 | options: QueryList<MatOption>, |
| 303 | optionGroups: QueryList<MatOptgroup>, |
| 304 | ): number { |
| 305 | if (optionGroups.length) { |
| 306 | let optionsArray = options.toArray(); |
| 307 | let groups = optionGroups.toArray(); |
| 308 | let groupCounter = 0; |
| 309 | |
| 310 | for (let i = 0; i < optionIndex + 1; i++) { |
| 311 | if (optionsArray[i].group && optionsArray[i].group === groups[groupCounter]) { |
| 312 | groupCounter++; |
| 313 | } |
| 314 | } |
| 315 | |
| 316 | return groupCounter; |
| 317 | } |
| 318 | |
| 319 | return 0; |
| 320 | } |
| 321 | |
| 322 | /** |
| 323 | * Determines the position to which to scroll a panel in order for an option to be into view. |
no outgoing calls
no test coverage detected