-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Removed warnings for commas * Update NPM to support lockfile v2 * WIP * Trying again with @latest with build-essential * Trying sudo again * Revert "Trying sudo again" This reverts commit 48077b1. * Added label navigation * Labels are now sync using ROS * Added label addition and move * Added label editing * Added dropdown menu functionnality to map settings and navigation settings
- Loading branch information
1 parent
de5f5c6
commit 6dd2516
Showing
18 changed files
with
859 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,22 @@ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
node: true, | ||
node: true | ||
}, | ||
extends: [ | ||
"plugin:vue/vue3-essential", | ||
"eslint:recommended", | ||
"@vue/typescript/recommended", | ||
"@vue/prettier", | ||
"@vue/prettier/@typescript-eslint", | ||
"@vue/prettier/@typescript-eslint" | ||
], | ||
parserOptions: { | ||
ecmaVersion: 2020, | ||
ecmaVersion: 2020 | ||
}, | ||
ignorePatterns: ["/submodules/*"], | ||
rules: { | ||
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off", | ||
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", | ||
"comma-dangle": [ | ||
"warn", | ||
{ | ||
arrays: "always-multiline", | ||
objects: "always-multiline", | ||
imports: "always-multiline", | ||
exports: "always-multiline", | ||
functions: "never", | ||
}, | ||
], | ||
}, | ||
"prettier/prettier": "off" | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
.div { | ||
display: inline-block; | ||
transition: all 1s ease-in-out; | ||
--padding-top: 0; | ||
} | ||
|
||
.toggle-button { | ||
position: relative; | ||
display: inline-block; | ||
background-color: transparent; | ||
border: none; | ||
padding: 0.5rem; | ||
width: fit-content; | ||
height: fit-content; | ||
} | ||
|
||
.left { | ||
margin-right: auto; | ||
} | ||
|
||
.right { | ||
margin-left: auto; | ||
} | ||
|
||
.icon { | ||
font-size: larger; | ||
font-weight: 600; | ||
width: 1rem; | ||
color: inherit; | ||
padding: 0.4rem; | ||
} | ||
|
||
.inner { | ||
display: inline-block; | ||
width: fit-content; | ||
height: fit-content; | ||
position: relative; | ||
transition: all 1s ease-in-out; | ||
padding-top: var(--padding-top); | ||
} |
106 changes: 106 additions & 0 deletions
106
teleop-vue/src/components/DropdownMenu/DropdownMenu.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<template> | ||
<div | ||
class="div" | ||
@mouseenter="mouseEnter" | ||
@mouseleave="mouseLeave" | ||
@mousemove="clearTimer" | ||
> | ||
<button | ||
class="toggle-button" | ||
:class="align" | ||
:style="{ color: color, 'text-align': align }" | ||
@click="togglePinned" | ||
> | ||
<span v-if="align === 'right'">{{ label }}</span> | ||
<span v-show="!hidden && hoverShown && !pinnedShown" class="icon" | ||
>📌</span | ||
> | ||
<span v-show="!hidden && pinnedShown" class="icon">ᐱ</span> | ||
<span v-show="hidden" class="icon">ᐯ</span | ||
><span v-if="align === 'left'">{{ label }}</span></button | ||
><br /> | ||
<div v-show="!hidden" class="inner"> | ||
<slot></slot> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "dropdown-menu", | ||
props: { | ||
label: { | ||
type: String, | ||
required: false, | ||
default: "", | ||
}, | ||
color: { | ||
type: String, | ||
required: false, | ||
default: "#FFF", | ||
}, | ||
align: { | ||
type: String, | ||
required: false, | ||
default: "left", | ||
}, | ||
hoverTimeout: { | ||
type: Number, | ||
required: false, | ||
default: 400, | ||
}, | ||
}, | ||
data() { | ||
return { | ||
pinnedShown: false, | ||
hoverShown: false, | ||
timer: null, | ||
}; | ||
}, | ||
computed: { | ||
hidden() { | ||
return !this.pinnedShown && !this.hoverShown; | ||
}, | ||
}, | ||
methods: { | ||
clearTimer() { | ||
if (this.timer) { | ||
clearTimeout(this.timer); | ||
} | ||
}, | ||
resetTimer(timeout) { | ||
this.clearTimer(); | ||
this.timer = setTimeout(this.timerTimeout, timeout, timeout); | ||
}, | ||
mouseEnter() { | ||
this.hoverShown = true; | ||
this.clearTimer(); | ||
}, | ||
timerTimeout(timeout) { | ||
const a = document.querySelector("#div:hover"); | ||
if (a === null) { | ||
this.hoverShown = false; | ||
} else { | ||
this.timer = setTimeout(this.timerTimeout, timeout, timeout); | ||
} | ||
}, | ||
mouseLeave(event) { | ||
// Needed to fix a bug on Firefox where hovering above a <select> dropdown menu triggers the mouseleave event | ||
if (event.relatedTarget === null) { | ||
event.stopPropagation(); | ||
this.resetTimer(2 * this.hoverTimeout); | ||
} else { | ||
this.resetTimer(this.hoverTimeout); | ||
} | ||
}, | ||
togglePinned() { | ||
this.pinnedShown = !this.pinnedShown; | ||
this.clearTimer(); | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
@import "./DropdownMenu.scss"; | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as DropdownMenu } from "./DropdownMenu.vue"; |
Oops, something went wrong.