- Vue 3, Vite, TypeScript, Vue Router, vue-i18n, MapLibre GL JS, Bootstrap 5 (CSS seul), Bootstrap Icons, police Roboto. - Pages : connexion, évaluation (adresse, carte avec couches WalOnMap, une carte par facteur avec badge, valeurs mesurées, onglets et références, état « indisponible » avec Réessayer), erreurs 403/404. - Design repris des maquettes Penpot (charte ssmg.be), bureau et mobile. - Garde de navigation, client API avec jeton CSRF ; l'adresse du patient ne quitte pas la mémoire du composant. - 51 tests Vitest ; README et CLAUDE.md mis à jour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
100 lines
2.3 KiB
Vue
100 lines
2.3 KiB
Vue
<script setup lang="ts">
|
|
import { computed } from 'vue'
|
|
|
|
import type { FactorResult } from '@/api/types'
|
|
|
|
import ColorBadge from './ColorBadge.vue'
|
|
import DetailList from './DetailList.vue'
|
|
import InfoTabs from './InfoTabs.vue'
|
|
import ReferenceList from './ReferenceList.vue'
|
|
|
|
const props = defineProps<{ factor: FactorResult }>()
|
|
defineEmits<{ retry: [] }>()
|
|
|
|
const levelClass = computed(() =>
|
|
props.factor.status === 'ok' && props.factor.level ? `level-${props.factor.level}` : 'level-none',
|
|
)
|
|
</script>
|
|
|
|
<template>
|
|
<article
|
|
class="factor-card prism-card"
|
|
:class="{ unavailable: factor.status !== 'ok' }"
|
|
:aria-labelledby="`factor-${factor.code}`"
|
|
>
|
|
<header class="factor-header">
|
|
<span class="factor-dot" :class="levelClass" aria-hidden="true"></span>
|
|
<h2 :id="`factor-${factor.code}`" class="factor-title">{{ factor.label }}</h2>
|
|
<ColorBadge class="ms-sm-auto" :level="factor.level" :status="factor.status" />
|
|
</header>
|
|
|
|
<template v-if="factor.status === 'ok'">
|
|
<p v-if="factor.summary" class="summary">{{ factor.summary }}</p>
|
|
<DetailList :details="factor.details" />
|
|
<InfoTabs :tabs="factor.tabs" />
|
|
<ReferenceList :references="factor.references" />
|
|
</template>
|
|
|
|
<template v-else>
|
|
<p class="summary">
|
|
{{
|
|
factor.status === 'unavailable'
|
|
? $t('factor.unavailable', { label: factor.label.toLowerCase() })
|
|
: $t('factor.noData')
|
|
}}
|
|
</p>
|
|
<div v-if="factor.status === 'unavailable'">
|
|
<button type="button" class="btn btn-outline-primary" @click="$emit('retry')">
|
|
{{ $t('factor.retry') }}
|
|
</button>
|
|
</div>
|
|
</template>
|
|
</article>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.factor-card {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 14px;
|
|
padding: 22px 24px;
|
|
}
|
|
|
|
.factor-card.unavailable {
|
|
border: 1px dashed var(--prism-level-none);
|
|
}
|
|
|
|
.factor-header {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
gap: 10px;
|
|
}
|
|
|
|
@media (max-width: 575.98px) {
|
|
.factor-header :deep(.color-badge) {
|
|
order: 3;
|
|
}
|
|
}
|
|
|
|
.factor-dot {
|
|
width: 22px;
|
|
height: 22px;
|
|
border-radius: 50%;
|
|
background: var(--level-color);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.factor-title {
|
|
font-size: 1.25rem;
|
|
margin: 0;
|
|
}
|
|
|
|
.summary {
|
|
color: var(--prism-navy);
|
|
font-size: 0.9375rem;
|
|
font-weight: 500;
|
|
margin: 0;
|
|
}
|
|
</style>
|