ep-lib-ts 1.0.47 → 1.0.48
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-kLycvFEF.js +4 -0
- package/dist/Details-Op3Zkhcg.js +4 -0
- package/dist/DisplayBox-DGsKoxmr.js +4 -0
- package/dist/{Ep360Image-CQJBPImD.js → Ep360Image-DHK_IWTi.js} +1 -1
- package/dist/{Ep360Video-CL_7mOiQ.js → Ep360Video-C4PekHTc.js} +1 -1
- package/dist/EpAlert-aWrJokXa.js +4 -0
- package/dist/EpAudio-DGFoC0Go.js +4 -0
- package/dist/EpAvatar-1yU-OXsu.js +4 -0
- package/dist/EpBadge-BlIhFCIg.js +4 -0
- package/dist/EpBarChart-KgYdXvMq.js +4 -0
- package/dist/EpBtn-S1mCeeV7.js +4 -0
- package/dist/EpCard-COy2GODb.js +4 -0
- package/dist/EpCardLink-SBppyTrI.js +4 -0
- package/dist/EpChip-CNRaxrjP.js +4 -0
- package/dist/EpCodeblock-NyXHH5gD.js +4 -0
- package/dist/EpConclusion-CUWiK_nt.js +4 -0
- package/dist/EpContentSlider-mpqkd2T2.js +4 -0
- package/dist/{EpDarkmode-DKSyFe8_.js → EpDarkmode-C5NMN4h2.js} +1 -1
- package/dist/EpDescription-Dewh9Bmr.js +4 -0
- package/dist/EpDivider-C_cgaXNK.js +4 -0
- package/dist/EpDocument-CmN-KUVt.js +4 -0
- package/dist/{EpDraggable-B6I1LZM8.js → EpDraggable-BwpIpRyf.js} +46 -46
- package/dist/EpEdu-BRXEfH5H.js +4 -0
- package/dist/EpFlex-UUXOmWtZ.js +4 -0
- package/dist/EpFunnelChart-DgkcR1ON.js +4 -0
- package/dist/EpHeader-DeiRUZRl.js +4 -0
- package/dist/EpHover-BKK7j48J.js +4 -0
- package/dist/EpHoverCard-6ZKNpNBq.js +4 -0
- package/dist/EpIcon-C3jjducH.js +4 -0
- package/dist/EpIframe-CoaO5gb_.js +4 -0
- package/dist/EpImg-iypQu6WK.js +4 -0
- package/dist/EpImgCarousel-vagns6kd.js +4 -0
- package/dist/{EpInput-BLfdye3a.js → EpInput-uDeg10dD.js} +29 -29
- package/dist/EpInstructions-C2JYulUa.js +4 -0
- package/dist/EpIntroduction-BJXDxfYV.js +4 -0
- package/dist/EpLineChart-BVlswUIa.js +4 -0
- package/dist/EpLink-DPR3gH7f.js +4 -0
- package/dist/EpLinkVersion-DqQvfQQT.js +4 -0
- package/dist/{EpList-snrOZLuu.js → EpList-BI7oPTHl.js} +1 -1
- package/dist/EpModal-DN-QQzrQ.js +4 -0
- package/dist/{EpNothing-ChU4qO5j.js → EpNothing-z596jG9D.js} +1 -1
- package/dist/EpObjective-sNcUzMGj.js +4 -0
- package/dist/EpPieChart-CCgGmemH.js +4 -0
- package/dist/EpQuestion-DJ-1vSS6.js +4 -0
- package/dist/EpQuote-BWRF6A-L.js +4 -0
- package/dist/EpRadio-BLbK_ijo.js +4 -0
- package/dist/EpRadioSummative-BtiAeyHR.js +4 -0
- package/dist/EpReading-C78Icl4m.js +4 -0
- package/dist/EpResource-C_JQvg2g.js +4 -0
- package/dist/EpScope-D1e7l9RQ.js +4 -0
- package/dist/EpSection-C9VobPvp.js +4 -0
- package/dist/EpSectionCols-D9DqSfNG.js +4 -0
- package/dist/EpSkeleton-Cc3nfQlv.js +4 -0
- package/dist/EpSoftware-Bga9b4WM.js +4 -0
- package/dist/EpSpecificObjective-C9MHA7ez.js +4 -0
- package/dist/EpSpinner-BOpURQEs.js +4 -0
- package/dist/EpStackedList-BdIF2Obj.js +4 -0
- package/dist/EpSummativeTable-BTLrKIHA.js +4 -0
- package/dist/EpSvg-CJfC1DMY.js +4 -0
- package/dist/EpSvgShow-SnjMv4b2.js +4 -0
- package/dist/EpTable--hx3As1M.js +4 -0
- package/dist/EpTerm-l4uolPHU.js +4 -0
- package/dist/EpText-Dvi-oAJe.js +4 -0
- package/dist/EpTimeLine-BeRMD8rW.js +4 -0
- package/dist/EpVideo-D4DR93ep.js +4 -0
- package/dist/EpVideoPanopto-CVjjy9Nn.js +4 -0
- package/dist/EpWordDef-DRBqhyxR.js +4 -0
- package/dist/TextMedia-LKMaVja3.js +4 -0
- package/dist/components/educationals/EpBranchingScenario.vue.d.ts +43 -6
- package/dist/components/educationals/EpDocument.vue.d.ts +44 -0
- package/dist/components/medias/EpHierarchy.vue.d.ts +51 -0
- package/dist/components/medias/EpSoftware.vue.d.ts +0 -1
- package/dist/components/tools/Details.vue.d.ts +3 -1
- package/dist/components/tools/{TextImg.vue.d.ts → TextMedia.vue.d.ts} +3 -2
- package/dist/ep-lib-ts.js +41 -39
- package/dist/ep-lib-ts.umd.cjs +212 -212
- package/dist/{index-QY-UvpNr.js → index-DH1gIdAA.js} +1 -1
- package/dist/{index-D6RVSyf7.js → index-DeiLPw0s.js} +10899 -8250
- package/dist/index.d.ts +3 -1
- package/dist/{prism-Cv4D8Rjm.js → prism-BvbRGWPO.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{three.module-CWLs6nMo.js → three.module-B-oqC8Xk.js} +1 -1
- package/dist/types/Component.d.ts +7 -0
- package/dist/types/Hierarchy.d.ts +14 -0
- package/package.json +11 -1
- package/src/components/basics/EpBtn.vue +1 -1
- package/src/components/educationals/EpBranchingScenario.vue +202 -172
- package/src/components/educationals/EpDocument.vue +92 -0
- package/src/components/interactions/EpContentSlider.vue +1 -1
- package/src/components/medias/EpHierarchy.vue +345 -0
- package/src/components/medias/EpSoftware.vue +1 -2
- package/src/components/tools/Details.vue +8 -10
- package/src/components/tools/TextMedia.vue +34 -0
- package/dist/BgAudio-CFZeS_dQ.js +0 -4
- package/dist/Details-D_yxeUuE.js +0 -4
- package/dist/DisplayBox-D8hlc9Gn.js +0 -4
- package/dist/EpAlert-RMp39gBY.js +0 -4
- package/dist/EpAudio-VXqSaCc0.js +0 -4
- package/dist/EpAvatar-CoBsHAyN.js +0 -4
- package/dist/EpBadge-Di0ORWOa.js +0 -4
- package/dist/EpBarChart-D0FaZPGz.js +0 -4
- package/dist/EpBtn-D5wu8yT7.js +0 -4
- package/dist/EpCard-Drdckmbx.js +0 -4
- package/dist/EpCardLink-DUGjSAGF.js +0 -4
- package/dist/EpChip-DDochFMT.js +0 -4
- package/dist/EpCodeblock-BjxiWHoc.js +0 -4
- package/dist/EpConclusion-CXoGHiG1.js +0 -4
- package/dist/EpContentSlider-HBkmUIw5.js +0 -4
- package/dist/EpDescription-BmRR6d2p.js +0 -4
- package/dist/EpDivider-BALEThPk.js +0 -4
- package/dist/EpEdu-D7erj5ED.js +0 -4
- package/dist/EpFlex-CdriG_tC.js +0 -4
- package/dist/EpFunnelChart-HVjlJWQd.js +0 -4
- package/dist/EpHeader-Bl4162yt.js +0 -4
- package/dist/EpHover-CVY1squO.js +0 -4
- package/dist/EpHoverCard-BIuPau4X.js +0 -4
- package/dist/EpIcon-DsCeMM28.js +0 -4
- package/dist/EpIframe-Cz5g1BYb.js +0 -4
- package/dist/EpImg-Ccr76yR5.js +0 -4
- package/dist/EpImgCarousel-Ddz1Ur0L.js +0 -4
- package/dist/EpInstructions-B-b52LnB.js +0 -4
- package/dist/EpIntroduction-DEaiE8_Q.js +0 -4
- package/dist/EpLineChart-CJ28vhHx.js +0 -4
- package/dist/EpLink-DRGrCSOs.js +0 -4
- package/dist/EpLinkVersion-DJcPV4xm.js +0 -4
- package/dist/EpModal-m4szNip0.js +0 -4
- package/dist/EpObjective-CAXtephy.js +0 -4
- package/dist/EpPieChart-B3l-Y3E9.js +0 -4
- package/dist/EpQuestion-CrXTzzzu.js +0 -4
- package/dist/EpQuote-Dc-IZjOX.js +0 -4
- package/dist/EpRadio-CA0CASuz.js +0 -4
- package/dist/EpRadioSummative-Bm2JDs6z.js +0 -4
- package/dist/EpReading-BNArWsC2.js +0 -4
- package/dist/EpResource-Bx1G7Dlz.js +0 -4
- package/dist/EpScope-CB6RuO3X.js +0 -4
- package/dist/EpSection-BUBgMeo9.js +0 -4
- package/dist/EpSectionCols-rigTAR3l.js +0 -4
- package/dist/EpSkeleton-B9HFmS5A.js +0 -4
- package/dist/EpSoftware-CK9VPoFF.js +0 -4
- package/dist/EpSpecificObjective-Dm-H_StM.js +0 -4
- package/dist/EpSpinner-Br8tW9f2.js +0 -4
- package/dist/EpStackedList-By0U0h1R.js +0 -4
- package/dist/EpSummativeTable-Czo4hRQq.js +0 -4
- package/dist/EpSvg-BVV9GJ09.js +0 -4
- package/dist/EpSvgShow-DSPDvQlK.js +0 -4
- package/dist/EpTable-CNPciiRt.js +0 -4
- package/dist/EpTerm-BjD-0L65.js +0 -4
- package/dist/EpText-8IGa40sW.js +0 -4
- package/dist/EpTimeLine-D5R81tuv.js +0 -4
- package/dist/EpVideo-v6GnvLIU.js +0 -4
- package/dist/EpVideoPanopto-BWVr3ji1.js +0 -4
- package/dist/EpWordDef-QB2ioxjp.js +0 -4
- package/dist/TextImg-B_cSkkBi.js +0 -4
- package/src/components/tools/TextImg.vue +0 -28
package/dist/index.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ import { default as EpDescription } from './components/educationals/EpDescriptio
|
|
|
29
29
|
import { default as EpConclusion } from './components/educationals/EpConclusion.vue';
|
|
30
30
|
import { default as EpCodeblock } from './components/educationals/EpCodeblock.vue';
|
|
31
31
|
import { default as EpBranchingScenario } from './components/educationals/EpBranchingScenario.vue';
|
|
32
|
+
import { default as EpDocument } from './components/educationals/EpDocument.vue';
|
|
32
33
|
import { default as EpAccordeon } from './components/interactions/EpAccordeon.vue';
|
|
33
34
|
import { default as EpContentSlider } from './components/interactions/EpContentSlider.vue';
|
|
34
35
|
import { default as EpModal } from './components/interactions/EpModal.vue';
|
|
@@ -50,9 +51,10 @@ import { default as EpVideo } from './components/medias/EpVideo.vue';
|
|
|
50
51
|
import { default as EpVideoPanopto } from './components/medias/EpVideoPanopto.vue';
|
|
51
52
|
import { default as EpWordDef } from './components/medias/EpWordDef.vue';
|
|
52
53
|
import { default as EpCardLink } from './components/medias/EpCardLink.vue';
|
|
54
|
+
import { default as EpHierarchy } from './components/medias/EpHierarchy.vue';
|
|
53
55
|
import { default as EpAlert } from './components/signages/EpAlert.vue';
|
|
54
56
|
import { default as EpHeader } from './components/signages/EpHeader.vue';
|
|
55
57
|
import { default as EpQuote } from './components/signages/EpQuote.vue';
|
|
56
58
|
import { default as EpSkeleton } from './components/signages/EpSkeleton.vue';
|
|
57
59
|
|
|
58
|
-
export { EpBadge, EpBtn, EpCard, EpChip, EpDivider, EpFlex, EpIcon, EpImg, EpSection, EpSpinner, EpTable, EpBarChart, EpLineChart, EpPieChart, EpFunnelChart, EpText, EpEdu, EpReading, EpResource, EpScope, EpAccordeon, EpContentSlider, EpModal, EpQuestion, EpTabs, EpAudio, EpCarousel, EpIframe, EpKatex, EpLink, EpLinkVersion, EpSoftware, EpSvg, EpTerm, EpTimeLine, EpVideo, EpVideoPanopto, EpAlert, EpHeader, EpQuote, EpSkeleton, EpWordDef, EpSummativeTable, EpObjective, EpSpecificObjective, EpIntroduction, EpInstructions, EpDescription, EpConclusion, EpCodeblock, EpSectionCols, EpCardLink, EpStackedList, EpHoverCard, EpBranchingScenario, EpSvgShow };
|
|
60
|
+
export { EpBadge, EpBtn, EpCard, EpChip, EpDivider, EpFlex, EpIcon, EpImg, EpSection, EpSpinner, EpTable, EpBarChart, EpLineChart, EpPieChart, EpFunnelChart, EpText, EpEdu, EpReading, EpResource, EpScope, EpAccordeon, EpContentSlider, EpModal, EpQuestion, EpTabs, EpAudio, EpCarousel, EpIframe, EpKatex, EpLink, EpLinkVersion, EpSoftware, EpSvg, EpTerm, EpTimeLine, EpVideo, EpVideoPanopto, EpAlert, EpHeader, EpQuote, EpSkeleton, EpWordDef, EpSummativeTable, EpObjective, EpSpecificObjective, EpIntroduction, EpInstructions, EpDescription, EpConclusion, EpCodeblock, EpSectionCols, EpCardLink, EpStackedList, EpHoverCard, EpBranchingScenario, EpSvgShow, EpHierarchy, EpDocument };
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.content[data-v-3a321611]{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}pre{white-space:break-spaces}@keyframes fade-
|
|
1
|
+
.content[data-v-3a321611]{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}pre{white-space:break-spaces}.tree-wrapper[data-v-bc317bc6]{overflow:auto;border:1px solid #ddd}.tree-container[data-v-bc317bc6]{width:100%;overflow-x:auto}@keyframes fade-1e22db06{0%{opacity:0}to{opacity:1}}@keyframes scale-1e22db06{0%{transform:scale(.5);opacity:0}to{transform:scale(1);opacity:1}}@keyframes slideY-1e22db06{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}.fade[data-v-1e22db06]{animation:fade-1e22db06 1s}.scale[data-v-1e22db06]{animation:scale-1e22db06 1s}.slideY[data-v-1e22db06]{animation:slideY-1e22db06 1s}.shape{height:var(--57a4c52c);width:var(--32b5e5ba)}.v-enter-active[data-v-7e484601],.v-leave-active[data-v-7e484601]{transition:opacity .5s ease}.v-enter-from[data-v-7e484601],.v-leave-to[data-v-7e484601]{opacity:0}.katex[data-v-a5d595cd]{font-size:1.6em}.content[data-v-1ad88e28]{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)}.arrow-light-top:before{content:" ";position:absolute;top:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:rgba(0,0,0,.2) transparent transparent transparent}.arrow-dark-top:before{content:" ";position:absolute;top:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:black transparent transparent transparent}.arrow-light-bottom:before{content:"";position:absolute;display:inline-block;left:50%;bottom:100%;border-right:7px solid transparent;border-bottom:7px solid #eee;border-left:7px solid transparent;border-bottom-color:#0003}.arrow-dark-bottom:before{content:"";position:absolute;display:inline-block;left:50%;bottom:100%;border-right:7px solid transparent;border-bottom:7px solid black;border-left:7px solid transparent;border-bottom-color:black transparent transparent transparent}.arrow-light-left:before{position:absolute;display:inline-block;left:100%;top:50%;content:"";margin-right:0;border-top:5px solid transparent;border-left:5px solid #eee;border-bottom:5px solid transparent;border-left-color:#0003}.arrow-dark-left:before{position:absolute;display:inline-block;left:100%;top:50%;content:"";margin-right:0;border-top:5px solid transparent;border-left:5px solid black;border-bottom:5px solid transparent;border-left-color:black transparent transparent transparent}.arrow-light-right:before{position:absolute;display:inline-block;right:100%;top:50%;content:"";margin-right:0;border-top:5px solid transparent;border-right:5px solid #eee;border-bottom:5px solid transparent;border-right-color:#0003}.arrow-dark-right:before{position:absolute;display:inline-block;right:100%;top:50%;content:"";margin-right:0;border-top:5px solid transparent;border-right:5px solid black;border-bottom:5px solid transparent;border-right-color:black transparent transparent transparent}
|
|
@@ -12145,7 +12145,7 @@ class Mw extends ai {
|
|
|
12145
12145
|
const t = this.geometry, e = this.pointMap, i = 1, r = 1;
|
|
12146
12146
|
Me.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse);
|
|
12147
12147
|
const s = this.camera.coordinateSystem === Wn ? -1 : 0;
|
|
12148
|
-
Be("c", e, t, Me, 0, 0, s), Be("t", e, t, Me, 0, 0, 1), Be("n1", e, t, Me, -
|
|
12148
|
+
Be("c", e, t, Me, 0, 0, s), Be("t", e, t, Me, 0, 0, 1), Be("n1", e, t, Me, -i, -r, s), Be("n2", e, t, Me, i, -r, s), Be("n3", e, t, Me, -i, r, s), Be("n4", e, t, Me, i, r, s), Be("f1", e, t, Me, -i, -r, 1), Be("f2", e, t, Me, i, -r, 1), Be("f3", e, t, Me, -i, r, 1), Be("f4", e, t, Me, i, r, 1), Be("u1", e, t, Me, i * 0.7, r * 1.1, s), Be("u2", e, t, Me, -i * 0.7, r * 1.1, s), Be("u3", e, t, Me, 0, r * 2, s), Be("cf1", e, t, Me, -i, 0, 1), Be("cf2", e, t, Me, i, 0, 1), Be("cf3", e, t, Me, 0, -r, 1), Be("cf4", e, t, Me, 0, r, 1), Be("cn1", e, t, Me, -i, 0, s), Be("cn2", e, t, Me, i, 0, s), Be("cn3", e, t, Me, 0, -r, s), Be("cn4", e, t, Me, 0, r, s), t.getAttribute("position").needsUpdate = !0;
|
|
12149
12149
|
}
|
|
12150
12150
|
dispose() {
|
|
12151
12151
|
this.geometry.dispose(), this.material.dispose();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NestedComponents } from './Component';
|
|
2
|
+
|
|
3
|
+
export interface TreeNode {
|
|
4
|
+
name: string;
|
|
5
|
+
children?: TreeNode[];
|
|
6
|
+
active?: boolean;
|
|
7
|
+
text?: string;
|
|
8
|
+
component?: NestedComponents;
|
|
9
|
+
}
|
|
10
|
+
type TailwindShade = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800;
|
|
11
|
+
type TailwindColor = 'main-color' | 'primary' | 'red' | 'orange' | 'amber' | 'yellow' | 'lime' | 'green' | 'emerald' | 'teal' | 'cyan' | 'sky' | 'blue' | 'indigo' | 'violet' | 'purple' | 'fuchsia' | 'pink' | 'rose';
|
|
12
|
+
export type ColorPath = `stroke-${TailwindColor}-${TailwindShade}`;
|
|
13
|
+
export type ColorRect = `fill-${TailwindColor}-${TailwindShade}`;
|
|
14
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ep-lib-ts",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.48",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
7
7
|
"src/components/"
|
|
@@ -28,11 +28,21 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@lottiefiles/dotlottie-vue": "^0.5.6",
|
|
30
30
|
"@mdi/js": "^7.4.47",
|
|
31
|
+
"@types/d3-array": "^3.2.1",
|
|
32
|
+
"@types/d3-hierarchy": "^3.1.7",
|
|
33
|
+
"@types/d3-selection": "^3.0.11",
|
|
34
|
+
"@types/d3-shape": "^3.1.7",
|
|
35
|
+
"@types/d3-zoom": "^3.0.8",
|
|
31
36
|
"@types/three": "^0.170.0",
|
|
32
37
|
"@vueuse/core": "^10.9.0",
|
|
33
38
|
"@wdns/vue-code-block": "^2.3.3",
|
|
34
39
|
"aframe": "^1.6.0",
|
|
35
40
|
"apexcharts": "3.53.0",
|
|
41
|
+
"d3-array": "^3.2.4",
|
|
42
|
+
"d3-hierarchy": "^3.1.2",
|
|
43
|
+
"d3-selection": "^3.0.0",
|
|
44
|
+
"d3-shape": "^3.2.0",
|
|
45
|
+
"d3-zoom": "^3.0.0",
|
|
36
46
|
"katex": "^0.16.11",
|
|
37
47
|
"markdown-it": "^14.1.0",
|
|
38
48
|
"postcss-cli": "^11.0.0",
|
|
@@ -80,7 +80,7 @@ const { disabled, prependIcon, appendIcon } = toRefs(props);
|
|
|
80
80
|
<slot></slot>
|
|
81
81
|
<EpIcon v-if="appendIcon" :iconPath="appendIcon" :size="sizeIcon" extraClass="ml-2"></EpIcon>
|
|
82
82
|
</button>
|
|
83
|
-
<a :class="`${styles}
|
|
83
|
+
<a :class="`${styles} flex justify-center items-center`" :disabled="disabled" :href="href" target="_blank" v-else>
|
|
84
84
|
<EpIcon v-if="prependIcon" :iconPath="prependIcon" :size="sizeIcon" extraClass="mr-2"></EpIcon>
|
|
85
85
|
<slot></slot>
|
|
86
86
|
<EpIcon v-if="appendIcon" :iconPath="appendIcon" :size="sizeIcon" extraClass="ml-2"></EpIcon>
|
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import { ref, computed } from "vue";
|
|
4
4
|
import { useRenderText } from '../../composables/useRenderText';
|
|
5
|
+
import type { NestedComponents } from "../../types/Component";
|
|
6
|
+
import type { TreeNode, ColorPath, ColorRect } from "../../types/Hierarchy";
|
|
5
7
|
import EpIcon from '../../components/basics/EpIcon.vue';
|
|
6
|
-
import { mdiArrowLeft } from "@mdi/js";
|
|
7
|
-
import TextImg from "../tools/TextImg.vue";
|
|
8
8
|
import Details from "../tools/Details.vue";
|
|
9
|
+
import EpModal from "../interactions/EpModal.vue";
|
|
10
|
+
import EpHierarchy from "../medias/EpHierarchy.vue";
|
|
11
|
+
import EpBtn from "../basics/EpBtn.vue";
|
|
12
|
+
import { mdiArrowLeft } from "@mdi/js";
|
|
13
|
+
import TextMedia from "../tools/TextMedia.vue";
|
|
9
14
|
|
|
10
15
|
|
|
11
16
|
// Defining the props
|
|
@@ -13,220 +18,262 @@ import Details from "../tools/Details.vue";
|
|
|
13
18
|
interface Option {
|
|
14
19
|
name: string;
|
|
15
20
|
question: string;
|
|
16
|
-
|
|
21
|
+
media?:NestedComponents;
|
|
17
22
|
options?: Option[];
|
|
18
23
|
}
|
|
19
24
|
|
|
20
|
-
interface Choice {
|
|
21
|
-
question:string;
|
|
22
|
-
choice:string;
|
|
23
|
-
img?:string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
25
|
interface Props {
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
title: string;
|
|
27
|
+
media?:NestedComponents;
|
|
29
28
|
initialInstruction?: string | null;
|
|
30
29
|
generalFeedback?: string;
|
|
31
30
|
bgColor?: string;
|
|
31
|
+
|
|
32
32
|
decisionTree: {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
name: string;
|
|
34
|
+
question:string;
|
|
35
|
+
media?: NestedComponents;
|
|
36
|
+
options?: Option[];
|
|
36
37
|
};
|
|
37
38
|
transitionAnimation?: "fade" | "scale" | "slideY";
|
|
39
|
+
labelStart?:string;
|
|
40
|
+
labelFinish?:string;
|
|
41
|
+
labelYourPath?:string;
|
|
42
|
+
labelShowFullPath?:string;
|
|
43
|
+
labelClose?:string;
|
|
44
|
+
labelRestart?:string;
|
|
45
|
+
colorPath?:ColorPath;
|
|
46
|
+
colorRect?:ColorRect;
|
|
47
|
+
isCluster?:boolean
|
|
38
48
|
}
|
|
39
49
|
|
|
40
|
-
|
|
41
50
|
const props = withDefaults(defineProps<Props>(), {
|
|
42
51
|
initialInstruction: null,
|
|
43
|
-
transitionAnimation: "fade"
|
|
52
|
+
transitionAnimation: "fade",
|
|
53
|
+
labelFinish:"Vous avez terminé le scénario!",
|
|
54
|
+
labelYourPath:"Votre parcours",
|
|
55
|
+
labelShowFullPath:"Voir le parcours au complet",
|
|
56
|
+
labelClose:"Fermer",
|
|
57
|
+
labelRestart:"Recommencer",
|
|
58
|
+
labelStart:"Commencer",
|
|
59
|
+
colorRect:'fill-main-color-400',
|
|
60
|
+
colorPath:'stroke-yellow-400'
|
|
44
61
|
});
|
|
45
62
|
|
|
46
63
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
const currentSlide = ref(0);
|
|
52
|
-
const currentOption = ref<null | any>(null);
|
|
64
|
+
const showPath = ref(false)
|
|
65
|
+
const path = ref<Option[]>([])
|
|
66
|
+
const userPath = ref<TreeNode|null>(null)
|
|
67
|
+
const currentOption = ref<Option | null>(null);
|
|
53
68
|
|
|
54
69
|
|
|
55
70
|
// Manage the introductory part
|
|
56
71
|
const isIntroductoryPart = ref(true);
|
|
57
72
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
for (let i = 0; i < itinerary.length; i++) {
|
|
63
|
-
option = option.options[itinerary[i]];
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return (option !== props.decisionTree)? option : null;
|
|
67
|
-
};
|
|
73
|
+
const start = () => {
|
|
74
|
+
isIntroductoryPart.value = false
|
|
75
|
+
currentOption.value = props.decisionTree
|
|
76
|
+
}
|
|
68
77
|
|
|
69
78
|
|
|
70
79
|
|
|
71
80
|
// Return function
|
|
72
|
-
|
|
73
81
|
const goToPrevious = () => {
|
|
74
|
-
if(notTheEnd.value){
|
|
75
|
-
if(
|
|
82
|
+
//if(notTheEnd.value){
|
|
83
|
+
if(path.value.length === 0) {
|
|
76
84
|
isIntroductoryPart.value = true;
|
|
85
|
+
currentOption.value = null;
|
|
86
|
+
return
|
|
77
87
|
}
|
|
78
88
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
// Verifying if we are at the end
|
|
86
|
-
const notTheEnd = computed(() => {
|
|
87
|
-
return currentSlide.value === 0 || (currentOption.value && currentOption.value.options && currentOption.value.options.length > 0);
|
|
88
|
-
});
|
|
89
|
-
|
|
89
|
+
path.value.pop();
|
|
90
|
+
// Get the previous option in the path
|
|
91
|
+
const lastOption = path.value[path.value.length - 1];
|
|
90
92
|
|
|
93
|
+
if (lastOption) {
|
|
94
|
+
currentOption.value = lastOption;
|
|
95
|
+
} else {
|
|
96
|
+
currentOption.value = props.decisionTree;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
91
99
|
|
|
92
100
|
// Restart function
|
|
93
101
|
const restart = () => {
|
|
94
|
-
|
|
102
|
+
//currentSlide.value = 0;
|
|
95
103
|
currentOption.value = null;
|
|
96
|
-
itinerary.value = [];
|
|
97
104
|
isIntroductoryPart.value = true;
|
|
105
|
+
path.value = []
|
|
98
106
|
};
|
|
99
107
|
|
|
100
108
|
|
|
101
109
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
for (let i = 1; i < itinerary.length; i++) {
|
|
113
|
-
let question: string = option.question;
|
|
114
|
-
let img:string|undefined = option.imgSrc
|
|
115
|
-
if(option.options){
|
|
116
|
-
option = option.options[itinerary[i]];
|
|
117
|
-
console.log(option)
|
|
118
|
-
}
|
|
119
|
-
choices.push({question, choice: option.name, img});
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return choices;
|
|
124
|
-
};
|
|
125
|
-
|
|
110
|
+
const nextSlide = (option:Option) => {
|
|
111
|
+
//currentSlide.value++
|
|
112
|
+
path.value.push(option)
|
|
113
|
+
if (option.options && option.options.length > 0) {
|
|
114
|
+
currentOption.value = option; // drill into next level
|
|
115
|
+
} else {
|
|
116
|
+
currentOption.value = null; // reached the end (leaf node)
|
|
117
|
+
userPath.value = convertOptionToTreeNode(props.decisionTree, path.value);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
126
120
|
|
|
127
121
|
|
|
128
|
-
|
|
122
|
+
//helper function
|
|
123
|
+
function convertOptionToTreeNode(option: Option, path: Option[]): TreeNode {
|
|
124
|
+
const isActive = path.includes(option);
|
|
129
125
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
:src="scenarioImg"
|
|
139
|
-
:alt="`image d'introduction ${scenarioTitle}`"
|
|
140
|
-
/>
|
|
141
|
-
<button class="rounded bg-primary text-white py-2 px-4 min-w-28 my-2" @click="isIntroductoryPart = false">Commencer</button>
|
|
142
|
-
</div>
|
|
126
|
+
return {
|
|
127
|
+
name: option.name,
|
|
128
|
+
text: option.question,
|
|
129
|
+
component: option.media,
|
|
130
|
+
active: isActive,
|
|
131
|
+
children: option.options?.map(child => convertOptionToTreeNode(child, path))
|
|
132
|
+
};
|
|
133
|
+
}
|
|
143
134
|
|
|
144
135
|
|
|
145
|
-
|
|
146
|
-
<!-- Return button -->
|
|
147
|
-
<div><button :class="`rounded bg-primary text-white py-2 px-4 m-2 ${transitionAnimation}`" v-if="notTheEnd" @click="goToPrevious">
|
|
148
|
-
<EpIcon :icon-path="mdiArrowLeft" size="25"></EpIcon>
|
|
149
|
-
</button></div>
|
|
136
|
+
//styles computed
|
|
150
137
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
138
|
+
const gridStyle = computed(()=>{
|
|
139
|
+
if(currentOption.value &&
|
|
140
|
+
currentOption.value.options &&
|
|
141
|
+
currentOption.value.options?.length <= 2) {
|
|
142
|
+
return 'grid-cols-2'
|
|
143
|
+
}
|
|
144
|
+
return 'grid-cols-3'
|
|
145
|
+
})
|
|
160
146
|
|
|
161
|
-
|
|
147
|
+
const currentLengthOptions = computed(()=> {
|
|
148
|
+
if(currentOption.value && currentOption.value.options){
|
|
149
|
+
return currentOption.value.options.length
|
|
150
|
+
}
|
|
151
|
+
return 0
|
|
152
|
+
})
|
|
162
153
|
|
|
163
|
-
<button :class="`rounded bg-primary text-white py-2 px-4 min-w-28 max-w-40 my-3 ${(index === (decisionTree.options.length - 1) && (index % 3) === 0)? `col-span-3`: 'col-span-1'}`" v-for="(option, index) in decisionTree.options" :key="index" @click="itinerary.push(index); currentSlide++; currentOption = option">{{ option.name }}</button>
|
|
164
|
-
</div>
|
|
165
|
-
</div>
|
|
166
154
|
|
|
167
|
-
|
|
168
|
-
<div class="flex-grow flex" v-else>
|
|
155
|
+
</script>
|
|
169
156
|
|
|
170
|
-
|
|
171
|
-
|
|
157
|
+
<template>
|
|
158
|
+
<div>
|
|
159
|
+
<div
|
|
160
|
+
class="mx-auto w-2/3 bg-gray-200 dark:bg-slate-800 rounded-md p-4 flex flex-col"
|
|
161
|
+
:style="{ minHeight: '500px', backgroundColor: bgColor }"
|
|
162
|
+
>
|
|
163
|
+
<!-- <div v-for="item in path" :key="item.name">
|
|
164
|
+
<span class="text-xs">{{ item.name }}</span>
|
|
165
|
+
</div> -->
|
|
166
|
+
<!-- Header (fixed at top of card) -->
|
|
167
|
+
<div>
|
|
168
|
+
<h1 class="font-bold text-3xl text-center">{{ title }}</h1>
|
|
169
|
+
<div v-if="currentOption" class="mt-2">
|
|
170
|
+
<EpBtn
|
|
171
|
+
type="primary"
|
|
172
|
+
rounded
|
|
173
|
+
size="small"
|
|
174
|
+
:extra-class="`${transitionAnimation}`"
|
|
175
|
+
@click="goToPrevious"
|
|
176
|
+
>
|
|
177
|
+
<EpIcon :icon-path="mdiArrowLeft" size="25" />
|
|
178
|
+
</EpBtn>
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
|
|
182
|
+
<!-- Content Area -->
|
|
183
|
+
<div class="flex-grow flex items-center justify-center">
|
|
184
|
+
<!-- Introductory Part -->
|
|
185
|
+
<div
|
|
186
|
+
v-if="isIntroductoryPart"
|
|
187
|
+
class="flex flex-col items-center justify-center space-y-6"
|
|
188
|
+
>
|
|
189
|
+
<TextMedia
|
|
190
|
+
v-if="initialInstruction && media"
|
|
191
|
+
:text="initialInstruction"
|
|
192
|
+
:media="media"
|
|
193
|
+
/>
|
|
194
|
+
<EpBtn type="primary" rounded @click="start">{{labelStart}}</EpBtn>
|
|
195
|
+
</div>
|
|
172
196
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
197
|
+
<!-- Slides -->
|
|
198
|
+
<template v-else-if="currentOption && !isIntroductoryPart">
|
|
199
|
+
<div class="flex flex-col items-center justify-center w-full">
|
|
200
|
+
<div :class="`flex flex-col items-center justify-center ${transitionAnimation}`">
|
|
201
|
+
<TextMedia
|
|
202
|
+
:text="currentOption.question"
|
|
203
|
+
:media="currentOption.media"
|
|
204
|
+
/>
|
|
205
|
+
|
|
206
|
+
<div
|
|
207
|
+
:class="`w-full my-4 mx-4 grid gap-4 ${gridStyle}`"
|
|
208
|
+
:style="{ placeItems: currentLengthOptions <= 4 ? 'center' : 'initial' }"
|
|
209
|
+
>
|
|
210
|
+
<template v-for="(option, index) in currentOption.options" :key="`option-${index}`">
|
|
211
|
+
<EpBtn
|
|
212
|
+
rounded
|
|
213
|
+
type="primary"
|
|
214
|
+
class="w-full max-w-xs text-center"
|
|
215
|
+
@click="nextSlide(option)"
|
|
216
|
+
>
|
|
217
|
+
{{ option.name }}
|
|
218
|
+
</EpBtn>
|
|
219
|
+
</template>
|
|
182
220
|
</div>
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
:img="question.img"
|
|
206
|
-
/>
|
|
207
|
-
</div>
|
|
208
|
-
</template>
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
</div>
|
|
212
|
-
</div>
|
|
213
|
-
<div v-if="generalFeedback" class="flex flex-col col-span-1 items-center px-4 border-l-2 border-gray-700 overflow-auto">
|
|
214
|
-
<h3 class="font-bold mb-3">Feedback général</h3>
|
|
215
|
-
<div v-html="useRenderText(generalFeedback)"></div>
|
|
221
|
+
</div>
|
|
222
|
+
</div>
|
|
223
|
+
</template>
|
|
224
|
+
|
|
225
|
+
<!--show path-->
|
|
226
|
+
<div v-else>
|
|
227
|
+
|
|
228
|
+
<!-- <template v-if="userPath">
|
|
229
|
+
<EpHierarchy :nodes="userPath"/>
|
|
230
|
+
</template> -->
|
|
231
|
+
<h3 class="text-xl text-center font-semibold">{{ labelFinish }}</h3>
|
|
232
|
+
<div class="flex gap-6 mt-3">
|
|
233
|
+
<div class="w-full">
|
|
234
|
+
<h3 class="font-semibold mb-3">{{ labelYourPath }}</h3>
|
|
235
|
+
<div class="overflow-auto p-2" :style="{height: '200px'}">
|
|
236
|
+
<template v-for="(item,i) in path" :key="`user-choice-${i}`">
|
|
237
|
+
<div class="mb-2">
|
|
238
|
+
<Details
|
|
239
|
+
:content="item.question"
|
|
240
|
+
:title="item.name"
|
|
241
|
+
:media="item.media"
|
|
242
|
+
/>
|
|
216
243
|
</div>
|
|
217
|
-
|
|
218
|
-
|
|
244
|
+
</template>
|
|
245
|
+
</div>
|
|
246
|
+
<div class="flex justify-center mt-2">
|
|
247
|
+
<EpBtn type="info" rounded @click="showPath = true">{{ labelShowFullPath }}</EpBtn>
|
|
248
|
+
</div>
|
|
249
|
+
<EpModal v-if="userPath" v-model="showPath">
|
|
250
|
+
<EpHierarchy
|
|
251
|
+
:nodes="userPath"
|
|
252
|
+
:is-cluster="props.isCluster"
|
|
253
|
+
:color-path="props.colorPath"
|
|
254
|
+
:color-rect="props.colorRect"
|
|
255
|
+
/>
|
|
256
|
+
<div class="flex justify-end">
|
|
257
|
+
<EpBtn @click="showPath = false" type="error" outlined rounded>{{labelClose}}</EpBtn>
|
|
219
258
|
</div>
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
259
|
+
</EpModal>
|
|
260
|
+
</div>
|
|
261
|
+
<div v-if="generalFeedback" class="flex flex-col col-span-1 items-center px-4 border-l-2 border-gray-700 overflow-auto">
|
|
262
|
+
<div v-html="useRenderText(generalFeedback)"></div>
|
|
263
|
+
</div>
|
|
223
264
|
</div>
|
|
224
265
|
|
|
266
|
+
<div class="flex justify-center mt-2">
|
|
267
|
+
<EpBtn rounded type="warning" @click="restart">{{ labelRestart }}</EpBtn>
|
|
268
|
+
</div>
|
|
225
269
|
</div>
|
|
270
|
+
</div>
|
|
226
271
|
</div>
|
|
272
|
+
</div>
|
|
227
273
|
</template>
|
|
228
274
|
|
|
229
275
|
|
|
276
|
+
|
|
230
277
|
<style scoped>
|
|
231
278
|
@keyframes fade {
|
|
232
279
|
0% {
|
|
@@ -275,22 +322,5 @@ const getChoices = (itinerary: number[]) => {
|
|
|
275
322
|
|
|
276
323
|
|
|
277
324
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
/* Path item styling */
|
|
281
|
-
.path-item {
|
|
282
|
-
position: relative;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
.path-item::after {
|
|
286
|
-
content: '';
|
|
287
|
-
position: absolute;
|
|
288
|
-
top: 50%;
|
|
289
|
-
right: 100%;
|
|
290
|
-
width: 60px;
|
|
291
|
-
height: 4px;
|
|
292
|
-
background-color: rgb(55, 65, 81);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
325
|
</style>
|
|
296
326
|
|