2022-04-08 18:07:31 -05:00
|
|
|
<template>
|
|
|
|
<modals-modal v-model="show" :width="300" height="100%">
|
|
|
|
<template #outer>
|
2023-02-26 14:41:18 -06:00
|
|
|
<div v-if="title" class="absolute top-8 left-4 z-40" style="max-width: 80%">
|
|
|
|
<p class="text-white text-xl truncate">{{ title }}</p>
|
2022-04-08 18:07:31 -05:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<div class="w-full h-full overflow-hidden absolute top-0 left-0 flex items-center justify-center" @click="show = false">
|
2023-02-08 23:19:37 +01:00
|
|
|
<div ref="container" class="w-full overflow-x-hidden overflow-y-auto bg-primary rounded-lg border border-white border-opacity-20 p-2" style="max-height: 75%" @click.stop>
|
2022-04-08 18:07:31 -05:00
|
|
|
<ul class="h-full w-full" role="listbox" aria-labelledby="listbox-label">
|
|
|
|
<template v-for="item in items">
|
2022-08-22 16:02:35 -05:00
|
|
|
<slot :name="item.value" :item="item" :selected="item.value === selected">
|
|
|
|
<li :key="item.value" class="text-gray-50 select-none relative py-4 cursor-pointer hover:bg-black-400" :class="selected === item.value ? 'bg-success bg-opacity-10' : ''" role="option" @click="clickedOption(item.value)">
|
|
|
|
<div class="relative flex items-center px-3">
|
2023-01-16 17:03:07 -06:00
|
|
|
<span v-if="item.icon" class="material-icons-outlined text-xl mr-2 text-white text-opacity-80">{{ item.icon }}</span>
|
2022-08-22 16:02:35 -05:00
|
|
|
<p class="font-normal block truncate text-base text-white text-opacity-80">{{ item.text }}</p>
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</slot>
|
2022-04-08 18:07:31 -05:00
|
|
|
</template>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</modals-modal>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
value: Boolean,
|
|
|
|
title: String,
|
|
|
|
items: {
|
|
|
|
type: Array,
|
|
|
|
default: () => []
|
2022-06-01 19:38:26 -05:00
|
|
|
},
|
|
|
|
selected: String // optional
|
2022-04-08 18:07:31 -05:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
show: {
|
|
|
|
get() {
|
|
|
|
return this.value
|
|
|
|
},
|
|
|
|
set(val) {
|
|
|
|
this.$emit('input', val)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
clickedOption(action) {
|
|
|
|
this.$emit('action', action)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {}
|
|
|
|
}
|
|
|
|
</script>
|