codevdesign 0.0.48 → 0.0.49

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,58 +1,58 @@
1
- <template>
2
- <v-icon
3
- right
4
- color="grisMoyen"
5
- @click="exportToXLSX"
6
- icon="mdi-microsoft-excel"
7
- >
8
- </v-icon>
9
- </template>
10
-
11
- <script setup lang="ts">
12
- import { utils, writeFileXLSX } from '@e965/xlsx'
13
- import { computed } from 'vue'
14
-
15
- const props = defineProps<{
16
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
- liste: any[]
18
- nomFichier: string
19
- chargementListe: boolean
20
- }>()
21
-
22
- // Extraction des clés uniques de tous les objets
23
- const cleDynamique = computed(() => {
24
- const keys = new Set<string>()
25
-
26
- // Parcours tous les objets de la liste et ajoute leurs clés
27
- props.liste.forEach(item => {
28
- if (typeof item === 'object' && item !== null) {
29
- Object.keys(item).forEach(key => keys.add(key))
30
- }
31
- })
32
- return Array.from(keys)
33
- })
34
-
35
- // Fonction pour exporter les données en Excel
36
- const exportToXLSX = () => {
37
- if (!props.liste.length) {
38
- console.warn('La liste est vide, exportation annulée.')
39
- return
40
- }
41
-
42
- // Récupération des en-têtes depuis la fonction cleDynamique
43
- const headers = cleDynamique.value
44
-
45
- // Construction des lignes en respectant l'ordre des en-têtes
46
- const rows = props.liste.map(item => {
47
- return headers.map(key => (key in item ? item[key] : '')) // Valeur ou vide si absente
48
- })
49
-
50
- // Création des données Excel (en-têtes + lignes)
51
- const data = [headers, ...rows]
52
- // Génération du fichier Excel
53
- const ws = utils.aoa_to_sheet(data)
54
- const wb = utils.book_new()
55
- utils.book_append_sheet(wb, ws, '1')
56
- writeFileXLSX(wb, `${props.nomFichier}.xlsx`)
57
- }
58
- </script>
1
+ <template>
2
+ <v-icon
3
+ end
4
+ color="grisMoyen"
5
+ icon="mdi-microsoft-excel"
6
+ @click="exportToXLSX"
7
+ >
8
+ </v-icon>
9
+ </template>
10
+
11
+ <script setup lang="ts">
12
+ import { utils, writeFileXLSX } from '@e965/xlsx'
13
+ import { computed } from 'vue'
14
+
15
+ const props = defineProps<{
16
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
+ liste: any[]
18
+ nomFichier: string
19
+ chargementListe: boolean
20
+ }>()
21
+
22
+ // Extraction des clés uniques de tous les objets
23
+ const cleDynamique = computed(() => {
24
+ const keys: Set<string> = new Set()
25
+
26
+ // Parcours tous les objets de la liste et ajoute leurs clés
27
+ props.liste.forEach(item => {
28
+ if (typeof item === 'object' && item !== null) {
29
+ Object.keys(item).forEach(key => keys.add(key))
30
+ }
31
+ })
32
+ return Array.from(keys)
33
+ })
34
+
35
+ // Fonction pour exporter les données en Excel
36
+ const exportToXLSX = () => {
37
+ if (!props.liste.length) {
38
+ console.warn('La liste est vide, exportation annulée.')
39
+ return
40
+ }
41
+
42
+ // Récupération des en-têtes depuis la fonction cleDynamique
43
+ const headers = cleDynamique.value
44
+
45
+ // Construction des lignes en respectant l'ordre des en-têtes
46
+ const rows = props.liste.map(item => {
47
+ return headers.map(key => (key in item ? item[key] : '')) // Valeur ou vide si absente
48
+ })
49
+
50
+ // Création des données Excel (en-têtes + lignes)
51
+ const data = [headers, ...rows]
52
+ // Génération du fichier Excel
53
+ const ws = utils.aoa_to_sheet(data)
54
+ const wb = utils.book_new()
55
+ utils.book_append_sheet(wb, ws, '1')
56
+ writeFileXLSX(wb, `${props.nomFichier}.xlsx`)
57
+ }
58
+ </script>
@@ -1,61 +1,61 @@
1
1
  <template>
2
2
  <v-row dense>
3
3
  <v-col
4
- cols="12"
5
4
  v-if="afficherChampFr"
5
+ cols="12"
6
6
  >
7
7
  <label
8
+ v-if="!libelleInterieur"
8
9
  :for="`saisieChampFr-${cleTradFr}`"
9
10
  :class="{ libelle: true, required: estRequis }"
10
- v-if="!libelleInterieur"
11
11
  >{{ $t(cleTradFr) }}</label
12
12
  >
13
13
  <v-textarea
14
- :id="`saisieChampFr-${cleTradFr}`"
15
14
  v-if="textarea"
15
+ :id="`saisieChampFr-${cleTradFr}`"
16
+ v-model="model[champs.Francais]"
16
17
  density="comfortable"
17
18
  rows="1"
18
19
  :label="libelleInterieur ? $t(cleTradFr) : ''"
19
- v-model="model[champs.Francais]"
20
20
  :rules="reglesInterne"
21
21
  :autofocus="autofocus && afficherChampFr"
22
22
  />
23
23
  <v-text-field
24
- :id="`saisieChampFr-${cleTradFr}`"
25
24
  v-else
25
+ :id="`saisieChampFr-${cleTradFr}`"
26
+ v-model="model[champs.Francais]"
26
27
  density="comfortable"
27
28
  :label="libelleInterieur ? $t(cleTradFr) : ''"
28
- v-model="model[champs.Francais]"
29
29
  :rules="reglesInterne"
30
30
  :autofocus="autofocus && afficherChampFr"
31
31
  />
32
32
  </v-col>
33
33
  <v-col
34
- cols="12"
35
34
  v-if="afficherChampEn"
35
+ cols="12"
36
36
  >
37
37
  <label
38
+ v-if="!libelleInterieur"
38
39
  :for="`saisieChampEn-${cleTradEn}`"
39
40
  :class="{ libelle: true, required: estRequis }"
40
- v-if="!libelleInterieur"
41
41
  >{{ $t(cleTradEn) }}</label
42
42
  >
43
43
  <v-textarea
44
- :id="`saisieChampEn-${cleTradEn}`"
45
44
  v-if="textarea"
45
+ :id="`saisieChampEn-${cleTradEn}`"
46
+ v-model="model[champs.Anglais]"
46
47
  rows="1"
47
48
  density="comfortable"
48
49
  :label="libelleInterieur ? $t(cleTradEn) : ''"
49
- v-model="model[champs.Anglais]"
50
50
  :rules="reglesInterne"
51
51
  :autofocus="autofocus && !afficherChampFr"
52
52
  />
53
53
  <v-text-field
54
54
  v-else
55
55
  :id="`saisieChampEn-${cleTradEn}`"
56
+ v-model="model[champs.Anglais]"
56
57
  density="comfortable"
57
58
  :label="libelleInterieur ? $t(cleTradEn) : ''"
58
- v-model="model[champs.Anglais]"
59
59
  :rules="reglesInterne"
60
60
  :autofocus="autofocus && !afficherChampFr"
61
61
  />
@@ -78,7 +78,7 @@
78
78
  estUniqueValeurs?: T[]
79
79
  minimumLongueur?: number
80
80
  maximumLongueur?: number
81
- regles?: Array<(v: string) => string | true>
81
+ regles?: ((v: string) => string | true)[]
82
82
  langue: ChoixLangue
83
83
  i18nLibelleRacine: string
84
84
  champs: { ['Francais']: keyof T; ['Anglais']: keyof T }
@@ -97,7 +97,7 @@
97
97
  })
98
98
 
99
99
  const reglesInterne = computed(() => {
100
- const _regles: Array<(v: string) => string | true> = regles.value ?? []
100
+ const _regles: ((v: string) => string | true)[] = regles.value ?? []
101
101
 
102
102
  if (minimumLongueur.value && maximumLongueur.value && minimumLongueur.value > maximumLongueur.value) {
103
103
  console.error(
@@ -24,7 +24,7 @@
24
24
  style="font-size: 24px"
25
25
  >
26
26
  <slot name="titre"></slot>
27
- <div class="headline">{{ titre }}</div>
27
+ <div text-h5>{{ titre }}</div>
28
28
  </v-card-title>
29
29
 
30
30
  <v-card-text class="pa-0 ma-0 pb-6 pr-6">
@@ -53,7 +53,6 @@
53
53
  :loading="operationEnCours"
54
54
  :disabled="btnOkDesactiver || operationEnCours"
55
55
  @click="okBouton"
56
- outlined
57
56
  >
58
57
  {{ props.btnOkTexte ? props.btnOkTexte : $t('csqc.bouton.ok') }}
59
58
  </v-btn>
@@ -12,8 +12,8 @@
12
12
  class="pt-1"
13
13
  >
14
14
  <v-btn
15
- variant="text"
16
15
  v-if="doitAfficherItemMenu(item)"
16
+ variant="text"
17
17
  :to="item.path"
18
18
  :active="item.path === route"
19
19
  :active-color="'white'"
@@ -24,9 +24,9 @@
24
24
  <v-spacer></v-spacer>
25
25
  <!-- Sous Liste -->
26
26
  <v-menu
27
- open-on-hover
28
27
  v-for="(item, index) in filtrerSousListe"
29
28
  :key="index"
29
+ open-on-hover
30
30
  >
31
31
  <template v-slot:activator="{ props }">
32
32
  <v-btn
@@ -59,10 +59,10 @@
59
59
  </v-list>
60
60
  </v-menu>
61
61
  <v-btn
62
- variant="text"
63
62
  v-if="btnDeconnexion"
64
- @click="deconnexion"
63
+ variant="text"
65
64
  :style="'min-width: 100px;'"
65
+ @click="deconnexion"
66
66
  >{{ $t('csqc.csqcMenu.deconnexion') }}</v-btn
67
67
  >
68
68
  </v-toolbar>
@@ -123,8 +123,8 @@
123
123
  </v-list-group>
124
124
  <v-list-item
125
125
  v-if="btnDeconnexion"
126
- @click="deconnexion"
127
126
  :title="$t('csqc.csqcMenu.deconnexion')"
127
+ @click="deconnexion"
128
128
  />
129
129
  </div>
130
130
  </v-list>
@@ -135,6 +135,7 @@
135
135
  <script setup lang="ts">
136
136
  import type { MenuItem, SousListe, SousListeItems } from '../../modeles/composants/csqcMenuModele'
137
137
  import { ref, computed } from 'vue'
138
+
138
139
  const props = defineProps({
139
140
  estMobile: {
140
141
  type: Boolean,
@@ -168,6 +169,7 @@
168
169
  default: () => ({}),
169
170
  },
170
171
  })
172
+
171
173
  const menu = ref<boolean>(false)
172
174
  const emit = defineEmits(['deconnexion'])
173
175
 
@@ -14,16 +14,16 @@
14
14
  <a href="/">
15
15
  <img
16
16
  v-if="texteVide(logoUrl)"
17
+ id="pivImage"
17
18
  src="/images/QUEBEC_blanc.svg"
18
19
  height="72"
19
- id="pivImage"
20
20
  :alt="$t('csqc.pivFooter.logoAlt')"
21
21
  />
22
22
  <img
23
23
  v-else
24
+ id="pivImage"
24
25
  :src="logoUrl"
25
26
  height="72"
26
- id="pivImage"
27
27
  :alt="$t('csqc.pivFooter.logoAlt')"
28
28
  />
29
29
  </a>
@@ -53,7 +53,7 @@
53
53
 
54
54
  <!-- Colonne pour le nom de l'application (Pour le mode mobile) -->
55
55
  <v-col
56
- v-if="estMobile"
56
+ v-if="props.estMobile"
57
57
  cols="12"
58
58
  >
59
59
  <v-app-bar-title style="font-size: 16px !important">
@@ -66,6 +66,7 @@
66
66
 
67
67
  <script setup lang="ts">
68
68
  import { useLocale } from 'vuetify'
69
+
69
70
  const { current } = useLocale()
70
71
  const texteVide = (texte: string | undefined, retirerEspace: boolean = true): boolean => {
71
72
  let retour = texte === undefined || texte === null || texte === ''
@@ -91,12 +92,14 @@
91
92
  default: '',
92
93
  },
93
94
  })
94
-
95
+ const emit = defineEmits(['changementLangue'])
95
96
  // Fonction pour enregistrer la langue
96
97
  const enregistrerLangue = (): void => {
97
98
  const langueDispo: string = current.value === 'fr' ? 'en' : 'fr'
98
- const returnUrl: string = encodeURIComponent(window.location.pathname) + encodeURIComponent(window.location.hash)
99
- window.location.href = `${props.urlBase}/Traducteur/SetLanguage?culture=${langueDispo}&returnUrl=${returnUrl}`
99
+ window.location.href =
100
+ props.urlBase +
101
+ `/Traducteur/SetLanguage?culture=${langueDispo}&returnUrl=${encodeURIComponent(props.urlBase + window.location.hash)}`
102
+ emit('changementLangue')
100
103
  }
101
104
  </script>
102
105
 
@@ -1,70 +1,70 @@
1
- <template>
2
- <footer>
3
- <div class="footer-content">
4
- <a href="https://quebec.ca">
5
- <img
6
- id="logoFooter"
7
- alt="Gouvernement du Québec."
8
- src="/images/QUEBEC_couleur.svg"
9
- width="117"
10
- height="35"
11
- />
12
- </a>
13
- <div>
14
- <small>
15
- <a
16
- href="http://www.droitauteur.gouv.qc.ca/copyright.php"
17
- target="_blank"
18
- >© Gouvernement du Québec {{ anneeEnCours }}
19
- </a>
20
-
21
- <a
22
- v-if="props.version"
23
- :href="props.lien"
24
- target="_blank"
25
- ><br />
26
- version <span v-html="props.version"
27
- /></a>
28
- </small>
29
- </div>
30
- </div>
31
- </footer>
32
- </template>
33
-
34
- <script setup lang="ts">
35
- import { computed } from 'vue'
36
-
37
- const props = defineProps<{
38
- version?: string
39
- lien?: string
40
- }>()
41
-
42
- const anneeEnCours = computed<number>(() => {
43
- return new Date().getFullYear()
44
- })
45
- </script>
46
-
47
- <style scoped>
48
- footer {
49
- display: flex;
50
- justify-content: center; /* Centrer horizontalement */
51
- align-items: center; /* Centrer verticalement */
52
- text-align: center; /* Centrer le texte à l'intérieur des éléments */
53
- height: 100px; /* Ajuster la hauteur du footer */
54
- }
55
-
56
- .footer-content {
57
- display: flex;
58
- flex-direction: column; /* Disposer les éléments les uns sous les autres */
59
- justify-content: center; /* Centrer verticalement à l'intérieur de .footer-content */
60
- align-items: center; /* Centrer horizontalement à l'intérieur de .footer-content */
61
- }
62
-
63
- footer a {
64
- text-decoration: none; /* Supprimer le soulignement des liens */
65
- }
66
-
67
- footer small {
68
- margin-top: 10px; /* Ajouter de l'espace entre l'image et le texte */
69
- }
70
- </style>
1
+ <template>
2
+ <footer>
3
+ <div class="footer-content">
4
+ <a href="https://quebec.ca">
5
+ <img
6
+ id="logoFooter"
7
+ alt="Gouvernement du Québec."
8
+ src="/images/QUEBEC_couleur.svg"
9
+ width="117"
10
+ height="35"
11
+ />
12
+ </a>
13
+ <div>
14
+ <small>
15
+ <a
16
+ href="http://www.droitauteur.gouv.qc.ca/copyright.php"
17
+ target="_blank"
18
+ >© Gouvernement du Québec {{ anneeEnCours }}
19
+ </a>
20
+
21
+ <a
22
+ v-if="props.version"
23
+ :href="props.lien"
24
+ target="_blank"
25
+ ><br />
26
+ version <span v-html="props.version"
27
+ /></a>
28
+ </small>
29
+ </div>
30
+ </div>
31
+ </footer>
32
+ </template>
33
+
34
+ <script setup lang="ts">
35
+ import { computed } from 'vue'
36
+
37
+ const props = defineProps<{
38
+ version?: string
39
+ lien?: string
40
+ }>()
41
+
42
+ const anneeEnCours = computed<number>(() => {
43
+ return new Date().getFullYear()
44
+ })
45
+ </script>
46
+
47
+ <style scoped>
48
+ footer {
49
+ display: flex;
50
+ justify-content: center; /* Centrer horizontalement */
51
+ align-items: center; /* Centrer verticalement */
52
+ text-align: center; /* Centrer le texte à l'intérieur des éléments */
53
+ height: 100px; /* Ajuster la hauteur du footer */
54
+ }
55
+
56
+ .footer-content {
57
+ display: flex;
58
+ flex-direction: column; /* Disposer les éléments les uns sous les autres */
59
+ justify-content: center; /* Centrer verticalement à l'intérieur de .footer-content */
60
+ align-items: center; /* Centrer horizontalement à l'intérieur de .footer-content */
61
+ }
62
+
63
+ footer a {
64
+ text-decoration: none; /* Supprimer le soulignement des liens */
65
+ }
66
+
67
+ footer small {
68
+ margin-top: 10px; /* Ajouter de l'espace entre l'image et le texte */
69
+ }
70
+ </style>