All demos added

This commit is contained in:
Bahadır Sofuoğlu
2022-11-04 02:27:06 +03:00
parent 1ee46af467
commit 3e45c1cf61
11 changed files with 1323 additions and 973 deletions

View File

@@ -27,11 +27,11 @@ defineProps({
<span class="layout-menuitem-text">{{ item.label }}</span> <span class="layout-menuitem-text">{{ item.label }}</span>
<i class="pi pi-fw pi-angle-down layout-submenu-toggler" v-if="item.items"></i> <i class="pi pi-fw pi-angle-down layout-submenu-toggler" v-if="item.items"></i>
</a> </a>
<a v-if="item.to && !item.items && item.visible !== false" @click="itemClick($event)" :class="item.class" tabindex="0" :to="item.to"> <router-link v-if="item.to && !item.items && item.visible !== false" @click="itemClick($event)" :class="[item.class, { 'active-route': active }]" tabindex="0" :to="item.to">
<i :class="item.icon" class="layout-menuitem-icon"></i> <i :class="item.icon" class="layout-menuitem-icon"></i>
<span class="layout-menuitem-text">{{ item.label }}</span> <span class="layout-menuitem-text">{{ item.label }}</span>
<i class="pi pi-fw pi-angle-down layout-submenu-toggler" v-if="item.items"></i> <i class="pi pi-fw pi-angle-down layout-submenu-toggler" v-if="item.items"></i>
</a> </router-link>
<Transition class="layout-submenu"> <Transition class="layout-submenu">
<ul v-if="item.items && item.visible !== false"> <ul v-if="item.items && item.visible !== false">
<app-menu-item v-for="(child, i) in item.items" :key="child" :index="i" :item="child" :root="false"></app-menu-item> <app-menu-item v-for="(child, i) in item.items" :key="child" :index="i" :item="child" :root="false"></app-menu-item>

View File

@@ -1,11 +1,13 @@
export default class NodeService { export default class NodeService {
getTreeTableNodes () {
getTreeTableNodes() { return fetch('/data/treetablenodes.json')
return fetch('data/treetablenodes.json').then(res => res.json()).then(d => d.root); .then(res => res.json())
.then(d => d.root);
} }
getTreeNodes() { getTreeNodes () {
return fetch('data/treenodes.json').then(res => res.json()).then(d => d.root); return fetch('/data/treenodes.json')
.then(res => res.json())
.then(d => d.root);
} }
} }

View File

@@ -1,7 +1,7 @@
export default class PhotoService { export default class PhotoService {
getImages () {
getImages() { return fetch('/data/photos.json')
return fetch('data/photos.json').then(res => res.json()) .then(res => res.json())
.then(d => d.data); .then(d => d.data);
} }
} }

View File

@@ -1,15 +1,19 @@
export default class ProductService { export default class ProductService {
getProductsSmall () {
getProductsSmall() { return fetch('/data/products-small.json')
return fetch('data/products-small.json').then(res => res.json()).then(d => d.data); .then(res => res.json())
.then(d => d.data);
} }
getProducts() { getProducts () {
return fetch('data/products.json').then(res => res.json()).then(d => d.data); return fetch('/data/products.json')
.then(res => res.json())
.then(d => d.data);
} }
getProductsWithOrdersSmall() { getProductsWithOrdersSmall () {
return fetch('data/products-orders-small.json').then(res => res.json()).then(d => d.data); return fetch('/data/products-orders-small.json')
.then(res => res.json())
.then(d => d.data);
} }
} }

View File

@@ -9,65 +9,85 @@ const router = createRouter({
component: AppLayout, component: AppLayout,
children: [ children: [
{ {
path: '', path: '/',
name: 'dashboard', name: 'dashboard',
component: () => import('@/views/Dashboard.vue') component: () => import('@/views/Dashboard.vue')
}, },
{ {
path: '/formlayout', path: '/uikit/formlayout',
name: 'formlayout', name: 'formlayout',
component: () => import('@/views/demo/FormLayout.vue') component: () => import('@/views/demo/FormLayout.vue')
}, },
{ {
path: '/input', path: '/uikit/input',
name: 'input', name: 'input',
component: () => import('@/views/demo/Input.vue') component: () => import('@/views/demo/Input.vue')
}, },
{ {
path: '/floatlabel', path: '/uikit/floatlabel',
name: 'floatlabel', name: 'floatlabel',
component: () => import('@/views/demo/FloatLabel.vue') component: () => import('@/views/demo/FloatLabel.vue')
}, },
{ {
path: '/invalidstate', path: '/uikit/invalidstate',
name: 'invalidstate', name: 'invalidstate',
component: () => import('@/views/demo/InvalidState.vue') component: () => import('@/views/demo/InvalidState.vue')
}, },
{ {
path: '/button', path: '/uikit/button',
name: 'button', name: 'button',
component: () => import('@/views/demo/Button.vue') component: () => import('@/views/demo/Button.vue')
}, },
{ {
path: '/table', path: '/uikit/table',
name: 'table', name: 'table',
component: () => import('@/views/demo/Table.vue') component: () => import('@/views/demo/Table.vue')
}, },
{ {
path: '/list', path: '/uikit/list',
name: 'list', name: 'list',
component: () => import('@/views/demo/List.vue') component: () => import('@/views/demo/List.vue')
}, },
{ {
path: '/tree', path: '/uikit/tree',
name: 'tree', name: 'tree',
component: () => import('@/views/demo/Tree.vue') component: () => import('@/views/demo/Tree.vue')
}, },
{ {
path: '/panel', path: '/uikit/panel',
name: 'panel', name: 'panel',
component: () => import('@/views/demo/Panels.vue') component: () => import('@/views/demo/Panels.vue')
}, },
{ {
path: '/overlay', path: '/uikit/overlay',
name: 'overlay', name: 'overlay',
component: () => import('@/views/demo/Overlay.vue') component: () => import('@/views/demo/Overlay.vue')
}, },
{ {
path: '/media', path: '/uikit/media',
name: 'media', name: 'media',
component: () => import('@/views/demo/Media.vue') component: () => import('@/views/demo/Media.vue')
},
{
path: '/uikit/menu',
name: 'menu',
component: () => import('@/views/demo/Menu.vue')
},
{
path: '/uikit/message',
name: 'message',
component: () => import('@/views/demo/Messages.vue')
},
{
path: '/uikit/file',
name: 'file',
component: () => import('@/views/demo/File.vue')
},
{
path: '/uikit/misc',
name: 'misc',
component: () => import('@/views/demo/Misc.vue')
} }
/* /*
@@ -75,12 +95,12 @@ const router = createRouter({
{ {
path: '/overlay', path: '/uikit/overlay',
name: 'overlay', name: 'overlay',
component: () => import('./components/OverlayDemo.vue') component: () => import('./components/OverlayDemo.vue')
}, },
{ {
path: '/media', path: '/uikit/media',
name: 'media', name: 'media',
component: () => import('./components/MediaDemo.vue') component: () => import('./components/MediaDemo.vue')
} */ } */

357
src/views/demo/Chart.vue Normal file
View File

@@ -0,0 +1,357 @@
<template>
<div class="grid p-fluid">
<div class="col-12 lg:col-6">
<div class="card">
<h5>Linear Chart</h5>
<Chart type="line" :data="lineData" :options="lineOptions" />
</div>
<div class="card flex flex-column align-items-center">
<h5 class="align-self-start">Pie Chart</h5>
<Chart type="pie" :data="pieData" :options="pieOptions" style="width: 50%" />
</div>
<div class="card flex flex-column align-items-center">
<h5 class="align-self-start">Polar Area Chart</h5>
<Chart type="polarArea" :data="polarData" :options="polarOptions" style="width: 50%" />
</div>
</div>
<div class="col-12 lg:col-6">
<div class="card">
<h5>Bar Chart</h5>
<Chart type="bar" :data="barData" :options="barOptions" />
</div>
<div class="card flex flex-column align-items-center">
<h5 class="align-self-start">Doughnut Chart</h5>
<Chart type="doughnut" :data="pieData" :options="pieOptions" style="width: 50%" />
</div>
<div class="card flex flex-column align-items-center">
<h5 class="align-self-start">Radar Chart</h5>
<Chart type="radar" :data="radarData" :options="radarOptions" style="width: 50%" />
</div>
</div>
</div>
</template>
<script>
import EventBus from '@/AppEventBus';
export default {
themeChangeListener: null,
mounted() {
this.themeChangeListener = (event) => {
if (event.dark) this.applyDarkTheme();
else this.applyLightTheme();
};
EventBus.on('change-theme', this.themeChangeListener);
if (this.isDarkTheme()) {
this.applyDarkTheme();
} else {
this.applyLightTheme();
}
},
beforeUnmount() {
EventBus.off('change-theme', this.themeChangeListener);
},
data() {
return {
lineData: {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [
{
label: 'First Dataset',
data: [65, 59, 80, 81, 56, 55, 40],
fill: false,
backgroundColor: '#2f4860',
borderColor: '#2f4860',
tension: 0.4
},
{
label: 'Second Dataset',
data: [28, 48, 40, 19, 86, 27, 90],
fill: false,
backgroundColor: '#00bb7e',
borderColor: '#00bb7e',
tension: 0.4
}
]
},
pieData: {
labels: ['A', 'B', 'C'],
datasets: [
{
data: [300, 50, 100],
backgroundColor: ['#FF6384', '#36A2EB', '#FFCE56'],
hoverBackgroundColor: ['#FF6384', '#36A2EB', '#FFCE56']
}
]
},
polarData: {
datasets: [
{
data: [11, 16, 7, 3, 14],
backgroundColor: ['#FF6384', '#4BC0C0', '#FFCE56', '#E7E9ED', '#36A2EB'],
label: 'My dataset'
}
],
labels: ['Red', 'Green', 'Yellow', 'Grey', 'Blue']
},
barData: {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [
{
label: 'My First dataset',
backgroundColor: '#2f4860',
data: [65, 59, 80, 81, 56, 55, 40]
},
{
label: 'My Second dataset',
backgroundColor: '#00bb7e',
data: [28, 48, 40, 19, 86, 27, 90]
}
]
},
radarData: {
labels: ['Eating', 'Drinking', 'Sleeping', 'Designing', 'Coding', 'Cycling', 'Running'],
datasets: [
{
label: 'My First dataset',
backgroundColor: 'rgba(179,181,198,0.2)',
borderColor: 'rgba(179,181,198,1)',
pointBackgroundColor: 'rgba(179,181,198,1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(179,181,198,1)',
data: [65, 59, 90, 81, 56, 55, 40]
},
{
label: 'My Second dataset',
backgroundColor: 'rgba(255,99,132,0.2)',
borderColor: 'rgba(255,99,132,1)',
pointBackgroundColor: 'rgba(255,99,132,1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(255,99,132,1)',
data: [28, 48, 40, 19, 96, 27, 100]
}
]
},
lineOptions: null,
pieOptions: null,
polarOptions: null,
barOptions: null,
radarOptions: null
};
},
methods: {
isDarkTheme() {
return this.$appState.darkTheme === true;
},
applyLightTheme() {
this.lineOptions = {
plugins: {
legend: {
labels: {
color: '#495057'
}
}
},
scales: {
x: {
ticks: {
color: '#495057'
},
grid: {
color: '#ebedef'
}
},
y: {
ticks: {
color: '#495057'
},
grid: {
color: '#ebedef'
}
}
}
};
this.barOptions = {
plugins: {
legend: {
labels: {
color: '#495057'
}
}
},
scales: {
x: {
ticks: {
color: '#495057'
},
grid: {
color: '#ebedef'
}
},
y: {
ticks: {
color: '#495057'
},
grid: {
color: '#ebedef'
}
}
}
};
this.pieOptions = {
plugins: {
legend: {
labels: {
color: '#495057'
}
}
}
};
this.polarOptions = {
plugins: {
legend: {
labels: {
color: '#495057'
}
}
},
scales: {
r: {
grid: {
color: '#ebedef'
}
}
}
};
this.radarOptions = {
plugins: {
legend: {
labels: {
color: '#495057'
}
}
},
scales: {
r: {
grid: {
color: '#ebedef'
}
}
}
};
},
applyDarkTheme() {
this.lineOptions = {
plugins: {
legend: {
labels: {
color: '#ebedef'
}
}
},
scales: {
x: {
ticks: {
color: '#ebedef'
},
grid: {
color: 'rgba(160, 167, 181, .3)'
}
},
y: {
ticks: {
color: '#ebedef'
},
grid: {
color: 'rgba(160, 167, 181, .3)'
}
}
}
};
this.barOptions = {
plugins: {
legend: {
labels: {
color: '#ebedef'
}
}
},
scales: {
x: {
ticks: {
color: '#ebedef'
},
grid: {
color: 'rgba(160, 167, 181, .3)'
}
},
y: {
ticks: {
color: '#ebedef'
},
grid: {
color: 'rgba(160, 167, 181, .3)'
}
}
}
};
this.pieOptions = {
plugins: {
legend: {
labels: {
color: '#ebedef'
}
}
}
};
this.polarOptions = {
plugins: {
legend: {
labels: {
color: '#ebedef'
}
}
},
scales: {
r: {
grid: {
color: 'rgba(160, 167, 181, .3)'
}
}
}
};
this.radarOptions = {
plugins: {
legend: {
labels: {
color: '#ebedef'
}
}
},
scales: {
r: {
grid: {
color: 'rgba(160, 167, 181, .3)'
}
}
}
};
}
}
};
</script>

View File

@@ -3,7 +3,7 @@
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
<h5>Advanced</h5> <h5>Advanced</h5>
<FileUpload name="demo[]" url="./upload.php" @upload="onUpload" :multiple="true" accept="image/*" :maxFileSize="1000000"/> <FileUpload name="demo[]" url="./upload.php" @upload="onUpload" :multiple="true" accept="image/*" :maxFileSize="1000000" />
<h5>Basic</h5> <h5>Basic</h5>
<FileUpload mode="basic" name="demo[]" url="./upload.php" accept="image/*" :maxFileSize="1000000" @upload="onUpload" /> <FileUpload mode="basic" name="demo[]" url="./upload.php" accept="image/*" :maxFileSize="1000000" @upload="onUpload" />
@@ -12,12 +12,12 @@
</div> </div>
</template> </template>
<script> <script setup>
export default { import { useToast } from 'primevue/usetoast';
methods: {
onUpload() { const toast = useToast();
this.$toast.add({severity: 'info', summary: 'Success', detail: 'File Uploaded', life: 3000});
} const onUpload = () => {
} toast.add({ severity: 'info', summary: 'Success', detail: 'File Uploaded', life: 3000 });
} };
</script> </script>

View File

@@ -54,11 +54,11 @@
<div class="formgroup-inline"> <div class="formgroup-inline">
<div class="field"> <div class="field">
<label for="firstname1" class="p-sr-only">Firstname</label> <label for="firstname1" class="p-sr-only">Firstname</label>
<InputText id="firstname1" type="text" placeholder="Firstname"/> <InputText id="firstname1" type="text" placeholder="Firstname" />
</div> </div>
<div class="field"> <div class="field">
<label for="lastname1" class="p-sr-only">Lastname</label> <label for="lastname1" class="p-sr-only">Lastname</label>
<InputText id="lastname1" type="text" placeholder="Lastname"/> <InputText id="lastname1" type="text" placeholder="Lastname" />
</div> </div>
<Button label="Submit"></Button> <Button label="Submit"></Button>
</div> </div>
@@ -80,15 +80,15 @@
<div class="p-fluid formgrid grid"> <div class="p-fluid formgrid grid">
<div class="field col-12 md:col-6"> <div class="field col-12 md:col-6">
<label for="firstname2">Firstname</label> <label for="firstname2">Firstname</label>
<InputText id="firstname2" type="text"/> <InputText id="firstname2" type="text" />
</div> </div>
<div class="field col-12 md:col-6"> <div class="field col-12 md:col-6">
<label for="lastname2">Lastname</label> <label for="lastname2">Lastname</label>
<InputText id="lastname2" type="text"/> <InputText id="lastname2" type="text" />
</div> </div>
<div class="field col-12"> <div class="field col-12">
<label for="address">Address</label> <label for="address">Address</label>
<Textarea id="address" rows="4"/> <Textarea id="address" rows="4" />
</div> </div>
<div class="field col-12 md:col-6"> <div class="field col-12 md:col-6">
<label for="city">City</label> <label for="city">City</label>
@@ -100,7 +100,7 @@
</div> </div>
<div class="field col-12 md:col-3"> <div class="field col-12 md:col-3">
<label for="zip">Zip</label> <label for="zip">Zip</label>
<InputText id="zip" type="text"/> <InputText id="zip" type="text" />
</div> </div>
</div> </div>
</div> </div>
@@ -108,17 +108,14 @@
</div> </div>
</template> </template>
<script> <script setup>
export default { import { ref } from 'vue';
data() {
return { const dropdownItems = ref([
dropdownItems: [ { name: 'Option 1', code: 'Option 1' },
{name: 'Option 1', code: 'Option 1'}, { name: 'Option 2', code: 'Option 2' },
{name: 'Option 2', code: 'Option 2'}, { name: 'Option 3', code: 'Option 3' }
{name: 'Option 3', code: 'Option 3'} ]);
],
dropdownItem: null const dropdownItem = ref(null);
}
}
}
</script> </script>

View File

@@ -26,7 +26,7 @@
<h5>Steps</h5> <h5>Steps</h5>
<p>Steps and TabMenu are integrated with the same child routes.</p> <p>Steps and TabMenu are integrated with the same child routes.</p>
<Steps :model="nestedRouteItems" :readonly="false" /> <Steps :model="nestedRouteItems" :readonly="false" />
<router-view/> <router-view />
</div> </div>
</div> </div>
@@ -35,7 +35,7 @@
<h5>TabMenu</h5> <h5>TabMenu</h5>
<p>Steps and TabMenu are integrated with the same child routes.</p> <p>Steps and TabMenu are integrated with the same child routes.</p>
<TabMenu :model="nestedRouteItems" /> <TabMenu :model="nestedRouteItems" />
<router-view/> <router-view />
</div> </div>
</div> </div>
@@ -58,7 +58,7 @@
<h5>Overlay Menu</h5> <h5>Overlay Menu</h5>
<Menu ref="menu" :model="overlayMenuItems" :popup="true" /> <Menu ref="menu" :model="overlayMenuItems" :popup="true" />
<Button type="button" label="Options" icon="pi pi-angle-down" @click="toggleMenu" style="width: auto"/> <Button type="button" label="Options" icon="pi pi-angle-down" @click="toggleMenu" style="width: auto" />
</div> </div>
<div class="card" @contextmenu="onContextRightClick"> <div class="card" @contextmenu="onContextRightClick">
@@ -84,103 +84,94 @@
<PanelMenu :model="panelMenuitems" /> <PanelMenu :model="panelMenuitems" />
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script setup>
export default { import { ref } from 'vue';
data() {
return {
nestedMenuitems: [
{
label:'Customers',
icon:'pi pi-fw pi-table',
items:[
{
label:'New',
icon:'pi pi-fw pi-user-plus',
items:[
{
label:'Customer',
icon:'pi pi-fw pi-plus'
},
{
label:'Duplicate',
icon:'pi pi-fw pi-copy'
},
] const menu = ref(null);
const contextMenu = ref(null);
const nestedMenuitems = ref([
{
label: 'Customers',
icon: 'pi pi-fw pi-table',
items: [
{
label: 'New',
icon: 'pi pi-fw pi-user-plus',
items: [
{
label: 'Customer',
icon: 'pi pi-fw pi-plus'
}, },
{ {
label:'Edit', label: 'Duplicate',
icon:'pi pi-fw pi-user-edit' icon: 'pi pi-fw pi-copy'
} }
] ]
}, },
{ {
label:'Orders', label: 'Edit',
icon:'pi pi-fw pi-shopping-cart', icon: 'pi pi-fw pi-user-edit'
items:[
{
label:'View',
icon:'pi pi-fw pi-list'
},
{
label:'Search',
icon:'pi pi-fw pi-search'
},
]
},
{
label:'Shipments',
icon:'pi pi-fw pi-envelope',
items:[
{
label:'Tracker',
icon:'pi pi-fw pi-compass'
},
{
label:'Map',
icon:'pi pi-fw pi-map-marker'
},
{
label:'Manage',
icon:'pi pi-fw pi-pencil'
} }
] ]
}, },
{ {
label:'Profile', label: 'Orders',
icon:'pi pi-fw pi-user', icon: 'pi pi-fw pi-shopping-cart',
items:[ items: [
{ {
label:'Settings', label: 'View',
icon:'pi pi-fw pi-cog' icon: 'pi pi-fw pi-list'
}, },
{ {
label:'Billing', label: 'Search',
icon:'pi pi-fw pi-file' icon: 'pi pi-fw pi-search'
} }
] ]
}, },
{ {
label:'Quit', label: 'Shipments',
icon:'pi pi-fw pi-sign-out' icon: 'pi pi-fw pi-envelope',
items: [
{
label: 'Tracker',
icon: 'pi pi-fw pi-compass'
},
{
label: 'Map',
icon: 'pi pi-fw pi-map-marker'
},
{
label: 'Manage',
icon: 'pi pi-fw pi-pencil'
} }
], ]
breadcrumbHome: {icon: 'pi pi-home', to: '/'}, },
breadcrumbItems: [ {
{label:'Computer'}, label: 'Profile',
{label:'Notebook'}, icon: 'pi pi-fw pi-user',
{label:'Accessories'}, items: [
{label:'Backpacks'}, {
{label:'Item'} label: 'Settings',
], icon: 'pi pi-fw pi-cog'
nestedRouteItems: [ },
{
label: 'Billing',
icon: 'pi pi-fw pi-file'
}
]
},
{
label: 'Quit',
icon: 'pi pi-fw pi-sign-out'
}
]);
const breadcrumbHome = ref({ icon: 'pi pi-home', to: '/' });
const breadcrumbItems = ref([{ label: 'Computer' }, { label: 'Notebook' }, { label: 'Accessories' }, { label: 'Backpacks' }, { label: 'Item' }]);
const nestedRouteItems = ref([
{ {
label: 'Personal', label: 'Personal',
to: '/menu' to: '/menu'
@@ -197,91 +188,87 @@
label: 'Confirmation', label: 'Confirmation',
to: '/menu/confirmation' to: '/menu/confirmation'
} }
], ]);
tieredMenuItems: [ const tieredMenuItems = ref([
{ {
label:'Customers', label: 'Customers',
icon:'pi pi-fw pi-table', icon: 'pi pi-fw pi-table',
items:[ items: [
{ {
label:'New', label: 'New',
icon:'pi pi-fw pi-user-plus', icon: 'pi pi-fw pi-user-plus',
items:[ items: [
{ {
label:'Customer', label: 'Customer',
icon:'pi pi-fw pi-plus' icon: 'pi pi-fw pi-plus'
}, },
{ {
label:'Duplicate', label: 'Duplicate',
icon:'pi pi-fw pi-copy' icon: 'pi pi-fw pi-copy'
},
]
},
{
label:'Edit',
icon:'pi pi-fw pi-user-edit'
} }
] ]
}, },
{ {
label:'Orders', label: 'Edit',
icon:'pi pi-fw pi-shopping-cart', icon: 'pi pi-fw pi-user-edit'
items:[
{
label:'View',
icon:'pi pi-fw pi-list'
},
{
label:'Search',
icon:'pi pi-fw pi-search'
},
]
},
{
label:'Shipments',
icon:'pi pi-fw pi-envelope',
items:[
{
label:'Tracker',
icon:'pi pi-fw pi-compass'
},
{
label:'Map',
icon:'pi pi-fw pi-map-marker'
},
{
label:'Manage',
icon:'pi pi-fw pi-pencil'
} }
] ]
}, },
{ {
label:'Profile', label: 'Orders',
icon:'pi pi-fw pi-user', icon: 'pi pi-fw pi-shopping-cart',
items:[ items: [
{ {
label:'Settings', label: 'View',
icon:'pi pi-fw pi-cog' icon: 'pi pi-fw pi-list'
}, },
{ {
label:'Billing', label: 'Search',
icon:'pi pi-fw pi-file' icon: 'pi pi-fw pi-search'
} }
] ]
}, },
{ {
separator:true label: 'Shipments',
icon: 'pi pi-fw pi-envelope',
items: [
{
label: 'Tracker',
icon: 'pi pi-fw pi-compass'
}, },
{ {
label:'Quit', label: 'Map',
icon:'pi pi-fw pi-sign-out' icon: 'pi pi-fw pi-map-marker'
},
{
label: 'Manage',
icon: 'pi pi-fw pi-pencil'
} }
], ]
overlayMenuItems: [ },
{
label: 'Profile',
icon: 'pi pi-fw pi-user',
items: [
{
label: 'Settings',
icon: 'pi pi-fw pi-cog'
},
{
label: 'Billing',
icon: 'pi pi-fw pi-file'
}
]
},
{
separator: true
},
{
label: 'Quit',
icon: 'pi pi-fw pi-sign-out'
}
]);
const overlayMenuItems = ref([
{ {
label: 'Save', label: 'Save',
icon: 'pi pi-save' icon: 'pi pi-save'
@@ -300,38 +287,37 @@
{ {
label: 'Home', label: 'Home',
icon: 'pi pi-home' icon: 'pi pi-home'
}, }
], ]);
menuitems: [ const menuitems = ref([
{ {
label:'Customers', label: 'Customers',
items:[ items: [
{ {
label:'New', label: 'New',
icon:'pi pi-fw pi-plus', icon: 'pi pi-fw pi-plus'
}, },
{ {
label:'Edit', label: 'Edit',
icon:'pi pi-fw pi-user-edit' icon: 'pi pi-fw pi-user-edit'
} }
] ]
}, },
{ {
label:'Orders', label: 'Orders',
items:[ items: [
{ {
label:'View', label: 'View',
icon:'pi pi-fw pi-list' icon: 'pi pi-fw pi-list'
}, },
{ {
label:'Search', label: 'Search',
icon:'pi pi-fw pi-search' icon: 'pi pi-fw pi-search'
}, }
] ]
} }
], ]);
contextMenuItems: [ const contextMenuItems = ref([
{ {
label: 'Save', label: 'Save',
icon: 'pi pi-save' icon: 'pi pi-save'
@@ -350,197 +336,194 @@
{ {
label: 'Options', label: 'Options',
icon: 'pi pi-cog' icon: 'pi pi-cog'
}, }
], ]);
megamenuItems: [ const megamenuItems = ref([
{ {
label: 'Fashion', icon: 'pi pi-fw pi-tag', label: 'Fashion',
icon: 'pi pi-fw pi-tag',
items: [ items: [
[ [
{ {
label: 'Woman', label: 'Woman',
items: [{label: 'Woman Item'}, {label: 'Woman Item'}, {label: 'Woman Item'}] items: [{ label: 'Woman Item' }, { label: 'Woman Item' }, { label: 'Woman Item' }]
}, },
{ {
label: 'Men', label: 'Men',
items: [{label: 'Men Item'}, {label: 'Men Item'}, {label: 'Men Item'}] items: [{ label: 'Men Item' }, { label: 'Men Item' }, { label: 'Men Item' }]
} }
], ],
[ [
{ {
label: 'Kids', label: 'Kids',
items: [{label: 'Kids Item'}, {label: 'Kids Item'} ] items: [{ label: 'Kids Item' }, { label: 'Kids Item' }]
}, },
{ {
label: 'Luggage', label: 'Luggage',
items: [{label: 'Luggage Item'}, {label: 'Luggage Item'}, {label: 'Luggage Item'} ] items: [{ label: 'Luggage Item' }, { label: 'Luggage Item' }, { label: 'Luggage Item' }]
} }
] ]
] ]
}, },
{ {
label: 'Electronics', icon: 'pi pi-fw pi-desktop', label: 'Electronics',
icon: 'pi pi-fw pi-desktop',
items: [ items: [
[ [
{ {
label: 'Computer', label: 'Computer',
items: [{label: 'Computer Item'}, {label: 'Computer Item'}] items: [{ label: 'Computer Item' }, { label: 'Computer Item' }]
}, },
{ {
label: 'Camcorder', label: 'Camcorder',
items: [{label: 'Camcorder Item'}, {label: 'Camcorder Item'}, {label: 'Camcorder Item'}, ] items: [{ label: 'Camcorder Item' }, { label: 'Camcorder Item' }, { label: 'Camcorder Item' }]
}, }
], ],
[ [
{ {
label: 'TV', label: 'TV',
items: [{label: 'TV Item'}, {label: 'TV Item'}] items: [{ label: 'TV Item' }, { label: 'TV Item' }]
}, },
{ {
label: 'Audio', label: 'Audio',
items: [{label: 'Audio Item'}, {label: 'Audio Item'}, {label: 'Audio Item'} ] items: [{ label: 'Audio Item' }, { label: 'Audio Item' }, { label: 'Audio Item' }]
} }
], ],
[ [
{ {
label: 'Sports.7', label: 'Sports.7',
items: [{label: 'Sports.7.1'}, {label: 'Sports.7.2'}] items: [{ label: 'Sports.7.1' }, { label: 'Sports.7.2' }]
} }
] ]
] ]
}, },
{ {
label: 'Furniture', icon: 'pi pi-fw pi-image', label: 'Furniture',
icon: 'pi pi-fw pi-image',
items: [ items: [
[ [
{ {
label: 'Living Room', label: 'Living Room',
items: [{label: 'Living Room Item'}, {label: 'Living Room Item'}, ] items: [{ label: 'Living Room Item' }, { label: 'Living Room Item' }]
}, },
{ {
label: 'Kitchen', label: 'Kitchen',
items: [{label: 'Kitchen Item'}, {label: 'Kitchen Item'}, {label: 'Kitchen Item'} ] items: [{ label: 'Kitchen Item' }, { label: 'Kitchen Item' }, { label: 'Kitchen Item' }]
} }
], ],
[ [
{ {
label: 'Bedroom', label: 'Bedroom',
items: [{label: 'Bedroom Item'}, {label: 'Bedroom Item'}] items: [{ label: 'Bedroom Item' }, { label: 'Bedroom Item' }]
}, },
{ {
label: 'Outdoor', label: 'Outdoor',
items: [{label: 'Outdoor Item'}, {label: 'Outdoor Item'}, {label: 'Outdoor Item'} ] items: [{ label: 'Outdoor Item' }, { label: 'Outdoor Item' }, { label: 'Outdoor Item' }]
} }
] ]
] ]
}, },
{ {
label: 'Sports', icon: 'pi pi-fw pi-star', label: 'Sports',
icon: 'pi pi-fw pi-star',
items: [ items: [
[ [
{ {
label: 'Basketball', label: 'Basketball',
items: [{label: 'Basketball Item'}, {label: 'Basketball Item'}] items: [{ label: 'Basketball Item' }, { label: 'Basketball Item' }]
}, },
{ {
label: 'Football', label: 'Football',
items: [{label: 'Football Item'}, {label: 'Football Item'}, {label: 'Football Item'}] items: [{ label: 'Football Item' }, { label: 'Football Item' }, { label: 'Football Item' }]
} }
], ],
[ [
{ {
label: 'Tennis', label: 'Tennis',
items: [{label: 'Tennis Item'}, {label: 'Tennis Item'}] items: [{ label: 'Tennis Item' }, { label: 'Tennis Item' }]
} }
] ]
] ]
} }
], ]);
panelMenuitems: [ const panelMenuitems = ref([
{ {
label:'Customers', label: 'Customers',
icon:'pi pi-fw pi-table', icon: 'pi pi-fw pi-table',
items:[ items: [
{ {
label:'New', label: 'New',
icon:'pi pi-fw pi-user-plus', icon: 'pi pi-fw pi-user-plus',
items:[ items: [
{ {
label:'Customer', label: 'Customer',
icon:'pi pi-fw pi-plus' icon: 'pi pi-fw pi-plus'
}, },
{ {
label:'Duplicate', label: 'Duplicate',
icon:'pi pi-fw pi-copy' icon: 'pi pi-fw pi-copy'
}
]
}, },
{
label: 'Edit',
icon: 'pi pi-fw pi-user-edit'
}
]
},
{
label: 'Orders',
icon: 'pi pi-fw pi-shopping-cart',
items: [
{
label: 'View',
icon: 'pi pi-fw pi-list'
},
{
label: 'Search',
icon: 'pi pi-fw pi-search'
}
]
},
{
label: 'Shipments',
icon: 'pi pi-fw pi-envelope',
items: [
{
label: 'Tracker',
icon: 'pi pi-fw pi-compass'
},
{
label: 'Map',
icon: 'pi pi-fw pi-map-marker'
},
{
label: 'Manage',
icon: 'pi pi-fw pi-pencil'
}
]
},
{
label: 'Profile',
icon: 'pi pi-fw pi-user',
items: [
{
label: 'Settings',
icon: 'pi pi-fw pi-cog'
},
{
label: 'Billing',
icon: 'pi pi-fw pi-file'
}
]
}
]);
] const toggleMenu = (event) => {
}, menu.value.toggle(event);
{ };
label:'Edit',
icon:'pi pi-fw pi-user-edit'
}
]
},
{
label:'Orders',
icon:'pi pi-fw pi-shopping-cart',
items:[
{
label:'View',
icon:'pi pi-fw pi-list'
},
{
label:'Search',
icon:'pi pi-fw pi-search'
},
] const onContextRightClick = (event) => {
}, contextMenu.value.show(event);
{ };
label:'Shipments',
icon:'pi pi-fw pi-envelope',
items:[
{
label:'Tracker',
icon:'pi pi-fw pi-compass'
},
{
label:'Map',
icon:'pi pi-fw pi-map-marker'
},
{
label:'Manage',
icon:'pi pi-fw pi-pencil'
}
]
},
{
label:'Profile',
icon:'pi pi-fw pi-user',
items:[
{
label:'Settings',
icon:'pi pi-fw pi-cog'
},
{
label:'Billing',
icon:'pi pi-fw pi-file'
}
]
}
],
}
},
methods: {
toggleMenu(event) {
this.$refs.menu.toggle(event);
},
onContextRightClick(event) {
this.$refs.contextMenu.show(event);
}
}
}
</script> </script>

View File

@@ -16,13 +16,13 @@
<div class="card"> <div class="card">
<h5>Messages</h5> <h5>Messages</h5>
<Button label="Success" @click="addMessage('success')" class="p-button-success mr-2"/> <Button label="Success" @click="addMessage('success')" class="p-button-success mr-2" />
<Button label="Info" @click="addMessage('info')" class="p-button-info mr-2"/> <Button label="Info" @click="addMessage('info')" class="p-button-info mr-2" />
<Button label="Warn" @click="addMessage('warn')" class="p-button-warning mr-2"/> <Button label="Warn" @click="addMessage('warn')" class="p-button-warning mr-2" />
<Button label="Error" @click="addMessage('error')" class="p-button-danger mr-2"/> <Button label="Error" @click="addMessage('error')" class="p-button-danger mr-2" />
<transition-group name="p-message" tag="div"> <transition-group name="p-message" tag="div">
<Message v-for="msg of message" :severity="msg.severity" :key="msg.content">{{msg.content}}</Message> <Message v-for="msg of message" :severity="msg.severity" :key="msg.content">{{ msg.content }}</Message>
</transition-group> </transition-group>
</div> </div>
</div> </div>
@@ -41,7 +41,7 @@
<label for="email" class="col-fixed w-9rem">Email</label> <label for="email" class="col-fixed w-9rem">Email</label>
<div class="col"> <div class="col">
<InputText id="email" v-model="email" :required="true" class="p-invalid mr-2"></InputText> <InputText id="email" v-model="email" :required="true" class="p-invalid mr-2"></InputText>
<InlineMessage/> <InlineMessage />
</div> </div>
</div> </div>
</div> </div>
@@ -60,42 +60,40 @@
</div> </div>
</template> </template>
<script> <script setup>
export default { import { ref } from 'vue';
data() { import { useToast } from 'primevue/usetoast';
return {
message: [], const toast = useToast();
username:null, const message = ref([]);
email:null const username = ref(null);
} const email = ref(null);
},
methods: { const addMessage = (type) => {
addMessage(type) { if (type === 'success') {
if(type === 'success') { this.message = [{ severity: 'success', detail: 'Success Message', content: 'Message sent', id: this.count++ }];
this.message = [{severity: 'success', detail: 'Success Message', content: 'Message sent', id: this.count++}] } else if (type === 'info') {
} this.message = [{ severity: 'info', detail: 'Info Message', content: 'PrimeVue rocks', id: this.count++ }];
else if(type === 'info') { } else if (type === 'warn') {
this.message = [{severity: 'info', detail: 'Info Message', content: 'PrimeVue rocks', id: this.count++}] this.message = [{ severity: 'warn', detail: 'Warn Message', content: 'There are unsaved changes', id: this.count++ }];
} } else if (type === 'error') {
else if(type === 'warn') { this.message = [{ severity: 'error', detail: 'Error Message', content: 'Validation failed', id: this.count++ }];
this.message = [{severity: 'warn', detail: 'Warn Message', content: 'There are unsaved changes', id: this.count++}]
}
else if(type === 'error') {
this.message = [{severity: 'error', detail: 'Error Message', content: 'Validation failed', id: this.count++}]
}
},
showSuccess() {
this.$toast.add({severity:'success', summary: 'Success Message', detail:'Message Detail', life: 3000});
},
showInfo() {
this.$toast.add({severity:'info', summary: 'Info Message', detail:'Message Detail', life: 3000});
},
showWarn() {
this.$toast.add({severity:'warn', summary: 'Warn Message', detail:'Message Detail', life: 3000});
},
showError() {
this.$toast.add({severity:'error', summary: 'Error Message', detail:'Message Detail', life: 3000});
},
}
} }
};
const showSuccess = () => {
toast.add({ severity: 'success', summary: 'Success Message', detail: 'Message Detail', life: 3000 });
};
const showInfo = () => {
toast.add({ severity: 'info', summary: 'Info Message', detail: 'Message Detail', life: 3000 });
};
const showWarn = () => {
toast.add({ severity: 'warn', summary: 'Warn Message', detail: 'Message Detail', life: 3000 });
};
const showError = () => {
toast.add({ severity: 'error', summary: 'Error Message', detail: 'Message Detail', life: 3000 });
};
</script> </script>

View File

@@ -30,7 +30,6 @@
<i class="pi pi-calendar mr-4 p-text-secondary" style="font-size: 2rem" v-badge.danger="'10+'"></i> <i class="pi pi-calendar mr-4 p-text-secondary" style="font-size: 2rem" v-badge.danger="'10+'"></i>
<i class="pi pi-envelope p-text-secondary" style="font-size: 2rem" v-badge.danger></i> <i class="pi pi-envelope p-text-secondary" style="font-size: 2rem" v-badge.danger></i>
<h5>Inline Button Badge</h5> <h5>Inline Button Badge</h5>
<Button label="Emails" badge="8" class="mr-2"></Button> <Button label="Emails" badge="8" class="mr-2"></Button>
<Button label="Messages" icon="pi pi-users" class="p-button-warning" badge="8" badgeClass="p-badge-danger"></Button> <Button label="Messages" icon="pi pi-users" class="p-button-warning" badge="8" badgeClass="p-badge-danger"></Button>
@@ -52,13 +51,13 @@
<Avatar image="images/avatar/onyamalimba.png" size="large" shape="circle"></Avatar> <Avatar image="images/avatar/onyamalimba.png" size="large" shape="circle"></Avatar>
<Avatar image="images/avatar/ionibowcher.png" size="large" shape="circle"></Avatar> <Avatar image="images/avatar/ionibowcher.png" size="large" shape="circle"></Avatar>
<Avatar image="images/avatar/xuxuefeng.png" size="large" shape="circle"></Avatar> <Avatar image="images/avatar/xuxuefeng.png" size="large" shape="circle"></Avatar>
<Avatar label="+2" shape="circle" size="large" :style="{'background-color':'#9c27b0', 'color': '#ffffff'}"></Avatar> <Avatar label="+2" shape="circle" size="large" :style="{ 'background-color': '#9c27b0', color: '#ffffff' }"></Avatar>
</AvatarGroup> </AvatarGroup>
<h5>Label - Circle</h5> <h5>Label - Circle</h5>
<Avatar label="P" class="mr-2" size="xlarge" shape="circle"></Avatar> <Avatar label="P" class="mr-2" size="xlarge" shape="circle"></Avatar>
<Avatar label="V" class="mr-2" size="large" :style="{'background-color':'#2196F3', 'color': '#ffffff'}" shape="circle"></Avatar> <Avatar label="V" class="mr-2" size="large" :style="{ 'background-color': '#2196F3', color: '#ffffff' }" shape="circle"></Avatar>
<Avatar label="U" class="mr-2" :style="{'background-color': '#9c27b0', 'color': '#ffffff'}" shape="circle"></Avatar> <Avatar label="U" class="mr-2" :style="{ 'background-color': '#9c27b0', color: '#ffffff' }" shape="circle"></Avatar>
<h5>Icon - Badge</h5> <h5>Icon - Badge</h5>
<Avatar icon="pi pi-user" class="mr-2" size="xlarge" v-badge.success="4"></Avatar> <Avatar icon="pi pi-user" class="mr-2" size="xlarge" v-badge.success="4"></Avatar>
@@ -66,19 +65,13 @@
<div class="card"> <div class="card">
<h4>ScrollTop</h4> <h4>ScrollTop</h4>
<ScrollPanel :style="{width: '250px', height: '200px'}"> <ScrollPanel :style="{ width: '250px', height: '200px' }">
<p> <p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae et leo duis ut diam. Ultricies mi quis hendrerit dolor magna eget est lorem. Amet consectetur
Vitae et leo duis ut diam. adipiscing elit ut. Nam libero justo laoreet sit amet. Pharetra massa massa ultricies mi quis hendrerit dolor magna. Est ultricies integer quis auctor elit sed vulputate. Consequat ac felis donec et. Tellus orci ac auctor
Ultricies mi quis hendrerit dolor magna eget est lorem. Amet consectetur adipiscing elit ut. augue mauris. Semper feugiat nibh sed pulvinar proin gravida hendrerit lectus a. Tincidunt arcu non sodales neque sodales. Metus aliquam eleifend mi in nulla posuere sollicitudin aliquam ultrices. Sodales ut etiam sit amet
Nam libero justo laoreet sit amet. Pharetra massa massa ultricies mi quis hendrerit dolor magna. nisl purus. Cursus sit amet dictum sit amet. Tristique senectus et netus et malesuada fames ac turpis egestas. Et tortor consequat id porta nibh venenatis cras sed. Diam maecenas ultricies mi eget mauris. Eget egestas purus
Est ultricies integer quis auctor elit sed vulputate. Consequat ac felis donec et. Tellus orci ac auctor augue mauris. viverra accumsan in nisl nisi. Suscipit adipiscing bibendum est ultricies integer. Mattis aliquam faucibus purus in massa tempor nec.
Semper feugiat nibh sed pulvinar proin gravida hendrerit lectus a. Tincidunt arcu non sodales neque sodales.
Metus aliquam eleifend mi in nulla posuere sollicitudin aliquam ultrices. Sodales ut etiam sit amet nisl purus.
Cursus sit amet dictum sit amet. Tristique senectus et netus et malesuada fames ac turpis egestas.
Et tortor consequat id porta nibh venenatis cras sed. Diam maecenas ultricies mi eget mauris.
Eget egestas purus viverra accumsan in nisl nisi. Suscipit adipiscing bibendum est ultricies integer.
Mattis aliquam faucibus purus in massa tempor nec.
</p> </p>
<ScrollTop target="parent" :threshold="100" icon="pi pi-arrow-up"></ScrollTop> <ScrollTop target="parent" :threshold="100" icon="pi pi-arrow-up"></ScrollTop>
</ScrollPanel> </ScrollPanel>
@@ -154,38 +147,34 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script setup>
export default { import { ref, onMounted, onBeforeUnmount } from 'vue';
data() {
return { const value = ref(0);
value: 0 let interval = null;
}
}, const startProgress = () => {
interval: null, interval = setInterval(() => {
methods: { let newValue = value.value + Math.floor(Math.random() * 10) + 1;
startProgress() {
this.interval = setInterval(() => {
let newValue = this.value + Math.floor(Math.random() * 10) + 1;
if (newValue >= 100) { if (newValue >= 100) {
newValue = 100; newValue = 100;
} }
this.value = newValue; value.value = newValue;
}, 2000); }, 2000);
}, };
endProgress() { const endProgress = () => {
clearInterval(this.interval); clearInterval(interval);
this.interval = null; interval = null;
} };
},
mounted() { onMounted(() => {
this.startProgress(); startProgress();
}, });
beforeUnmount() {
this.endProgress(); onBeforeUnmount(() => {
} endProgress();
} });
</script> </script>