@@ -21,6 +21,7 @@ import {customElement, property} from 'lit/decorators.js';
2121
2222import { BatchSelection } from './batch_selection' ;
2323import { Entry } from './entry' ;
24+ import { dispatch , EventType } from './events' ;
2425import { State } from './state' ;
2526
2627/** Component displaying filtered images in a table. */
@@ -44,6 +45,24 @@ export class FilteredImagesUi extends LitElement {
4445
4546 override render ( ) {
4647 const batch = this . batchSelection . batch ;
48+ let rows = batch . rows ;
49+ let truncatedRows = html `` ;
50+ if ( ! this . state . showAllRows && rows . length > 100 ) {
51+ const onDisplayHiddenRow = ( ) => {
52+ this . state . showAllRows = true ;
53+ dispatch ( EventType . SETTINGS_CHANGED ) ;
54+ this . requestUpdate ( ) ;
55+ } ;
56+ truncatedRows = html `
57+ <tr>
58+ <td @click = ${ onDisplayHiddenRow }
59+ colspan= ${ batch . fields . length } class= "hiddenRow" >
60+ ${ rows . length - 100 } hidden rows . Click to expand .
61+ </ td>
62+ </ tr> ` ;
63+ rows = rows . slice ( 0 , 100 ) ;
64+ }
65+
4766 return html `
4867 <div class= "horizontalFlex" >
4968 <div id= "imageChip" >
@@ -71,7 +90,8 @@ export class FilteredImagesUi extends LitElement {
7190 ( field ) => html `<th title= "${ field . description } " > ${
7291 field . displayName } </ th> `) }
7392 </ tr>
74- ${ batch . rows . map ( ( row , rowIndex ) => this . renderRow ( row , rowIndex ) ) }
93+ ${ rows . map ( ( row , rowIndex ) => this . renderRow ( row , rowIndex ) ) }
94+ ${ truncatedRows }
7595 </ table>
7696 </ div> ` ;
7797 }
@@ -151,6 +171,15 @@ export class FilteredImagesUi extends LitElement {
151171 color : grey;
152172 }
153173
174+ .hiddenRow {
175+ color : grey;
176+ font-style : italic;
177+ text-align : center;
178+ }
179+ .hiddenRow : hover {
180+ cursor : pointer;
181+ }
182+
154183 a {
155184 text-decoration : none;
156185 }
0 commit comments