<div [@routerTransition]>
 
    <div class="kt-content  kt-grid__item kt-grid__item--fluid kt-grid kt-grid--hor">
        <div class="kt-subheader kt-grid__item">
            <div [class]="containerClass">
                <div class="kt-subheader__main">
                    <h3 class="kt-subheader__title">
                        <span>{{"OrderStatusType" | localize}}</span>
                    </h3>
                    <span class="kt-subheader__separator kt-subheader__separator--v"></span>
                    <span class="kt-subheader__desc">
                        {{"OrderStatusTypeManagement" | localize}}
                    </span>
                </div>
                <div class="kt-subheader__toolbar">
                    <div class="kt-subheader__wrapper">
                        <button (click)="createOrderStatuType()" *ngIf="isGranted('Pages.Orders.OrderStatusTypes.Create')" class="btn btn-primary btn-primary btn-elevate btn-pill"><i class="fa fa-plus"></i> {{"OrderStatusTypeCreate" | localize}}</button>
                    </div>
                </div>
            </div>
        </div>
        <div [class]="containerClass + ' kt-grid__item kt-grid__item--fluid'">
            <div class="kt-portlet kt-portlet--mobile">
                <div class="kt-portlet__body">

                    <form (submit)="getOrderStatusTypes()" autocomplete="off" class="kt-form" >
                        <div class="row align-items-center mb-4">
                            <div class="col-md-12">
                                <div class="kt-searchbar">
                                    <div class="kt-input-icon kt-input-icon--right">
                                        <input [(ngModel)]="filterText" name="filterText" autoFocus class="form-control m-input" [placeholder]="l('SearchWithThreeDot')" type="text">
                                        <span class="kt-input-icon__icon kt-input-icon__icon--right">
                                            <span class="" id="basic-addon1"><i class="flaticon-search"></i></span>
                                        </span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>

                    <div class="row align-items-center">
                        <!--<Primeng-TurboTable-Start>-->
                        <div class="col-xl-12">
                            <div class="primeng-datatable-container"
                                >
                                <p-table #dataTable
                                        (onLazyLoad)="getOrderStatusTypes($event)"
                                        [value]="primengTableHelper.records"
                                        rows="{{primengTableHelper.defaultRecordsCountPerPage}}"
                                        [paginator]="false"
                                        [lazy]="true"
                                        [scrollable]="true"
                                        ScrollWidth="100%"
                                        [responsive]="primengTableHelper.isResponsive"
                                        [resizableColumns]="primengTableHelper.resizableColumns">
                                    <ng-template pTemplate="header">
                                        <tr>
                                            <th style="width: 130px" >{{'Actions' | localize}}</th>
                                            <th style="width: 150px" pSortableColumn="id">
                                                {{'Id' | localize}}
                                                <p-sortIcon field="id"></p-sortIcon>
                                            </th>
                                            <th style="width: 150px" pSortableColumn="code">
                                                {{'Code' | localize}}
                                                <p-sortIcon field="code"></p-sortIcon>
                                            </th>
                                            <th style="width: 150px" pSortableColumn="description">
                                                {{'Description' | localize}}
                                                <p-sortIcon field="description"></p-sortIcon>
                                            </th>
                                            <th style="width: 250px" pSortableColumn="sortOrder">
                                                {{'SortOrder' | localize}}
                                                <p-sortIcon field="sortOrder"></p-sortIcon>
                                            </th>
                                        </tr>
                                    </ng-template>
                                    <ng-template pTemplate="body" let-record="$implicit">
                                        <tr>
                                            <td style="width: 130px"
                                                [hidden]="!isGrantedAny('Pages.Orders.OrderStatusTypes.Create', 'Pages.Orders.OrderStatusTypes.Update', 'Pages.Orders.OrderStatusTypes.Delete')">
                                                <div class="btn-group dropdown" dropdown container="body">
                                                    <button dropdownToggle class="dropdown-toggle btn btn-sm btn-primary btn-elevate btn-brand btn-pill">
                                                        <i class="fa fa-cog"></i><span class="caret"></span> {{"Actions" | localize}}
                                                    </button>
                                                    <ul class="dropdown-menu" *dropdownMenu>
                                                        <li>
                                                            <a href="javascript:;" *ngIf="'Pages.Orders.OrderStatusTypes.Update' | permission"
                                                            (click)="updateOrderStatuTypeModal.show(record)">{{'Edit' | localize}}</a>
                                                        </li>
                                                        <li>
                                                            <a href="javascript:;" *ngIf="'Pages.Orders.OrderStatusTypes.Update' | permission"
                                                            (click)="deleteOrderStatusType(record)">{{'Delete' | localize}}</a>
                                                        </li>
                                                    </ul>
                                                </div>
                                            </td>
                                            <td style="width: 150px">
                                                <span class="ui-column-title"> {{'Id' | localize}}</span>
                                                {{record.id}}
                                            </td>
                                            <td style="width: 150px">
                                                <span class="ui-column-title"> {{'Code' | localize}}</span>
                                                {{record.code}}
                                            </td>
                                            <td style="width: 150px">
                                                <span class="ui-column-title"> {{'Description' | localize}}</span>
                                                {{record.description}}
                                            </td>
                                            <td style="width: 250px">
                                                <span class="ui-column-title"> {{'SortOrder' | localize}}</span>
                                                {{record.sortOrder}}
                                            </td>
                                        </tr>
                                    </ng-template>
                                </p-table>
                                <div class="primeng-no-data" *ngIf="primengTableHelper.totalRecordsCount == 0">
                                    {{'NoData' | localize}}
                                </div>
                                <div class="primeng-paging-container">
                                    <p-paginator [rows]="primengTableHelper.defaultRecordsCountPerPage"
                                                #paginator
                                                (onPageChange)="getOrderStatusTypes($event)"
                                                [totalRecords]="primengTableHelper.totalRecordsCount"
                                                [rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage">

                                    </p-paginator>
                                    <span class="total-records-count">
                                        {{'TotalRecordsCount' | localize:primengTableHelper.totalRecordsCount}}
                                    </span>
                                </div>
                            </div>
                        </div>
                        <!--<Primeng-TurboTable-End>-->
                    </div>
                </div>
            </div>
        </div>

    <createOrderStatuTypeModal #createOrderStatuTypeModal (modalSave)="getOrderStatusTypes()"></createOrderStatuTypeModal>
    <updateOrderStatuTypeModal #updateOrderStatuTypeModal></updateOrderStatuTypeModal>
    </div>  
</div>
