]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/eg2/src/app/share/grid/grid-body.component.html
LP1916754 Angular Grid row index shows > 99
[working/Evergreen.git] / Open-ILS / src / eg2 / src / app / share / grid / grid-body.component.html
1 <!-- uses dropdown menu CSS for easy stying, but it's not a dropdown -->
2 <ng-template #contextMenu let-gridContext="gridContext">
3   <eg-grid-toolbar-actions-menu [gridContext]="gridContext">
4   </eg-grid-toolbar-actions-menu>
5 </ng-template>
6
7 <!--
8   tabindex=1 so the grid body can capture keyboard events.
9 -->
10 <div class="eg-grid-body" tabindex="1" (keydown)="onGridKeyDown($event)">
11   <div role="row" class="eg-grid-row eg-grid-body-row {{context.rowClassCallback(row)}}"
12     [ngClass]="{'selected': context.rowSelector.contains(context.getRowIndex(row))}"
13     *ngFor="let row of context.dataSource.getPageOfRows(context.pager); let idx = index">
14
15     <ng-container *ngIf="!context.disableSelect">
16       <div class="eg-grid-cell eg-grid-checkbox-cell eg-grid-cell-skinny">
17         <input type='checkbox' [(ngModel)]="context.rowSelector.indexes[context.getRowIndex(row)]"
18           i18n-aria-label="e.g. Row 13" attr.aria-label="Row {{context.pager.rowNumber(idx)}}"
19           #rowContextMenu="ngbPopover"
20           popoverTitle="Actions for Selected Rows" i18n-popoverTitle
21           (contextmenu)="onRowContextClick($event, row, rowContextMenu)"
22           [ngbPopover]="contextMenu"
23           placement="right"
24           triggers="manual">
25       </div>
26     </ng-container>
27     <div class="eg-grid-cell eg-grid-number-cell eg-grid-cell-skinny-2">
28       {{context.pager.rowNumber(idx)}}
29     </div>
30     <div *ngIf="context.rowFlairIsEnabled" class="eg-grid-cell eg-grid-flair-cell">
31       <!-- using *ngIf allows us to assign the flair callback to a value,
32             obviating the need for multiple calls of the same function -->
33       <ng-container *ngIf="context.rowFlairCallback(row); let flair">
34         <ng-container *ngIf="flair.icon">
35           <!-- tooltip is disabled when no title is set -->
36           <span class="material-icons"
37             ngbTooltip="{{flair.title || ''}}" triggers="mouseenter:mouseleave">
38             {{flair.icon}}
39           </span>
40         </ng-container>
41       </ng-container>
42     </div>
43     <!-- contextMenu applied to cells instead of rows so the position
44          of the popover is close to the mouse.  As of writing, no way
45          to position the popover at the mouse -->
46     <div role="gridcell" class="eg-grid-cell eg-grid-body-cell"
47       [ngStyle]="{flex:col.flex}"
48       [ngClass]="{'eg-grid-cell-overflow': context.overflowCells}"
49       (dblclick)="onRowDblClick(row)"
50       (click)="onRowClick($event, row, idx)"
51       #rowContextMenu="ngbPopover"
52       popoverTitle="Actions for Selected Rows" i18n-popoverTitle
53       (contextmenu)="onRowContextClick($event, row, rowContextMenu)"
54       [ngbPopover]="contextMenu"
55       placement="bottom"
56       triggers="manual"
57       *ngFor="let col of context.columnSet.displayColumns()">
58
59       <eg-grid-body-cell [context]="context" [row]="row" [column]="col">
60       </eg-grid-body-cell>
61     </div>
62   </div>
63 </div>
64