( tabView: View, nativeScriptChildrenNodes: JSONObject[] = [], sourceRoot = "", )
| 1445 | } |
| 1446 | |
| 1447 | function nativeScriptTabItems( |
| 1448 | tabView: View, |
| 1449 | nativeScriptChildrenNodes: JSONObject[] = [], |
| 1450 | sourceRoot = "", |
| 1451 | ): JSONObject[] { |
| 1452 | const rawItems = nsArray( |
| 1453 | read(tabView, "items") || |
| 1454 | read(tabView, "_items") || |
| 1455 | read(tabView, "_tabItems"), |
| 1456 | ); |
| 1457 | const children = nativeScriptChildren(tabView); |
| 1458 | const count = Math.max( |
| 1459 | rawItems.length, |
| 1460 | children.length, |
| 1461 | nativeScriptChildrenNodes.length, |
| 1462 | ); |
| 1463 | return Array.from({ length: count }, (_, index) => { |
| 1464 | const child = children[index] ?? null; |
| 1465 | const childNode = nativeScriptChildrenNodes[index] ?? {}; |
| 1466 | const item = |
| 1467 | rawItems[index] || |
| 1468 | read(child, "tabItem") || |
| 1469 | read(child, "_tabItem") || |
| 1470 | {}; |
| 1471 | return { |
| 1472 | title: |
| 1473 | stringValue(read(item, "title")) || stringValue(read(child, "title")), |
| 1474 | iconSource: |
| 1475 | stringValue(read(item, "iconSource")) || |
| 1476 | stringValue(read(child, "iconSource")), |
| 1477 | view: read(item, "view") || child, |
| 1478 | sourceLocation: |
| 1479 | sourceLocationForView(item, sourceRoot) || |
| 1480 | sourceLocationForView(child, sourceRoot) || |
| 1481 | sourceLocationFromNode(childNode), |
| 1482 | }; |
| 1483 | }); |
| 1484 | } |
| 1485 | |
| 1486 | function tabItemSourceLocation( |
| 1487 | tabView: View, |
no test coverage detected