@iris.interactive/handcook 2.9.17 → 2.9.20

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.
@@ -1 +1 @@
1
- (()=>{"use strict";var t={812:(t,a,o)=>{function r(t,a,o){return a in t?Object.defineProperty(t,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[a]=o,t}var e=function t(){!function(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}(this,t)};r(e,"tooltip","[data-hc-tooltip], [data-hc-popover]"),r(e,"popover","[data-hc-popover]"),r(e,"scrollSmooth","[data-hc-smooth-scroll]"),r(e,"modal","[data-hc-modal]"),r(e,"lightboxAttr","data-hc-lightbox"),r(e,"lightbox","[".concat(e.lightboxAttr,"]")),r(e,"dropdown","[data-hc-dropdown]"),r(e,"collapse","[data-hc-collapse]"),r(e,"collapseItem","[data-hc-collapse-item]"),r(e,"popin","[data-hc-popin]"),r(e,"tab","[data-hc-tab]"),r(e,"toggle","[data-hc-toggle]"),r(e,"slider","[data-hc-slider]"),r(e,"scrollspy","[data-hc-scrollspy]"),r(e,"scrollspyNav","[data-hc-scrollspy-nav]"),r(e,"scrollspyNavItem","[data-hc-scrollspy-nav-item]")},539:(t,a,o)=>{function r(t,a,o){return a in t?Object.defineProperty(t,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[a]=o,t}var e=function t(){!function(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}(this,t)};r(e,"attrHref","data-hc-smooth-scroll-href"),r(e,"attrShift","data-hc-smooth-scroll-shift")}},a={};function o(r){var e=a[r];if(void 0!==e)return e.exports;var c=a[r]={exports:{}};return t[r](c,c.exports,o),c.exports}o.d=(t,a)=>{for(var r in a)o.o(a,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o.o=(t,a)=>Object.prototype.hasOwnProperty.call(t,a),o(812),o(539)})();
1
+ (()=>{"use strict";var t={812:(t,a,o)=>{function r(t,a,o){return a in t?Object.defineProperty(t,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[a]=o,t}var e=function t(){!function(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}(this,t)};r(e,"tooltip","[data-hc-tooltip], [data-hc-popover]"),r(e,"popover","[data-hc-popover]"),r(e,"scrollSmooth","[data-hc-smooth-scroll]"),r(e,"modal","[data-hc-modal]"),r(e,"modalClose","[data-hc-modal-close]"),r(e,"lightboxAttr","data-hc-lightbox"),r(e,"lightbox","[".concat(e.lightboxAttr,"]")),r(e,"dropdown","[data-hc-dropdown]"),r(e,"collapse","[data-hc-collapse]"),r(e,"collapseItem","[data-hc-collapse-item]"),r(e,"popin","[data-hc-popin]"),r(e,"tab","[data-hc-tab]"),r(e,"toggle","[data-hc-toggle]"),r(e,"slider","[data-hc-slider]"),r(e,"scrollspy","[data-hc-scrollspy]"),r(e,"scrollspyNav","[data-hc-scrollspy-nav]"),r(e,"scrollspyNavItem","[data-hc-scrollspy-nav-item]")},539:(t,a,o)=>{function r(t,a,o){return a in t?Object.defineProperty(t,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[a]=o,t}var e=function t(){!function(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}(this,t)};r(e,"attrHref","data-hc-smooth-scroll-href"),r(e,"attrShift","data-hc-smooth-scroll-shift")}},a={};function o(r){var e=a[r];if(void 0!==e)return e.exports;var l=a[r]={exports:{}};return t[r](l,l.exports,o),l.exports}o.d=(t,a)=>{for(var r in a)o.o(a,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o.o=(t,a)=>Object.prototype.hasOwnProperty.call(t,a),o(812),o(539)})();
@@ -123,50 +123,53 @@ export class HcSlider {
123
123
  }
124
124
 
125
125
  buildDom() {
126
- // On recupère les slide items (element de DOM enfant de premier niveau)
127
- // et on leur ajoute la classe des slide item
128
- const items = [].slice.call(this.slider.children);
129
- items.forEach(item => {
130
- item.classList.add('swiper-slide');
131
- });
132
-
133
- // On ajoute la classe swiper a notre slider,
134
- // on crée la div wrapper et on insére les slider item dedans
135
- const wrapperElement = document.createElement("div");
136
- wrapperElement.classList.add("swiper-wrapper");
137
- items.forEach(item => {
138
- wrapperElement.appendChild(item);
139
- });
140
- this.slider.appendChild(wrapperElement);
141
-
142
- // On ajout les différentes div utile en fonction des options passées
143
- // et si les elements n'existent pas déjà
144
- if (this.options.pagination !== false) {
145
-
146
- const el = this.slider.querySelectorAll(this.options.pagination.el);
147
- if (el.length === 0) {
148
- const paginationElement = document.createElement("div");
149
- paginationElement.classList.add(this.options.pagination.el.substr(1));
150
- this.slider.appendChild(paginationElement);
151
- }
152
- }
153
- if (this.options.navigation !== false) {
154
-
155
- if (!this.slider.hasAttribute('data-hc-slider-arrow-prev')) {
156
- const prevEl = this.slider.querySelectorAll(this.options.navigation.prevEl);
157
- if (prevEl.length === 0) {
158
- const buttonPrev = document.createElement("div");
159
- buttonPrev.classList.add(this.options.navigation.prevEl.substr(1));
160
- this.slider.appendChild(buttonPrev);
126
+ // Si le DOM n'est pas créé correctement, on le fait
127
+ if (this.slider.querySelectorAll('.swiper-wrapper').length === 0) {
128
+ // On recupère les slide items (element de DOM enfant de premier niveau)
129
+ // et on leur ajoute la classe des slide item
130
+ const items = [].slice.call(this.slider.children);
131
+ items.forEach(item => {
132
+ item.classList.add('swiper-slide');
133
+ });
134
+
135
+ // On ajoute la classe swiper a notre slider,
136
+ // on crée la div wrapper et on insére les slider item dedans
137
+ const wrapperElement = document.createElement("div");
138
+ wrapperElement.classList.add("swiper-wrapper");
139
+ items.forEach(item => {
140
+ wrapperElement.appendChild(item);
141
+ });
142
+ this.slider.appendChild(wrapperElement);
143
+
144
+ // On ajout les différentes div utile en fonction des options passées
145
+ // et si les elements n'existent pas déjà
146
+ if (this.options.pagination !== false) {
147
+
148
+ const el = this.slider.querySelectorAll(this.options.pagination.el);
149
+ if (el.length === 0) {
150
+ const paginationElement = document.createElement("div");
151
+ paginationElement.classList.add(this.options.pagination.el.substr(1));
152
+ this.slider.appendChild(paginationElement);
161
153
  }
162
154
  }
155
+ if (this.options.navigation !== false) {
156
+
157
+ if (!this.slider.hasAttribute('data-hc-slider-arrow-prev')) {
158
+ const prevEl = this.slider.querySelectorAll(this.options.navigation.prevEl);
159
+ if (prevEl.length === 0) {
160
+ const buttonPrev = document.createElement("div");
161
+ buttonPrev.classList.add(this.options.navigation.prevEl.substr(1));
162
+ this.slider.appendChild(buttonPrev);
163
+ }
164
+ }
163
165
 
164
- if (!this.slider.hasAttribute('data-hc-slider-arrow-next')) {
165
- const nextEl = this.slider.querySelectorAll(this.options.navigation.nextEl);
166
- if (nextEl.length === 0) {
167
- const buttonNext = document.createElement("div");
168
- buttonNext.classList.add(this.options.navigation.nextEl.substr(1));
169
- this.slider.appendChild(buttonNext);
166
+ if (!this.slider.hasAttribute('data-hc-slider-arrow-next')) {
167
+ const nextEl = this.slider.querySelectorAll(this.options.navigation.nextEl);
168
+ if (nextEl.length === 0) {
169
+ const buttonNext = document.createElement("div");
170
+ buttonNext.classList.add(this.options.navigation.nextEl.substr(1));
171
+ this.slider.appendChild(buttonNext);
172
+ }
170
173
  }
171
174
  }
172
175
  }