codevdesign 0.0.78 → 0.0.79

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