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.
- package/composants/codeBudgetaireGenerique.vue +260 -260
- package/composants/csqcAide.vue +55 -55
- package/composants/csqcDialogue.vue +117 -117
- package/composants/csqcOptionSwitch.vue +124 -124
- package/composants/csqcRecherche.vue +25 -3
- package/composants/csqcSnackbar.vue +98 -98
- package/composants/csqcTable/csqcTableExportExcel.vue +58 -58
- package/composants/csqcTable/csqcTableModaleChoixColonnes.vue +586 -586
- package/composants/csqcTexteBilingue.vue +158 -158
- package/composants/csqcTiroir.vue +149 -149
- package/composants/gabarit/csqcMenu.vue +274 -274
- package/composants/gabarit/pivEntete.vue +118 -118
- package/index.ts +70 -70
- package/package.json +1 -1
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-snackbar
|
|
3
|
-
v-model="snackbar"
|
|
4
|
-
:timeout="tempsFinal"
|
|
5
|
-
:style="styleCss"
|
|
6
|
-
multi-line
|
|
7
|
-
:location="position"
|
|
8
|
-
:color="props.couleur"
|
|
9
|
-
@update:model-value="fermer"
|
|
10
|
-
>
|
|
11
|
-
<template v-if="props.titre || props.message">
|
|
12
|
-
<b style="font-size: 12pt">{{ props.titre }}</b>
|
|
13
|
-
<br v-if="props.titre" />
|
|
14
|
-
<b>{{ props.message }}</b>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<template #actions>
|
|
18
|
-
<!-- on affiche tjrs si c'est -1 car on ne pourra pas fermer le snack -->
|
|
19
|
-
<v-icon
|
|
20
|
-
v-if="props.btnFermer || props.temps === -1"
|
|
21
|
-
color="white"
|
|
22
|
-
style="cursor: pointer"
|
|
23
|
-
@click.stop="fermer"
|
|
24
|
-
>
|
|
25
|
-
mdi-close
|
|
26
|
-
</v-icon>
|
|
27
|
-
</template>
|
|
28
|
-
</v-snackbar>
|
|
29
|
-
</template>
|
|
30
|
-
<script lang="ts" setup>
|
|
31
|
-
import { computed, ref, watch, type PropType } from 'vue'
|
|
32
|
-
|
|
33
|
-
// Définir les props avec les types
|
|
34
|
-
const props = defineProps({
|
|
35
|
-
styleCss: {
|
|
36
|
-
type: String,
|
|
37
|
-
required: false,
|
|
38
|
-
},
|
|
39
|
-
temps: {
|
|
40
|
-
type: Number,
|
|
41
|
-
required: false,
|
|
42
|
-
default: 4000,
|
|
43
|
-
validator(value: number) {
|
|
44
|
-
// Si la valeur est inférieure à -1, on la remplace par -1
|
|
45
|
-
if (value < -1) {
|
|
46
|
-
return false // Laisser échouer la validation pour gérer ça dans une logique personnalisée
|
|
47
|
-
}
|
|
48
|
-
// Validation que la valeur soit comprise entre -1 et Number.MAX_VALUE
|
|
49
|
-
return value <= Number.MAX_VALUE
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
message: {
|
|
53
|
-
type: String,
|
|
54
|
-
required: true,
|
|
55
|
-
},
|
|
56
|
-
titre: {
|
|
57
|
-
type: String,
|
|
58
|
-
required: false,
|
|
59
|
-
},
|
|
60
|
-
couleur: {
|
|
61
|
-
type: String,
|
|
62
|
-
required: false,
|
|
63
|
-
default: 'success',
|
|
64
|
-
},
|
|
65
|
-
position: {
|
|
66
|
-
type: String as PropType<'top' | 'bottom' | 'left' | 'right' | 'center'>,
|
|
67
|
-
required: false,
|
|
68
|
-
default: 'left',
|
|
69
|
-
},
|
|
70
|
-
btnFermer: {
|
|
71
|
-
type: Boolean,
|
|
72
|
-
required: false,
|
|
73
|
-
default: true,
|
|
74
|
-
},
|
|
75
|
-
})
|
|
76
|
-
const emit = defineEmits(['fermer:snackbar'])
|
|
77
|
-
const fermer = (): void => {
|
|
78
|
-
snackbar.value = false
|
|
79
|
-
emit('fermer:snackbar')
|
|
80
|
-
}
|
|
81
|
-
// Déclarer l'état réactif pour snackbar
|
|
82
|
-
const snackbar = ref(false)
|
|
83
|
-
const message = computed(() => props.message)
|
|
84
|
-
const tempsFinal = computed(() => {
|
|
85
|
-
if (props.temps < -1) {
|
|
86
|
-
return -1 // Si la valeur est inférieure à -1, on la met à -1
|
|
87
|
-
}
|
|
88
|
-
if (props.temps >= 0 && props.temps < 1000) return 1000 // on met 1 seconde minimum sinon one ne la voit pas
|
|
89
|
-
|
|
90
|
-
return props.temps // Sinon, on retourne la valeur de la prop
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
watch(message, nouveau => {
|
|
94
|
-
if (nouveau != null && nouveau !== '') {
|
|
95
|
-
snackbar.value = true
|
|
96
|
-
}
|
|
97
|
-
})
|
|
98
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<v-snackbar
|
|
3
|
+
v-model="snackbar"
|
|
4
|
+
:timeout="tempsFinal"
|
|
5
|
+
:style="styleCss"
|
|
6
|
+
multi-line
|
|
7
|
+
:location="position"
|
|
8
|
+
:color="props.couleur"
|
|
9
|
+
@update:model-value="fermer"
|
|
10
|
+
>
|
|
11
|
+
<template v-if="props.titre || props.message">
|
|
12
|
+
<b style="font-size: 12pt">{{ props.titre }}</b>
|
|
13
|
+
<br v-if="props.titre" />
|
|
14
|
+
<b>{{ props.message }}</b>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<template #actions>
|
|
18
|
+
<!-- on affiche tjrs si c'est -1 car on ne pourra pas fermer le snack -->
|
|
19
|
+
<v-icon
|
|
20
|
+
v-if="props.btnFermer || props.temps === -1"
|
|
21
|
+
color="white"
|
|
22
|
+
style="cursor: pointer"
|
|
23
|
+
@click.stop="fermer"
|
|
24
|
+
>
|
|
25
|
+
mdi-close
|
|
26
|
+
</v-icon>
|
|
27
|
+
</template>
|
|
28
|
+
</v-snackbar>
|
|
29
|
+
</template>
|
|
30
|
+
<script lang="ts" setup>
|
|
31
|
+
import { computed, ref, watch, type PropType } from 'vue'
|
|
32
|
+
|
|
33
|
+
// Définir les props avec les types
|
|
34
|
+
const props = defineProps({
|
|
35
|
+
styleCss: {
|
|
36
|
+
type: String,
|
|
37
|
+
required: false,
|
|
38
|
+
},
|
|
39
|
+
temps: {
|
|
40
|
+
type: Number,
|
|
41
|
+
required: false,
|
|
42
|
+
default: 4000,
|
|
43
|
+
validator(value: number) {
|
|
44
|
+
// Si la valeur est inférieure à -1, on la remplace par -1
|
|
45
|
+
if (value < -1) {
|
|
46
|
+
return false // Laisser échouer la validation pour gérer ça dans une logique personnalisée
|
|
47
|
+
}
|
|
48
|
+
// Validation que la valeur soit comprise entre -1 et Number.MAX_VALUE
|
|
49
|
+
return value <= Number.MAX_VALUE
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
message: {
|
|
53
|
+
type: String,
|
|
54
|
+
required: true,
|
|
55
|
+
},
|
|
56
|
+
titre: {
|
|
57
|
+
type: String,
|
|
58
|
+
required: false,
|
|
59
|
+
},
|
|
60
|
+
couleur: {
|
|
61
|
+
type: String,
|
|
62
|
+
required: false,
|
|
63
|
+
default: 'success',
|
|
64
|
+
},
|
|
65
|
+
position: {
|
|
66
|
+
type: String as PropType<'top' | 'bottom' | 'left' | 'right' | 'center'>,
|
|
67
|
+
required: false,
|
|
68
|
+
default: 'left',
|
|
69
|
+
},
|
|
70
|
+
btnFermer: {
|
|
71
|
+
type: Boolean,
|
|
72
|
+
required: false,
|
|
73
|
+
default: true,
|
|
74
|
+
},
|
|
75
|
+
})
|
|
76
|
+
const emit = defineEmits(['fermer:snackbar'])
|
|
77
|
+
const fermer = (): void => {
|
|
78
|
+
snackbar.value = false
|
|
79
|
+
emit('fermer:snackbar')
|
|
80
|
+
}
|
|
81
|
+
// Déclarer l'état réactif pour snackbar
|
|
82
|
+
const snackbar = ref(false)
|
|
83
|
+
const message = computed(() => props.message)
|
|
84
|
+
const tempsFinal = computed(() => {
|
|
85
|
+
if (props.temps < -1) {
|
|
86
|
+
return -1 // Si la valeur est inférieure à -1, on la met à -1
|
|
87
|
+
}
|
|
88
|
+
if (props.temps >= 0 && props.temps < 1000) return 1000 // on met 1 seconde minimum sinon one ne la voit pas
|
|
89
|
+
|
|
90
|
+
return props.temps // Sinon, on retourne la valeur de la prop
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
watch(message, nouveau => {
|
|
94
|
+
if (nouveau != null && nouveau !== '') {
|
|
95
|
+
snackbar.value = true
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
</script>
|
|
@@ -1,58 +1,58 @@
|
|
|
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
|
+
<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>
|