codevdesign 0.0.62 → 0.0.63

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,117 +1,117 @@
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
-
22
- <v-card-title
23
- class="pa-0 ma-0 pb-6"
24
- style="font-size: 24px; white-space: normal; word-break: break-word"
25
- >
26
- <slot name="titre"></slot>
27
- <div text-h5><span v-html="titre"></span></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
- :loading="operationEnCours"
42
- variant="text"
43
- @click="annuler"
44
- >
45
- {{ btnAnnulerTexte ? btnAnnulerTexte : $t('csqc.bouton.annuler') }}
46
- </v-btn>
47
-
48
- <v-btn
49
- v-if="btnOk"
50
- class="Gouttiere"
51
- color="primary"
52
- :loading="operationEnCours"
53
- :disabled="btnOkDesactiver"
54
- variant="flat"
55
- @click="okBouton"
56
- >
57
- {{ btnOkTexte ? btnOkTexte : $t('csqc.bouton.ok') }}
58
- </v-btn>
59
- </v-card-actions>
60
- </v-card>
61
- </v-dialog>
62
- </template>
63
-
64
- <script setup lang="ts">
65
- import { ref } from 'vue'
66
- import { useDisplay } from 'vuetify'
67
-
68
- const display = useDisplay()
69
-
70
- // Déclaration des props
71
- const props = defineProps({
72
- largeur: { type: String, default: '50vw' },
73
- persistant: { type: Boolean, default: true },
74
- operationEnCours: { type: Boolean, default: false },
75
- btnAnnuler: { type: Boolean, default: true },
76
- btnOk: { type: Boolean, default: true },
77
- btnAnnulerTexte: { type: String, default: '' },
78
- btnOkTexte: { type: String, default: '' },
79
- titre: { type: String, default: '' },
80
- btnOkDesactiver: { type: Boolean, default: false },
81
- })
82
-
83
- // Déclaration des événements émis
84
- const emit = defineEmits(['annuler', 'ok'])
85
-
86
- // Gestion de l'état du dialogue
87
- const dialog = ref(false)
88
-
89
- // Méthodes pour gérer l'ouverture et la fermeture
90
- const ouvrir = () => {
91
- dialog.value = true
92
- }
93
-
94
- const fermer = () => {
95
- dialog.value = false
96
- }
97
-
98
- // Gestion des actions des boutons
99
- const annuler = () => {
100
- emit('annuler')
101
- fermer()
102
- }
103
-
104
- const okBouton = () => {
105
- emit('ok')
106
- }
107
-
108
- // permet d'exporter les 2 actions
109
- defineExpose({ ouvrir, fermer })
110
- </script>
111
-
112
- <style lang="css" scoped>
113
- .v-card__text,
114
- .v-card__title {
115
- word-break: normal; /* empeche le wrap de couper un mot en XS */
116
- }
117
- </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
+
22
+ <v-card-title
23
+ class="pa-0 ma-0 pb-6"
24
+ style="font-size: 24px; white-space: normal; word-break: break-word"
25
+ >
26
+ <slot name="titre"></slot>
27
+ <div text-h5><span v-html="titre"></span></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
+ :loading="operationEnCours"
42
+ variant="text"
43
+ @click="annuler"
44
+ >
45
+ {{ btnAnnulerTexte ? btnAnnulerTexte : $t('csqc.bouton.annuler') }}
46
+ </v-btn>
47
+
48
+ <v-btn
49
+ v-if="btnOk"
50
+ class="Gouttiere"
51
+ color="primary"
52
+ :loading="operationEnCours"
53
+ :disabled="btnOkDesactiver"
54
+ variant="flat"
55
+ @click="okBouton"
56
+ >
57
+ {{ btnOkTexte ? btnOkTexte : $t('csqc.bouton.ok') }}
58
+ </v-btn>
59
+ </v-card-actions>
60
+ </v-card>
61
+ </v-dialog>
62
+ </template>
63
+
64
+ <script setup lang="ts">
65
+ import { ref } from 'vue'
66
+ import { useDisplay } from 'vuetify'
67
+
68
+ const display = useDisplay()
69
+
70
+ // Déclaration des props
71
+ const props = defineProps({
72
+ largeur: { type: String, default: '50vw' },
73
+ persistant: { type: Boolean, default: true },
74
+ operationEnCours: { type: Boolean, default: false },
75
+ btnAnnuler: { type: Boolean, default: true },
76
+ btnOk: { type: Boolean, default: true },
77
+ btnAnnulerTexte: { type: String, default: '' },
78
+ btnOkTexte: { type: String, default: '' },
79
+ titre: { type: String, default: '' },
80
+ btnOkDesactiver: { type: Boolean, default: false },
81
+ })
82
+
83
+ // Déclaration des événements émis
84
+ const emit = defineEmits(['annuler', 'ok'])
85
+
86
+ // Gestion de l'état du dialogue
87
+ const dialog = ref(false)
88
+
89
+ // Méthodes pour gérer l'ouverture et la fermeture
90
+ const ouvrir = () => {
91
+ dialog.value = true
92
+ }
93
+
94
+ const fermer = () => {
95
+ dialog.value = false
96
+ }
97
+
98
+ // Gestion des actions des boutons
99
+ const annuler = () => {
100
+ emit('annuler')
101
+ fermer()
102
+ }
103
+
104
+ const okBouton = () => {
105
+ emit('ok')
106
+ }
107
+
108
+ // permet d'exporter les 2 actions
109
+ defineExpose({ ouvrir, fermer })
110
+ </script>
111
+
112
+ <style lang="css" scoped>
113
+ .v-card__text,
114
+ .v-card__title {
115
+ word-break: normal; /* empeche le wrap de couper un mot en XS */
116
+ }
117
+ </style>
@@ -1,124 +1,124 @@
1
- <template>
2
- <div>
3
- <v-row dense>
4
- <v-col
5
- cols="9"
6
- md="8"
7
- lg="6"
8
- class="d-flex align-end"
9
- >
10
- <div class="labelSwitchSiSwitchApres">{{ texte }}</div>
11
- </v-col>
12
- <v-col
13
- cols="2"
14
- class="d-flex align-end justify-end"
15
- >
16
- <v-switch
17
- v-model="maValeur"
18
- :disabled="desactiver"
19
- :density="densite"
20
- :inset="inset"
21
- hide-details
22
- @update:model-value="sauvegarder"
23
- />
24
- </v-col>
25
- </v-row>
26
- <v-row dense>
27
- <v-col
28
- cols="9"
29
- md="8"
30
- >
31
- <span v-html="texteDetaille"></span>
32
- </v-col>
33
- </v-row>
34
- </div>
35
- </template>
36
- <script setup lang="ts">
37
- import { ref, watch, onMounted, type PropType } from 'vue'
38
-
39
- // Définition des props
40
- const props = defineProps({
41
- valeurInverse: {
42
- type: Boolean,
43
- default: false,
44
- },
45
- desactiver: {
46
- type: Boolean,
47
- default: false,
48
- },
49
- inset: {
50
- type: Boolean,
51
- default: true,
52
- },
53
- modelValue: {
54
- type: Boolean,
55
- required: true,
56
- },
57
- texte: {
58
- type: String,
59
- required: true,
60
- },
61
- texteDetaille: {
62
- type: String,
63
- required: true,
64
- },
65
- densite: { type: String as PropType<'default' | 'comfortable' | 'compact'>, default: 'compact' },
66
- })
67
-
68
- // Définition de l'événement
69
- const emit = defineEmits(['update:modelValue'])
70
-
71
- // Référence pour la valeur interne
72
- const maValeur = ref<boolean>(false)
73
-
74
- // Montée du composant
75
- onMounted(() => {
76
- if (props.valeurInverse) {
77
- maValeur.value = !props.modelValue
78
- } else {
79
- maValeur.value = props.modelValue
80
- }
81
- })
82
-
83
- // Watcher pour suivre les changements de la prop 'value'
84
- watch(
85
- () => props.modelValue,
86
- newValue => {
87
- if (props.valeurInverse) {
88
- maValeur.value = !newValue
89
- } else {
90
- maValeur.value = newValue
91
- }
92
- },
93
- )
94
-
95
- watch(
96
- () => props.valeurInverse,
97
- newValue => {
98
- if (props.valeurInverse) {
99
- maValeur.value = newValue
100
- } else {
101
- maValeur.value = !newValue
102
- }
103
- },
104
- )
105
-
106
- // Méthode pour sauvegarder la valeur
107
- const sauvegarder = () => {
108
- if (props.valeurInverse) {
109
- emit('update:modelValue', !maValeur.value)
110
- } else {
111
- emit('update:modelValue', maValeur.value)
112
- }
113
- }
114
- </script>
115
-
116
- <style lang="css" scoped>
117
- .labelSwitchSiSwitchApres {
118
- font-weight: bold;
119
- margin-top: 25px;
120
- }
121
- .v-switch {
122
- margin-bottom: -10px; /* aligner le switch avec son texte*/
123
- }
124
- </style>
1
+ <template>
2
+ <div>
3
+ <v-row dense>
4
+ <v-col
5
+ cols="9"
6
+ md="8"
7
+ lg="6"
8
+ class="d-flex align-end"
9
+ >
10
+ <div class="labelSwitchSiSwitchApres">{{ texte }}</div>
11
+ </v-col>
12
+ <v-col
13
+ cols="2"
14
+ class="d-flex align-end justify-end"
15
+ >
16
+ <v-switch
17
+ v-model="maValeur"
18
+ :disabled="desactiver"
19
+ :density="densite"
20
+ :inset="inset"
21
+ hide-details
22
+ @update:model-value="sauvegarder"
23
+ />
24
+ </v-col>
25
+ </v-row>
26
+ <v-row dense>
27
+ <v-col
28
+ cols="9"
29
+ md="8"
30
+ >
31
+ <span v-html="texteDetaille"></span>
32
+ </v-col>
33
+ </v-row>
34
+ </div>
35
+ </template>
36
+ <script setup lang="ts">
37
+ import { ref, watch, onMounted, type PropType } from 'vue'
38
+
39
+ // Définition des props
40
+ const props = defineProps({
41
+ valeurInverse: {
42
+ type: Boolean,
43
+ default: false,
44
+ },
45
+ desactiver: {
46
+ type: Boolean,
47
+ default: false,
48
+ },
49
+ inset: {
50
+ type: Boolean,
51
+ default: true,
52
+ },
53
+ modelValue: {
54
+ type: Boolean,
55
+ required: true,
56
+ },
57
+ texte: {
58
+ type: String,
59
+ required: true,
60
+ },
61
+ texteDetaille: {
62
+ type: String,
63
+ required: true,
64
+ },
65
+ densite: { type: String as PropType<'default' | 'comfortable' | 'compact'>, default: 'compact' },
66
+ })
67
+
68
+ // Définition de l'événement
69
+ const emit = defineEmits(['update:modelValue'])
70
+
71
+ // Référence pour la valeur interne
72
+ const maValeur = ref<boolean>(false)
73
+
74
+ // Montée du composant
75
+ onMounted(() => {
76
+ if (props.valeurInverse) {
77
+ maValeur.value = !props.modelValue
78
+ } else {
79
+ maValeur.value = props.modelValue
80
+ }
81
+ })
82
+
83
+ // Watcher pour suivre les changements de la prop 'value'
84
+ watch(
85
+ () => props.modelValue,
86
+ newValue => {
87
+ if (props.valeurInverse) {
88
+ maValeur.value = !newValue
89
+ } else {
90
+ maValeur.value = newValue
91
+ }
92
+ },
93
+ )
94
+
95
+ watch(
96
+ () => props.valeurInverse,
97
+ newValue => {
98
+ if (props.valeurInverse) {
99
+ maValeur.value = newValue
100
+ } else {
101
+ maValeur.value = !newValue
102
+ }
103
+ },
104
+ )
105
+
106
+ // Méthode pour sauvegarder la valeur
107
+ const sauvegarder = () => {
108
+ if (props.valeurInverse) {
109
+ emit('update:modelValue', !maValeur.value)
110
+ } else {
111
+ emit('update:modelValue', maValeur.value)
112
+ }
113
+ }
114
+ </script>
115
+
116
+ <style lang="css" scoped>
117
+ .labelSwitchSiSwitchApres {
118
+ font-weight: bold;
119
+ margin-top: 25px;
120
+ }
121
+ .v-switch {
122
+ margin-bottom: -10px; /* aligner le switch avec son texte*/
123
+ }
124
+ </style>
@@ -4,7 +4,14 @@
4
4
  dense
5
5
  class="pt-0 mt-0"
6
6
  >
7
- <v-col>
7
+ <v-col
8
+ cols="12"
9
+ sm="7"
10
+ md="6"
11
+ lg="5"
12
+ xl="4"
13
+ >
14
+ <slot name="recherche"></slot>
8
15
  <v-text-field
9
16
  v-model="rechercheLocale"
10
17
  :label="rechercheTexte ? rechercheTexte : $t('csqc.label.recherche')"
@@ -33,6 +40,23 @@
33
40
  </template>
34
41
  </v-text-field>
35
42
  </v-col>
43
+ <!-- Entre recherche et ajouté-->
44
+ <v-col
45
+ cols="12"
46
+ sm="auto"
47
+ class="pt-1 mt-0 pb-0 mb-0"
48
+ >
49
+ <slot name="milieu" />
50
+ </v-col>
51
+
52
+ <!-- Affichage des boutons et icônes-->
53
+ <v-col
54
+ cols="12"
55
+ sm="auto"
56
+ class="flex-grow-1 d-flex justify-end"
57
+ >
58
+ <slot name="droite" />
59
+ </v-col>
36
60
  </v-row>
37
61
  <v-row
38
62
  dense
@@ -40,8 +64,7 @@
40
64
  >
41
65
  <v-col
42
66
  cols="12"
43
- md="10"
44
- lg="8"
67
+ :lg="rechercheAvanceeLargeur"
45
68
  >
46
69
  <v-expansion-panels
47
70
  v-if="rechercheAvancee"
@@ -90,6 +113,11 @@
90
113
  required: false,
91
114
  default: '',
92
115
  },
116
+ rechercheAvanceeLargeur: {
117
+ type: Number,
118
+ required: false,
119
+ default: 12,
120
+ },
93
121
  chargement: {
94
122
  type: Boolean,
95
123
  required: false,