@iris.interactive/handcook 7.2.2-beta → 8.0.0-alpha.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/.gitlab-ci.yml +2 -2
- package/.nvmrc +1 -1
- package/.stylelintrc +89 -0
- package/README.md +1 -1
- package/biome.json +43 -0
- package/package.json +35 -40
- package/public/index.css +1 -0
- package/public/index.html +33 -36
- package/public/index.js +240 -0
- package/public/scripts/components/collapse/collapse.component.js +1 -82
- package/public/scripts/components/collapse/collapse.component.scss +4 -4
- package/public/scripts/components/dropdown/dropdown.component.js +1 -68
- package/public/scripts/components/lazyload/lazyload.component.js +1 -48
- package/public/scripts/components/lightbox/lightbox.component.js +1 -78
- package/public/scripts/components/modal/modal.component.js +1 -70
- package/public/scripts/components/nats/nats.component.js +1 -49
- package/public/scripts/components/overlay/overlay.component.js +1 -88
- package/public/scripts/components/popin/popin.component.js +1 -137
- package/public/scripts/components/scroll-reveal/scroll-reveal.component.js +1 -155
- package/public/scripts/components/scrollspy/scrollspy.component.js +1 -93
- package/public/scripts/components/share/share.component.js +1 -51
- package/public/scripts/components/slider/slider.component.js +1 -312
- package/public/scripts/components/smooth-scroll/smooth-scroll.component.js +1 -45
- package/public/scripts/components/tab/tab.component.js +1 -69
- package/public/scripts/components/toggle/toggle.component.js +1 -38
- package/public/scripts/components/tooltip/tooltip.component.js +1 -106
- package/public/scripts/enumerators/element.enum.js +1 -27
- package/public/scripts/enumerators/share.enum.js +1 -6
- package/public/scripts/enumerators/smooth-scroll.enum.js +1 -6
- package/public/scripts/enumerators/tooltip.enum.js +1 -12
- package/public/scripts/handcook.js +1 -36
- package/public/scripts/hc_swiper_v11.js +5 -0
- package/public/scripts/libraries/swiper-11/index.js +7 -0
- package/public/scripts/libraries/swiper-8/index.js +7 -0
- package/public/scripts/support/cookie.support.js +1 -22
- package/public/scripts/support/hash.support.js +1 -11
- package/public/scripts/support/toggle-html.support.js +1 -5
- package/public/scripts/support/wrap-select.support.js +1 -3
- package/public/styles/hc_swiper_v11.css +1 -0
- package/public/styles/hc_swiper_v11.js +1 -0
- package/public/styles/scss/_utils.scss +21 -17
- package/public/styles/scss/handcook.scss +5 -5
- package/public/styles/scss/mixins/_mixin-font.scss +19 -6
- package/public/styles/scss/mixins/_mixin-layout.scss +10 -7
- package/public/styles/scss/mixins/_mixin-style.scss +63 -60
- package/public/styles/scss/style.css +1 -172
- package/mix-manifest.json +0 -57
- package/public/scripts/components/collapse/collapse.component.min.js +0 -1
- package/public/scripts/components/dropdown/dropdown.component.min.js +0 -1
- package/public/scripts/components/lazyload/lazyload.component.min.js +0 -1
- package/public/scripts/components/lightbox/lightbox.component.min.js +0 -1
- package/public/scripts/components/modal/modal.component.min.js +0 -1
- package/public/scripts/components/scrollspy/scrollspy.component.min.js +0 -1
- package/public/scripts/components/slider/slider.component.min.js +0 -1
- package/public/scripts/components/smooth-scroll/smooth-scroll.component.min.js +0 -1
- package/public/scripts/components/tab/tab.component.min.js +0 -1
- package/public/scripts/components/toggle/toggle.component.min.js +0 -1
- package/public/scripts/components/tooltip/tooltip.component.min.js +0 -1
- package/public/scripts/index.js.LICENSE.txt +0 -1
- package/public/styles/style.css +0 -28
|
@@ -11,315 +11,4 @@
|
|
|
11
11
|
* @author Lucas ROCHE
|
|
12
12
|
* @date 22/02/2022 17:21
|
|
13
13
|
* @copyright Copyright (c) 2002-2022 IRIS Interactive, Inc. (http://www.iris-interactive.fr)
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
import ElementEnum from "../../enumerators/element.enum";
|
|
17
|
-
import Swiper from "swiper/bundle";
|
|
18
|
-
import "swiper/css";
|
|
19
|
-
import "swiper/css/effect-fade";
|
|
20
|
-
|
|
21
|
-
export class HcSlider {
|
|
22
|
-
|
|
23
|
-
slider;
|
|
24
|
-
instances = [];
|
|
25
|
-
|
|
26
|
-
breakpoints = [{
|
|
27
|
-
name: "medium",
|
|
28
|
-
value: 651
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: "large",
|
|
32
|
-
value: 1001
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: "xlarge",
|
|
36
|
-
value: 1454
|
|
37
|
-
}];
|
|
38
|
-
|
|
39
|
-
// Options
|
|
40
|
-
options = {};
|
|
41
|
-
|
|
42
|
-
// Events
|
|
43
|
-
initEvent;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* @param elements
|
|
47
|
-
*/
|
|
48
|
-
constructor(elements = ElementEnum.slider) {
|
|
49
|
-
document.querySelectorAll(elements).forEach(element => {
|
|
50
|
-
this.initEvent = new Event("init.hc.slider");
|
|
51
|
-
this.initOptions();
|
|
52
|
-
this.slider = element;
|
|
53
|
-
this.setOptions();
|
|
54
|
-
this.buildDom();
|
|
55
|
-
const instance = new Swiper(element, this.options);
|
|
56
|
-
this.instances.push(instance);
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
setOptions() {
|
|
61
|
-
const attr = this.slider.getAttribute('data-hc-slider-autoplay');
|
|
62
|
-
if (attr !== null) {
|
|
63
|
-
this.options['autoplay'] = {
|
|
64
|
-
delay: attr
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
let breakpointOptions = {};
|
|
69
|
-
|
|
70
|
-
let breakpointKeyConfig = [
|
|
71
|
-
{
|
|
72
|
-
'hcKey': 'gap',
|
|
73
|
-
'libKey': 'spaceBetween',
|
|
74
|
-
'callback': 'parseFloat'
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
'hcKey': 'slides-per-view',
|
|
78
|
-
'libKey': 'slidesPerView',
|
|
79
|
-
'callback': 'parseFloat'
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
'hcKey': 'no-swipe',
|
|
83
|
-
'libKey': 'allowTouchMove',
|
|
84
|
-
'callback': 'parseReverseBool'
|
|
85
|
-
}
|
|
86
|
-
];
|
|
87
|
-
|
|
88
|
-
breakpointKeyConfig.map(config => {
|
|
89
|
-
let defaultVal = this.slider.getAttribute(`data-hc-slider-${config.hcKey}`);
|
|
90
|
-
if (defaultVal !== null) {
|
|
91
|
-
if ( config.callback === 'parseReverseBool' ) {
|
|
92
|
-
defaultVal = defaultVal !== 'true';
|
|
93
|
-
}
|
|
94
|
-
if ( config.callback === 'parseBool' ) {
|
|
95
|
-
defaultVal = defaultVal === 'true';
|
|
96
|
-
}
|
|
97
|
-
if ( config.callback === 'parseFloat' ) {
|
|
98
|
-
defaultVal = parseFloat(defaultVal);
|
|
99
|
-
}
|
|
100
|
-
this.options[config.libKey] = defaultVal;
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
this.breakpoints.forEach(breakpoint => {
|
|
105
|
-
let breakpointOptionsConfig = {};
|
|
106
|
-
breakpointKeyConfig.map(config => {
|
|
107
|
-
let val = this.slider.getAttribute(`data-hc-slider-${config.hcKey}-${breakpoint.name}`);
|
|
108
|
-
if (val !== null) {
|
|
109
|
-
if (config.callback === 'parseReverseBool') {
|
|
110
|
-
val = val !== 'true';
|
|
111
|
-
}
|
|
112
|
-
if (config.callback === 'parseBool') {
|
|
113
|
-
val = val === 'true';
|
|
114
|
-
}
|
|
115
|
-
if (config.callback === 'parseFloat') {
|
|
116
|
-
val = parseFloat(val);
|
|
117
|
-
}
|
|
118
|
-
breakpointOptionsConfig[config.libKey] = val;
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
if ( Object.getOwnPropertyNames(breakpointOptionsConfig).length > 0 ) {
|
|
123
|
-
breakpointOptions[breakpoint.value] = breakpointOptionsConfig;
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
this.options.breakpoints = breakpointOptions;
|
|
128
|
-
|
|
129
|
-
const freeMode = this.slider.getAttribute('data-hc-slider-free-mode');
|
|
130
|
-
if (freeMode !== null) {
|
|
131
|
-
this.options['freeMode'] = {
|
|
132
|
-
enabled: true
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
if (this.slider.hasAttribute('data-hc-slider-pagination')) {
|
|
137
|
-
this.options['pagination'] = {
|
|
138
|
-
el: '.hc-slider-pagination',
|
|
139
|
-
type: 'bullets',
|
|
140
|
-
clickable: true,
|
|
141
|
-
dynamicBullets: false,
|
|
142
|
-
bulletClass: 'hc-slider-pagination-bullet',
|
|
143
|
-
clickableClass: 'hc-slider-pagination-clickable',
|
|
144
|
-
currentClass: 'hc-slider-pagination-current',
|
|
145
|
-
bulletActiveClass: 'hc-slider-pagination-bullet-active'
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
if (this.slider.hasAttribute('data-hc-slider-arrows')) {
|
|
149
|
-
const suffix = this.slider.getAttribute('data-hc-slider-arrows');
|
|
150
|
-
const wrapperElement = this.slider.hasAttribute('data-hc-slider-arrows-wrapper') ? '.hc-slider-buttons' : null;
|
|
151
|
-
const prevElement = this.slider.hasAttribute('data-hc-slider-arrow-prev') ? this.slider.getAttribute('data-hc-slider-arrow-prev') : `.hc-slider-button-prev${suffix}`;
|
|
152
|
-
const nextElement = this.slider.hasAttribute('data-hc-slider-arrow-next') ? this.slider.getAttribute('data-hc-slider-arrow-next') : `.hc-slider-button-next${suffix}`;
|
|
153
|
-
|
|
154
|
-
this.options['navigation'] = {
|
|
155
|
-
prevEl: prevElement,
|
|
156
|
-
nextEl: nextElement,
|
|
157
|
-
wrapperEl: wrapperElement,
|
|
158
|
-
disabledClass: `hc-slider-button-disabled${suffix}`,
|
|
159
|
-
hiddenClass: `hc-slider-button-hidden${suffix}`
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
if (this.slider.hasAttribute('data-hc-slider-fade-effect')) {
|
|
164
|
-
this.options['effect'] = 'fade';
|
|
165
|
-
this.options['fadeEffect'] = {
|
|
166
|
-
crossFade: true
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
if (this.slider.hasAttribute('data-hc-slider-infinite')) {
|
|
171
|
-
this.options['loop'] = true;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
if (this.slider.hasAttribute('data-hc-slider-disable-mousewheel')) {
|
|
175
|
-
this.options['mousewheel'] = false;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
this.options['watchOverflow'] = true;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
buildDom() {
|
|
182
|
-
// Si le DOM n'est pas créé correctement, on le fait
|
|
183
|
-
if (this.slider.querySelectorAll('.swiper-wrapper').length === 0) {
|
|
184
|
-
// On recupère les slide items (element de DOM enfant de premier niveau)
|
|
185
|
-
// et on leur ajoute la classe des slide item
|
|
186
|
-
const items = [].slice.call(this.slider.children);
|
|
187
|
-
items.forEach(item => {
|
|
188
|
-
item.classList.add('swiper-slide');
|
|
189
|
-
item.setAttribute('aria-roledescription', 'slide');
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
// On ajoute la classe swiper a notre slider,
|
|
193
|
-
// on crée la div wrapper et on insére les slider item dedans
|
|
194
|
-
const wrapperElement = document.createElement("div");
|
|
195
|
-
wrapperElement.classList.add("swiper-wrapper");
|
|
196
|
-
items.forEach(item => {
|
|
197
|
-
wrapperElement.appendChild(item);
|
|
198
|
-
});
|
|
199
|
-
this.slider.appendChild(wrapperElement);
|
|
200
|
-
|
|
201
|
-
// On ajout les différentes div utile en fonction des options passées
|
|
202
|
-
// et si les elements n'existent pas déjà
|
|
203
|
-
if (this.options.pagination !== false) {
|
|
204
|
-
|
|
205
|
-
const el = this.slider.querySelectorAll(this.options.pagination.el);
|
|
206
|
-
if (el.length === 0) {
|
|
207
|
-
const paginationElement = document.createElement("div");
|
|
208
|
-
paginationElement.classList.add(this.options.pagination.el.substr(1));
|
|
209
|
-
this.slider.appendChild(paginationElement);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
if (this.options.navigation !== false) {
|
|
213
|
-
|
|
214
|
-
const prevEl = this.slider.querySelectorAll(this.options.navigation.prevEl);
|
|
215
|
-
const nextEl = this.slider.querySelectorAll(this.options.navigation.nextEl);
|
|
216
|
-
|
|
217
|
-
if (this.slider.hasAttribute('data-hc-slider-arrows-wrapper') && prevEl.length === 0 && nextEl.length === 0) {
|
|
218
|
-
const buttonsWrapper = document.createElement("div");
|
|
219
|
-
const buttonPrev = document.createElement("div");
|
|
220
|
-
const buttonNext = document.createElement("div");
|
|
221
|
-
|
|
222
|
-
buttonPrev.classList.add(this.options.navigation.prevEl.substr(1));
|
|
223
|
-
buttonNext.classList.add(this.options.navigation.nextEl.substr(1));
|
|
224
|
-
buttonsWrapper.classList.add(this.options.navigation.wrapperEl.substr(1));
|
|
225
|
-
|
|
226
|
-
buttonsWrapper.appendChild(buttonPrev);
|
|
227
|
-
buttonsWrapper.appendChild(buttonNext);
|
|
228
|
-
|
|
229
|
-
this.slider.prepend(buttonsWrapper);
|
|
230
|
-
} else {
|
|
231
|
-
if (!this.slider.hasAttribute('data-hc-slider-arrow-prev') && prevEl.length === 0) {
|
|
232
|
-
const buttonPrev = document.createElement("div");
|
|
233
|
-
buttonPrev.classList.add(this.options.navigation.prevEl.substr(1));
|
|
234
|
-
this.slider.appendChild(buttonPrev);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
if (!this.slider.hasAttribute('data-hc-slider-arrow-next') && nextEl.length === 0) {
|
|
238
|
-
const buttonNext = document.createElement("div");
|
|
239
|
-
buttonNext.classList.add(this.options.navigation.nextEl.substr(1));
|
|
240
|
-
this.slider.appendChild(buttonNext);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
initOptions() {
|
|
248
|
-
this.options = {
|
|
249
|
-
slidesPerView: "auto",
|
|
250
|
-
pagination: false,
|
|
251
|
-
navigation: false,
|
|
252
|
-
mousewheel: {
|
|
253
|
-
forceToAxis: true,
|
|
254
|
-
},
|
|
255
|
-
grabCursor: true,
|
|
256
|
-
loop: false,
|
|
257
|
-
watchSlidesProgress: true,
|
|
258
|
-
a11y: {
|
|
259
|
-
prevSlideMessage: IRISCollectionTheme.translate.slider.prevSlideMessage ?? 'Slide précédente',
|
|
260
|
-
nextSlideMessage: IRISCollectionTheme.translate.slider.nextSlideMessage ?? 'Slide suivante',
|
|
261
|
-
firstSlideMessage: IRISCollectionTheme.translate.slider.firstSlideMessage ?? 'Vous êtes sur la première slide',
|
|
262
|
-
lastSlideMessage: IRISCollectionTheme.translate.slider.lastSlideMessage ?? 'Vous avez atteint la dernière slide',
|
|
263
|
-
paginationBulletMessage: IRISCollectionTheme.translate.slider.paginationBulletMessage ?? 'Aller sur la slide {{index}}',
|
|
264
|
-
slideLabelMessage: IRISCollectionTheme.translate.slider.slideLabelMessage ?? 'Slide {{index}} sur {{slidesLength}}',
|
|
265
|
-
},
|
|
266
|
-
on: {
|
|
267
|
-
init: (swiper) => {
|
|
268
|
-
|
|
269
|
-
// layout
|
|
270
|
-
$(swiper.el).find('.swiper-wrapper').addClass('hc-slider-wrapper');
|
|
271
|
-
$(swiper.el).addClass('hc-slider-initialized');
|
|
272
|
-
|
|
273
|
-
// slide item
|
|
274
|
-
$(swiper.el).find('.swiper-slide').addClass('hc-slider-slide');
|
|
275
|
-
$(swiper.el).find('.swiper-slide-active').addClass('hc-slider-slide-active');
|
|
276
|
-
$(swiper.el).find('.swiper-slide-next').addClass('hc-slider-slide-next');
|
|
277
|
-
$(swiper.el).find('.swiper-slide-prev').addClass('hc-slider-slide-prev');
|
|
278
|
-
|
|
279
|
-
if (swiper.isLocked) {
|
|
280
|
-
$(swiper.el).addClass('hc-slider-lock');
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
this.slider.dispatchEvent(this.initEvent);
|
|
284
|
-
},
|
|
285
|
-
afterInit: (swiper) => {
|
|
286
|
-
|
|
287
|
-
//Remove tabindex
|
|
288
|
-
if (this.slider.hasAttribute('data-hc-slider-disable-arrows-focus')) {
|
|
289
|
-
$(swiper.el).find('.hc-slider-buttons > *').removeAttr('tabindex');
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
if (this.slider.hasAttribute('data-hc-slider-disable-pagination-focus')) {
|
|
293
|
-
$(swiper.el).find('.hc-slider-pagination > *').removeAttr('tabindex');
|
|
294
|
-
}
|
|
295
|
-
},
|
|
296
|
-
slideChangeTransitionEnd: (swiper) => {
|
|
297
|
-
|
|
298
|
-
// slide item
|
|
299
|
-
$(swiper.el).find('.swiper-slide')
|
|
300
|
-
.removeClass('hc-slider-slide-active')
|
|
301
|
-
.removeClass('hc-slider-slide-next')
|
|
302
|
-
.removeClass('hc-slider-slide-prev');
|
|
303
|
-
$(swiper.el).find('.swiper-slide-active').addClass('hc-slider-slide-active');
|
|
304
|
-
$(swiper.el).find('.swiper-slide-next').addClass('hc-slider-slide-next');
|
|
305
|
-
$(swiper.el).find('.swiper-slide-prev').addClass('hc-slider-slide-prev');
|
|
306
|
-
|
|
307
|
-
//Remove tabindex
|
|
308
|
-
if (this.slider.hasAttribute('data-hc-slider-disable-arrows-focus')) {
|
|
309
|
-
$(swiper.el).find('.hc-slider-buttons > *').removeAttr('tabindex');
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
if (this.slider.hasAttribute('data-hc-slider-disable-pagination-focus')) {
|
|
313
|
-
$(swiper.el).find('.hc-slider-pagination > *').removeAttr('tabindex');
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
},
|
|
317
|
-
breakpoints: {}
|
|
318
|
-
};
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
const hc_slider = function (trigger) {
|
|
323
|
-
return new HcSlider(trigger);
|
|
324
|
-
}
|
|
325
|
-
export default hc_slider;
|
|
14
|
+
*/import e from"../../enumerators/element.enum";import i from"../../libraries/swiper-11";export class HcSlider{slider;instances=[];breakpoints=[{name:"medium",value:651},{name:"large",value:1001},{name:"xlarge",value:1454}];options={};initEvent;constructor(s=e.slider){for(let e of s)this.initEvent=new Event("init.hc.slider"),this.initOptions(),this.slider=e,this.setOptions(),this.buildDom(),i.create(e,this.options).then(e=>{this.instances.push(e)})}setOptions(){let e=this.slider.getAttribute("data-hc-slider-autoplay");null!==e&&(this.options.autoplay={delay:e});let i={},s=[{hcKey:"gap",libKey:"spaceBetween",callback:"parseFloat"},{hcKey:"slides-per-view",libKey:"slidesPerView",callback:"parseFloat"},{hcKey:"no-swipe",libKey:"allowTouchMove",callback:"parseReverseBool"}];for(let e of(s.map(e=>{let i=this.slider.getAttribute(`data-hc-slider-${e.hcKey}`);null!==i&&("parseReverseBool"===e.callback&&(i="true"!==i),"parseBool"===e.callback&&(i="true"===i),"parseFloat"===e.callback&&(i=Number.parseFloat(i)),this.options[e.libKey]=i)}),this.breakpoints)){let t={};s.map(i=>{let s=this.slider.getAttribute(`data-hc-slider-${i.hcKey}-${e.name}`);null!==s&&("parseReverseBool"===i.callback&&(s="true"!==s),"parseBool"===i.callback&&(s="true"===s),"parseFloat"===i.callback&&(s=Number.parseFloat(s)),t[i.libKey]=s)}),Object.getOwnPropertyNames(t).length>0&&(i[e.value]=t)}if(this.options.breakpoints=i,null!==this.slider.getAttribute("data-hc-slider-free-mode")&&(this.options.freeMode={enabled:!0}),this.slider.hasAttribute("data-hc-slider-pagination")&&(this.options.pagination={el:".hc-slider-pagination",type:"bullets",clickable:!0,dynamicBullets:!1,bulletClass:"hc-slider-pagination-bullet",clickableClass:"hc-slider-pagination-clickable",currentClass:"hc-slider-pagination-current",bulletActiveClass:"hc-slider-pagination-bullet-active"}),this.slider.hasAttribute("data-hc-slider-arrows")){let e=this.slider.getAttribute("data-hc-slider-arrows"),i=this.slider.hasAttribute("data-hc-slider-arrows-wrapper")?".hc-slider-buttons":null,s=this.slider.hasAttribute("data-hc-slider-arrow-prev")?this.slider.getAttribute("data-hc-slider-arrow-prev"):`.hc-slider-button-prev${e}`,t=this.slider.hasAttribute("data-hc-slider-arrow-next")?this.slider.getAttribute("data-hc-slider-arrow-next"):`.hc-slider-button-next${e}`;this.options.navigation={prevEl:s,nextEl:t,wrapperEl:i,disabledClass:`hc-slider-button-disabled${e}`,hiddenClass:`hc-slider-button-hidden${e}`}}this.slider.hasAttribute("data-hc-slider-fade-effect")&&(this.options.effect="fade",this.options.fadeEffect={crossFade:!0}),this.slider.hasAttribute("data-hc-slider-infinite")&&(this.options.loop=!0),this.slider.hasAttribute("data-hc-slider-disable-mousewheel")&&(this.options.mousewheel=!1),this.options.watchOverflow=!0}buildDom(){if(0===this.slider.querySelectorAll(".swiper-wrapper").length){let e=[].slice.call(this.slider.children);for(let i of e)i.classList.add("swiper-slide"),i.setAttribute("aria-roledescription","slide");let i=document.createElement("div");for(let s of(i.classList.add("swiper-wrapper"),e))i.appendChild(s);if(this.slider.appendChild(i),!1!==this.options.pagination&&0===this.slider.querySelectorAll(this.options.pagination.el).length){let e=document.createElement("div");e.classList.add(this.options.pagination.el.substr(1)),this.slider.appendChild(e)}if(!1!==this.options.navigation){let e=this.slider.querySelectorAll(this.options.navigation.prevEl),i=this.slider.querySelectorAll(this.options.navigation.nextEl);if(this.slider.hasAttribute("data-hc-slider-arrows-wrapper")&&0===e.length&&0===i.length){let e=document.createElement("div"),i=document.createElement("div"),s=document.createElement("div");i.classList.add(this.options.navigation.prevEl.substr(1)),s.classList.add(this.options.navigation.nextEl.substr(1)),e.classList.add(this.options.navigation.wrapperEl.substr(1)),e.appendChild(i),e.appendChild(s),this.slider.prepend(e)}else{if(!this.slider.hasAttribute("data-hc-slider-arrow-prev")&&0===e.length){let e=document.createElement("div");e.classList.add(this.options.navigation.prevEl.substr(1)),this.slider.appendChild(e)}if(!this.slider.hasAttribute("data-hc-slider-arrow-next")&&0===i.length){let e=document.createElement("div");e.classList.add(this.options.navigation.nextEl.substr(1)),this.slider.appendChild(e)}}}}}initOptions(){this.options={slidesPerView:"auto",pagination:!1,navigation:!1,mousewheel:{forceToAxis:!0},grabCursor:!0,loop:!1,watchSlidesProgress:!0,a11y:{prevSlideMessage:IRISCollectionTheme.translate.slider.prevSlideMessage??"Slide pr\xe9c\xe9dente",nextSlideMessage:IRISCollectionTheme.translate.slider.nextSlideMessage??"Slide suivante",firstSlideMessage:IRISCollectionTheme.translate.slider.firstSlideMessage??"Vous \xeates sur la premi\xe8re slide",lastSlideMessage:IRISCollectionTheme.translate.slider.lastSlideMessage??"Vous avez atteint la derni\xe8re slide",paginationBulletMessage:IRISCollectionTheme.translate.slider.paginationBulletMessage??"Aller sur la slide {{index}}",slideLabelMessage:IRISCollectionTheme.translate.slider.slideLabelMessage??"Slide {{index}} sur {{slidesLength}}"},on:{init:e=>{$(e.el).find(".swiper-wrapper").addClass("hc-slider-wrapper"),$(e.el).addClass("hc-slider-initialized"),$(e.el).find(".swiper-slide").addClass("hc-slider-slide"),$(e.el).find(".swiper-slide-active").addClass("hc-slider-slide-active"),$(e.el).find(".swiper-slide-next").addClass("hc-slider-slide-next"),$(e.el).find(".swiper-slide-prev").addClass("hc-slider-slide-prev"),e.isLocked&&$(e.el).addClass("hc-slider-lock"),this.slider.dispatchEvent(this.initEvent)},afterInit:e=>{this.slider.hasAttribute("data-hc-slider-disable-arrows-focus")&&$(e.el).find(".hc-slider-buttons > *").removeAttr("tabindex"),this.slider.hasAttribute("data-hc-slider-disable-pagination-focus")&&$(e.el).find(".hc-slider-pagination > *").removeAttr("tabindex")},slideChangeTransitionEnd:e=>{$(e.el).find(".swiper-slide").removeClass("hc-slider-slide-active").removeClass("hc-slider-slide-next").removeClass("hc-slider-slide-prev"),$(e.el).find(".swiper-slide-active").addClass("hc-slider-slide-active"),$(e.el).find(".swiper-slide-next").addClass("hc-slider-slide-next"),$(e.el).find(".swiper-slide-prev").addClass("hc-slider-slide-prev"),this.slider.hasAttribute("data-hc-slider-disable-arrows-focus")&&$(e.el).find(".hc-slider-buttons > *").removeAttr("tabindex"),this.slider.hasAttribute("data-hc-slider-disable-pagination-focus")&&$(e.el).find(".hc-slider-pagination > *").removeAttr("tabindex")}},breakpoints:{}}}}let hc_slider=e=>new HcSlider(e);export default hc_slider;
|
|
@@ -12,48 +12,4 @@
|
|
|
12
12
|
* @date 28/01/2022 14:27
|
|
13
13
|
* @copyright Copyright (c) 2002-2022 IRIS Interactive, Inc. (http://www.iris-interactive.fr)
|
|
14
14
|
* @deprecated 5.0.17
|
|
15
|
-
*/
|
|
16
|
-
import ElementEnum from "../../enumerators/element.enum";
|
|
17
|
-
import SmoothScrollEnum from "../../enumerators/smooth-scroll.enum";
|
|
18
|
-
|
|
19
|
-
export class HcSmoothScroll {
|
|
20
|
-
constructor(triggerAttribute = ElementEnum.scrollSmooth, durationAnimation = 1000) {
|
|
21
|
-
document.querySelectorAll(triggerAttribute).forEach(trigger => {
|
|
22
|
-
trigger.addEventListener('click', (e) => {
|
|
23
|
-
e.preventDefault();
|
|
24
|
-
const target = (e.currentTarget.getAttribute('href') != null) ? document.querySelector(e.currentTarget.getAttribute('href')) : document.querySelector(e.currentTarget.dataset.hcSmoothScrollHref);
|
|
25
|
-
const shift = (e.currentTarget.getAttribute(SmoothScrollEnum.attrShift) !== null) ? e.currentTarget.getAttribute(SmoothScrollEnum.attrShift) : 0;
|
|
26
|
-
const anim = requestAnimationFrame((timestamp) => {
|
|
27
|
-
const stamp = timestamp || new Date().getTime();
|
|
28
|
-
const start = stamp;
|
|
29
|
-
const startScrollOffset = window.pageYOffset;
|
|
30
|
-
const scrollEndElemTop = target.getBoundingClientRect().top - shift;
|
|
31
|
-
this.scrollToElem(start, stamp, durationAnimation, scrollEndElemTop, startScrollOffset);
|
|
32
|
-
})
|
|
33
|
-
});
|
|
34
|
-
})
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
easeInCubic(t) {
|
|
38
|
-
return t * t * t
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
scrollToElem(startTime, currentTime, duration, scrollEndElemTop, startScrollOffset) {
|
|
42
|
-
const runtime = currentTime - startTime;
|
|
43
|
-
let progress = runtime / duration;
|
|
44
|
-
progress = Math.min(progress, 1);
|
|
45
|
-
const ease = this.easeInCubic(progress);
|
|
46
|
-
window.scroll(0, startScrollOffset + (scrollEndElemTop * ease));
|
|
47
|
-
if (runtime < duration) {
|
|
48
|
-
requestAnimationFrame((timestamp) => {
|
|
49
|
-
const currentTime = timestamp || new Date().getTime();
|
|
50
|
-
this.scrollToElem(startTime, currentTime, duration, scrollEndElemTop, startScrollOffset);
|
|
51
|
-
})
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const hc_smooth_scroll = function (trigger, durationAnimation) {
|
|
57
|
-
new HcSmoothScroll(trigger, durationAnimation);
|
|
58
|
-
}
|
|
59
|
-
export default hc_smooth_scroll;
|
|
15
|
+
*/import e from"../../enumerators/element.enum";import t from"../../enumerators/smooth-scroll.enum";export class HcSmoothScroll{constructor(r=e.scrollSmooth,o=1e3){for(let e of document.querySelectorAll(r))e.addEventListener("click",e=>{e.preventDefault();let r=null!=e.currentTarget.getAttribute("href")?document.querySelector(e.currentTarget.getAttribute("href")):document.querySelector(e.currentTarget.dataset.hcSmoothScrollHref),l=null!==e.currentTarget.getAttribute(t.attrShift)?e.currentTarget.getAttribute(t.attrShift):0;requestAnimationFrame(e=>{let t=e||new Date().getTime(),c=window.pageYOffset,n=r.getBoundingClientRect().top-l;this.scrollToElem(t,t,o,n,c)})})}easeInCubic(e){return e*e*e}scrollToElem(e,t,r,o,l){let c=t-e,n=c/r;n=Math.min(n,1);let u=this.easeInCubic(n);window.scroll(0,l+o*u),c<r&&requestAnimationFrame(t=>{let c=t||new Date().getTime();this.scrollToElem(e,c,r,o,l)})}}let hc_smooth_scroll=(e,t)=>{new HcSmoothScroll(e,t)};export default hc_smooth_scroll;
|
|
@@ -11,72 +11,4 @@
|
|
|
11
11
|
* @author Lucas ROCHE
|
|
12
12
|
* @date 22/02/2022 14:34
|
|
13
13
|
* @copyright Copyright (c) 2002-2022 IRIS Interactive, Inc. (http://www.iris-interactive.fr)
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
import ElementEnum from "../../enumerators/element.enum";
|
|
17
|
-
import "./tab.component.scss";
|
|
18
|
-
import Tab from "bootstrap/js/src/tab";
|
|
19
|
-
|
|
20
|
-
export class HcTab {
|
|
21
|
-
|
|
22
|
-
showEvent;
|
|
23
|
-
shownEvent;
|
|
24
|
-
hideEvent;
|
|
25
|
-
hiddenEvent;
|
|
26
|
-
|
|
27
|
-
constructor(elements = ElementEnum.tab) {
|
|
28
|
-
this.createEvent();
|
|
29
|
-
this.buildDOM();
|
|
30
|
-
const triggerTabList = [].slice.call(document.querySelectorAll(elements))
|
|
31
|
-
triggerTabList.forEach(function (triggerEl) {
|
|
32
|
-
const tabTrigger = new Tab(triggerEl);
|
|
33
|
-
|
|
34
|
-
triggerEl.addEventListener('click', function (event) {
|
|
35
|
-
event.preventDefault()
|
|
36
|
-
tabTrigger.show()
|
|
37
|
-
})
|
|
38
|
-
});
|
|
39
|
-
document.querySelectorAll(elements).forEach(trigger => {
|
|
40
|
-
trigger.addEventListener('hide.bs.tab', (e) => {
|
|
41
|
-
trigger.dispatchEvent(this.hideEvent);
|
|
42
|
-
});
|
|
43
|
-
trigger.addEventListener('show.bs.tab', (e) => {
|
|
44
|
-
trigger.dispatchEvent(this.showEvent);
|
|
45
|
-
});
|
|
46
|
-
trigger.addEventListener('shown.bs.tab', (e) => {
|
|
47
|
-
trigger.dispatchEvent(this.shownEvent);
|
|
48
|
-
});
|
|
49
|
-
trigger.addEventListener('hidden.bs.tab', (e) => {
|
|
50
|
-
trigger.dispatchEvent(this.hiddenEvent);
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
buildDOM() {
|
|
56
|
-
document.querySelectorAll("[data-hc-tab-wrapper]").forEach(wrapper => {
|
|
57
|
-
if (!wrapper.classList.contains("nav")) {
|
|
58
|
-
wrapper.classList.add("nav")
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
createEvent() {
|
|
64
|
-
this.showEvent = new Event("show.hc.tab");
|
|
65
|
-
this.shownEvent = new Event("shown.hc.tab");
|
|
66
|
-
this.hideEvent = new Event("hide.hc.tab");
|
|
67
|
-
this.hiddenEvent = new Event("hidden.hc.tab");
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
static show(trigger) {
|
|
71
|
-
var triggerTabList = [].slice.call(document.querySelectorAll(trigger));
|
|
72
|
-
triggerTabList.forEach(function (triggerEl) {
|
|
73
|
-
var tabTrigger = new Tab(triggerEl)
|
|
74
|
-
tabTrigger.show();
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const hc_tab = function (trigger) {
|
|
80
|
-
return new HcTab(trigger);
|
|
81
|
-
}
|
|
82
|
-
export default hc_tab;
|
|
14
|
+
*/import t from"../../enumerators/element.enum";import"./tab.component.scss";import e from"bootstrap/js/src/tab";export class HcTab{showEvent;shownEvent;hideEvent;hiddenEvent;constructor(n=t.tab){for(let t of(this.createEvent(),this.buildDOM(),[].slice.call(document.querySelectorAll(n)))){let n=new e(t);t.addEventListener("click",t=>{t.preventDefault(),n.show()})}for(let t of document.querySelectorAll(n))t.addEventListener("hide.bs.tab",e=>{t.dispatchEvent(this.hideEvent)}),t.addEventListener("show.bs.tab",e=>{t.dispatchEvent(this.showEvent)}),t.addEventListener("shown.bs.tab",e=>{t.dispatchEvent(this.shownEvent)}),t.addEventListener("hidden.bs.tab",e=>{t.dispatchEvent(this.hiddenEvent)})}buildDOM(){for(let t of document.querySelectorAll("[data-hc-tab-wrapper]"))t.classList.contains("nav")||t.classList.add("nav")}createEvent(){this.showEvent=new Event("show.hc.tab"),this.shownEvent=new Event("shown.hc.tab"),this.hideEvent=new Event("hide.hc.tab"),this.hiddenEvent=new Event("hidden.hc.tab")}static show(t){for(let n of[].slice.call(document.querySelectorAll(t)))new e(n).show()}}let hc_tab=t=>new HcTab(t);export default hc_tab;
|
|
@@ -11,41 +11,4 @@
|
|
|
11
11
|
* @author Lucas ROCHE
|
|
12
12
|
* @date 22/02/2022 16:50
|
|
13
13
|
* @copyright Copyright (c) 2002-2022 IRIS Interactive, Inc. (http://www.iris-interactive.fr)
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import ElementEnum from "../../enumerators/element.enum";
|
|
18
|
-
|
|
19
|
-
export class HcToggle {
|
|
20
|
-
|
|
21
|
-
constructor(elements = ElementEnum.toggle) {
|
|
22
|
-
document.querySelectorAll(elements).forEach(element => {
|
|
23
|
-
element.addEventListener('click', (e) => {
|
|
24
|
-
e.preventDefault();
|
|
25
|
-
const attribute = e.currentTarget.dataset.hcToggleAttribute;
|
|
26
|
-
const value = e.currentTarget.dataset.hcToggleValue;
|
|
27
|
-
const targets = e.currentTarget.getAttribute("href") ? e.currentTarget.getAttribute("href") : e.currentTarget.dataset.hcToggleTarget;
|
|
28
|
-
document.querySelectorAll(targets).forEach(target => {
|
|
29
|
-
if (target.getAttribute(attribute) !== null && target.getAttribute(attribute).indexOf(value) !== -1) {
|
|
30
|
-
if (attribute === "class") {
|
|
31
|
-
target.classList.remove(value);
|
|
32
|
-
} else {
|
|
33
|
-
target.removeAttribute(attribute);
|
|
34
|
-
}
|
|
35
|
-
} else {
|
|
36
|
-
if (attribute === "class") {
|
|
37
|
-
target.classList.add(value);
|
|
38
|
-
} else {
|
|
39
|
-
target.setAttribute(attribute, value);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const hc_toggle = function (trigger) {
|
|
49
|
-
return new HcToggle(trigger);
|
|
50
|
-
}
|
|
51
|
-
export default hc_toggle;
|
|
14
|
+
*/import e from"../../enumerators/element.enum";export class HcToggle{constructor(t=e.toggle){for(let e of t)e.addEventListener("click",e=>{e.preventDefault();let t=e.currentTarget.dataset.hcToggleAttribute,r=e.currentTarget.dataset.hcToggleValue,l=e.currentTarget.getAttribute("href")?e.currentTarget.getAttribute("href"):e.currentTarget.dataset.hcToggleTarget;for(let e of document.querySelectorAll(l))null!==e.getAttribute(t)&&-1!==e.getAttribute(t).indexOf(r)?"class"===t?e.classList.remove(r):e.removeAttribute(t):"class"===t?e.classList.add(r):e.setAttribute(t,r)})}}let hc_toggle=e=>new HcToggle(e);export default hc_toggle;
|
|
@@ -11,109 +11,4 @@
|
|
|
11
11
|
* @author Lucas ROCHE
|
|
12
12
|
* @date 28/01/2022 14:52
|
|
13
13
|
* @copyright Copyright (c) 2002-2022 IRIS Interactive, Inc. (http://www.iris-interactive.fr)
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import tippy from "tippy.js";
|
|
18
|
-
import "tippy.js/dist/tippy.css"
|
|
19
|
-
import ElementEnum from "../../enumerators/element.enum";
|
|
20
|
-
import TooltipEnum from "../../enumerators/tooltip.enum";
|
|
21
|
-
|
|
22
|
-
export class HcTooltip {
|
|
23
|
-
|
|
24
|
-
showEvent;
|
|
25
|
-
shownEvent;
|
|
26
|
-
hideEvent;
|
|
27
|
-
hiddenEvent;
|
|
28
|
-
|
|
29
|
-
instances = [];
|
|
30
|
-
defaultOptions = {
|
|
31
|
-
placement: '',
|
|
32
|
-
content: '',
|
|
33
|
-
trigger: '',
|
|
34
|
-
interactive: false,
|
|
35
|
-
allowHTML: true
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
constructor(elements = ElementEnum.tooltip, overrideOptions = {}) {
|
|
39
|
-
this.createEvent();
|
|
40
|
-
document.querySelectorAll(elements).forEach(element => {
|
|
41
|
-
let options = {};
|
|
42
|
-
Object.assign(options, this.defaultOptions, overrideOptions);
|
|
43
|
-
options.trigger = options.trigger != '' ? options.trigger : (element.hasAttribute(TooltipEnum.attrPopover) ? "click focus" : "mouseenter focus");
|
|
44
|
-
options.content = options.content != '' ? options.content : (element.hasAttribute(TooltipEnum.attrContent) ? element.getAttribute(TooltipEnum.attrContent) : '');
|
|
45
|
-
options.placement = options.placement != '' ? options.placement : (element.hasAttribute(TooltipEnum.attrPlacement) ? element.getAttribute(TooltipEnum.attrPlacement) : 'bottom');
|
|
46
|
-
options.interactive = options.interactive != '' ? options.interactive : (element.hasAttribute(TooltipEnum.attrInteractive) ? element.getAttribute(TooltipEnum.attrInteractive) : false);
|
|
47
|
-
let backgroundColor = element.hasAttribute(TooltipEnum.attrBackgroundColor) ? element.getAttribute(TooltipEnum.attrBackgroundColor) : '';
|
|
48
|
-
let color = element.hasAttribute(TooltipEnum.attrColor) ? element.getAttribute(TooltipEnum.attrColor) : '';
|
|
49
|
-
let fontSize = element.hasAttribute(TooltipEnum.attrFontSize) ? element.getAttribute(TooltipEnum.attrFontSize) : '';
|
|
50
|
-
if (options.trigger.indexOf('click') !== -1) {
|
|
51
|
-
element.addEventListener('click', (e) => {
|
|
52
|
-
e.preventDefault();
|
|
53
|
-
});
|
|
54
|
-
} else {
|
|
55
|
-
options.touch = false;
|
|
56
|
-
}
|
|
57
|
-
options.onShow = (instance) => {
|
|
58
|
-
if (backgroundColor) {
|
|
59
|
-
instance.popper.querySelector('.tippy-box').style.setProperty('--iris--tooltip--background-color', backgroundColor);
|
|
60
|
-
}
|
|
61
|
-
if (color) {
|
|
62
|
-
instance.popper.querySelector('.tippy-box').style.setProperty('--iris--tooltip--color', color);
|
|
63
|
-
}
|
|
64
|
-
if (fontSize) {
|
|
65
|
-
instance.popper.querySelector('.tippy-box').style.setProperty('--iris--tooltip--font-size', fontSize);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
instance.reference.dispatchEvent(this.showEvent);
|
|
69
|
-
}
|
|
70
|
-
options.onShown = (instance) => {
|
|
71
|
-
instance.reference.dispatchEvent(this.shownEvent);
|
|
72
|
-
}
|
|
73
|
-
options.onHide = (instance) => {
|
|
74
|
-
instance.reference.dispatchEvent(this.hideEvent);
|
|
75
|
-
}
|
|
76
|
-
options.onHidden = (instance) => {
|
|
77
|
-
instance.reference.dispatchEvent(this.hiddenEvent);
|
|
78
|
-
}
|
|
79
|
-
const instance = tippy(element, options);
|
|
80
|
-
this.instances.push(instance);
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
createEvent() {
|
|
85
|
-
this.showEvent = new Event('show.hc.tooltip');
|
|
86
|
-
this.shownEvent = new Event('shown.hc.tooltip');
|
|
87
|
-
this.hideEvent = new Event('hide.hc.tooltip');
|
|
88
|
-
this.hiddenEvent = new Event('hidden.hc.tooltip');
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
show() {
|
|
92
|
-
this.instances.forEach(instance => {
|
|
93
|
-
instance.show();
|
|
94
|
-
})
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
hide() {
|
|
98
|
-
this.instances.forEach(instance => {
|
|
99
|
-
instance.hide();
|
|
100
|
-
})
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
disable() {
|
|
104
|
-
this.instances.forEach(instance => {
|
|
105
|
-
instance.disable();
|
|
106
|
-
})
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
enable() {
|
|
110
|
-
this.instances.forEach(instance => {
|
|
111
|
-
instance.enable();
|
|
112
|
-
})
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const hc_tooltip = function (trigger, options) {
|
|
117
|
-
return new HcTooltip(trigger, options);
|
|
118
|
-
}
|
|
119
|
-
export default hc_tooltip;
|
|
14
|
+
*/import t from"tippy.js";import"tippy.js/dist/tippy.css";import e from"../../enumerators/element.enum";import o from"../../enumerators/tooltip.enum";export class HcTooltip{showEvent;shownEvent;hideEvent;hiddenEvent;instances=[];defaultOptions={placement:"",content:"",trigger:"",interactive:!1,allowHTML:!0};constructor(i=e.tooltip,r={}){for(let e of(this.createEvent(),document.querySelectorAll(i))){let i={};Object.assign(i,this.defaultOptions,r),i.trigger=""!==i.trigger?i.trigger:e.hasAttribute(o.attrPopover)?"click focus":"mouseenter focus",i.content=""!==i.content?i.content:e.hasAttribute(o.attrContent)?e.getAttribute(o.attrContent):"",i.placement=""!==i.placement?i.placement:e.hasAttribute(o.attrPlacement)?e.getAttribute(o.attrPlacement):"bottom",i.interactive=""!==i.interactive?i.interactive:!!e.hasAttribute(o.attrInteractive)&&e.getAttribute(o.attrInteractive);let n=e.hasAttribute(o.attrBackgroundColor)?e.getAttribute(o.attrBackgroundColor):"",s=e.hasAttribute(o.attrColor)?e.getAttribute(o.attrColor):"",c=e.hasAttribute(o.attrFontSize)?e.getAttribute(o.attrFontSize):"";-1!==i.trigger.indexOf("click")?e.addEventListener("click",t=>{t.preventDefault()}):i.touch=!1,i.onShow=t=>{n&&t.popper.querySelector(".tippy-box").style.setProperty("--iris--tooltip--background-color",n),s&&t.popper.querySelector(".tippy-box").style.setProperty("--iris--tooltip--color",s),c&&t.popper.querySelector(".tippy-box").style.setProperty("--iris--tooltip--font-size",c),t.reference.dispatchEvent(this.showEvent)},i.onShown=t=>{t.reference.dispatchEvent(this.shownEvent)},i.onHide=t=>{t.reference.dispatchEvent(this.hideEvent)},i.onHidden=t=>{t.reference.dispatchEvent(this.hiddenEvent)};let a=t(e,i);this.instances.push(a)}}createEvent(){this.showEvent=new Event("show.hc.tooltip"),this.shownEvent=new Event("shown.hc.tooltip"),this.hideEvent=new Event("hide.hc.tooltip"),this.hiddenEvent=new Event("hidden.hc.tooltip")}show(){for(let t of this.instances)t.show()}hide(){for(let t of this.instances)t.hide()}disable(){for(let t of this.instances)t.disable()}enable(){for(let t of this.instances)t.enable()}}let hc_tooltip=(t,e)=>new HcTooltip(t,e);export default hc_tooltip;
|
|
@@ -11,30 +11,4 @@
|
|
|
11
11
|
* @author Lucas ROCHE
|
|
12
12
|
* @date 01/02/2022 10:36
|
|
13
13
|
* @copyright Copyright (c) 2002-2022 IRIS Interactive, Inc. (http://www.iris-interactive.fr)
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
export default class ElementEnum {
|
|
17
|
-
static tooltip = '[data-hc-tooltip], [data-hc-popover]';
|
|
18
|
-
static popover = '[data-hc-popover]';
|
|
19
|
-
static scrollSmooth = '[data-hc-smooth-scroll]';
|
|
20
|
-
static modal = '[data-hc-modal]';
|
|
21
|
-
static modalClose = '[data-hc-modal-close]';
|
|
22
|
-
static lightboxAttr = 'data-hc-lightbox';
|
|
23
|
-
static lightbox = `[${ElementEnum.lightboxAttr}]`;
|
|
24
|
-
static dropdown = '[data-hc-dropdown]';
|
|
25
|
-
static collapse = '[data-hc-collapse]';
|
|
26
|
-
static collapseItem = '[data-hc-collapse-item]';
|
|
27
|
-
static popin = '[data-hc-popin]';
|
|
28
|
-
static tab = '[data-hc-tab]';
|
|
29
|
-
static toggle = '[data-hc-toggle]';
|
|
30
|
-
static slider = '[data-hc-slider]';
|
|
31
|
-
static scrollspy = '[data-hc-scrollspy]';
|
|
32
|
-
static scrollspyNav = '[data-hc-scrollspy-nav]';
|
|
33
|
-
static scrollspyNavItem = '[data-hc-scrollspy-nav-item]';
|
|
34
|
-
static scrollspyNavItemHref = '[data-hc-scrollspy-nav-item-href]';
|
|
35
|
-
static scrollReveal = '[data-hc-scroll-reveal]';
|
|
36
|
-
static scrollRevealDisable = '[data-hc-noscroll-reveal]';
|
|
37
|
-
static scrollRevealParent = '[data-hc-scroll-reveal-parent]';
|
|
38
|
-
static scrollRevealChildren = `${ElementEnum.scrollRevealParent} > *:not(${ElementEnum.scrollRevealDisable}):not(${ElementEnum.scrollRevealParent}):not(${ElementEnum.scrollReveal})`;
|
|
39
|
-
static overlay = '[data-hc-overlay]';
|
|
40
|
-
}
|
|
14
|
+
*/export default class a{static tooltip="[data-hc-tooltip], [data-hc-popover]";static popover="[data-hc-popover]";static scrollSmooth="[data-hc-smooth-scroll]";static modal="[data-hc-modal]";static modalClose="[data-hc-modal-close]";static lightboxAttr="data-hc-lightbox";static lightbox=`[${a.lightboxAttr}]`;static dropdown="[data-hc-dropdown]";static collapse="[data-hc-collapse]";static collapseItem="[data-hc-collapse-item]";static popin="[data-hc-popin]";static tab="[data-hc-tab]";static toggle="[data-hc-toggle]";static slider="[data-hc-slider]";static scrollspy="[data-hc-scrollspy]";static scrollspyNav="[data-hc-scrollspy-nav]";static scrollspyNavItem="[data-hc-scrollspy-nav-item]";static scrollspyNavItemHref="[data-hc-scrollspy-nav-item-href]";static scrollReveal="[data-hc-scroll-reveal]";static scrollRevealDisable="[data-hc-noscroll-reveal]";static scrollRevealParent="[data-hc-scroll-reveal-parent]";static scrollRevealChildren=`${a.scrollRevealParent} > *:not(${a.scrollRevealDisable}):not(${a.scrollRevealParent}):not(${a.scrollReveal})`;static overlay="[data-hc-overlay]"}
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
export default class
|
|
2
|
-
static shareDesktop = '[data-share="desktop"]';
|
|
3
|
-
static shareMobile = '[data-share="mobile"]';
|
|
4
|
-
static shareWhatsappService = '[data-share-service="whatsapp"]';
|
|
5
|
-
static shareMessengerService = '[data-share-service="messenger"]';
|
|
6
|
-
}
|
|
1
|
+
export default class e{static shareDesktop='[data-share="desktop"]';static shareMobile='[data-share="mobile"]';static shareWhatsappService='[data-share-service="whatsapp"]';static shareMessengerService='[data-share-service="messenger"]'}
|
|
@@ -11,9 +11,4 @@
|
|
|
11
11
|
* @author Lucas ROCHE
|
|
12
12
|
* @date 14/04/2022 11:28
|
|
13
13
|
* @copyright Copyright (c) 2002-2022 IRIS Interactive, Inc. (http://www.iris-interactive.fr)
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
export default class SmoothScrollEnum {
|
|
17
|
-
static attrHref = "data-hc-smooth-scroll-href";
|
|
18
|
-
static attrShift = "data-hc-smooth-scroll-shift";
|
|
19
|
-
}
|
|
14
|
+
*/export default class t{static attrHref="data-hc-smooth-scroll-href";static attrShift="data-hc-smooth-scroll-shift"}
|