ep-lib-ts 0.1.26 → 0.1.28

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 (118) hide show
  1. package/dist/BgAudio-820c0a39.js +5 -0
  2. package/dist/DisplayBox-05ba8755.js +5 -0
  3. package/dist/EpAlert-f32ad986.js +5 -0
  4. package/dist/EpAudio-80dbaf40.js +5 -0
  5. package/dist/EpBadge-cb67d4b1.js +5 -0
  6. package/dist/EpBarChart-710b4ff4.js +5 -0
  7. package/dist/EpBtn-5c939189.js +5 -0
  8. package/dist/EpCard-3c75fd57.js +5 -0
  9. package/dist/{EpChip-d95c000b.js → EpChip-75b64fd5.js} +1 -1
  10. package/dist/EpContentSlider-5f4ed454.js +5 -0
  11. package/dist/EpDivider-05f71886.js +5 -0
  12. package/dist/EpEdu-b7e92524.js +5 -0
  13. package/dist/EpFlex-f7103829.js +5 -0
  14. package/dist/EpHeader-564a55a0.js +5 -0
  15. package/dist/{EpIcon-f4b4bc40.js → EpIcon-5c184634.js} +1 -1
  16. package/dist/EpIframe-e47cdf06.js +5 -0
  17. package/dist/EpImg-4ac885e3.js +5 -0
  18. package/dist/{EpInput-52bd7c29.js → EpInput-81ae2a5e.js} +1 -1
  19. package/dist/EpLineChart-468b3ed7.js +5 -0
  20. package/dist/EpLink-9f599e06.js +5 -0
  21. package/dist/EpLinkVersion-9a5026a6.js +5 -0
  22. package/dist/EpModal-8208c45a.js +5 -0
  23. package/dist/{EpNothing-ee1a3764.js → EpNothing-2c04e40e.js} +1 -1
  24. package/dist/EpPieChart-0b7f0752.js +5 -0
  25. package/dist/EpQuestion-f5c0082f.js +5 -0
  26. package/dist/EpQuote-c51e2778.js +5 -0
  27. package/dist/EpRadio-edd52b6b.js +5 -0
  28. package/dist/EpReading-19d5e14b.js +5 -0
  29. package/dist/EpResource-d05a5a4a.js +5 -0
  30. package/dist/EpScope-e4c2d014.js +5 -0
  31. package/dist/EpSection-97392b3b.js +5 -0
  32. package/dist/{EpSelect-3bb3ebfb.js → EpSelect-0bc80667.js} +1 -1
  33. package/dist/EpSkeleton-9542d360.js +10 -0
  34. package/dist/EpSoftware-3c6dce6e.js +5 -0
  35. package/dist/EpSpinner-d47f52b4.js +5 -0
  36. package/dist/EpSvg-c08f08c7.js +5 -0
  37. package/dist/EpTable-15f79011.js +5 -0
  38. package/dist/EpTerm-892a5db3.js +5 -0
  39. package/dist/EpText-466d34a5.js +5 -0
  40. package/dist/EpTimeLine-7c0f2078.js +5 -0
  41. package/dist/EpVideo-ddedb1ac.js +5 -0
  42. package/dist/EpVideoPanopto-2d7bdf5f.js +5 -0
  43. package/dist/components/basics/EpBadge.vue.d.ts +9 -9
  44. package/dist/components/basics/EpBtn.vue.d.ts +11 -11
  45. package/dist/components/basics/EpDivider.vue.d.ts +9 -9
  46. package/dist/components/basics/EpImg.vue.d.ts +4 -4
  47. package/dist/components/basics/EpSection.vue.d.ts +6 -6
  48. package/dist/components/basics/EpSpinner.vue.d.ts +9 -9
  49. package/dist/components/charts/EpBarChart.vue.d.ts +6 -6
  50. package/dist/components/charts/EpLineChart.vue.d.ts +6 -6
  51. package/dist/components/charts/EpPieChart.vue.d.ts +6 -6
  52. package/dist/components/educationals/EpResource.vue.d.ts +5 -5
  53. package/dist/components/forms/EpCheckbox.vue.d.ts +9 -9
  54. package/dist/components/forms/EpInput.vue.d.ts +26 -26
  55. package/dist/components/forms/EpRadio.vue.d.ts +18 -18
  56. package/dist/components/forms/EpSelect.vue.d.ts +17 -17
  57. package/dist/components/forms/EpSwitch.vue.d.ts +18 -18
  58. package/dist/components/forms/EpTextarea.vue.d.ts +18 -18
  59. package/dist/components/forms/EpToggle.vue.d.ts +18 -18
  60. package/dist/components/interactions/EpAccordeon.vue.d.ts +3 -3
  61. package/dist/components/medias/EpSoftware.vue.d.ts +6 -6
  62. package/dist/components/medias/EpSvg.vue.d.ts +11 -1
  63. package/dist/components/medias/EpTerm.vue.d.ts +0 -9
  64. package/dist/components/signages/EpAlert.vue.d.ts +3 -3
  65. package/dist/components/signages/EpSkeleton.vue.d.ts +2 -0
  66. package/dist/components/tools/TimelineItem.vue.d.ts +9 -0
  67. package/dist/composables/useIcons.d.ts +3 -0
  68. package/dist/ep-lib-ts.js +1 -1
  69. package/dist/ep-lib-ts.umd.cjs +36 -32
  70. package/dist/{index-58100a64.js → index-78ac7d74.js} +4544 -4491
  71. package/dist/style.css +1 -1
  72. package/dist/types/Accordeon.d.ts +4 -0
  73. package/dist/types/Alert.d.ts +4 -0
  74. package/package.json +2 -2
  75. package/src/components/basics/EpImg.vue +1 -1
  76. package/src/components/basics/EpText.vue +23 -13
  77. package/src/components/interactions/EpContentSlider.vue +3 -2
  78. package/src/components/medias/EpSvg.vue +29 -6
  79. package/src/components/medias/EpTerm.vue +32 -24
  80. package/src/components/medias/EpTimeLine.vue +53 -46
  81. package/src/components/signages/EpSkeleton.vue +17 -0
  82. package/src/components/tools/TimelineItem.vue +3 -3
  83. package/dist/BgAudio-9c7c57a7.js +0 -5
  84. package/dist/DisplayBox-c282fff4.js +0 -5
  85. package/dist/EpAlert-a64aea08.js +0 -5
  86. package/dist/EpAudio-32aaf084.js +0 -5
  87. package/dist/EpBadge-8380fcc2.js +0 -5
  88. package/dist/EpBarChart-3f81608e.js +0 -5
  89. package/dist/EpBtn-0c842202.js +0 -5
  90. package/dist/EpCard-700fe5e3.js +0 -5
  91. package/dist/EpContentSlider-d8752e6e.js +0 -5
  92. package/dist/EpDivider-a32e0177.js +0 -5
  93. package/dist/EpEdu-9d26836d.js +0 -5
  94. package/dist/EpFlex-59716f0c.js +0 -5
  95. package/dist/EpHeader-f168320a.js +0 -5
  96. package/dist/EpIframe-27a236f3.js +0 -5
  97. package/dist/EpImg-00828689.js +0 -5
  98. package/dist/EpLineChart-67012b1e.js +0 -5
  99. package/dist/EpLink-fc45197a.js +0 -5
  100. package/dist/EpLinkVersion-13183ab8.js +0 -5
  101. package/dist/EpModal-5bff1fb8.js +0 -5
  102. package/dist/EpPieChart-5e1350b8.js +0 -5
  103. package/dist/EpQuestion-ca5ebab1.js +0 -5
  104. package/dist/EpQuote-51d82a92.js +0 -5
  105. package/dist/EpRadio-34d4b2f1.js +0 -5
  106. package/dist/EpReading-15024973.js +0 -5
  107. package/dist/EpResource-d4402841.js +0 -5
  108. package/dist/EpScope-e03422df.js +0 -5
  109. package/dist/EpSection-07e69719.js +0 -5
  110. package/dist/EpSoftware-bf127112.js +0 -5
  111. package/dist/EpSpinner-6675a594.js +0 -5
  112. package/dist/EpSvg-26494cb6.js +0 -5
  113. package/dist/EpTable-4a80c53e.js +0 -5
  114. package/dist/EpTerm-681f1cec.js +0 -5
  115. package/dist/EpText-7636f01e.js +0 -5
  116. package/dist/EpTimeLine-3c329159.js +0 -5
  117. package/dist/EpVideo-0f779d99.js +0 -5
  118. package/dist/EpVideoPanopto-ee435c19.js +0 -5
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .content[data-v-ab122c9c]{max-height:0;overflow:hidden}.modal-mask{position:fixed;z-index:9998;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;transition:opacity .3s ease}.modal-container{margin:auto;max-height:95%;transition:all .3s ease;z-index:9999}.modal-header h3{margin-top:0;color:#42b983}.modal-body{margin:20px 0}.modal-default-button{float:right}.modal-enter-from,.modal-leave-to{opacity:0}.modal-enter-from .modal-container,.modal-leave-to .modal-container{transform:scale(1.1)}.custom_index{z-index:9999;position:absolute;right:12rem}.h-custom{height:30rem}.p-custom p{margin-bottom:1em}.v-enter-active[data-v-049ea2df],.v-leave-active[data-v-049ea2df]{transition:opacity .5s ease}.v-enter-from[data-v-049ea2df],.v-leave-to[data-v-049ea2df]{opacity:0}.katex[data-v-24ff8b28]{font-size:1.3em}.content[data-v-523dedc7]{max-height:0;overflow:hidden}.list-enter-active,.list-leave-active{transition:all .5s ease}.list-enter-from,.list-leave-to{opacity:0;transform:translate(30px)}
1
+ .content[data-v-ab122c9c]{max-height:0;overflow:hidden}.modal-mask{position:fixed;z-index:9998;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;transition:opacity .3s ease}.modal-container{margin:auto;max-height:95%;transition:all .3s ease;z-index:9999}.modal-header h3{margin-top:0;color:#42b983}.modal-body{margin:20px 0}.modal-default-button{float:right}.modal-enter-from,.modal-leave-to{opacity:0}.modal-enter-from .modal-container,.modal-leave-to .modal-container{transform:scale(1.1)}.custom_index{z-index:9999;position:absolute;right:12rem}.h-custom{height:30rem}.p-custom p{margin-bottom:1em}.v-enter-active[data-v-049ea2df],.v-leave-active[data-v-049ea2df]{transition:opacity .5s ease}.v-enter-from[data-v-049ea2df],.v-leave-to[data-v-049ea2df]{opacity:0}.katex[data-v-24ff8b28]{font-size:1.3em}.content[data-v-4cca257a]{max-height:0;overflow:hidden}.list-enter-active,.list-leave-active{transition:all .5s ease}.list-enter-from,.list-leave-to{opacity:0;transform:translate(30px)}
@@ -35,6 +35,10 @@ export declare const typeAccordeon: {
35
35
  default: string;
36
36
  outlined: string;
37
37
  };
38
+ Question: {
39
+ default: string;
40
+ outlined: string;
41
+ };
38
42
  tip: {
39
43
  default: string;
40
44
  outlined: string;
@@ -23,6 +23,10 @@ export declare const typeAlert: {
23
23
  default: string;
24
24
  outlined: string;
25
25
  };
26
+ Question: {
27
+ default: string;
28
+ outlined: string;
29
+ };
26
30
  tip: {
27
31
  default: string;
28
32
  outlined: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ep-lib-ts",
3
3
  "private": false,
4
- "version": "0.1.26",
4
+ "version": "0.1.28",
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.10"
53
+ "vue-tsc": "^1.8.19"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "vue": "^3.2.45"
@@ -38,7 +38,7 @@ interface Props {
38
38
 
39
39
  const props = withDefaults(defineProps<Props>(), {
40
40
  alt: "Image snfas",
41
- cols: "basis-6/12",
41
+ cols: "6",
42
42
  thumbnail: false,
43
43
  noModal:false
44
44
  })
@@ -4,7 +4,6 @@ import { isHtml } from "../../composables/isHtml";
4
4
  import { useMarkdown } from "../../composables/useMarkdown";
5
5
  import EpAccordeon from "../interactions/EpAccordeon.vue";
6
6
 
7
-
8
7
  interface Props {
9
8
  glossary?: any[];
10
9
  content: string;
@@ -25,18 +24,26 @@ const renderTitle = computed(() => {
25
24
 
26
25
  const renderText = computed(() => {
27
26
  if (!props.content) {
28
- return `<div>no data</div>`;
27
+ return `<div></div>`;
29
28
  }
30
29
  if (!isHtml(props.content)) {
31
30
  return useMarkdown(props.content);
32
31
  }
32
+ if(!props.glossary){
33
+ return props.content
34
+ }
33
35
  //return props.content
34
36
  //create a div
35
37
  const div = document.createElement("DIV");
38
+
39
+ //format string
40
+ const contentString = props.content.trim();
41
+ const newFormat = contentString.replace(/<p>/g, '<div style="margin-bottom: 1em;">').replace(/<\/p>/g, '</div>')
36
42
  ///add the html input to the div
37
- div.innerHTML = props.content.trim();
43
+ div.innerHTML = newFormat
38
44
  ///get strign of html
39
45
  let newStr = div.outerHTML;
46
+ //console.log(newStr)
40
47
  //find all span.ep_glossary_item to know the glossary terms in the text
41
48
  const glossaryTerms = div.querySelectorAll(".ep_glossary_item");
42
49
  // console.log(glossaryTerms)
@@ -45,6 +52,7 @@ const renderText = computed(() => {
45
52
  ///check every term and replace it
46
53
  glossaryTerms.forEach((item) => {
47
54
  //get id
55
+
48
56
  const id = item.getAttribute("data-id");
49
57
  //get content text
50
58
  const render_word = item.innerHTML;
@@ -57,7 +65,9 @@ const renderText = computed(() => {
57
65
  //if was found
58
66
  if (term) {
59
67
  ///add the new values to the array
68
+
60
69
  const word = item.outerHTML;
70
+ // console.log(word)
61
71
  //check if the term has relations
62
72
  const foundedRelations = _glossary.filter((x) =>
63
73
  x.relation.some((item: string) => {
@@ -65,40 +75,40 @@ const renderText = computed(() => {
65
75
  })
66
76
  );
67
77
  //get relations id and term
68
- const idsRelation = foundedRelations.map((x) => x.id);
78
+ //const idsRelation = foundedRelations.map((x) => x.id);
69
79
  const termsRelation = foundedRelations.map((x) => x.term);
70
80
  const variation = term.variation;
71
81
  const hasImge = term.src ? term.src : "";
72
- //const replaceWord = `<EpBtn :pts-data="{term:'${term.term}', definition:'${term.definition}', renderword:'${render_word}', graminfo:'${term.graminfo}', domain:'${term.domain}',variation:'${variation}', relations_names:'${termsRelation}', relations_ids:'${idsRelation}'}"></EpBtn>`
73
- const replaceWord = ` <EpTerm term="${term.term}" word="${render_word}" variations="${variation}" graminfo="${term.graminfo}" src='${hasImge}' domain="${term.domain}" relations="${termsRelation}" idrelation="${idsRelation}"> ${term.definition} </EpTerm> `;
82
+ const replaceWord = `<div style="display:inline"><EpTerm term="${term.term}" word="${render_word}" variations="${variation}" graminfo="${term.graminfo}" src="${hasImge}" domain="${term.domain}" relations="${termsRelation}"> ${term.definition}</EpTerm> </div>`;
74
83
  //replace output string
75
84
  newStr = newStr.replace(word, replaceWord);
85
+
76
86
  }
77
87
  });
78
88
  }
79
- div.innerHTML = newStr;
80
- // console.log(div.innerHTML)
81
- return div.innerHTML;
89
+ div.innerHTML = newStr
90
+ return div.innerHTML
82
91
  });
83
92
 
93
+ //console.log(renderText.value)
94
+
84
95
  const myRenderComponent = () => {
85
96
  const r = {
86
97
  components: {
87
- epterm: defineAsyncComponent(()=>import('../medias/EpTerm.vue')),
98
+ epterm: defineAsyncComponent(()=>import('../medias/EpTerm.vue')),
88
99
  },
89
- template: `<div>${renderText.value}</div>`,
100
+ template: `${renderText.value}`,
90
101
  };
91
102
 
92
103
  return h(r);
93
104
  };
94
105
 
95
106
 
96
-
97
107
  const { compact } = toRefs(props);
98
108
  </script>
99
109
 
100
110
  <template>
101
- <div>
111
+ <div class="px-2">
102
112
  <myRenderComponent v-if="!compact"></myRenderComponent>
103
113
  <EpAccordeon outlined :title="renderTitle" v-else>
104
114
  <myRenderComponent></myRenderComponent>
@@ -2,6 +2,7 @@
2
2
  import { ref, computed, defineAsyncComponent, toRefs } from "vue";
3
3
  import {SlidesType} from "../../types/Slides"
4
4
  import { useComponent } from "../../composables/useComponent";
5
+ import { useRenderText } from "../../composables/useRenderText";
5
6
  import { mdiArrowLeft } from "@mdi/js";
6
7
  import { mdiArrowRight } from "@mdi/js";
7
8
  import EpIcon from "../basics/EpIcon.vue";
@@ -82,11 +83,11 @@ const {slides} = toRefs(props)
82
83
  <Transition name="list" mode="out-in">
83
84
  <div class="md:flex p-8" :key="currentSlide.uid">
84
85
  <div class="w-full mr-5 flex items-center" v-if="currentSlideMediaContent">
85
- <component v-if="currentSlide.img" :is="currentSlideMediaContent" :src="currentSlide.img"></component>
86
+ <component v-if="currentSlide.img" :is="currentSlideMediaContent" :src="currentSlide.img" cols="11"></component>
86
87
  <component v-else-if="currentSlide.component" :is="currentSlideMediaContent" v-bind="{...currentSlide.component.data}"></component>
87
88
  </div>
88
89
  <div class="w-full">
89
- <div class="overflow-y-auto h-96 p-custom" v-html="currentSlide.content"></div>
90
+ <div class="overflow-y-auto h-96 p-custom" v-html="useRenderText(currentSlide.content)"></div>
90
91
  </div>
91
92
  </div>
92
93
  </Transition>
@@ -6,16 +6,39 @@ import { useRenderText } from "../../composables/useRenderText";
6
6
  import { mdiImage } from '@mdi/js';
7
7
  import EpEdu from '../educationals/EpEdu.vue';
8
8
 
9
+
10
+
9
11
  interface Props {
10
12
  desc?:string;
11
13
  title?:string;
12
14
  content?:string;
13
15
  mandateLevel?: string | MandateLevel | null;
14
- type?:MediaVariants
16
+ type?:MediaVariants;
17
+ cols?:string | number;
15
18
  }
16
19
 
17
20
  const props = withDefaults(defineProps<Props>(), {
21
+ cols: "6",
22
+ })
23
+
24
+ const Cols = [
25
+ 'basis-6/12',
26
+ 'basis-1/12',
27
+ 'basis-2/12',
28
+ 'basis-3/12',
29
+ 'basis-4/12',
30
+ 'basis-5/12',
31
+ 'basis-6/12',
32
+ 'basis-7/12',
33
+ 'basis-8/12',
34
+ 'basis-9/12',
35
+ 'basis-10/12',
36
+ 'basis-11/12',
37
+ 'basis-12/12',
38
+ ]
18
39
 
40
+ const renderCols = computed(() => {
41
+ return Cols[+props.cols]
19
42
  })
20
43
 
21
44
  const renderText = computed(()=> {
@@ -27,7 +50,7 @@ const renderText = computed(()=> {
27
50
 
28
51
 
29
52
 
30
- const {title, content} = toRefs(props)
53
+ const {title, content, cols} = toRefs(props)
31
54
 
32
55
  </script>
33
56
 
@@ -37,11 +60,11 @@ const {title, content} = toRefs(props)
37
60
  <div v-html="renderText"></div>
38
61
  </template>
39
62
  <template #content>
40
- <div class="flex justify-center">
41
- <div class="w-4/5" v-if="content">
42
- <div v-html="content" class="md:w-96 w-56 mx-auto"></div>
63
+ <div class="flex">
64
+ <div v-if="content" :class="`mx-auto ${renderCols}`">
65
+ <div v-html="content" class="w-full"></div>
66
+ </div>
43
67
  </div>
44
- </div>
45
68
  </template>
46
69
  </EpEdu>
47
70
  </template>
@@ -1,6 +1,7 @@
1
1
  <script setup lang="ts">
2
- import { ref, toRefs, computed, onMounted} from "vue";
2
+ import { ref, toRefs, computed} from "vue";
3
3
  import { useRenderText } from "../../composables/useRenderText";
4
+ import { useRouter } from "vue-router";
4
5
  import { mdiBookmarkMultipleOutline } from "@mdi/js";
5
6
  import EpImg from "../basics/EpImg.vue";
6
7
  import EpIcon from "../basics/EpIcon.vue";
@@ -17,7 +18,7 @@ interface Props {
17
18
  domain?: string;
18
19
  graminfo?: string;
19
20
  relations?: string;
20
- idrelation?: string;
21
+ //idrelation?: string;
21
22
  labelClose?: string;
22
23
  src?:string;
23
24
  }
@@ -33,10 +34,6 @@ const props = withDefaults(defineProps<Props>(), {
33
34
  const show = ref(false);
34
35
 
35
36
 
36
-
37
-
38
-
39
-
40
37
  const subtitle = computed(() => {
41
38
  if (props.term !== props.word) {
42
39
  return `(${props.word})`;
@@ -62,14 +59,23 @@ const renderRelations = computed(() => {
62
59
  return renderRelations;
63
60
  });
64
61
 
65
- const relationsID = computed(() => {
66
- let relationsID = null;
67
- let valueprops = props.idrelation?.trim();
68
- if (valueprops?.length > 0) {
69
- relationsID = valueprops.split(",");
62
+
63
+ const router = useRouter()
64
+ const goto = (term:string) =>{
65
+ if(router.hasRoute('glossary')){
66
+ router.push({ path: "/glossary", query:{word:term} });
70
67
  }
71
- return relationsID;
72
- });
68
+ //console.log(router.hasRoute('signages'))
69
+ //
70
+ }
71
+ // const relationsID = computed(() => {
72
+ // let relationsID = null;
73
+ // let valueprops = props.idrelation?.trim();
74
+ // if (valueprops?.length > 0) {
75
+ // relationsID = valueprops.split(",");
76
+ // }
77
+ // return relationsID;
78
+ // });
73
79
 
74
80
  const renderDomain = computed(() => {
75
81
  if (props.domain === "null") {
@@ -81,12 +87,12 @@ const renderDomain = computed(() => {
81
87
  const toggleModal = () => {
82
88
  show.value = !show.value
83
89
  }
84
-
90
+ /*
85
91
  const el = (contentref:any) => {
86
92
  const contentHtml = contentref.innerHTML
87
93
  const renderHtml = useRenderText(contentHtml)
88
94
  contentref.innerHTML = renderHtml
89
- }
95
+ }*/
90
96
 
91
97
  const { term, graminfo, labelClose, src } = toRefs(props);
92
98
  </script>
@@ -128,7 +134,7 @@ const { term, graminfo, labelClose, src } = toRefs(props);
128
134
  >
129
135
  </div>
130
136
  <!-- <div v-html="renderText"></div> -->
131
- <div :ref="el">
137
+ <div>
132
138
  <slot></slot>
133
139
  </div>
134
140
  <EpImg v-if="src" :src="src"></EpImg>
@@ -142,14 +148,16 @@ const { term, graminfo, labelClose, src } = toRefs(props);
142
148
  </div>
143
149
  <div class="text-sm mt-2" v-if="renderRelations">
144
150
  <span class="mr-2 font-bold">Relations :</span>
145
- <EpBtn
146
- v-for="(relation, i) in renderRelations"
147
- :key="`relation-${i}`"
148
- size="small"
149
- rounded
150
- extra-class="mr-2"
151
- >{{ relation }}</EpBtn
152
- >
151
+ <template v-for="(relation, i) in renderRelations"
152
+ :key="`relation-${i}`">
153
+ <EpBtn
154
+ size="small"
155
+ rounded
156
+ extra-class="mr-2"
157
+ @click="goto(relation)"
158
+ >{{ relation }}</EpBtn>
159
+ </template>
160
+
153
161
  </div>
154
162
  <div class="flex justify-end">
155
163
  <EpBtn type="error" outlined @click="show = false" rounded>{{
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { ref, toRefs, onMounted, computed } from 'vue';
3
3
  //types in capital letter
4
- import {TagTimeLine, HeadTimeLine, EventTimeLine, ColorsTags, colorsTimeLine} from '../../types/TimeLine'
4
+ import { TagTimeLine, HeadTimeLine, EventTimeLine, ColorsTags, colorsTimeLine } from '../../types/TimeLine'
5
5
  import TimeLineItem from '../tools/TimelineItem.vue'
6
6
  import EpIcon from '../basics/EpIcon.vue';
7
7
  import { mdiCheckboxBlankCircleOutline } from '@mdi/js';
@@ -9,83 +9,89 @@ import { mdiCheckboxMarkedCircle } from '@mdi/js';
9
9
 
10
10
  interface TimelineHeading {
11
11
  title?: {
12
- text?:HeadTimeLine
12
+ text?: HeadTimeLine
13
13
  }
14
14
  }
15
15
 
16
16
  interface Props {
17
- tags:TagTimeLine[];
18
- events:EventTimeLine[];
19
- title?:TimelineHeading;
17
+ tags: TagTimeLine[];
18
+ events: EventTimeLine[];
19
+ title?: TimelineHeading;
20
20
  }
21
21
 
22
- const props = withDefaults(defineProps<Props>(),{})
22
+
23
+
24
+ const props = withDefaults(defineProps<Props>(), {
25
+
26
+ })
23
27
 
24
28
  const timeLineTags = ref<TagTimeLine[]>()
25
29
 
26
- onMounted(()=> {
27
- if(props.tags){
28
- timeLineTags.value = props.tags.map(tag => ({...tag, active:false}))
30
+ onMounted(() => {
31
+ if (props.tags) {
32
+ timeLineTags.value = props.tags.map(tag => ({ ...tag, active: false }))
29
33
  }
30
34
  })
31
35
 
32
- const styleTag = (color:ColorsTags) => {
33
- const styles = colorsTimeLine[color]
34
- if(!styles){
35
- return colorsTimeLine.noTag
36
- }
37
- return styles
36
+ const styleTag = (color: ColorsTags) => {
37
+ const styles = colorsTimeLine[color]
38
+ if (!styles) {
39
+ return colorsTimeLine.noTag
40
+ }
41
+ return styles
38
42
  }
39
43
 
40
- const activeTags = computed(()=>{
41
- return timeLineTags.value?.filter(tag => tag.active) || []
44
+ const activeTags = computed(() => {
45
+ return timeLineTags.value?.filter(tag => tag.active) || []
42
46
  })
43
47
 
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
48
+ const filteredEvents = computed(() => {
49
+ if (activeTags.value.length === 0) {
50
+ return props.events
51
+ } else {
52
+ const filtered = props.events.filter(event => {
53
+ if (event.tag) {
54
+ ///event.tag.id === this.activesTags.some(t => t.id)
55
+ return activeTags.value.some(t => t.id === event.tag?.id)
55
56
  }
57
+ })
58
+ return filtered
59
+ }
56
60
  })
57
61
 
58
- const toggleActive = (tag:TagTimeLine) => {
59
- tag.active = !tag.active
62
+ const toggleActive = (tag: TagTimeLine) => {
63
+ tag.active = !tag.active
60
64
  }
61
65
 
62
- const {title} = toRefs(props)
66
+
67
+ const { title } = toRefs(props)
63
68
 
64
69
  </script>
65
70
 
66
71
  <template>
67
72
  <!-- component -->
68
- <div>
69
- <div class="w-10/12 md:w-7/12 lg:6/12 mx-auto relative">
73
+ <div>
74
+ <div class="w-10/12 mx-auto relative">
70
75
  <h3 class="text-2xl mb-2">{{ title?.title?.text?.headline }}</h3>
71
76
  <p>{{ title?.title?.text?.text }}</p>
72
- <div class="my-4">
73
- <template v-for="tag in timeLineTags" :key="tag.id">
74
- <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:''}`">
75
- {{ tag.title }} <EpIcon :icon-path="tag.active?mdiCheckboxMarkedCircle:mdiCheckboxBlankCircleOutline" size="14"></EpIcon>
76
- </span>
77
- </template>
78
- </div>
77
+ <div class="my-4 px-2">
78
+ <template v-for="tag in timeLineTags" :key="tag.id">
79
+ <span @click="toggleActive(tag)"
80
+ :class="`mr-2 mb-2 inline-block 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 : ''}`">
81
+ {{ tag.title }} <EpIcon :icon-path="tag.active ? mdiCheckboxMarkedCircle : mdiCheckboxBlankCircleOutline"
82
+ size="14"></EpIcon>
83
+ </span>
84
+ </template>
85
+ </div>
79
86
  <div class="border-l-4 pl-1 transition-all">
80
- <TransitionGroup name="list" tag="ul">
81
- <template v-for="(item, i) in filteredEvents" :key="`${i}-card-${item.id}`">
82
- <TimeLineItem :event="item"></TimeLineItem>
87
+ <TransitionGroup name="list" tag="div">
88
+ <template v-for="(item, i) in filteredEvents" :key="`${i}-card-${item.id}`">
89
+ <TimeLineItem :event="item"></TimeLineItem>
83
90
  </template>
84
- </TransitionGroup>
91
+ </TransitionGroup>
85
92
  </div>
86
93
  </div>
87
- </div>
88
-
94
+ </div>
89
95
  </template>
90
96
 
91
97
  <style>
@@ -93,6 +99,7 @@ const {title} = toRefs(props)
93
99
  .list-leave-active {
94
100
  transition: all 0.5s ease;
95
101
  }
102
+
96
103
  .list-enter-from,
97
104
  .list-leave-to {
98
105
  opacity: 0;
@@ -0,0 +1,17 @@
1
+ <script setup lang="ts">
2
+
3
+ //props
4
+ //square
5
+ //rounded
6
+ //an animate
7
+
8
+ //https://mui.com/material-ui/react-skeleton/
9
+ //https://ui.nuxt.com/layout/skeleton
10
+
11
+
12
+ </script>
13
+ <template>
14
+ <div>
15
+ skeleton
16
+ </div>
17
+ </template>
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { ref, toRefs, onMounted, computed } from "vue";
2
+ import { ref, toRefs, onMounted, computed, watch } from "vue";
3
3
  import { useImage } from '@vueuse/core'
4
4
  import { useRenderText } from "../../composables/useRenderText";
5
5
  ///types with Capital letters... object with styles same name in lowercase
@@ -10,18 +10,19 @@ interface Props {
10
10
  title?: string | null;
11
11
  date?: string;
12
12
  event: EventTimeLine;
13
+ collapse?:boolean
13
14
  }
14
15
 
15
16
  const props = withDefaults(defineProps<Props>(), {
16
17
  title: 'En savoir plus',
17
18
  type: 'base',
19
+ collapse:false
18
20
  });
19
21
 
20
22
 
21
23
  const showDiv = ref(true);
22
24
  const collapsible = ref();
23
25
 
24
-
25
26
  onMounted(() => {
26
27
  var content = collapsible.value
27
28
  if (showDiv.value) {
@@ -88,7 +89,6 @@ const { event } = toRefs(props)
88
89
 
89
90
  <template>
90
91
  <div
91
-
92
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
93
  @click="toggleDivVisibility">
94
94
  <!-- Dot -->
@@ -1,5 +0,0 @@
1
- import { L as m } from "./index-58100a64.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { M as m } from "./index-58100a64.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { I as m } from "./index-58100a64.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { z as m } from "./index-58100a64.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { c as m } from "./index-58100a64.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { o as a } from "./index-58100a64.js";
2
- import "vue";
3
- export {
4
- a as default
5
- };
@@ -1,5 +0,0 @@
1
- import { d as m } from "./index-58100a64.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { e as m } from "./index-58100a64.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { w as m } from "./index-58100a64.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { g as m } from "./index-58100a64.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { r as a } from "./index-58100a64.js";
2
- import "vue";
3
- export {
4
- a as default
5
- };
@@ -1,5 +0,0 @@
1
- import { h as m } from "./index-58100a64.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { J as m } from "./index-58100a64.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { A as m } from "./index-58100a64.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };