@everymatrix/general-tutorial-slider 1.44.0 → 1.45.0
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/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/general-tutorial-slider.cjs.entry.js +267 -301
- package/dist/cjs/general-tutorial-slider.cjs.js +17 -11
- package/dist/cjs/index-42afbd98.js +1243 -0
- package/dist/cjs/loader.cjs.js +7 -13
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/general-tutorial-slider/general-tutorial-slider.css +0 -2
- package/dist/collection/components/general-tutorial-slider/general-tutorial-slider.js +466 -510
- package/dist/collection/components/general-tutorial-slider/index.js +1 -0
- package/dist/collection/utils/locale.utils.js +34 -34
- package/dist/collection/utils/utils.js +26 -26
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/general-tutorial-slider.entry.js +267 -301
- package/dist/esm/general-tutorial-slider.js +14 -11
- package/dist/esm/index-a6815b2c.js +1216 -0
- package/dist/esm/loader.js +7 -13
- package/dist/general-tutorial-slider/general-tutorial-slider.esm.js +1 -1
- package/dist/general-tutorial-slider/p-5bac4bfc.entry.js +1 -0
- package/dist/general-tutorial-slider/p-87756a93.js +2 -0
- package/dist/general-tutorial-slider/p-e1255160.js +1 -0
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +14 -19
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-tutorial-slider/.stencil/packages/stencil/general-tutorial-slider/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-tutorial-slider/.stencil/packages/stencil/general-tutorial-slider/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/general-tutorial-slider/general-tutorial-slider.d.ts +88 -88
- package/dist/types/components/general-tutorial-slider/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +142 -33
- package/loader/cdn.js +1 -3
- package/loader/index.cjs.js +1 -3
- package/loader/index.d.ts +13 -1
- package/loader/index.es2017.js +1 -3
- package/loader/index.js +1 -3
- package/loader/package.json +1 -0
- package/package.json +8 -1
- package/dist/cjs/index-18ec3908.js +0 -1282
- package/dist/components/general-tutorial-slider.d.ts +0 -11
- package/dist/components/general-tutorial-slider.js +0 -376
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -1
- package/dist/esm/index-a2165162.js +0 -1256
- 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/p-4e4fd5b7.entry.js +0 -1
- package/dist/general-tutorial-slider/p-a878ee14.js +0 -1
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/general-tutorial-slider/.stencil/packages/general-tutorial-slider/stencil.config.d.ts +0 -2
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Components, JSX } from "../types/components";
|
|
2
|
-
|
|
3
|
-
interface GeneralTutorialSlider extends Components.GeneralTutorialSlider, HTMLElement {}
|
|
4
|
-
export const GeneralTutorialSlider: {
|
|
5
|
-
prototype: GeneralTutorialSlider;
|
|
6
|
-
new (): GeneralTutorialSlider;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Used to define this component and all nested components recursively.
|
|
10
|
-
*/
|
|
11
|
-
export const defineCustomElement: () => void;
|
|
@@ -1,376 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
-
|
|
3
|
-
const DEFAULT_LANGUAGE = 'en';
|
|
4
|
-
const TRANSLATIONS = {
|
|
5
|
-
en: {
|
|
6
|
-
error: 'Error',
|
|
7
|
-
noResults: 'Loading, please wait ...',
|
|
8
|
-
},
|
|
9
|
-
hu: {
|
|
10
|
-
error: 'Error',
|
|
11
|
-
noResults: 'Loading, please wait ...',
|
|
12
|
-
},
|
|
13
|
-
ro: {
|
|
14
|
-
error: 'Eroare',
|
|
15
|
-
noResults: 'Loading, please wait ...',
|
|
16
|
-
},
|
|
17
|
-
fr: {
|
|
18
|
-
error: 'Error',
|
|
19
|
-
noResults: 'Loading, please wait ...',
|
|
20
|
-
},
|
|
21
|
-
ar: {
|
|
22
|
-
error: 'خطأ',
|
|
23
|
-
noResults: 'Loading, please wait ...',
|
|
24
|
-
},
|
|
25
|
-
hr: {
|
|
26
|
-
error: 'Greška',
|
|
27
|
-
noResults: 'Učitavanje, molimo pričekajte ...',
|
|
28
|
-
},
|
|
29
|
-
'es-mx': {
|
|
30
|
-
'error': 'Error',
|
|
31
|
-
'noResults': 'Cargando, espere por favor…'
|
|
32
|
-
},
|
|
33
|
-
'pt-br': {
|
|
34
|
-
'error': 'Erro',
|
|
35
|
-
'noResults': 'Carregando, espere por favor…'
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
const translate = (key, customLang) => {
|
|
39
|
-
const lang = customLang;
|
|
40
|
-
return TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key];
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* @name isMobile
|
|
45
|
-
* @description A method that returns if the browser used to access the app is from a mobile device or not
|
|
46
|
-
* @param {String} userAgent window.navigator.userAgent
|
|
47
|
-
* @returns {Boolean} true or false
|
|
48
|
-
*/
|
|
49
|
-
const isMobile = (userAgent) => {
|
|
50
|
-
return !!(userAgent.toLowerCase().match(/android/i) ||
|
|
51
|
-
userAgent.toLowerCase().match(/blackberry|bb/i) ||
|
|
52
|
-
userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
|
|
53
|
-
userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
|
|
54
|
-
};
|
|
55
|
-
const getDevice = () => {
|
|
56
|
-
let userAgent = window.navigator.userAgent;
|
|
57
|
-
if (userAgent.toLowerCase().match(/android/i)) {
|
|
58
|
-
return 'Android';
|
|
59
|
-
}
|
|
60
|
-
if (userAgent.toLowerCase().match(/iphone/i)) {
|
|
61
|
-
return 'iPhone';
|
|
62
|
-
}
|
|
63
|
-
if (userAgent.toLowerCase().match(/ipad|ipod/i)) {
|
|
64
|
-
return 'iPad';
|
|
65
|
-
}
|
|
66
|
-
return 'PC';
|
|
67
|
-
};
|
|
68
|
-
const getDevicePlatform = () => {
|
|
69
|
-
const device = getDevice();
|
|
70
|
-
if (device) {
|
|
71
|
-
if (device === 'PC') {
|
|
72
|
-
return 'dk';
|
|
73
|
-
}
|
|
74
|
-
else if (device === 'iPad' || device === 'iPhone') {
|
|
75
|
-
return 'ios';
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
return 'mtWeb';
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
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}";
|
|
84
|
-
|
|
85
|
-
const GeneralTutorialSlider$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
86
|
-
constructor() {
|
|
87
|
-
super();
|
|
88
|
-
this.__registerHost();
|
|
89
|
-
this.__attachShadow();
|
|
90
|
-
/**
|
|
91
|
-
* Client custom styling via inline style
|
|
92
|
-
*/
|
|
93
|
-
this.clientStyling = '';
|
|
94
|
-
/**
|
|
95
|
-
* Client custom styling via url
|
|
96
|
-
*/
|
|
97
|
-
this.clientStylingUrl = '';
|
|
98
|
-
/**
|
|
99
|
-
* Language of the widget
|
|
100
|
-
*/
|
|
101
|
-
this.language = 'en';
|
|
102
|
-
/**
|
|
103
|
-
* User roles
|
|
104
|
-
*/
|
|
105
|
-
this.userRoles = 'everyone';
|
|
106
|
-
/**
|
|
107
|
-
* CMS Endpoint stage
|
|
108
|
-
*/
|
|
109
|
-
this.cmsEnv = 'stage';
|
|
110
|
-
/**
|
|
111
|
-
* Show slider dots
|
|
112
|
-
*/
|
|
113
|
-
this.showSliderDots = true;
|
|
114
|
-
/**
|
|
115
|
-
* Show slider navigate arrows
|
|
116
|
-
*/
|
|
117
|
-
this.showSliderArrows = true;
|
|
118
|
-
/**
|
|
119
|
-
* Show slider navigate arrows on mobile
|
|
120
|
-
*/
|
|
121
|
-
this.showSliderArrowsMobile = false;
|
|
122
|
-
/**
|
|
123
|
-
* Auto-scroll will only function if it is set to true, and otherwise it will be ignored.
|
|
124
|
-
*/
|
|
125
|
-
this.enableAutoScroll = false;
|
|
126
|
-
/**
|
|
127
|
-
* Set interval period for slider
|
|
128
|
-
*/
|
|
129
|
-
this.intervalPeriod = 5000;
|
|
130
|
-
/**
|
|
131
|
-
* Set the number of slides you wish to display.
|
|
132
|
-
*/
|
|
133
|
-
this.scrollItems = 1;
|
|
134
|
-
/**
|
|
135
|
-
* Set the number of slides you wish to display.
|
|
136
|
-
*/
|
|
137
|
-
this.itemsPerPage = 1;
|
|
138
|
-
this.hasErrors = false;
|
|
139
|
-
this.limitStylingAppends = false;
|
|
140
|
-
this.isLoading = true;
|
|
141
|
-
this.activeIndex = 0;
|
|
142
|
-
this.tutorialElementWidth = 0;
|
|
143
|
-
this.userAgent = window.navigator.userAgent;
|
|
144
|
-
this.isMobile = isMobile(this.userAgent);
|
|
145
|
-
this.allElementsWidth = 0;
|
|
146
|
-
this.xDown = null;
|
|
147
|
-
this.yDown = null;
|
|
148
|
-
this.resizeHandler = () => {
|
|
149
|
-
this.recalculateItemsPerPage();
|
|
150
|
-
};
|
|
151
|
-
this.orientationChangeHandler = () => {
|
|
152
|
-
setTimeout(() => {
|
|
153
|
-
this.recalculateItemsPerPage();
|
|
154
|
-
}, 10);
|
|
155
|
-
};
|
|
156
|
-
this.setClientStyling = () => {
|
|
157
|
-
let sheet = document.createElement('style');
|
|
158
|
-
sheet.innerHTML = this.clientStyling;
|
|
159
|
-
this.stylingContainer.prepend(sheet);
|
|
160
|
-
};
|
|
161
|
-
this.setClientStylingURL = () => {
|
|
162
|
-
let url = new URL(this.clientStylingUrl);
|
|
163
|
-
let cssFile = document.createElement('style');
|
|
164
|
-
fetch(url.href)
|
|
165
|
-
.then((res) => res.text())
|
|
166
|
-
.then((data) => {
|
|
167
|
-
cssFile.innerHTML = data;
|
|
168
|
-
setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
|
|
169
|
-
})
|
|
170
|
-
.catch((err) => {
|
|
171
|
-
console.log('error ', err);
|
|
172
|
-
});
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
watchEndpoint(newValue, oldValue) {
|
|
176
|
-
if (newValue && newValue != oldValue && this.cmsEndpoint) {
|
|
177
|
-
this.getGeneralTutorialSlider().then((tutorialContent) => {
|
|
178
|
-
this.tutorialData = tutorialContent;
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
connectedCallback() {
|
|
183
|
-
window.screen.orientation.addEventListener('change', this.orientationChangeHandler);
|
|
184
|
-
}
|
|
185
|
-
componentWillLoad() {
|
|
186
|
-
if (this.cmsEndpoint && this.language) {
|
|
187
|
-
return this.getGeneralTutorialSlider().then((tutorialContent) => {
|
|
188
|
-
this.tutorialData = tutorialContent;
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
componentDidLoad() {
|
|
193
|
-
window.addEventListener('resize', this.resizeHandler);
|
|
194
|
-
}
|
|
195
|
-
componentDidRender() {
|
|
196
|
-
this.el.addEventListener('touchstart', this.handleTouchStart.bind(this), { passive: true });
|
|
197
|
-
this.el.addEventListener('touchmove', this.handleTouchMove.bind(this), { passive: true });
|
|
198
|
-
this.recalculateItemsPerPage();
|
|
199
|
-
// start custom styling area
|
|
200
|
-
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
201
|
-
if (this.clientStyling)
|
|
202
|
-
this.setClientStyling();
|
|
203
|
-
if (this.clientStylingUrl)
|
|
204
|
-
this.setClientStylingURL();
|
|
205
|
-
this.limitStylingAppends = true;
|
|
206
|
-
}
|
|
207
|
-
// end custom styling area
|
|
208
|
-
}
|
|
209
|
-
componentDidUpdate() {
|
|
210
|
-
this.recalculateItemsPerPage();
|
|
211
|
-
}
|
|
212
|
-
disconnectedCallback() {
|
|
213
|
-
this.el.removeEventListener('touchstart', this.handleTouchStart);
|
|
214
|
-
this.el.removeEventListener('touchmove', this.handleTouchMove);
|
|
215
|
-
window.screen.orientation.removeEventListener('change', this.orientationChangeHandler);
|
|
216
|
-
window.removeEventListener('resize', this.resizeHandler);
|
|
217
|
-
}
|
|
218
|
-
getGeneralTutorialSlider() {
|
|
219
|
-
let url = new URL(`${this.cmsEndpoint}/${this.language}/slider-onboarding`);
|
|
220
|
-
url.searchParams.append('env', this.cmsEnv);
|
|
221
|
-
url.searchParams.append('userRoles', this.userRoles);
|
|
222
|
-
url.searchParams.append('device', getDevicePlatform());
|
|
223
|
-
return new Promise((resolve, reject) => {
|
|
224
|
-
this.isLoading = true;
|
|
225
|
-
fetch(url.href)
|
|
226
|
-
.then((res) => res.json())
|
|
227
|
-
.then((tutorialContent) => {
|
|
228
|
-
resolve(tutorialContent);
|
|
229
|
-
}).catch((err) => {
|
|
230
|
-
console.error(err);
|
|
231
|
-
this.hasErrors = true;
|
|
232
|
-
reject(err);
|
|
233
|
-
}).finally(() => {
|
|
234
|
-
this.isLoading = false;
|
|
235
|
-
});
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
move(direction) {
|
|
239
|
-
this.setActive(this.activeIndex + direction);
|
|
240
|
-
}
|
|
241
|
-
;
|
|
242
|
-
//calculate itemsperpage by tutorials length to avoid empty in the tutorials end
|
|
243
|
-
recalculateItemsPerPage() {
|
|
244
|
-
if (!this.tutorialsElement)
|
|
245
|
-
return;
|
|
246
|
-
this.tutorialElementWidth = this.tutorialsElement.clientWidth;
|
|
247
|
-
this.allElementsWidth = (this.tutorialData.length - 1) * this.tutorialElementWidth;
|
|
248
|
-
}
|
|
249
|
-
;
|
|
250
|
-
goTo(index) {
|
|
251
|
-
let diff = this.activeIndex - index;
|
|
252
|
-
if (diff > 0) {
|
|
253
|
-
for (let i = 0; i < diff; i++) {
|
|
254
|
-
this.move(-1);
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
else {
|
|
258
|
-
for (let i = 0; i > diff; i--) {
|
|
259
|
-
this.move(1);
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
handleTouchStart(evt) {
|
|
264
|
-
const firstTouch = this.getTouches(evt)[0];
|
|
265
|
-
this.xDown = firstTouch.clientX;
|
|
266
|
-
this.yDown = firstTouch.clientY;
|
|
267
|
-
}
|
|
268
|
-
getTouches(evt) {
|
|
269
|
-
return evt.touches || evt.originalEvent.touches;
|
|
270
|
-
}
|
|
271
|
-
handleTouchMove(evt) {
|
|
272
|
-
if (!this.xDown || !this.yDown)
|
|
273
|
-
return;
|
|
274
|
-
let xUp = evt.touches[0].clientX;
|
|
275
|
-
let yUp = evt.touches[0].clientY;
|
|
276
|
-
let xDiff = this.xDown - xUp;
|
|
277
|
-
let yDiff = this.yDown - yUp;
|
|
278
|
-
if (Math.abs(xDiff) > Math.abs(yDiff)) {
|
|
279
|
-
if (xDiff > 0) {
|
|
280
|
-
this.move(1);
|
|
281
|
-
}
|
|
282
|
-
else {
|
|
283
|
-
this.move(-1);
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
this.xDown = null;
|
|
287
|
-
this.yDown = null;
|
|
288
|
-
}
|
|
289
|
-
;
|
|
290
|
-
setActive(index) {
|
|
291
|
-
const maxLength = this.tutorialData.length;
|
|
292
|
-
if (index >= 0) {
|
|
293
|
-
if (index >= maxLength - 1) {
|
|
294
|
-
this.activeIndex = maxLength - 1;
|
|
295
|
-
}
|
|
296
|
-
else {
|
|
297
|
-
this.activeIndex = index;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
else {
|
|
301
|
-
this.activeIndex = 0;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
renderDots() {
|
|
305
|
-
const dots = [];
|
|
306
|
-
for (let index = 0; index < this.tutorialData.length / this.itemsPerPage; index++) {
|
|
307
|
-
dots.push(h("li", { class: index == this.activeIndex ? 'active' : 'default', onClick: () => { this.goTo(index); this.setActive(index); } }));
|
|
308
|
-
}
|
|
309
|
-
return dots;
|
|
310
|
-
}
|
|
311
|
-
render() {
|
|
312
|
-
const styles = {
|
|
313
|
-
transform: `translate(${(this.allElementsWidth / (this.tutorialData.length - 1) * this.activeIndex) * -1}px, 0px)`
|
|
314
|
-
};
|
|
315
|
-
const itemStyle = {
|
|
316
|
-
width: `${this.tutorialElementWidth / this.itemsPerPage}px`
|
|
317
|
-
};
|
|
318
|
-
if (this.hasErrors) {
|
|
319
|
-
return (h("div", { class: "GeneralTutorialSliderError" }, h("div", { class: "TitleError" }, translate('error', this.language))));
|
|
320
|
-
}
|
|
321
|
-
if (!this.isLoading) {
|
|
322
|
-
return (h("div", { ref: el => this.stylingContainer = el }, h("div", { class: "TutorialWrapper" }, h("div", { class: "TutorialContent", ref: (el) => this.slider = el }, ((this.showSliderArrows && !this.isMobile) ||
|
|
323
|
-
(this.showSliderArrowsMobile && this.isMobile)) &&
|
|
324
|
-
h("div", { class: this.activeIndex === 0 ? 'SliderNavButton DisabledArrow' : 'SliderNavButton', onClick: () => this.move(-1) }, h("svg", { fill: "none", stroke: "var(--emfe-w-color-secondary, #FD2839)", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M15 19l-7-7 7-7" }))), h("main", null, h("div", { style: styles, ref: (el) => this.tutorialsElement = el, class: "TutorialItems" }, this.tutorialData.map((data) => {
|
|
325
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
326
|
-
return h("div", { class: "TutorialItem", style: itemStyle }, 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) ? (h("div", { class: "ItemImage" }, this.isMobile ? (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 })) : (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) ? (h("div", { class: "ItemImage" }, this.isMobile ? (h("video", { controls: true, loop: true, autoplay: true }, 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" }))) : (h("video", { controls: true, loop: true, autoplay: true }, 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, h("div", { class: "ItemDescription", innerHTML: data === null || data === void 0 ? void 0 : data.content }));
|
|
327
|
-
}))), ((this.showSliderArrows && !this.isMobile) ||
|
|
328
|
-
(this.showSliderArrowsMobile && this.isMobile)) &&
|
|
329
|
-
h("div", { class: this.activeIndex === this.tutorialData.length - 1 ? ' SliderNavButton DisabledArrow disabled' : 'SliderNavButton', onClick: () => this.move(1) }, h("svg", { fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M9 5l7 7-7 7" }))), h("div", null)), this.showSliderDots &&
|
|
330
|
-
h("div", { class: "DotsWrapper" }, h("ul", { class: "Dots" }, this.renderDots())))));
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
get el() { return this; }
|
|
334
|
-
static get watchers() { return {
|
|
335
|
-
"cmsEndpoint": ["watchEndpoint"],
|
|
336
|
-
"language": ["watchEndpoint"]
|
|
337
|
-
}; }
|
|
338
|
-
static get style() { return generalTutorialSliderCss; }
|
|
339
|
-
}, [1, "general-tutorial-slider", {
|
|
340
|
-
"clientStyling": [513, "client-styling"],
|
|
341
|
-
"clientStylingUrl": [513, "client-styling-url"],
|
|
342
|
-
"language": [513],
|
|
343
|
-
"cmsEndpoint": [513, "cms-endpoint"],
|
|
344
|
-
"userRoles": [513, "user-roles"],
|
|
345
|
-
"cmsEnv": [513, "cms-env"],
|
|
346
|
-
"showSliderDots": [516, "show-slider-dots"],
|
|
347
|
-
"showSliderArrows": [516, "show-slider-arrows"],
|
|
348
|
-
"showSliderArrowsMobile": [516, "show-slider-arrows-mobile"],
|
|
349
|
-
"enableAutoScroll": [516, "enable-auto-scroll"],
|
|
350
|
-
"intervalPeriod": [514, "interval-period"],
|
|
351
|
-
"scrollItems": [520, "scroll-items"],
|
|
352
|
-
"itemsPerPage": [514, "items-per-page"],
|
|
353
|
-
"hasErrors": [32],
|
|
354
|
-
"limitStylingAppends": [32],
|
|
355
|
-
"isLoading": [32],
|
|
356
|
-
"activeIndex": [32],
|
|
357
|
-
"tutorialElementWidth": [32]
|
|
358
|
-
}]);
|
|
359
|
-
function defineCustomElement$1() {
|
|
360
|
-
if (typeof customElements === "undefined") {
|
|
361
|
-
return;
|
|
362
|
-
}
|
|
363
|
-
const components = ["general-tutorial-slider"];
|
|
364
|
-
components.forEach(tagName => { switch (tagName) {
|
|
365
|
-
case "general-tutorial-slider":
|
|
366
|
-
if (!customElements.get(tagName)) {
|
|
367
|
-
customElements.define(tagName, GeneralTutorialSlider$1);
|
|
368
|
-
}
|
|
369
|
-
break;
|
|
370
|
-
} });
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
const GeneralTutorialSlider = GeneralTutorialSlider$1;
|
|
374
|
-
const defineCustomElement = defineCustomElement$1;
|
|
375
|
-
|
|
376
|
-
export { GeneralTutorialSlider, defineCustomElement };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/* GeneralTutorialSlider custom elements */
|
|
2
|
-
|
|
3
|
-
import type { Components, JSX } from "../types/components";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Used to manually set the base path where assets can be found.
|
|
7
|
-
* If the script is used as "module", it's recommended to use "import.meta.url",
|
|
8
|
-
* such as "setAssetPath(import.meta.url)". Other options include
|
|
9
|
-
* "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
|
|
10
|
-
* dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
|
|
11
|
-
* But do note that this configuration depends on how your script is bundled, or lack of
|
|
12
|
-
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
13
|
-
* will have to ensure the static assets are copied to its build directory.
|
|
14
|
-
*/
|
|
15
|
-
export declare const setAssetPath: (path: string) => void;
|
|
16
|
-
|
|
17
|
-
export interface SetPlatformOptions {
|
|
18
|
-
raf?: (c: FrameRequestCallback) => number;
|
|
19
|
-
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
20
|
-
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
21
|
-
}
|
|
22
|
-
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
23
|
-
|
|
24
|
-
export type { Components, JSX };
|
|
25
|
-
|
|
26
|
-
export * from '../types';
|
package/dist/components/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|