codevdesign 2.0.5 → 2.0.7

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,197 +1,197 @@
1
- <template>
2
- <v-navigation-drawer
3
- v-model="visible"
4
- location="right"
5
- temporary
6
- class="pa-0 elevation-2 csqc-ligneBleue"
7
- :persistent="persistant"
8
- :width="grosseurTiroir"
9
- v-bind="$attrs"
10
- @keydown.esc="!persistant ? fermeture : ''"
11
- @click:outside="!persistant ? fermeture : ''"
12
- >
13
- <v-card class="pa-0 ma-0 pl-8 pt-8">
14
- <!-- Bouton en haut à droite -->
15
- <v-btn
16
- icon="mdi-close"
17
- variant="text"
18
- class="position-absolute iconeHover"
19
- style="right: 5px; top: 5px"
20
- @click="fermeture"
21
- ></v-btn>
22
-
23
- <v-card-title
24
- class="pa-0 ma-0 pb-6 text-wrap"
25
- style="font-size: 24px"
26
- >
27
- <slot name="titre"></slot>
28
- <div text-h5>{{ titre }}</div>
29
- </v-card-title>
30
-
31
- <v-card-text class="pa-0 ma-0 pb-6 pr-6">
32
- <v-container>
33
- <slot></slot>
34
- <slot name="content"></slot>
35
- </v-container>
36
- </v-card-text>
37
- <v-card-actions class="my-2 d-flex justify-end pr-6 pb-5">
38
- <slot name="actions"></slot>
39
- <v-btn
40
- v-if="btnAnnuler"
41
- color="primary"
42
- variant="text"
43
- :loading="operationEnCours"
44
- @click="fermeture"
45
- >
46
- {{ props.btnAnnulerTexte ? props.btnAnnulerTexte : $t('csqc.bouton.annuler') }}
47
- </v-btn>
48
-
49
- <v-btn
50
- v-if="btnOk"
51
- class="Gouttiere"
52
- color="primary"
53
- variant="flat"
54
- :loading="operationEnCours"
55
- :disabled="btnOkDesactiver || operationEnCours"
56
- @click="okBouton"
57
- >
58
- {{ props.btnOkTexte ? props.btnOkTexte : $t('csqc.bouton.ok') }}
59
- </v-btn>
60
- </v-card-actions>
61
- </v-card>
62
- </v-navigation-drawer>
63
- <Teleport to="body">
64
- <v-fab
65
- v-if="retourEnHaut && afficherBoutonHaut"
66
- style="bottom: 24px; position: fixed; right: 24px; z-index: 2000"
67
- elevation="8"
68
- color="primary"
69
- icon="mdi-arrow-up"
70
- @click="allerEnHaut"
71
- />
72
- </Teleport>
73
- </template>
74
- <script lang="ts" setup>
75
- import { ref, computed, watch, nextTick, useAttrs } from 'vue'
76
- import { useDisplay } from 'vuetify'
77
-
78
- const visible = ref(false)
79
- const display = useDisplay()
80
- const attrs = useAttrs()
81
-
82
- // Déclaration des props
83
- const props = defineProps({
84
- titre: {
85
- type: String,
86
- default: '',
87
- required: false,
88
- },
89
- btnAnnuler: {
90
- type: Boolean,
91
- default: true,
92
- required: false,
93
- },
94
- btnOk: {
95
- type: Boolean,
96
- default: true,
97
- required: false,
98
- },
99
- btnAnnulerTexte: {
100
- type: String,
101
- default: '',
102
- required: false,
103
- },
104
- btnOkDesactiver: {
105
- type: Boolean,
106
- default: false,
107
- required: false,
108
- },
109
- operationEnCours: { type: Boolean, default: false },
110
- persistant: { type: Boolean, default: true },
111
- btnOkTexte: {
112
- type: String,
113
- default: '',
114
- required: false,
115
- },
116
- retourEnHaut: {
117
- type: Boolean,
118
- default: true,
119
- },
120
- })
121
-
122
- // Déclaration des événements
123
- const emit = defineEmits(['fermer', 'ok'])
124
-
125
- // Back to top
126
- const afficherBoutonHaut = ref(false)
127
- let conteneurScroll: Element | null = null
128
-
129
- function onScroll() {
130
- afficherBoutonHaut.value = (conteneurScroll?.scrollTop ?? 0) > 350
131
- }
132
-
133
- function allerEnHaut() {
134
- conteneurScroll?.scrollTo({ top: 0, behavior: 'smooth' })
135
- }
136
-
137
- watch(visible, async val => {
138
- if (!props.retourEnHaut) return
139
- if (val) {
140
- await nextTick()
141
- conteneurScroll = document.querySelector('.v-navigation-drawer--active .v-navigation-drawer__content')
142
- conteneurScroll?.addEventListener('scroll', onScroll)
143
- } else {
144
- conteneurScroll?.removeEventListener('scroll', onScroll)
145
- conteneurScroll = null
146
- afficherBoutonHaut.value = false
147
- }
148
- })
149
-
150
- // Méthodes
151
- const ouvrir = () => {
152
- visible.value = true
153
- }
154
-
155
- const fermer = () => {
156
- visible.value = false
157
- }
158
-
159
- const fermeture = () => {
160
- emit('fermer')
161
- fermer()
162
- }
163
-
164
- const okBouton = () => {
165
- emit('ok')
166
- fermer()
167
- }
168
-
169
- // Calcul des tailles du tiroir en fonction du breakpoint
170
- const grosseurTiroir = computed(() => {
171
- if (attrs.width !== undefined && attrs.width !== null) return attrs.width as string | number
172
- switch (display.name.value) {
173
- case 'xs':
174
- return ''
175
- case 'sm':
176
- return 0.95 * display.width.value
177
- case 'md':
178
- return 0.8 * display.width.value
179
- case 'lg':
180
- return 0.7 * display.width.value
181
- case 'xl':
182
- return 0.6 * display.width.value
183
- case 'xxl':
184
- return 0.5 * display.width.value
185
- default:
186
- return ''
187
- }
188
- })
189
-
190
- defineExpose({ ouvrir, fermer })
191
- </script>
192
-
193
- <style>
194
- .csqc-ligneBleue {
195
- border-left: 30px #095797 solid !important;
196
- }
197
- </style>
1
+ <template>
2
+ <v-navigation-drawer
3
+ v-model="visible"
4
+ location="right"
5
+ temporary
6
+ class="pa-0 elevation-2 csqc-ligneBleue"
7
+ :persistent="persistant"
8
+ :width="grosseurTiroir"
9
+ v-bind="$attrs"
10
+ @keydown.esc="!persistant ? fermeture : ''"
11
+ @click:outside="!persistant ? fermeture : ''"
12
+ >
13
+ <v-card class="pa-0 ma-0 pl-8 pt-8">
14
+ <!-- Bouton en haut à droite -->
15
+ <v-btn
16
+ icon="mdi-close"
17
+ variant="text"
18
+ class="position-absolute iconeHover"
19
+ style="right: 5px; top: 5px"
20
+ @click="fermeture"
21
+ ></v-btn>
22
+
23
+ <v-card-title
24
+ class="pa-0 ma-0 pb-6 text-wrap"
25
+ style="font-size: 24px"
26
+ >
27
+ <slot name="titre"></slot>
28
+ <div text-h5>{{ titre }}</div>
29
+ </v-card-title>
30
+
31
+ <v-card-text class="pa-0 ma-0 pb-6 pr-6">
32
+ <v-container>
33
+ <slot></slot>
34
+ <slot name="content"></slot>
35
+ </v-container>
36
+ </v-card-text>
37
+ <v-card-actions class="my-2 d-flex justify-end pr-6 pb-5">
38
+ <slot name="actions"></slot>
39
+ <v-btn
40
+ v-if="btnAnnuler"
41
+ color="primary"
42
+ variant="text"
43
+ :loading="operationEnCours"
44
+ @click="fermeture"
45
+ >
46
+ {{ props.btnAnnulerTexte ? props.btnAnnulerTexte : $t('csqc.bouton.annuler') }}
47
+ </v-btn>
48
+
49
+ <v-btn
50
+ v-if="btnOk"
51
+ class="Gouttiere"
52
+ color="primary"
53
+ variant="flat"
54
+ :loading="operationEnCours"
55
+ :disabled="btnOkDesactiver || operationEnCours"
56
+ @click="okBouton"
57
+ >
58
+ {{ props.btnOkTexte ? props.btnOkTexte : $t('csqc.bouton.ok') }}
59
+ </v-btn>
60
+ </v-card-actions>
61
+ </v-card>
62
+ </v-navigation-drawer>
63
+ <Teleport to="body">
64
+ <v-fab
65
+ v-if="retourEnHaut && afficherBoutonHaut"
66
+ style="bottom: 24px; position: fixed; right: 24px; z-index: 2000"
67
+ elevation="8"
68
+ color="primary"
69
+ icon="mdi-arrow-up"
70
+ @click="allerEnHaut"
71
+ />
72
+ </Teleport>
73
+ </template>
74
+ <script lang="ts" setup>
75
+ import { ref, computed, watch, nextTick, useAttrs } from 'vue'
76
+ import { useDisplay } from 'vuetify'
77
+
78
+ const visible = ref(false)
79
+ const display = useDisplay()
80
+ const attrs = useAttrs()
81
+
82
+ // Déclaration des props
83
+ const props = defineProps({
84
+ titre: {
85
+ type: String,
86
+ default: '',
87
+ required: false,
88
+ },
89
+ btnAnnuler: {
90
+ type: Boolean,
91
+ default: true,
92
+ required: false,
93
+ },
94
+ btnOk: {
95
+ type: Boolean,
96
+ default: true,
97
+ required: false,
98
+ },
99
+ btnAnnulerTexte: {
100
+ type: String,
101
+ default: '',
102
+ required: false,
103
+ },
104
+ btnOkDesactiver: {
105
+ type: Boolean,
106
+ default: false,
107
+ required: false,
108
+ },
109
+ operationEnCours: { type: Boolean, default: false },
110
+ persistant: { type: Boolean, default: true },
111
+ btnOkTexte: {
112
+ type: String,
113
+ default: '',
114
+ required: false,
115
+ },
116
+ retourEnHaut: {
117
+ type: Boolean,
118
+ default: true,
119
+ },
120
+ })
121
+
122
+ // Déclaration des événements
123
+ const emit = defineEmits(['fermer', 'ok'])
124
+
125
+ // Back to top
126
+ const afficherBoutonHaut = ref(false)
127
+ let conteneurScroll: Element | null = null
128
+
129
+ function onScroll() {
130
+ afficherBoutonHaut.value = (conteneurScroll?.scrollTop ?? 0) > 350
131
+ }
132
+
133
+ function allerEnHaut() {
134
+ conteneurScroll?.scrollTo({ top: 0, behavior: 'smooth' })
135
+ }
136
+
137
+ watch(visible, async val => {
138
+ if (!props.retourEnHaut) return
139
+ if (val) {
140
+ await nextTick()
141
+ conteneurScroll = document.querySelector('.v-navigation-drawer--active .v-navigation-drawer__content')
142
+ conteneurScroll?.addEventListener('scroll', onScroll)
143
+ } else {
144
+ conteneurScroll?.removeEventListener('scroll', onScroll)
145
+ conteneurScroll = null
146
+ afficherBoutonHaut.value = false
147
+ }
148
+ })
149
+
150
+ // Méthodes
151
+ const ouvrir = () => {
152
+ visible.value = true
153
+ }
154
+
155
+ const fermer = () => {
156
+ visible.value = false
157
+ }
158
+
159
+ const fermeture = () => {
160
+ emit('fermer')
161
+ fermer()
162
+ }
163
+
164
+ const okBouton = () => {
165
+ emit('ok')
166
+ fermer()
167
+ }
168
+
169
+ // Calcul des tailles du tiroir en fonction du breakpoint
170
+ const grosseurTiroir = computed(() => {
171
+ if (attrs.width !== undefined && attrs.width !== null) return attrs.width as string | number
172
+ switch (display.name.value) {
173
+ case 'xs':
174
+ return ''
175
+ case 'sm':
176
+ return 0.95 * display.width.value
177
+ case 'md':
178
+ return 0.8 * display.width.value
179
+ case 'lg':
180
+ return 0.7 * display.width.value
181
+ case 'xl':
182
+ return 0.6 * display.width.value
183
+ case 'xxl':
184
+ return 0.5 * display.width.value
185
+ default:
186
+ return ''
187
+ }
188
+ })
189
+
190
+ defineExpose({ ouvrir, fermer })
191
+ </script>
192
+
193
+ <style>
194
+ .csqc-ligneBleue {
195
+ border-left: 30px #095797 solid !important;
196
+ }
197
+ </style>
@@ -41,7 +41,7 @@
41
41
  </template>
42
42
 
43
43
  <v-list
44
- style="background-color: #223654 !important"
44
+ :style="{ backgroundColor: couleurSousListe }"
45
45
  min-width="230px"
46
46
  >
47
47
  <v-list-item
@@ -80,7 +80,7 @@
80
80
  <v-toolbar-title
81
81
  ><label
82
82
  class="ajouterPointeur"
83
- style="color: white !important"
83
+ style="color: rgb(var(--v-theme-blanc)) !important"
84
84
  >{{ $t('menu.menu') }}</label
85
85
  >
86
86
  </v-toolbar-title>
@@ -144,6 +144,7 @@
144
144
  <script setup lang="ts">
145
145
  import type { MenuItem, SousListe, SousListeItems } from '../../modeles/composants/csqcMenuModele'
146
146
  import { ref, computed } from 'vue'
147
+ import { useTheme } from 'vuetify'
147
148
 
148
149
  const props = defineProps({
149
150
  estMobile: {
@@ -165,12 +166,12 @@
165
166
  sousliste: {
166
167
  type: Array as () => SousListe[],
167
168
  required: false,
168
- default: () => [],
169
+ default: (): SousListe[] => [],
169
170
  },
170
171
  souslisteItems: {
171
172
  type: Array as () => SousListeItems[],
172
173
  required: false,
173
- default: () => [],
174
+ default: (): SousListeItems[] => [],
174
175
  },
175
176
  droitsMap: {
176
177
  type: Object as () => Record<string, boolean>,
@@ -179,6 +180,9 @@
179
180
  },
180
181
  })
181
182
 
183
+ const theme = useTheme()
184
+ const couleurSousListe = computed(() => (theme.current.value.colors as Record<string, string>)['bleuFonce'])
185
+
182
186
  const menu = ref<boolean>(false)
183
187
  const emit = defineEmits(['deconnexion'])
184
188
 
@@ -215,13 +219,14 @@
215
219
  <style lang="css" scoped>
216
220
  /* desktop background de la barre de menu et hauteur */
217
221
  .v-toolbar {
218
- background-color: #223654;
222
+ background-color: rgb(var(--v-theme-bleuFonce));
219
223
  height: 64px;
220
224
  }
221
225
 
226
+
222
227
  /* desktop couleur du texte de la barre, marge du haut, padding */
223
228
  .barreMenu {
224
- color: white !important;
229
+ color: rgb(var(--v-theme-blanc)) !important;
225
230
  padding: 0 10px 0 10px !important;
226
231
  }
227
232
  /* desktop */
@@ -244,35 +249,35 @@
244
249
  }
245
250
  /* desktop */
246
251
  .params_item {
247
- background-color: #223654 !important;
248
- color: white !important;
252
+ background-color: rgb(var(--v-theme-bleuFonce)) !important;
253
+ color: rgb(var(--v-theme-blanc)) !important;
249
254
  font-weight: 400;
250
255
  }
251
256
  /* desktop */
252
257
  .params_item.v-btn--active {
253
- color: white !important;
258
+ color: rgb(var(--v-theme-blanc)) !important;
254
259
  font-weight: 600 !important;
255
260
  }
256
261
  /* desktop */
257
262
  .params_item.v-btn--active:hover {
258
- background-color: #223654 !important;
259
- color: white !important;
263
+ background-color: rgb(var(--v-theme-bleuFonce)) !important;
264
+ color: rgb(var(--v-theme-blanc)) !important;
260
265
  }
261
266
  /* desktop */
262
267
  .params_item.v-btn--active:hover::before {
263
- color: #ffffff80 !important;
268
+ color: rgb(var(--v-theme-blanc) / 0.5) !important;
264
269
  }
265
270
  /* desktop */
266
271
  .params_item.v-btn--active::before {
267
272
  border-radius: 0;
268
- color: #ffffff80 !important;
273
+ color: rgb(var(--v-theme-blanc) / 0.5) !important;
269
274
  margin-top: 1px !important;
270
275
  opacity: 0.24;
271
276
  }
272
277
 
273
278
  /* mobile couleur du texte de la barre, marge du haut, padding */
274
279
  .barreMenuMobile {
275
- color: white !important;
280
+ color: rgb(var(--v-theme-blanc)) !important;
276
281
  padding: 0 10px 0 10px !important;
277
282
  }
278
283