codevdesign 1.0.77 → 1.0.78
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/csqcConfirmation.vue +75 -75
- package/composants/csqcDate.vue +86 -86
- package/composants/csqcDialogue.vue +118 -118
- package/composants/csqcEditeurTexteRiche.vue +378 -378
- package/composants/csqcModaleSaisie.vue +97 -97
- package/composants/csqcRechercheUtilisateur.vue +198 -198
- package/composants/csqcSnackbar.vue +207 -207
- package/composants/csqcTiroir.vue +197 -195
- package/outils/rafraichisseurToken.ts +310 -310
- package/package.json +1 -1
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<csqcDialogue
|
|
3
|
-
ref="modale"
|
|
4
|
-
:titre="props.titre"
|
|
5
|
-
:operation-en-cours="operationEnCours"
|
|
6
|
-
activator="supprimer"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
@ok="confirmer"
|
|
10
|
-
@annuler="annuler"
|
|
11
|
-
>
|
|
12
|
-
<v-form
|
|
13
|
-
ref="form"
|
|
14
|
-
@submit.prevent
|
|
15
|
-
>
|
|
16
|
-
<v-row>
|
|
17
|
-
<v-col
|
|
18
|
-
cols="12"
|
|
19
|
-
class="pa-0 ma-0"
|
|
20
|
-
>
|
|
21
|
-
<span v-html="texte"></span>
|
|
22
|
-
</v-col>
|
|
23
|
-
</v-row>
|
|
24
|
-
</v-form>
|
|
25
|
-
</csqcDialogue>
|
|
26
|
-
</template>
|
|
27
|
-
|
|
28
|
-
<script lang="ts" setup>
|
|
29
|
-
import { ref } from 'vue'
|
|
30
|
-
import csqcDialogue from './csqcDialogue.vue'
|
|
31
|
-
|
|
32
|
-
const modale = ref<InstanceType<typeof csqcDialogue> | null>(null)
|
|
33
|
-
const utilisateurATermine = ref(false)
|
|
34
|
-
const reponse = ref(false)
|
|
35
|
-
const texte = ref('')
|
|
36
|
-
const modeAlerte = ref(false)
|
|
37
|
-
|
|
38
|
-
const props = defineProps({
|
|
39
|
-
operationEnCours: { type: Boolean, default: false },
|
|
40
|
-
titre: { type: String, default: '' },
|
|
41
|
-
largeur: { type: String, default: '525px' },
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
const ouvrir = async (message: string, modeAlerteParam: boolean = false) => {
|
|
45
|
-
texte.value = message
|
|
46
|
-
modeAlerte.value = modeAlerteParam
|
|
47
|
-
utilisateurATermine.value = false
|
|
48
|
-
modale.value?.ouvrir()
|
|
49
|
-
|
|
50
|
-
while (!utilisateurATermine.value) {
|
|
51
|
-
await new Promise(resolve => setTimeout(resolve, 100)) // Attendre 100ms
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return reponse.value
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const confirmer = (): void => {
|
|
58
|
-
reponse.value = true
|
|
59
|
-
utilisateurATermine.value = true
|
|
60
|
-
|
|
61
|
-
if (modeAlerte.value) fermer()
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const annuler = (): void => {
|
|
65
|
-
reponse.value = false
|
|
66
|
-
utilisateurATermine.value = true
|
|
67
|
-
fermer()
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const fermer = (): void => {
|
|
71
|
-
modale.value?.fermer()
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
defineExpose({ ouvrir, fermer })
|
|
75
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<csqcDialogue
|
|
3
|
+
ref="modale"
|
|
4
|
+
:titre="props.titre"
|
|
5
|
+
:operation-en-cours="operationEnCours"
|
|
6
|
+
activator="supprimer"
|
|
7
|
+
:largeur="props.largeur"
|
|
8
|
+
v-bind="$attrs"
|
|
9
|
+
@ok="confirmer"
|
|
10
|
+
@annuler="annuler"
|
|
11
|
+
>
|
|
12
|
+
<v-form
|
|
13
|
+
ref="form"
|
|
14
|
+
@submit.prevent
|
|
15
|
+
>
|
|
16
|
+
<v-row>
|
|
17
|
+
<v-col
|
|
18
|
+
cols="12"
|
|
19
|
+
class="pa-0 ma-0"
|
|
20
|
+
>
|
|
21
|
+
<span v-html="texte"></span>
|
|
22
|
+
</v-col>
|
|
23
|
+
</v-row>
|
|
24
|
+
</v-form>
|
|
25
|
+
</csqcDialogue>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script lang="ts" setup>
|
|
29
|
+
import { ref } from 'vue'
|
|
30
|
+
import csqcDialogue from './csqcDialogue.vue'
|
|
31
|
+
|
|
32
|
+
const modale = ref<InstanceType<typeof csqcDialogue> | null>(null)
|
|
33
|
+
const utilisateurATermine = ref(false)
|
|
34
|
+
const reponse = ref(false)
|
|
35
|
+
const texte = ref('')
|
|
36
|
+
const modeAlerte = ref(false)
|
|
37
|
+
|
|
38
|
+
const props = defineProps({
|
|
39
|
+
operationEnCours: { type: Boolean, default: false },
|
|
40
|
+
titre: { type: String, default: '' },
|
|
41
|
+
largeur: { type: String, default: '525px' },
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
const ouvrir = async (message: string, modeAlerteParam: boolean = false) => {
|
|
45
|
+
texte.value = message
|
|
46
|
+
modeAlerte.value = modeAlerteParam
|
|
47
|
+
utilisateurATermine.value = false
|
|
48
|
+
modale.value?.ouvrir()
|
|
49
|
+
|
|
50
|
+
while (!utilisateurATermine.value) {
|
|
51
|
+
await new Promise(resolve => setTimeout(resolve, 100)) // Attendre 100ms
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return reponse.value
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const confirmer = (): void => {
|
|
58
|
+
reponse.value = true
|
|
59
|
+
utilisateurATermine.value = true
|
|
60
|
+
|
|
61
|
+
if (modeAlerte.value) fermer()
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const annuler = (): void => {
|
|
65
|
+
reponse.value = false
|
|
66
|
+
utilisateurATermine.value = true
|
|
67
|
+
fermer()
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const fermer = (): void => {
|
|
71
|
+
modale.value?.fermer()
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
defineExpose({ ouvrir, fermer })
|
|
75
|
+
</script>
|
package/composants/csqcDate.vue
CHANGED
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-date-input
|
|
3
|
-
:model-value="dateInterne"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
prepend-icon=""
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@update:model-value="choixUtilisateur"
|
|
11
|
-
/>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script setup lang="ts">
|
|
15
|
-
import { computed, ref } from 'vue'
|
|
16
|
-
import { VDateInput } from 'vuetify/labs/VDateInput'
|
|
17
|
-
|
|
18
|
-
type Model = string | Date | null
|
|
19
|
-
|
|
20
|
-
const props = defineProps<{ modelValue: Model }>()
|
|
21
|
-
|
|
22
|
-
const emit = defineEmits<{
|
|
23
|
-
(e: 'update:modelValue', v: string | null): void
|
|
24
|
-
(e: 'change', v: string | null): void
|
|
25
|
-
}>()
|
|
26
|
-
|
|
27
|
-
// Normalisation, TOUJOURS "YYYY-MM-DD" ou null
|
|
28
|
-
const normalizeToYmd = (v: Date | string | null | undefined): string | null => {
|
|
29
|
-
if (v == null || v === '') return null
|
|
30
|
-
|
|
31
|
-
// Date -> YYYY-MM-DD (local)
|
|
32
|
-
if (v instanceof Date) {
|
|
33
|
-
if (isNaN(v.getTime())) return null
|
|
34
|
-
const yyyy = v.getFullYear()
|
|
35
|
-
const mm = String(v.getMonth() + 1).padStart(2, '0')
|
|
36
|
-
const dd = String(v.getDate()).padStart(2, '0')
|
|
37
|
-
return `${yyyy}-${mm}-${dd}`
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// String -> accepte seulement YYYY-MM-DD ISO8601 (optionnellement suivi de l'heure, qui est ignorée)
|
|
41
|
-
const s = String(v).trim()
|
|
42
|
-
const m = s.match(
|
|
43
|
-
/^(?<date>(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2}))(?:T\d{2}:\d{2}:\d{2}(?:\.\d{3})?(?:Z|(?:[-+]\d{2}:\d{2}?))?)?$/,
|
|
44
|
-
)
|
|
45
|
-
if (!m) return null
|
|
46
|
-
|
|
47
|
-
// Optionnel: validation simple (évite 2026-99-99)
|
|
48
|
-
const y = Number(m.groups!.year),
|
|
49
|
-
mo = Number(m.groups!.month),
|
|
50
|
-
d = Number(m.groups!.day)
|
|
51
|
-
if (mo < 1 || mo > 12 || d < 1 || d > 31) return null
|
|
52
|
-
if (mo === 2) {
|
|
53
|
-
const isLeap = (y % 4 === 0 && y % 100 !== 0) || y % 400 === 0
|
|
54
|
-
if (d > (isLeap ? 29 : 28)) return null
|
|
55
|
-
}
|
|
56
|
-
if ([4, 6, 9, 11].includes(mo) && d > 30) return null
|
|
57
|
-
|
|
58
|
-
return `${m.groups!.date}`
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// UI: VDateInput stable avec Date|null
|
|
62
|
-
const dateInterne = computed<Date | null>(() => {
|
|
63
|
-
const ymd = normalizeToYmd(props.modelValue as any)
|
|
64
|
-
if (!ymd) return null
|
|
65
|
-
const [y, m, d] = ymd.split('-').map(Number)
|
|
66
|
-
return new Date(y, m - 1, d) // local, stable
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
const prevBeforeEmit = ref<string | null>(null)
|
|
70
|
-
|
|
71
|
-
const choixUtilisateur = (v: Date | string | null) => {
|
|
72
|
-
const next = normalizeToYmd(v)
|
|
73
|
-
const current = normalizeToYmd(props.modelValue as any)
|
|
74
|
-
|
|
75
|
-
// rollback: on reçoit l'ancienne valeur (celle qu'on avait avant)
|
|
76
|
-
if (prevBeforeEmit.value && next === prevBeforeEmit.value && current !== prevBeforeEmit.value) {
|
|
77
|
-
return
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
if (next === current) return
|
|
81
|
-
|
|
82
|
-
prevBeforeEmit.value = current
|
|
83
|
-
emit('update:modelValue', next)
|
|
84
|
-
emit('change', next)
|
|
85
|
-
}
|
|
86
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<v-date-input
|
|
3
|
+
:model-value="dateInterne"
|
|
4
|
+
input-format="yyyy-MM-dd"
|
|
5
|
+
variant="outlined"
|
|
6
|
+
prepend-icon=""
|
|
7
|
+
prepend-inner-icon="$calendar"
|
|
8
|
+
density="comfortable"
|
|
9
|
+
v-bind="$attrs"
|
|
10
|
+
@update:model-value="choixUtilisateur"
|
|
11
|
+
/>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
import { computed, ref } from 'vue'
|
|
16
|
+
import { VDateInput } from 'vuetify/labs/VDateInput'
|
|
17
|
+
|
|
18
|
+
type Model = string | Date | null
|
|
19
|
+
|
|
20
|
+
const props = defineProps<{ modelValue: Model }>()
|
|
21
|
+
|
|
22
|
+
const emit = defineEmits<{
|
|
23
|
+
(e: 'update:modelValue', v: string | null): void
|
|
24
|
+
(e: 'change', v: string | null): void
|
|
25
|
+
}>()
|
|
26
|
+
|
|
27
|
+
// Normalisation, TOUJOURS "YYYY-MM-DD" ou null
|
|
28
|
+
const normalizeToYmd = (v: Date | string | null | undefined): string | null => {
|
|
29
|
+
if (v == null || v === '') return null
|
|
30
|
+
|
|
31
|
+
// Date -> YYYY-MM-DD (local)
|
|
32
|
+
if (v instanceof Date) {
|
|
33
|
+
if (isNaN(v.getTime())) return null
|
|
34
|
+
const yyyy = v.getFullYear()
|
|
35
|
+
const mm = String(v.getMonth() + 1).padStart(2, '0')
|
|
36
|
+
const dd = String(v.getDate()).padStart(2, '0')
|
|
37
|
+
return `${yyyy}-${mm}-${dd}`
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// String -> accepte seulement YYYY-MM-DD ISO8601 (optionnellement suivi de l'heure, qui est ignorée)
|
|
41
|
+
const s = String(v).trim()
|
|
42
|
+
const m = s.match(
|
|
43
|
+
/^(?<date>(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2}))(?:T\d{2}:\d{2}:\d{2}(?:\.\d{3})?(?:Z|(?:[-+]\d{2}:\d{2}?))?)?$/,
|
|
44
|
+
)
|
|
45
|
+
if (!m) return null
|
|
46
|
+
|
|
47
|
+
// Optionnel: validation simple (évite 2026-99-99)
|
|
48
|
+
const y = Number(m.groups!.year),
|
|
49
|
+
mo = Number(m.groups!.month),
|
|
50
|
+
d = Number(m.groups!.day)
|
|
51
|
+
if (mo < 1 || mo > 12 || d < 1 || d > 31) return null
|
|
52
|
+
if (mo === 2) {
|
|
53
|
+
const isLeap = (y % 4 === 0 && y % 100 !== 0) || y % 400 === 0
|
|
54
|
+
if (d > (isLeap ? 29 : 28)) return null
|
|
55
|
+
}
|
|
56
|
+
if ([4, 6, 9, 11].includes(mo) && d > 30) return null
|
|
57
|
+
|
|
58
|
+
return `${m.groups!.date}`
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// UI: VDateInput stable avec Date|null
|
|
62
|
+
const dateInterne = computed<Date | null>(() => {
|
|
63
|
+
const ymd = normalizeToYmd(props.modelValue as any)
|
|
64
|
+
if (!ymd) return null
|
|
65
|
+
const [y, m, d] = ymd.split('-').map(Number)
|
|
66
|
+
return new Date(y, m - 1, d) // local, stable
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
const prevBeforeEmit = ref<string | null>(null)
|
|
70
|
+
|
|
71
|
+
const choixUtilisateur = (v: Date | string | null) => {
|
|
72
|
+
const next = normalizeToYmd(v)
|
|
73
|
+
const current = normalizeToYmd(props.modelValue as any)
|
|
74
|
+
|
|
75
|
+
// rollback: on reçoit l'ancienne valeur (celle qu'on avait avant)
|
|
76
|
+
if (prevBeforeEmit.value && next === prevBeforeEmit.value && current !== prevBeforeEmit.value) {
|
|
77
|
+
return
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (next === current) return
|
|
81
|
+
|
|
82
|
+
prevBeforeEmit.value = current
|
|
83
|
+
emit('update:modelValue', next)
|
|
84
|
+
emit('change', next)
|
|
85
|
+
}
|
|
86
|
+
</script>
|
|
@@ -1,118 +1,118 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-dialog
|
|
3
|
-
v-model="dialog"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@keydown.esc="!persistant ? annuler : ''"
|
|
11
|
-
@click:outside="!persistant ? annuler : ''"
|
|
12
|
-
>
|
|
13
|
-
<v-card class="pa-0 ma-0 pl-8 pt-8">
|
|
14
|
-
<!-- Bouton en haut à droite -->
|
|
15
|
-
<v-btn
|
|
16
|
-
icon="mdi-close"
|
|
17
|
-
variant="text"
|
|
18
|
-
class="position-absolute iconeHover"
|
|
19
|
-
style="top: 5px; right: 5px"
|
|
20
|
-
@click="annuler"
|
|
21
|
-
></v-btn>
|
|
22
|
-
|
|
23
|
-
<v-card-title
|
|
24
|
-
class="pa-0 ma-0 pb-6"
|
|
25
|
-
style="font-size: 24px; white-space: normal; word-break: break-word"
|
|
26
|
-
>
|
|
27
|
-
<slot name="titre"></slot>
|
|
28
|
-
<div text-h5><span v-html="titre"></span></div>
|
|
29
|
-
</v-card-title>
|
|
30
|
-
|
|
31
|
-
<v-card-text class="pa-0 ma-0 pb-6 pr-6">
|
|
32
|
-
<v-container>
|
|
33
|
-
<slot></slot>
|
|
34
|
-
<slot name="content"></slot>
|
|
35
|
-
</v-container>
|
|
36
|
-
</v-card-text>
|
|
37
|
-
<v-card-actions class="my-2 d-flex justify-end pr-6 pb-5">
|
|
38
|
-
<slot name="actions"></slot>
|
|
39
|
-
<v-btn
|
|
40
|
-
v-if="btnAnnuler"
|
|
41
|
-
color="primary"
|
|
42
|
-
:loading="operationEnCours"
|
|
43
|
-
variant="text"
|
|
44
|
-
@click="annuler"
|
|
45
|
-
>
|
|
46
|
-
{{ btnAnnulerTexte ? btnAnnulerTexte : $t('csqc.bouton.annuler') }}
|
|
47
|
-
</v-btn>
|
|
48
|
-
|
|
49
|
-
<v-btn
|
|
50
|
-
v-if="btnOk"
|
|
51
|
-
class="Gouttiere"
|
|
52
|
-
color="primary"
|
|
53
|
-
:loading="operationEnCours"
|
|
54
|
-
:disabled="btnOkDesactiver"
|
|
55
|
-
variant="flat"
|
|
56
|
-
@click="okBouton"
|
|
57
|
-
>
|
|
58
|
-
{{ btnOkTexte ? btnOkTexte : $t('csqc.bouton.ok') }}
|
|
59
|
-
</v-btn>
|
|
60
|
-
</v-card-actions>
|
|
61
|
-
</v-card>
|
|
62
|
-
</v-dialog>
|
|
63
|
-
</template>
|
|
64
|
-
|
|
65
|
-
<script setup lang="ts">
|
|
66
|
-
import { ref } from 'vue'
|
|
67
|
-
import { useDisplay } from 'vuetify'
|
|
68
|
-
|
|
69
|
-
const display = useDisplay()
|
|
70
|
-
|
|
71
|
-
// Déclaration des props
|
|
72
|
-
const props = defineProps({
|
|
73
|
-
largeur: { type: String, default: '50vw' },
|
|
74
|
-
persistant: { type: Boolean, default: true },
|
|
75
|
-
operationEnCours: { type: Boolean, default: false },
|
|
76
|
-
btnAnnuler: { type: Boolean, default: true },
|
|
77
|
-
btnOk: { type: Boolean, default: true },
|
|
78
|
-
btnAnnulerTexte: { type: String, default: '' },
|
|
79
|
-
btnOkTexte: { type: String, default: '' },
|
|
80
|
-
titre: { type: String, default: '' },
|
|
81
|
-
btnOkDesactiver: { type: Boolean, default: false },
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
// Déclaration des événements émis
|
|
85
|
-
const emit = defineEmits(['annuler', 'ok'])
|
|
86
|
-
|
|
87
|
-
// Gestion de l'état du dialogue
|
|
88
|
-
const dialog = ref(false)
|
|
89
|
-
|
|
90
|
-
// Méthodes pour gérer l'ouverture et la fermeture
|
|
91
|
-
const ouvrir = () => {
|
|
92
|
-
dialog.value = true
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const fermer = () => {
|
|
96
|
-
dialog.value = false
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// Gestion des actions des boutons
|
|
100
|
-
const annuler = () => {
|
|
101
|
-
emit('annuler')
|
|
102
|
-
fermer()
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const okBouton = () => {
|
|
106
|
-
emit('ok')
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// permet d'exporter les 2 actions
|
|
110
|
-
defineExpose({ ouvrir, fermer })
|
|
111
|
-
</script>
|
|
112
|
-
|
|
113
|
-
<style lang="css" scoped>
|
|
114
|
-
.v-card__text,
|
|
115
|
-
.v-card__title {
|
|
116
|
-
word-break: normal; /* empeche le wrap de couper un mot en XS */
|
|
117
|
-
}
|
|
118
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<v-dialog
|
|
3
|
+
v-model="dialog"
|
|
4
|
+
class="pa-0 ma-0"
|
|
5
|
+
:width="largeur"
|
|
6
|
+
:fullscreen="display.xs.value"
|
|
7
|
+
max-width="650"
|
|
8
|
+
:persistent="props.persistant"
|
|
9
|
+
v-bind="$attrs"
|
|
10
|
+
@keydown.esc="!persistant ? annuler : ''"
|
|
11
|
+
@click:outside="!persistant ? annuler : ''"
|
|
12
|
+
>
|
|
13
|
+
<v-card class="pa-0 ma-0 pl-8 pt-8">
|
|
14
|
+
<!-- Bouton en haut à droite -->
|
|
15
|
+
<v-btn
|
|
16
|
+
icon="mdi-close"
|
|
17
|
+
variant="text"
|
|
18
|
+
class="position-absolute iconeHover"
|
|
19
|
+
style="top: 5px; right: 5px"
|
|
20
|
+
@click="annuler"
|
|
21
|
+
></v-btn>
|
|
22
|
+
|
|
23
|
+
<v-card-title
|
|
24
|
+
class="pa-0 ma-0 pb-6"
|
|
25
|
+
style="font-size: 24px; white-space: normal; word-break: break-word"
|
|
26
|
+
>
|
|
27
|
+
<slot name="titre"></slot>
|
|
28
|
+
<div text-h5><span v-html="titre"></span></div>
|
|
29
|
+
</v-card-title>
|
|
30
|
+
|
|
31
|
+
<v-card-text class="pa-0 ma-0 pb-6 pr-6">
|
|
32
|
+
<v-container>
|
|
33
|
+
<slot></slot>
|
|
34
|
+
<slot name="content"></slot>
|
|
35
|
+
</v-container>
|
|
36
|
+
</v-card-text>
|
|
37
|
+
<v-card-actions class="my-2 d-flex justify-end pr-6 pb-5">
|
|
38
|
+
<slot name="actions"></slot>
|
|
39
|
+
<v-btn
|
|
40
|
+
v-if="btnAnnuler"
|
|
41
|
+
color="primary"
|
|
42
|
+
:loading="operationEnCours"
|
|
43
|
+
variant="text"
|
|
44
|
+
@click="annuler"
|
|
45
|
+
>
|
|
46
|
+
{{ btnAnnulerTexte ? btnAnnulerTexte : $t('csqc.bouton.annuler') }}
|
|
47
|
+
</v-btn>
|
|
48
|
+
|
|
49
|
+
<v-btn
|
|
50
|
+
v-if="btnOk"
|
|
51
|
+
class="Gouttiere"
|
|
52
|
+
color="primary"
|
|
53
|
+
:loading="operationEnCours"
|
|
54
|
+
:disabled="btnOkDesactiver"
|
|
55
|
+
variant="flat"
|
|
56
|
+
@click="okBouton"
|
|
57
|
+
>
|
|
58
|
+
{{ btnOkTexte ? btnOkTexte : $t('csqc.bouton.ok') }}
|
|
59
|
+
</v-btn>
|
|
60
|
+
</v-card-actions>
|
|
61
|
+
</v-card>
|
|
62
|
+
</v-dialog>
|
|
63
|
+
</template>
|
|
64
|
+
|
|
65
|
+
<script setup lang="ts">
|
|
66
|
+
import { ref } from 'vue'
|
|
67
|
+
import { useDisplay } from 'vuetify'
|
|
68
|
+
|
|
69
|
+
const display = useDisplay()
|
|
70
|
+
|
|
71
|
+
// Déclaration des props
|
|
72
|
+
const props = defineProps({
|
|
73
|
+
largeur: { type: String, default: '50vw' },
|
|
74
|
+
persistant: { type: Boolean, default: true },
|
|
75
|
+
operationEnCours: { type: Boolean, default: false },
|
|
76
|
+
btnAnnuler: { type: Boolean, default: true },
|
|
77
|
+
btnOk: { type: Boolean, default: true },
|
|
78
|
+
btnAnnulerTexte: { type: String, default: '' },
|
|
79
|
+
btnOkTexte: { type: String, default: '' },
|
|
80
|
+
titre: { type: String, default: '' },
|
|
81
|
+
btnOkDesactiver: { type: Boolean, default: false },
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
// Déclaration des événements émis
|
|
85
|
+
const emit = defineEmits(['annuler', 'ok'])
|
|
86
|
+
|
|
87
|
+
// Gestion de l'état du dialogue
|
|
88
|
+
const dialog = ref(false)
|
|
89
|
+
|
|
90
|
+
// Méthodes pour gérer l'ouverture et la fermeture
|
|
91
|
+
const ouvrir = () => {
|
|
92
|
+
dialog.value = true
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const fermer = () => {
|
|
96
|
+
dialog.value = false
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Gestion des actions des boutons
|
|
100
|
+
const annuler = () => {
|
|
101
|
+
emit('annuler')
|
|
102
|
+
fermer()
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const okBouton = () => {
|
|
106
|
+
emit('ok')
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// permet d'exporter les 2 actions
|
|
110
|
+
defineExpose({ ouvrir, fermer })
|
|
111
|
+
</script>
|
|
112
|
+
|
|
113
|
+
<style lang="css" scoped>
|
|
114
|
+
.v-card__text,
|
|
115
|
+
.v-card__title {
|
|
116
|
+
word-break: normal; /* empeche le wrap de couper un mot en XS */
|
|
117
|
+
}
|
|
118
|
+
</style>
|