Multiple groups per contact, legacy group text migrated, excel import/export, contacts filter and column, richer create-in-tahesab, match-first bulk export
49 lines
1.0 KiB
Vue
49 lines
1.0 KiB
Vue
<script setup lang="ts">
|
|
import type { CustomerGroupSummaryDto } from '@mento/shared';
|
|
import { groupSwatch } from '@/lib/customer-groups';
|
|
|
|
defineProps<{
|
|
groups: CustomerGroupSummaryDto[] | undefined;
|
|
/** متن وقتی گروهی نیست */
|
|
empty?: string;
|
|
}>();
|
|
</script>
|
|
|
|
<template>
|
|
<span v-if="groups?.length" class="group-chips">
|
|
<span
|
|
v-for="g in groups"
|
|
:key="g.id"
|
|
class="group-chip"
|
|
:style="{ color: groupSwatch(g.color).fg, background: groupSwatch(g.color).bg }"
|
|
:title="g.source === 'tahesab' ? `${g.name} (از تهحساب)` : g.name"
|
|
>
|
|
{{ g.name }}
|
|
</span>
|
|
</span>
|
|
<span v-else-if="empty" class="group-empty">{{ empty }}</span>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.group-chips {
|
|
display: inline-flex;
|
|
flex-wrap: wrap;
|
|
gap: 0.25rem;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.group-chip {
|
|
display: inline-block;
|
|
padding: 0.1rem 0.5rem;
|
|
border-radius: 999px;
|
|
font-size: 0.75rem;
|
|
font-weight: 600;
|
|
line-height: 1.5;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.group-empty {
|
|
color: #94a3b8;
|
|
}
|
|
</style>
|