ep-lib-ts 0.1.37 → 0.1.39
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-ee6be0f3.js → BgAudio-16fee83c.js} +1 -1
- package/dist/{DisplayBox-867d56fb.js → DisplayBox-73015033.js} +1 -1
- package/dist/{EpAlert-e0ad680d.js → EpAlert-2c844554.js} +1 -1
- package/dist/{EpAudio-f9836de7.js → EpAudio-2003d5e8.js} +1 -1
- package/dist/EpBadge-27f2474f.js +6 -0
- package/dist/{EpBarChart-84b69362.js → EpBarChart-48ff491a.js} +1 -1
- package/dist/EpBtn-7b078900.js +6 -0
- package/dist/EpCard-0aee22e8.js +6 -0
- package/dist/EpChip-2a8503d3.js +6 -0
- package/dist/EpContentSlider-40cc6a2b.js +6 -0
- package/dist/EpDivider-ed395bc5.js +6 -0
- package/dist/{EpEdu-582f809e.js → EpEdu-10122e1e.js} +1 -1
- package/dist/EpFlex-424687b3.js +6 -0
- package/dist/EpHeader-3d1641ed.js +6 -0
- package/dist/{EpIcon-d4dc0ecb.js → EpIcon-31d00f5e.js} +1 -1
- package/dist/EpIframe-a97b631a.js +6 -0
- package/dist/EpImg-222224c2.js +6 -0
- package/dist/{EpInput-afe43604.js → EpInput-2aa86f26.js} +1 -1
- package/dist/EpLineChart-16958459.js +6 -0
- package/dist/EpLink-004ed0a4.js +6 -0
- package/dist/EpLinkVersion-a34e1d57.js +6 -0
- package/dist/{EpList-2efcfcfb.js → EpList-d0d800c9.js} +1 -1
- package/dist/EpModal-b6942706.js +6 -0
- package/dist/{EpNothing-33d89c4c.js → EpNothing-bd698aea.js} +1 -1
- package/dist/EpPieChart-5497dd48.js +6 -0
- package/dist/EpQuestion-a7bb2ab2.js +6 -0
- package/dist/EpQuote-71b5b4c7.js +6 -0
- package/dist/EpRadio-3517e7a5.js +6 -0
- package/dist/EpReading-f2375e7c.js +6 -0
- package/dist/EpResource-7ad9996a.js +6 -0
- package/dist/{EpScope-44628aad.js → EpScope-3d25b2df.js} +1 -1
- package/dist/EpSection-b8709b04.js +6 -0
- package/dist/{EpSelect-46fcb799.js → EpSelect-65ad210c.js} +1 -1
- package/dist/EpSkeleton-3d3384fe.js +6 -0
- package/dist/EpSoftware-13fac4e9.js +6 -0
- package/dist/EpSpinner-cdc9f6f7.js +6 -0
- package/dist/EpSvg-9985e445.js +6 -0
- package/dist/EpTable-e7613a98.js +6 -0
- package/dist/EpTerm-e818059c.js +6 -0
- package/dist/EpText-44f21440.js +6 -0
- package/dist/EpTimeLine-0961d89d.js +6 -0
- package/dist/EpVideo-34c7f788.js +6 -0
- package/dist/EpVideoPanopto-53f86982.js +6 -0
- package/dist/EpWordDef-70e01746.js +81 -0
- package/dist/components/charts/EpBarChart.vue.d.ts +4 -0
- package/dist/components/charts/EpLineChart.vue.d.ts +4 -0
- package/dist/components/charts/EpPieChart.vue.d.ts +4 -0
- package/dist/components/medias/EpWordDef.vue.d.ts +29 -0
- package/dist/ep-lib-ts.js +11 -11
- package/dist/ep-lib-ts.umd.cjs +36 -36
- package/dist/{index-cdaa9a08.js → index-972bbed8.js} +3729 -3684
- package/dist/types/GlossaryEntry.d.ts +10 -0
- package/package.json +2 -2
- package/src/components/basics/EpImg.vue +4 -3
- package/src/components/charts/EpBarChart.vue +5 -3
- package/src/components/charts/EpLineChart.vue +5 -3
- package/src/components/charts/EpPieChart.vue +6 -4
- package/src/components/educationals/EpResource.vue +0 -1
- package/src/components/interactions/EpContentSlider.vue +50 -30
- package/src/components/interactions/EpQuestion.vue +4 -4
- package/src/components/medias/EpVideo.vue +16 -3
- package/src/components/medias/EpWordDef.vue +116 -0
- package/src/components/signages/EpQuote.vue +10 -9
- package/dist/EpBadge-4e59ef7c.js +0 -6
- package/dist/EpBtn-5e8f86bf.js +0 -6
- package/dist/EpCard-7e3ed4a4.js +0 -6
- package/dist/EpChip-dc954589.js +0 -6
- package/dist/EpContentSlider-cb03f3e9.js +0 -6
- package/dist/EpDivider-7678be0c.js +0 -6
- package/dist/EpFlex-f1971347.js +0 -6
- package/dist/EpHeader-78726a42.js +0 -6
- package/dist/EpIframe-c1e28504.js +0 -6
- package/dist/EpImg-c1483410.js +0 -6
- package/dist/EpLineChart-9fc01457.js +0 -6
- package/dist/EpLink-4a639047.js +0 -6
- package/dist/EpLinkVersion-8200767b.js +0 -6
- package/dist/EpModal-30b4a013.js +0 -6
- package/dist/EpPieChart-0059d199.js +0 -6
- package/dist/EpQuestion-37e61b97.js +0 -6
- package/dist/EpQuote-4d749894.js +0 -6
- package/dist/EpRadio-2a23d115.js +0 -6
- package/dist/EpReading-3ebe66a8.js +0 -6
- package/dist/EpResource-c6ccc660.js +0 -6
- package/dist/EpSection-840524bf.js +0 -6
- package/dist/EpSkeleton-1067e7d2.js +0 -6
- package/dist/EpSoftware-7b6c561f.js +0 -6
- package/dist/EpSpinner-0e8ac388.js +0 -6
- package/dist/EpSvg-cf5106d4.js +0 -6
- package/dist/EpTable-639de0ff.js +0 -6
- package/dist/EpTerm-28f932c3.js +0 -6
- package/dist/EpText-ee0d1c44.js +0 -6
- package/dist/EpTimeLine-7b1db15d.js +0 -6
- package/dist/EpVideo-36737f59.js +0 -6
- package/dist/EpVideoPanopto-c23c232f.js +0 -6
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ep-lib-ts",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.39",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
7
7
|
"src/components/"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"typescript": "^5.2.0-dev.20230801",
|
|
51
51
|
"vite": "^4.1.0",
|
|
52
52
|
"vite-plugin-dts": "^3.5.2",
|
|
53
|
-
"vue-tsc": "^1.8.
|
|
53
|
+
"vue-tsc": "^1.8.27"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"vue": "^3.2.45"
|
|
@@ -77,8 +77,8 @@ const { src, alt, title, caption, thumbnail, bib, noModal } = toRefs(props)
|
|
|
77
77
|
</script>
|
|
78
78
|
|
|
79
79
|
<template>
|
|
80
|
-
<div>
|
|
81
|
-
<div v-if="!thumbnail" class="flex">
|
|
80
|
+
<div :class="thumbnail?'inline-block':''">
|
|
81
|
+
<div v-if="!thumbnail" class="flex m-2">
|
|
82
82
|
<div :class="`mx-auto bg-white rounded-md overflow-hidden shadow-md ${renderCols}`">
|
|
83
83
|
<template v-if="isLoading">
|
|
84
84
|
<span class="text-gray-200"><EpIcon :icon-path="mdiImage" size="250"></EpIcon></span>
|
|
@@ -107,12 +107,13 @@ const { src, alt, title, caption, thumbnail, bib, noModal } = toRefs(props)
|
|
|
107
107
|
</div>
|
|
108
108
|
</div>
|
|
109
109
|
<EpModal v-model="showModal">
|
|
110
|
-
<img class="object-cover object-center h-5/6 w-5/6 mx-auto" :src="src" :alt="alt" @click="toggleModal"
|
|
110
|
+
<img class="object-cover object-center h-5/6 w-5/6 mx-auto" :src="src" :alt="alt" @click="toggleModal"/>
|
|
111
111
|
<div class="px-4 py-2" v-if="thumbnail">
|
|
112
112
|
<h2 class="text-2xl font-bold">{{ title }}</h2>
|
|
113
113
|
<p class="text-gray-500 text-sm mt-4">{{ caption }}</p>
|
|
114
114
|
<div class="text-gray-700 mt-4" v-html="renderBib"></div>
|
|
115
115
|
</div>
|
|
116
|
+
<!-- <div class="flex justify-end"><EpBtn @click="toggleModal" size="small" type="error" outlined>Fermer</EpBtn></div> -->
|
|
116
117
|
</EpModal>
|
|
117
118
|
<EpModal v-model="showBib" title="Référence bibliographique">
|
|
118
119
|
|
|
@@ -31,10 +31,12 @@ interface Props {
|
|
|
31
31
|
type?: MediaVariants;
|
|
32
32
|
mandateLevel?: string | null;
|
|
33
33
|
source?:string;
|
|
34
|
+
width?:string
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
const props = withDefaults(defineProps<Props>(), {
|
|
37
|
-
center:
|
|
38
|
+
center: true,
|
|
39
|
+
width:"500"
|
|
38
40
|
});
|
|
39
41
|
|
|
40
42
|
const renderText = computed(() => {
|
|
@@ -56,7 +58,7 @@ const globalOptions = computed(() => {
|
|
|
56
58
|
}
|
|
57
59
|
})
|
|
58
60
|
|
|
59
|
-
const { center, series, source } = toRefs(props)
|
|
61
|
+
const { center, series, source, width } = toRefs(props)
|
|
60
62
|
|
|
61
63
|
</script>
|
|
62
64
|
|
|
@@ -67,7 +69,7 @@ const { center, series, source } = toRefs(props)
|
|
|
67
69
|
</template>
|
|
68
70
|
<template #content>
|
|
69
71
|
<div :class="`p-4 ${center ? 'flex justify-center' : ''}`" v-if="globalOptions && series">
|
|
70
|
-
<apexchart width="
|
|
72
|
+
<apexchart :width="width" type="bar" :options="globalOptions" :series="series"></apexchart>
|
|
71
73
|
</div>
|
|
72
74
|
<div v-else>
|
|
73
75
|
<p>Data no disponible</p>
|
|
@@ -30,10 +30,12 @@ interface Props {
|
|
|
30
30
|
type?: MediaVariants;
|
|
31
31
|
mandateLevel?: string | null;
|
|
32
32
|
source?: string;
|
|
33
|
+
width?:string
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
const props = withDefaults(defineProps<Props>(), {
|
|
36
|
-
center:
|
|
37
|
+
center: true,
|
|
38
|
+
width:"500"
|
|
37
39
|
});
|
|
38
40
|
|
|
39
41
|
const renderText = computed(() => {
|
|
@@ -65,7 +67,7 @@ const globalOptions = computed(() => {
|
|
|
65
67
|
}
|
|
66
68
|
})
|
|
67
69
|
|
|
68
|
-
const { center, series, source } = toRefs(props)
|
|
70
|
+
const { center, series, source, width} = toRefs(props)
|
|
69
71
|
|
|
70
72
|
</script>
|
|
71
73
|
|
|
@@ -76,7 +78,7 @@ const { center, series, source } = toRefs(props)
|
|
|
76
78
|
</template>
|
|
77
79
|
<template #content>
|
|
78
80
|
<div :class="`p-4 ${center ? 'flex justify-center' : ''}`" v-if="globalOptions && series">
|
|
79
|
-
<apexchart width="
|
|
81
|
+
<apexchart :width="width" type="line" :options="globalOptions" :series="series"></apexchart>
|
|
80
82
|
</div>
|
|
81
83
|
<div v-else>
|
|
82
84
|
<p>Data no disponible</p>
|
|
@@ -32,11 +32,13 @@ interface Props {
|
|
|
32
32
|
type?: MediaVariants;
|
|
33
33
|
mandateLevel?: string | null;
|
|
34
34
|
source?: string;
|
|
35
|
+
width?:string
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
const props = withDefaults(defineProps<Props>(), {
|
|
38
|
-
center:
|
|
39
|
-
type:'base'
|
|
39
|
+
center: true,
|
|
40
|
+
type:'base',
|
|
41
|
+
width:"450"
|
|
40
42
|
});
|
|
41
43
|
|
|
42
44
|
|
|
@@ -52,7 +54,7 @@ const renderText = computed(() => {
|
|
|
52
54
|
|
|
53
55
|
|
|
54
56
|
|
|
55
|
-
const { center, series, source, options } = toRefs(props)
|
|
57
|
+
const { center, series, source, options, width } = toRefs(props)
|
|
56
58
|
|
|
57
59
|
</script>
|
|
58
60
|
|
|
@@ -64,7 +66,7 @@ const { center, series, source, options } = toRefs(props)
|
|
|
64
66
|
</template>
|
|
65
67
|
<template #content>
|
|
66
68
|
<div :class="`p-4 ${center ? 'flex justify-center' : ''}`" v-if="options && series">
|
|
67
|
-
<apexchart width="
|
|
69
|
+
<apexchart :width="width" type="pie" :options="options" :series="series"></apexchart>
|
|
68
70
|
</div>
|
|
69
71
|
<div v-else>
|
|
70
72
|
<p>Data no disponible</p>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { ref, computed, defineAsyncComponent, toRefs } from "vue";
|
|
3
|
-
import {SlidesType} from "../../types/Slides"
|
|
2
|
+
import { ref, computed, defineAsyncComponent, toRefs, Suspense } from "vue";
|
|
3
|
+
import { SlidesType } from "../../types/Slides"
|
|
4
4
|
import { useComponent } from "../../composables/useComponent";
|
|
5
5
|
import { useRenderText } from "../../composables/useRenderText";
|
|
6
6
|
import { mdiArrowLeft } from "@mdi/js";
|
|
@@ -9,7 +9,7 @@ import EpIcon from "../basics/EpIcon.vue";
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
interface Props {
|
|
12
|
-
|
|
12
|
+
slides: SlidesType[];
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
const props = withDefaults(defineProps<Props>(), {})
|
|
@@ -18,45 +18,49 @@ const props = withDefaults(defineProps<Props>(), {})
|
|
|
18
18
|
const currentIndex = ref<number>(0)
|
|
19
19
|
|
|
20
20
|
const currentSlide = computed(() => {
|
|
21
|
-
if(!props.slides){
|
|
22
|
-
return {title:'no data',
|
|
21
|
+
if (!props.slides) {
|
|
22
|
+
return { title: 'no data', img: '', uid: 2, content: "" }
|
|
23
23
|
}
|
|
24
|
-
if(props.slides.length === 0) {
|
|
25
|
-
return {title:'no data',
|
|
24
|
+
if (props.slides.length === 0) {
|
|
25
|
+
return { title: 'no data', img: '', uid: 2, content: "" }
|
|
26
26
|
}
|
|
27
27
|
return props.slides[currentIndex.value]
|
|
28
28
|
})
|
|
29
29
|
|
|
30
|
+
const hasTextContent = computed(() => {
|
|
31
|
+
return currentSlide.value.content.trim().length > 0
|
|
32
|
+
})
|
|
33
|
+
|
|
30
34
|
const currentSlideMediaContent = computed(() => {
|
|
31
35
|
if (currentSlide.value.img) {
|
|
32
36
|
return defineAsyncComponent(() => import('../basics/EpImg.vue'))
|
|
33
37
|
}
|
|
34
|
-
if(currentSlide.value.component){
|
|
38
|
+
if (currentSlide.value.component) {
|
|
35
39
|
const componentToLoad = useComponent(currentSlide.value.component?.type)
|
|
36
|
-
return defineAsyncComponent(()=>import(`../${componentToLoad.path}/${componentToLoad.name}.vue`))
|
|
40
|
+
return defineAsyncComponent(() => import(`../${componentToLoad.path}/${componentToLoad.name}.vue`))
|
|
37
41
|
}
|
|
38
42
|
return null
|
|
39
43
|
})
|
|
40
44
|
|
|
41
|
-
const max = computed(()=> (currentIndex.value+1) < props.slides.length)
|
|
42
|
-
const min = computed(()=> (currentIndex.value+1) > 1)
|
|
45
|
+
const max = computed(() => (currentIndex.value + 1) < props.slides.length)
|
|
46
|
+
const min = computed(() => (currentIndex.value + 1) > 1)
|
|
43
47
|
const next = () => {
|
|
44
|
-
if(max.value){
|
|
48
|
+
if (max.value) {
|
|
45
49
|
currentIndex.value += 1
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
|
|
49
53
|
const prev = () => {
|
|
50
|
-
if(min.value){
|
|
54
|
+
if (min.value) {
|
|
51
55
|
currentIndex.value -= 1
|
|
52
56
|
}
|
|
53
57
|
}
|
|
54
58
|
|
|
55
|
-
const goTo = (index:number) =>{
|
|
59
|
+
const goTo = (index: number) => {
|
|
56
60
|
currentIndex.value = index
|
|
57
61
|
}
|
|
58
62
|
|
|
59
|
-
const {slides} = toRefs(props)
|
|
63
|
+
const { slides } = toRefs(props)
|
|
60
64
|
|
|
61
65
|
</script>
|
|
62
66
|
|
|
@@ -67,27 +71,42 @@ const {slides} = toRefs(props)
|
|
|
67
71
|
{{ currentSlide.title }}
|
|
68
72
|
</h5>
|
|
69
73
|
<div class="md:flex items-end pb-1" v-if="slides">
|
|
70
|
-
|
|
71
|
-
<span
|
|
74
|
+
<template v-for="(slide, i) in slides.length" :key="`slide-index-${i}`">
|
|
75
|
+
<span
|
|
76
|
+
:class="`cursor-pointer h-4 w-4 ml-1 inline-block ${i === currentIndex ? 'bg-primary' : 'bg-gray-400'}`"
|
|
77
|
+
@click="goTo(i)"></span>
|
|
72
78
|
</template>
|
|
73
|
-
<span class="ml-2 text-xs">({{(currentIndex+1)}}/{{ slides.length }})</span>
|
|
74
|
-
<button :class="`px-2 ${min?'':'opacity-5'}`" @click="prev">
|
|
79
|
+
<span class="ml-2 text-xs">({{ (currentIndex + 1) }}/{{ slides.length }})</span>
|
|
80
|
+
<button :class="`px-2 ${min ? '' : 'opacity-5'}`" @click="prev">
|
|
75
81
|
<EpIcon :icon-path="mdiArrowLeft" size="24"></EpIcon>
|
|
76
82
|
</button>
|
|
77
|
-
<button :class="`mx-2 ${max?'':'opacity-5'}`" @click="next">
|
|
83
|
+
<button :class="`mx-2 ${max ? '' : 'opacity-5'}`" @click="next">
|
|
78
84
|
<EpIcon :icon-path="mdiArrowRight" size="24"></EpIcon>
|
|
79
85
|
</button>
|
|
80
86
|
</div>
|
|
81
87
|
</div>
|
|
82
88
|
<div class="">
|
|
83
89
|
<Transition name="list" mode="out-in">
|
|
84
|
-
<div class="md:flex p-
|
|
85
|
-
<div class="w-full mr-5
|
|
86
|
-
<
|
|
87
|
-
|
|
90
|
+
<div class="md:flex p-4" :key="currentSlide.uid">
|
|
91
|
+
<div :class="`w-full ${hasTextContent ? 'mr-5' : ''}`" v-if="currentSlideMediaContent">
|
|
92
|
+
<div v-if="currentSlide.img" class="p-4">
|
|
93
|
+
<component :is="currentSlideMediaContent" :src="currentSlide.img" cols="11"></component>
|
|
94
|
+
</div>
|
|
95
|
+
<div v-else-if="currentSlide.component">
|
|
96
|
+
<Suspense>
|
|
97
|
+
|
|
98
|
+
<component :is="currentSlideMediaContent" v-bind="{ ...currentSlide.component.data }">
|
|
99
|
+
</component>
|
|
100
|
+
<template #fallback>
|
|
101
|
+
...loading
|
|
102
|
+
</template>
|
|
103
|
+
</Suspense>
|
|
104
|
+
|
|
105
|
+
</div>
|
|
106
|
+
|
|
88
107
|
</div>
|
|
89
|
-
<div class="w-full">
|
|
90
|
-
|
|
108
|
+
<div class="w-full pt-4" v-if="hasTextContent">
|
|
109
|
+
<div class="overflow-y-auto h-96 p-custom" v-html="useRenderText(currentSlide.content)"></div>
|
|
91
110
|
</div>
|
|
92
111
|
</div>
|
|
93
112
|
</Transition>
|
|
@@ -105,12 +124,13 @@ const {slides} = toRefs(props)
|
|
|
105
124
|
opacity: 0;
|
|
106
125
|
transform: translateX(30px);
|
|
107
126
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
127
|
+
|
|
128
|
+
.h-custom {
|
|
129
|
+
height: 30rem;
|
|
130
|
+
}
|
|
111
131
|
|
|
112
132
|
.p-custom p {
|
|
113
|
-
margin-bottom:1em;
|
|
133
|
+
margin-bottom: 1em;
|
|
114
134
|
}
|
|
115
135
|
</style>
|
|
116
136
|
|
|
@@ -31,7 +31,7 @@ interface Props {
|
|
|
31
31
|
const props = withDefaults(defineProps<Props>(), {
|
|
32
32
|
type: "base",
|
|
33
33
|
hideIcon: false,
|
|
34
|
-
shuffle:
|
|
34
|
+
shuffle: false,
|
|
35
35
|
before: false,
|
|
36
36
|
numeration: false,
|
|
37
37
|
});
|
|
@@ -138,7 +138,7 @@ const { title, intentions, hideIcon, question, src } = toRefs(props);
|
|
|
138
138
|
|
|
139
139
|
<div class="mb-6">
|
|
140
140
|
<ol class="no-list">
|
|
141
|
-
<li v-for="(answer, i) in
|
|
141
|
+
<li v-for="(answer, i) in shuffleAnswers" :key="answer.uid">
|
|
142
142
|
<EpRadio
|
|
143
143
|
:label="`${typeList(i)}. ${answer.text}`"
|
|
144
144
|
v-model="userAnswer"
|
|
@@ -152,12 +152,12 @@ const { title, intentions, hideIcon, question, src } = toRefs(props);
|
|
|
152
152
|
</EpAlert>
|
|
153
153
|
</div>
|
|
154
154
|
|
|
155
|
-
<div v-if="answered">
|
|
155
|
+
<div v-if="answered" class="mb-2">
|
|
156
156
|
<EpAlert :type="response.type" outlined>
|
|
157
157
|
<div v-html="useRenderText(response.feedback)"></div>
|
|
158
158
|
</EpAlert>
|
|
159
159
|
|
|
160
|
-
<div v-if="response.component">
|
|
160
|
+
<div v-if="response.component" class="my-2">
|
|
161
161
|
<component :is="getCompontent(response.component.type)" v-bind="{ ...response.component.data }"></component>
|
|
162
162
|
</div>
|
|
163
163
|
</div>
|
|
@@ -37,7 +37,7 @@ const isVideoFormat = computed(()=>{
|
|
|
37
37
|
return false
|
|
38
38
|
})
|
|
39
39
|
|
|
40
|
-
const
|
|
40
|
+
const videoURL = computed(()=> {
|
|
41
41
|
const url = props.src
|
|
42
42
|
if(!isVideoFormat.value && url.includes("https://vimeo.com/")){
|
|
43
43
|
return url.replace("https://vimeo.com/", "https://player.vimeo.com/video/")
|
|
@@ -45,6 +45,13 @@ const vimeoUrl = computed(()=> {
|
|
|
45
45
|
if(!isVideoFormat.value && url.includes('https://www.youtube.com/watch?')){
|
|
46
46
|
return url.replace("https://www.youtube.com/watch?v=","https://www.youtube.com/embed/")
|
|
47
47
|
}
|
|
48
|
+
//extra to short url youtube
|
|
49
|
+
if(!isVideoFormat.value && url.includes('https://youtu.be/')){
|
|
50
|
+
const id = getIdYoutube(url)
|
|
51
|
+
if(id){
|
|
52
|
+
return `https://www.youtube.com/embed/${id}`
|
|
53
|
+
}
|
|
54
|
+
}
|
|
48
55
|
return url
|
|
49
56
|
})
|
|
50
57
|
|
|
@@ -57,6 +64,12 @@ const renderText = computed(()=>{
|
|
|
57
64
|
}
|
|
58
65
|
return props.intentions
|
|
59
66
|
})
|
|
67
|
+
|
|
68
|
+
const getIdYoutube = (url:string):string|null => {
|
|
69
|
+
const match = url.match(/\/([^\/]+)$/);
|
|
70
|
+
return match ? match[1]:null
|
|
71
|
+
}
|
|
72
|
+
|
|
60
73
|
//controls
|
|
61
74
|
//const controls = useMediaControls(video, {src:props.src})
|
|
62
75
|
const {src, title, hideIcon, type} = toRefs(props)
|
|
@@ -71,8 +84,8 @@ const {src, title, hideIcon, type} = toRefs(props)
|
|
|
71
84
|
<template #content>
|
|
72
85
|
<div class="max-w-screen-sm mx-auto">
|
|
73
86
|
<video v-if="isVideoFormat" ref="video" controls :src="src" width="640" controlsList="nodownload"></video>
|
|
74
|
-
<iframe v-else :src="
|
|
75
|
-
|
|
87
|
+
<iframe v-else :src="videoURL" width="100%" height="360" frameborder="0" allowfullscreen></iframe>
|
|
88
|
+
</div>
|
|
76
89
|
</template>
|
|
77
90
|
<!-- <template #actions>
|
|
78
91
|
<EpBtn :color="type=='base'?'text-gray-700':'text-white'" :type="type">[Repair btn style... to change]</EpBtn>
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue';
|
|
3
|
+
import { GlossaryEntry } from '../../types/GlossaryEntry';
|
|
4
|
+
import { useRenderText } from '../../composables/useRenderText';
|
|
5
|
+
import { useRouter } from "vue-router";
|
|
6
|
+
|
|
7
|
+
interface Term {
|
|
8
|
+
term: {
|
|
9
|
+
id: string
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface Props {
|
|
14
|
+
word: Term;
|
|
15
|
+
glossary: GlossaryEntry[]
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const props = withDefaults(defineProps<Props>(), {});
|
|
19
|
+
|
|
20
|
+
const definition = computed(() => {
|
|
21
|
+
return props.glossary.find(item => item.id === props.word.term.id)
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const sizeGramIngo = computed(() => {
|
|
25
|
+
if (definition.value) {
|
|
26
|
+
return definition.value.domain || definition.value.variation.length > 0 ? 'w-1/3' : 'w-full'
|
|
27
|
+
}
|
|
28
|
+
return ''
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
const sizeDomain = computed(() => {
|
|
32
|
+
if (definition.value) {
|
|
33
|
+
return definition.value.variation.length > 0 ? 'w-1/4' : 'w-3/4'
|
|
34
|
+
}
|
|
35
|
+
return ''
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
const sizeVariations = computed(() => {
|
|
39
|
+
if (definition.value) {
|
|
40
|
+
return definition.value.domain ? 'w-2/4' : 'w-3/4'
|
|
41
|
+
}
|
|
42
|
+
return ''
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
const findRelations = (relations: string[]): { id: number | string, term: string }[] => {
|
|
46
|
+
let _relations = props.glossary.filter((term) => {
|
|
47
|
+
return relations.some((x) => {
|
|
48
|
+
return term.id === x;
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
return _relations.map((x) => ({id:x.id, term:x.term}));
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const router = useRouter()
|
|
55
|
+
const goto = (term:string) =>{
|
|
56
|
+
if(router.hasRoute('glossary')){
|
|
57
|
+
router.push({ path: "/glossary", query:{word:term} });
|
|
58
|
+
}
|
|
59
|
+
//console.log(router.hasRoute('signages'))
|
|
60
|
+
//
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<template>
|
|
66
|
+
<div>
|
|
67
|
+
<div v-if="definition">
|
|
68
|
+
<div class="h-min border border-stone-300 rounded-lg divide-y">
|
|
69
|
+
<h2 class="text-xl font-semibold p-2">{{ definition.term }}</h2>
|
|
70
|
+
<div class="flex justify-between">
|
|
71
|
+
<div :class="sizeGramIngo">
|
|
72
|
+
<p class="text-sm font-medium bg-stone-100 p-2">
|
|
73
|
+
Information grammaticale
|
|
74
|
+
</p>
|
|
75
|
+
<div class="px-2 py-1">{{ definition.graminfo }}</div>
|
|
76
|
+
</div>
|
|
77
|
+
<div :class="sizeDomain" v-if="definition.domain">
|
|
78
|
+
<p class="text-sm font-medium bg-stone-100 p-2">Domaine</p>
|
|
79
|
+
<div class="px-2 py-1">{{ definition.domain }}</div>
|
|
80
|
+
</div>
|
|
81
|
+
<div :class="sizeVariations" v-if="definition.variation.length > 0">
|
|
82
|
+
<p class="text-sm font-medium bg-stone-100 p-2">Variation(s)</p>
|
|
83
|
+
<div class="px-2 py-1">
|
|
84
|
+
<span v-for="(variation, i) in definition.variation" :key="`v-${i}`">{{ variation }}{{
|
|
85
|
+
definition.variation.length > i + 1 ? ", " :
|
|
86
|
+
"." }}</span>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
<template v-if="!definition.img">
|
|
91
|
+
<div class="px-2 py-6" v-html="useRenderText(definition.definition)"></div>
|
|
92
|
+
</template>
|
|
93
|
+
<template v-else>
|
|
94
|
+
<div class="flex">
|
|
95
|
+
<div class="px-2 py-6" v-html="useRenderText(definition.definition)"></div>
|
|
96
|
+
<img class="h-60" :src="definition.img" :alt="`Image du terme ${definition.term}`" />
|
|
97
|
+
</div>
|
|
98
|
+
</template>
|
|
99
|
+
|
|
100
|
+
<div>
|
|
101
|
+
<div v-if="definition.relation.length > 0">
|
|
102
|
+
<p class="text-sm font-medium bg-stone-100 p-2">Relations</p>
|
|
103
|
+
<div class="p-2">
|
|
104
|
+
<template v-for="(relation, i) in findRelations(definition.relation)" :key="`relation-${i}`">
|
|
105
|
+
<button class="p-1 border rounded mr-1" @click="goto(relation.term)">
|
|
106
|
+
{{ relation.term }}
|
|
107
|
+
</button>
|
|
108
|
+
</template>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
<div v-else>La definition n'est pas disponible</div>
|
|
115
|
+
</div>
|
|
116
|
+
</template>
|
|
@@ -31,9 +31,9 @@ const styleTextAutor = computed(() => {
|
|
|
31
31
|
|
|
32
32
|
const imageStyle = computed(() => {
|
|
33
33
|
if (props.card) {
|
|
34
|
-
return `rounded-lg`;
|
|
34
|
+
return `md:rounded-lg`;
|
|
35
35
|
}
|
|
36
|
-
return `rounded-l-md`;
|
|
36
|
+
return `md:rounded-l-md`;
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
const { author, img, card } = toRefs(props);
|
|
@@ -46,13 +46,14 @@ const { author, img, card } = toRefs(props);
|
|
|
46
46
|
:outlined="!card ? true : false"
|
|
47
47
|
:color="card ? 'primary':'bg-white'"
|
|
48
48
|
>
|
|
49
|
-
<div class="flex flex-wrap rounded-md">
|
|
50
|
-
<img
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
<div :class="`md:flex md:flex-wrap rounded-md `">
|
|
50
|
+
<div class="w-1/5" v-if="img">
|
|
51
|
+
<img
|
|
52
|
+
:class="`${imageStyle} md:w-full md:h-full md:object-cover md:rounded-l-md`"
|
|
53
|
+
:src="img"
|
|
54
|
+
alt="Image of quote"
|
|
55
|
+
/>
|
|
56
|
+
</div>
|
|
56
57
|
<div :class="`p-6 flex-1 ${colorText}`">
|
|
57
58
|
<slot></slot>
|
|
58
59
|
<template v-if="author">
|
package/dist/EpBadge-4e59ef7c.js
DELETED
package/dist/EpBtn-5e8f86bf.js
DELETED
package/dist/EpCard-7e3ed4a4.js
DELETED
package/dist/EpChip-dc954589.js
DELETED
package/dist/EpFlex-f1971347.js
DELETED
package/dist/EpImg-c1483410.js
DELETED
package/dist/EpLink-4a639047.js
DELETED