-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(models-manager): create model-status-badge and model-action-menu
- Loading branch information
1 parent
71dfdf6
commit 32ac19d
Showing
11 changed files
with
224 additions
and
28 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
21 changes: 21 additions & 0 deletions
21
src/components/specific/models/model-action-menu/ModelActionMenu.scss
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,21 @@ | ||
.model-action-menu { | ||
position: relative; | ||
display: flex; | ||
justify-content: flex-end; | ||
align-items: center; | ||
gap: $spacing-unit; | ||
|
||
&__btn { | ||
color: $color-tertiary-dark; | ||
} | ||
|
||
&__container { | ||
position: absolute; | ||
right: 32px + $spacing-unit; | ||
width: 180px; | ||
padding: $spacing-unit/2 0; | ||
border-radius: 4px; | ||
background-color: $color-white; | ||
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.1); | ||
} | ||
} |
69 changes: 69 additions & 0 deletions
69
src/components/specific/models/model-action-menu/ModelActionMenu.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,69 @@ | ||
<template> | ||
<div class="model-action-menu" v-click-away="closeMenu"> | ||
<BIMDataButton | ||
class="model-action-menu__btn" | ||
ripple | ||
rounded | ||
icon | ||
@click="() => {}" | ||
> | ||
<BIMDataIcon name="cloud" size="s" /> | ||
</BIMDataButton> | ||
<BIMDataButton | ||
class="model-action-menu__btn" | ||
ripple | ||
rounded | ||
icon | ||
@click="toggleMenu" | ||
> | ||
<BIMDataIcon name="ellipsis" size="l" /> | ||
</BIMDataButton> | ||
|
||
<transition name="fade"> | ||
<div class="model-action-menu__container" v-show="showMenu"> | ||
<!-- TODO --> | ||
<span>Model Action Menu</span> | ||
</div> | ||
</transition> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { ref } from "vue"; | ||
// Components | ||
import BIMDataButton from "@bimdata/design-system/dist/js/BIMDataComponents/vue3/BIMDataButton.js"; | ||
import BIMDataIcon from "@bimdata/design-system/dist/js/BIMDataComponents/vue3/BIMDataIcon.js"; | ||
export default { | ||
components: { | ||
BIMDataButton, | ||
BIMDataIcon | ||
}, | ||
props: { | ||
model: { | ||
type: Object, | ||
required: true | ||
} | ||
}, | ||
setup() { | ||
const showMenu = ref(false); | ||
const closeMenu = () => { | ||
showMenu.value = false; | ||
}; | ||
const toggleMenu = () => { | ||
showMenu.value = !showMenu.value; | ||
}; | ||
return { | ||
// References | ||
showMenu, | ||
// Methods | ||
closeMenu, | ||
toggleMenu | ||
}; | ||
} | ||
}; | ||
</script> | ||
|
||
<style scoped lang="scss" src="./ModelActionMenu.scss"></style> |
19 changes: 19 additions & 0 deletions
19
src/components/specific/models/model-status-badge/ModelStatusBadge.scss
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,19 @@ | ||
.model-status-badge { | ||
display: inline-block; | ||
width: 18px; | ||
height: 18px; | ||
margin: $spacing-unit/2; | ||
|
||
&--pending, | ||
&--in-progress { | ||
color: $color-neutral; | ||
} | ||
|
||
&--completed { | ||
color: $color-success; | ||
} | ||
|
||
&--error { | ||
color: $color-high; | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
src/components/specific/models/model-status-badge/ModelStatusBadge.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,53 @@ | ||
<template> | ||
<span class="model-status-badge" :class="`model-status-badge--${statusName}`"> | ||
<BIMDataIcon :name="statusIcon" size="s" /> | ||
</span> | ||
</template> | ||
|
||
<script> | ||
import { ref } from "vue"; | ||
// Components | ||
import BIMDataIcon from "@bimdata/design-system/dist/js/BIMDataComponents/vue3/BIMDataIcon.js"; | ||
export default { | ||
components: { | ||
BIMDataIcon | ||
}, | ||
props: { | ||
status: { | ||
type: String, | ||
required: true | ||
} | ||
}, | ||
setup(props) { | ||
const statusName = ref(""); | ||
const statusIcon = ref(""); | ||
switch (props.status) { | ||
case "P": | ||
statusName.value = "pending"; | ||
statusIcon.value = "success"; | ||
break; | ||
case "I": | ||
statusName.value = "in-progress"; | ||
statusIcon.value = "refresh"; | ||
break; | ||
case "C": | ||
statusName.value = "completed"; | ||
statusIcon.value = "success"; | ||
break; | ||
case "E": | ||
statusName.value = "error"; | ||
statusIcon.value = "failed"; | ||
break; | ||
} | ||
return { | ||
statusIcon, | ||
statusName | ||
}; | ||
} | ||
}; | ||
</script> | ||
|
||
<style scoped lang="scss" src="./ModelStatusBadge.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 |
---|---|---|
|
@@ -3,4 +3,8 @@ | |
height: calc(100% - 35px); | ||
padding: $spacing-unit; | ||
} | ||
|
||
&__table { | ||
margin-top: $spacing-unit * 3; | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
src/components/specific/users/user-role-badge/UserRoleBadge.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