Skip to content

Commit

Permalink
Refactor #5437 - SpeedDial
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Mar 18, 2024
1 parent 89e01ff commit 926b085
Show file tree
Hide file tree
Showing 8 changed files with 148 additions and 149 deletions.
2 changes: 1 addition & 1 deletion components/lib/themes/primeone/base/speeddial/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default {
css: ({ dt }) => `
.p-speeddial {
position: absolute;
position: static;
display: flex;
gap: 0.25rem;
}
Expand Down
14 changes: 7 additions & 7 deletions doc/speeddial/CircleDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<p>Items can be displayed around the button when <i>type</i> is set to <i>circle</i>. Additional <i>radius</i> property defines the radius of the circle.</p>
</DocSectionText>
<div class="card">
<div :style="{ height: '500px' }" class="flex align-items-center justify-content-center">
<SpeedDial :model="items" :radius="80" type="circle" buttonClass="p-button-warning" />
<div :style="{ position: 'relative', height: '500px' }" class="flex align-items-center justify-content-center">
<SpeedDial :model="items" :radius="80" type="circle" buttonClass="p-button-warning" :style="{ position: 'absolute' }" />
</div>
</div>
<DocSectionCode :code="code" />
Expand Down Expand Up @@ -53,13 +53,13 @@ export default {
],
code: {
basic: `
<SpeedDial :model="items" :radius="80" type="circle" buttonClass="p-button-warning" />
<SpeedDial :model="items" :radius="80" type="circle" buttonClass="p-button-warning" :style="{ position: 'absolute' }" />
`,
options: `
<template>
<div class="card">
<div :style="{ height: '500px' }" class="flex align-items-center justify-content-center">
<SpeedDial :model="items" :radius="80" type="circle" buttonClass="p-button-warning" />
<div :style="{ position: 'relative', height: '500px' }" class="flex align-items-center justify-content-center">
<SpeedDial :model="items" :radius="80" type="circle" buttonClass="p-button-warning" :style="{ position: 'absolute' }" />
<Toast />
</div>
</div>
Expand Down Expand Up @@ -114,8 +114,8 @@ export default {
composition: `
<template>
<div class="card">
<div :style="{ height: '500px' }" class="flex align-items-center justify-content-center">
<SpeedDial :model="items" :radius="80" type="circle" buttonClass="p-button-warning" />
<div :style="{ position: 'relative', height: '500px' }" class="flex align-items-center justify-content-center">
<SpeedDial :model="items" :radius="80" type="circle" buttonClass="p-button-warning" :style="{ position: 'absolute' }" />
<Toast />
</div>
</div>
Expand Down
161 changes: 80 additions & 81 deletions doc/speeddial/CustomDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</DocSectionText>
<div class="card">
<div class="flex align-items-end justify-content-center" :style="{ position: 'relative', height: '350px' }">
<SpeedDial :model="items" direction="up" :transitionDelay="80" showIcon="pi pi-bars" hideIcon="pi pi-times" buttonClass="p-button-outlined" />
<SpeedDial :model="items" direction="up" :transitionDelay="80" showIcon="pi pi-bars" hideIcon="pi pi-times" buttonClass="p-button-outlined" :style="{ position: 'absolute' }" />
</div>
</div>
<DocSectionCode :code="code" />
Expand Down Expand Up @@ -53,62 +53,61 @@ export default {
],
code: {
basic: `
<Toast />
<SpeedDial :model="items" direction="up" :transitionDelay="80" showIcon="pi pi-bars" hideIcon="pi pi-times" buttonClass="p-button-outlined" />
<SpeedDial :model="items" direction="up" :transitionDelay="80" showIcon="pi pi-bars" hideIcon="pi pi-times" buttonClass="p-button-outlined" :style="{ position: 'absolute' }" />
`,
options: `
<template>
<div class="card">
<div class="flex align-items-end justify-content-center" :style="{ position: 'relative', height: '350px' }">
<Toast />
<SpeedDial :model="items" direction="up" :transitionDelay="80" showIcon="pi pi-bars" hideIcon="pi pi-times" buttonClass="p-button-outlined" />
<SpeedDial :model="items" direction="up" :transitionDelay="80" showIcon="pi pi-bars" hideIcon="pi pi-times" buttonClass="p-button-outlined" :style="{ position: 'absolute' }" />
</div>
</div>
</template>
<script>
export default {
data() {
return {
items: [
{
label: 'Add',
icon: 'pi pi-pencil',
command: () => {
this.$toast.add({ severity: 'info', summary: 'Add', detail: 'Data Added' });
}
},
{
label: 'Update',
icon: 'pi pi-refresh',
command: () => {
this.$toast.add({ severity: 'success', summary: 'Update', detail: 'Data Updated' });
}
},
{
label: 'Delete',
icon: 'pi pi-trash',
command: () => {
this.$toast.add({ severity: 'error', summary: 'Delete', detail: 'Data Deleted' });
}
},
{
label: 'Upload',
icon: 'pi pi-upload',
command: () => {
this.$router.push('/fileupload');
}
},
{
label: 'Vue Website',
icon: 'pi pi-external-link',
command: () => {
window.location.href = 'https://vuejs.org/';
}
}
]
}
}
data() {
return {
items: [
{
label: 'Add',
icon: 'pi pi-pencil',
command: () => {
this.$toast.add({ severity: 'info', summary: 'Add', detail: 'Data Added' });
}
},
{
label: 'Update',
icon: 'pi pi-refresh',
command: () => {
this.$toast.add({ severity: 'success', summary: 'Update', detail: 'Data Updated' });
}
},
{
label: 'Delete',
icon: 'pi pi-trash',
command: () => {
this.$toast.add({ severity: 'error', summary: 'Delete', detail: 'Data Deleted' });
}
},
{
label: 'Upload',
icon: 'pi pi-upload',
command: () => {
this.$router.push('/fileupload');
}
},
{
label: 'Vue Website',
icon: 'pi pi-external-link',
command: () => {
window.location.href = 'https://vuejs.org/';
}
}
]
}
}
};
<\/script>
`,
Expand All @@ -117,7 +116,7 @@ export default {
<div class="card">
<div class="flex align-items-end justify-content-center" :style="{ position: 'relative', height: '350px' }">
<Toast />
<SpeedDial :model="items" direction="up" :transitionDelay="80" showIcon="pi pi-bars" hideIcon="pi pi-times" buttonClass="p-button-outlined" />
<SpeedDial :model="items" direction="up" :transitionDelay="80" showIcon="pi pi-bars" hideIcon="pi pi-times" buttonClass="p-button-outlined" :style="{ position: 'absolute' }" />
</div>
</div>
</template>
Expand All @@ -131,41 +130,41 @@ const toast = useToast();
const router = useRouter();
const items = ref([
{
label: 'Add',
icon: 'pi pi-pencil',
command: () => {
toast.add({ severity: 'info', summary: 'Add', detail: 'Data Added' });
}
},
{
label: 'Update',
icon: 'pi pi-refresh',
command: () => {
toast.add({ severity: 'success', summary: 'Update', detail: 'Data Updated' });
}
},
{
label: 'Delete',
icon: 'pi pi-trash',
command: () => {
toast.add({ severity: 'error', summary: 'Delete', detail: 'Data Deleted' });
}
},
{
label: 'Upload',
icon: 'pi pi-upload',
command: () => {
router.push('/fileupload');
}
},
{
label: 'Vue Website',
icon: 'pi pi-external-link',
command: () => {
window.location.href = 'https://vuejs.org/'
}
}
{
label: 'Add',
icon: 'pi pi-pencil',
command: () => {
toast.add({ severity: 'info', summary: 'Add', detail: 'Data Added' });
}
},
{
label: 'Update',
icon: 'pi pi-refresh',
command: () => {
toast.add({ severity: 'success', summary: 'Update', detail: 'Data Updated' });
}
},
{
label: 'Delete',
icon: 'pi pi-trash',
command: () => {
toast.add({ severity: 'error', summary: 'Delete', detail: 'Data Deleted' });
}
},
{
label: 'Upload',
icon: 'pi pi-upload',
command: () => {
router.push('/fileupload');
}
},
{
label: 'Vue Website',
icon: 'pi pi-external-link',
command: () => {
window.location.href = 'https://vuejs.org/'
}
}
])
<\/script>
`
Expand Down
32 changes: 16 additions & 16 deletions doc/speeddial/LinearDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
</DocSectionText>
<div class="card">
<div :style="{ position: 'relative', height: '500px' }">
<SpeedDial :model="items" direction="up" :style="{ left: 'calc(50% - 2rem)', bottom: 0 }" />
<SpeedDial :model="items" direction="down" :style="{ left: 'calc(50% - 2rem)', top: 0 }" />
<SpeedDial :model="items" direction="left" :style="{ top: 'calc(50% - 2rem)', right: 0 }" />
<SpeedDial :model="items" direction="right" :style="{ top: 'calc(50% - 2rem)', left: 0 }" />
<SpeedDial :model="items" direction="up" :style="{ position: 'absolute', left: 'calc(50% - 2rem)', bottom: 0 }" />
<SpeedDial :model="items" direction="down" :style="{ position: 'absolute', left: 'calc(50% - 2rem)', top: 0 }" />
<SpeedDial :model="items" direction="left" :style="{ position: 'absolute', top: 'calc(50% - 2rem)', right: 0 }" />
<SpeedDial :model="items" direction="right" :style="{ position: 'absolute', top: 'calc(50% - 2rem)', left: 0 }" />
</div>
</div>
<DocSectionCode :code="code" />
Expand Down Expand Up @@ -56,19 +56,19 @@ export default {
],
code: {
basic: `
<SpeedDial :model="items" direction="up" :style="{ left: 'calc(50% - 2rem)', bottom: 0 }" />
<SpeedDial :model="items" direction="down" :style="{ left: 'calc(50% - 2rem)', top: 0 }" />
<SpeedDial :model="items" direction="left" :style="{ top: 'calc(50% - 2rem)', right: 0 }" />
<SpeedDial :model="items" direction="right" :style="{ top: 'calc(50% - 2rem)', left: 0 }" />
<SpeedDial :model="items" direction="up" :style="{ position: 'absolute', left: 'calc(50% - 2rem)', bottom: 0 }" />
<SpeedDial :model="items" direction="down" :style="{ position: 'absolute', left: 'calc(50% - 2rem)', top: 0 }" />
<SpeedDial :model="items" direction="left" :style="{ position: 'absolute', top: 'calc(50% - 2rem)', right: 0 }" />
<SpeedDial :model="items" direction="right" :style="{ position: 'absolute', top: 'calc(50% - 2rem)', left: 0 }" />
`,
options: `
<template>
<div class="card">
<div :style="{ position: 'relative', height: '500px' }">
<SpeedDial :model="items" direction="up" :style="{ left: 'calc(50% - 2rem)', bottom: 0 }" />
<SpeedDial :model="items" direction="down" :style="{ left: 'calc(50% - 2rem)', top: 0 }" />
<SpeedDial :model="items" direction="left" :style="{ top: 'calc(50% - 2rem)', right: 0 }" />
<SpeedDial :model="items" direction="right" :style="{ top: 'calc(50% - 2rem)', left: 0 }" />
<SpeedDial :model="items" direction="up" :style="{ position: 'absolute', left: 'calc(50% - 2rem)', bottom: 0 }" />
<SpeedDial :model="items" direction="down" :style="{ position: 'absolute', left: 'calc(50% - 2rem)', top: 0 }" />
<SpeedDial :model="items" direction="left" :style="{ position: 'absolute', top: 'calc(50% - 2rem)', right: 0 }" />
<SpeedDial :model="items" direction="right" :style="{ position: 'absolute', top: 'calc(50% - 2rem)', left: 0 }" />
<Toast />
</div>
</div>
Expand Down Expand Up @@ -124,10 +124,10 @@ export default {
<template>
<div class="card">
<div :style="{ position: 'relative', height: '500px' }">
<SpeedDial :model="items" direction="up" :style="{ left: 'calc(50% - 2rem)', bottom: 0 }" />
<SpeedDial :model="items" direction="down" :style="{ left: 'calc(50% - 2rem)', top: 0 }" />
<SpeedDial :model="items" direction="left" :style="{ top: 'calc(50% - 2rem)', right: 0 }" />
<SpeedDial :model="items" direction="right" :style="{ top: 'calc(50% - 2rem)', left: 0 }" />
<SpeedDial :model="items" direction="up" :style="{ position: 'absolute', left: 'calc(50% - 2rem)', bottom: 0 }" />
<SpeedDial :model="items" direction="down" :style="{ position: 'absolute', left: 'calc(50% - 2rem)', top: 0 }" />
<SpeedDial :model="items" direction="left" :style="{ position: 'absolute', top: 'calc(50% - 2rem)', right: 0 }" />
<SpeedDial :model="items" direction="right" :style="{ position: 'absolute', top: 'calc(50% - 2rem)', left: 0 }" />
<Toast />
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions doc/speeddial/MaskDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</DocSectionText>
<div class="card p-3">
<div :style="{ position: 'relative', height: '350px' }">
<SpeedDial :model="items" direction="up" mask :style="{ right: '1rem', bottom: '1rem' }" />
<SpeedDial :model="items" direction="up" mask :style="{ position: 'absolute', right: '1rem', bottom: '1rem' }" />
</div>
</div>
<DocSectionCode :code="code" />
Expand Down Expand Up @@ -53,13 +53,13 @@ export default {
],
code: {
basic: `
<SpeedDial :model="items" direction="up" mask :style="{ right: '1rem', bottom: '1rem' }" />
<SpeedDial :model="items" direction="up" mask :style="{ position: 'absolute', right: '1rem', bottom: '1rem' }" />
`,
options: `
<template>
<div class="card p-3">
<div :style="{ position: 'relative', height: '350px' }">
<SpeedDial :model="items" direction="up" mask :style="{ right: '1rem', bottom: '1rem' }" />
<SpeedDial :model="items" direction="up" mask :style="{ position: 'absolute', right: '1rem', bottom: '1rem' }" />
</div>
</div>
</template>
Expand Down Expand Up @@ -114,7 +114,7 @@ data() {
<template>
<div class="card p-3">
<div :style="{ position: 'relative', height: '350px' }">
<SpeedDial :model="items" direction="up" mask :style="{ right: '1rem', bottom: '1rem' }" />
<SpeedDial :model="items" direction="up" mask :style="{ position: 'absolute', right: '1rem', bottom: '1rem' }" />
</div>
</div>
</template>
Expand Down
32 changes: 16 additions & 16 deletions doc/speeddial/QuarterCircleDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
</DocSectionText>
<div class="card">
<div :style="{ position: 'relative', height: '500px' }">
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="up-left" :style="{ right: 0, bottom: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="up-right" :style="{ left: 0, bottom: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="down-left" :style="{ right: 0, top: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="down-right" :style="{ left: 0, top: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="up-left" :style="{ position: 'absolute', right: 0, bottom: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="up-right" :style="{ position: 'absolute', left: 0, bottom: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="down-left" :style="{ position: 'absolute', right: 0, top: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="down-right" :style="{ position: 'absolute', left: 0, top: 0 }" />
</div>
</div>
<DocSectionCode :code="code" />
Expand Down Expand Up @@ -56,19 +56,19 @@ export default {
],
code: {
basic: `
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="up-left" :style="{ right: 0, bottom: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="up-right" :style="{ left: 0, bottom: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="down-left" :style="{ right: 0, top: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="down-right" :style="{ left: 0, top: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="up-left" :style="{ position: 'absolute', right: 0, bottom: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="up-right" :style="{ position: 'absolute', left: 0, bottom: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="down-left" :style="{ position: 'absolute', right: 0, top: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="down-right" :style="{ position: 'absolute', left: 0, top: 0 }" />
`,
options: `
<template>
<div class="card">
<div :style="{ position: 'relative', height: '500px' }">
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="up-left" :style="{ right: 0, bottom: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="up-right" :style="{ left: 0, bottom: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="down-left" :style="{ right: 0, top: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="down-right" :style="{ left: 0, top: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="up-left" :style="{ position: 'absolute', right: 0, bottom: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="up-right" :style="{ position: 'absolute', left: 0, bottom: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="down-left" :style="{ position: 'absolute', right: 0, top: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="down-right" :style="{ position: 'absolute', left: 0, top: 0 }" />
<Toast />
</div>
</div>
Expand Down Expand Up @@ -124,10 +124,10 @@ data() {
<template>
<div class="card">
<div :style="{ position: 'relative', height: '500px' }">
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="up-left" :style="{ right: 0, bottom: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="up-right" :style="{ left: 0, bottom: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="down-left" :style="{ right: 0, top: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="down-right" :style="{ left: 0, top: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="up-left" :style="{ position: 'absolute', right: 0, bottom: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="up-right" :style="{ position: 'absolute', left: 0, bottom: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="down-left" :style="{ position: 'absolute', right: 0, top: 0 }" />
<SpeedDial :model="items" :radius="120" type="quarter-circle" direction="down-right" :style="{ position: 'absolute', left: 0, top: 0 }" />
<Toast />
</div>
</div>
Expand Down
Loading

0 comments on commit 926b085

Please sign in to comment.