@iris.interactive/handcook 2.10.35 → 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.35",
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
 
@@ -135,6 +138,7 @@ export class HcSlider {
135
138
  el: '.hc-slider-pagination',
136
139
  type: 'bullets',
137
140
  clickable: true,
141
+ dynamicBullets: false,
138
142
  bulletClass: 'hc-slider-pagination-bullet',
139
143
  clickableClass: 'hc-slider-pagination-clickable',
140
144
  currentClass: 'hc-slider-pagination-current',
@@ -193,6 +197,10 @@ export class HcSlider {
193
197
  // et si les elements n'existent pas déjà
194
198
  if (this.options.pagination !== false) {
195
199
 
200
+ if(items.length >= 8 ){
201
+ this.options.pagination.dynamicBullets = true;
202
+ }
203
+
196
204
  const el = this.slider.querySelectorAll(this.options.pagination.el);
197
205
  if (el.length === 0) {
198
206
  const paginationElement = document.createElement("div");
@@ -261,6 +269,8 @@ export class HcSlider {
261
269
  if (swiper.isLocked) {
262
270
  swiper.$el.addClass('hc-slider-lock');
263
271
  }
272
+
273
+ this.slider.dispatchEvent(this.initEvent);
264
274
  },
265
275
  slideChangeTransitionEnd: (swiper) => {
266
276
 
@@ -282,4 +292,4 @@ export class HcSlider {
282
292
  const hc_slider = function (trigger) {
283
293
  return new HcSlider(trigger);
284
294
  }
285
- export default hc_slider;
295
+ export default hc_slider;
@@ -120,6 +120,7 @@ $customer-bottom-bar-height: var(--iris--customer-bottom-bar--height, 60px);
120
120
 
121
121
  //Icon
122
122
  $icon-color: var(--iris--icon--color);
123
+ $icon-font-size: 20px;
123
124
 
124
125
 
125
126
  //Rank