codevdesign 2.0.4 → 2.0.6

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