Update demos with new content

pull/358/head
cagataycivici 2020-07-01 18:16:48 +03:00
parent 820c9267be
commit b2d9e1f189
11 changed files with 248 additions and 116 deletions

View File

@ -145,9 +145,7 @@ export default {
}
.product-list-item {
display: -ms-flexbox;
display: flex;
-ms-flex-align: center;
align-items: center;
padding: 1rem;
width: 100%;

View File

@ -9,16 +9,23 @@
<div class="content-section implementation">
<div class="card">
<OrderList v-model="cars" listStyle="height:auto" dataKey="vin">
<OrderList v-model="products" listStyle="height:auto" dataKey="id">
<template #header>
List of Cars
List of Products
</template>
<template #item="slotProps">
<div class="p-caritem">
<img :src="'demo/images/car/' + slotProps.item.brand + '.png'">
<div>
<span class="p-caritem-vin">{{slotProps.item.vin}}</span>
<span>{{slotProps.item.year}} - {{slotProps.item.color}}</span>
<div class="product-item">
<div class="image-container">
<img :src="'demo/images/product/' + slotProps.item.image" :alt="slotProps.item.name" />
</div>
<div class="product-list-detail">
<h5 class="p-mb-2">{{slotProps.item.name}}</h5>
<i class="pi pi-tag product-category-icon"></i>
<span class="product-category">{{slotProps.item.category}}</span>
</div>
<div class="product-list-action">
<h6 class="p-mb-2">${{slotProps.item.price}}</h6>
<span :class="'product-badge status-'+slotProps.item.inventoryStatus.toLowerCase()">{{slotProps.item.inventoryStatus}}</span>
</div>
</div>
</template>
@ -29,22 +36,23 @@
<OrderListDoc />
</div>
</template>
<script>
import OrderListDoc from './OrderListDoc';
import CarService from '../../service/CarService';
import ProductService from '../../service/ProductService';
export default {
data() {
return {
cars: null
products: null
}
},
carService: null,
productService: null,
created() {
this.carService = new CarService();
this.productService = new ProductService();
},
mounted() {
this.carService.getCarsSmall().then(data => this.cars = data.slice(0,5));
this.productService.getProductsSmall().then(data => this.products = data);
},
components: {
'OrderListDoc': OrderListDoc
@ -53,25 +61,52 @@ export default {
</script>
<style lang="scss" scoped>
.p-caritem {
display: flex;
align-items: center;
.product-item {
display: flex;
align-items: center;
padding: .5rem;
width: 100%;
div {
display: flex;
img {
width: 75px;
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
margin-right: 1rem;
}
.product-list-detail {
flex: 1 1 0;
}
.product-list-action {
display: flex;
flex-direction: column;
align-items: flex-end;
}
.p-caritem-vin {
font-weight: 600;
display: block;
margin-bottom: .25rem;
}
img {
width: 48px;
height: 48px;
.product-category-icon {
vertical-align: middle;
margin-right: .5rem;
}
.product-category {
vertical-align: middle;
line-height: 1;
}
}
@media screen and (max-width: 576px) {
.product-item {
flex-wrap: wrap;
.image-container {
width: 100%;
text-align: center;
}
img {
margin: 0 0 1rem 0;
width: 100px;
}
}
}
</style>

View File

@ -170,16 +170,23 @@ import OrderList from 'primevue/orderlist';
</a>
<CodeHighlight>
<template v-pre>
&lt;OrderList v-model="cars" listStyle="height:auto" dataKey="vin"&gt;
&lt;OrderList v-model="products" listStyle="height:auto" dataKey="id"&gt;
&lt;template #header&gt;
List of Cars
List of Products
&lt;/template&gt;
&lt;template #item="slotProps"&gt;
&lt;div class="p-caritem"&gt;
&lt;img :src="'demo/images/car/' + slotProps.item.brand + '.png'"&gt;
&lt;div&gt;
&lt;span class="p-caritem-vin"&gt;{{slotProps.item.vin}}&lt;/span&gt;
&lt;span&gt;{{slotProps.item.year}} - {{slotProps.item.color}}&lt;/span&gt;
&lt;div class="product-item"&gt;
&lt;div class="image-container"&gt;
&lt;img :src="'demo/images/product/' + slotProps.item.image" :alt="slotProps.item.name" /&gt;
&lt;/div&gt;
&lt;div class="product-list-detail"&gt;
&lt;h5 class="p-mb-2"&gt;{{slotProps.item.name}}&lt;/h5&gt;
&lt;i class="pi pi-tag product-category-icon"&gt;&lt;/i&gt;
&lt;span class="product-category"&gt;{{slotProps.item.category}}&lt;/span&gt;
&lt;/div&gt;
&lt;div class="product-list-action"&gt;
&lt;h6 class="p-mb-2"&gt;${{slotProps.item.price}}&lt;/h6&gt;
&lt;span :class="'product-badge status-'+slotProps.item.inventoryStatus.toLowerCase()"&gt;{{slotProps.item.inventoryStatus}}&lt;/span&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/template&gt;
@ -188,45 +195,72 @@ import OrderList from 'primevue/orderlist';
</CodeHighlight>
<CodeHighlight lang="js">
import CarService from '../../service/CarService';
import ProductService from '../../service/ProductService';
export default {
data() {
return {
cars: null
products: null
}
},
carService: null,
productService: null,
created() {
this.carService = new CarService();
this.productService = new ProductService();
},
mounted() {
this.carService.getCarsSmall().then(data => this.cars = data.slice(0,5));
this.productService.getProductsSmall().then(data => this.products = data);
}
}
</CodeHighlight>
<CodeHighlight lang="css">
.p-caritem {
display: flex;
align-items: center;
.product-item {
display: flex;
align-items: center;
padding: .5rem;
width: 100%;
div {
display: flex;
img {
width: 75px;
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
margin-right: 1rem;
}
.product-list-detail {
flex: 1 1 0;
}
.product-list-action {
display: flex;
flex-direction: column;
align-items: flex-end;
}
.p-caritem-vin {
font-weight: 600;
display: block;
margin-bottom: .25rem;
}
img {
width: 48px;
height: 48px;
.product-category-icon {
vertical-align: middle;
margin-right: .5rem;
}
.product-category {
vertical-align: middle;
line-height: 1;
}
}
@media screen and (max-width: 576px) {
.product-item {
flex-wrap: wrap;
.image-container {
width: 100%;
text-align: center;
}
img {
margin: 0 0 1rem 0;
width: 100px;
}
}
}
</CodeHighlight>
</TabPanel>

View File

@ -9,7 +9,7 @@
<div class="content-section implementation">
<div class="card">
<PickList v-model="cars" listStyle="height:342px" dataKey="vin">
<PickList v-model="products" listStyle="height:342px" dataKey="id">
<template #sourceHeader>
Available
</template>
@ -17,11 +17,18 @@
Selected
</template>
<template #item="slotProps">
<div class="p-caritem">
<img :src="'demo/images/car/' + slotProps.item.brand + '.png'">
<div>
<span class="p-caritem-vin">{{slotProps.item.vin}}</span>
<span>{{slotProps.item.year}} - {{slotProps.item.color}}</span>
<div class="product-item">
<div class="image-container">
<img :src="'demo/images/product/' + slotProps.item.image" :alt="slotProps.item.name" />
</div>
<div class="product-list-detail">
<h5 class="p-mb-2">{{slotProps.item.name}}</h5>
<i class="pi pi-tag product-category-icon"></i>
<span class="product-category">{{slotProps.item.category}}</span>
</div>
<div class="product-list-action">
<h6 class="p-mb-2">${{slotProps.item.price}}</h6>
<span :class="'product-badge status-'+slotProps.item.inventoryStatus.toLowerCase()">{{slotProps.item.inventoryStatus}}</span>
</div>
</div>
</template>
@ -32,22 +39,23 @@
<PickListDoc />
</div>
</template>
<script>
import PickListDoc from './PickListDoc';
import CarService from '../../service/CarService';
import ProductService from '../../service/ProductService';
export default {
data() {
return {
cars: null
products: null
}
},
carService: null,
productService: null,
created() {
this.carService = new CarService();
this.productService = new ProductService();
},
mounted() {
this.carService.getCarsSmall().then(data => this.cars = [data.slice(0,5),[]]);
this.productService.getProductsSmall().then(data => this.products = [data, []]);
},
components: {
'PickListDoc': PickListDoc
@ -56,25 +64,52 @@ export default {
</script>
<style lang="scss" scoped>
.p-caritem {
display: flex;
align-items: center;
.product-item {
display: flex;
align-items: center;
padding: .5rem;
width: 100%;
div {
display: flex;
img {
width: 75px;
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
margin-right: 1rem;
}
.product-list-detail {
flex: 1 1 0;
}
.product-list-action {
display: flex;
flex-direction: column;
align-items: flex-end;
}
.p-caritem-vin {
font-weight: 600;
display: block;
margin-bottom: .25rem;
}
img {
width: 48px;
height: 48px;
.product-category-icon {
vertical-align: middle;
margin-right: .5rem;
}
.product-category {
vertical-align: middle;
line-height: 1;
}
}
@media screen and (max-width: 576px) {
.product-item {
flex-wrap: wrap;
.image-container {
width: 100%;
text-align: center;
}
img {
margin: 0 0 1rem 0;
width: 100px;
}
}
}
</style>

View File

@ -229,7 +229,7 @@ import PickList from 'primevue/picklist';
</a>
<CodeHighlight>
<template v-pre>
&lt;PickList v-model="cars" listStyle="height:342px" dataKey="vin"&gt;
&lt;PickList v-model="products" listStyle="height:342px" dataKey="id"&gt;
&lt;template #sourceHeader&gt;
Available
&lt;/template&gt;
@ -237,11 +237,18 @@ import PickList from 'primevue/picklist';
Selected
&lt;/template&gt;
&lt;template #item="slotProps"&gt;
&lt;div class="p-caritem"&gt;
&lt;img :src="'demo/images/car/' + slotProps.item.brand + '.png'"&gt;
&lt;div&gt;
&lt;span class="p-caritem-vin"&gt;{{slotProps.item.vin}}&lt;/span&gt;
&lt;span&gt;{{slotProps.item.year}} - {{slotProps.item.color}}&lt;/span&gt;
&lt;div class="product-item"&gt;
&lt;div class="image-container"&gt;
&lt;img :src="'demo/images/product/' + slotProps.item.image" :alt="slotProps.item.name" /&gt;
&lt;/div&gt;
&lt;div class="product-list-detail"&gt;
&lt;h5 class="p-mb-2"&gt;{{slotProps.item.name}}&lt;/h5&gt;
&lt;i class="pi pi-tag product-category-icon"&gt;&lt;/i&gt;
&lt;span class="product-category"&gt;{{slotProps.item.category}}&lt;/span&gt;
&lt;/div&gt;
&lt;div class="product-list-action"&gt;
&lt;h6 class="p-mb-2"&gt;${{slotProps.item.price}}&lt;/h6&gt;
&lt;span :class="'product-badge status-'+slotProps.item.inventoryStatus.toLowerCase()"&gt;{{slotProps.item.inventoryStatus}}&lt;/span&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/template&gt;
@ -250,45 +257,72 @@ import PickList from 'primevue/picklist';
</CodeHighlight>
<CodeHighlight lang="js">
import CarService from '../../service/CarService';
import ProductService from '../../service/ProductService';
export default {
data() {
return {
cars: null
products: null
}
},
carService: null,
productService: null,
created() {
this.carService = new CarService();
this.productService = new ProductService();
},
mounted() {
this.carService.getCarsSmall().then(data => this.cars = [data.slice(0,5),[]]);
this.productService.getProductsSmall().then(data => this.products = [data, []]);
}
}
</CodeHighlight>
<CodeHighlight lang="css">
.p-caritem {
display: flex;
align-items: center;
product-item {
display: flex;
align-items: center;
padding: .5rem;
width: 100%;
div {
display: flex;
img {
width: 75px;
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
margin-right: 1rem;
}
.product-list-detail {
flex: 1 1 0;
}
.product-list-action {
display: flex;
flex-direction: column;
align-items: flex-end;
}
.p-caritem-vin {
font-weight: 600;
display: block;
margin-bottom: .25rem;
}
img {
width: 48px;
height: 48px;
.product-category-icon {
vertical-align: middle;
margin-right: .5rem;
}
.product-category {
vertical-align: middle;
line-height: 1;
}
}
@media screen and (max-width: 576px) {
.product-item {
flex-wrap: wrap;
.image-container {
width: 100%;
text-align: center;
}
img {
margin: 0 0 1rem 0;
width: 100px;
}
}
}
</CodeHighlight>
</TabPanel>

View File

@ -12,7 +12,7 @@
<h5>Basic {{val1}}</h5>
<Rating v-model="val1" />
<h5>No Cancel {{val2}}</h5>
<h5>Without Cancel</h5>
<Rating v-model="val2" :cancel="false" />
<h5>ReadOnly</h5>

View File

@ -142,7 +142,7 @@ import Rating from 'primevue/rating';
&lt;h3&gt;Basic {{val1}}&lt;/h3&gt;
&lt;Rating v-model="val1" /&gt;
&lt;h3&gt;No Cancel {{val2}}&lt;/h3&gt;
&lt;h3&gt;Without Cancel&lt;/h3&gt;
&lt;Rating v-model="val2" :cancel="false" /&gt;
&lt;h3&gt;ReadOnly&lt;/h3&gt;

View File

@ -31,7 +31,7 @@ import TextareaDoc from './TextareaDoc'
export default {
data() {
return {
value1: 'Welcome to PrimeVue',
value1: '',
value2: '',
value3: ''
}

View File

@ -95,7 +95,7 @@ import Textarea from 'primevue/textarea';
export default {
data() {
return {
value1: 'Welcome to PrimeVue',
value1: '',
value2: '',
value3: ''
}

View File

@ -11,11 +11,9 @@
<div class="card">
<h5>Basic</h5>
<ToggleButton v-model="checked1" onIcon="pi pi-check" offIcon="pi pi-times" />
<p>{{checked1}}</p>
<h5>Customized</h5>
<ToggleButton v-model="checked2" onLabel="I confirm" offLabel="I reject" onIcon="pi pi-check" offIcon="pi pi-times" style="width: 10em" />
<p>{{checked2}}</p>
</div>
</div>

View File

@ -168,11 +168,9 @@ export default {
<template v-pre>
&lt;h3&gt;Basic&lt;/h3&gt;
&lt;ToggleButton v-model="checked1" onIcon="pi pi-check" offIcon="pi pi-times" /&gt;
&lt;p&gt;{{checked1}}&lt;/p&gt;
&lt;h3&gt;Customized&lt;/h3&gt;
&lt;ToggleButton v-model="checked2" onLabel="I confirm" offLabel="I reject" onIcon="pi pi-check" offIcon="pi pi-times" style="width: 10em" /&gt;
&lt;p&gt;{{checked2}}&lt;/p&gt;
</template>
</CodeHighlight>