ep-lib-ts 0.1.8 → 0.1.10
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/dist/BgAudio-7556351b.js +5 -0
- package/dist/DisplayBox-15403c71.js +5 -0
- package/dist/EpAlert-2abc116f.js +5 -0
- package/dist/EpAudio-5c9dfb92.js +5 -0
- package/dist/EpBadge-234518b2.js +5 -0
- package/dist/EpBarChart-ce79ce3d.js +5 -0
- package/dist/EpBtn-3512ca60.js +5 -0
- package/dist/EpCard-84819b25.js +5 -0
- package/dist/EpCheckbox-fe632df9.js +36 -0
- package/dist/EpChip-f91aa662.js +5 -0
- package/dist/EpDivider-13d648fa.js +5 -0
- package/dist/EpEdu-fe8bc9f2.js +5 -0
- package/dist/EpFlex-c87197a7.js +5 -0
- package/dist/EpHeader-61c8da9f.js +5 -0
- package/dist/EpIcon-c85eaee3.js +5 -0
- package/dist/EpIframe-06bf6ef4.js +5 -0
- package/dist/EpImg-dc60d288.js +5 -0
- package/dist/EpInput-e2cd96a6.js +1171 -0
- package/dist/EpLineChart-76eb8203.js +5 -0
- package/dist/EpLink-ae95b58b.js +5 -0
- package/dist/EpModal-9acbf67e.js +5 -0
- package/dist/EpNothing-9a8a563a.js +10 -0
- package/dist/EpQuestion-e24fa1e7.js +5 -0
- package/dist/EpQuote-82683817.js +5 -0
- package/dist/EpRadio-6bb393b5.js +5 -0
- package/dist/EpReading-725ce633.js +5 -0
- package/dist/EpResource-3487f005.js +5 -0
- package/dist/EpScope-87682f54.js +5 -0
- package/dist/EpSection-826799f7.js +5 -0
- package/dist/EpSelect-39d82b2a.js +31 -0
- package/dist/EpSoftware-b616d8f4.js +5 -0
- package/dist/EpSpinner-b1c988e5.js +5 -0
- package/dist/EpSwitch-1eaf9d3f.js +44 -0
- package/dist/EpTable-fd10d6c4.js +5 -0
- package/dist/EpTerm-6a339de4.js +5 -0
- package/dist/EpText-75b4c821.js +5 -0
- package/dist/EpTextarea-67f751e9.js +41 -0
- package/dist/EpToggle-9755056a.js +44 -0
- package/dist/EpVideo-981c8f8d.js +5 -0
- package/dist/EpVideoPanopto-928e60df.js +5 -0
- package/dist/components/basics/EpSpinner.vue.d.ts +9 -0
- package/dist/components/basics/EpText.vue.d.ts +13 -9
- package/dist/components/educationals/EpEdu.vue.d.ts +3 -2
- package/dist/components/educationals/EpReading.vue.d.ts +5 -4
- package/dist/components/educationals/EpResource.vue.d.ts +34 -1
- package/dist/components/educationals/EpScope.vue.d.ts +9 -0
- package/dist/components/forms/EpCheckbox.vue.d.ts +72 -0
- package/dist/components/forms/EpInput.vue.d.ts +98 -0
- package/dist/components/forms/EpRadio.vue.d.ts +69 -0
- package/dist/components/forms/EpSelect.vue.d.ts +83 -0
- package/dist/components/forms/EpSwitch.vue.d.ts +81 -0
- package/dist/components/forms/EpTextarea.vue.d.ts +90 -0
- package/dist/components/forms/EpToggle.vue.d.ts +81 -0
- package/dist/components/interactions/EpQuestion.vue.d.ts +90 -1
- package/dist/components/medias/EpAudio.vue.d.ts +3 -8
- package/dist/components/medias/EpCarousel.vue.d.ts +2 -2
- package/dist/components/medias/EpLink.vue.d.ts +3 -2
- package/dist/components/medias/EpSoftware.vue.d.ts +3 -2
- package/dist/components/medias/EpVideo.vue.d.ts +3 -2
- package/dist/components/medias/EpVideoPanopto.vue.d.ts +3 -2
- package/dist/components/signages/EpAlert.vue.d.ts +10 -3
- package/dist/components/signages/EpNothing.vue.d.ts +2 -0
- package/dist/components/signages/EpQuote.vue.d.ts +9 -9
- package/dist/composables/useComponent.d.ts +6 -0
- package/dist/ep-lib-ts.js +41 -18489
- package/dist/ep-lib-ts.umd.cjs +42 -38
- package/dist/index-761c8157.js +18795 -0
- package/dist/style.css +1 -1
- package/dist/types/Answer.d.ts +15 -0
- package/dist/types/MandateLevel.d.ts +5 -0
- package/package.json +3 -2
- package/src/components/basics/EpCard.vue +1 -1
- package/src/components/basics/EpImg.vue +70 -40
- package/src/components/basics/EpSpinner.vue +35 -25
- package/src/components/basics/EpText.vue +19 -5
- package/src/components/educationals/EpEdu.vue +11 -3
- package/src/components/educationals/EpReading.vue +10 -7
- package/src/components/educationals/EpResource.vue +66 -3
- package/src/components/educationals/EpScope.vue +14 -2
- package/src/components/forms/EpRadio.vue +2 -1
- package/src/components/interactions/EpQuestion.vue +176 -4
- package/src/components/medias/EpAudio.vue +2 -2
- package/src/components/medias/EpCarousel.vue +10 -10
- package/src/components/medias/EpLink.vue +2 -1
- package/src/components/medias/EpSoftware.vue +4 -4
- package/src/components/medias/EpVideo.vue +7 -3
- package/src/components/medias/EpVideoPanopto.vue +2 -1
- package/src/components/signages/EpAlert.vue +19 -4
- package/src/components/signages/EpNothing.vue +5 -0
- package/src/components/signages/EpQuote.vue +23 -19
|
@@ -1,8 +1,180 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { watch, ref, toRefs, computed, defineAsyncComponent} from "vue";
|
|
3
|
+
import EpEdu from "../educationals/EpEdu.vue";
|
|
4
|
+
//types with capital letter, object styles in lowercase
|
|
5
|
+
import { MediaVariants } from "../../types/Medias";
|
|
6
|
+
import { Answer } from "../../types/Answer";
|
|
7
|
+
import { useRenderText } from "../../composables/useRenderText";
|
|
8
|
+
import { useComponent } from "../../composables/useComponent"
|
|
9
|
+
import { mdiHelpCircle } from "@mdi/js";
|
|
10
|
+
import EpImg from "../basics/EpImg.vue";
|
|
11
|
+
import EpRadio from "../forms/EpRadio.vue";
|
|
12
|
+
import EpBtn from "../basics/EpBtn.vue";
|
|
13
|
+
import EpAlert from "../signages/EpAlert.vue";
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
interface Props {
|
|
18
|
+
title?: string;
|
|
19
|
+
intentions?: string;
|
|
20
|
+
hideIcon?: boolean;
|
|
21
|
+
type?: MediaVariants;
|
|
22
|
+
mandateLevel?: string | null;
|
|
23
|
+
question: string;
|
|
24
|
+
answers: Answer[];
|
|
25
|
+
shuffle?: boolean;
|
|
26
|
+
before?: boolean;
|
|
27
|
+
numeration?: boolean;
|
|
28
|
+
src?: string | null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
32
|
+
type: "base",
|
|
33
|
+
hideIcon: false,
|
|
34
|
+
shuffle: true,
|
|
35
|
+
before: false,
|
|
36
|
+
numeration: false,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const renderText = computed(() => {
|
|
40
|
+
if (!props.intentions) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
return useRenderText(props.intentions);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
//shuffle and list
|
|
47
|
+
const shuffleAnswers = computed(() => {
|
|
48
|
+
const array = props.answers;
|
|
49
|
+
if (props.shuffle) {
|
|
50
|
+
for (let i = array.length - 1; i > 0; i--) {
|
|
51
|
+
const j = Math.floor(Math.random() * (i + 1));
|
|
52
|
+
const temp = array[i];
|
|
53
|
+
array[i] = array[j];
|
|
54
|
+
array[j] = temp;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return array;
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const alphabet = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J"];
|
|
61
|
+
const typeList = (index:number) => {
|
|
62
|
+
if (props.numeration) {
|
|
63
|
+
return alphabet[index];
|
|
64
|
+
}
|
|
65
|
+
return index + 1;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
///user answer
|
|
69
|
+
const userAnswer = ref("");
|
|
70
|
+
const answered = ref(false);
|
|
71
|
+
const valid = ref(true);
|
|
72
|
+
const response = ref<Answer>({type:'warning', text:'no found', component:null, feedback:""})
|
|
73
|
+
const checkAnswer = () => {
|
|
74
|
+
if (userAnswer.value === "") {
|
|
75
|
+
valid.value = false;
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const valuesAnswer = props.answers.find(x => x.uid === userAnswer.value)
|
|
79
|
+
if(!valuesAnswer){
|
|
80
|
+
return
|
|
81
|
+
}
|
|
82
|
+
response.value = valuesAnswer!
|
|
83
|
+
answered.value = true;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const reset = () => {
|
|
87
|
+
answered.value = false;
|
|
88
|
+
userAnswer.value = ""
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
watch(userAnswer, (val) => {
|
|
92
|
+
if (val !== "") {
|
|
93
|
+
valid.value = true;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
//get Component asyncComponent
|
|
98
|
+
const getCompontent = (name:string|undefined)=> {
|
|
99
|
+
const componentToLoad = useComponent(name)
|
|
100
|
+
//console.log(componentToLoad)
|
|
101
|
+
if(componentToLoad.name === "EpNothing"){
|
|
102
|
+
return defineAsyncComponent(()=>import('../signages/EpNothing.vue'))
|
|
103
|
+
}
|
|
104
|
+
return defineAsyncComponent(()=>import(`../${componentToLoad.path}/${componentToLoad.name}.vue`))
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
//returned values from props
|
|
108
|
+
const { title, intentions, hideIcon, question, src } = toRefs(props);
|
|
109
|
+
|
|
2
110
|
</script>
|
|
3
111
|
|
|
4
112
|
<template>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
113
|
+
<EpEdu
|
|
114
|
+
:title="title"
|
|
115
|
+
:type="type"
|
|
116
|
+
:hideIcon="hideIcon"
|
|
117
|
+
:icon="mdiHelpCircle"
|
|
118
|
+
:mandateLevel="mandateLevel"
|
|
119
|
+
>
|
|
120
|
+
<template #intentions v-if="renderText">
|
|
121
|
+
<div v-html="renderText"></div>
|
|
122
|
+
</template>
|
|
123
|
+
<template #content>
|
|
124
|
+
<div class="mt-5">
|
|
125
|
+
<EpImg
|
|
126
|
+
v-if="src && before"
|
|
127
|
+
:src="src"
|
|
128
|
+
:alt="`Image soutien à la question`"
|
|
129
|
+
cols="5"
|
|
130
|
+
/>
|
|
131
|
+
<div v-html="useRenderText(question)" class="my-6"></div>
|
|
132
|
+
<EpImg
|
|
133
|
+
v-if="src && !before"
|
|
134
|
+
:src="src"
|
|
135
|
+
:alt="`Image soutien à la question`"
|
|
136
|
+
cols="5"
|
|
137
|
+
/>
|
|
138
|
+
|
|
139
|
+
<div class="mb-6">
|
|
140
|
+
<ol>
|
|
141
|
+
<li v-for="(answer, i) in answers" class="mb-2" :key="answer.uid">
|
|
142
|
+
<EpRadio
|
|
143
|
+
:label="`${typeList(i)}. ${answer.text}`"
|
|
144
|
+
v-model="userAnswer"
|
|
145
|
+
:value="answer.uid"
|
|
146
|
+
:disabled="answered"
|
|
147
|
+
></EpRadio>
|
|
148
|
+
</li>
|
|
149
|
+
</ol>
|
|
150
|
+
<EpAlert type="error" outlined noIcon v-if="!valid">
|
|
151
|
+
Veuillez choisir une réponse
|
|
152
|
+
</EpAlert>
|
|
153
|
+
</div>
|
|
154
|
+
|
|
155
|
+
<div v-if="answered">
|
|
156
|
+
<EpAlert :type="response.type" outlined>
|
|
157
|
+
<div v-html="useRenderText(response.feedback)"></div>
|
|
158
|
+
</EpAlert>
|
|
159
|
+
|
|
160
|
+
<div v-if="response.component">
|
|
161
|
+
<component :is="getCompontent(response.component.type)" v-bind="{ ...response.component.data }"></component>
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
164
|
+
|
|
165
|
+
<EpBtn
|
|
166
|
+
:type="type"
|
|
167
|
+
@click="checkAnswer"
|
|
168
|
+
:disabled="answered"
|
|
169
|
+
outlined
|
|
170
|
+
extraClass="mr-2"
|
|
171
|
+
>Valider</EpBtn
|
|
172
|
+
>
|
|
173
|
+
<EpBtn :type="type" v-if="answered" @click="reset" outlined>Réessayer</EpBtn>
|
|
174
|
+
</div>
|
|
175
|
+
</template>
|
|
176
|
+
<!-- <template #actions>
|
|
177
|
+
<EpBtn :color="type=='base'?'text-gray-700':'text-white'" :type="type">[Repair btn style... to change]</EpBtn>
|
|
178
|
+
</template> -->
|
|
179
|
+
</EpEdu>
|
|
180
|
+
</template>
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { computed, toRefs } from 'vue'
|
|
4
4
|
//types with capital letter, object styles in lowercase
|
|
5
5
|
import { MediaVariants } from "../../types/Medias";
|
|
6
|
+
import { MandateLevel } from '../../types/MandateLevel';
|
|
6
7
|
import { isHtml } from '../../composables/isHtml';
|
|
7
8
|
import { useMarkdown } from '../../composables/useMarkdown'
|
|
8
9
|
import { mdiHeadphones } from "@mdi/js";
|
|
@@ -17,12 +18,11 @@ interface Props {
|
|
|
17
18
|
title?: string;
|
|
18
19
|
intentions?: string;
|
|
19
20
|
credits?: string;
|
|
20
|
-
madateLevel?: string;
|
|
21
21
|
labelIntentions?: string;
|
|
22
22
|
type?: MediaVariants;
|
|
23
23
|
messageError?: string
|
|
24
24
|
hideIcon?: boolean;
|
|
25
|
-
mandateLevel?:string | null;
|
|
25
|
+
mandateLevel?:string | MandateLevel | null;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
const props = withDefaults(defineProps<Props>(), {
|
|
@@ -9,7 +9,7 @@ import { MediaCarousel } from "../../types/MediaCarousel";
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
interface Props {
|
|
12
|
-
|
|
12
|
+
carrouselImg: MediaCarousel[];
|
|
13
13
|
labelRef?:string|null;
|
|
14
14
|
labelClose?:string|null
|
|
15
15
|
}
|
|
@@ -24,17 +24,17 @@ const dialog = ref<boolean>(false);
|
|
|
24
24
|
|
|
25
25
|
const prevSlide = () => {
|
|
26
26
|
const isFirstSlide = currentIndex.value === 0;
|
|
27
|
-
const newIndex = isFirstSlide ? props.
|
|
27
|
+
const newIndex = isFirstSlide ? props.carrouselImg.length - 1 : currentIndex.value - 1;
|
|
28
28
|
currentIndex.value = newIndex;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
const nextSlide = () => {
|
|
32
|
-
const isTheLastSlide = currentIndex.value === props.
|
|
32
|
+
const isTheLastSlide = currentIndex.value === props.carrouselImg.length - 1;
|
|
33
33
|
const newIndex = isTheLastSlide ? 0 : currentIndex.value + 1;
|
|
34
34
|
currentIndex.value = newIndex;
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
const {
|
|
37
|
+
const { carrouselImg, labelClose, labelRef } = toRefs(props);
|
|
38
38
|
</script>
|
|
39
39
|
|
|
40
40
|
<template>
|
|
@@ -42,7 +42,7 @@ const { images, labelClose, labelRef } = toRefs(props);
|
|
|
42
42
|
<button @click="prevSlide">
|
|
43
43
|
<EpIcon :icon-path="mdiChevronLeftCircleOutline"></EpIcon>
|
|
44
44
|
</button>
|
|
45
|
-
{{ currentIndex + 1 }}/{{
|
|
45
|
+
{{ currentIndex + 1 }}/{{ carrouselImg.length }}
|
|
46
46
|
<button @click="nextSlide">
|
|
47
47
|
<EpIcon :icon-path="mdiChevronRightCircleOutline"></EpIcon>
|
|
48
48
|
</button>
|
|
@@ -51,18 +51,18 @@ const { images, labelClose, labelRef } = toRefs(props);
|
|
|
51
51
|
<div class="max-w-[800px] h-[550px] m-auto relative">
|
|
52
52
|
<div
|
|
53
53
|
class="w-full h-full bg-center bg-cover duration-500"
|
|
54
|
-
:style="`background-image:url('${
|
|
54
|
+
:style="`background-image:url('${carrouselImg[currentIndex].src}')`"
|
|
55
55
|
></div>
|
|
56
56
|
</div>
|
|
57
|
-
<div v-if="
|
|
58
|
-
{{
|
|
57
|
+
<div v-if="carrouselImg[currentIndex]?.caption" class="mt-2 text-sm text-gray-800">
|
|
58
|
+
{{ carrouselImg[currentIndex].caption }}
|
|
59
59
|
</div>
|
|
60
|
-
<div v-if="
|
|
60
|
+
<div v-if="carrouselImg[currentIndex]?.bib" class="flex justify-end">
|
|
61
61
|
<EpBtn type="primary" @click="dialog = true" dark>{{ labelRef }}</EpBtn>
|
|
62
62
|
</div>
|
|
63
63
|
</div>
|
|
64
64
|
<EpModal v-model="dialog" title="Référence">
|
|
65
|
-
<div v-html="
|
|
65
|
+
<div v-html="carrouselImg[currentIndex].bib"></div>
|
|
66
66
|
<div class="flex justify-end">
|
|
67
67
|
<EpBtn @click="dialog = false" type="primary" dark>{{ labelClose }}</EpBtn>
|
|
68
68
|
</div>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { computed, toRefs } from "vue";
|
|
3
3
|
//types with capital letter, object styles in lowercase
|
|
4
4
|
import { MediaVariants } from "../../types/Medias";
|
|
5
|
+
import { MandateLevel } from '../../types/MandateLevel';
|
|
5
6
|
import EpBtn from "../basics/EpBtn.vue";
|
|
6
7
|
import { mdiLinkVariant } from "@mdi/js";
|
|
7
8
|
import EpEdu from "../educationals/EpEdu.vue";
|
|
@@ -13,7 +14,7 @@ interface Props {
|
|
|
13
14
|
href: string;
|
|
14
15
|
label?: string;
|
|
15
16
|
intentions?: string;
|
|
16
|
-
mandateLevel?: string;
|
|
17
|
+
mandateLevel?: string | MandateLevel | null;
|
|
17
18
|
labelIntentions?: string;
|
|
18
19
|
type?: MediaVariants;
|
|
19
20
|
hideIcon?: boolean;
|
|
@@ -5,6 +5,7 @@ import EpBtn from "../basics/EpBtn.vue";
|
|
|
5
5
|
import EpChip from "../basics/EpChip.vue";
|
|
6
6
|
import EpEdu from "../educationals/EpEdu.vue";
|
|
7
7
|
import { MediaVariants } from "../../types/Medias";
|
|
8
|
+
import { MandateLevel } from '../../types/MandateLevel';
|
|
8
9
|
import { useRenderText } from "../../composables/useRenderText";
|
|
9
10
|
|
|
10
11
|
import { mdiLaptop } from "@mdi/js";
|
|
@@ -14,7 +15,7 @@ interface Props {
|
|
|
14
15
|
url?: string;
|
|
15
16
|
cover?: string;
|
|
16
17
|
title: string;
|
|
17
|
-
mandateLevel?:
|
|
18
|
+
mandateLevel?:string | MandateLevel | null;
|
|
18
19
|
intentions?: string;
|
|
19
20
|
version_link?: null;
|
|
20
21
|
hideCover?: boolean;
|
|
@@ -22,7 +23,6 @@ interface Props {
|
|
|
22
23
|
type?:MediaVariants;
|
|
23
24
|
hideIcon?:boolean;
|
|
24
25
|
labelCard?:string;
|
|
25
|
-
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
// type, taxonomyLevel, courseCode, courseTitle, title, subtitle, height, src, color, synchrone
|
|
@@ -46,7 +46,7 @@ const hasCover = computed(() => {
|
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
const { title, intentions, cover, hideCover, version, labelCard, hideIcon, mandateLevel } = toRefs(props);
|
|
49
|
+
const { title, intentions, cover, hideCover, version, labelCard, hideIcon, mandateLevel, url } = toRefs(props);
|
|
50
50
|
</script>
|
|
51
51
|
|
|
52
52
|
<template>
|
|
@@ -76,7 +76,7 @@ const { title, intentions, cover, hideCover, version, labelCard, hideIcon, manda
|
|
|
76
76
|
<div class="w-full px-5">
|
|
77
77
|
<div class="flex justify-between items-center rounded-t-md p-2">
|
|
78
78
|
<h4>{{ title }} <EpChip size="small" type="base" v-if="version">{{version}}</EpChip></h4>
|
|
79
|
-
<EpBtn rounded type="base" :prependIcon="mdiOpenInNew"
|
|
79
|
+
<EpBtn v-if="url" rounded type="base" :prependIcon="mdiOpenInNew" :href="url"
|
|
80
80
|
>[Accéder au logiciel]</EpBtn
|
|
81
81
|
>
|
|
82
82
|
</div>
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
import {ref, computed, toRefs} from 'vue'
|
|
3
3
|
//types with capital letter, object styles in lowercase
|
|
4
4
|
import { MediaVariants } from "../../types/Medias";
|
|
5
|
+
import { MandateLevel } from '../../types/MandateLevel';
|
|
5
6
|
import { isHtml } from '../../composables/isHtml';
|
|
6
7
|
import {useMarkdown} from '../../composables/useMarkdown'
|
|
7
8
|
import { mdiVideo } from "@mdi/js";
|
|
9
|
+
|
|
8
10
|
//import { useMediaControls } from '@vueuse/core'
|
|
9
11
|
import EpEdu from '../educationals/EpEdu.vue'
|
|
10
12
|
|
|
@@ -13,7 +15,7 @@ interface Props{
|
|
|
13
15
|
title?:string;
|
|
14
16
|
intentions?:string;
|
|
15
17
|
credits?:string;
|
|
16
|
-
mandateLevel?:string | null;
|
|
18
|
+
mandateLevel?:string | MandateLevel | null;
|
|
17
19
|
labelIntentions?:string;
|
|
18
20
|
type?:MediaVariants;
|
|
19
21
|
hideIcon?:boolean;
|
|
@@ -40,6 +42,9 @@ const vimeoUrl = computed(()=> {
|
|
|
40
42
|
if(!isVideoFormat.value && url.includes("https://vimeo.com/")){
|
|
41
43
|
return url.replace("https://vimeo.com/", "https://player.vimeo.com/video/")
|
|
42
44
|
}
|
|
45
|
+
if(!isVideoFormat.value && url.includes('https://www.youtube.com/watch?')){
|
|
46
|
+
return url.replace("https://www.youtube.com/watch?v=","https://www.youtube.com/embed/")
|
|
47
|
+
}
|
|
43
48
|
return url
|
|
44
49
|
})
|
|
45
50
|
|
|
@@ -59,10 +64,9 @@ const {src, title, hideIcon, type} = toRefs(props)
|
|
|
59
64
|
</script>
|
|
60
65
|
|
|
61
66
|
<template>
|
|
62
|
-
|
|
63
67
|
<EpEdu :title="title" :type="type" :hideIcon="hideIcon" :icon="mdiVideo" :mandateLevel="mandateLevel">
|
|
64
68
|
<template #intentions v-if="renderText">
|
|
65
|
-
<div v-html="renderText"
|
|
69
|
+
<div v-html="renderText"></div>
|
|
66
70
|
</template>
|
|
67
71
|
<template #content>
|
|
68
72
|
<div class="max-w-screen-sm mx-auto">
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { computed, toRefs} from 'vue'
|
|
3
3
|
//types with capital letter, object styles in lowercase
|
|
4
4
|
import { MediaVariants } from "../../types/Medias";
|
|
5
|
+
import { MandateLevel } from '../../types/MandateLevel';
|
|
5
6
|
import { isHtml } from '../../composables/isHtml';
|
|
6
7
|
import {useMarkdown} from '../../composables/useMarkdown'
|
|
7
8
|
import { mdiVideo } from "@mdi/js";
|
|
@@ -13,7 +14,7 @@ interface Props{
|
|
|
13
14
|
title?:string;
|
|
14
15
|
intentions?:string;
|
|
15
16
|
credits?:string;
|
|
16
|
-
mandateLevel?:string | null;
|
|
17
|
+
mandateLevel?:string | MandateLevel | null;
|
|
17
18
|
labelIntentions?:string;
|
|
18
19
|
type?:MediaVariants;
|
|
19
20
|
hideIcon?:boolean;
|
|
@@ -7,8 +7,15 @@ import EpAccordeon from "../interactions/EpAccordeon.vue";
|
|
|
7
7
|
import { TypeAlert, typeAlert } from "../../types/Alert";
|
|
8
8
|
import {useIcons} from '../../composables/useIcons'
|
|
9
9
|
|
|
10
|
+
interface OldType {
|
|
11
|
+
icon: string;
|
|
12
|
+
name: string;
|
|
13
|
+
type: TypeAlert;
|
|
14
|
+
color: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
10
17
|
interface Props {
|
|
11
|
-
type?:TypeAlert;
|
|
18
|
+
type?:TypeAlert|OldType;
|
|
12
19
|
title?: string | null;
|
|
13
20
|
outlined?:boolean;
|
|
14
21
|
noIcon?:boolean;
|
|
@@ -29,12 +36,20 @@ const isOutlined = computed(()=>{
|
|
|
29
36
|
return 'default'
|
|
30
37
|
})
|
|
31
38
|
|
|
39
|
+
// to change after change bd strapi v4
|
|
40
|
+
const finalType = computed(()=>{
|
|
41
|
+
if(typeof props.type === 'object'){
|
|
42
|
+
return props.type.type
|
|
43
|
+
}
|
|
44
|
+
return props.type
|
|
45
|
+
})
|
|
46
|
+
|
|
32
47
|
const styles = computed(()=>{
|
|
33
|
-
return `${typeAlert[
|
|
48
|
+
return `${typeAlert[finalType.value]?.[isOutlined.value]}`
|
|
34
49
|
})
|
|
35
50
|
|
|
36
51
|
const icon = computed(()=>{
|
|
37
|
-
let icon = useIcons[
|
|
52
|
+
let icon = useIcons[finalType.value].icon
|
|
38
53
|
if(props.noIcon){
|
|
39
54
|
return null
|
|
40
55
|
}
|
|
@@ -59,7 +74,7 @@ const { title, compact, type, outlined } = toRefs(props);
|
|
|
59
74
|
</div>
|
|
60
75
|
</div>
|
|
61
76
|
</div>
|
|
62
|
-
<EpAccordeon :type="
|
|
77
|
+
<EpAccordeon :type="finalType" :outlined="outlined" :icon="icon" :title="title" v-else>
|
|
63
78
|
<slot></slot>
|
|
64
79
|
</EpAccordeon>
|
|
65
80
|
</template>
|
|
@@ -1,45 +1,49 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {toRefs} from 'vue'
|
|
2
|
+
import {toRefs, computed} from 'vue'
|
|
3
3
|
import EpCard from "../basics/EpCard.vue";
|
|
4
4
|
import EpDivider from "../basics/EpDivider.vue";
|
|
5
|
-
|
|
6
|
-
import useColors from "../../composables/useColors";
|
|
7
|
-
import { mdiFormatQuoteOpen } from "@mdi/js";
|
|
8
|
-
import { mdiFormatQuoteClose } from '@mdi/js';
|
|
5
|
+
|
|
9
6
|
|
|
10
7
|
interface Props {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
author?:string | null;
|
|
9
|
+
img?:string | null;
|
|
10
|
+
card?:boolean;
|
|
14
11
|
}
|
|
15
12
|
|
|
16
13
|
const props = withDefaults(defineProps<Props>(), {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
author:null,
|
|
15
|
+
img:null,
|
|
16
|
+
card:false
|
|
20
17
|
})
|
|
21
18
|
|
|
22
|
-
const {
|
|
19
|
+
const {author, img} = toRefs(props)
|
|
20
|
+
|
|
21
|
+
const styleQuote = computed(()=> {
|
|
22
|
+
if(props.card) {
|
|
23
|
+
return `primary`
|
|
24
|
+
}
|
|
25
|
+
return ``
|
|
26
|
+
})
|
|
23
27
|
|
|
24
28
|
</script>
|
|
25
29
|
|
|
26
30
|
<template>
|
|
27
|
-
<EpCard density="compact">
|
|
31
|
+
<EpCard density="compact" :color="styleQuote" outlined>
|
|
28
32
|
<div
|
|
29
|
-
class="flex flex-wrap rounded-
|
|
33
|
+
class="flex flex-wrap rounded-md bg-white"
|
|
30
34
|
>
|
|
31
35
|
<img
|
|
32
|
-
v-if="
|
|
33
|
-
class="h-96 w-full rounded-t-
|
|
34
|
-
:src="
|
|
36
|
+
v-if="img"
|
|
37
|
+
class="h-96 w-full rounded-t-md object-cover lg:h-auto lg:w-48 lg:rounded-none lg:rounded-l-md"
|
|
38
|
+
:src="img"
|
|
35
39
|
alt="Image of quote"
|
|
36
40
|
/>
|
|
37
41
|
<div class="p-6 flex-1">
|
|
38
42
|
<slot></slot>
|
|
39
|
-
<template v-if="
|
|
43
|
+
<template v-if="author">
|
|
40
44
|
<EpDivider size="border"></EpDivider>
|
|
41
45
|
<p class="text-xs italic text-neutral-500">
|
|
42
|
-
{{
|
|
46
|
+
{{ author }}
|
|
43
47
|
</p>
|
|
44
48
|
</template>
|
|
45
49
|
</div>
|