codevdesign 0.0.62 → 0.0.64

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,8 @@
4
4
  dense
5
5
  class="pt-0 mt-0"
6
6
  >
7
- <v-col>
7
+ <v-col cols="12">
8
+ <slot name="recherche"></slot>
8
9
  <v-text-field
9
10
  v-model="rechercheLocale"
10
11
  :label="rechercheTexte ? rechercheTexte : $t('csqc.label.recherche')"
@@ -33,6 +34,23 @@
33
34
  </template>
34
35
  </v-text-field>
35
36
  </v-col>
37
+ <!-- Entre recherche et ajouté-->
38
+ <v-col
39
+ cols="12"
40
+ sm="auto"
41
+ class="pt-1 mt-0 pb-0 mb-0"
42
+ >
43
+ <slot name="milieu" />
44
+ </v-col>
45
+
46
+ <!-- Affichage des boutons et icônes-->
47
+ <v-col
48
+ cols="12"
49
+ sm="auto"
50
+ class="flex-grow-1 d-flex justify-end"
51
+ >
52
+ <slot name="droite" />
53
+ </v-col>
36
54
  </v-row>
37
55
  <v-row
38
56
  dense
@@ -40,8 +58,7 @@
40
58
  >
41
59
  <v-col
42
60
  cols="12"
43
- md="10"
44
- lg="8"
61
+ :lg="rechercheAvanceeLargeur"
45
62
  >
46
63
  <v-expansion-panels
47
64
  v-if="rechercheAvancee"
@@ -90,6 +107,11 @@
90
107
  required: false,
91
108
  default: '',
92
109
  },
110
+ rechercheAvanceeLargeur: {
111
+ type: Number,
112
+ required: false,
113
+ default: 12,
114
+ },
93
115
  chargement: {
94
116
  type: Boolean,
95
117
  required: false,