codevdesign 0.0.67 → 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.
@@ -85,6 +85,12 @@
85
85
  texte: string
86
86
  }
87
87
 
88
+ interface EnteteEtatSecondaire {
89
+ afficher: boolean
90
+ couleur: string
91
+ texte: string
92
+ }
93
+
88
94
  const router = useRouter()
89
95
 
90
96
  const props = defineProps<{
@@ -92,6 +98,7 @@
92
98
  soustitre?: string
93
99
  retour?: string
94
100
  etat?: EnteteEtat
101
+ etatSecondaire?: EnteteEtatSecondaire
95
102
  }>()
96
103
 
97
104
  const titreCol = ref(12)
@@ -107,6 +114,16 @@
107
114
  )
108
115
  })
109
116
 
117
+ const monEtatSecondaire = computed<EnteteEtatSecondaire>(() => {
118
+ return (
119
+ props.etatSecondaire ?? {
120
+ afficher: false,
121
+ couleur: 'primary',
122
+ texte: 'test',
123
+ }
124
+ )
125
+ })
126
+
110
127
  function retournerMenu() {
111
128
  if (props.retour) {
112
129
  router.push({ name: props.retour })
@@ -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.67",
3
+ "version": "0.0.68",
4
4
  "description": "Composants Vuetify 3 pour les projets Codev",
5
5
  "files": [
6
6
  "./**/*.vue",