codevdesign 0.0.72 → 0.0.74

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