fcad-core-dragon 2.0.0-beta.0 → 2.0.0-beta.10
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 +6 -31
- package/.prettierrc +11 -0
- package/.vscode/extensions.json +8 -0
- package/.vscode/settings.json +16 -0
- package/CHANGELOG +153 -0
- package/README.md +28 -43
- package/documentation/.vitepress/config.js +114 -0
- package/documentation/api-examples.md +49 -0
- package/documentation/composants/app-base-button.md +58 -0
- package/documentation/composants/app-base-error-display.md +59 -0
- package/documentation/composants/app-base-popover.md +68 -0
- package/documentation/composants/app-comp-audio.md +75 -0
- package/documentation/composants/app-comp-branch-buttons.md +111 -0
- package/documentation/composants/app-comp-button-progress.md +53 -0
- package/documentation/composants/app-comp-carousel.md +53 -0
- package/documentation/composants/app-comp-container.md +53 -0
- package/documentation/composants/app-comp-input-checkbox-next.md +42 -0
- package/documentation/composants/app-comp-input-dropdown-next.md +34 -0
- package/documentation/composants/app-comp-input-radio-next.md +39 -0
- package/documentation/composants/app-comp-input-text-next.md +35 -0
- package/documentation/composants/app-comp-input-text-table-next.md +34 -0
- package/documentation/composants/app-comp-input-text-to-fill-dropdown-next.md +53 -0
- package/documentation/composants/app-comp-input-text-to-fill-next.md +31 -0
- package/documentation/composants/app-comp-jauge.md +31 -0
- package/documentation/composants/app-comp-menu-item.md +55 -0
- package/documentation/composants/app-comp-menu.md +29 -0
- package/documentation/composants/app-comp-navigation.md +41 -0
- package/documentation/composants/app-comp-note-call.md +53 -0
- package/documentation/composants/app-comp-note-credit.md +53 -0
- package/documentation/composants/app-comp-play-bar-next.md +53 -0
- package/documentation/composants/app-comp-pop-up-next.md +93 -0
- package/documentation/composants/app-comp-quiz-next.md +235 -0
- package/documentation/composants/app-comp-quiz-recall.md +53 -0
- package/documentation/composants/app-comp-svg-next.md +53 -0
- package/documentation/composants/app-comp-table-of-content.md +50 -0
- package/documentation/composants/app-comp-video-player.md +82 -0
- package/documentation/composants.md +46 -0
- package/documentation/composants_critiques/ModelPageComposant.md +53 -0
- package/documentation/composants_critiques/app-base-module.md +43 -0
- package/documentation/composants_critiques/app-base-page.md +48 -0
- package/documentation/composants_critiques/app-base.md +311 -0
- package/documentation/composants_critiques/main.md +15 -0
- package/documentation/demarrage.md +50 -0
- package/documentation/deploiement.md +58 -0
- package/documentation/index.md +33 -0
- package/documentation/markdown-examples.md +85 -0
- package/documentation/public/npm_version.png +0 -0
- package/documentation/public/vite.svg +15 -0
- package/documentation/public/vuejs.svg +2 -0
- package/documentation/public/vuetify.svg +6 -0
- package/eslint.config.js +60 -0
- package/package.json +43 -49
- package/src/$locales/en.json +94 -92
- package/src/$locales/fr.json +77 -113
- package/src/assets/data/onboardingMessages.json +1 -1
- package/src/components/AppBase.vue +971 -437
- package/src/components/AppBaseButton.test.js +21 -0
- package/src/components/AppBaseButton.vue +42 -10
- package/src/components/AppBaseErrorDisplay.vue +209 -162
- package/src/components/AppBaseFlipCard.vue +1 -0
- package/src/components/AppBaseModule.vue +1021 -976
- package/src/components/AppBasePage.vue +656 -128
- package/src/components/AppBasePopover.vue +41 -0
- package/src/components/AppBaseSkeleton.vue +66 -0
- package/src/components/AppCompAudio.vue +256 -0
- package/src/components/AppCompBranchButtons.vue +108 -181
- package/src/components/AppCompButtonProgress.vue +44 -70
- package/src/components/AppCompCarousel.vue +284 -233
- package/src/components/AppCompContainer.vue +29 -0
- package/src/components/AppCompInputCheckBoxNx.vue +323 -0
- package/src/components/AppCompInputDropdownNx.vue +299 -0
- package/src/components/AppCompInputRadioNx.vue +284 -0
- package/src/components/AppCompInputTextNx.vue +153 -0
- package/src/components/AppCompInputTextTableNx.vue +202 -0
- package/src/components/AppCompInputTextToFillDropdownNx.vue +340 -0
- package/src/components/AppCompInputTextToFillNx.vue +313 -0
- package/src/components/AppCompJauge.vue +36 -11
- package/src/components/AppCompMenu.vue +312 -92
- package/src/components/AppCompMenuItem.vue +129 -105
- package/src/components/AppCompNavigation.vue +972 -0
- package/src/components/AppCompNoteCall.vue +161 -0
- package/src/components/AppCompNoteCredit.vue +491 -0
- package/src/components/AppCompPlayBarNext.vue +2288 -0
- package/src/components/AppCompPopUpNext.vue +504 -0
- package/src/components/AppCompQuizNext.vue +510 -0
- package/src/components/AppCompQuizRecall.vue +350 -0
- package/src/components/AppCompSVGNext.vue +346 -0
- package/src/components/AppCompSettingsMenu.vue +18 -16
- package/src/components/AppCompTableOfContent.vue +340 -122
- package/src/components/AppCompVideoPlayer.vue +377 -0
- package/src/components/BaseModule.vue +24 -117
- package/src/components/tests__/AppBaseButton.spec.js +53 -0
- package/src/components/tests__/useTimer.spec.js +91 -0
- package/src/composables/useIdleDetector.js +56 -0
- package/src/composables/useQuiz.js +89 -0
- package/src/composables/useTimer.js +172 -0
- package/src/directives/nvdaFix.js +53 -0
- package/src/externalComps/ModuleView.vue +22 -0
- package/src/externalComps/SummaryView.vue +91 -0
- package/src/main.js +400 -142
- package/src/module/stores/appStore.js +947 -0
- package/src/module/xapi/ADL.js +241 -60
- package/src/module/xapi/Crypto/Hasher.js +8 -8
- package/src/module/xapi/Crypto/WordArray.js +6 -6
- package/src/module/xapi/Crypto/algorithms/BufferedBlockAlgorithm.js +4 -4
- package/src/module/xapi/Crypto/algorithms/C_algo.js +14 -18
- package/src/module/xapi/Crypto/algorithms/HMAC.js +1 -1
- package/src/module/xapi/Crypto/algorithms/SHA1.js +1 -1
- package/src/module/xapi/Crypto/encoders/Base.js +7 -7
- package/src/module/xapi/Crypto/encoders/Base64.js +3 -3
- package/src/module/xapi/Crypto/encoders/Hex.js +4 -3
- package/src/module/xapi/Crypto/encoders/Latin1.js +3 -3
- package/src/module/xapi/Crypto/encoders/Utf8.js +3 -3
- package/src/module/xapi/Statement/index.js +3 -3
- package/src/module/xapi/launch.js +10 -10
- package/src/module/xapi/utils.js +17 -17
- package/src/module/xapi/wrapper.js +223 -218
- package/src/module/xapi/xapiStatement.js +29 -29
- package/src/plugins/analytics.js +34 -0
- package/src/plugins/bus.js +7 -2
- package/src/plugins/gsap.js +9 -8
- package/src/plugins/helper.js +141 -43
- package/src/plugins/i18n.js +13 -18
- package/src/plugins/idb.js +46 -30
- package/src/plugins/save.js +1 -1
- package/src/plugins/scorm.js +15 -15
- package/src/plugins/xapi.js +2 -2
- package/src/public/index.html +23 -11
- package/src/router/index.js +57 -0
- package/src/router/routes.js +312 -0
- package/src/shared/generalfuncs.js +241 -10
- package/src/shared/validators.js +1018 -0
- package/vitest.config.js +19 -0
- package/.eslintignore +0 -29
- package/.eslintrc.js +0 -86
- package/.prettierrc.js +0 -5
- package/babel.config.js +0 -3
- package/src/components/AppBaseDragChoice.vue +0 -91
- package/src/components/AppBaseDropZone.vue +0 -112
- package/src/components/AppCompDragAndDrop.vue +0 -339
- package/src/components/AppCompInputAssociation.vue +0 -332
- package/src/components/AppCompInputCheckBox.vue +0 -227
- package/src/components/AppCompInputDropdown.vue +0 -184
- package/src/components/AppCompInputRadio.vue +0 -169
- package/src/components/AppCompInputTextBox.vue +0 -91
- package/src/components/AppCompInputTextTable.vue +0 -155
- package/src/components/AppCompInputTextToFillDropdown.vue +0 -255
- package/src/components/AppCompInputTextToFillText.vue +0 -164
- package/src/components/AppCompMediaPlayer.vue +0 -365
- package/src/components/AppCompNavigationFull.vue +0 -1791
- package/src/components/AppCompPlayBar.vue +0 -1540
- package/src/components/AppCompPopUp.vue +0 -523
- package/src/components/AppCompQuiz.vue +0 -2998
- package/src/components/AppCompToolTip.vue +0 -94
- package/src/mixins/$pageMixins.js +0 -381
- package/src/mixins/$quizMixins.js +0 -456
- package/src/mixins/timerMixin.js +0 -132
- package/src/module/store.js +0 -874
- package/src/plugins/timeManager.js +0 -77
- package/src/routes.js +0 -734
- package/vue.config.js +0 -83
|
@@ -1,523 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<div v-show="errors.length <= 0" class="p_popup">
|
|
4
|
-
<!----------------------- POPUP CUSTOM ---------------------------->
|
|
5
|
-
<b-modal
|
|
6
|
-
v-show="isPopupCustom === true"
|
|
7
|
-
id="popup-custom"
|
|
8
|
-
ref="popup-custom"
|
|
9
|
-
:content-class="[pType, pName]"
|
|
10
|
-
:no-fade="animationOff"
|
|
11
|
-
:header-close-label="$t('button.alert_close')"
|
|
12
|
-
v-bind="pContent.$bvArgs"
|
|
13
|
-
@cancel="$cancel(pContent.cb_$cancel)"
|
|
14
|
-
@ok="$confirm(pContent.cb_$confirm)"
|
|
15
|
-
@hidden="$close(pContent.cb_$close)"
|
|
16
|
-
>
|
|
17
|
-
<template v-slot:default>
|
|
18
|
-
<div class="box-content-popUp" v-html="pContent.hypertext" />
|
|
19
|
-
</template>
|
|
20
|
-
</b-modal>
|
|
21
|
-
<!----------------------- OTHER POPUP ---------------------------->
|
|
22
|
-
|
|
23
|
-
<b-modal
|
|
24
|
-
v-show="isPopupCustom === false"
|
|
25
|
-
:id="getAppState"
|
|
26
|
-
ref="someModal"
|
|
27
|
-
:header-close-label="$t('button.alert_close')"
|
|
28
|
-
:hide-footer="true"
|
|
29
|
-
:content-class="[pType, pName, typeRetro, getAppState]"
|
|
30
|
-
:no-fade="animationOff"
|
|
31
|
-
@hidden="$close(pContent.cb_$close)"
|
|
32
|
-
>
|
|
33
|
-
<!------------------- Custom DIV: Use to add any custom Css (visual) to your Popup ------------------------->
|
|
34
|
-
<div v-show="pType == 'popup-retro'" class="pop-deco"></div>
|
|
35
|
-
<!----------------------------- END Custom DIV ------------------------------------->
|
|
36
|
-
<div class="popUp-title">
|
|
37
|
-
<h4 v-html="pTitle"></h4>
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
<div v-if="contentLength > 0" class="box-content-popUp">
|
|
41
|
-
<div
|
|
42
|
-
v-for="(content, _key, index) of pContent"
|
|
43
|
-
:id="`col-ref-${_key}`"
|
|
44
|
-
:key="`ref_${_key}_${content}`"
|
|
45
|
-
class="col-popUp"
|
|
46
|
-
>
|
|
47
|
-
<!-------- Create TEXT element -------------->
|
|
48
|
-
<p
|
|
49
|
-
v-if="_key.includes('text') && !_key.includes('hyper')"
|
|
50
|
-
:id="`${_key}_${index}`"
|
|
51
|
-
:key="_key"
|
|
52
|
-
>
|
|
53
|
-
{{ content }}
|
|
54
|
-
</p>
|
|
55
|
-
|
|
56
|
-
<!-------- Create HTMLelement -------------->
|
|
57
|
-
<div
|
|
58
|
-
v-else-if="_key.includes('hypertext')"
|
|
59
|
-
:id="`${_key}_${index}`"
|
|
60
|
-
:key="_key"
|
|
61
|
-
v-html="content"
|
|
62
|
-
/>
|
|
63
|
-
|
|
64
|
-
<!-------- Create IMAGE element ------------->
|
|
65
|
-
<img
|
|
66
|
-
v-else-if="_key.includes('image')"
|
|
67
|
-
:id="`${_key}_${index}`"
|
|
68
|
-
:key="_key"
|
|
69
|
-
:src="require(`@/assets/${content.path}`)"
|
|
70
|
-
:alt="content.label || 'image'"
|
|
71
|
-
/>
|
|
72
|
-
|
|
73
|
-
<!-------- Create LINK element -------------->
|
|
74
|
-
<a
|
|
75
|
-
v-else-if="_key.includes('link')"
|
|
76
|
-
:id="`${_key}_${index}`"
|
|
77
|
-
:key="_key"
|
|
78
|
-
:href="content.ref"
|
|
79
|
-
target="_blank"
|
|
80
|
-
:title="`${content.label}`"
|
|
81
|
-
>
|
|
82
|
-
{{ content.label }}
|
|
83
|
-
</a>
|
|
84
|
-
|
|
85
|
-
<!-------- Create VIDEO element ------------->
|
|
86
|
-
<video
|
|
87
|
-
v-else-if="_key.includes('video')"
|
|
88
|
-
:id="`${_key}_${index}`"
|
|
89
|
-
:key="_key"
|
|
90
|
-
:src="require(`@/assets/${content}`)"
|
|
91
|
-
controls
|
|
92
|
-
disablepictureinpicture
|
|
93
|
-
controlslist="nofullscreen nodownload"
|
|
94
|
-
/>
|
|
95
|
-
|
|
96
|
-
<!--------Create AUDIO element--------------->
|
|
97
|
-
<audio
|
|
98
|
-
v-else-if="_key.includes('audio')"
|
|
99
|
-
:id="`${_key}_${index}`"
|
|
100
|
-
:key="_key"
|
|
101
|
-
:src="require(`@/assets/${content}`)"
|
|
102
|
-
controls
|
|
103
|
-
controlslist="nodownload"
|
|
104
|
-
/>
|
|
105
|
-
</div>
|
|
106
|
-
</div>
|
|
107
|
-
<!--------Default Button of Pop up --------------->
|
|
108
|
-
<div v-show="pType === 'popup-avert'" class="col-bouton">
|
|
109
|
-
<app-base-button
|
|
110
|
-
id="btn-cancel-popup"
|
|
111
|
-
:name-acces="'Annuler'"
|
|
112
|
-
class="btn-cancel"
|
|
113
|
-
:title="$t('button.cancel_pop')"
|
|
114
|
-
@click="$cancel(pContent.cb_$cancel)"
|
|
115
|
-
>
|
|
116
|
-
{{ $t('button.cancel_pop') }}
|
|
117
|
-
</app-base-button>
|
|
118
|
-
<app-base-button
|
|
119
|
-
id="btn-confirm-popup"
|
|
120
|
-
:name-acces="'Confirmer'"
|
|
121
|
-
class="btn-confirm"
|
|
122
|
-
:title="$t('button.confirm_pop')"
|
|
123
|
-
@click="$confirm(pContent.cb_$confirm)"
|
|
124
|
-
>
|
|
125
|
-
{{ $t('button.confirm_pop') }}
|
|
126
|
-
</app-base-button>
|
|
127
|
-
</div>
|
|
128
|
-
<div
|
|
129
|
-
v-if="pType === 'popup-retro' || pType === 'popup-info'"
|
|
130
|
-
id="popup-bottom-buttons"
|
|
131
|
-
>
|
|
132
|
-
<button
|
|
133
|
-
id="popup-retro-close-btn"
|
|
134
|
-
:title="$t('button.alert_close')"
|
|
135
|
-
@click="$close(pContent.cb_$close)"
|
|
136
|
-
>
|
|
137
|
-
{{ $t('button.alert_close') }}
|
|
138
|
-
</button>
|
|
139
|
-
<portal-target
|
|
140
|
-
id="popup_retro_nav_wrapper"
|
|
141
|
-
name="popup_retro_nav"
|
|
142
|
-
></portal-target>
|
|
143
|
-
</div>
|
|
144
|
-
<div v-if="pType === 'popup-noanswer'" id="popup-bottom-buttons">
|
|
145
|
-
<button
|
|
146
|
-
id="popup-retro-close-btn"
|
|
147
|
-
:title="$t('button.quiz_close_no_answer')"
|
|
148
|
-
@click="$close(pContent.cb_$close)"
|
|
149
|
-
>
|
|
150
|
-
{{ $t('button.quiz_close_no_answer') }}
|
|
151
|
-
</button>
|
|
152
|
-
<portal-target
|
|
153
|
-
id="popup_retro_nav_wrapper"
|
|
154
|
-
name="popup_retro_nav"
|
|
155
|
-
></portal-target>
|
|
156
|
-
</div>
|
|
157
|
-
</b-modal>
|
|
158
|
-
</div>
|
|
159
|
-
<div v-show="errors.length > 0" class="pop-error">
|
|
160
|
-
<app-base-error-display :errors-list="errors" :doc-link="docLink" />
|
|
161
|
-
</div>
|
|
162
|
-
</div>
|
|
163
|
-
</template>
|
|
164
|
-
|
|
165
|
-
<script>
|
|
166
|
-
//import { mapGetters } from 'vuex'
|
|
167
|
-
export default {
|
|
168
|
-
name: 'AppCompPopUp',
|
|
169
|
-
data() {
|
|
170
|
-
return {
|
|
171
|
-
pType: 'popup-info',
|
|
172
|
-
pName: 'noName',
|
|
173
|
-
typeRetro: 'none',
|
|
174
|
-
pContent: {},
|
|
175
|
-
pContenttype: 'pg_normal',
|
|
176
|
-
pTitle: '',
|
|
177
|
-
errors: [],
|
|
178
|
-
docLink:
|
|
179
|
-
'https://fcaddocumentation.netlify.app/guide/ressources.html#creer-un-popup-custom',
|
|
180
|
-
animationOff: false
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
computed: {
|
|
184
|
-
contentLength() {
|
|
185
|
-
let size = null
|
|
186
|
-
if (this.pType && this.pType !== 'popup-custom') {
|
|
187
|
-
if (this.pContent && Object.keys(this.pContent).length > 0)
|
|
188
|
-
size = Object.keys(this.pContent).length
|
|
189
|
-
}
|
|
190
|
-
return size
|
|
191
|
-
},
|
|
192
|
-
isPopupCustom() {
|
|
193
|
-
if (this.pType && this.pType === 'popup-custom') return true
|
|
194
|
-
return false
|
|
195
|
-
},
|
|
196
|
-
popup() {
|
|
197
|
-
/**
|
|
198
|
-
* Get the istance of the bvModal that is open and return it as our active popup
|
|
199
|
-
*/
|
|
200
|
-
let id
|
|
201
|
-
if (this.isPopupCustom) id = 'popup-custom'
|
|
202
|
-
else id = `${this.getAppState}`
|
|
203
|
-
const p = this.$bvModal._vm.$children.find((p) => p.id === id)
|
|
204
|
-
return p
|
|
205
|
-
},
|
|
206
|
-
getAppState() {
|
|
207
|
-
let toto
|
|
208
|
-
if (!this.$store.state.$appStore.isDr) {
|
|
209
|
-
toto = 'not-popup-custom full '
|
|
210
|
-
} else {
|
|
211
|
-
toto = 'not-popup-custom lites '
|
|
212
|
-
}
|
|
213
|
-
return toto
|
|
214
|
-
}
|
|
215
|
-
},
|
|
216
|
-
mounted() {
|
|
217
|
-
this.$bus.$on('popup-open', (e) => {
|
|
218
|
-
if (e) {
|
|
219
|
-
this.validateContent(e)
|
|
220
|
-
}
|
|
221
|
-
})
|
|
222
|
-
this.$bus.$on('popup-close', (options, cb) => {
|
|
223
|
-
this.$close(options, cb)
|
|
224
|
-
})
|
|
225
|
-
|
|
226
|
-
this.$bus.$on('retro-type', (b) => {
|
|
227
|
-
this.retroType(b)
|
|
228
|
-
})
|
|
229
|
-
},
|
|
230
|
-
methods: {
|
|
231
|
-
/**
|
|
232
|
-
* @description - Validate the data for the component
|
|
233
|
-
* @param {Object} data
|
|
234
|
-
*/
|
|
235
|
-
validateContent(data) {
|
|
236
|
-
const typeList = [
|
|
237
|
-
'popup-info',
|
|
238
|
-
'popup-retro',
|
|
239
|
-
'popup-avert',
|
|
240
|
-
'popup-custom',
|
|
241
|
-
'popup-noanswer'
|
|
242
|
-
]
|
|
243
|
-
const callbacksFunctionList = [
|
|
244
|
-
'cb_$confirm',
|
|
245
|
-
'cb_$cancel',
|
|
246
|
-
'cb_$open',
|
|
247
|
-
'cb_$close'
|
|
248
|
-
]
|
|
249
|
-
|
|
250
|
-
if (this.errors.length > 0) this.errors = []
|
|
251
|
-
|
|
252
|
-
if (data.type) {
|
|
253
|
-
// validate the type value of popup
|
|
254
|
-
const validType = typeList.includes(data.type)
|
|
255
|
-
|
|
256
|
-
if (!validType) this.errors.push('Invalid value for type')
|
|
257
|
-
} else this.errors.push('Missing argument: type')
|
|
258
|
-
|
|
259
|
-
// validate value of the popup according to popup type
|
|
260
|
-
// Content must be String|Object
|
|
261
|
-
if (data.value) {
|
|
262
|
-
let validObject = false
|
|
263
|
-
if (
|
|
264
|
-
data.value.constructor === Object &&
|
|
265
|
-
Object.keys(data.value).length > 0
|
|
266
|
-
)
|
|
267
|
-
validObject = true
|
|
268
|
-
if (validObject) {
|
|
269
|
-
let KeywordsList
|
|
270
|
-
switch (data.type) {
|
|
271
|
-
case 'popup-custom':
|
|
272
|
-
KeywordsList = ['hypertext', '$bvArgs'] // accepted keyword in value declartion for pop-up custom
|
|
273
|
-
|
|
274
|
-
for (const key of Object.keys(data.value)) {
|
|
275
|
-
// search if key match lists
|
|
276
|
-
if (![...KeywordsList, ...callbacksFunctionList].includes(key))
|
|
277
|
-
this.errors.push('Invalid key declaration in value')
|
|
278
|
-
|
|
279
|
-
// Validating content of hypertext key
|
|
280
|
-
if (
|
|
281
|
-
key.includes('hypertext') &&
|
|
282
|
-
data.value[key].constructor != String
|
|
283
|
-
) {
|
|
284
|
-
this.errors.push(
|
|
285
|
-
'Invalid assigment for hypertext. Must be a String'
|
|
286
|
-
)
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
// validating content of cb_$ keys
|
|
290
|
-
if (
|
|
291
|
-
key.includes('cb_$') &&
|
|
292
|
-
data.value[key].constructor != Function
|
|
293
|
-
) {
|
|
294
|
-
this.errors.push(
|
|
295
|
-
`Invalid assigment for ${key}. Must be a Function`
|
|
296
|
-
)
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
// validating content of $bvArgs keys. Must be an array.
|
|
300
|
-
// validating content of $bvArgs. Content in $bvArgs must be objects
|
|
301
|
-
if (
|
|
302
|
-
(key.includes('$bvArgs') &&
|
|
303
|
-
data.value[key].constructor != Array) ||
|
|
304
|
-
(data.value[key].constructor === Array &&
|
|
305
|
-
data.value[key].length < 1)
|
|
306
|
-
) {
|
|
307
|
-
this.errors.push(
|
|
308
|
-
`Invalid assigment for ${key}. Must be an Array of Objects`
|
|
309
|
-
)
|
|
310
|
-
} else if (
|
|
311
|
-
key.includes('$bvArgs') &&
|
|
312
|
-
data.value[key].constructor === Array &&
|
|
313
|
-
data.value[key].length > 0
|
|
314
|
-
) {
|
|
315
|
-
let count = 0
|
|
316
|
-
data.value[key].forEach((element) => {
|
|
317
|
-
if (element.constructor !== Object && count < 1) {
|
|
318
|
-
this.errors.push(
|
|
319
|
-
`Invalid value(s) found in ${key}. Must be an Array of Objects`
|
|
320
|
-
)
|
|
321
|
-
count++
|
|
322
|
-
}
|
|
323
|
-
})
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
break
|
|
327
|
-
|
|
328
|
-
default:
|
|
329
|
-
KeywordsList = [
|
|
330
|
-
'title',
|
|
331
|
-
'text_',
|
|
332
|
-
'image_',
|
|
333
|
-
'video_',
|
|
334
|
-
'audio_',
|
|
335
|
-
'link_',
|
|
336
|
-
'hypertext_'
|
|
337
|
-
] // accepted keyword in value declartion for pop-up custom
|
|
338
|
-
|
|
339
|
-
for (let key of Object.keys(data.value)) {
|
|
340
|
-
const savedKey = key // backup key
|
|
341
|
-
|
|
342
|
-
if (key.includes('_') && !key.includes('cb_$'))
|
|
343
|
-
key = `${key.split('_')[0]}_`
|
|
344
|
-
|
|
345
|
-
// search if key match lists
|
|
346
|
-
if (![...KeywordsList, ...callbacksFunctionList].includes(key))
|
|
347
|
-
this.errors.push('Invalid key declaration in value')
|
|
348
|
-
|
|
349
|
-
// Validating content of link element
|
|
350
|
-
if (key.includes('link') && !data.value[savedKey].ref) {
|
|
351
|
-
this.errors.push('Missing ref for link')
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
// validating content of image element
|
|
355
|
-
if (key.includes('image') && !data.value[savedKey].path)
|
|
356
|
-
this.errors.push('Missing path for image')
|
|
357
|
-
|
|
358
|
-
// validating content of cb_$ keys
|
|
359
|
-
if (
|
|
360
|
-
key.includes('cb_$') &&
|
|
361
|
-
data.value[key].constructor != Function
|
|
362
|
-
)
|
|
363
|
-
this.errors.push(
|
|
364
|
-
`Invalid assigment for ${key}. Must be a Function`
|
|
365
|
-
)
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
} else this.errors.push('Invalid object declaration for value')
|
|
369
|
-
} else this.errors.push('Missing argument - value')
|
|
370
|
-
|
|
371
|
-
if (process.env.NODE_ENV === 'development') {
|
|
372
|
-
for (const err of this.errors)
|
|
373
|
-
console.warn(
|
|
374
|
-
`%c WARNING!>>> POP-UP: ${err} `,
|
|
375
|
-
'background: orange; color: white; display: block; border-radius:5px; margin:5px;'
|
|
376
|
-
)
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
// No error detected proced
|
|
380
|
-
if (!this.errors.length) {
|
|
381
|
-
if (data.type === 'popup-custom') {
|
|
382
|
-
this.pContent = data.value
|
|
383
|
-
} else {
|
|
384
|
-
const { title, ...filtered } = data.value
|
|
385
|
-
this.pContent = filtered
|
|
386
|
-
this.pTitle = title
|
|
387
|
-
}
|
|
388
|
-
this.pType = data.type
|
|
389
|
-
this.pName = data.name
|
|
390
|
-
const cb_open = data.value.cb_$open || null
|
|
391
|
-
this.$open(cb_open)
|
|
392
|
-
}
|
|
393
|
-
},
|
|
394
|
-
|
|
395
|
-
/**
|
|
396
|
-
* @param {String} type
|
|
397
|
-
*/
|
|
398
|
-
retroType(type) {
|
|
399
|
-
this.typeRetro = type
|
|
400
|
-
return this.typeRetro
|
|
401
|
-
},
|
|
402
|
-
/**
|
|
403
|
-
* @description - method to open the popup
|
|
404
|
-
* @param {Function} cb
|
|
405
|
-
*/
|
|
406
|
-
$open(cb) {
|
|
407
|
-
if (this.animationOff === true) this.animationOff = false
|
|
408
|
-
this.popup.show()
|
|
409
|
-
if (cb && typeof cb === 'function') cb()
|
|
410
|
-
},
|
|
411
|
-
/**
|
|
412
|
-
* @description - method to close the popup
|
|
413
|
-
* @param {Function} cb
|
|
414
|
-
*/
|
|
415
|
-
$close(options, cb) {
|
|
416
|
-
//this.animationOff =true
|
|
417
|
-
if (options && options.animationOff) {
|
|
418
|
-
this.animationOff = options.animationOff
|
|
419
|
-
}
|
|
420
|
-
this.popup.hide()
|
|
421
|
-
//reset popup class name
|
|
422
|
-
this.typeRetro = 'none'
|
|
423
|
-
if (cb && typeof cb === 'function') cb()
|
|
424
|
-
},
|
|
425
|
-
/**
|
|
426
|
-
* @description - method for action confirm
|
|
427
|
-
* @param {Function} cb
|
|
428
|
-
*/
|
|
429
|
-
$confirm(cb) {
|
|
430
|
-
cb = cb || null
|
|
431
|
-
this.popup.hide()
|
|
432
|
-
if (cb && typeof cb === 'function') cb()
|
|
433
|
-
},
|
|
434
|
-
/**
|
|
435
|
-
* @description - method for action cancel
|
|
436
|
-
* @param {Function} cb
|
|
437
|
-
*/
|
|
438
|
-
$cancel(cb) {
|
|
439
|
-
cb = cb || null
|
|
440
|
-
this.popup.hide()
|
|
441
|
-
if (cb && typeof cb === 'function') cb()
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
</script>
|
|
446
|
-
<style lang="scss">
|
|
447
|
-
.modal {
|
|
448
|
-
.modal-dialog {
|
|
449
|
-
max-width: 100% !important;
|
|
450
|
-
height: 100%;
|
|
451
|
-
margin: 0 0 !important;
|
|
452
|
-
|
|
453
|
-
// DR pop-up
|
|
454
|
-
.lites {
|
|
455
|
-
width: 450px;
|
|
456
|
-
margin: 10% auto;
|
|
457
|
-
|
|
458
|
-
.modal-header {
|
|
459
|
-
border-bottom: 0 solid transparent;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
#popup-bottom-buttons {
|
|
463
|
-
display: none;
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
// full minou pop-up
|
|
468
|
-
.full {
|
|
469
|
-
&.popup-retro {
|
|
470
|
-
width: 50%;
|
|
471
|
-
height: 100%;
|
|
472
|
-
position: relative;
|
|
473
|
-
border-radius: 0;
|
|
474
|
-
border-width: 0;
|
|
475
|
-
|
|
476
|
-
.modal-header {
|
|
477
|
-
position: absolute;
|
|
478
|
-
top: 0;
|
|
479
|
-
right: 0;
|
|
480
|
-
z-index: 2;
|
|
481
|
-
border-bottom: 0 solid transparent;
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
.modal-body {
|
|
485
|
-
#popup-bottom-buttons {
|
|
486
|
-
position: absolute;
|
|
487
|
-
bottom: 0;
|
|
488
|
-
margin-bottom: 65px;
|
|
489
|
-
|
|
490
|
-
#popup-retro-close-btn {
|
|
491
|
-
display: inline-block;
|
|
492
|
-
vertical-align: top;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
#popup_retro_nav_wrapper {
|
|
496
|
-
display: inline-block;
|
|
497
|
-
vertical-align: top;
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
&.popup-info,
|
|
504
|
-
&.popup-noanswer {
|
|
505
|
-
width: 660px;
|
|
506
|
-
margin: 10% auto;
|
|
507
|
-
.modal-header {
|
|
508
|
-
border-bottom: 0 solid transparent;
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
#popup_retro_nav_wrapper {
|
|
512
|
-
display: inline-block;
|
|
513
|
-
order: 1;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
#popup-retro-close-btn {
|
|
517
|
-
order: 2;
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
</style>
|