The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding. His beloved son Michael has just come home from the war, but does not intend to become part of his father's business. Through Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family, kind and benevolent to those who give respect, but given to ruthless violence whenever anything stands against the good of the family.
<div class="ui-grid ui-grid-responsive ui-grid-pad">
<div class="ui-grid-row">
<div class="ui-grid-col-6">
<div class="ui-grid-col-4">
InputText
</div>
<div class="ui-grid-col-8">
<input pInputText type="text" />
</div>
</div>
<div class="ui-grid-col-6">
<div class="ui-grid-col-4">
Textarea
</div>
<div class="ui-grid-col-8">
<textarea pInputTextarea type="text"></textarea>
</div>
</div>
</div>
<div class="ui-grid-row">
<div class="ui-grid-col-6">
<div class="ui-grid-col-4">
Calendar
</div>
<div class="ui-grid-col-8">
<p-calendar [(ngModel)]="date"></p-calendar>
</div>
</div>
<div class="ui-grid-col-6">
<div class="ui-grid-col-4">
AutoComplete
</div>
<div class="ui-grid-col-8">
<p-autoComplete [(ngModel)]="country" [suggestions]="filteredCountriesSingle" (completeMethod)="filterCountrySingle($event)" field="name" [size]="30"
placeholder="Countries" [minLength]="1"></p-autoComplete>
</div>
</div>
</div>
<div class="ui-grid-row">
<div class="ui-grid-col-6">
<div class="ui-grid-col-4">
Button
</div>
<div class="ui-grid-col-8">
<button pButton label="Save"type="button"></button>
</div>
</div>
<div class="ui-grid-col-6">
<div class="ui-grid-col-4">
SplitButton
</div>
<div class="ui-grid-col-8">
<p-splitButton label="Save" icon="fa-check" (onClick)="save()">
<p-splitButtonItem icon="fa-close" label="Delete" (onClick)="delete()"></p-splitButtonItem>
<p-splitButtonItem icon="fa-refresh" label="Update" (onClick)="update()"></p-splitButtonItem>
<p-splitButtonItem icon="fa-link" label="Angular.io" url="http://angular.io"></p-splitButtonItem>
</p-splitButton>
</div>
</div>
</div>
<div class="ui-grid-row">
<div class="ui-grid-col-6">
<div class="ui-grid-col-4">
Dropdown
</div>
<div class="ui-grid-col-8">
<p-dropdown [options]="cities" [(ngModel)]="selectedCity" [autoWidth]="false"></p-dropdown>
</div>
</div>
<div class="ui-grid-col-6">
<div class="ui-grid-col-4">
Password
</div>
<div class="ui-grid-col-8">
<input type="text" pPassword />
</div>
</div>
</div>
<div class="ui-grid-row">
<div class="ui-grid-col-6">
<div class="ui-grid-col-4">
Listbox
</div>
<div class="ui-grid-col-8">
<p-listbox [options]="options" [(ngModel)]="selectedOptions"></p-listbox>
</div>
</div>
<div class="ui-grid-col-6">
<div class="ui-grid-col-4">
RadioButton
</div>
<div class="ui-grid-col-8">
<div class="ui-grid ui-grid-responsive">
<div class="ui-grid-row">
<div class="ui-grid-col-1"><p-radioButton name="group1" value="Option 1" [(ngModel)]="val"></p-radioButton></div>
<div class="ui-grid-col-11"><label class="ui-widget">Option 1</label></div>
</div>
<div class="ui-grid-row">
<div class="ui-grid-col-1"><p-radioButton name="group1" value="Option 2" [(ngModel)]="val"></p-radioButton></div>
<div class="ui-grid-col-11"><label class="ui-widget">Option 2</label></div>
</div>
<div class="ui-grid-row">
<div class="ui-grid-col-1"><p-radioButton name="group1" value="Option 3" [(ngModel)]="val"></p-radioButton></div>
<div class="ui-grid-col-11"><label class="ui-widget">Option 3</label></div>
</div>
<div class="ui-grid-row">
<div class="ui-grid-col-1"><p-radioButton name="group1" value="Option 4" [(ngModel)]="val"></p-radioButton></div>
<div class="ui-grid-col-11"><label class="ui-widget">Option 4</label></div>
</div>
</div>
</div>
</div>
</div>
<div class="ui-grid-row">
<div class="ui-grid-col-2">
Dialog
</div>
<div class="ui-grid-col-10">
<button pButton label="Show" type="button" icon='fa-external-link' (click)="showDialog()"></button>
</div>
</div>
</div>
<p-dialog header="Godfather 1" [(visible)]="display" [responsive]="true" [resizable]="false">
<p>The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding.
His beloved son Michael has just come home from the war, but does not intend to become part of his father's business.
Through Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family,
kind and benevolent to those who give respect,
but given to ruthless violence whenever anything stands against the good of the family.</p>
</p-dialog>
<p-panel header="Panel" style="margin-top:20px">
The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding.
His beloved son Michael has just come home from the war, but does not intend to become part of his father's business.
Through Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family,
kind and benevolent to those who give respect,
but given to ruthless violence whenever anything stands against the good of the family.
</p-panel>
<p-dataTable style="margin-top:20px" [value]="cars" [rows]="10" [paginator]="true" [pageLinks]="3" [responsive]="true">
<header>Cars</header>
<p-column field="vin" header="Vin"></p-column>
<p-column field="year" header="Year"></p-column>
<p-column field="brand" header="Brand"></p-column>
<p-column field="color" header="Color"></p-column>
</p-dataTable>
<p-dataGrid style="margin-top:20px;margin-bottom:20px" [value]="cars" [columns]="5" [paginator]="true" [rows]="20">
<header>
Datagrid
</header>
<template let-car>
<div style="padding:3px">
<p-panel [header]="car.vin" [paginator]="true" style="text-align:center">
<img src="showcase/resources/demo/images/car/{{car.brand}}.gif">
<div class="car-detail">{{car.year}} - {{car.color}}</div>
<hr class="ui-widget-content" style="border-top:0">
</p-panel>
</div>
</template>
</p-dataGrid>
<p-tree [value]="files" style="margin-top:20px;margin-bottom:20px"></p-tree>
<p-orderList [value]="cars" listStyle="height:250px" style="margin-top:20px;margin-bottom:20px" [responsive]="true" header="Responsive Cars">
<template let-car>
<li class="ui-orderlist-item ui-helper-clearfix">
<img src="showcase/resources/demo/images/car/{{car.brand}}.gif" style="display:inline-block;margin:2px 0 2px 2px"/>
<div style="font-size:14px;float:right;margin:15px 5px 0 0">{{car.brand}} - {{car.year}} - {{car.color}}</div>
</li>
</template>
</p-orderList>
<p-carousel headerText="Cars" [value]="cars2" style="margin-top:20px;margin-bottom:20px">
<template let-car>
<li>
<div class="ui-grid ui-grid-responsive ui-grid-pad" style="text-align:center">
<div class="ui-grid-row">
<div class="ui-grid-col-12" style="text-align:center"><img src="showcase/resources/demo/images/car/{{car.brand}}.gif" /></div>
</div>
<div class="ui-grid-row">
<div class="ui-grid-col-6">Vin</div>
<div class="ui-grid-col-6">{{car.vin}}</div>
</div>
<div class="ui-grid-row">
<div class="ui-grid-col-6">Year</div>
<div class="ui-grid-col-6">{{car.year}}</div>
</div>
<div class="ui-grid-row">
<div class="ui-grid-col-6">Color</div>
<div class="ui-grid-col-6">{{car.color}}</div>
</div>
</div>
</li>
</template>
</p-carousel>
<p-pickList [source]="sourceCars" [target]="targetCars" sourceHeader="Available" targetHeader="Selected" [responsive]="true" sourceStyle="height:300px" targetStyle="height:300px" style="margin-top:20px;margin-bottom:20px">
<template let-car>
<li class="ui-picklist-item ui-helper-clearfix">
<img src="showcase/resources/demo/images/car/{{car.brand}}.gif" style="display:inline-block;margin:2px 0 2px 2px"/>
<div style="font-size:14px;float:right;margin:15px 5px 0 0">{{car.brand}} - {{car.year}} - {{car.color}}</div>
</li>
</template>
</p-pickList>
<div class="ui-grid ui-grid-responsive ui-grid-pad">
<div class="ui-grid-row">
<div class="ui-grid-col-6">
<p-menu>
<ul>
<li><h3>File</h3></li>
<li><a data-icon="fa-plus"><span>New</span></a></li>
<li><a data-icon="fa-download"><span>Open</span></a></li>
<li><h3>Edit</h3></li>
<li><a data-icon="fa-refresh"><span>Undo</span></a></li>
<li><a data-icon="fa-repeat"><span>Redo</span></a></li>
</ul>
</p-menu>
</div>
<div class="ui-grid-col-6">
<p-panelMenu>
<div>
<div><a data-icon="fa-file-o"><span>File</span></a></div>
<div>
<ul>
<li><a data-icon="fa-plus"><span>New</span></a>
<ul>
<li><a><span>Project</span></a></li>
<li><a><span>Other</span></a></li>
</ul>
</li>
<li><a><span>Open</span></a></li>
<li><a><span>Quit</span></a></li>
</ul>
</div>
</div>
<div>
<div><a data-icon="fa-edit"><span>Edit</span></a></div>
<div>
<ul>
<li><a data-icon="fa-mail-forward"><span>Undo</span></a></li>
<li><a data-icon="fa-mail-reply"><span>Redo</span></a></li>
</ul>
</div>
</div>
<div>
<div><a data-icon="fa-question"><span>Help</span></a></div>
<div>
<ul>
<li><a><span>Contents</span></a></li>
<li><a data-icon="fa-search"><span>Search</span></a>
<ul>
<li><a><span>Text</span></a>
<ul>
<li><a><span>Workspace</span></a></li>
</ul>
</li>
<li><a><span>File</span></a></li>
</ul>
</li>
</ul>
</div>
</div>
<div>
<div><a data-icon="fa-gear"><span>Actions</span></a></div>
<div>
<ul>
<li><a data-icon="fa-pencil"><span>Edit</span></a>
<ul>
<li><a data-icon="fa-save"><span>Save</span></a></li>
<li><a data-icon="fa-save"><span>Update</span></a></li>
</ul>
</li>
<li><a data-icon="fa-phone"><span>Other</span></a>
<ul>
<li><a data-icon="fa-minus"><span>Delete</span></a></li>
</ul>
</li>
</ul>
</div>
</div>
</p-panelMenu>
</div>
</div>
</div>
export class ResponsiveDemo implements OnInit {
cities: SelectItem[];
files: TreeNode[];
sourceCars: Car[];
targetCars: Car[];
data: any;
selectedCity: string;
val: string;
options: SelectItem[];
selectedOption: string;
display: boolean = false;
cars: Car[];
cars1: Car[];
cars2: Car[];
cars3: Car[];
date: string;
text: string;
filteredCountriesSingle: any[];
showDialog() {
this.display = true;
}
constructor(private carService: CarService, private countryService: CountryService, private nodeService: NodeService) {
this.cars2 = [
{vin: 'r3278r2', year: 2010, brand: 'Audi', color: 'Black'},
{vin: 'jhto2g2', year: 2015, brand: 'BMW', color: 'White'},
{vin: 'h453w54', year: 2012, brand: 'Honda', color: 'Blue'},
{vin: 'g43gwwg', year: 1998, brand: 'Renault', color: 'White'},
{vin: 'gf45wg5', year: 2011, brand: 'VW', color: 'Red'},
{vin: 'bhv5y5w', year: 2015, brand: 'Jaguar', color: 'Blue'},
{vin: 'ybw5fsd', year: 2012, brand: 'Ford', color: 'Yellow'},
{vin: '45665e5', year: 2011, brand: 'Mercedes', color: 'Brown'},
{vin: 'he6sb5v', year: 2015, brand: 'Ford', color: 'Black'}
];
this.cities = [];
this.cities.push({label:'Select Cities', value:'Select Cities'});
this.cities.push({label:'New York', value:'New York'});
this.cities.push({label:'Rome', value:'Rome'});
this.cities.push({label:'London', value:'London'});
this.cities.push({label:'Istanbul', value:'Istanbul'});
this.cities.push({label:'Paris', value:'Paris'});
this.options = [];
this.options.push({label:'Option 1', value:'Option 1'});
this.options.push({label:'Option 2', value:'Option 2'});
this.options.push({label:'Option 3', value:'Option 3'});
this.options.push({label:'Option 4', value:'Option 4'});
this.options.push({label:'Option 5', value:'Option 5'});
this.data = {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [
{
label: 'My First dataset',
fillColor: 'rgba(220,220,220,0.2)',
strokeColor: 'rgba(220,220,220,1)',
pointColor: 'rgba(220,220,220,1)',
pointStrokeColor: '#fff',
pointHighlightFill: '#fff',
pointHighlightStroke: 'rgba(220,220,220,1)',
data: [65, 59, 80, 81, 56, 55, 40]
},
{
label: 'My Second dataset',
fillColor: 'rgba(151,187,205,0.2)',
strokeColor: 'rgba(151,187,205,1)',
pointColor: 'rgba(151,187,205,1)',
pointStrokeColor: '#fff',
pointHighlightFill: '#fff',
pointHighlightStroke: 'rgba(151,187,205,1)',
data: [28, 48, 40, 19, 86, 27, 90]
}
]
}
}
ngOnInit() {
this.carService.getCarsMedium().then(cars => this.cars = cars);
this.nodeService.getFiles().then(files => this.files = files);
this.carService.getCarsSmall().then(cars1 => this.cars1 = cars1);
this.carService.getCarsSmall().then(cars3 => this.sourceCars = cars3);
this.targetCars = [];
}
filterCountrySingle(event) {
let query = event.query;
this.countryService.getCountries().then(countries => {
this.filteredCountriesSingle = this.filterCountry(query, countries);
});
}
filterCountry(query, countries: any[]):any[] {
//in a real application, make a request to a remote url with the query and return filtered results, for demo we filter at client side
let filtered : any[] = [];
for(let i = 0; i < countries.length; i++) {
let country = countries[i];
if(country.name.toLowerCase().indexOf(query.toLowerCase()) == 0) {
filtered.push(country);
}
}
return filtered;
}
}