-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Michele F. <michele-franchi@users.noreply.github.com> Co-authored-by: Michele Franchi <michele.franchi933@gmail.com>
- Loading branch information
1 parent
57f4239
commit f5a0f80
Showing
31 changed files
with
754 additions
and
137 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -81,8 +81,7 @@ | |
Is Generalized | ||
</th> | ||
<td> | ||
<app-chip | ||
size="sm"> | ||
<app-chip size="sm"> | ||
Generalized | ||
</app-chip> | ||
</td> | ||
|
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,99 @@ | ||
<template> | ||
<div | ||
:class="[ | ||
'accordion', | ||
{ 'accordion--disabled' : isDisabled }]"> | ||
<div | ||
v-for="(item, index) in accordionItems" | ||
:key="index" | ||
class="accordion__item"> | ||
<header | ||
:class="[ | ||
'accordion__header', | ||
{'accordion__header--expanded' : item.isExpanded }]" | ||
@click="toggle(index)"> | ||
<h4> | ||
{{ item.name }} | ||
</h4> | ||
</header> | ||
|
||
<transition name="accordion__content"> | ||
<div | ||
v-show="item.isExpanded" | ||
class="accordion__content"> | ||
<slot | ||
:content="{item, index}" | ||
name="content"/> | ||
</div> | ||
</transition> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { ref } from 'vue' | ||
const props = defineProps({ | ||
items: { | ||
type: Array, | ||
required: true, | ||
}, | ||
isDisabled: { | ||
type: Boolean, | ||
required: true, | ||
}, | ||
}) | ||
const accordionItems = ref(props.items.map(item => ({ ...item, isExpanded: false }))) | ||
function toggle(index) { | ||
accordionItems.value[index].isExpanded = !accordionItems.value[index].isExpanded | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.accordion { | ||
&--disabled { | ||
opacity: 0.5; | ||
pointer-events: none; | ||
} | ||
&__item { | ||
border: 1px solid var(--color-gray); | ||
border-radius: 8px; | ||
margin-bottom: var(--space-4); | ||
} | ||
&__header { | ||
background: var(--color-snow); | ||
padding: var(--space-1); | ||
border-radius: 8px; | ||
cursor: pointer; | ||
&--expanded { | ||
border-bottom: 1px solid var(--color-gray); | ||
border-radius: 8px 8px 0 0; | ||
} | ||
} | ||
&__content { | ||
padding: var(--space-1) 0; | ||
margin: 0 var(--space-1); | ||
&-enter-active, &-leave-active { | ||
transition: max-height 0.08s ease, padding 0.08s ease; | ||
} | ||
&-enter-from, &-leave-to { | ||
max-height: 0; | ||
padding: 0; | ||
overflow: hidden; | ||
} | ||
&-enter-to, &-leave-from { | ||
max-height: 1000px; | ||
overflow: hidden; | ||
} | ||
} | ||
} | ||
</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
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 |
---|---|---|
|
@@ -70,6 +70,5 @@ const codeModel = ref(props.code) | |
.mtk7 { | ||
color: var(--color-success); | ||
} | ||
} | ||
</style> |
Oops, something went wrong.