Some checks failed
Lock Threads / action (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Publish Chatwoot EE docker images / build (linux/amd64, ubuntu-latest) (push) Has been cancelled
Publish Chatwoot EE docker images / build (linux/arm64, ubuntu-22.04-arm) (push) Has been cancelled
Publish Chatwoot EE docker images / merge (push) Has been cancelled
Publish Chatwoot CE docker images / build (linux/amd64, ubuntu-latest) (push) Has been cancelled
Publish Chatwoot CE docker images / build (linux/arm64, ubuntu-22.04-arm) (push) Has been cancelled
Publish Chatwoot CE docker images / merge (push) Has been cancelled
Run Chatwoot CE spec / lint-backend (push) Has been cancelled
Run Chatwoot CE spec / lint-frontend (push) Has been cancelled
Run Chatwoot CE spec / frontend-tests (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (0, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (1, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (10, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (11, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (12, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (13, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (14, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (15, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (2, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (3, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (4, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (5, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (6, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (7, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (8, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (9, 16) (push) Has been cancelled
Run Linux nightly installer / nightly (push) Has been cancelled
- Add Logistics component with progress tracking - Add OrderDetail component for order information - Support data-driven steps and actions - Add blue color scale to widget SCSS - Fix node overflow and progress bar rendering issues - Add English translations for dashboard components Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
71 lines
2.2 KiB
Vue
71 lines
2.2 KiB
Vue
<script setup>
|
|
import { computed } from 'vue';
|
|
import { useMapGetter } from 'dashboard/composables/store.js';
|
|
import Icon from 'next/icon/Icon.vue';
|
|
|
|
const props = defineProps({
|
|
to: { type: [Object, String], default: '' },
|
|
label: { type: String, default: '' },
|
|
icon: { type: [String, Object], default: '' },
|
|
expandable: { type: Boolean, default: false },
|
|
isExpanded: { type: Boolean, default: false },
|
|
isActive: { type: Boolean, default: false },
|
|
hasActiveChild: { type: Boolean, default: false },
|
|
getterKeys: { type: Object, default: () => ({}) },
|
|
});
|
|
|
|
const emit = defineEmits(['toggle']);
|
|
|
|
const showBadge = useMapGetter(props.getterKeys.badge);
|
|
const dynamicCount = useMapGetter(props.getterKeys.count);
|
|
const count = computed(() =>
|
|
dynamicCount.value > 99 ? '99+' : dynamicCount.value
|
|
);
|
|
</script>
|
|
|
|
<template>
|
|
<component
|
|
:is="to ? 'router-link' : 'div'"
|
|
class="flex items-center gap-2 px-2 py-1.5 rounded-lg h-8 min-w-0"
|
|
role="button"
|
|
draggable="false"
|
|
:to="to"
|
|
:title="label"
|
|
:class="{
|
|
'text-n-blue-text bg-n-alpha-2 font-medium': isActive && !hasActiveChild,
|
|
'text-n-slate-12 font-medium': hasActiveChild,
|
|
'text-n-slate-11 hover:bg-n-alpha-2': !isActive && !hasActiveChild,
|
|
}"
|
|
@click.stop="emit('toggle')"
|
|
>
|
|
<div v-if="icon" class="relative flex items-center gap-2">
|
|
<Icon v-if="icon" :icon="icon" class="size-4" />
|
|
<span
|
|
v-if="showBadge"
|
|
class="size-2 -top-px ltr:-right-px rtl:-left-px bg-n-brand absolute rounded-full border border-n-solid-2"
|
|
/>
|
|
</div>
|
|
<div class="flex items-center gap-1.5 flex-grow min-w-0">
|
|
<span class="text-sm font-medium leading-5 truncate">
|
|
{{ label }}
|
|
</span>
|
|
<span
|
|
v-if="dynamicCount && !expandable"
|
|
class="rounded-md capitalize text-xs leading-5 font-medium text-center outline outline-1 px-1 flex-shrink-0"
|
|
:class="{
|
|
'text-n-blue-text outline-n-slate-6': isActive,
|
|
'text-n-slate-11 outline-n-strong': !isActive,
|
|
}"
|
|
>
|
|
{{ count }}
|
|
</span>
|
|
</div>
|
|
<span
|
|
v-if="expandable"
|
|
v-show="isExpanded"
|
|
class="i-lucide-chevron-up size-3"
|
|
@click.stop="emit('toggle')"
|
|
/>
|
|
</component>
|
|
</template>
|