@everymatrix/general-tutorial-slider 1.31.1 → 1.32.4
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/LICENSE +21 -0
- package/package.json +3 -2
- package/dist/cjs/general-tutorial-slider.cjs.entry.js +0 -344
- package/dist/cjs/general-tutorial-slider.cjs.js +0 -19
- package/dist/cjs/index-18ec3908.js +0 -1282
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/loader.cjs.js +0 -21
- package/dist/collection/collection-manifest.json +0 -12
- package/dist/collection/components/general-tutorial-slider/general-tutorial-slider.css +0 -168
- package/dist/collection/components/general-tutorial-slider/general-tutorial-slider.js +0 -526
- package/dist/collection/index.js +0 -1
- package/dist/collection/utils/locale.utils.js +0 -40
- package/dist/collection/utils/utils.js +0 -39
- package/dist/components/general-tutorial-slider.d.ts +0 -11
- package/dist/components/general-tutorial-slider.js +0 -377
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -1
- package/dist/esm/general-tutorial-slider.entry.js +0 -340
- package/dist/esm/general-tutorial-slider.js +0 -17
- package/dist/esm/index-a2165162.js +0 -1256
- package/dist/esm/index.js +0 -1
- package/dist/esm/loader.js +0 -17
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/general-tutorial-slider/general-tutorial-slider.esm.js +0 -1
- package/dist/general-tutorial-slider/index.esm.js +0 -0
- package/dist/general-tutorial-slider/p-a5ce3c59.entry.js +0 -1
- package/dist/general-tutorial-slider/p-a878ee14.js +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/stencil.config.js +0 -22
- package/dist/types/Users/sebastian.strulea/Documents/work/widgets-stencil/packages/general-tutorial-slider/.stencil/packages/general-tutorial-slider/stencil.config.d.ts +0 -2
- package/dist/types/components/general-tutorial-slider/general-tutorial-slider.d.ts +0 -90
- package/dist/types/components.d.ts +0 -141
- package/dist/types/index.d.ts +0 -1
- package/dist/types/stencil-public-runtime.d.ts +0 -1565
- package/dist/types/utils/locale.utils.d.ts +0 -1
- package/dist/types/utils/utils.d.ts +0 -9
- package/loader/cdn.js +0 -3
- package/loader/index.cjs.js +0 -3
- package/loader/index.d.ts +0 -12
- package/loader/index.es2017.js +0 -3
- package/loader/index.js +0 -4
- package/loader/package.json +0 -10
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/general-tutorial-slider",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.32.4",
|
|
4
4
|
"main": "./dist/index.cjs.js",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"es2015": "./dist/esm/index.mjs",
|
|
@@ -15,5 +15,6 @@
|
|
|
15
15
|
],
|
|
16
16
|
"publishConfig": {
|
|
17
17
|
"access": "public"
|
|
18
|
-
}
|
|
18
|
+
},
|
|
19
|
+
"gitHead": "69a4e0bb1b0460c07baef352d283492a6e2dc4b0"
|
|
19
20
|
}
|
|
@@ -1,344 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-18ec3908.js');
|
|
6
|
-
|
|
7
|
-
const DEFAULT_LANGUAGE = 'en';
|
|
8
|
-
const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hu', 'hr'];
|
|
9
|
-
const TRANSLATIONS = {
|
|
10
|
-
en: {
|
|
11
|
-
error: 'Error',
|
|
12
|
-
noResults: 'Loading, please wait ...',
|
|
13
|
-
},
|
|
14
|
-
hu: {
|
|
15
|
-
error: 'Error',
|
|
16
|
-
noResults: 'Loading, please wait ...',
|
|
17
|
-
},
|
|
18
|
-
ro: {
|
|
19
|
-
error: 'Eroare',
|
|
20
|
-
noResults: 'Loading, please wait ...',
|
|
21
|
-
},
|
|
22
|
-
fr: {
|
|
23
|
-
error: 'Error',
|
|
24
|
-
noResults: 'Loading, please wait ...',
|
|
25
|
-
},
|
|
26
|
-
ar: {
|
|
27
|
-
error: 'خطأ',
|
|
28
|
-
noResults: 'Loading, please wait ...',
|
|
29
|
-
},
|
|
30
|
-
hr: {
|
|
31
|
-
error: 'Greška',
|
|
32
|
-
noResults: 'Učitavanje, molimo pričekajte ...',
|
|
33
|
-
},
|
|
34
|
-
'es-mx': {
|
|
35
|
-
'error': 'Error',
|
|
36
|
-
'noResults': 'Cargando, espere por favor…'
|
|
37
|
-
},
|
|
38
|
-
'pt-br': {
|
|
39
|
-
'error': 'Erro',
|
|
40
|
-
'noResults': 'Carregando, espere por favor…'
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
const translate = (key, customLang) => {
|
|
44
|
-
const lang = customLang;
|
|
45
|
-
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* @name isMobile
|
|
50
|
-
* @description A method that returns if the browser used to access the app is from a mobile device or not
|
|
51
|
-
* @param {String} userAgent window.navigator.userAgent
|
|
52
|
-
* @returns {Boolean} true or false
|
|
53
|
-
*/
|
|
54
|
-
const isMobile = (userAgent) => {
|
|
55
|
-
return !!(userAgent.toLowerCase().match(/android/i) ||
|
|
56
|
-
userAgent.toLowerCase().match(/blackberry|bb/i) ||
|
|
57
|
-
userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
|
|
58
|
-
userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
|
|
59
|
-
};
|
|
60
|
-
const getDevice = () => {
|
|
61
|
-
let userAgent = window.navigator.userAgent;
|
|
62
|
-
if (userAgent.toLowerCase().match(/android/i)) {
|
|
63
|
-
return 'Android';
|
|
64
|
-
}
|
|
65
|
-
if (userAgent.toLowerCase().match(/iphone/i)) {
|
|
66
|
-
return 'iPhone';
|
|
67
|
-
}
|
|
68
|
-
if (userAgent.toLowerCase().match(/ipad|ipod/i)) {
|
|
69
|
-
return 'iPad';
|
|
70
|
-
}
|
|
71
|
-
return 'PC';
|
|
72
|
-
};
|
|
73
|
-
const getDevicePlatform = () => {
|
|
74
|
-
const device = getDevice();
|
|
75
|
-
if (device) {
|
|
76
|
-
if (device === 'PC') {
|
|
77
|
-
return 'dk';
|
|
78
|
-
}
|
|
79
|
-
else if (device === 'iPad' || device === 'iPhone') {
|
|
80
|
-
return 'ios';
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
return 'mtWeb';
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
const generalTutorialSliderCss = ":host {\n display: block;\n}\n\n.GeneralTutorialSliderError {\n display: flex;\n justify-content: center;\n flex-direction: column;\n}\n.GeneralTutorialSliderError.TitleError {\n color: red;\n}\n\nmain {\n width: 100%;\n overflow: hidden;\n}\n\n.TutorialWrapper {\n width: 100%;\n display: flex;\n flex: 0 0 auto;\n justify-content: center;\n flex-direction: column;\n overflow: auto;\n}\n\n.TutorialContent {\n display: flex;\n justify-content: center;\n flex-direction: row;\n}\n\n.TutorialItems {\n display: flex;\n transition: transform 0.4s ease-in-out;\n transform: translateX(0px);\n}\n\n.TutorialItem {\n flex: 0 0 auto;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: center;\n color: #000;\n background-color: #f5f5f5;\n border-radius: 5px;\n user-select: none;\n}\n.TutorialItem .ItemTitle {\n padding: 25px 15px;\n font-size: 18px;\n font-weight: 600;\n color: var(--emfe-w-color-secondary, #FD2839);\n}\n.TutorialItem .ItemImage {\n overflow: hidden;\n}\n.TutorialItem .ItemImage img, .TutorialItem .ItemImage video {\n height: auto;\n width: 450px;\n}\n.TutorialItem .ItemDescription {\n font-size: 14px;\n padding: 25px 15px;\n font-weight: 400;\n color: #000;\n}\n\n.SliderNavButton {\n border: 0px;\n width: 25px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.SliderNavButton svg {\n width: 20px;\n stroke: var(--emfe-w-color-secondary, #FD2839);\n}\n\n.DisabledArrow svg {\n opacity: 0.2;\n stroke: var(--emfe-w-color-secondary, #FD2839);\n pointer-events: none;\n}\n\n.DotsWrapper {\n width: 100%;\n margin: 0 auto;\n margin-top: 20px;\n height: 30px;\n}\n.DotsWrapper ul.Dots {\n display: flex;\n justify-content: center;\n padding: 0;\n}\n.DotsWrapper ul.Dots li {\n height: 10px;\n width: 10px;\n background: #ccc;\n border-radius: 50%;\n margin-left: 3px;\n margin-right: 3px;\n list-style: none;\n cursor: pointer;\n}\n.DotsWrapper ul.Dots li:hover {\n background: #bbb;\n}\n.DotsWrapper ul.Dots li.active {\n border: solid 1px var(--emfe-w-color-secondary, #FD2839);\n background: var(--emfe-w-color-secondary, #FD2839);\n}\n.DotsWrapper ul.Dots li.default {\n border: solid 1px var(--emfe-w-color-secondary, #FD2839);\n background-color: #FFF;\n}\n\n@container (max-width: 475px) {\n @media screen and (orientation: landscape) {\n .TutorialItem {\n width: 100%;\n }\n }\n main {\n height: 90cqh;\n }\n\n .TutorialItems {\n height: inherit;\n }\n\n .TutorialItem {\n min-width: 100%;\n max-height: 800px;\n overflow: auto;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: center;\n color: #000;\n background-color: #f5f5f5;\n border-radius: 5px;\n user-select: none;\n }\n .TutorialItem .ItemTitle {\n padding: 25px 15px;\n font-size: 18px;\n font-weight: 600;\n color: var(--emfe-w-color-secondary, #FD2839);\n }\n .TutorialItem .ItemImage {\n min-height: 200px;\n }\n .TutorialItem .ItemImage img, .TutorialItem .ItemImage video {\n height: auto;\n width: 100%;\n }\n .TutorialItem .ItemDescription {\n font-size: 14px;\n padding: 25px 15px;\n font-weight: 400;\n color: #000;\n }\n}";
|
|
89
|
-
|
|
90
|
-
const GeneralTutorialSlider = class {
|
|
91
|
-
constructor(hostRef) {
|
|
92
|
-
index.registerInstance(this, hostRef);
|
|
93
|
-
/**
|
|
94
|
-
* Client custom styling via inline style
|
|
95
|
-
*/
|
|
96
|
-
this.clientStyling = '';
|
|
97
|
-
/**
|
|
98
|
-
* Client custom styling via url
|
|
99
|
-
*/
|
|
100
|
-
this.clientStylingUrl = '';
|
|
101
|
-
/**
|
|
102
|
-
* Language of the widget
|
|
103
|
-
*/
|
|
104
|
-
this.language = 'en';
|
|
105
|
-
/**
|
|
106
|
-
* User roles
|
|
107
|
-
*/
|
|
108
|
-
this.userRoles = 'everyone';
|
|
109
|
-
/**
|
|
110
|
-
* CMS Endpoint stage
|
|
111
|
-
*/
|
|
112
|
-
this.cmsEnv = 'stage';
|
|
113
|
-
/**
|
|
114
|
-
* Show slider dots
|
|
115
|
-
*/
|
|
116
|
-
this.showSliderDots = true;
|
|
117
|
-
/**
|
|
118
|
-
* Show slider navigate arrows
|
|
119
|
-
*/
|
|
120
|
-
this.showSliderArrows = true;
|
|
121
|
-
/**
|
|
122
|
-
* Show slider navigate arrows on mobile
|
|
123
|
-
*/
|
|
124
|
-
this.showSliderArrowsMobile = false;
|
|
125
|
-
/**
|
|
126
|
-
* Auto-scroll will only function if it is set to true, and otherwise it will be ignored.
|
|
127
|
-
*/
|
|
128
|
-
this.enableAutoScroll = false;
|
|
129
|
-
/**
|
|
130
|
-
* Set interval period for slider
|
|
131
|
-
*/
|
|
132
|
-
this.intervalPeriod = 5000;
|
|
133
|
-
/**
|
|
134
|
-
* Set the number of slides you wish to display.
|
|
135
|
-
*/
|
|
136
|
-
this.scrollItems = 1;
|
|
137
|
-
/**
|
|
138
|
-
* Set the number of slides you wish to display.
|
|
139
|
-
*/
|
|
140
|
-
this.itemsPerPage = 1;
|
|
141
|
-
this.hasErrors = false;
|
|
142
|
-
this.limitStylingAppends = false;
|
|
143
|
-
this.isLoading = true;
|
|
144
|
-
this.activeIndex = 0;
|
|
145
|
-
this.tutorialElementWidth = 0;
|
|
146
|
-
this.userAgent = window.navigator.userAgent;
|
|
147
|
-
this.isMobile = isMobile(this.userAgent);
|
|
148
|
-
this.allElementsWidth = 0;
|
|
149
|
-
this.xDown = null;
|
|
150
|
-
this.yDown = null;
|
|
151
|
-
this.resizeHandler = () => {
|
|
152
|
-
this.recalculateItemsPerPage();
|
|
153
|
-
};
|
|
154
|
-
this.orientationChangeHandler = () => {
|
|
155
|
-
setTimeout(() => {
|
|
156
|
-
this.recalculateItemsPerPage();
|
|
157
|
-
}, 10);
|
|
158
|
-
};
|
|
159
|
-
this.setClientStyling = () => {
|
|
160
|
-
let sheet = document.createElement('style');
|
|
161
|
-
sheet.innerHTML = this.clientStyling;
|
|
162
|
-
this.stylingContainer.prepend(sheet);
|
|
163
|
-
};
|
|
164
|
-
this.setClientStylingURL = () => {
|
|
165
|
-
let url = new URL(this.clientStylingUrl);
|
|
166
|
-
let cssFile = document.createElement('style');
|
|
167
|
-
fetch(url.href)
|
|
168
|
-
.then((res) => res.text())
|
|
169
|
-
.then((data) => {
|
|
170
|
-
cssFile.innerHTML = data;
|
|
171
|
-
setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
|
|
172
|
-
})
|
|
173
|
-
.catch((err) => {
|
|
174
|
-
console.log('error ', err);
|
|
175
|
-
});
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
watchEndpoint(newValue, oldValue) {
|
|
179
|
-
if (newValue && newValue != oldValue && this.cmsEndpoint) {
|
|
180
|
-
this.getGeneralTutorialSlider().then((tutorialContent) => {
|
|
181
|
-
this.tutorialData = tutorialContent;
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
connectedCallback() {
|
|
186
|
-
window.screen.orientation.addEventListener('change', this.orientationChangeHandler);
|
|
187
|
-
}
|
|
188
|
-
componentWillLoad() {
|
|
189
|
-
if (this.cmsEndpoint && this.language) {
|
|
190
|
-
return this.getGeneralTutorialSlider().then((tutorialContent) => {
|
|
191
|
-
this.tutorialData = tutorialContent;
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
componentDidLoad() {
|
|
196
|
-
window.addEventListener('resize', this.resizeHandler);
|
|
197
|
-
}
|
|
198
|
-
componentDidRender() {
|
|
199
|
-
this.el.addEventListener('touchstart', this.handleTouchStart.bind(this), { passive: true });
|
|
200
|
-
this.el.addEventListener('touchmove', this.handleTouchMove.bind(this), { passive: true });
|
|
201
|
-
this.recalculateItemsPerPage();
|
|
202
|
-
// start custom styling area
|
|
203
|
-
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
204
|
-
if (this.clientStyling)
|
|
205
|
-
this.setClientStyling();
|
|
206
|
-
if (this.clientStylingUrl)
|
|
207
|
-
this.setClientStylingURL();
|
|
208
|
-
this.limitStylingAppends = true;
|
|
209
|
-
}
|
|
210
|
-
// end custom styling area
|
|
211
|
-
}
|
|
212
|
-
componentDidUpdate() {
|
|
213
|
-
this.recalculateItemsPerPage();
|
|
214
|
-
}
|
|
215
|
-
disconnectedCallback() {
|
|
216
|
-
this.el.removeEventListener('touchstart', this.handleTouchStart);
|
|
217
|
-
this.el.removeEventListener('touchmove', this.handleTouchMove);
|
|
218
|
-
window.screen.orientation.removeEventListener('change', this.orientationChangeHandler);
|
|
219
|
-
window.removeEventListener('resize', this.resizeHandler);
|
|
220
|
-
}
|
|
221
|
-
getGeneralTutorialSlider() {
|
|
222
|
-
let url = new URL(`${this.cmsEndpoint}/${this.language}/slider-onboarding`);
|
|
223
|
-
url.searchParams.append('env', this.cmsEnv);
|
|
224
|
-
url.searchParams.append('userRoles', this.userRoles);
|
|
225
|
-
url.searchParams.append('device', getDevicePlatform());
|
|
226
|
-
return new Promise((resolve, reject) => {
|
|
227
|
-
this.isLoading = true;
|
|
228
|
-
fetch(url.href)
|
|
229
|
-
.then((res) => res.json())
|
|
230
|
-
.then((tutorialContent) => {
|
|
231
|
-
resolve(tutorialContent);
|
|
232
|
-
}).catch((err) => {
|
|
233
|
-
console.error(err);
|
|
234
|
-
this.hasErrors = true;
|
|
235
|
-
reject(err);
|
|
236
|
-
}).finally(() => {
|
|
237
|
-
this.isLoading = false;
|
|
238
|
-
});
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
move(direction) {
|
|
242
|
-
this.setActive(this.activeIndex + direction);
|
|
243
|
-
}
|
|
244
|
-
;
|
|
245
|
-
//calculate itemsperpage by tutorials length to avoid empty in the tutorials end
|
|
246
|
-
recalculateItemsPerPage() {
|
|
247
|
-
if (!this.tutorialsElement)
|
|
248
|
-
return;
|
|
249
|
-
this.tutorialElementWidth = this.tutorialsElement.clientWidth;
|
|
250
|
-
this.allElementsWidth = (this.tutorialData.length - 1) * this.tutorialElementWidth;
|
|
251
|
-
}
|
|
252
|
-
;
|
|
253
|
-
goTo(index) {
|
|
254
|
-
let diff = this.activeIndex - index;
|
|
255
|
-
if (diff > 0) {
|
|
256
|
-
for (let i = 0; i < diff; i++) {
|
|
257
|
-
this.move(-1);
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
else {
|
|
261
|
-
for (let i = 0; i > diff; i--) {
|
|
262
|
-
this.move(1);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
handleTouchStart(evt) {
|
|
267
|
-
const firstTouch = this.getTouches(evt)[0];
|
|
268
|
-
this.xDown = firstTouch.clientX;
|
|
269
|
-
this.yDown = firstTouch.clientY;
|
|
270
|
-
}
|
|
271
|
-
getTouches(evt) {
|
|
272
|
-
return evt.touches || evt.originalEvent.touches;
|
|
273
|
-
}
|
|
274
|
-
handleTouchMove(evt) {
|
|
275
|
-
if (!this.xDown || !this.yDown)
|
|
276
|
-
return;
|
|
277
|
-
let xUp = evt.touches[0].clientX;
|
|
278
|
-
let yUp = evt.touches[0].clientY;
|
|
279
|
-
let xDiff = this.xDown - xUp;
|
|
280
|
-
let yDiff = this.yDown - yUp;
|
|
281
|
-
if (Math.abs(xDiff) > Math.abs(yDiff)) {
|
|
282
|
-
if (xDiff > 0) {
|
|
283
|
-
this.move(1);
|
|
284
|
-
}
|
|
285
|
-
else {
|
|
286
|
-
this.move(-1);
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
this.xDown = null;
|
|
290
|
-
this.yDown = null;
|
|
291
|
-
}
|
|
292
|
-
;
|
|
293
|
-
setActive(index) {
|
|
294
|
-
const maxLength = this.tutorialData.length;
|
|
295
|
-
if (index >= 0) {
|
|
296
|
-
if (index >= maxLength - 1) {
|
|
297
|
-
this.activeIndex = maxLength - 1;
|
|
298
|
-
}
|
|
299
|
-
else {
|
|
300
|
-
this.activeIndex = index;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
else {
|
|
304
|
-
this.activeIndex = 0;
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
renderDots() {
|
|
308
|
-
const dots = [];
|
|
309
|
-
for (let index$1 = 0; index$1 < this.tutorialData.length / this.itemsPerPage; index$1++) {
|
|
310
|
-
dots.push(index.h("li", { class: index$1 == this.activeIndex ? 'active' : 'default', onClick: () => { this.goTo(index$1); this.setActive(index$1); } }));
|
|
311
|
-
}
|
|
312
|
-
return dots;
|
|
313
|
-
}
|
|
314
|
-
render() {
|
|
315
|
-
const styles = {
|
|
316
|
-
transform: `translate(${(this.allElementsWidth / (this.tutorialData.length - 1) * this.activeIndex) * -1}px, 0px)`
|
|
317
|
-
};
|
|
318
|
-
const itemStyle = {
|
|
319
|
-
width: `${this.tutorialElementWidth / this.itemsPerPage}px`
|
|
320
|
-
};
|
|
321
|
-
if (this.hasErrors) {
|
|
322
|
-
return (index.h("div", { class: "GeneralTutorialSliderError" }, index.h("div", { class: "TitleError" }, translate('error', this.language))));
|
|
323
|
-
}
|
|
324
|
-
if (!this.isLoading) {
|
|
325
|
-
return (index.h("div", { ref: el => this.stylingContainer = el }, index.h("div", { class: "TutorialWrapper" }, index.h("div", { class: "TutorialContent", ref: (el) => this.slider = el }, ((this.showSliderArrows && !this.isMobile) ||
|
|
326
|
-
(this.showSliderArrowsMobile && this.isMobile)) &&
|
|
327
|
-
index.h("div", { class: this.activeIndex === 0 ? 'SliderNavButton DisabledArrow' : 'SliderNavButton', onClick: () => this.move(-1) }, index.h("svg", { fill: "none", stroke: "var(--emfe-w-color-secondary, #FD2839)", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M15 19l-7-7 7-7" }))), index.h("main", null, index.h("div", { style: styles, ref: (el) => this.tutorialsElement = el, class: "TutorialItems" }, this.tutorialData.map((data) => {
|
|
328
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
329
|
-
return index.h("div", { class: "TutorialItem", style: itemStyle }, index.h("div", { class: "ItemTitle", innerHTML: data === null || data === void 0 ? void 0 : data.title }), ((_a = data === null || data === void 0 ? void 0 : data.media) === null || _a === void 0 ? void 0 : _a.images) ? (index.h("div", { class: "ItemImage" }, this.isMobile ? (index.h("img", { src: (_e = (_d = (_c = (_b = data === null || data === void 0 ? void 0 : data.media) === null || _b === void 0 ? void 0 : _b.images[0]) === null || _c === void 0 ? void 0 : _c.sources) === null || _d === void 0 ? void 0 : _d.find((source) => source.media === 'mobile')) === null || _e === void 0 ? void 0 : _e.src, alt: data === null || data === void 0 ? void 0 : data.slug })) : (index.h("img", { src: (_j = (_h = (_g = (_f = data === null || data === void 0 ? void 0 : data.media) === null || _f === void 0 ? void 0 : _f.images[0]) === null || _g === void 0 ? void 0 : _g.sources) === null || _h === void 0 ? void 0 : _h.find((source) => source.media === 'desktop')) === null || _j === void 0 ? void 0 : _j.src, alt: data === null || data === void 0 ? void 0 : data.slug })))) : ((_k = data === null || data === void 0 ? void 0 : data.media) === null || _k === void 0 ? void 0 : _k.video) ? (index.h("div", { class: "ItemImage" }, this.isMobile ? (index.h("video", { controls: true, loop: true, autoplay: true }, index.h("source", { src: (_p = (_o = (_m = (_l = data === null || data === void 0 ? void 0 : data.media) === null || _l === void 0 ? void 0 : _l.video[0]) === null || _m === void 0 ? void 0 : _m.sources) === null || _o === void 0 ? void 0 : _o.find((source) => source.media === 'mobile')) === null || _p === void 0 ? void 0 : _p.src, type: "video/mp4" }))) : (index.h("video", { controls: true, loop: true, autoplay: true }, index.h("source", { src: (_t = (_s = (_r = (_q = data === null || data === void 0 ? void 0 : data.media) === null || _q === void 0 ? void 0 : _q.video[0]) === null || _r === void 0 ? void 0 : _r.sources) === null || _s === void 0 ? void 0 : _s.find((source) => source.media === 'desktop')) === null || _t === void 0 ? void 0 : _t.src, type: "video/mp4" }))))) : null, index.h("div", { class: "ItemDescription", innerHTML: data === null || data === void 0 ? void 0 : data.content }));
|
|
330
|
-
}))), ((this.showSliderArrows && !this.isMobile) ||
|
|
331
|
-
(this.showSliderArrowsMobile && this.isMobile)) &&
|
|
332
|
-
index.h("div", { class: this.activeIndex === this.tutorialData.length - 1 ? ' SliderNavButton DisabledArrow disabled' : 'SliderNavButton', onClick: () => this.move(1) }, index.h("svg", { fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M9 5l7 7-7 7" }))), index.h("div", null)), this.showSliderDots &&
|
|
333
|
-
index.h("div", { class: "DotsWrapper" }, index.h("ul", { class: "Dots" }, this.renderDots())))));
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
get el() { return index.getElement(this); }
|
|
337
|
-
static get watchers() { return {
|
|
338
|
-
"cmsEndpoint": ["watchEndpoint"],
|
|
339
|
-
"language": ["watchEndpoint"]
|
|
340
|
-
}; }
|
|
341
|
-
};
|
|
342
|
-
GeneralTutorialSlider.style = generalTutorialSliderCss;
|
|
343
|
-
|
|
344
|
-
exports.general_tutorial_slider = GeneralTutorialSlider;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const index = require('./index-18ec3908.js');
|
|
4
|
-
|
|
5
|
-
/*
|
|
6
|
-
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
7
|
-
*/
|
|
8
|
-
const patchBrowser = () => {
|
|
9
|
-
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('general-tutorial-slider.cjs.js', document.baseURI).href));
|
|
10
|
-
const opts = {};
|
|
11
|
-
if (importMeta !== '') {
|
|
12
|
-
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
13
|
-
}
|
|
14
|
-
return index.promiseResolve(opts);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["general-tutorial-slider.cjs",[[1,"general-tutorial-slider",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"cmsEndpoint":[513,"cms-endpoint"],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"showSliderDots":[516,"show-slider-dots"],"showSliderArrows":[516,"show-slider-arrows"],"showSliderArrowsMobile":[516,"show-slider-arrows-mobile"],"enableAutoScroll":[516,"enable-auto-scroll"],"intervalPeriod":[514,"interval-period"],"scrollItems":[520,"scroll-items"],"itemsPerPage":[514,"items-per-page"],"hasErrors":[32],"limitStylingAppends":[32],"isLoading":[32],"activeIndex":[32],"tutorialElementWidth":[32]}]]]], options);
|
|
19
|
-
});
|