<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>{{"OrderPackageCreate" | 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 m-form__group align-items-center">
                        <label for="TagType">{{"OrderId" | localize}} *</label>
                        <select class="form-control kt-select2" style="width:100%" id="Order" [(ngModel)]="orderId" name="order"  #orderCtrl="ngModel" >
                            <option *ngFor="let order of filteredOrder"  [(value)]="order.id" [selected]="order.id === orderFilter">
                                {{order.id}}
                            </option>
                        </select>
                        <!-- <p-autoComplete [(ngModel)]="orderFilter"
                            id="Order"
                            [suggestions]="filteredOrder"
                            (completeMethod)="filterOrder($event)"
                            field="id"
                            [minLength]="1"
                            name="order"
                            dropdown="true"
                            placeholder="Select order id.."
                            #orderCtrl="ngModel"
                            required
                            [style]="{'width':'100%'}"
                            [inputStyle]="{'width':'92%','height':'33px'}">
                        </p-autoComplete> -->
                        <validation-messages [formCtrl]="orderCtrl"></validation-messages>
                    </div>

                    <div class="form-group m-form__group align-items-center">
                        <label for="TagType">{{"Package" | localize}} *</label>
                        <select class="form-control kt-select2" style="width:100%" id="Package" [(ngModel)]="packageId" name="addPackage"  #packageCtrl="ngModel" >
                            <option *ngFor="let packagef of filteredPackage"  [(value)]="packagef.id" [selected]="packagef.id === packageId">
                                {{packagef.name}}
                            </option>
                        </select>
                        <!-- <p-autoComplete [(ngModel)]="orderPackage.package"
                            id="Package"
                            [suggestions]="filteredPackage"
                            (completeMethod)="filterPackage($event)"
                            field="name"
                            [minLength]="1"
                            name="addPackage"
                            dropdown="true"
                            placeholder="Select package.."
                            #packageCtrl="ngModel"
                            required
                            [style]="{'width':'100%'}"
                            [inputStyle]="{'width':'92%','height':'33px'}">
                        </p-autoComplete> -->
                        <validation-messages [formCtrl]="packageCtrl"></validation-messages>
                    </div>
                    <div class="form-group">
                        <label for="Name">{{"Quantity" | localize}} *</label>
                        <input id="Name" #name="ngModel" type="text" name="Name" class="form-control" [(ngModel)]="orderPackage.quantity" required/>
                        <validation-messages [formCtrl]="name"></validation-messages>
                    </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>
