@iris.interactive/handcook 8.0.0-alpha.2 → 8.0.0-alpha.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/package.json +1 -1
- package/public/index.js +17 -17
- package/public/scripts/components/dropdown/dropdown.component.js +1 -1
- package/public/scripts/components/modal/modal.component.js +1 -1
- package/public/scripts/components/overlay/overlay.component.js +1 -1
- package/public/scripts/components/popin/popin.component.js +1 -1
- package/public/scripts/components/slider/slider.component.js +1 -1
- package/public/scripts/components/toggle/toggle.component.js +1 -1
- package/public/styles/scss/mixins/_mixin-font.scss +2 -2
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
* @author Lucas ROCHE
|
|
12
12
|
* @date 21/02/2022 10:14
|
|
13
13
|
* @copyright Copyright (c) 2002-2022 IRIS Interactive, Inc. (http://www.iris-interactive.fr)
|
|
14
|
-
*/import e,{hideAll as n}from"tippy.js";import o from"../../enumerators/element.enum";import"tippy.js/dist/tippy.css";import"./dropdown.component.scss";export class HcDropdown{showEvent;shownEvent;hideEvent;hiddenEvent;constructor(n=o.dropdown){for(let o of(window.hc_dropdown=window.hc_dropdown||[],this.createEvent(),n)){let n=document.querySelector(o.dataset.hcDropdownMenu),t=e(o,{trigger:"click",allowHTML:!0,content:n.innerHTML,arrow:!1,placement:"bottom",theme:"dropdown",interactive:!0,onShow:e=>{e.reference.dispatchEvent(this.showEvent)},onShown:e=>{e.reference.dispatchEvent(this.shownEvent)},onHide:e=>{e.reference.dispatchEvent(this.hideEvent)},onHidden:e=>{e.reference.dispatchEvent(this.hiddenEvent)}});window.hc_dropdown.push(t)}}static hideAll(){if(void 0!==window.hc_dropdown)for(let e of window.hc_dropdown)e.hide()}createEvent(){this.showEvent=new Event("show.hc.dropdown"),this.shownEvent=new Event("shown.hc.dropdown"),this.hideEvent=new Event("hide.hc.dropdown"),this.hiddenEvent=new Event("hidden.hc.dropdown")}}let hc_dropdown=e=>new HcDropdown(e);export default hc_dropdown;
|
|
14
|
+
*/import e,{hideAll as n}from"tippy.js";import o from"../../enumerators/element.enum";import"tippy.js/dist/tippy.css";import"./dropdown.component.scss";export class HcDropdown{showEvent;shownEvent;hideEvent;hiddenEvent;constructor(n=o.dropdown){for(let o of(window.hc_dropdown=window.hc_dropdown||[],this.createEvent(),document.querySelectorAll(n))){let n=document.querySelector(o.dataset.hcDropdownMenu),t=e(o,{trigger:"click",allowHTML:!0,content:n.innerHTML,arrow:!1,placement:"bottom",theme:"dropdown",interactive:!0,onShow:e=>{e.reference.dispatchEvent(this.showEvent)},onShown:e=>{e.reference.dispatchEvent(this.shownEvent)},onHide:e=>{e.reference.dispatchEvent(this.hideEvent)},onHidden:e=>{e.reference.dispatchEvent(this.hiddenEvent)}});window.hc_dropdown.push(t)}}static hideAll(){if(void 0!==window.hc_dropdown)for(let e of window.hc_dropdown)e.hide()}createEvent(){this.showEvent=new Event("show.hc.dropdown"),this.shownEvent=new Event("shown.hc.dropdown"),this.hideEvent=new Event("hide.hc.dropdown"),this.hiddenEvent=new Event("hidden.hc.dropdown")}}let hc_dropdown=e=>new HcDropdown(e);export default hc_dropdown;
|
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
* @author Lucas ROCHE
|
|
12
12
|
* @date 01/02/2022 11:01
|
|
13
13
|
* @copyright Copyright (c) 2002-2022 IRIS Interactive, Inc. (http://www.iris-interactive.fr)
|
|
14
|
-
*/import{Fancybox as t}from"@fancyapps/ui";import e from"../../enumerators/element.enum";import"@fancyapps/ui/dist/fancybox.css";import"./modal.component.scss";export class HcModal{showEvent;hideEvent;options={};constructor(o=e.modal,s={}){for(let a of(this.createEvent(),o)){this.initOptions(),Object.assign(this.options,s),this.options.src=""!==this.options.src?this.options.src:a.hasAttribute("href")?a.getAttribute("href"):a.hasAttribute("data-src")?a.dataset.src:"",this.options.parentEl=null!==this.options.parentEl?document.querySelector(this.options.parentEl):a.hasAttribute("data-hc-modal-parent")?document.querySelector(a.getAttribute("data-hc-modal-parent")):"",this.options.autoFocus=!!a.hasAttribute("data-hc-modal-autofocus");let o=`${e.modal}[${a.hasAttribute("data-src")?"data-src":"href"}="${this.options.src}"]`;t.bind(o,Object.assign(this.options,{on:{done:()=>{document.dispatchEvent(this.showEvent)},closing:()=>{document.dispatchEvent(this.hideEvent)}}}))}for(let t of e.modalClose)t.addEventListener("click",t=>{t.preventDefault();let e=""===t.currentTarget.dataset.hcModalClose||t.currentTarget.dataset.hcModalClose;HcModal.close(e)})}static show(e){t.show([e])}static close(e){t.close(e)}initOptions(){this.options={src:"",type:"inline",parentEl:null}}createEvent(){this.showEvent=new Event("show.hc.modal"),this.hideEvent=new Event("hide.hc.modal")}}let hc_modal=(t,e)=>new HcModal(t,e);export default hc_modal;
|
|
14
|
+
*/import{Fancybox as t}from"@fancyapps/ui";import e from"../../enumerators/element.enum";import"@fancyapps/ui/dist/fancybox.css";import"./modal.component.scss";export class HcModal{showEvent;hideEvent;options={};constructor(o=e.modal,s={}){for(let a of(this.createEvent(),document.querySelectorAll(o))){this.initOptions(),Object.assign(this.options,s),this.options.src=""!==this.options.src?this.options.src:a.hasAttribute("href")?a.getAttribute("href"):a.hasAttribute("data-src")?a.dataset.src:"",this.options.parentEl=null!==this.options.parentEl?document.querySelector(this.options.parentEl):a.hasAttribute("data-hc-modal-parent")?document.querySelector(a.getAttribute("data-hc-modal-parent")):"",this.options.autoFocus=!!a.hasAttribute("data-hc-modal-autofocus");let o=`${e.modal}[${a.hasAttribute("data-src")?"data-src":"href"}="${this.options.src}"]`;t.bind(o,Object.assign(this.options,{on:{done:()=>{document.dispatchEvent(this.showEvent)},closing:()=>{document.dispatchEvent(this.hideEvent)}}}))}for(let t of document.querySelectorAll(e.modalClose))t.addEventListener("click",t=>{t.preventDefault();let e=""===t.currentTarget.dataset.hcModalClose||t.currentTarget.dataset.hcModalClose;HcModal.close(e)})}static show(e){t.show([e])}static close(e){t.close(e)}initOptions(){this.options={src:"",type:"inline",parentEl:null}}createEvent(){this.showEvent=new Event("show.hc.modal"),this.hideEvent=new Event("hide.hc.modal")}}let hc_modal=(t,e)=>new HcModal(t,e);export default hc_modal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../../enumerators/element.enum";import"./overlay.component.scss";export class HcOverlay{showEvent;hideEvent;constructor(t=e.overlay){for(let r of t){for(let e of(this.createEvent(r),r.classList.add("hc-overlay-init"),r.querySelectorAll("[data-hc-overlay-trigger]")))e.addEventListener("click",e=>{let t=e.currentTarget.getAttribute("data-hc-overlay-trigger")?e.currentTarget.getAttribute("data-hc-overlay-trigger"):e.currentTarget.getAttribute("href")?e.currentTarget.getAttribute("href").substring(1):null;this.show(document.getElementById(t))});for(let e of r.querySelectorAll("[data-hc-overlay-close]"))e.addEventListener("click",e=>{e.preventDefault();let t=e.currentTarget.getAttribute("data-hc-overlay-close");t&&this.close(document.getElementById(t))});for(let t of r.querySelectorAll("[data-hc-overlay-background]"))t.addEventListener("click",t=>{for(let r of(console.log("click"),t.preventDefault(),document.querySelectorAll(e.overlay)))this.close(r)});document.onkeyup=t=>{if("Escape"===t.key)for(let t of document.querySelectorAll(e.overlay))this.close(t)}}}show(e){e.classList.add("hc-overlay-show"),document.body.classList.add("hc-overlay-lock"),document.dispatchEvent(this.showEvent)}close(e){e.classList.remove("hc-overlay-show"),document.body.classList.remove("hc-overlay-lock"),document.dispatchEvent(this.hideEvent)}createEvent(e){this.showEvent=new CustomEvent("show.hc.overlay",{detail:{element:e}}),this.hideEvent=new CustomEvent("hide.hc.overlay",{detail:{element:e}})}}let hc_overlay=e=>new HcOverlay(e);export default hc_overlay;
|
|
1
|
+
import e from"../../enumerators/element.enum";import"./overlay.component.scss";export class HcOverlay{showEvent;hideEvent;constructor(t=e.overlay){for(let r of document.querySelectorAll(t)){for(let e of(this.createEvent(r),r.classList.add("hc-overlay-init"),r.querySelectorAll("[data-hc-overlay-trigger]")))e.addEventListener("click",e=>{let t=e.currentTarget.getAttribute("data-hc-overlay-trigger")?e.currentTarget.getAttribute("data-hc-overlay-trigger"):e.currentTarget.getAttribute("href")?e.currentTarget.getAttribute("href").substring(1):null;this.show(document.getElementById(t))});for(let e of r.querySelectorAll("[data-hc-overlay-close]"))e.addEventListener("click",e=>{e.preventDefault();let t=e.currentTarget.getAttribute("data-hc-overlay-close");t&&this.close(document.getElementById(t))});for(let t of r.querySelectorAll("[data-hc-overlay-background]"))t.addEventListener("click",t=>{for(let r of(console.log("click"),t.preventDefault(),document.querySelectorAll(e.overlay)))this.close(r)});document.onkeyup=t=>{if("Escape"===t.key)for(let t of document.querySelectorAll(e.overlay))this.close(t)}}}show(e){e.classList.add("hc-overlay-show"),document.body.classList.add("hc-overlay-lock"),document.dispatchEvent(this.showEvent)}close(e){e.classList.remove("hc-overlay-show"),document.body.classList.remove("hc-overlay-lock"),document.dispatchEvent(this.hideEvent)}createEvent(e){this.showEvent=new CustomEvent("show.hc.overlay",{detail:{element:e}}),this.hideEvent=new CustomEvent("hide.hc.overlay",{detail:{element:e}})}}let hc_overlay=e=>new HcOverlay(e);export default hc_overlay;
|
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
* @author Stephan JAMBOU
|
|
12
12
|
* @date 28/01/2022 14:27
|
|
13
13
|
* @copyright Copyright (c) 2002-2022 IRIS Interactive, Inc. (http://www.iris-interactive.fr)
|
|
14
|
-
*/import t from"../../enumerators/element.enum";import"./popin.component.scss";export class HcPopin{showEvent;hideEvent;constructor(e=t.popin){for(let t of e){this.createEvent(t);let e=document.createElement("button");if(e.setAttribute("data-hc-popin-close",""),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M20 20L4 4m16 0L4 20"></path></svg>',t.prepend(e),t.hasAttribute("data-hc-popin-overlay")){let e=document.createElement("div");e.setAttribute("data-hc-popin-overlay-background",""),t.prepend(e),t.parentNode.insertBefore(e,t),e.appendChild(t),document.querySelectorAll("[data-hc-popin-overlay-background]")[0].addEventListener("click",e=>{e.composedPath().includes(t)||this.close(t)})}if(t.hasAttribute("data-hc-popin-position-top")&&(t.style.top=t.getAttribute("data-hc-popin-position-top")),t.hasAttribute("data-hc-popin-position-bottom")&&(t.style.bottom=t.getAttribute("data-hc-popin-position-bottom")),t.hasAttribute("data-hc-popin-position-left")&&(t.style.left=t.getAttribute("data-hc-popin-position-left")),t.hasAttribute("data-hc-popin-position-right")&&(t.style.right=t.getAttribute("data-hc-popin-position-right")),t.hasAttribute("data-hc-popin-position-top")||t.hasAttribute("data-hc-popin-position-top")||(t.style.bottom="20px"),t.hasAttribute("data-hc-popin-position-left")||t.hasAttribute("data-hc-popin-position-right")||(t.style.right="20px"),t.hasAttribute("data-hc-popin-mode")&&"trigger"===t.getAttribute("data-hc-popin-mode"))for(let t of document.querySelectorAll("[data-hc-popin-trigger]"))t.addEventListener("click",t=>{let e=t.currentTarget.getAttribute("href");this.show(document.getElementById(e.substring(1)))});else t.hasAttribute("data-hc-popin-delay")?setTimeout(()=>{this.show(t)},t.getAttribute("data-hc-popin-delay")):this.show(t);t.querySelectorAll("[data-hc-popin-close]")[0].addEventListener("click",e=>{e.preventDefault(),this.close(t)})}}show(t){t.classList.add("hc-popin-show");let e=t.parentNode;e.hasAttribute("data-hc-popin-overlay-background")&&e.classList.add("hc-popin-overlay-show"),document.dispatchEvent(this.showEvent)}close(t){t.classList.remove("hc-popin-show");let e=t.parentNode;e.hasAttribute("data-hc-popin-overlay-background")&&e.classList.remove("hc-popin-overlay-show"),document.dispatchEvent(this.hideEvent)}createEvent(t){this.showEvent=new CustomEvent("show.hc.popin",{detail:{element:t}}),this.hideEvent=new CustomEvent("hide.hc.popin",{detail:{element:t}})}}let hc_popin=t=>{new HcPopin(t)};export default hc_popin;
|
|
14
|
+
*/import t from"../../enumerators/element.enum";import"./popin.component.scss";export class HcPopin{showEvent;hideEvent;constructor(e=t.popin){for(let t of document.querySelectorAll(e)){this.createEvent(t);let e=document.createElement("button");if(e.setAttribute("data-hc-popin-close",""),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M20 20L4 4m16 0L4 20"></path></svg>',t.prepend(e),t.hasAttribute("data-hc-popin-overlay")){let e=document.createElement("div");e.setAttribute("data-hc-popin-overlay-background",""),t.prepend(e),t.parentNode.insertBefore(e,t),e.appendChild(t),document.querySelectorAll("[data-hc-popin-overlay-background]")[0].addEventListener("click",e=>{e.composedPath().includes(t)||this.close(t)})}if(t.hasAttribute("data-hc-popin-position-top")&&(t.style.top=t.getAttribute("data-hc-popin-position-top")),t.hasAttribute("data-hc-popin-position-bottom")&&(t.style.bottom=t.getAttribute("data-hc-popin-position-bottom")),t.hasAttribute("data-hc-popin-position-left")&&(t.style.left=t.getAttribute("data-hc-popin-position-left")),t.hasAttribute("data-hc-popin-position-right")&&(t.style.right=t.getAttribute("data-hc-popin-position-right")),t.hasAttribute("data-hc-popin-position-top")||t.hasAttribute("data-hc-popin-position-top")||(t.style.bottom="20px"),t.hasAttribute("data-hc-popin-position-left")||t.hasAttribute("data-hc-popin-position-right")||(t.style.right="20px"),t.hasAttribute("data-hc-popin-mode")&&"trigger"===t.getAttribute("data-hc-popin-mode"))for(let t of document.querySelectorAll("[data-hc-popin-trigger]"))t.addEventListener("click",t=>{let e=t.currentTarget.getAttribute("href");this.show(document.getElementById(e.substring(1)))});else t.hasAttribute("data-hc-popin-delay")?setTimeout(()=>{this.show(t)},t.getAttribute("data-hc-popin-delay")):this.show(t);t.querySelectorAll("[data-hc-popin-close]")[0].addEventListener("click",e=>{e.preventDefault(),this.close(t)})}}show(t){t.classList.add("hc-popin-show");let e=t.parentNode;e.hasAttribute("data-hc-popin-overlay-background")&&e.classList.add("hc-popin-overlay-show"),document.dispatchEvent(this.showEvent)}close(t){t.classList.remove("hc-popin-show");let e=t.parentNode;e.hasAttribute("data-hc-popin-overlay-background")&&e.classList.remove("hc-popin-overlay-show"),document.dispatchEvent(this.hideEvent)}createEvent(t){this.showEvent=new CustomEvent("show.hc.popin",{detail:{element:t}}),this.hideEvent=new CustomEvent("hide.hc.popin",{detail:{element:t}})}}let hc_popin=t=>{new HcPopin(t)};export default hc_popin;
|
|
@@ -11,4 +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
|
-
*/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;
|
|
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 document.querySelectorAll(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;
|
|
@@ -11,4 +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
|
-
*/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;
|
|
14
|
+
*/import e from"../../enumerators/element.enum";export class HcToggle{constructor(t=e.toggle){for(let e of document.querySelectorAll(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;
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
|
|
59
59
|
/* Text icon
|
|
60
60
|
/* ============================================= */
|
|
61
|
-
@mixin text-icon($icon: '', $format: '', $alignment: '', $icon-position: before) {
|
|
61
|
+
@mixin text-icon($icon: '', $format: '', $alignment: '', $icon-position: before, $font: 'customer-font') {
|
|
62
62
|
display: inline-flex;
|
|
63
63
|
align-items: center;
|
|
64
64
|
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
@if $icon != '' {
|
|
80
80
|
&:#{$icon-position} {
|
|
81
81
|
color: #{variables.$icon-color};
|
|
82
|
-
@include fi(#{$icon});
|
|
82
|
+
@include fi(#{$icon}, #{$font});
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|