fcad-core-dragon 2.1.1 → 2.1.2
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/.editorconfig +7 -7
- package/.gitlab-ci.yml +124 -0
- package/.prettierrc +11 -11
- package/.vscode/extensions.json +8 -8
- package/.vscode/settings.json +46 -16
- package/CHANGELOG +520 -520
- package/README.md +57 -57
- package/documentation/.vitepress/config.js +114 -114
- package/documentation/api-examples.md +49 -49
- package/documentation/composants/app-base-button.md +58 -58
- package/documentation/composants/app-base-error-display.md +59 -59
- package/documentation/composants/app-base-popover.md +68 -68
- package/documentation/composants/app-comp-audio.md +75 -75
- package/documentation/composants/app-comp-branch-buttons.md +111 -111
- package/documentation/composants/app-comp-button-progress.md +53 -53
- package/documentation/composants/app-comp-carousel.md +53 -53
- package/documentation/composants/app-comp-container.md +53 -53
- package/documentation/composants/app-comp-input-checkbox-next.md +42 -42
- package/documentation/composants/app-comp-input-dropdown-next.md +34 -34
- package/documentation/composants/app-comp-input-radio-next.md +39 -39
- package/documentation/composants/app-comp-input-text-next.md +35 -35
- package/documentation/composants/app-comp-input-text-table-next.md +34 -34
- package/documentation/composants/app-comp-input-text-to-fill-dropdown-next.md +53 -53
- package/documentation/composants/app-comp-input-text-to-fill-next.md +31 -31
- package/documentation/composants/app-comp-jauge.md +31 -31
- package/documentation/composants/app-comp-menu-item.md +55 -55
- package/documentation/composants/app-comp-menu.md +29 -29
- package/documentation/composants/app-comp-navigation.md +41 -41
- package/documentation/composants/app-comp-note-call.md +53 -53
- package/documentation/composants/app-comp-note-credit.md +53 -53
- package/documentation/composants/app-comp-play-bar-next.md +53 -53
- package/documentation/composants/app-comp-pop-up-next.md +93 -93
- package/documentation/composants/app-comp-quiz-next.md +235 -235
- package/documentation/composants/app-comp-quiz-recall.md +53 -53
- package/documentation/composants/app-comp-svg-next.md +53 -53
- package/documentation/composants/app-comp-table-of-content.md +50 -50
- package/documentation/composants/app-comp-video-player.md +82 -82
- package/documentation/composants.md +46 -46
- package/documentation/composants_critiques/ModelPageComposant.md +53 -53
- package/documentation/composants_critiques/app-base-module.md +43 -43
- package/documentation/composants_critiques/app-base-page.md +48 -48
- package/documentation/composants_critiques/app-base.md +311 -311
- package/documentation/composants_critiques/main.md +15 -15
- package/documentation/demarrage.md +50 -50
- package/documentation/deploiement.md +57 -57
- package/documentation/index.md +33 -33
- package/documentation/markdown-examples.md +85 -85
- package/documentation/public/vite.svg +14 -14
- package/documentation/public/vuejs.svg +1 -1
- package/documentation/public/vuetify.svg +5 -5
- package/eslint.config.js +60 -60
- package/junit-report.xml +182 -0
- package/package.json +66 -59
- package/playwright/index.html +12 -0
- package/playwright/index.js +21 -0
- package/playwright-ct.config.js +95 -0
- package/src/$locales/en.json +157 -157
- package/src/$locales/fr.json +120 -120
- package/src/assets/data/onboardingMessages.json +47 -47
- package/src/components/AppBase.vue +1171 -1169
- package/src/components/AppBaseButton.vue +90 -95
- package/src/components/AppBaseErrorDisplay.vue +438 -438
- package/src/components/AppBaseFlipCard.vue +84 -84
- package/src/components/AppBaseModule.vue +1639 -1634
- package/src/components/AppBasePage.vue +867 -866
- package/src/components/AppBasePopover.vue +41 -41
- package/src/components/AppBaseSkeleton.vue +66 -66
- package/src/components/AppCompAudio.vue +261 -256
- package/src/components/AppCompBranchButtons.vue +508 -508
- package/src/components/AppCompButtonProgress.vue +137 -132
- package/src/components/AppCompCarousel.vue +342 -336
- package/src/components/AppCompContainer.vue +29 -29
- package/src/components/AppCompInputCheckBoxNx.vue +325 -323
- package/src/components/AppCompInputDropdownNx.vue +302 -299
- package/src/components/AppCompInputRadioNx.vue +287 -284
- package/src/components/AppCompInputTextNx.vue +156 -153
- package/src/components/AppCompInputTextTableNx.vue +205 -202
- package/src/components/AppCompInputTextToFillDropdownNx.vue +343 -340
- package/src/components/AppCompInputTextToFillNx.vue +316 -313
- package/src/components/AppCompJauge.vue +81 -81
- package/src/components/AppCompMenu.vue +6 -1
- package/src/components/AppCompMenuItem.vue +246 -240
- package/src/components/AppCompNavigation.vue +977 -972
- package/src/components/AppCompNoteCall.vue +167 -161
- package/src/components/AppCompNoteCredit.vue +496 -491
- package/src/components/AppCompPlayBarNext.vue +2290 -2288
- package/src/components/AppCompPopUpNext.vue +508 -504
- package/src/components/AppCompQuizNext.vue +515 -510
- package/src/components/AppCompQuizRecall.vue +355 -350
- package/src/components/AppCompSVGNext.vue +346 -346
- package/src/components/AppCompSettingsMenu.vue +177 -172
- package/src/components/AppCompTableOfContent.vue +433 -427
- package/src/components/AppCompVideoPlayer.vue +377 -377
- package/src/components/AppCompViewDisplay.vue +6 -6
- package/src/components/BaseModule.vue +55 -55
- package/src/composables/useIdleDetector.js +56 -56
- package/src/composables/useQuiz.js +89 -89
- package/src/composables/useTimer.js +172 -172
- package/src/directives/nvdaFix.js +53 -53
- package/src/externalComps/ModuleView.vue +22 -22
- package/src/externalComps/SummaryView.vue +91 -91
- package/src/main.js +493 -476
- package/src/module/stores/appStore.js +960 -947
- package/src/module/xapi/ADL.js +520 -520
- package/src/module/xapi/Crypto/Hasher.js +241 -241
- package/src/module/xapi/Crypto/WordArray.js +278 -278
- package/src/module/xapi/Crypto/algorithms/BufferedBlockAlgorithm.js +103 -103
- package/src/module/xapi/Crypto/algorithms/C_algo.js +315 -315
- package/src/module/xapi/Crypto/algorithms/HMAC.js +9 -9
- package/src/module/xapi/Crypto/algorithms/SHA1.js +9 -9
- package/src/module/xapi/Crypto/encoders/Base.js +105 -105
- package/src/module/xapi/Crypto/encoders/Base64.js +99 -99
- package/src/module/xapi/Crypto/encoders/Hex.js +61 -61
- package/src/module/xapi/Crypto/encoders/Latin1.js +61 -61
- package/src/module/xapi/Crypto/encoders/Utf8.js +45 -45
- package/src/module/xapi/Crypto/index.js +53 -53
- package/src/module/xapi/Statement/activity.js +47 -47
- package/src/module/xapi/Statement/agent.js +55 -55
- package/src/module/xapi/Statement/group.js +26 -26
- package/src/module/xapi/Statement/index.js +259 -259
- package/src/module/xapi/Statement/statement.js +253 -253
- package/src/module/xapi/Statement/statementRef.js +23 -23
- package/src/module/xapi/Statement/substatement.js +22 -22
- package/src/module/xapi/Statement/verb.js +36 -36
- package/src/module/xapi/activitytypes.js +17 -17
- package/src/module/xapi/launch.js +157 -157
- package/src/module/xapi/utils.js +167 -167
- package/src/module/xapi/verbs.js +294 -294
- package/src/module/xapi/wrapper.js +1895 -1895
- package/src/module/xapi/xapiStatement.js +444 -444
- package/src/plugins/analytics.js +34 -34
- package/src/plugins/bus.js +12 -8
- package/src/plugins/gsap.js +17 -17
- package/src/plugins/helper.js +355 -358
- package/src/plugins/i18n.js +27 -26
- package/src/plugins/idb.js +227 -227
- package/src/plugins/save.js +37 -37
- package/src/plugins/scorm.js +287 -287
- package/src/plugins/xapi.js +11 -11
- package/src/public/index.html +33 -33
- package/src/router/index.js +57 -57
- package/src/router/routes.js +312 -312
- package/src/shared/generalfuncs.js +344 -344
- package/src/shared/validators.js +1018 -1018
- package/tests/component/AppBaseButton.spec.js +53 -0
- package/tests/component/pinia.spec.js +24 -0
- package/{src/components/tests__ → tests/unit}/AppBaseButton.spec.js +53 -53
- package/tests/unit/AppCompInputCheckBoxNx.spec.js +59 -0
- package/tests/unit/AppCompInputDropdownNx.spec.js +51 -0
- package/tests/unit/AppCompInputRadioNx.spec.js +59 -0
- package/tests/unit/AppCompInputTextNx.spec.js +44 -0
- package/tests/unit/AppCompInputTextTableNx.spec.js +77 -0
- package/tests/unit/AppCompInputTextToFillDropdownNx.spec.js +60 -0
- package/tests/unit/AppCompInputTextToFillNx.spec.js +45 -0
- package/tests/unit/AppCompQuizNext.spec.js +114 -0
- package/tests/unit/AppCompVideoPlayer.spec.js +177 -0
- package/{src/components/tests__ → tests/unit}/useTimer.spec.js +91 -91
- package/vitest.config.js +28 -19
- package/vitest.setup.js +28 -0
- package/src/components/AppBaseButton.test.js +0 -21
|
@@ -1,427 +1,433 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
----------------- MUST ADD ERROR GESTION ------------------
|
|
3
|
-
----------------- MUST ADD label terminer ------------------
|
|
4
|
-
----------------- MUST ADD css ------------------
|
|
5
|
-
|
|
6
|
-
@ Description: This component is used to display the sub menu to show the anchor of a activity.
|
|
7
|
-
@ What it does: The component show the data that was enter in menu.json and create de link to the anchor from those information. This componant must be use with app-comp-menu-Item and app-comp-menu.
|
|
8
|
-
-->
|
|
9
|
-
|
|
10
|
-
<template>
|
|
11
|
-
<div v-if="error" id="sidebar-submenu" :class="{ isOpen: isOpened }">
|
|
12
|
-
<focus-trap :active="isOpened" :prevent-scroll="true">
|
|
13
|
-
<div ref="target">
|
|
14
|
-
<!-- <div class="submenu-header"> -->
|
|
15
|
-
<app-base-button
|
|
16
|
-
id="close-toc"
|
|
17
|
-
class="btn-ghost"
|
|
18
|
-
:title="$t('button.closePopUp')"
|
|
19
|
-
@click="onCloseWidget('toc')"
|
|
20
|
-
>
|
|
21
|
-
<svg aria-hidden="true" focusable="false">
|
|
22
|
-
<use href="#close-square-icon" />
|
|
23
|
-
</svg>
|
|
24
|
-
</app-base-button>
|
|
25
|
-
<!-- </div> -->
|
|
26
|
-
|
|
27
|
-
<!-- <div class="submenu-content"> -->
|
|
28
|
-
<p class="t-act" v-html="`${title}`"></p>
|
|
29
|
-
<div class="box-prog-act">
|
|
30
|
-
<p>
|
|
31
|
-
{{ $t('text.activity_progress') }}
|
|
32
|
-
<span>{{ actProgress }}</span>
|
|
33
|
-
</p>
|
|
34
|
-
</div>
|
|
35
|
-
<div class="box-anchor">
|
|
36
|
-
<p class="t-toc">{{ $t('text.toc') }}</p>
|
|
37
|
-
|
|
38
|
-
<RouterLink
|
|
39
|
-
v-for="(anchor, index) of anchors"
|
|
40
|
-
:key="anchor.title"
|
|
41
|
-
class="toc-item"
|
|
42
|
-
:done="sectionProgress(index)"
|
|
43
|
-
:to="{ name: anchor.path }"
|
|
44
|
-
@click="closeAndNextPage(anchor.path)"
|
|
45
|
-
>
|
|
46
|
-
<div class="box-text-anchor">
|
|
47
|
-
<div class="text-anchor">
|
|
48
|
-
<p class="anchor-t" v-html="anchor.title"></p>
|
|
49
|
-
<p class="state">
|
|
50
|
-
<span class="box-text">
|
|
51
|
-
<svg aria-hidden="true" focusable="false">
|
|
52
|
-
<use href="#check-toc" />
|
|
53
|
-
</svg>
|
|
54
|
-
{{ $t('text.complete') }}
|
|
55
|
-
</span>
|
|
56
|
-
</p>
|
|
57
|
-
</div>
|
|
58
|
-
<svg aria-hidden="true" focusable="false">
|
|
59
|
-
<use href="#chevronD-icon" />
|
|
60
|
-
</svg>
|
|
61
|
-
</div>
|
|
62
|
-
</RouterLink>
|
|
63
|
-
</div>
|
|
64
|
-
<!-- </div> -->
|
|
65
|
-
</div>
|
|
66
|
-
</focus-trap>
|
|
67
|
-
</div>
|
|
68
|
-
<div v-else id="sidebar-submenu" :class="{ isOpen: isOpened }">
|
|
69
|
-
<p>
|
|
70
|
-
Cette activité n'existe pas dans menu setting, svp l'ajouter à votre menu
|
|
71
|
-
setting
|
|
72
|
-
</p>
|
|
73
|
-
</div>
|
|
74
|
-
</template>
|
|
75
|
-
|
|
76
|
-
<script>
|
|
77
|
-
import { mapState, mapActions } from 'pinia'
|
|
78
|
-
import { useAppStore } from '../module/stores/appStore'
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
this.$bus.$
|
|
108
|
-
this.$bus.$
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
this.isOpened =
|
|
135
|
-
this.updateWidgetOpen(
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
case '
|
|
162
|
-
this.title = menuInfo[activity].subTitle
|
|
163
|
-
? `
|
|
164
|
-
: `
|
|
165
|
-
break
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
this.title = menuInfo[activity].subTitle
|
|
169
|
-
?
|
|
170
|
-
:
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
if (
|
|
188
|
-
|
|
189
|
-
} else {
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
)
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
this
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
this.
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
let
|
|
272
|
-
let
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
margin-bottom:
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
1
|
+
<!--
|
|
2
|
+
----------------- MUST ADD ERROR GESTION ------------------
|
|
3
|
+
----------------- MUST ADD label terminer ------------------
|
|
4
|
+
----------------- MUST ADD css ------------------
|
|
5
|
+
|
|
6
|
+
@ Description: This component is used to display the sub menu to show the anchor of a activity.
|
|
7
|
+
@ What it does: The component show the data that was enter in menu.json and create de link to the anchor from those information. This componant must be use with app-comp-menu-Item and app-comp-menu.
|
|
8
|
+
-->
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div v-if="error" id="sidebar-submenu" :class="{ isOpen: isOpened }">
|
|
12
|
+
<focus-trap :active="isOpened" :prevent-scroll="true">
|
|
13
|
+
<div ref="target">
|
|
14
|
+
<!-- <div class="submenu-header"> -->
|
|
15
|
+
<app-base-button
|
|
16
|
+
id="close-toc"
|
|
17
|
+
class="btn-ghost"
|
|
18
|
+
:title="$t('button.closePopUp')"
|
|
19
|
+
@click="onCloseWidget('toc')"
|
|
20
|
+
>
|
|
21
|
+
<svg aria-hidden="true" focusable="false">
|
|
22
|
+
<use href="#close-square-icon" />
|
|
23
|
+
</svg>
|
|
24
|
+
</app-base-button>
|
|
25
|
+
<!-- </div> -->
|
|
26
|
+
|
|
27
|
+
<!-- <div class="submenu-content"> -->
|
|
28
|
+
<p class="t-act" v-html="`${title}`"></p>
|
|
29
|
+
<div class="box-prog-act">
|
|
30
|
+
<p>
|
|
31
|
+
{{ $t('text.activity_progress') }}
|
|
32
|
+
<span>{{ actProgress }}</span>
|
|
33
|
+
</p>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="box-anchor">
|
|
36
|
+
<p class="t-toc">{{ $t('text.toc') }}</p>
|
|
37
|
+
|
|
38
|
+
<RouterLink
|
|
39
|
+
v-for="(anchor, index) of anchors"
|
|
40
|
+
:key="anchor.title"
|
|
41
|
+
class="toc-item"
|
|
42
|
+
:done="sectionProgress(index)"
|
|
43
|
+
:to="{ name: anchor.path }"
|
|
44
|
+
@click="closeAndNextPage(anchor.path)"
|
|
45
|
+
>
|
|
46
|
+
<div class="box-text-anchor">
|
|
47
|
+
<div class="text-anchor">
|
|
48
|
+
<p class="anchor-t" v-html="anchor.title"></p>
|
|
49
|
+
<p class="state">
|
|
50
|
+
<span class="box-text">
|
|
51
|
+
<svg aria-hidden="true" focusable="false">
|
|
52
|
+
<use href="#check-toc" />
|
|
53
|
+
</svg>
|
|
54
|
+
{{ $t('text.complete') }}
|
|
55
|
+
</span>
|
|
56
|
+
</p>
|
|
57
|
+
</div>
|
|
58
|
+
<svg aria-hidden="true" focusable="false">
|
|
59
|
+
<use href="#chevronD-icon" />
|
|
60
|
+
</svg>
|
|
61
|
+
</div>
|
|
62
|
+
</RouterLink>
|
|
63
|
+
</div>
|
|
64
|
+
<!-- </div> -->
|
|
65
|
+
</div>
|
|
66
|
+
</focus-trap>
|
|
67
|
+
</div>
|
|
68
|
+
<div v-else id="sidebar-submenu" :class="{ isOpen: isOpened }">
|
|
69
|
+
<p>
|
|
70
|
+
Cette activité n'existe pas dans menu setting, svp l'ajouter à votre menu
|
|
71
|
+
setting
|
|
72
|
+
</p>
|
|
73
|
+
</div>
|
|
74
|
+
</template>
|
|
75
|
+
|
|
76
|
+
<script>
|
|
77
|
+
import { mapState, mapActions } from 'pinia'
|
|
78
|
+
import { useAppStore } from '../module/stores/appStore'
|
|
79
|
+
import { useI18n } from 'vue-i18n'
|
|
80
|
+
|
|
81
|
+
export default {
|
|
82
|
+
setup() {
|
|
83
|
+
const { t } = useI18n()
|
|
84
|
+
return { t }
|
|
85
|
+
},
|
|
86
|
+
data() {
|
|
87
|
+
return {
|
|
88
|
+
title: '',
|
|
89
|
+
anchors: [],
|
|
90
|
+
activity: '',
|
|
91
|
+
isOpened: false,
|
|
92
|
+
menuInfo: null,
|
|
93
|
+
actProgress: null,
|
|
94
|
+
error: true
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
computed: {
|
|
98
|
+
...mapState(useAppStore, [
|
|
99
|
+
'getMenuSettings',
|
|
100
|
+
'getAnchorsForActivity',
|
|
101
|
+
'getBifChoice',
|
|
102
|
+
'getAllCompleted',
|
|
103
|
+
'getAllActivitiesState'
|
|
104
|
+
])
|
|
105
|
+
},
|
|
106
|
+
beforeUnmount() {
|
|
107
|
+
this.$bus.$off('toggle-widget', this.onToggleWidget)
|
|
108
|
+
this.$bus.$off('close-widget', this.onCloseWidget)
|
|
109
|
+
this.$bus.$off('info-activity', this.onInfoActivity)
|
|
110
|
+
},
|
|
111
|
+
mounted() {
|
|
112
|
+
this.$bus.$on('toggle-widget', this.onToggleWidget)
|
|
113
|
+
this.$bus.$on('close-widget', this.onCloseWidget)
|
|
114
|
+
this.$bus.$on('info-activity', this.onInfoActivity)
|
|
115
|
+
},
|
|
116
|
+
methods: {
|
|
117
|
+
...mapActions(useAppStore, ['updateWidgetOpen']),
|
|
118
|
+
onInfoActivity(data) {
|
|
119
|
+
//should be conditioned to avoid event firing multiple time on call
|
|
120
|
+
|
|
121
|
+
if (data) {
|
|
122
|
+
this.reset()
|
|
123
|
+
this.activity = data
|
|
124
|
+
|
|
125
|
+
if (!this.getMenuSettings[data]) {
|
|
126
|
+
return (this.error = false)
|
|
127
|
+
} else {
|
|
128
|
+
this.getInfoSubMenu(data)
|
|
129
|
+
this.getProgressActivity(data)
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
onCloseWidget(data) {
|
|
134
|
+
this.isOpened = false
|
|
135
|
+
this.updateWidgetOpen(false)
|
|
136
|
+
this.reset()
|
|
137
|
+
},
|
|
138
|
+
onToggleWidget(data) {
|
|
139
|
+
if (data.type !== 'toc') return (this.isOpened = false)
|
|
140
|
+
this.isOpened = !this.isOpened
|
|
141
|
+
this.updateWidgetOpen(this.isOpened)
|
|
142
|
+
},
|
|
143
|
+
/* @Description:Get and set the section to output
|
|
144
|
+
* @params: activity {Object}: the activity which sections need to be output
|
|
145
|
+
*/
|
|
146
|
+
getInfoSubMenu(activity) {
|
|
147
|
+
//get the anchors for this activity from the store
|
|
148
|
+
let menuInfo = this.getMenuSettings
|
|
149
|
+
|
|
150
|
+
let nb = null
|
|
151
|
+
|
|
152
|
+
//Get title are if no title construct acitivty
|
|
153
|
+
if (menuInfo[activity] && menuInfo[activity].title)
|
|
154
|
+
this.title = menuInfo[activity].title
|
|
155
|
+
|
|
156
|
+
if (activity.charAt(1) == '0' || activity.charAt(1) == 0)
|
|
157
|
+
nb = activity.substr(2)
|
|
158
|
+
else nb = activity.substr(1)
|
|
159
|
+
//Format title in the Progress info
|
|
160
|
+
switch (nb) {
|
|
161
|
+
case '0':
|
|
162
|
+
this.title = menuInfo[activity].subTitle
|
|
163
|
+
? `Introduction : ${menuInfo[activity].subTitle}`
|
|
164
|
+
: `Introduction`
|
|
165
|
+
break
|
|
166
|
+
|
|
167
|
+
case '99':
|
|
168
|
+
this.title = menuInfo[activity].subTitle
|
|
169
|
+
? `Conclusion : ${menuInfo[activity].subTitle}`
|
|
170
|
+
: `Conclusion`
|
|
171
|
+
break
|
|
172
|
+
|
|
173
|
+
default:
|
|
174
|
+
this.title = menuInfo[activity].subTitle
|
|
175
|
+
? `${this.$t('text.activity')} ${nb} : ${menuInfo[activity].subTitle}`
|
|
176
|
+
: `${this.$t('text.activity')} ${nb}`
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
//create anchors title and path
|
|
180
|
+
if (menuInfo[activity] && menuInfo[activity].anchors) {
|
|
181
|
+
menuInfo[activity].anchors.forEach((element) => {
|
|
182
|
+
//
|
|
183
|
+
let _path = null
|
|
184
|
+
let b = null
|
|
185
|
+
if (nb == 0 || nb == '0') {
|
|
186
|
+
b = `introduction`
|
|
187
|
+
} else if (nb == 99 || nb == '99') {
|
|
188
|
+
b = `conclusion`
|
|
189
|
+
} else {
|
|
190
|
+
b = `activite_${nb}`
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if (element.page == 'page_1') {
|
|
194
|
+
_path = `${b}`
|
|
195
|
+
} else {
|
|
196
|
+
_path = `${b}.${element.page}`
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
let info = {
|
|
200
|
+
title: `${element.anchorName}`,
|
|
201
|
+
path: _path
|
|
202
|
+
}
|
|
203
|
+
this.anchors.push(info)
|
|
204
|
+
})
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
disable(data) {
|
|
208
|
+
let page = data.pageRef
|
|
209
|
+
let act = this.getAct(data.path)
|
|
210
|
+
let choosen = this.getBifChoice
|
|
211
|
+
|
|
212
|
+
// disable if bif
|
|
213
|
+
if (data.bif && choosen) {
|
|
214
|
+
if (choosen.act == act && choosen.page == page) {
|
|
215
|
+
return false
|
|
216
|
+
} else {
|
|
217
|
+
return true
|
|
218
|
+
}
|
|
219
|
+
} else {
|
|
220
|
+
return false
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
getAct(data) {
|
|
224
|
+
//return the id need it
|
|
225
|
+
if (data) {
|
|
226
|
+
if (data.substring(data.indexOf('_') + 1).length == 1) {
|
|
227
|
+
return `A0${data.substring(data.indexOf('_') + 1)}`
|
|
228
|
+
} else {
|
|
229
|
+
return `A${data.substring(data.indexOf('_') + 1)}`
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
/**
|
|
234
|
+
* @description Gives gives length of completed page for an activity
|
|
235
|
+
* @param {String} idActivity
|
|
236
|
+
* @returns {Number}
|
|
237
|
+
*/
|
|
238
|
+
getProgressActivity(idActivity) {
|
|
239
|
+
/// give all the page that are complete to the gauge
|
|
240
|
+
if (idActivity) {
|
|
241
|
+
let completed = []
|
|
242
|
+
if (this.getAllCompleted[idActivity]) {
|
|
243
|
+
completed = this.getAllCompleted[idActivity] //get all completed page for the activity
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const allActivitiesState = JSON.parse(
|
|
247
|
+
JSON.stringify(this.getAllActivitiesState)
|
|
248
|
+
)
|
|
249
|
+
let size = allActivitiesState[idActivity]
|
|
250
|
+
? allActivitiesState[idActivity].size
|
|
251
|
+
: 0
|
|
252
|
+
|
|
253
|
+
// return pourcent of activity completion
|
|
254
|
+
this.actProgress = `${Math.round((completed.length * 100) / size)} %`
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
close() {
|
|
258
|
+
this.isOpened = !this.isOpened
|
|
259
|
+
this.updateWidgetOpen(this.isOpened)
|
|
260
|
+
},
|
|
261
|
+
closeAndNextPage(NextPage) {
|
|
262
|
+
this.isOpened = !this.isOpened
|
|
263
|
+
this.updateWidgetOpen(this.isOpened)
|
|
264
|
+
this.$router.push({ name: NextPage })
|
|
265
|
+
},
|
|
266
|
+
reset() {
|
|
267
|
+
this.anchors = []
|
|
268
|
+
this.activity = ''
|
|
269
|
+
},
|
|
270
|
+
sectionProgress(index) {
|
|
271
|
+
let menuInfo = this.getMenuSettings
|
|
272
|
+
let nextIndex = index + 1
|
|
273
|
+
let nextSec
|
|
274
|
+
let curSec = menuInfo[this.activity].anchors[index].pageRef
|
|
275
|
+
|
|
276
|
+
let nb
|
|
277
|
+
let tabPageSec = []
|
|
278
|
+
let tabcomplete = []
|
|
279
|
+
|
|
280
|
+
if (nextIndex < menuInfo[this.activity].anchors.length) {
|
|
281
|
+
nextSec = menuInfo[this.activity].anchors[nextIndex].pageRef
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
if (nextSec != undefined) {
|
|
285
|
+
nb = parseInt(nextSec.substring(1))
|
|
286
|
+
|
|
287
|
+
while (nb > parseInt(curSec.substring(1))) {
|
|
288
|
+
nb--
|
|
289
|
+
if (nb < 10) tabPageSec.push(`P0${nb}`)
|
|
290
|
+
else tabPageSec.push(`P${nb}`)
|
|
291
|
+
}
|
|
292
|
+
} else {
|
|
293
|
+
if (menuInfo[this.activity].anchors.length == 1) {
|
|
294
|
+
let numPage = this.getAllActivitiesState[this.activity].size
|
|
295
|
+
|
|
296
|
+
for (let g = 1; g == numPage; g++) {
|
|
297
|
+
tabPageSec.push(`P${g}`)
|
|
298
|
+
}
|
|
299
|
+
if (
|
|
300
|
+
typeof this.getAllCompleted[this.activity] !== 'undefined' &&
|
|
301
|
+
this.getAllCompleted[this.activity].length !==
|
|
302
|
+
this.getAllActivitiesState[this.activity].size
|
|
303
|
+
)
|
|
304
|
+
return false
|
|
305
|
+
}
|
|
306
|
+
tabPageSec.push(curSec)
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
let completeActPage = this.getAllCompleted[this.activity]
|
|
310
|
+
|
|
311
|
+
if (completeActPage) {
|
|
312
|
+
completeActPage.find((value) => {
|
|
313
|
+
let w = Object.keys(value)
|
|
314
|
+
tabcomplete.push(w[0])
|
|
315
|
+
})
|
|
316
|
+
|
|
317
|
+
const isSubset = (array1, array2) =>
|
|
318
|
+
array2.every((element) => array1.includes(element))
|
|
319
|
+
|
|
320
|
+
return isSubset(tabcomplete, tabPageSec)
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
</script>
|
|
326
|
+
<style lang="scss">
|
|
327
|
+
#sidebar-submenu {
|
|
328
|
+
display: none;
|
|
329
|
+
position: absolute;
|
|
330
|
+
left: 75px;
|
|
331
|
+
top: 0;
|
|
332
|
+
max-height: 592px;
|
|
333
|
+
width: 476px;
|
|
334
|
+
transition: left 0.5s ease-in-out;
|
|
335
|
+
|
|
336
|
+
&.isOpen {
|
|
337
|
+
display: flex;
|
|
338
|
+
flex-direction: column;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
#close-toc {
|
|
342
|
+
position: absolute;
|
|
343
|
+
right: 24px;
|
|
344
|
+
top: 24px;
|
|
345
|
+
margin-bottom: 0;
|
|
346
|
+
padding: 12px;
|
|
347
|
+
width: 48px;
|
|
348
|
+
height: 48px;
|
|
349
|
+
display: flex;
|
|
350
|
+
justify-content: center;
|
|
351
|
+
|
|
352
|
+
&:focus {
|
|
353
|
+
box-shadow: inherit !important;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.box-prog-act {
|
|
358
|
+
width: 319px;
|
|
359
|
+
display: flex;
|
|
360
|
+
flex-direction: row;
|
|
361
|
+
margin-bottom: 16px;
|
|
362
|
+
|
|
363
|
+
p {
|
|
364
|
+
position: relative;
|
|
365
|
+
width: 100%;
|
|
366
|
+
|
|
367
|
+
span {
|
|
368
|
+
position: absolute;
|
|
369
|
+
right: 0;
|
|
370
|
+
top: 0;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.box-anchor {
|
|
376
|
+
max-height: 366px;
|
|
377
|
+
overflow-y: auto;
|
|
378
|
+
padding: 0 4px;
|
|
379
|
+
|
|
380
|
+
.t-toc {
|
|
381
|
+
margin-bottom: 16px;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.toc-item {
|
|
385
|
+
display: block;
|
|
386
|
+
width: 95%;
|
|
387
|
+
margin-bottom: 8px;
|
|
388
|
+
|
|
389
|
+
.state {
|
|
390
|
+
display: none;
|
|
391
|
+
|
|
392
|
+
.box-text {
|
|
393
|
+
display: flex;
|
|
394
|
+
justify-content: flex-start;
|
|
395
|
+
align-items: center;
|
|
396
|
+
margin-top: 7px;
|
|
397
|
+
|
|
398
|
+
svg {
|
|
399
|
+
margin-right: 10px;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
&[done='true'] {
|
|
404
|
+
.state {
|
|
405
|
+
display: flex;
|
|
406
|
+
align-items: center;
|
|
407
|
+
svg {
|
|
408
|
+
margin-right: 10px;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.box-text-anchor {
|
|
414
|
+
display: flex;
|
|
415
|
+
flex-direction: row;
|
|
416
|
+
align-items: center;
|
|
417
|
+
justify-content: space-between;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.app-nav {
|
|
424
|
+
&.show,
|
|
425
|
+
&:hover {
|
|
426
|
+
.ctn-w {
|
|
427
|
+
#sidebar-submenu {
|
|
428
|
+
left: 120px;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
</style>
|