primevue-mirror/components/lib/dock/Dock.vue

162 lines
2.8 KiB
Vue
Raw Normal View History

2022-09-06 12:03:37 +00:00
<template>
2023-04-26 10:49:14 +00:00
<div :class="containerClass" :style="style" v-bind="ptm('root')">
<DockSub :model="model" :templates="$slots" :exact="exact" :tooltipOptions="tooltipOptions" :position="position" :menuId="menuId" :aria-label="ariaLabel" :aria-labelledby="ariaLabelledby" :tabindex="tabindex" :pt="pt"></DockSub>
2022-09-06 12:03:37 +00:00
</div>
</template>
<script>
2023-04-26 10:49:14 +00:00
import BaseComponent from 'primevue/basecomponent';
2022-09-06 12:03:37 +00:00
import DockSub from './DockSub.vue';
export default {
name: 'Dock',
2023-04-26 10:49:14 +00:00
extends: BaseComponent,
2022-09-06 12:03:37 +00:00
props: {
position: {
type: String,
2022-09-14 11:26:01 +00:00
default: 'bottom'
2022-09-06 12:03:37 +00:00
},
model: null,
class: null,
style: null,
tooltipOptions: null,
exact: {
type: Boolean,
default: true
2022-12-08 11:04:25 +00:00
},
menuId: {
type: String,
default: null
},
tabindex: {
type: Number,
default: 0
},
'aria-label': {
type: String,
default: null
},
'aria-labelledby': {
type: String,
default: null
2022-09-06 12:03:37 +00:00
}
},
computed: {
containerClass() {
return ['p-dock p-component', `p-dock-${this.position}`, this.class];
}
},
components: {
DockSub
}
2022-09-14 11:26:01 +00:00
};
2022-09-06 12:03:37 +00:00
</script>
<style>
.p-dock {
position: absolute;
z-index: 1;
display: flex;
justify-content: center;
align-items: center;
pointer-events: none;
}
.p-dock-list-container {
display: flex;
pointer-events: auto;
}
.p-dock-list {
margin: 0;
padding: 0;
list-style: none;
display: flex;
align-items: center;
justify-content: center;
}
.p-dock-item {
2022-09-14 11:26:01 +00:00
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
2022-09-06 12:03:37 +00:00
will-change: transform;
}
2022-12-08 11:04:25 +00:00
.p-dock-link {
2022-09-06 12:03:37 +00:00
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
overflow: hidden;
cursor: default;
}
.p-dock-item-second-prev,
.p-dock-item-second-next {
transform: scale(1.2);
}
.p-dock-item-prev,
.p-dock-item-next {
transform: scale(1.4);
}
.p-dock-item-current {
transform: scale(1.6);
z-index: 1;
}
/* Position */
/* top */
.p-dock-top {
left: 0;
top: 0;
width: 100%;
}
.p-dock-top .p-dock-item {
transform-origin: center top;
}
/* bottom */
.p-dock-bottom {
left: 0;
bottom: 0;
width: 100%;
}
.p-dock-bottom .p-dock-item {
transform-origin: center bottom;
}
/* right */
.p-dock-right {
right: 0;
top: 0;
height: 100%;
}
.p-dock-right .p-dock-item {
transform-origin: center right;
}
.p-dock-right .p-dock-list {
flex-direction: column;
}
/* left */
.p-dock-left {
left: 0;
top: 0;
height: 100%;
}
.p-dock-left .p-dock-item {
transform-origin: center left;
}
.p-dock-left .p-dock-list {
flex-direction: column;
}
</style>