codevdesign 2.0.19 → 2.0.21

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,54 +1,54 @@
1
- <template>
2
- <div>
3
- <v-list-item-title>{{ nomUnite }}</v-list-item-title>
4
- <v-list-item-subtitle v-if="getPreference != ''">
5
- {{ getPreference }}
6
- </v-list-item-subtitle>
7
- <v-list-item-subtitle
8
- v-if="getPreference == ''"
9
- class="messageErreurChaiseItem"
10
- >
11
- {{ $t('csqc.message.chaiseSelection') }}
12
- </v-list-item-subtitle>
13
- </div>
14
- </template>
15
- <script lang="ts" setup>
16
- import { computed } from 'vue'
17
-
18
- // Définition des props
19
- const props = defineProps<{
20
- uniteId: number
21
- preferences: { chaiseId: number }[]
22
- dictChaisesReleve: Record<number, { id: number; nom: string }[]>
23
- unites: { id: number; nom: string }[]
24
- }>()
25
-
26
- const nomUnite = computed(() => {
27
- if (!props.uniteId || !props.unites?.length) {
28
- return ''
29
- }
30
-
31
- const unite = props.unites.find(u => u.id == props.uniteId)
32
- return unite?.nom || ''
33
- })
34
-
35
- const getPreference = computed(() => {
36
- const chaises = props.dictChaisesReleve?.[props.uniteId] ?? []
37
- const prefs = props.preferences ?? []
38
-
39
- for (const chaise of chaises) {
40
- if (prefs.some(p => p.chaiseId === chaise.id)) {
41
- return chaise.nom
42
- }
43
- }
44
-
45
- return ''
46
- })
47
- </script>
48
-
49
- <style scoped>
50
- .messageErreurChaiseItem {
51
- color: red !important;
52
- font-style: italic;
53
- }
54
- </style>
1
+ <template>
2
+ <div>
3
+ <v-list-item-title>{{ nomUnite }}</v-list-item-title>
4
+ <v-list-item-subtitle v-if="getPreference != ''">
5
+ {{ getPreference }}
6
+ </v-list-item-subtitle>
7
+ <v-list-item-subtitle
8
+ v-if="getPreference == ''"
9
+ class="messageErreurChaiseItem"
10
+ >
11
+ {{ $t('csqc.message.chaiseSelection') }}
12
+ </v-list-item-subtitle>
13
+ </div>
14
+ </template>
15
+ <script lang="ts" setup>
16
+ import { computed } from 'vue'
17
+
18
+ // Définition des props
19
+ const props = defineProps<{
20
+ uniteId: number
21
+ preferences: { chaiseId: number }[]
22
+ dictChaisesReleve: Record<number, { id: number; nom: string }[]>
23
+ unites: { id: number; nom: string }[]
24
+ }>()
25
+
26
+ const nomUnite = computed(() => {
27
+ if (!props.uniteId || !props.unites?.length) {
28
+ return ''
29
+ }
30
+
31
+ const unite = props.unites.find(u => u.id == props.uniteId)
32
+ return unite?.nom || ''
33
+ })
34
+
35
+ const getPreference = computed(() => {
36
+ const chaises = props.dictChaisesReleve?.[props.uniteId] ?? []
37
+ const prefs = props.preferences ?? []
38
+
39
+ for (const chaise of chaises) {
40
+ if (prefs.some(p => p.chaiseId === chaise.id)) {
41
+ return chaise.nom
42
+ }
43
+ }
44
+
45
+ return ''
46
+ })
47
+ </script>
48
+
49
+ <style scoped>
50
+ .messageErreurChaiseItem {
51
+ color: red !important;
52
+ font-style: italic;
53
+ }
54
+ </style>
@@ -1,120 +1,120 @@
1
- <template>
2
- <v-dialog
3
- v-model="dialog"
4
- class="pa-0 ma-0"
5
- :width="largeur"
6
- :fullscreen="display.xs.value"
7
- max-width="650"
8
- :persistent="props.persistant"
9
- v-bind="$attrs"
10
- @keydown.esc="!persistant ? annuler : ''"
11
- @click:outside="!persistant ? annuler : ''"
12
- >
13
- <v-card
14
- color="background"
15
- class="pa-0 ma-0 pl-8 pt-8"
16
- >
17
- <!-- Bouton en haut à droite -->
18
- <v-btn
19
- icon="mdi-close"
20
- variant="text"
21
- class="position-absolute iconeHover"
22
- color="primary"
23
- style="right: 5px; top: 5px"
24
- @click="annuler"
25
- ></v-btn>
26
-
27
- <v-card-title
28
- class="pa-0 ma-0 pb-6 headline"
29
- style="font-size: 24px; white-space: normal; word-break: break-word"
30
- >
31
- <slot name="titre"></slot>
32
- <div text-h5><span v-html="titre"></span></div>
33
- </v-card-title>
34
-
35
- <v-card-text class="pa-0 ma-0 pb-6 pr-6">
36
- <v-container>
37
- <slot></slot>
38
- <slot name="content"></slot>
39
- </v-container>
40
- </v-card-text>
41
- <v-card-actions class="my-2 d-flex justify-end pr-6 pb-5">
42
- <slot name="actions"></slot>
43
- <bouton-tertiaire
44
- v-if="btnAnnuler"
45
- :loading="operationEnCours"
46
- @click="annuler"
47
- >
48
- {{ btnAnnulerTexte ? btnAnnulerTexte : $t('csqc.bouton.annuler') }}
49
- </bouton-tertiaire>
50
-
51
- <bouton-primaire
52
- v-if="btnOk"
53
- class="Gouttiere"
54
- :color="props.estDialogueAlerte ? 'rouge' : 'primary'"
55
- :loading="operationEnCours"
56
- :disabled="btnOkDesactiver"
57
- @click="okBouton"
58
- >
59
- {{ btnOkTexte ? btnOkTexte : $t('csqc.bouton.ok') }}
60
- </bouton-primaire>
61
- </v-card-actions>
62
- </v-card>
63
- </v-dialog>
64
- </template>
65
-
66
- <script setup lang="ts">
67
- import { ref } from 'vue'
68
- import { useDisplay } from 'vuetify'
69
-
70
- const display = useDisplay()
71
-
72
- // Déclaration des props
73
- const props = defineProps({
74
- largeur: { type: String, default: '50vw' },
75
- persistant: { type: Boolean, default: true },
76
- operationEnCours: { type: Boolean, default: false },
77
- btnAnnuler: { type: Boolean, default: true },
78
- btnOk: { type: Boolean, default: true },
79
- btnAnnulerTexte: { type: String, default: '' },
80
- btnOkTexte: { type: String, default: '' },
81
- titre: { type: String, default: '' },
82
- btnOkDesactiver: { type: Boolean, default: false },
83
- estDialogueAlerte: { type: Boolean, default: false },
84
- })
85
-
86
- // Déclaration des événements émis
87
- const emit = defineEmits(['annuler', 'ok'])
88
-
89
- // Gestion de l'état du dialogue
90
- const dialog = ref(false)
91
-
92
- // Méthodes pour gérer l'ouverture et la fermeture
93
- const ouvrir = () => {
94
- dialog.value = true
95
- }
96
-
97
- const fermer = () => {
98
- dialog.value = false
99
- }
100
-
101
- // Gestion des actions des boutons
102
- const annuler = () => {
103
- emit('annuler')
104
- fermer()
105
- }
106
-
107
- const okBouton = () => {
108
- emit('ok')
109
- }
110
-
111
- // permet d'exporter les 2 actions
112
- defineExpose({ ouvrir, fermer })
113
- </script>
114
-
115
- <style lang="css" scoped>
116
- .v-card__text,
117
- .v-card__title {
118
- word-break: normal; /* empeche le wrap de couper un mot en XS */
119
- }
120
- </style>
1
+ <template>
2
+ <v-dialog
3
+ v-model="dialog"
4
+ class="pa-0 ma-0"
5
+ :width="largeur"
6
+ :fullscreen="display.xs.value"
7
+ max-width="650"
8
+ :persistent="props.persistant"
9
+ v-bind="$attrs"
10
+ @keydown.esc="!persistant ? annuler : ''"
11
+ @click:outside="!persistant ? annuler : ''"
12
+ >
13
+ <v-card
14
+ color="background"
15
+ class="pa-0 ma-0 pl-8 pt-8"
16
+ >
17
+ <!-- Bouton en haut à droite -->
18
+ <v-btn
19
+ icon="mdi-close"
20
+ variant="text"
21
+ class="position-absolute iconeHover"
22
+ color="primary"
23
+ style="right: 5px; top: 5px"
24
+ @click="annuler"
25
+ ></v-btn>
26
+
27
+ <v-card-title
28
+ class="pa-0 ma-0 pb-6 headline"
29
+ style="font-size: 24px; white-space: normal; word-break: break-word"
30
+ >
31
+ <slot name="titre"></slot>
32
+ <div text-h5><span v-html="titre"></span></div>
33
+ </v-card-title>
34
+
35
+ <v-card-text class="pa-0 ma-0 pb-6 pr-6">
36
+ <v-container>
37
+ <slot></slot>
38
+ <slot name="content"></slot>
39
+ </v-container>
40
+ </v-card-text>
41
+ <v-card-actions class="my-2 d-flex justify-end pr-6 pb-5">
42
+ <slot name="actions"></slot>
43
+ <bouton-tertiaire
44
+ v-if="btnAnnuler"
45
+ :loading="operationEnCours"
46
+ @click="annuler"
47
+ >
48
+ {{ btnAnnulerTexte ? btnAnnulerTexte : $t('csqc.bouton.annuler') }}
49
+ </bouton-tertiaire>
50
+
51
+ <bouton-primaire
52
+ v-if="btnOk"
53
+ class="Gouttiere"
54
+ :color="props.estDialogueAlerte ? 'rouge' : 'primary'"
55
+ :loading="operationEnCours"
56
+ :disabled="btnOkDesactiver"
57
+ @click="okBouton"
58
+ >
59
+ {{ btnOkTexte ? btnOkTexte : $t('csqc.bouton.ok') }}
60
+ </bouton-primaire>
61
+ </v-card-actions>
62
+ </v-card>
63
+ </v-dialog>
64
+ </template>
65
+
66
+ <script setup lang="ts">
67
+ import { ref } from 'vue'
68
+ import { useDisplay } from 'vuetify'
69
+
70
+ const display = useDisplay()
71
+
72
+ // Déclaration des props
73
+ const props = defineProps({
74
+ largeur: { type: String, default: '50vw' },
75
+ persistant: { type: Boolean, default: true },
76
+ operationEnCours: { type: Boolean, default: false },
77
+ btnAnnuler: { type: Boolean, default: true },
78
+ btnOk: { type: Boolean, default: true },
79
+ btnAnnulerTexte: { type: String, default: '' },
80
+ btnOkTexte: { type: String, default: '' },
81
+ titre: { type: String, default: '' },
82
+ btnOkDesactiver: { type: Boolean, default: false },
83
+ estDialogueAlerte: { type: Boolean, default: false },
84
+ })
85
+
86
+ // Déclaration des événements émis
87
+ const emit = defineEmits(['annuler', 'ok'])
88
+
89
+ // Gestion de l'état du dialogue
90
+ const dialog = ref(false)
91
+
92
+ // Méthodes pour gérer l'ouverture et la fermeture
93
+ const ouvrir = () => {
94
+ dialog.value = true
95
+ }
96
+
97
+ const fermer = () => {
98
+ dialog.value = false
99
+ }
100
+
101
+ // Gestion des actions des boutons
102
+ const annuler = () => {
103
+ emit('annuler')
104
+ fermer()
105
+ }
106
+
107
+ const okBouton = () => {
108
+ emit('ok')
109
+ }
110
+
111
+ // permet d'exporter les 2 actions
112
+ defineExpose({ ouvrir, fermer })
113
+ </script>
114
+
115
+ <style lang="css" scoped>
116
+ .v-card__text,
117
+ .v-card__title {
118
+ word-break: normal; /* empeche le wrap de couper un mot en XS */
119
+ }
120
+ </style>