ep-lib-ts 0.1.11 → 0.1.14

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.
Files changed (123) hide show
  1. package/.vscode/extensions.json +3 -0
  2. package/README.md +1 -0
  3. package/package.json +7 -4
  4. package/src/components/basics/EpImg.vue +49 -26
  5. package/src/components/medias/EpLinkVersion.vue +7 -4
  6. package/src/components/medias/EpTimeLine.vue +95 -4
  7. package/src/components/signages/EpHeader.vue +3 -63
  8. package/src/components/tools/TimelineItem.vue +128 -0
  9. package/dist/BgAudio-b12a8d0d.js +0 -5
  10. package/dist/DisplayBox-7f75756f.js +0 -5
  11. package/dist/EpAlert-8bea1cc6.js +0 -5
  12. package/dist/EpAudio-15f6ad49.js +0 -5
  13. package/dist/EpBadge-3c86b448.js +0 -5
  14. package/dist/EpBarChart-8d6c96e7.js +0 -5
  15. package/dist/EpBtn-87f90799.js +0 -5
  16. package/dist/EpCard-61fc7afd.js +0 -5
  17. package/dist/EpCheckbox-fe632df9.js +0 -36
  18. package/dist/EpChip-16e2c87e.js +0 -5
  19. package/dist/EpDivider-407d1497.js +0 -5
  20. package/dist/EpEdu-f9179a45.js +0 -5
  21. package/dist/EpFlex-9e2d21f7.js +0 -5
  22. package/dist/EpHeader-1397bf98.js +0 -5
  23. package/dist/EpIcon-f4dc52bb.js +0 -5
  24. package/dist/EpIframe-2cbac751.js +0 -5
  25. package/dist/EpImg-b94ff028.js +0 -5
  26. package/dist/EpInput-b270aaaa.js +0 -1171
  27. package/dist/EpLineChart-d9a0b34b.js +0 -5
  28. package/dist/EpLink-2eab8bbf.js +0 -5
  29. package/dist/EpLinkVersion-d4c4a373.js +0 -5
  30. package/dist/EpModal-fe287280.js +0 -5
  31. package/dist/EpNothing-75cd2a42.js +0 -10
  32. package/dist/EpQuestion-56464bb7.js +0 -5
  33. package/dist/EpQuote-fd55d7eb.js +0 -5
  34. package/dist/EpRadio-05507d50.js +0 -5
  35. package/dist/EpReading-14b168eb.js +0 -5
  36. package/dist/EpResource-efee3fa3.js +0 -5
  37. package/dist/EpScope-ec8113aa.js +0 -5
  38. package/dist/EpSection-d5a8818f.js +0 -5
  39. package/dist/EpSelect-623f5cf1.js +0 -31
  40. package/dist/EpSoftware-556eab4b.js +0 -5
  41. package/dist/EpSpinner-35e73665.js +0 -5
  42. package/dist/EpSwitch-1eaf9d3f.js +0 -44
  43. package/dist/EpTable-af31a993.js +0 -5
  44. package/dist/EpTerm-9088ca28.js +0 -5
  45. package/dist/EpText-4cbda071.js +0 -5
  46. package/dist/EpTextarea-67f751e9.js +0 -41
  47. package/dist/EpToggle-9755056a.js +0 -44
  48. package/dist/EpVideo-08e65cdf.js +0 -5
  49. package/dist/EpVideoPanopto-84e6e091.js +0 -5
  50. package/dist/components/basics/EpBadge.vue.d.ts +0 -38
  51. package/dist/components/basics/EpBtn.vue.d.ts +0 -108
  52. package/dist/components/basics/EpCard.vue.d.ts +0 -95
  53. package/dist/components/basics/EpChip.vue.d.ts +0 -72
  54. package/dist/components/basics/EpDivider.vue.d.ts +0 -51
  55. package/dist/components/basics/EpFlex.vue.d.ts +0 -9
  56. package/dist/components/basics/EpIcon.vue.d.ts +0 -37
  57. package/dist/components/basics/EpImg.vue.d.ts +0 -70
  58. package/dist/components/basics/EpSection.vue.d.ts +0 -84
  59. package/dist/components/basics/EpSpinner.vue.d.ts +0 -41
  60. package/dist/components/basics/EpTable.vue.d.ts +0 -24
  61. package/dist/components/basics/EpText.vue.d.ts +0 -34
  62. package/dist/components/charts/EpBarChart.vue.d.ts +0 -82
  63. package/dist/components/charts/EpLineChart.vue.d.ts +0 -82
  64. package/dist/components/charts/EpPieChart.vue.d.ts +0 -2
  65. package/dist/components/educationals/EpEdu.vue.d.ts +0 -81
  66. package/dist/components/educationals/EpReading.vue.d.ts +0 -152
  67. package/dist/components/educationals/EpResource.vue.d.ts +0 -35
  68. package/dist/components/educationals/EpScope.vue.d.ts +0 -23
  69. package/dist/components/forms/EpCheckbox.vue.d.ts +0 -72
  70. package/dist/components/forms/EpInput.vue.d.ts +0 -98
  71. package/dist/components/forms/EpRadio.vue.d.ts +0 -69
  72. package/dist/components/forms/EpSelect.vue.d.ts +0 -83
  73. package/dist/components/forms/EpSwitch.vue.d.ts +0 -81
  74. package/dist/components/forms/EpTextarea.vue.d.ts +0 -90
  75. package/dist/components/forms/EpToggle.vue.d.ts +0 -81
  76. package/dist/components/interactions/EpAccordeon.vue.d.ts +0 -54
  77. package/dist/components/interactions/EpContentSlider.vue.d.ts +0 -2
  78. package/dist/components/interactions/EpModal.vue.d.ts +0 -70
  79. package/dist/components/interactions/EpQuestion.vue.d.ts +0 -91
  80. package/dist/components/interactions/EpTabs.vue.d.ts +0 -2
  81. package/dist/components/medias/EpAudio.vue.d.ts +0 -74
  82. package/dist/components/medias/EpCarousel.vue.d.ts +0 -41
  83. package/dist/components/medias/EpIframe.vue.d.ts +0 -58
  84. package/dist/components/medias/EpKatex.vue.d.ts +0 -52
  85. package/dist/components/medias/EpLink.vue.d.ts +0 -74
  86. package/dist/components/medias/EpLinkVersion.vue.d.ts +0 -27
  87. package/dist/components/medias/EpSoftware.vue.d.ts +0 -89
  88. package/dist/components/medias/EpSvg.vue.d.ts +0 -2
  89. package/dist/components/medias/EpTerm.vue.d.ts +0 -80
  90. package/dist/components/medias/EpTimeLine.vue.d.ts +0 -2
  91. package/dist/components/medias/EpVideo.vue.d.ts +0 -65
  92. package/dist/components/medias/EpVideoPanopto.vue.d.ts +0 -65
  93. package/dist/components/signages/EpAlert.vue.d.ts +0 -61
  94. package/dist/components/signages/EpHeader.vue.d.ts +0 -101
  95. package/dist/components/signages/EpNothing.vue.d.ts +0 -2
  96. package/dist/components/signages/EpQuote.vue.d.ts +0 -39
  97. package/dist/components/tools/BgAudio.vue.d.ts +0 -14
  98. package/dist/components/tools/DisplayBox.vue.d.ts +0 -17
  99. package/dist/composables/isHtml.d.ts +0 -1
  100. package/dist/composables/useColors.d.ts +0 -1
  101. package/dist/composables/useComponent.d.ts +0 -6
  102. package/dist/composables/useIcons.d.ts +0 -23
  103. package/dist/composables/useMarkdown.d.ts +0 -1
  104. package/dist/composables/useRenderText.d.ts +0 -1
  105. package/dist/ep-lib-ts.js +0 -43
  106. package/dist/ep-lib-ts.umd.cjs +0 -310
  107. package/dist/index-8c79cd61.js +0 -18814
  108. package/dist/index.d.ts +0 -40
  109. package/dist/main.d.ts +0 -0
  110. package/dist/router.d.ts +0 -2
  111. package/dist/style.css +0 -1
  112. package/dist/types/Accordeon.d.ts +0 -43
  113. package/dist/types/Alert.d.ts +0 -31
  114. package/dist/types/Answer.d.ts +0 -15
  115. package/dist/types/Border.d.ts +0 -2
  116. package/dist/types/Btn.d.ts +0 -41
  117. package/dist/types/Card.d.ts +0 -6
  118. package/dist/types/Chip.d.ts +0 -41
  119. package/dist/types/MandateLevel.d.ts +0 -5
  120. package/dist/types/MediaCarousel.d.ts +0 -7
  121. package/dist/types/Medias.d.ts +0 -11
  122. package/dist/types/Radio.d.ts +0 -11
  123. package/dist/vite.svg +0 -1
@@ -0,0 +1,3 @@
1
+ {
2
+ "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
3
+ }
package/README.md CHANGED
@@ -16,3 +16,4 @@ If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has a
16
16
  1. Run `Extensions: Show Built-in Extensions` from VSCode's command palette
17
17
  2. Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
18
18
  2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
19
+ .
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ep-lib-ts",
3
3
  "private": false,
4
- "version": "0.1.11",
4
+ "version": "0.1.14",
5
5
  "files": [
6
6
  "dist",
7
7
  "src/components/"
@@ -33,9 +33,9 @@
33
33
  "markdown-it": "^13.0.1",
34
34
  "postcss-cli": "^10.1.0",
35
35
  "vee-validate": "^4.8.6",
36
+ "vue": "^3.2.45",
36
37
  "vue-router": "^4.1.6",
37
- "vue3-apexcharts": "^1.4.4",
38
- "vue": "^3.2.45"
38
+ "vue3-apexcharts": "^1.4.4"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@tailwindcss/forms": "^0.5.3",
@@ -54,5 +54,8 @@
54
54
  },
55
55
  "peerDependencies": {
56
56
  "vue": "^3.2.45"
57
+ },
58
+ "engines": {
59
+ "node": "18.x.x"
57
60
  }
58
- }
61
+ }
@@ -1,8 +1,11 @@
1
1
  <script setup lang="ts">
2
2
  import { toRefs, ref, computed } from 'vue'
3
+ import { useImage } from '@vueuse/core'
3
4
  import EpModal from '../interactions/EpModal.vue'
4
5
  import EpIcon from '../basics/EpIcon.vue'
5
6
  import { mdiArrowExpandAll } from '@mdi/js';
7
+ import { mdiImage } from '@mdi/js';
8
+ import { mdiImageRemove } from '@mdi/js';
6
9
  import { useRenderText } from "../../composables/useRenderText";
7
10
  const Cols = [
8
11
  'basis-6/12',
@@ -28,7 +31,8 @@ interface Props {
28
31
  thumbnail?: boolean;
29
32
  caption?: string;
30
33
  bib?: string;
31
- title?: string,
34
+ title?: string;
35
+ noModal?:boolean;
32
36
  cols?: string | number //posible type à venir => basis-1/12... basis-11/12 to basis-full
33
37
  }
34
38
 
@@ -36,6 +40,7 @@ const props = withDefaults(defineProps<Props>(), {
36
40
  alt: "Image snfas",
37
41
  cols: "basis-6/12",
38
42
  thumbnail: false,
43
+ noModal:false
39
44
  })
40
45
 
41
46
  const renderCols = computed(() => {
@@ -51,38 +56,56 @@ const renderBib = computed(()=>{
51
56
 
52
57
  const showModal = ref<boolean>(false)
53
58
 
54
- const { src, alt, title, caption, thumbnail, bib } = toRefs(props)
59
+ const toggleModal = ():void => {
60
+ if(props.noModal){
61
+ return
62
+ }
63
+ showModal.value = !showModal.value
64
+ }
65
+
66
+ const { isLoading, error } = useImage({ src: props.src })
67
+ const { src, alt, title, caption, thumbnail, bib, noModal } = toRefs(props)
55
68
 
56
69
  </script>
57
70
 
58
71
  <template>
59
- <div v-if="!thumbnail" class="flex">
60
- <div :class="`mx-auto bg-white rounded-md overflow-hidden shadow-md ${renderCols}`">
61
- <img class="object-cover object-center w-full" :src="src" :alt="alt" @click="showModal = true">
62
- <div class="px-4 py-2" v-if="title || caption || bib">
63
- <h2 class="text-2xl font-bold">{{ title }}</h2>
64
- <p class="text-gray-500 text-sm mt-4">{{ caption }}</p>
65
- <div class="text-gray-700 mt-4" v-html="renderBib"></div>
72
+ <div>
73
+ <div v-if="!thumbnail" class="flex">
74
+ <div :class="`mx-auto bg-white rounded-md overflow-hidden shadow-md ${renderCols}`">
75
+ <template v-if="isLoading">
76
+ <span class="text-gray-200"><EpIcon :icon-path="mdiImage" size="250"></EpIcon></span>
77
+ </template>
78
+ <template v-else-if="error">
79
+ <span class="text-red-200"><EpIcon :icon-path="mdiImageRemove" size="150"></EpIcon></span>
80
+ </template>
81
+ <template v-else>
82
+ <img class="object-cover object-center w-full" :src="src" :alt="alt" @click="toggleModal">
83
+ </template>
84
+ <div class="px-4 py-2" v-if="title || caption || bib">
85
+ <h2 class="text-2xl font-bold">{{ title }}</h2>
86
+ <p class="text-gray-500 text-sm mt-4">{{ caption }}</p>
87
+ <div class="text-gray-700 mt-4" v-html="renderBib"></div>
88
+ </div>
66
89
  </div>
67
90
  </div>
68
- </div>
69
- <div v-if="thumbnail" class="relative group inline-block m-2">
70
- <img class="w-36 h-36 object-cover object-center group-hover:opacity-30 " :src="src" :alt="alt">
71
- <div
72
- class="absolute top-0 left-0 w-36 h-36 bg-black opacity-0 transition-opacity duration-300 group-hover:opacity-30 cursor-pointer"
73
- @click="showModal = true">
74
- <div class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 text-white text-center">
75
- <EpIcon :icon-path="mdiArrowExpandAll"></EpIcon>
91
+ <div v-if="thumbnail" class="relative group inline-block m-2">
92
+ <img class="w-36 h-36 object-cover object-center group-hover:opacity-30 " :src="src" :alt="alt">
93
+ <div
94
+ class="absolute top-0 left-0 w-36 h-36 bg-black opacity-0 transition-opacity duration-300 group-hover:opacity-30 cursor-pointer"
95
+ @click="toggleModal">
96
+ <div class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 text-white text-center">
97
+ <EpIcon :icon-path="mdiArrowExpandAll"></EpIcon>
98
+ </div>
76
99
  </div>
77
100
  </div>
78
- </div>
79
- <EpModal v-model="showModal">
80
- <img class="object-cover object-center h-5/6 w-5/6 mx-auto" :src="src" :alt="alt" @click="showModal = false">
81
- <div class="px-4 py-2" v-if="thumbnail">
82
- <h2 class="text-2xl font-bold">{{ title }}</h2>
83
- <p class="text-gray-500 text-sm mt-4">{{ caption }}</p>
84
- <div class="text-gray-700 mt-4" v-html="renderBib"></div>
85
- </div>
86
- </EpModal>
101
+ <EpModal v-model="showModal">
102
+ <img class="object-cover object-center h-5/6 w-5/6 mx-auto" :src="src" :alt="alt" @click="toggleModal">
103
+ <div class="px-4 py-2" v-if="thumbnail">
104
+ <h2 class="text-2xl font-bold">{{ title }}</h2>
105
+ <p class="text-gray-500 text-sm mt-4">{{ caption }}</p>
106
+ <div class="text-gray-700 mt-4" v-html="renderBib"></div>
107
+ </div>
108
+ </EpModal>
109
+ </div>
87
110
  </template>
88
111
 
@@ -14,12 +14,15 @@ interface Link {
14
14
 
15
15
  interface Props{
16
16
  type:TypeLink;
17
- link:Link
17
+ link:Link;
18
+ big?:boolean
18
19
  }
19
20
 
20
- const props = withDefaults(defineProps<Props>(),{})
21
+ const props = withDefaults(defineProps<Props>(),{
22
+ big:false
23
+ })
21
24
 
22
- const {type, link} = toRefs(props)
25
+ const {type, link, big} = toRefs(props)
23
26
 
24
27
  </script>
25
28
 
@@ -28,7 +31,7 @@ const {type, link} = toRefs(props)
28
31
  <EpLink :label="link.title" :href="link.url"></EpLink>
29
32
  </div>
30
33
  <div v-else-if="type === 'iframe'">
31
- <EpIframe :title="link.title" :src="link.url"></EpIframe>
34
+ <EpIframe :title="link.title" :src="link.url" :big="big"></EpIframe>
32
35
  </div>
33
36
  <div v-else>
34
37
  no data
@@ -1,8 +1,99 @@
1
1
  <script setup lang="ts">
2
+ import { ref, toRefs, onMounted, computed } from 'vue';
3
+ //types in capital letter
4
+ import {TagTimeLine, HeadTimeLine, EventTimeLine, ColorsTags, colorsTimeLine} from '../../types/TimeLine'
5
+ import TimeLineItem from '../tools/TimelineItem.vue'
6
+ import EpIcon from '../basics/EpIcon.vue';
7
+ import { mdiCheckboxBlankCircleOutline } from '@mdi/js';
8
+ import { mdiCheckboxMarkedCircle } from '@mdi/js';
9
+
10
+ interface TimelineHeading {
11
+ title?: {
12
+ text?:HeadTimeLine
13
+ }
14
+ }
15
+
16
+ interface Props {
17
+ tags:TagTimeLine[];
18
+ events:EventTimeLine[];
19
+ title?:TimelineHeading;
20
+ }
21
+
22
+ const props = withDefaults(defineProps<Props>(),{})
23
+
24
+ const timeLineTags = ref<TagTimeLine[]>()
25
+
26
+ onMounted(()=> {
27
+ if(props.tags){
28
+ timeLineTags.value = props.tags.map(tag => ({...tag, active:false}))
29
+ }
30
+ })
31
+
32
+ const styleTag = (color:ColorsTags) => {
33
+ const styles = colorsTimeLine[color]
34
+ if(!styles){
35
+ return colorsTimeLine.noTag
36
+ }
37
+ return styles
38
+ }
39
+
40
+ const activeTags = computed(()=>{
41
+ return timeLineTags.value?.filter(tag => tag.active) || []
42
+ })
43
+
44
+ const filteredEvents = computed(()=>{
45
+ if(activeTags.value.length === 0){
46
+ return props.events
47
+ }else{
48
+ const filtered = props.events.filter(event => {
49
+ if(event.tag){
50
+ ///event.tag.id === this.activesTags.some(t => t.id)
51
+ return activeTags.value.some(t => t.id === event.tag?.id)
52
+ }
53
+ })
54
+ return filtered
55
+ }
56
+ })
57
+
58
+ const toggleActive = (tag:TagTimeLine) => {
59
+ tag.active = !tag.active
60
+ }
61
+
62
+ const {title} = toRefs(props)
63
+
2
64
  </script>
3
65
 
4
66
  <template>
5
- <div class="p-12 bg-warning-light w-[50%] mx-auto border-2 border-warning">
6
- <p class="text-center text-error font-bold uppercase">In progress</p>
7
- </div>
8
- </template>
67
+ <!-- component -->
68
+ <div class="w-10/12 md:w-7/12 lg:6/12 mx-auto relative">
69
+ <h3 class="text-2xl mb-2">{{ title?.title?.text?.headline }}</h3>
70
+ <p>{{ title?.title?.text?.text }}</p>
71
+ <div class="my-4">
72
+ <template v-for="tag in timeLineTags" :key="tag.id">
73
+ <span @click="toggleActive(tag)" :class="`mr-2 cursor-pointer text-sm px-2 py-1 rounded border ${styleTag(tag.color).border} ${tag.active?'text-white':styleTag(tag.color).text} ${tag.active?styleTag(tag.color).bg:''}`">
74
+ {{ tag.title }} <EpIcon :icon-path="tag.active?mdiCheckboxMarkedCircle:mdiCheckboxBlankCircleOutline" size="14"></EpIcon>
75
+ </span>
76
+ </template>
77
+ </div>
78
+ <div class="border-l-4 pl-1 transition-all">
79
+ <TransitionGroup name="list" tag="ul">
80
+ <template v-for="(item, i) in filteredEvents" :key="`${i}-card-${item.id}`">
81
+ <TimeLineItem :event="item"></TimeLineItem>
82
+ </template>
83
+ </TransitionGroup>
84
+ </div>
85
+ </div>
86
+
87
+ </template>
88
+
89
+ <style>
90
+ .list-enter-active,
91
+ .list-leave-active {
92
+ transition: all 0.5s ease;
93
+ }
94
+ .list-enter-from,
95
+ .list-leave-to {
96
+ opacity: 0;
97
+ transform: translateX(30px);
98
+ }
99
+ </style>
@@ -82,9 +82,10 @@ const { title, icon, color, src, height } = toRefs(props);
82
82
  >Formatif</EpChip
83
83
  >
84
84
  </div>
85
- <div id="title-content" class="w-full grow flex items-end">
85
+
86
+ <div id="title-content" class="md:px-64 flex w-full grow flex items-end">
86
87
  <div
87
- class="container flex flex-col px-8 py-24 mx-auto max-w-7xl md:flex-row lg:px-16"
88
+ class="container flex flex-col px-8 py-24 max-w-7xl md:flex-row lg:px-16"
88
89
  >
89
90
  <div
90
91
  v-if="title"
@@ -159,65 +160,4 @@ const { title, icon, color, src, height } = toRefs(props);
159
160
  </div> -->
160
161
  </section>
161
162
 
162
- <section>
163
- <div class="items-center pb-12 max-w-7xl lg:pb-24">
164
- <div class="justify-center w-full mx-auto bg-stone-100">
165
- <nav class="flex py-3 border-y" aria-label="Breadcrumb">
166
- <ol role="list" class="flex items-center pl-2 space-x-2">
167
- <li>
168
- <div class="flex items-center">
169
- <a
170
- href="#"
171
- class="inline-flex items-center text-sm font-medium text-gray-500 duration-200 hover:text-gray-700 hover:scale-95"
172
- >
173
- <!-- <ion-icon
174
- class="flex-shrink-0 w-4 h-4 md hydrated"
175
- name="home-outline"
176
- role="img"
177
- aria-label="home outline"
178
- ></ion-icon> -->
179
- <EpIcon :iconPath="mdiHome" size="22"></EpIcon>
180
- <span class="ml-2"> Parent </span>
181
- </a>
182
- </div>
183
- </li>
184
- <li>
185
- <div class="flex items-center">
186
- <span class="flex-shrink-0 w-5 h-5 text-gray-300"> / </span>
187
- <a
188
- href="#"
189
- class="ml-4 text-sm font-medium text-gray-500 hover:scale-95 hover:text-gray-700"
190
- >
191
- Parent
192
- </a>
193
- </div>
194
- </li>
195
- <li>
196
- <div class="flex items-center">
197
- <span class="flex-shrink-0 w-5 h-5 text-gray-300"> / </span>
198
- <a
199
- href="#"
200
- class="ml-4 text-sm font-medium text-gray-500 hover:scale-95 hover:text-gray-700"
201
- >
202
- Parent
203
- </a>
204
- </div>
205
- </li>
206
- <li>
207
- <div class="flex items-center">
208
- <span class="flex-shrink-0 w-5 h-5 text-gray-300"> / </span>
209
- <a
210
- href="#"
211
- class="ml-4 text-sm font-medium text-blue-500 hover:scale-95 hover:text-gray-700"
212
- aria-current="page"
213
- >
214
- Current
215
- </a>
216
- </div>
217
- </li>
218
- </ol>
219
- </nav>
220
- </div>
221
- </div>
222
- </section>
223
163
  </template>
@@ -0,0 +1,128 @@
1
+ <script setup lang="ts">
2
+ import { ref, toRefs, onMounted, computed } from "vue";
3
+ import { useImage } from '@vueuse/core'
4
+ import { useRenderText } from "../../composables/useRenderText";
5
+ ///types with Capital letters... object with styles same name in lowercase
6
+ import { EventTimeLine, TimeLineDate, colorsTimeLine } from "../../types/TimeLine";
7
+ import EpImg from "../basics/EpImg.vue";
8
+
9
+ interface Props {
10
+ title?: string | null;
11
+ date?: string;
12
+ event: EventTimeLine;
13
+ }
14
+
15
+ const props = withDefaults(defineProps<Props>(), {
16
+ title: 'En savoir plus',
17
+ type: 'base',
18
+ });
19
+
20
+
21
+ const showDiv = ref(true);
22
+ const collapsible = ref();
23
+
24
+
25
+ onMounted(() => {
26
+ var content = collapsible.value
27
+ if (showDiv.value) {
28
+ content.style.maxHeight = content.scrollHeight + "px";
29
+ }
30
+ })
31
+
32
+ function toggleDivVisibility() {
33
+ showDiv.value = !showDiv.value;
34
+ var content = collapsible.value
35
+ if (content.style.maxHeight) {
36
+ content.style.maxHeight = null;
37
+ } else {
38
+ content.style.maxHeight = content.scrollHeight + "px";
39
+ }
40
+ //add transition
41
+ if (!content.style.transition) {
42
+ content.style.transition = 'max-height 0.2s ease-out';
43
+ }
44
+ }
45
+
46
+ const start_date = computed(() => {
47
+ if (props.event.start_date) {
48
+ return parseTimeline(props.event.start_date)
49
+ }
50
+ return null
51
+ })
52
+
53
+ const end_date = computed(() => {
54
+ if (props.event.end_date) {
55
+ return parseTimeline(props.event.end_date)
56
+ }
57
+ return null
58
+ })
59
+
60
+ const src = computed(()=>{
61
+ if(props.event.media.url.trim() !== ""){
62
+ return props.event.media.url
63
+ }
64
+ return null
65
+ })
66
+
67
+ const colorEvent = computed(()=> {
68
+ if(props.event.tag){
69
+ return colorsTimeLine[props.event.tag.color]
70
+ }
71
+ return colorsTimeLine.noTag
72
+ })
73
+
74
+ const parseTimeline = (timeDate: TimeLineDate) => {
75
+ const day = timeDate.day ? `${timeDate.day}/` : ``
76
+ const month = timeDate.month ? `${timeDate.month}/` : ``
77
+ const year = timeDate.year
78
+ const hours = timeDate.hour
79
+ const minutes = timeDate.minute ? `:${timeDate.minute}` : ``
80
+ return {
81
+ date: day + month + year,
82
+ hour: hours + minutes
83
+ }
84
+ }
85
+
86
+ const { event } = toRefs(props)
87
+ </script>
88
+
89
+ <template>
90
+ <div
91
+
92
+ :class="`cursor-pointer ml-10 relative flex items-center p-2 ${colorEvent.border} border border-2 rounded-r-lg mb-8 flex-col md:flex-row space-y-4 md:space-y-0`"
93
+ @click="toggleDivVisibility">
94
+ <!-- Dot -->
95
+ <div
96
+ :class="`w-5 h-5 bg-white border-2 ${colorEvent.border} absolute -left-12 transform -translate-x-2/4 rounded-full z-10 mt-2 md:mt-0`">
97
+ </div>
98
+ <!-- Line -->
99
+ <div :class="`w-10 border ${colorEvent.border} absolute -left-10 z-0`"></div>
100
+ <div>
101
+ <div :class="`${colorEvent.text} text-sm`" >
102
+ <!-- sur protheus on est trop laxes ... mais on peut avoir plusieurs cas :/ -->
103
+ <span v-if="start_date?.date.trim()" class="font-bold">{{ start_date.date }}</span>
104
+ <span v-if="start_date?.hour.trim()" class="text-xs ml-1">{{ start_date.hour }}</span>
105
+ <span v-if="end_date?.date.trim()" class="mx-4">-</span>
106
+ <span v-if="end_date?.date.trim()" class="font-bold">{{ end_date.date }}</span>
107
+ <span v-if="end_date?.hour.trim()" class="text-xs ml-1"> {{ end_date.hour }}</span>
108
+
109
+ </div>
110
+ <h1 :class="`text-2xl ${colorEvent.text}`">{{ event.text?.headline }}</h1>
111
+ <!-- Content -->
112
+ <div ref="collapsible" class="content">
113
+ <div :class="`${src?'flex':''} py-4`">
114
+ <div v-if="src" class="flex-1">
115
+ <EpImg noModal cols="8" :src="src" :alt="event.text?.headline" ></EpImg>
116
+ </div>
117
+ <div class="flex-1" v-html="useRenderText(event.text.text)"></div>
118
+ </div>
119
+ </div>
120
+ </div>
121
+ </div>
122
+ </template>
123
+
124
+ <style scoped>
125
+ .content {
126
+ max-height: 0;
127
+ overflow: hidden;
128
+ }</style>
@@ -1,5 +0,0 @@
1
- import { H as m } from "./index-8c79cd61.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { I as m } from "./index-8c79cd61.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { E as m } from "./index-8c79cd61.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { w as m } from "./index-8c79cd61.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { b as m } from "./index-8c79cd61.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { n as m } from "./index-8c79cd61.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { c as m } from "./index-8c79cd61.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { d as m } from "./index-8c79cd61.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,36 +0,0 @@
1
- import { defineComponent as u, toRefs as p, openBlock as f, createElementBlock as b, createElementVNode as a, unref as e, toDisplayString as m } from "vue";
2
- const y = ["id", "type", "value", "disabled", "readonly", "checked"], h = ["for", "disabled"], B = /* @__PURE__ */ u({
3
- __name: "EpCheckbox",
4
- props: {
5
- id: { default: "0" },
6
- label: { default: "check" },
7
- modelValue: { default: "" },
8
- type: { default: "checkbox" },
9
- disabled: { type: Boolean, default: !1 },
10
- readonly: { type: Boolean, default: !1 },
11
- checked: { type: Boolean, default: !1 }
12
- },
13
- emits: ["update:modelValue"],
14
- setup(o, { emit: k }) {
15
- const t = o, { id: l, label: n, type: c, modelValue: s, disabled: d, readonly: r, checked: i } = p(t);
16
- return (_, x) => (f(), b("div", null, [
17
- a("input", {
18
- id: e(l),
19
- type: e(c),
20
- value: e(s),
21
- class: "form-checkbox rounded border-neutral-300 text-blue-600 h-[1.125rem] w-[1.125rem] mr-2 disabled:opacity-40 disabled:cursor-not-allowed",
22
- disabled: e(d),
23
- readonly: e(r),
24
- checked: e(i)
25
- }, null, 8, y),
26
- a("label", {
27
- for: e(l),
28
- class: "disabled:opacity-40 hover:pointer-events-none",
29
- disabled: e(d)
30
- }, m(e(n)), 9, h)
31
- ]));
32
- }
33
- });
34
- export {
35
- B as default
36
- };
@@ -1,5 +0,0 @@
1
- import { e as m } from "./index-8c79cd61.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { f } from "./index-8c79cd61.js";
2
- import "vue";
3
- export {
4
- f as default
5
- };
@@ -1,5 +0,0 @@
1
- import { p as m } from "./index-8c79cd61.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { g as m } from "./index-8c79cd61.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { F as m } from "./index-8c79cd61.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { h as m } from "./index-8c79cd61.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { x as m } from "./index-8c79cd61.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { i } from "./index-8c79cd61.js";
2
- import "vue";
3
- export {
4
- i as default
5
- };