@iris.interactive/handcook 2.10.36 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Welcome to HandCook 👨‍🍳
2
- ![Version](https://img.shields.io/badge/version-2.10.35-blue.svg?cacheSeconds=2592000)
2
+ ![Version](https://img.shields.io/badge/version-4.0.0-blue.svg?cacheSeconds=2592000)
3
3
  ![Prerequisite](https://img.shields.io/badge/node-%3E%3D%2012.14.0-blue.svg)
4
4
  [![License: UNLICENSED](https://img.shields.io/badge/License-UNLICENSED-yellow.svg)](#)
5
5
  [![Twitter: captain\_iris](https://img.shields.io/twitter/follow/captain\_iris.svg?style=social)](https://twitter.com/captain\_iris)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iris.interactive/handcook",
3
- "version": "2.10.36",
3
+ "version": "4.0.0",
4
4
  "description": "The web cooking by IRIS Interactive",
5
5
  "main": "./public/scripts/index.js",
6
6
  "scripts": {
@@ -39,18 +39,21 @@ export class HcSlider {
39
39
  // Options
40
40
  options = {};
41
41
 
42
+ // Events
43
+ initEvent;
44
+
42
45
  /**
43
46
  * @param elements
44
47
  */
45
48
  constructor(elements = ElementEnum.slider) {
46
- this.initOptions();
47
49
  document.querySelectorAll(elements).forEach(element => {
50
+ this.initEvent = new Event("init.hc.slider");
51
+ this.initOptions();
48
52
  this.slider = element;
49
53
  this.setOptions();
50
54
  this.buildDom();
51
55
  const instance = new Swiper(element, this.options);
52
56
  this.instances.push(instance);
53
- this.initOptions();
54
57
  });
55
58
  }
56
59
 
@@ -266,6 +269,8 @@ export class HcSlider {
266
269
  if (swiper.isLocked) {
267
270
  swiper.$el.addClass('hc-slider-lock');
268
271
  }
272
+
273
+ this.slider.dispatchEvent(this.initEvent);
269
274
  },
270
275
  slideChangeTransitionEnd: (swiper) => {
271
276