@iris.interactive/handcook 2.9.34 → 2.9.36

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.
@@ -26,6 +26,7 @@ export class HcScrollReveal {
26
26
  let interval = 150;
27
27
  let origin = 'bottom';
28
28
 
29
+ //Children by parent
29
30
  const parents = document.querySelectorAll(ElementEnum.scrollRevealParent);
30
31
  parents.forEach( parent => {
31
32
 
@@ -55,7 +56,7 @@ export class HcScrollReveal {
55
56
  }
56
57
  });
57
58
 
58
- ScrollReveal().reveal('[data-hc-scroll-reveal-child]', {
59
+ ScrollReveal().reveal(parent.querySelectorAll("[data-hc-scroll-reveal-child]"), {
59
60
  distance: distance,
60
61
  delay: delay,
61
62
  duration: duration,
@@ -64,6 +65,7 @@ export class HcScrollReveal {
64
65
  });
65
66
  });
66
67
 
68
+ //Specific item
67
69
  const items = document.querySelectorAll(ElementEnum.scrollReveal);
68
70
  items.forEach( item => {
69
71
 
@@ -1,327 +1 @@
1
- /******/ (() => { // webpackBootstrap
2
- /******/ "use strict";
3
- /******/ var __webpack_modules__ = ({
4
-
5
- /***/ "./resources/assets/scripts/enumerators/element.enum.js":
6
- /*!**************************************************************!*\
7
- !*** ./resources/assets/scripts/enumerators/element.enum.js ***!
8
- \**************************************************************/
9
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10
-
11
- __webpack_require__.r(__webpack_exports__);
12
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13
- /* harmony export */ "default": () => (/* binding */ ElementEnum)
14
- /* harmony export */ });
15
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
16
-
17
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
18
-
19
- /*
20
- * IRIS Interactive
21
- *
22
- * NOTICE OF LICENSE
23
- *
24
- * This source file is no subject to a specific license
25
- * but it belongs to the company IRIS Interactive.
26
- * You can contact IRIS Interactive at the following
27
- * address: contact@iris-interactive.fr
28
- *
29
- * @author Lucas ROCHE
30
- * @date 01/02/2022 10:36
31
- * @copyright Copyright (c) 2002-2022 IRIS Interactive, Inc. (http://www.iris-interactive.fr)
32
- */
33
- var ElementEnum = function ElementEnum() {
34
- _classCallCheck(this, ElementEnum);
35
- };
36
-
37
- _defineProperty(ElementEnum, "tooltip", '[data-hc-tooltip], [data-hc-popover]');
38
-
39
- _defineProperty(ElementEnum, "popover", '[data-hc-popover]');
40
-
41
- _defineProperty(ElementEnum, "scrollSmooth", '[data-hc-smooth-scroll]');
42
-
43
- _defineProperty(ElementEnum, "modal", '[data-hc-modal]');
44
-
45
- _defineProperty(ElementEnum, "modalClose", '[data-hc-modal-close]');
46
-
47
- _defineProperty(ElementEnum, "lightboxAttr", 'data-hc-lightbox');
48
-
49
- _defineProperty(ElementEnum, "lightbox", "[".concat(ElementEnum.lightboxAttr, "]"));
50
-
51
- _defineProperty(ElementEnum, "dropdown", '[data-hc-dropdown]');
52
-
53
- _defineProperty(ElementEnum, "collapse", '[data-hc-collapse]');
54
-
55
- _defineProperty(ElementEnum, "collapseItem", '[data-hc-collapse-item]');
56
-
57
- _defineProperty(ElementEnum, "popin", '[data-hc-popin]');
58
-
59
- _defineProperty(ElementEnum, "tab", '[data-hc-tab]');
60
-
61
- _defineProperty(ElementEnum, "toggle", '[data-hc-toggle]');
62
-
63
- _defineProperty(ElementEnum, "slider", '[data-hc-slider]');
64
-
65
- _defineProperty(ElementEnum, "scrollspy", '[data-hc-scrollspy]');
66
-
67
- _defineProperty(ElementEnum, "scrollspyNav", '[data-hc-scrollspy-nav]');
68
-
69
- _defineProperty(ElementEnum, "scrollspyNavItem", '[data-hc-scrollspy-nav-item]');
70
-
71
- _defineProperty(ElementEnum, "scrollRevealParent", '[data-hc-scroll-reveal-parent]');
72
-
73
- _defineProperty(ElementEnum, "scrollReveal", '[data-hc-scroll-reveal]');
74
-
75
-
76
-
77
- /***/ }),
78
-
79
- /***/ "./resources/assets/scripts/enumerators/smooth-scroll.enum.js":
80
- /*!********************************************************************!*\
81
- !*** ./resources/assets/scripts/enumerators/smooth-scroll.enum.js ***!
82
- \********************************************************************/
83
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
84
-
85
- __webpack_require__.r(__webpack_exports__);
86
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
87
- /* harmony export */ "default": () => (/* binding */ SmoothScrollEnum)
88
- /* harmony export */ });
89
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
90
-
91
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
92
-
93
- /*
94
- * IRIS Interactive
95
- *
96
- * NOTICE OF LICENSE
97
- *
98
- * This source file is no subject to a specific license
99
- * but it belongs to the company IRIS Interactive.
100
- * You can contact IRIS Interactive at the following
101
- * address: contact@iris-interactive.fr
102
- *
103
- * @author Lucas ROCHE
104
- * @date 14/04/2022 11:28
105
- * @copyright Copyright (c) 2002-2022 IRIS Interactive, Inc. (http://www.iris-interactive.fr)
106
- */
107
- var SmoothScrollEnum = function SmoothScrollEnum() {
108
- _classCallCheck(this, SmoothScrollEnum);
109
- };
110
-
111
- _defineProperty(SmoothScrollEnum, "attrHref", "data-hc-smooth-scroll-href");
112
-
113
- _defineProperty(SmoothScrollEnum, "attrShift", "data-hc-smooth-scroll-shift");
114
-
115
-
116
-
117
- /***/ })
118
-
119
- /******/ });
120
- /************************************************************************/
121
- /******/ // The module cache
122
- /******/ var __webpack_module_cache__ = {};
123
- /******/
124
- /******/ // The require function
125
- /******/ function __webpack_require__(moduleId) {
126
- /******/ // Check if module is in cache
127
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
128
- /******/ if (cachedModule !== undefined) {
129
- /******/ return cachedModule.exports;
130
- /******/ }
131
- /******/ // Create a new module (and put it into the cache)
132
- /******/ var module = __webpack_module_cache__[moduleId] = {
133
- /******/ // no module.id needed
134
- /******/ // no module.loaded needed
135
- /******/ exports: {}
136
- /******/ };
137
- /******/
138
- /******/ // Execute the module function
139
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
140
- /******/
141
- /******/ // Return the exports of the module
142
- /******/ return module.exports;
143
- /******/ }
144
- /******/
145
- /************************************************************************/
146
- /******/ /* webpack/runtime/define property getters */
147
- /******/ (() => {
148
- /******/ // define getter functions for harmony exports
149
- /******/ __webpack_require__.d = (exports, definition) => {
150
- /******/ for(var key in definition) {
151
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
152
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
153
- /******/ }
154
- /******/ }
155
- /******/ };
156
- /******/ })();
157
- /******/
158
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
159
- /******/ (() => {
160
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
161
- /******/ })();
162
- /******/
163
- /******/ /* webpack/runtime/make namespace object */
164
- /******/ (() => {
165
- /******/ // define __esModule on exports
166
- /******/ __webpack_require__.r = (exports) => {
167
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
168
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
169
- /******/ }
170
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
171
- /******/ };
172
- /******/ })();
173
- /******/
174
- /************************************************************************/
175
- var __webpack_exports__ = {};
176
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
177
- (() => {
178
- /*!******************************************************************************!*\
179
- !*** ./resources/assets/scripts/components/scrollspy/scrollspy.component.js ***!
180
- \******************************************************************************/
181
- __webpack_require__.r(__webpack_exports__);
182
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
183
- /* harmony export */ "HcScrollspy": () => (/* binding */ HcScrollspy),
184
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
185
- /* harmony export */ });
186
- /* harmony import */ var _enumerators_element_enum__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../enumerators/element.enum */ "./resources/assets/scripts/enumerators/element.enum.js");
187
- /* harmony import */ var _enumerators_smooth_scroll_enum__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../enumerators/smooth-scroll.enum */ "./resources/assets/scripts/enumerators/smooth-scroll.enum.js");
188
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
189
-
190
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
191
-
192
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
193
-
194
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
195
-
196
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
197
-
198
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
199
-
200
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
201
-
202
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
203
-
204
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
205
-
206
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
207
-
208
-
209
-
210
- var HcScrollspy = /*#__PURE__*/function () {
211
- function HcScrollspy() {
212
- var _this = this;
213
-
214
- var elements = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _enumerators_element_enum__WEBPACK_IMPORTED_MODULE_0__["default"].scrollspy;
215
-
216
- _classCallCheck(this, HcScrollspy);
217
-
218
- _defineProperty(this, "activeEvent", void 0);
219
-
220
- document.querySelectorAll(elements).forEach(function (element) {
221
- var navElement = document.querySelector(element.dataset.hcScrollspy);
222
- var shift = element.getAttribute('data-hc-scrollspy-shift') !== null ? parseInt(element.getAttribute('data-hc-scrollspy-shift')) : 0;
223
-
224
- _this.activeItem(navElement, _enumerators_element_enum__WEBPACK_IMPORTED_MODULE_0__["default"].scrollSmooth, shift);
225
- });
226
- }
227
-
228
- _createClass(HcScrollspy, [{
229
- key: "getPartsConfig",
230
- value: function getPartsConfig(navElement, childElement) {
231
- var _this2 = this;
232
-
233
- var offsetTop = [];
234
- navElement.querySelectorAll(childElement).forEach(function (item) {
235
- var part = item.getAttribute('href') !== null ? {
236
- id: item.getAttribute('href'),
237
- value: 0,
238
- attribute: 'href'
239
- } : {
240
- id: item.getAttribute(_enumerators_smooth_scroll_enum__WEBPACK_IMPORTED_MODULE_1__["default"].attrHref),
241
- value: 0,
242
- attribute: _enumerators_smooth_scroll_enum__WEBPACK_IMPORTED_MODULE_1__["default"].attrHref
243
- };
244
-
245
- if (document.querySelector(part.id) !== null) {
246
- // part.value = document.querySelector(part.id).offsetTop;
247
- part.value = _this2.getOffset(document.querySelector(part.id)).top;
248
- offsetTop = [].concat(_toConsumableArray(offsetTop), [part]);
249
- }
250
- });
251
- return offsetTop;
252
- }
253
- }, {
254
- key: "activeItem",
255
- value: function activeItem(navElement, childElement) {
256
- var _this3 = this;
257
-
258
- var shift = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
259
- var item = navElement.querySelector("".concat(childElement, ":first-child"));
260
- window.addEventListener('scroll', function () {
261
- var partsConfig = _this3.getPartsConfig(navElement, childElement);
262
-
263
- var top = window.scrollY;
264
- partsConfig.forEach(function (offsetTop) {
265
- if (top > offsetTop.value - (shift + 50)) {
266
- item = navElement.querySelector('[' + offsetTop.attribute + '="' + offsetTop.id + '"]');
267
- }
268
- });
269
- navElement.querySelectorAll(childElement).forEach(function (child) {
270
- if (child !== item) {
271
- var deactiveEvent = new CustomEvent('deactive.hc.scrollspy', {
272
- detail: {
273
- nav: navElement,
274
- item: item
275
- }
276
- });
277
- document.dispatchEvent(deactiveEvent);
278
-
279
- if (child.classList.contains('active')) {
280
- child.classList.remove('active');
281
- }
282
- }
283
- });
284
-
285
- if (!item.classList.contains('active')) {
286
- var activeEvent = new CustomEvent('active.hc.scrollspy', {
287
- detail: {
288
- nav: navElement,
289
- item: item
290
- }
291
- });
292
- document.dispatchEvent(activeEvent);
293
- item.classList.add('active');
294
- }
295
- });
296
- }
297
- }, {
298
- key: "getOffset",
299
- value: function getOffset(element) {
300
- var x = 0;
301
- var y = 0;
302
-
303
- while (element && !isNaN(element.offsetLeft) && !isNaN(element.offsetTop)) {
304
- x += element.offsetLeft - element.scrollLeft;
305
- y += element.offsetTop - element.scrollTop;
306
- element = element.offsetParent;
307
- }
308
-
309
- return {
310
- top: y,
311
- left: x
312
- };
313
- }
314
- }]);
315
-
316
- return HcScrollspy;
317
- }();
318
-
319
- var hc_scrollspy = function hc_scrollspy(trigger) {
320
- return new HcScrollspy(trigger);
321
- };
322
-
323
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (hc_scrollspy);
324
- })();
325
-
326
- /******/ })()
327
- ;
1
+ (()=>{"use strict";var a={812:(a,t,o)=>{function e(a,t,o){return t in a?Object.defineProperty(a,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):a[t]=o,a}var r=function a(){!function(a,t){if(!(a instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a)};e(r,"tooltip","[data-hc-tooltip], [data-hc-popover]"),e(r,"popover","[data-hc-popover]"),e(r,"scrollSmooth","[data-hc-smooth-scroll]"),e(r,"modal","[data-hc-modal]"),e(r,"modalClose","[data-hc-modal-close]"),e(r,"lightboxAttr","data-hc-lightbox"),e(r,"lightbox","[".concat(r.lightboxAttr,"]")),e(r,"dropdown","[data-hc-dropdown]"),e(r,"collapse","[data-hc-collapse]"),e(r,"collapseItem","[data-hc-collapse-item]"),e(r,"popin","[data-hc-popin]"),e(r,"tab","[data-hc-tab]"),e(r,"toggle","[data-hc-toggle]"),e(r,"slider","[data-hc-slider]"),e(r,"scrollspy","[data-hc-scrollspy]"),e(r,"scrollspyNav","[data-hc-scrollspy-nav]"),e(r,"scrollspyNavItem","[data-hc-scrollspy-nav-item]"),e(r,"scrollRevealParent","[data-hc-scroll-reveal-parent]"),e(r,"scrollReveal","[data-hc-scroll-reveal]")},539:(a,t,o)=>{function e(a,t,o){return t in a?Object.defineProperty(a,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):a[t]=o,a}var r=function a(){!function(a,t){if(!(a instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a)};e(r,"attrHref","data-hc-smooth-scroll-href"),e(r,"attrShift","data-hc-smooth-scroll-shift")}},t={};function o(e){var r=t[e];if(void 0!==r)return r.exports;var l=t[e]={exports:{}};return a[e](l,l.exports,o),l.exports}o.d=(a,t)=>{for(var e in t)o.o(t,e)&&!o.o(a,e)&&Object.defineProperty(a,e,{enumerable:!0,get:t[e]})},o.o=(a,t)=>Object.prototype.hasOwnProperty.call(a,t),o(812),o(539)})();