codevdesign 1.0.76 → 1.0.77

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,46 +1,46 @@
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 type Colonne from '../../modeles/composants/datatableColonne'
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
- colonnes: Colonne[]
21
- }>()
22
-
23
- // Fonction pour exporter les données en Excel
24
- const exportToXLSX = () => {
25
- if (!props.liste.length) {
26
- console.warn('La liste est vide, exportation annulée.')
27
- return
28
- }
29
-
30
- // Colonnes affichées (on exclut action et ancre)
31
- const colonnesExport = props.colonnes.filter(c => c.key && c.key !== 'action' && c.key !== 'ancre')
32
-
33
- const headers = colonnesExport.map(c => c.title ?? String(c.key))
34
- const keys = colonnesExport.map(c => String(c.key))
35
-
36
- const rows = props.liste.map(item => {
37
- return keys.map(key => (key in item ? item[key] : ''))
38
- })
39
-
40
- const data = [headers, ...rows]
41
- const ws = utils.aoa_to_sheet(data)
42
- const wb = utils.book_new()
43
- utils.book_append_sheet(wb, ws, '1')
44
- writeFileXLSX(wb, `${props.nomFichier}.xlsx`)
45
- }
46
- </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 type Colonne from '../../modeles/composants/datatableColonne'
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
+ colonnes: Colonne[]
21
+ }>()
22
+
23
+ // Fonction pour exporter les données en Excel
24
+ const exportToXLSX = () => {
25
+ if (!props.liste.length) {
26
+ console.warn('La liste est vide, exportation annulée.')
27
+ return
28
+ }
29
+
30
+ // Colonnes affichées (on exclut action et ancre)
31
+ const colonnesExport = props.colonnes.filter(c => c.key && c.key !== 'action' && c.key !== 'ancre')
32
+
33
+ const headers = colonnesExport.map(c => c.title ?? String(c.key))
34
+ const keys = colonnesExport.map(c => String(c.key))
35
+
36
+ const rows = props.liste.map(item => {
37
+ return keys.map(key => (key in item ? item[key] : ''))
38
+ })
39
+
40
+ const data = [headers, ...rows]
41
+ const ws = utils.aoa_to_sheet(data)
42
+ const wb = utils.book_new()
43
+ utils.book_append_sheet(wb, ws, '1')
44
+ writeFileXLSX(wb, `${props.nomFichier}.xlsx`)
45
+ }
46
+ </script>
@@ -55,6 +55,22 @@ class RafraichisseurToken {
55
55
  }
56
56
 
57
57
  public attendreRefreshSiNecessaire(force = false): Promise<void> {
58
+ if (this.urlPortailSeConnecter == null || this.urlPortailSeConnecter === '') {
59
+ if (this.loggerTrace)
60
+ console.warn(
61
+ '[RafraichisseurToken] attendreRefreshSiNecessaire appelé alors que aucun url se connecter a été configuré.',
62
+ )
63
+ return Promise.resolve()
64
+ }
65
+
66
+ if (this.urlPortailRafraichir == null || this.urlPortailRafraichir === '') {
67
+ if (this.loggerTrace)
68
+ console.warn(
69
+ '[RafraichisseurToken] attendreRefreshSiNecessaire appelé alors que aucun url rafraichir a été configuré.',
70
+ )
71
+ return Promise.resolve()
72
+ }
73
+
58
74
  if (this.refreshPromise) return this.refreshPromise
59
75
  if (force || !this.estJetonValide()) {
60
76
  this.refreshPromise = this.rafraichir().finally(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codevdesign",
3
- "version": "1.0.76",
3
+ "version": "1.0.77",
4
4
  "description": "Composants Vuetify 3 pour les projets Codev",
5
5
  "files": [
6
6
  "./**/*.vue",