2023-12-31 02:02:03 +00:00
|
|
|
<template>
|
|
|
|
<ul class="countries nolist">
|
|
|
|
<li
|
|
|
|
v-for="country in countries"
|
|
|
|
:key="country.alpha2"
|
|
|
|
:title="country.name"
|
|
|
|
:class="{ selected: selectedCountry === country.alpha2 }"
|
|
|
|
class="country"
|
2024-01-05 23:30:30 +00:00
|
|
|
@click="emit('country', country.alpha2)"
|
2023-12-31 02:02:03 +00:00
|
|
|
>
|
|
|
|
<img
|
|
|
|
:src="`/img/flags/${country.alpha2.toLowerCase()}.svg`"
|
|
|
|
class="flag"
|
|
|
|
>
|
|
|
|
|
|
|
|
<span class="country-name">{{ country.alias || country.name }}</span>
|
|
|
|
|
|
|
|
<Icon
|
|
|
|
v-if="selectedCountry === country.alpha2"
|
|
|
|
icon="cross2"
|
2024-01-10 01:00:38 +00:00
|
|
|
class="filter-remove"
|
2024-01-05 23:30:30 +00:00
|
|
|
@click.native.stop="emit('country', null)"
|
2023-12-31 02:02:03 +00:00
|
|
|
/>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
defineProps({
|
|
|
|
countries: {
|
|
|
|
type: Array,
|
|
|
|
default: () => [],
|
|
|
|
},
|
|
|
|
selectedCountry: {
|
|
|
|
type: String,
|
|
|
|
default: null,
|
|
|
|
},
|
|
|
|
});
|
2024-01-05 23:30:30 +00:00
|
|
|
|
|
|
|
const emit = defineEmits(['country']);
|
2023-12-31 02:02:03 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.countries:not(:last-child) {
|
2024-06-10 01:24:48 +00:00
|
|
|
border-bottom: solid 1px var(--glass-weak-30);
|
2023-12-31 02:02:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.country {
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
.flag {
|
2024-01-03 01:52:41 +00:00
|
|
|
width: 1.5rem;
|
|
|
|
padding: .25rem .25rem .25rem .5rem;
|
2023-12-31 02:02:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
2024-06-10 01:24:48 +00:00
|
|
|
background: var(--glass-weak-30);
|
2023-12-31 02:02:03 +00:00
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.selected {
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.country-name {
|
|
|
|
flex-grow: 1;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
padding: .25rem .5rem;
|
|
|
|
}
|
2024-03-19 00:40:56 +00:00
|
|
|
|
|
|
|
.filter-remove {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
padding: .5rem;
|
2024-06-10 01:24:48 +00:00
|
|
|
fill: var(--glass);
|
2024-03-19 00:40:56 +00:00
|
|
|
|
|
|
|
&:hover {
|
|
|
|
fill: var(--error);
|
|
|
|
}
|
|
|
|
}
|
2023-12-31 02:02:03 +00:00
|
|
|
</style>
|