codevdesign 0.0.66 → 0.0.68

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,127 +1,158 @@
1
- <template>
2
- <v-app-bar
3
- color="white"
4
- class="px-0 mx-0"
5
- :style="{ position: 'sticky' }"
6
- height="82px"
7
- >
8
- <v-row
9
- class="pt-2"
10
- @resize="controlAffichage"
11
- >
12
- <v-col
13
- :cols="titreCol"
14
- class="pr-0 mr-0 pl-5"
15
- >
16
- <v-toolbar-title class="titre">
17
- <!-- Barre de retour -->
18
- <slot name="retour">
19
- <v-icon
20
- v-if="retour"
21
- size="large"
22
- start
23
- color="grisMoyen"
24
- icon="mdi-arrow-left-thin"
25
- @click="retournerMenu"
26
- /></slot>
27
-
28
- <div class="titre-bloc">
29
- <!-- Titre -->
30
- <slot name="titre"
31
- ><span class="pl-3"> {{ props.titre }}</span></slot
32
- >
33
-
34
- <!-- État -->
35
- <slot name="etat">
36
- <span
37
- v-if="monEtat?.afficher"
38
- class="pl-10"
39
- >
40
- <v-btn
41
- size="small"
42
- :color="monEtat.couleur"
43
- variant="tonal"
44
- >
45
- {{ monEtat.texte }}
46
- </v-btn>
47
- </span></slot
48
- >
49
-
50
- <!-- Sous-titre -->
51
- <slot name="soustitre"
52
- ><span class="pl-3 soustitre"> {{ props.soustitre }}</span></slot
53
- >
54
- </div>
55
- </v-toolbar-title>
56
- </v-col>
57
- </v-row>
58
- <!-- Barre en bas -->
59
- <div style="position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background-color: #808a9d" />
60
- </v-app-bar>
61
- </template>
62
-
63
- <script setup lang="ts">
64
- import { useRouter } from 'vue-router'
65
- import { ref, computed } from 'vue'
66
-
67
- // Déclaration de l'interface
68
- interface EnteteEtat {
69
- afficher: boolean
70
- couleur: string
71
- texte: string
72
- }
73
-
74
- const router = useRouter()
75
-
76
- const props = defineProps<{
77
- titre: string
78
- soustitre?: string
79
- retour?: string
80
- etat?: EnteteEtat
81
- }>()
82
-
83
- const titreCol = ref(12)
84
-
85
- // État calculé basé sur la prop, avec fallback
86
- const monEtat = computed<EnteteEtat>(() => {
87
- return (
88
- props.etat ?? {
89
- afficher: false,
90
- couleur: 'primary',
91
- texte: 'test',
92
- }
93
- )
94
- })
95
-
96
- function retournerMenu() {
97
- if (props.retour) {
98
- router.push({ name: props.retour })
99
- }
100
- }
101
-
102
- function controlAffichage() {
103
- // logique à l’événement de redimensionnement
104
- }
105
- </script>
106
- <style lang="css" scoped>
107
- .titre {
108
- font-size: 1.85rem;
109
- color: #223654;
110
- font-weight: bold;
111
- margin-bottom: 15px;
112
- }
113
- .soustitre {
114
- display: block;
115
- font-size: 1rem;
116
- color: #223654;
117
- font-weight: normal;
118
- }
119
- .titre-bloc {
120
- display: inline-block;
121
- vertical-align: middle;
122
- padding-left: 12px;
123
- }
124
- .v-icon:hover {
125
- color: #095797 !important;
126
- }
127
- </style>
1
+ <template>
2
+ <v-app-bar
3
+ color="white"
4
+ class="px-0 mx-0"
5
+ :style="{ position: 'sticky' }"
6
+ height="82px"
7
+ >
8
+ <v-row
9
+ class="pt-2"
10
+ @resize="controlAffichage"
11
+ >
12
+ <v-col
13
+ :cols="titreCol"
14
+ class="pr-0 mr-0 pl-5"
15
+ >
16
+ <v-toolbar-title class="titre">
17
+ <!-- Barre de retour -->
18
+ <slot name="retour">
19
+ <v-icon
20
+ v-if="retour"
21
+ size="large"
22
+ start
23
+ color="grisMoyen"
24
+ icon="mdi-arrow-left-thin"
25
+ @click="retournerMenu"
26
+ /></slot>
27
+
28
+ <div class="titre-bloc">
29
+ <!-- Titre -->
30
+ <slot name="titre"
31
+ ><span class="pl-3"> {{ props.titre }}</span></slot
32
+ >
33
+
34
+ <!-- État -->
35
+ <slot name="etat">
36
+ <span
37
+ v-if="monEtat?.afficher"
38
+ class="pl-10"
39
+ >
40
+ <v-btn
41
+ size="small"
42
+ :color="monEtat.couleur"
43
+ variant="tonal"
44
+ >
45
+ {{ monEtat.texte }}
46
+ </v-btn>
47
+ </span></slot
48
+ >
49
+ <!-- État secondaire-->
50
+ <slot name="etatSecondaire">
51
+ <span
52
+ v-if="monEtatSecondaire?.afficher"
53
+ class="pl-3"
54
+ >
55
+ <v-btn
56
+ size="small"
57
+ :color="monEtatSecondaire.couleur"
58
+ variant="tonal"
59
+ >
60
+ {{ monEtatSecondaire.texte }}
61
+ </v-btn>
62
+ </span></slot
63
+ >
64
+ <!-- Sous-titre -->
65
+ <slot name="soustitre"
66
+ ><span class="pl-3 soustitre"> {{ props.soustitre }}</span></slot
67
+ >
68
+ </div>
69
+ </v-toolbar-title>
70
+ </v-col>
71
+ </v-row>
72
+ <!-- Barre en bas -->
73
+ <div style="position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background-color: #808a9d" />
74
+ </v-app-bar>
75
+ </template>
76
+
77
+ <script setup lang="ts">
78
+ import { useRouter } from 'vue-router'
79
+ import { ref, computed } from 'vue'
80
+
81
+ // Déclaration de l'interface
82
+ interface EnteteEtat {
83
+ afficher: boolean
84
+ couleur: string
85
+ texte: string
86
+ }
87
+
88
+ interface EnteteEtatSecondaire {
89
+ afficher: boolean
90
+ couleur: string
91
+ texte: string
92
+ }
93
+
94
+ const router = useRouter()
95
+
96
+ const props = defineProps<{
97
+ titre: string
98
+ soustitre?: string
99
+ retour?: string
100
+ etat?: EnteteEtat
101
+ etatSecondaire?: EnteteEtatSecondaire
102
+ }>()
103
+
104
+ const titreCol = ref(12)
105
+
106
+ // État calculé basé sur la prop, avec fallback
107
+ const monEtat = computed<EnteteEtat>(() => {
108
+ return (
109
+ props.etat ?? {
110
+ afficher: false,
111
+ couleur: 'primary',
112
+ texte: 'test',
113
+ }
114
+ )
115
+ })
116
+
117
+ const monEtatSecondaire = computed<EnteteEtatSecondaire>(() => {
118
+ return (
119
+ props.etatSecondaire ?? {
120
+ afficher: false,
121
+ couleur: 'primary',
122
+ texte: 'test',
123
+ }
124
+ )
125
+ })
126
+
127
+ function retournerMenu() {
128
+ if (props.retour) {
129
+ router.push({ name: props.retour })
130
+ }
131
+ }
132
+
133
+ function controlAffichage() {
134
+ // logique à l’événement de redimensionnement
135
+ }
136
+ </script>
137
+ <style lang="css" scoped>
138
+ .titre {
139
+ font-size: 1.85rem;
140
+ color: #223654;
141
+ font-weight: bold;
142
+ margin-bottom: 15px;
143
+ }
144
+ .soustitre {
145
+ display: block;
146
+ font-size: 1rem;
147
+ color: #223654;
148
+ font-weight: normal;
149
+ }
150
+ .titre-bloc {
151
+ display: inline-block;
152
+ vertical-align: middle;
153
+ padding-left: 12px;
154
+ }
155
+ .v-icon:hover {
156
+ color: #095797 !important;
157
+ }
158
+ </style>
@@ -1,149 +1,155 @@
1
- <template>
2
- <v-navigation-drawer
3
- v-model="visible"
4
- location="right"
5
- temporary
6
- class="pa-0 elevation-2"
7
- :width="grosseurTiroir"
8
- :persistent="persistant"
9
- @keydown.esc="!persistant ? fermeture : ''"
10
- @click:outside="!persistant ? fermeture : ''"
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="fermeture"
20
- ></v-btn>
21
-
22
- <v-card-title
23
- class="pa-0 ma-0 pb-6 text-wrap"
24
- style="font-size: 24px"
25
- >
26
- <slot name="titre"></slot>
27
- <div text-h5>{{ titre }}</div>
28
- </v-card-title>
29
-
30
- <v-card-text class="pa-0 ma-0 pb-6 pr-6">
31
- <v-container>
32
- <slot></slot>
33
- <slot name="content"></slot>
34
- </v-container>
35
- </v-card-text>
36
- <v-card-actions class="my-2 d-flex justify-end pr-6 pb-5">
37
- <slot name="actions"></slot>
38
- <v-btn
39
- v-if="btnAnnuler"
40
- color="primary"
41
- variant="text"
42
- :loading="operationEnCours"
43
- @click="fermeture"
44
- >
45
- {{ props.btnAnnulerTexte ? props.btnAnnulerTexte : $t('csqc.bouton.annuler') }}
46
- </v-btn>
47
-
48
- <v-btn
49
- v-if="btnOk"
50
- class="Gouttiere"
51
- color="primary"
52
- variant="flat"
53
- :loading="operationEnCours"
54
- :disabled="btnOkDesactiver || operationEnCours"
55
- @click="okBouton"
56
- >
57
- {{ props.btnOkTexte ? props.btnOkTexte : $t('csqc.bouton.ok') }}
58
- </v-btn>
59
- </v-card-actions>
60
- </v-card>
61
- </v-navigation-drawer>
62
- </template>
63
- <script lang="ts" setup>
64
- import { ref, computed } from 'vue'
65
- import { useDisplay } from 'vuetify'
66
-
67
- const visible = ref(false)
68
- const display = useDisplay()
69
-
70
- // Déclaration des props
71
- const props = defineProps({
72
- titre: {
73
- type: String,
74
- default: '',
75
- required: false,
76
- },
77
- btnAnnuler: {
78
- type: Boolean,
79
- default: true,
80
- required: false,
81
- },
82
- btnOk: {
83
- type: Boolean,
84
- default: true,
85
- required: false,
86
- },
87
- btnAnnulerTexte: {
88
- type: String,
89
- default: '',
90
- required: false,
91
- },
92
- btnOkDesactiver: {
93
- type: Boolean,
94
- default: false,
95
- required: false,
96
- },
97
- operationEnCours: { type: Boolean, default: false },
98
- persistant: { type: Boolean, default: true },
99
- btnOkTexte: {
100
- type: String,
101
- default: '',
102
- required: false,
103
- },
104
- })
105
-
106
- // Déclaration des événements
107
- const emit = defineEmits(['fermer', 'ok'])
108
-
109
- // Méthodes
110
- const ouvrir = () => {
111
- visible.value = true
112
- }
113
-
114
- const fermer = () => {
115
- visible.value = false
116
- }
117
-
118
- const fermeture = () => {
119
- emit('fermer')
120
- fermer()
121
- }
122
-
123
- const okBouton = () => {
124
- emit('ok')
125
- fermer()
126
- }
127
-
128
- // Calcul des tailles du tiroir en fonction du breakpoint
129
- const grosseurTiroir = computed(() => {
130
- switch (display.name.value) {
131
- case 'xs':
132
- return ''
133
- case 'sm':
134
- return 0.95 * display.width.value
135
- case 'md':
136
- return 0.8 * display.width.value
137
- case 'lg':
138
- return 0.7 * display.width.value
139
- case 'xl':
140
- return 0.6 * display.width.value
141
- case 'xxl':
142
- return 0.5 * display.width.value
143
- default:
144
- return ''
145
- }
146
- })
147
-
148
- defineExpose({ ouvrir, fermer })
149
- </script>
1
+ <template>
2
+ <v-navigation-drawer
3
+ v-model="visible"
4
+ location="right"
5
+ temporary
6
+ class="pa-0 elevation-2 csqc-ligneBleue"
7
+ :width="grosseurTiroir"
8
+ :persistent="persistant"
9
+ @keydown.esc="!persistant ? fermeture : ''"
10
+ @click:outside="!persistant ? fermeture : ''"
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="fermeture"
20
+ ></v-btn>
21
+
22
+ <v-card-title
23
+ class="pa-0 ma-0 pb-6 text-wrap"
24
+ style="font-size: 24px"
25
+ >
26
+ <slot name="titre"></slot>
27
+ <div text-h5>{{ titre }}</div>
28
+ </v-card-title>
29
+
30
+ <v-card-text class="pa-0 ma-0 pb-6 pr-6">
31
+ <v-container>
32
+ <slot></slot>
33
+ <slot name="content"></slot>
34
+ </v-container>
35
+ </v-card-text>
36
+ <v-card-actions class="my-2 d-flex justify-end pr-6 pb-5">
37
+ <slot name="actions"></slot>
38
+ <v-btn
39
+ v-if="btnAnnuler"
40
+ color="primary"
41
+ variant="text"
42
+ :loading="operationEnCours"
43
+ @click="fermeture"
44
+ >
45
+ {{ props.btnAnnulerTexte ? props.btnAnnulerTexte : $t('csqc.bouton.annuler') }}
46
+ </v-btn>
47
+
48
+ <v-btn
49
+ v-if="btnOk"
50
+ class="Gouttiere"
51
+ color="primary"
52
+ variant="flat"
53
+ :loading="operationEnCours"
54
+ :disabled="btnOkDesactiver || operationEnCours"
55
+ @click="okBouton"
56
+ >
57
+ {{ props.btnOkTexte ? props.btnOkTexte : $t('csqc.bouton.ok') }}
58
+ </v-btn>
59
+ </v-card-actions>
60
+ </v-card>
61
+ </v-navigation-drawer>
62
+ </template>
63
+ <script lang="ts" setup>
64
+ import { ref, computed } from 'vue'
65
+ import { useDisplay } from 'vuetify'
66
+
67
+ const visible = ref(false)
68
+ const display = useDisplay()
69
+
70
+ // Déclaration des props
71
+ const props = defineProps({
72
+ titre: {
73
+ type: String,
74
+ default: '',
75
+ required: false,
76
+ },
77
+ btnAnnuler: {
78
+ type: Boolean,
79
+ default: true,
80
+ required: false,
81
+ },
82
+ btnOk: {
83
+ type: Boolean,
84
+ default: true,
85
+ required: false,
86
+ },
87
+ btnAnnulerTexte: {
88
+ type: String,
89
+ default: '',
90
+ required: false,
91
+ },
92
+ btnOkDesactiver: {
93
+ type: Boolean,
94
+ default: false,
95
+ required: false,
96
+ },
97
+ operationEnCours: { type: Boolean, default: false },
98
+ persistant: { type: Boolean, default: true },
99
+ btnOkTexte: {
100
+ type: String,
101
+ default: '',
102
+ required: false,
103
+ },
104
+ })
105
+
106
+ // Déclaration des événements
107
+ const emit = defineEmits(['fermer', 'ok'])
108
+
109
+ // Méthodes
110
+ const ouvrir = () => {
111
+ visible.value = true
112
+ }
113
+
114
+ const fermer = () => {
115
+ visible.value = false
116
+ }
117
+
118
+ const fermeture = () => {
119
+ emit('fermer')
120
+ fermer()
121
+ }
122
+
123
+ const okBouton = () => {
124
+ emit('ok')
125
+ fermer()
126
+ }
127
+
128
+ // Calcul des tailles du tiroir en fonction du breakpoint
129
+ const grosseurTiroir = computed(() => {
130
+ switch (display.name.value) {
131
+ case 'xs':
132
+ return ''
133
+ case 'sm':
134
+ return 0.95 * display.width.value
135
+ case 'md':
136
+ return 0.8 * display.width.value
137
+ case 'lg':
138
+ return 0.7 * display.width.value
139
+ case 'xl':
140
+ return 0.6 * display.width.value
141
+ case 'xxl':
142
+ return 0.5 * display.width.value
143
+ default:
144
+ return ''
145
+ }
146
+ })
147
+
148
+ defineExpose({ ouvrir, fermer })
149
+ </script>
150
+
151
+ <style>
152
+ .csqc-ligneBleue {
153
+ border-left: 30px #095797 solid !important;
154
+ }
155
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codevdesign",
3
- "version": "0.0.66",
3
+ "version": "0.0.68",
4
4
  "description": "Composants Vuetify 3 pour les projets Codev",
5
5
  "files": [
6
6
  "./**/*.vue",