<div bsModal #createOrEditModal="bs-modal" (onShown)="onShown()" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="createOrEditModal" aria-hidden="true" [config]="{backdrop: 'static', keyboard: !saving}">
    <div class="modal-dialog modal-md">
        <div class="modal-content">
            <form *ngIf="active" #userForm="ngForm" novalidate (ngSubmit)="save()" autocomplete="off">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span>{{"MoveOrder" | localize}}</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')" [disabled]="saving">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
    
                    <div class="form-group">
                        <label for="Name">{{"MoveTo" | localize}} *</label>
                        <ng-select 
                            #select
                            class="custom"
                            [closeOnSelect]="true" 
                            [items]="data" 
                            bindValue="routeId" 
                            bindLabel="routeId"
                            [(ngModel)]="movetoRouteId" 
                            [searchable]="false"
                            name="movetoRouteId">
                            <ng-template ng-header-tmp>
                                <input style="width: 100%; line-height: 24px" type="text" (input)="select.filter($event.target.value)" placeholder="Route Id"/>
                            </ng-template>
                            
                            <ng-template ng-label-tmp let-item="item">
                                {{item.routeId}} - {{item.driverName}} - {{item.routeDate}}
                            </ng-template>
                                
                            <ng-template ng-option-tmp let-item="item" let-item$="item$" let-index="routeId" let-search="searchTerm" >
                                {{item.routeId}} - {{item.driverName}} - {{item.routeDate}}
                            </ng-template>
                        </ng-select>
                    </div>

                </div>
                <div class="modal-footer">
                    <button [disabled]="saving" type="button" class="btn btn-default btn-elevate btn-pill" (click)="close()">{{"Cancel" | localize}}</button>
                    <button type="submit" class="btn btn-primary btn-elevate btn-pill" [disabled]="!userForm.form.valid" [buttonBusy]="saving" [busyText]="l('SavingWithThreeDot')"><i class="fa fa-save"></i> <span>{{"Save" | localize}}</span></button>
                </div>
            </form>
        </div>
    </div>
</div>
