2022-05-23 08:56:15 -07:00
|
|
|
<template>
|
2022-12-14 01:04:10 -08:00
|
|
|
<Draggable
|
|
|
|
type="panel-resize"
|
|
|
|
@drag="onDrag"
|
|
|
|
@dragstart="onDragStart"
|
|
|
|
@dragend="onDragEnd"
|
|
|
|
:class="$style.dragContainer"
|
|
|
|
>
|
2022-11-18 05:59:31 -08:00
|
|
|
<template #default="{ isDragging }">
|
2022-12-14 01:04:10 -08:00
|
|
|
<div :class="{ [$style.dragButton]: true }">
|
|
|
|
<span
|
|
|
|
v-if="canMoveLeft"
|
|
|
|
:class="{ [$style.leftArrow]: true, [$style.visible]: isDragging }"
|
|
|
|
>
|
2022-05-23 08:56:15 -07:00
|
|
|
<font-awesome-icon icon="arrow-left" />
|
|
|
|
</span>
|
2022-12-14 01:04:10 -08:00
|
|
|
<span
|
|
|
|
v-if="canMoveRight"
|
|
|
|
:class="{ [$style.rightArrow]: true, [$style.visible]: isDragging }"
|
|
|
|
>
|
2022-05-23 08:56:15 -07:00
|
|
|
<font-awesome-icon icon="arrow-right" />
|
|
|
|
</span>
|
|
|
|
<div :class="$style.grid">
|
|
|
|
<div>
|
|
|
|
<div></div>
|
|
|
|
<div></div>
|
|
|
|
<div></div>
|
|
|
|
<div></div>
|
|
|
|
<div></div>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<div></div>
|
|
|
|
<div></div>
|
|
|
|
<div></div>
|
|
|
|
<div></div>
|
|
|
|
<div></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</Draggable>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2022-12-14 01:04:10 -08:00
|
|
|
import Vue from 'vue';
|
2022-05-23 08:56:15 -07:00
|
|
|
import Draggable from './Draggable.vue';
|
|
|
|
|
2022-10-06 06:03:55 -07:00
|
|
|
export default Vue.extend({
|
2022-05-23 08:56:15 -07:00
|
|
|
components: {
|
|
|
|
Draggable,
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
canMoveRight: {
|
|
|
|
type: Boolean,
|
|
|
|
},
|
|
|
|
canMoveLeft: {
|
|
|
|
type: Boolean,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
2022-12-14 01:04:10 -08:00
|
|
|
onDrag(e: { x: number; y: number }) {
|
2022-05-23 08:56:15 -07:00
|
|
|
this.$emit('drag', e);
|
|
|
|
},
|
|
|
|
onDragStart() {
|
|
|
|
this.$emit('dragstart');
|
|
|
|
},
|
|
|
|
onDragEnd() {
|
|
|
|
this.$emit('dragend');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" module>
|
2022-09-22 08:41:15 -07:00
|
|
|
.dragContainer {
|
|
|
|
pointer-events: all;
|
|
|
|
}
|
2022-05-23 08:56:15 -07:00
|
|
|
.dragButton {
|
|
|
|
background-color: var(--color-background-base);
|
|
|
|
width: 64px;
|
|
|
|
height: 21px;
|
|
|
|
border-top-left-radius: var(--border-radius-base);
|
|
|
|
border-top-right-radius: var(--border-radius-base);
|
|
|
|
cursor: grab;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
overflow: visible;
|
2022-09-22 08:41:15 -07:00
|
|
|
position: relative;
|
|
|
|
z-index: 3;
|
2022-05-23 08:56:15 -07:00
|
|
|
|
|
|
|
&:hover {
|
2022-12-14 01:04:10 -08:00
|
|
|
.leftArrow,
|
|
|
|
.rightArrow {
|
2022-05-23 08:56:15 -07:00
|
|
|
visibility: visible;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.visible {
|
|
|
|
visibility: visible !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
.arrow {
|
|
|
|
position: absolute;
|
|
|
|
color: var(--color-background-xlight);
|
|
|
|
font-size: var(--font-size-3xs);
|
|
|
|
visibility: hidden;
|
|
|
|
top: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.leftArrow {
|
|
|
|
composes: arrow;
|
|
|
|
left: -16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.rightArrow {
|
|
|
|
composes: arrow;
|
|
|
|
right: -16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.grid {
|
|
|
|
> div {
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
&:first-child {
|
|
|
|
> div {
|
|
|
|
margin-bottom: 2px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> div {
|
|
|
|
height: 2px;
|
|
|
|
width: 2px;
|
|
|
|
border-radius: 50%;
|
|
|
|
background-color: var(--color-foreground-xdark);
|
|
|
|
margin-right: 4px;
|
|
|
|
|
|
|
|
&:last-child {
|
|
|
|
margin-right: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|