2021-10-09 23:19:16 -07:00
|
|
|
<template>
|
|
|
|
<div class="rrevdjwu" :class="{ grid }">
|
2021-11-19 02:36:12 -08:00
|
|
|
<div v-for="group in def" class="group">
|
|
|
|
<div v-if="group.title" class="title">{{ group.title }}</div>
|
2021-10-09 23:19:16 -07:00
|
|
|
|
|
|
|
<div class="items">
|
|
|
|
<template v-for="(item, i) in group.items">
|
|
|
|
<a v-if="item.type === 'a'" :href="item.href" :target="item.target" :tabindex="i" class="_button item" :class="{ danger: item.danger, active: item.active }">
|
2022-12-19 02:01:30 -08:00
|
|
|
<i v-if="item.icon" class="icon ti-fw" :class="item.icon"></i>
|
2021-10-09 23:19:16 -07:00
|
|
|
<span class="text">{{ item.text }}</span>
|
|
|
|
</a>
|
2021-11-19 02:36:12 -08:00
|
|
|
<button v-else-if="item.type === 'button'" :tabindex="i" class="_button item" :class="{ danger: item.danger, active: item.active }" :disabled="item.active" @click="ev => item.action(ev)">
|
2022-12-19 02:01:30 -08:00
|
|
|
<i v-if="item.icon" class="icon ti-fw" :class="item.icon"></i>
|
2021-10-09 23:19:16 -07:00
|
|
|
<span class="text">{{ item.text }}</span>
|
|
|
|
</button>
|
|
|
|
<MkA v-else :to="item.to" :tabindex="i" class="_button item" :class="{ danger: item.danger, active: item.active }">
|
2022-12-19 02:01:30 -08:00
|
|
|
<i v-if="item.icon" class="icon ti-fw" :class="item.icon"></i>
|
2021-10-09 23:19:16 -07:00
|
|
|
<span class="text">{{ item.text }}</span>
|
|
|
|
</MkA>
|
|
|
|
</template>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { defineComponent, ref, unref } from 'vue';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
props: {
|
|
|
|
def: {
|
|
|
|
type: Array,
|
2022-07-12 06:42:50 -07:00
|
|
|
required: true,
|
2021-10-09 23:19:16 -07:00
|
|
|
},
|
|
|
|
grid: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.rrevdjwu {
|
|
|
|
> .group {
|
|
|
|
& + .group {
|
|
|
|
margin-top: 16px;
|
|
|
|
padding-top: 16px;
|
|
|
|
border-top: solid 0.5px var(--divider);
|
|
|
|
}
|
|
|
|
|
|
|
|
> .title {
|
|
|
|
opacity: 0.7;
|
2021-12-02 03:09:12 -08:00
|
|
|
margin: 0 0 8px 0;
|
2021-12-09 22:33:01 -08:00
|
|
|
font-size: 0.9em;
|
2021-10-09 23:19:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
> .items {
|
|
|
|
> .item {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
width: 100%;
|
|
|
|
box-sizing: border-box;
|
2021-10-15 09:15:22 -07:00
|
|
|
padding: 10px 16px 10px 8px;
|
|
|
|
border-radius: 9px;
|
2022-07-12 06:42:50 -07:00
|
|
|
font-size: 0.9em;
|
2021-10-09 23:19:16 -07:00
|
|
|
|
|
|
|
&:hover {
|
|
|
|
text-decoration: none;
|
|
|
|
background: var(--panelHighlight);
|
|
|
|
}
|
|
|
|
|
|
|
|
&.active {
|
|
|
|
color: var(--accent);
|
|
|
|
background: var(--accentedBg);
|
|
|
|
}
|
|
|
|
|
|
|
|
&.danger {
|
|
|
|
color: var(--error);
|
|
|
|
}
|
|
|
|
|
|
|
|
> .icon {
|
|
|
|
width: 32px;
|
|
|
|
margin-right: 2px;
|
|
|
|
flex-shrink: 0;
|
|
|
|
text-align: center;
|
|
|
|
opacity: 0.8;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .text {
|
2022-12-17 23:43:09 -08:00
|
|
|
white-space: normal;
|
2021-10-09 23:19:16 -07:00
|
|
|
padding-right: 12px;
|
2022-12-17 23:43:09 -08:00
|
|
|
flex-shrink: 1;
|
2021-10-09 23:19:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.grid {
|
|
|
|
> .group {
|
|
|
|
& + .group {
|
|
|
|
padding-top: 0;
|
|
|
|
border-top: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
margin-left: 0;
|
|
|
|
margin-right: 0;
|
|
|
|
|
|
|
|
> .title {
|
|
|
|
font-size: 1em;
|
|
|
|
opacity: 0.7;
|
|
|
|
margin: 0 0 8px 16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .items {
|
|
|
|
display: grid;
|
2022-12-20 15:39:28 -08:00
|
|
|
grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
|
2022-12-19 20:20:19 -08:00
|
|
|
grid-gap: 16px;
|
2021-10-09 23:19:16 -07:00
|
|
|
padding: 0 16px;
|
|
|
|
|
|
|
|
> .item {
|
|
|
|
flex-direction: column;
|
|
|
|
text-align: center;
|
2022-12-19 20:20:19 -08:00
|
|
|
padding: 0;
|
2021-10-09 23:19:16 -07:00
|
|
|
|
2022-12-19 20:21:40 -08:00
|
|
|
&:hover {
|
|
|
|
text-decoration: none;
|
|
|
|
background: none;
|
|
|
|
color: var(--accent);
|
|
|
|
|
|
|
|
> .icon {
|
|
|
|
background: var(--accentedBg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-09 23:19:16 -07:00
|
|
|
> .icon {
|
2022-12-19 20:20:19 -08:00
|
|
|
display: grid;
|
|
|
|
place-content: center;
|
2021-10-09 23:19:16 -07:00
|
|
|
margin-right: 0;
|
2022-12-19 20:20:19 -08:00
|
|
|
margin-bottom: 6px;
|
2021-10-09 23:19:16 -07:00
|
|
|
font-size: 1.5em;
|
2022-12-20 15:39:28 -08:00
|
|
|
width: 54px;
|
|
|
|
height: 54px;
|
2022-12-19 20:20:19 -08:00
|
|
|
aspect-ratio: 1;
|
|
|
|
background: var(--panel);
|
|
|
|
border-radius: 100%;
|
2021-10-09 23:19:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
> .text {
|
|
|
|
padding-right: 0;
|
|
|
|
width: 100%;
|
|
|
|
font-size: 0.8em;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|