codevdesign 2.0.18 → 2.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,236 +1,236 @@
1
- <template>
2
- <v-app-bar
3
- :color="barreCouleur"
4
- class="px-0 mx-0"
5
- :style="{
6
- position: 'sticky',
7
- width: '100%',
8
- // variables CSS pour les couleurs dynamiques
9
- '--entete-texte': texteCouleur,
10
- '--entete-icone': iconeCouleur,
11
- }"
12
- height="auto"
13
- >
14
- <v-row
15
- class="pt-2"
16
- @resize="controlAffichage"
17
- >
18
- <v-col
19
- :cols="titreCol"
20
- class="pr-0 mr-0 pl-5"
21
- >
22
- <v-toolbar-title class="titre">
23
- <div class="entete-ligne">
24
- <!-- GAUCHE -->
25
- <div class="entete-gauche">
26
- <!-- Barre de retour -->
27
- <slot name="retour">
28
- <v-icon
29
- v-if="retour"
30
- size="large"
31
- start
32
- :color="iconeCouleur"
33
- icon="mdi-arrow-left-thin"
34
- @click="retournerMenu"
35
- />
36
- </slot>
37
-
38
- <div class="titre-bloc">
39
- <slot name="titre">
40
- <span class="pl-3 titre-texte">{{ props.titre }}</span>
41
- </slot>
42
-
43
- <slot name="etat">
44
- <span
45
- v-if="monEtat?.afficher"
46
- class="pl-10"
47
- >
48
- <v-btn
49
- size="small"
50
- :color="monEtat.couleur"
51
- variant="tonal"
52
- density="default"
53
- min-width="100px"
54
- :style="'font-size:.75rem;letter-spacing: .0892857em; text-transform: uppercase; font-weight: 500; line-height: normal;'"
55
- >
56
- {{ monEtat.texte }}
57
- </v-btn>
58
- </span>
59
- </slot>
60
-
61
- <slot name="etatSecondaire">
62
- <span
63
- v-if="monEtatSecondaire?.afficher"
64
- class="pl-3"
65
- >
66
- <v-btn
67
- size="small"
68
- :color="monEtatSecondaire.couleur"
69
- variant="tonal"
70
- density="default"
71
- min-width="100px"
72
- :style="'font-size:.75rem;letter-spacing: .0892857em; text-transform: uppercase; font-weight: 500; line-height: normal;'"
73
- >
74
- {{ monEtatSecondaire.texte }}
75
- </v-btn>
76
- </span>
77
- </slot>
78
-
79
- <slot name="soustitre">
80
- <span class="pl-3 soustitre-texte">{{ props.soustitre }}</span>
81
- </slot>
82
- </div>
83
- </div>
84
-
85
- <!-- DROITE -->
86
- <div class="entete-droite mr-1">
87
- <slot name="droite" />
88
- </div>
89
- </div>
90
- </v-toolbar-title>
91
- </v-col>
92
- </v-row>
93
-
94
- <!-- Barre en bas -->
95
- <div style="background-color: #808a9d; bottom: 0; height: 2px; left: 0; position: absolute; right: 0" />
96
- </v-app-bar>
97
- </template>
98
-
99
- <script setup lang="ts">
100
- import { useRouter } from 'vue-router'
101
- import { ref, computed } from 'vue'
102
-
103
- interface EnteteEtat {
104
- afficher: boolean
105
- couleur: string
106
- texte: string
107
- }
108
-
109
- interface EnteteEtatSecondaire {
110
- afficher: boolean
111
- couleur: string
112
- texte: string
113
- }
114
-
115
- const router = useRouter()
116
-
117
- const props = defineProps<{
118
- titre: string
119
- soustitre?: string
120
- retour?: string
121
- etat?: EnteteEtat
122
- couleur?: string // couleur de la barre (Vuetify color/hex)
123
- couleurTexte?: string
124
- couleurIcone?: string
125
- etatSecondaire?: EnteteEtatSecondaire
126
- }>()
127
-
128
- const titreCol = ref(12)
129
-
130
- // Fallbacks (tes valeurs actuelles)
131
- const barreCouleur = computed(() => props.couleur ?? 'white')
132
- const texteCouleur = computed(() => props.couleurTexte ?? '#223654')
133
- const iconeCouleur = computed(() => props.couleurIcone ?? 'grisMoyen') // peut être un nom de couleur Vuetify ou un hex
134
-
135
- const monEtat = computed<EnteteEtat>(() => props.etat ?? { afficher: false, couleur: 'primary', texte: 'test' })
136
- const monEtatSecondaire = computed<EnteteEtatSecondaire>(
137
- () => props.etatSecondaire ?? { afficher: false, couleur: 'primary', texte: 'test' },
138
- )
139
-
140
- function retournerMenu() {
141
- if (props.retour) router.push({ name: props.retour })
142
- }
143
- function controlAffichage() {
144
- /* logique resize */
145
- }
146
- </script>
147
-
148
- <style scoped>
149
- .titre {
150
- font-size: 1.85rem;
151
- font-weight: bold;
152
- margin-bottom: 15px;
153
- }
154
- .titre-texte {
155
- color: var(--entete-texte, #223654);
156
- max-width: 100%;
157
- overflow: hidden;
158
- text-overflow: ellipsis;
159
- white-space: nowrap;
160
- }
161
- .soustitre-texte {
162
- color: var(--entete-texte, #223654);
163
- display: block;
164
- font-size: 1rem;
165
- font-weight: normal;
166
- }
167
- .titre-bloc {
168
- display: inline-block;
169
- padding-left: 12px;
170
- vertical-align: middle;
171
- }
172
- /* Couleur de l’icône (retour) + hover */
173
- .v-icon {
174
- color: var(--entete-icone, #6b7280); /* grisMoyen approx si hex */
175
- }
176
- .v-icon:hover {
177
- filter: brightness(0.85);
178
- }
179
- .entete-ligne {
180
- align-items: center;
181
- display: flex;
182
- flex-wrap: wrap;
183
- gap: 8px;
184
- width: 100%;
185
- }
186
-
187
- .entete-gauche {
188
- align-items: center;
189
- display: flex;
190
- flex: 1;
191
- min-width: 0; /* important pour éviter overflow */
192
- }
193
-
194
- .entete-droite {
195
- align-items: center;
196
- display: flex;
197
- flex-shrink: 0;
198
- gap: 12px;
199
- padding-right: 16px;
200
- }
201
-
202
- @media (max-width: 600px) {
203
- .entete-gauche {
204
- width: 100%;
205
- }
206
- .entete-droite {
207
- justify-content: flex-end;
208
- padding-left: 0;
209
- padding-right: 8px;
210
- width: 100%;
211
- }
212
- .titre {
213
- font-size: 1.2rem;
214
- }
215
- .titre-bloc {
216
- align-items: flex-start;
217
- display: flex;
218
- flex-direction: column;
219
- max-width: 100%;
220
- min-width: 0;
221
- padding-left: 4px;
222
- }
223
- .titre-texte {
224
- max-width: 100%;
225
- overflow: hidden;
226
- text-overflow: ellipsis;
227
- white-space: nowrap;
228
- }
229
- :deep(.v-col) {
230
- padding-left: 8px !important;
231
- }
232
- :deep(.v-toolbar-title__placeholder) {
233
- padding-inline-start: 0 !important;
234
- }
235
- }
236
- </style>
1
+ <template>
2
+ <v-app-bar
3
+ :color="barreCouleur"
4
+ class="px-0 mx-0"
5
+ :style="{
6
+ position: 'sticky',
7
+ width: '100%',
8
+ // variables CSS pour les couleurs dynamiques
9
+ '--entete-texte': texteCouleur,
10
+ '--entete-icone': iconeCouleur,
11
+ }"
12
+ height="auto"
13
+ >
14
+ <v-row
15
+ class="pt-2"
16
+ @resize="controlAffichage"
17
+ >
18
+ <v-col
19
+ :cols="titreCol"
20
+ class="pr-0 mr-0 pl-5"
21
+ >
22
+ <v-toolbar-title class="titre">
23
+ <div class="entete-ligne">
24
+ <!-- GAUCHE -->
25
+ <div class="entete-gauche">
26
+ <!-- Barre de retour -->
27
+ <slot name="retour">
28
+ <v-icon
29
+ v-if="retour"
30
+ size="large"
31
+ start
32
+ :color="iconeCouleur"
33
+ icon="mdi-arrow-left-thin"
34
+ @click="retournerMenu"
35
+ />
36
+ </slot>
37
+
38
+ <div class="titre-bloc">
39
+ <slot name="titre">
40
+ <span class="pl-3 titre-texte">{{ props.titre }}</span>
41
+ </slot>
42
+
43
+ <slot name="etat">
44
+ <span
45
+ v-if="monEtat?.afficher"
46
+ class="pl-10"
47
+ >
48
+ <v-btn
49
+ size="small"
50
+ :color="monEtat.couleur"
51
+ variant="tonal"
52
+ density="default"
53
+ min-width="100px"
54
+ :style="'font-size:.75rem;letter-spacing: .0892857em; text-transform: uppercase; font-weight: 500; line-height: normal;'"
55
+ >
56
+ {{ monEtat.texte }}
57
+ </v-btn>
58
+ </span>
59
+ </slot>
60
+
61
+ <slot name="etatSecondaire">
62
+ <span
63
+ v-if="monEtatSecondaire?.afficher"
64
+ class="pl-3"
65
+ >
66
+ <v-btn
67
+ size="small"
68
+ :color="monEtatSecondaire.couleur"
69
+ variant="tonal"
70
+ density="default"
71
+ min-width="100px"
72
+ :style="'font-size:.75rem;letter-spacing: .0892857em; text-transform: uppercase; font-weight: 500; line-height: normal;'"
73
+ >
74
+ {{ monEtatSecondaire.texte }}
75
+ </v-btn>
76
+ </span>
77
+ </slot>
78
+
79
+ <slot name="soustitre">
80
+ <span class="pl-3 soustitre-texte">{{ props.soustitre }}</span>
81
+ </slot>
82
+ </div>
83
+ </div>
84
+
85
+ <!-- DROITE -->
86
+ <div class="entete-droite mr-1">
87
+ <slot name="droite" />
88
+ </div>
89
+ </div>
90
+ </v-toolbar-title>
91
+ </v-col>
92
+ </v-row>
93
+
94
+ <!-- Barre en bas -->
95
+ <div style="background-color: #808a9d; bottom: 0; height: 2px; left: 0; position: absolute; right: 0" />
96
+ </v-app-bar>
97
+ </template>
98
+
99
+ <script setup lang="ts">
100
+ import { useRouter } from 'vue-router'
101
+ import { ref, computed } from 'vue'
102
+
103
+ interface EnteteEtat {
104
+ afficher: boolean
105
+ couleur: string
106
+ texte: string
107
+ }
108
+
109
+ interface EnteteEtatSecondaire {
110
+ afficher: boolean
111
+ couleur: string
112
+ texte: string
113
+ }
114
+
115
+ const router = useRouter()
116
+
117
+ const props = defineProps<{
118
+ titre: string
119
+ soustitre?: string
120
+ retour?: string
121
+ etat?: EnteteEtat
122
+ couleur?: string // couleur de la barre (Vuetify color/hex)
123
+ couleurTexte?: string
124
+ couleurIcone?: string
125
+ etatSecondaire?: EnteteEtatSecondaire
126
+ }>()
127
+
128
+ const titreCol = ref(12)
129
+
130
+ // Fallbacks (tes valeurs actuelles)
131
+ const barreCouleur = computed(() => props.couleur ?? 'white')
132
+ const texteCouleur = computed(() => props.couleurTexte ?? '#223654')
133
+ const iconeCouleur = computed(() => props.couleurIcone ?? 'grisMoyen') // peut être un nom de couleur Vuetify ou un hex
134
+
135
+ const monEtat = computed<EnteteEtat>(() => props.etat ?? { afficher: false, couleur: 'primary', texte: 'test' })
136
+ const monEtatSecondaire = computed<EnteteEtatSecondaire>(
137
+ () => props.etatSecondaire ?? { afficher: false, couleur: 'primary', texte: 'test' },
138
+ )
139
+
140
+ function retournerMenu() {
141
+ if (props.retour) router.push({ name: props.retour })
142
+ }
143
+ function controlAffichage() {
144
+ /* logique resize */
145
+ }
146
+ </script>
147
+
148
+ <style scoped>
149
+ .titre {
150
+ font-size: 1.85rem;
151
+ font-weight: bold;
152
+ margin-bottom: 15px;
153
+ }
154
+ .titre-texte {
155
+ color: var(--entete-texte, #223654);
156
+ max-width: 100%;
157
+ overflow: hidden;
158
+ text-overflow: ellipsis;
159
+ white-space: nowrap;
160
+ }
161
+ .soustitre-texte {
162
+ color: var(--entete-texte, #223654);
163
+ display: block;
164
+ font-size: 1rem;
165
+ font-weight: normal;
166
+ }
167
+ .titre-bloc {
168
+ display: inline-block;
169
+ padding-left: 12px;
170
+ vertical-align: middle;
171
+ }
172
+ /* Couleur de l’icône (retour) + hover */
173
+ .v-icon {
174
+ color: var(--entete-icone, #6b7280); /* grisMoyen approx si hex */
175
+ }
176
+ .v-icon:hover {
177
+ filter: brightness(0.85);
178
+ }
179
+ .entete-ligne {
180
+ align-items: center;
181
+ display: flex;
182
+ flex-wrap: wrap;
183
+ gap: 8px;
184
+ width: 100%;
185
+ }
186
+
187
+ .entete-gauche {
188
+ align-items: center;
189
+ display: flex;
190
+ flex: 1;
191
+ min-width: 0; /* important pour éviter overflow */
192
+ }
193
+
194
+ .entete-droite {
195
+ align-items: center;
196
+ display: flex;
197
+ flex-shrink: 0;
198
+ gap: 12px;
199
+ padding-right: 16px;
200
+ }
201
+
202
+ @media (max-width: 600px) {
203
+ .entete-gauche {
204
+ width: 100%;
205
+ }
206
+ .entete-droite {
207
+ justify-content: flex-end;
208
+ padding-left: 0;
209
+ padding-right: 8px;
210
+ width: 100%;
211
+ }
212
+ .titre {
213
+ font-size: 1.2rem;
214
+ }
215
+ .titre-bloc {
216
+ align-items: flex-start;
217
+ display: flex;
218
+ flex-direction: column;
219
+ max-width: 100%;
220
+ min-width: 0;
221
+ padding-left: 4px;
222
+ }
223
+ .titre-texte {
224
+ max-width: 100%;
225
+ overflow: hidden;
226
+ text-overflow: ellipsis;
227
+ white-space: nowrap;
228
+ }
229
+ :deep(.v-col) {
230
+ padding-left: 8px !important;
231
+ }
232
+ :deep(.v-toolbar-title__placeholder) {
233
+ padding-inline-start: 0 !important;
234
+ }
235
+ }
236
+ </style>