( props: RelationshipInHtmlTableProps & HtmlTableProps, )
| 110 | }; |
| 111 | |
| 112 | export const RelationshipInHtmlTable = ( |
| 113 | props: RelationshipInHtmlTableProps & HtmlTableProps, |
| 114 | ): JSXElement => { |
| 115 | const resolvedRelationships = useRelationshipsOrRelationshipsById( |
| 116 | () => props.relationships, |
| 117 | ); |
| 118 | const details = createMemo(() => |
| 119 | getRelationshipsStoreTableIds( |
| 120 | resolvedRelationships(), |
| 121 | props.relationshipId, |
| 122 | ), |
| 123 | ); |
| 124 | const localCellIds = useDottedCellIds( |
| 125 | () => details()[2], |
| 126 | () => details()[1], |
| 127 | ); |
| 128 | const remoteCellIds = useDottedCellIds( |
| 129 | () => details()[3], |
| 130 | () => details()[1], |
| 131 | ); |
| 132 | const cellIds = createMemo(() => [...localCellIds(), ...remoteCellIds()]); |
| 133 | const cells = useCells( |
| 134 | cellIds, |
| 135 | () => props.customCells, |
| 136 | () => (props.editable ? EditableCellView : CellView), |
| 137 | ); |
| 138 | const rowIds = useRowIds( |
| 139 | () => details()[2] as Id, |
| 140 | () => details()[1], |
| 141 | ); |
| 142 | const content = () => { |
| 143 | const [relationships, store, localTableId, remoteTableId] = details(); |
| 144 | const params = getParams( |
| 145 | props.idColumn ?? true, |
| 146 | cells, |
| 147 | localTableId, |
| 148 | remoteTableId, |
| 149 | props.relationshipId, |
| 150 | relationships, |
| 151 | store, |
| 152 | props.extraCellsBefore, |
| 153 | props.extraCellsAfter, |
| 154 | ); |
| 155 | return ( |
| 156 | <table class={props.className}> |
| 157 | {isFalse(props.headerRow) ? null : ( |
| 158 | <thead> |
| 159 | <tr> |
| 160 | {extraHeaders(props.extraCellsBefore)} |
| 161 | {isFalse(props.idColumn) ? null : ( |
| 162 | <> |
| 163 | <th>{localTableId}.Id</th> |
| 164 | <th>{remoteTableId}.Id</th> |
| 165 | </> |
| 166 | )} |
| 167 | {objToArray(cells(), (cell) => ( |
| 168 | <th>{cell.label}</th> |
| 169 | ))} |
nothing calls this directly
no test coverage detected
searching dependent graphs…