codevdesign 1.0.27 → 1.0.30

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,120 +1,120 @@
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="compact"
20
- inset
21
- v-bind="$attrs"
22
- hide-details
23
- @update:model-value="sauvegarder"
24
- />
25
- </v-col>
26
- </v-row>
27
- <v-row dense>
28
- <v-col
29
- cols="9"
30
- md="8"
31
- >
32
- <span v-html="texteDetaille"></span>
33
- </v-col>
34
- </v-row>
35
- </div>
36
- </template>
37
- <script setup lang="ts">
38
- import { ref, watch, onMounted, type PropType } from 'vue'
39
-
40
- // Définition des props
41
- const props = defineProps({
42
- valeurInverse: {
43
- type: Boolean,
44
- default: false,
45
- },
46
- desactiver: {
47
- type: Boolean,
48
- default: false,
49
- },
50
- modelValue: {
51
- type: Boolean,
52
- required: true,
53
- },
54
- texte: {
55
- type: String,
56
- required: true,
57
- },
58
- texteDetaille: {
59
- type: String,
60
- required: true,
61
- },
62
- })
63
-
64
- // Définition de l'événement
65
- const emit = defineEmits(['update:modelValue'])
66
-
67
- // Référence pour la valeur interne
68
- const maValeur = ref<boolean>(false)
69
-
70
- // Montée du composant
71
- onMounted(() => {
72
- if (props.valeurInverse) {
73
- maValeur.value = !props.modelValue
74
- } else {
75
- maValeur.value = props.modelValue
76
- }
77
- })
78
-
79
- // Watcher pour suivre les changements de la prop 'value'
80
- watch(
81
- () => props.modelValue,
82
- newValue => {
83
- if (props.valeurInverse) {
84
- maValeur.value = !newValue
85
- } else {
86
- maValeur.value = newValue
87
- }
88
- },
89
- )
90
-
91
- watch(
92
- () => props.valeurInverse,
93
- newValue => {
94
- if (props.valeurInverse) {
95
- maValeur.value = newValue
96
- } else {
97
- maValeur.value = !newValue
98
- }
99
- },
100
- )
101
-
102
- // Méthode pour sauvegarder la valeur
103
- const sauvegarder = () => {
104
- if (props.valeurInverse) {
105
- emit('update:modelValue', !maValeur.value)
106
- } else {
107
- emit('update:modelValue', maValeur.value)
108
- }
109
- }
110
- </script>
111
-
112
- <style lang="css" scoped>
113
- .labelSwitchSiSwitchApres {
114
- font-weight: bold;
115
- margin-top: 25px;
116
- }
117
- .v-switch {
118
- margin-bottom: -10px; /* aligner le switch avec son texte*/
119
- }
120
- </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="compact"
20
+ inset
21
+ v-bind="$attrs"
22
+ hide-details
23
+ @update:model-value="sauvegarder"
24
+ />
25
+ </v-col>
26
+ </v-row>
27
+ <v-row dense>
28
+ <v-col
29
+ cols="9"
30
+ md="8"
31
+ >
32
+ <span v-html="texteDetaille"></span>
33
+ </v-col>
34
+ </v-row>
35
+ </div>
36
+ </template>
37
+ <script setup lang="ts">
38
+ import { ref, watch, onMounted, type PropType } from 'vue'
39
+
40
+ // Définition des props
41
+ const props = defineProps({
42
+ valeurInverse: {
43
+ type: Boolean,
44
+ default: false,
45
+ },
46
+ desactiver: {
47
+ type: Boolean,
48
+ default: false,
49
+ },
50
+ modelValue: {
51
+ type: Boolean,
52
+ required: true,
53
+ },
54
+ texte: {
55
+ type: String,
56
+ required: true,
57
+ },
58
+ texteDetaille: {
59
+ type: String,
60
+ required: true,
61
+ },
62
+ })
63
+
64
+ // Définition de l'événement
65
+ const emit = defineEmits(['update:modelValue'])
66
+
67
+ // Référence pour la valeur interne
68
+ const maValeur = ref<boolean>(false)
69
+
70
+ // Montée du composant
71
+ onMounted(() => {
72
+ if (props.valeurInverse) {
73
+ maValeur.value = !props.modelValue
74
+ } else {
75
+ maValeur.value = props.modelValue
76
+ }
77
+ })
78
+
79
+ // Watcher pour suivre les changements de la prop 'value'
80
+ watch(
81
+ () => props.modelValue,
82
+ newValue => {
83
+ if (props.valeurInverse) {
84
+ maValeur.value = !newValue
85
+ } else {
86
+ maValeur.value = newValue
87
+ }
88
+ },
89
+ )
90
+
91
+ watch(
92
+ () => props.valeurInverse,
93
+ newValue => {
94
+ if (props.valeurInverse) {
95
+ maValeur.value = newValue
96
+ } else {
97
+ maValeur.value = !newValue
98
+ }
99
+ },
100
+ )
101
+
102
+ // Méthode pour sauvegarder la valeur
103
+ const sauvegarder = () => {
104
+ if (props.valeurInverse) {
105
+ emit('update:modelValue', !maValeur.value)
106
+ } else {
107
+ emit('update:modelValue', maValeur.value)
108
+ }
109
+ }
110
+ </script>
111
+
112
+ <style lang="css" scoped>
113
+ .labelSwitchSiSwitchApres {
114
+ font-weight: bold;
115
+ margin-top: 25px;
116
+ }
117
+ .v-switch {
118
+ margin-bottom: -10px; /* aligner le switch avec son texte*/
119
+ }
120
+ </style>
@@ -1,212 +1,213 @@
1
- <template>
2
- <div>
3
- <v-row
4
- dense
5
- class="pt-0 mt-0"
6
- >
7
- <v-col
8
- cols="12"
9
- sm="auto"
10
- >
11
- <slot name="recherche"></slot>
12
- <v-text-field
13
- v-if="afficher"
14
- v-model="rechercheLocale"
15
- :label="rechercheTexte ? rechercheTexte : $t('csqc.label.recherche')"
16
- single-line
17
- density="compact"
18
- hide-details
19
- clearable
20
- :rounded="0"
21
- variant="outlined"
22
- max-width="640"
23
- min-width="500"
24
- class="BarreRecherche"
25
- :loading="chargement"
26
- :disabled="chargement || desactiver"
27
- >
28
- <template #append>
29
- <v-btn
30
- class="BarreRechercheBackIcone"
31
- :loading="chargement"
32
- :disabled="chargement || desactiver"
33
- >
34
- <v-icon
35
- class="BarreRechercheIcone"
36
- icon="mdi-magnify"
37
- />
38
- </v-btn>
39
- </template>
40
- </v-text-field>
41
- </v-col>
42
- <!-- Entre recherche et ajouté-->
43
- <v-col
44
- cols="12"
45
- sm="auto"
46
- class="pt-1 mt-0 pb-0 mb-0"
47
- >
48
- <slot name="milieu" />
49
- </v-col>
50
-
51
- <!-- Affichage des boutons et icônes-->
52
- <v-col
53
- cols="12"
54
- sm="auto"
55
- class="flex-grow-1 d-flex justify-end"
56
- >
57
- <slot name="droite" />
58
- </v-col>
59
- </v-row>
60
- <v-row
61
- dense
62
- class="pt-0 mt-0"
63
- >
64
- <v-col
65
- cols="12"
66
- :lg="rechercheAvanceeLargeur"
67
- >
68
- <v-expansion-panels
69
- v-if="rechercheAvancee"
70
- static
71
- :readonly="chargement || desactiver"
72
- expand-icon=""
73
- @update:model-value="onPanelChange"
74
- >
75
- <v-expansion-panel
76
- flat
77
- elevation="0"
78
- >
79
- <v-expansion-panel-title
80
- style="color: #095797"
81
- class="pl-0 ml-0"
82
- ><slot name="rechercheAvanceeTitre">
83
- <span
84
- style="text-decoration: underline"
85
- v-html="rechercheAvanceeTexte ? rechercheAvanceeTexte : $t('csqc.label.rechercheAvanceeDefaut')"
86
- ></span>
87
- <slot name="rechercheAvanceeApresTitre"></slot
88
- ></slot>
89
- </v-expansion-panel-title>
90
- <v-expansion-panel-text :style="rechercheAvanceeStyle">
91
- <slot name="rechercheAvancee"></slot>
92
- </v-expansion-panel-text>
93
- </v-expansion-panel>
94
- </v-expansion-panels>
95
- </v-col>
96
- </v-row>
97
- </div>
98
- </template>
99
-
100
- <script lang="ts" setup>
101
- import { ref, watch } from 'vue'
102
-
103
- // Props
104
- const props = defineProps({
105
- afficher: {
106
- type: Boolean,
107
- required: false,
108
- default: true,
109
- },
110
- rechercheTexte: {
111
- type: String,
112
- required: false,
113
- default: '',
114
- },
115
- rechercheAvanceeTexte: {
116
- type: String,
117
- required: false,
118
- default: '',
119
- },
120
- rechercheAvanceeLargeur: {
121
- type: Number,
122
- required: false,
123
- default: 12,
124
- },
125
- chargement: {
126
- type: Boolean,
127
- required: false,
128
- default: false,
129
- },
130
- desactiver: {
131
- type: Boolean,
132
- required: false,
133
- default: false,
134
- },
135
- recherche: {
136
- type: String,
137
- required: false,
138
- default: '',
139
- },
140
- rechercheAvancee: {
141
- type: Boolean,
142
- required: false,
143
- default: false,
144
- },
145
- rechercheAvanceeStyle: {
146
- type: String,
147
- required: false,
148
- default: '',
149
- },
150
- })
151
-
152
- const emit = defineEmits<{
153
- (e: 'update:recherche', recherche: string): void
154
- (e: 'panneau:etat', isOpen: boolean): void // événement pour l'ouverture/fermeture du panneau
155
- }>()
156
-
157
- // Création d'une variable locale pour gérer la recherche
158
- const rechercheLocale = ref(props.recherche)
159
-
160
- // Surveiller les changements de la prop `recherche` et mettre à jour `rechercheLocale`
161
- watch(
162
- () => props.recherche,
163
- nouvelleValeur => {
164
- rechercheLocale.value = nouvelleValeur
165
- },
166
- )
167
-
168
- // Émettre l'événement `update:recherche` chaque fois que l'utilisateur tape
169
- watch(rechercheLocale, nouvelleValeur => {
170
- emit('update:recherche', nouvelleValeur!)
171
- })
172
-
173
- // Fonction pour émettre l'événement d'ouverture/fermeture du panneau
174
- const onPanelChange = (val: unknown) => {
175
- if (typeof val === 'string' || typeof val === 'number' || val === null) {
176
- const isOpen = val !== null && val !== ''
177
- emit('panneau:etat', isOpen)
178
- } else {
179
- emit('panneau:etat', false)
180
- }
181
- }
182
- </script>
183
-
184
- <style lang="css">
185
- /* barre de recherche design QC*/
186
- .BarreRecherche {
187
- min-height: 40px;
188
- }
189
-
190
- .BarreRechercheBackIcone {
191
- border-right: 1px solid #808a9d;
192
- border-top: 1px solid #808a9d;
193
- border-bottom: 1px solid #808a9d;
194
- background-color: #095797 !important;
195
- height: 40px !important;
196
- width: 40px !important;
197
- max-width: 40px !important;
198
- min-width: 40px !important;
199
- padding-right: 0 !important;
200
- padding-left: 0 !important;
201
- border-radius: 0;
202
- margin-left: -16px;
203
- }
204
-
205
- /* icone loupe */
206
- .BarreRechercheIcone {
207
- font-size: 34px !important;
208
- margin-left: 1px !important;
209
- margin-top: 2px !important;
210
- color: white !important;
211
- }
212
- </style>
1
+ <template>
2
+ <div>
3
+ <v-row
4
+ dense
5
+ class="pt-0 mt-0"
6
+ >
7
+ <v-col
8
+ cols="12"
9
+ sm="auto"
10
+ >
11
+ <slot name="recherche"></slot>
12
+ <v-text-field
13
+ v-if="afficher"
14
+ v-model="rechercheLocale"
15
+ :label="rechercheTexte ? rechercheTexte : $t('csqc.label.recherche')"
16
+ single-line
17
+ density="compact"
18
+ hide-details
19
+ v-bind="$attrs"
20
+ clearable
21
+ :rounded="0"
22
+ variant="outlined"
23
+ max-width="640"
24
+ min-width="500"
25
+ class="BarreRecherche"
26
+ :loading="chargement"
27
+ :disabled="chargement || desactiver"
28
+ >
29
+ <template #append>
30
+ <v-btn
31
+ class="BarreRechercheBackIcone"
32
+ :loading="chargement"
33
+ :disabled="chargement || desactiver"
34
+ >
35
+ <v-icon
36
+ class="BarreRechercheIcone"
37
+ icon="mdi-magnify"
38
+ />
39
+ </v-btn>
40
+ </template>
41
+ </v-text-field>
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>
60
+ </v-row>
61
+ <v-row
62
+ dense
63
+ class="pt-0 mt-0"
64
+ >
65
+ <v-col
66
+ cols="12"
67
+ :lg="rechercheAvanceeLargeur"
68
+ >
69
+ <v-expansion-panels
70
+ v-if="rechercheAvancee"
71
+ static
72
+ :readonly="chargement || desactiver"
73
+ expand-icon=""
74
+ @update:model-value="onPanelChange"
75
+ >
76
+ <v-expansion-panel
77
+ flat
78
+ elevation="0"
79
+ >
80
+ <v-expansion-panel-title
81
+ style="color: #095797"
82
+ class="pl-0 ml-0"
83
+ ><slot name="rechercheAvanceeTitre">
84
+ <span
85
+ style="text-decoration: underline"
86
+ v-html="rechercheAvanceeTexte ? rechercheAvanceeTexte : $t('csqc.label.rechercheAvanceeDefaut')"
87
+ ></span>
88
+ <slot name="rechercheAvanceeApresTitre"></slot
89
+ ></slot>
90
+ </v-expansion-panel-title>
91
+ <v-expansion-panel-text :style="rechercheAvanceeStyle">
92
+ <slot name="rechercheAvancee"></slot>
93
+ </v-expansion-panel-text>
94
+ </v-expansion-panel>
95
+ </v-expansion-panels>
96
+ </v-col>
97
+ </v-row>
98
+ </div>
99
+ </template>
100
+
101
+ <script lang="ts" setup>
102
+ import { ref, watch } from 'vue'
103
+
104
+ // Props
105
+ const props = defineProps({
106
+ afficher: {
107
+ type: Boolean,
108
+ required: false,
109
+ default: true,
110
+ },
111
+ rechercheTexte: {
112
+ type: String,
113
+ required: false,
114
+ default: '',
115
+ },
116
+ rechercheAvanceeTexte: {
117
+ type: String,
118
+ required: false,
119
+ default: '',
120
+ },
121
+ rechercheAvanceeLargeur: {
122
+ type: Number,
123
+ required: false,
124
+ default: 12,
125
+ },
126
+ chargement: {
127
+ type: Boolean,
128
+ required: false,
129
+ default: false,
130
+ },
131
+ desactiver: {
132
+ type: Boolean,
133
+ required: false,
134
+ default: false,
135
+ },
136
+ recherche: {
137
+ type: String,
138
+ required: false,
139
+ default: '',
140
+ },
141
+ rechercheAvancee: {
142
+ type: Boolean,
143
+ required: false,
144
+ default: false,
145
+ },
146
+ rechercheAvanceeStyle: {
147
+ type: String,
148
+ required: false,
149
+ default: '',
150
+ },
151
+ })
152
+
153
+ const emit = defineEmits<{
154
+ (e: 'update:recherche', recherche: string): void
155
+ (e: 'panneau:etat', isOpen: boolean): void // événement pour l'ouverture/fermeture du panneau
156
+ }>()
157
+
158
+ // Création d'une variable locale pour gérer la recherche
159
+ const rechercheLocale = ref(props.recherche)
160
+
161
+ // Surveiller les changements de la prop `recherche` et mettre à jour `rechercheLocale`
162
+ watch(
163
+ () => props.recherche,
164
+ nouvelleValeur => {
165
+ rechercheLocale.value = nouvelleValeur
166
+ },
167
+ )
168
+
169
+ // Émettre l'événement `update:recherche` chaque fois que l'utilisateur tape
170
+ watch(rechercheLocale, nouvelleValeur => {
171
+ emit('update:recherche', nouvelleValeur!)
172
+ })
173
+
174
+ // Fonction pour émettre l'événement d'ouverture/fermeture du panneau
175
+ const onPanelChange = (val: unknown) => {
176
+ if (typeof val === 'string' || typeof val === 'number' || val === null) {
177
+ const isOpen = val !== null && val !== ''
178
+ emit('panneau:etat', isOpen)
179
+ } else {
180
+ emit('panneau:etat', false)
181
+ }
182
+ }
183
+ </script>
184
+
185
+ <style lang="css">
186
+ /* barre de recherche design QC*/
187
+ .BarreRecherche {
188
+ min-height: 40px;
189
+ }
190
+
191
+ .BarreRechercheBackIcone {
192
+ border-right: 1px solid #808a9d;
193
+ border-top: 1px solid #808a9d;
194
+ border-bottom: 1px solid #808a9d;
195
+ background-color: #095797 !important;
196
+ height: 40px !important;
197
+ width: 40px !important;
198
+ max-width: 40px !important;
199
+ min-width: 40px !important;
200
+ padding-right: 0 !important;
201
+ padding-left: 0 !important;
202
+ border-radius: 0;
203
+ margin-left: -16px;
204
+ }
205
+
206
+ /* icone loupe */
207
+ .BarreRechercheIcone {
208
+ font-size: 34px !important;
209
+ margin-left: 1px !important;
210
+ margin-top: 2px !important;
211
+ color: white !important;
212
+ }
213
+ </style>