Guest User

Untitled

a guest
Feb 23rd, 2024
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 5.73 KB | Source Code | 0 0
  1. <div>
  2.  
  3.     <!-- Toolbar -->
  4.     <div *ngIf="this.showToolbar"
  5.        class="list-view-toolbar d-flex justify-content-between">
  6.  
  7.         <div class="list-view-toolbar-left">
  8.             <search-textbox *ngIf="this.showSearch"
  9.                (onChanged)="this.onSearch($event);">
  10.             </search-textbox>
  11.             <ng-content select="[list-view-toolbar-left]"></ng-content>
  12.         </div>
  13.  
  14.         <div class="list-view-toolbar-center">
  15.             <ng-content select="[list-view-toolbar-center]"></ng-content>
  16.         </div>
  17.  
  18.         <div class="list-view-toolbar-right">
  19.             <ng-content select="[list-view-toolbar-right]"></ng-content>
  20.         </div>
  21.        
  22.     </div>
  23.  
  24.     <!-- Content -->
  25.     <div>
  26.  
  27.         <table class="table align-middle mb-0"
  28.            [ngClass]="{
  29.                'table-hover': this.hover,
  30.                'table-sm': this.small
  31.            }">
  32.  
  33.             <!-- Header Row -->
  34.             <thead *ngIf="this.showHeaderRow">
  35.                 <tr>
  36.                     <th *ngIf="this.isMultiSelect"
  37.                        class="select-column">
  38.                         <input
  39.                            class="form-check-input"
  40.                            type="checkbox"
  41.                            [checked]="this.allDisplayedRecordsAreSelected"
  42.                            (change)="this.toggleAllDisplayedRecordsSelected();" />
  43.                     </th>
  44.                     <th *ngFor="let column of this.displayedColumns"
  45.                        scope="col">
  46.                         <i *ngIf="column.icon"
  47.                            class="me-1"
  48.                            [ngClass]="column.icon">
  49.                         </i>
  50.                         <span *ngIf="column.label">{{column.label}}</span>
  51.                         <span *ngIf="column.isSortable !== false"
  52.                            class="sort-icon"
  53.                            (click)="this.onSort(column);">
  54.                         </span>
  55.                     </th>
  56.                     <th *ngIf="this.actions"
  57.                        class="text-end">
  58.                         <span>Actions</span>
  59.                     </th>
  60.                 </tr>
  61.             </thead>
  62.  
  63.             <tbody>
  64.  
  65.                 <tr *ngFor="let record of this.displayedRecords$ | async"
  66.                    [ngClass]="{
  67.                        'table-active': this.isRecordSelected(record),
  68.                        'table-secondary': !this.isRecordSelectable(record)
  69.                    }"
  70.                    (click)="this.onRecordClicked.emit(record);">
  71.  
  72.                     <td *ngIf="this.isMultiSelect"
  73.                        class="select-column">
  74.                         <input
  75.                            class="form-check-input"
  76.                            type="checkbox"
  77.                            [checked]="this.isRecordSelected(record)"
  78.                            [disabled]="!this.isRecordSelectable(record)"
  79.                            (click)="this.toggleRecordSelected(record, $event);" />
  80.                     </td>
  81.  
  82.                     <td *ngFor="let column of this.displayedColumns">
  83.                         <span *ngIf="column.renderSimple">{{column.renderSimple(record)}}</span>
  84.                         <ng-container *ngIf="column.renderComplex"
  85.                            [ngTemplateOutlet]="column.renderComplex()"
  86.                            [ngTemplateOutletContext]="{record: record}">
  87.                         </ng-container>
  88.                     </td>
  89.  
  90.                     <td *ngIf="this.actions"
  91.                        class="text-end">
  92.                         <div class="btn-group">
  93.                             <button *ngFor="let action of this.actions"
  94.                                class="btn btn-sm"
  95.                                type="button"
  96.                                [ngClass]="{
  97.                                    'btn-primary': action.style === 'primary',
  98.                                    'btn-danger': action.style === 'danger'
  99.                                }"
  100.                                (click)="action.click(record);">
  101.                                 <i *ngIf="action.icon"
  102.                                    [ngClass]="action.icon">
  103.                                 </i>
  104.                                 <span *ngIf="action.label"
  105.                                    class="ms-1">
  106.                                     {{action.label}}
  107.                                 </span>
  108.                             </button>
  109.                         </div>
  110.                     </td>
  111.  
  112.                 </tr>
  113.  
  114.                 <!-- No Records Found -->
  115.                 <tr *ngIf="this.displayedRecordCount < 1">
  116.                     <td [attr.colspan]="this.displayedColumns.length + (this.isMultiSelect ? 1 : 0) + (this.actions ? 1 : 0)">
  117.                         <span>No records were found.</span>
  118.                     </td>
  119.                 </tr>
  120.  
  121.             </tbody>
  122.        
  123.         </table>
  124.  
  125.     </div>
  126.  
  127.     <!-- Status Bar -->
  128.     <div *ngIf="this.showStatusBar"
  129.        class="list-view-status-bar d-flex justify-content-between">
  130.        
  131.         <div class="list-view-status-bar-left">
  132.             <p *ngIf="this.showSummary"
  133.                class="mb-0">
  134.                 <span>Displaying {{this.displayedRecordCount}} of {{this.totalRecordCount}}</span>
  135.             </p>
  136.             <ng-content select="[list-view-status-bar-left]"></ng-content>
  137.         </div>
  138.  
  139.         <div class="list-view-status-bar-center">
  140.             <ng-content select="[list-view-status-bar-center]"></ng-content>
  141.         </div>
  142.  
  143.         <div class="list-view-status-bar-right">
  144.             <ng-content select="[list-view-status-bar-right]"></ng-content>
  145.         </div>
  146.  
  147.     </div>
  148.  
  149. </div>
Advertisement
Add Comment
Please, Sign In to add comment