@iris.interactive/handcook 4.0.3 → 4.0.5
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 +1 -1
- package/package.json +3 -3
- package/public/index.html +3 -1
- package/public/scripts/components/lightbox/lightbox.component.js +2 -2
- package/public/scripts/components/modal/modal.component.js +3 -3
- package/public/scripts/components/slider/slider.component.js +4 -0
- package/public/scripts/components/tooltip/tooltip.component.js +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Welcome to HandCook 👨🍳
|
|
2
|
-

|
|
3
3
|

|
|
4
4
|
[](#)
|
|
5
5
|
[](https://twitter.com/captain\_iris)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iris.interactive/handcook",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.5",
|
|
4
4
|
"description": "The web cooking by IRIS Interactive",
|
|
5
5
|
"main": "./public/scripts/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@fancyapps/ui": "^4.0.22",
|
|
36
36
|
"bootstrap": "^5.1.3",
|
|
37
|
+
"scrollreveal": "^4.0.9",
|
|
37
38
|
"swiper": "8.0.6",
|
|
38
39
|
"tippy.js": "^6.3.7",
|
|
39
|
-
"vanilla-lazyload": "^17.6.1"
|
|
40
|
-
"scrollreveal": "^4.0.9"
|
|
40
|
+
"vanilla-lazyload": "^17.6.1"
|
|
41
41
|
}
|
|
42
42
|
}
|
package/public/index.html
CHANGED
|
@@ -184,7 +184,9 @@
|
|
|
184
184
|
<h2 class="component__content__title">Modal</h2>
|
|
185
185
|
<div class="component__content">
|
|
186
186
|
<div class="component__content__topbar">
|
|
187
|
-
<a href="#dialog-content" class="button" data-hc-modal
|
|
187
|
+
<a href="#dialog-content" class="button" data-hc-modal
|
|
188
|
+
data-hc-tooltip data-hc-tooltip-content="Tooltip + modal"
|
|
189
|
+
data-hc-tooltip-placement="bottom">Modal</a>
|
|
188
190
|
<a href="#dialog-content" class="button" id="custom-trigger-modal">Custom trigger modal</a>
|
|
189
191
|
</div>
|
|
190
192
|
</div>
|
|
@@ -42,9 +42,9 @@ export class HcLightbox {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
getTranslation() {
|
|
45
|
-
const lang = document.querySelector('html')
|
|
45
|
+
const lang = document.querySelector('html')?.getAttribute('lang');
|
|
46
46
|
|
|
47
|
-
if (lang.indexOf('fr-FR') !== false) {
|
|
47
|
+
if ( typeof lang == "string" && lang.indexOf('fr-FR') !== false) {
|
|
48
48
|
return {
|
|
49
49
|
CLOSE: "Fermer",
|
|
50
50
|
NEXT: "Suivant",
|
|
@@ -31,16 +31,16 @@ export class HcModal {
|
|
|
31
31
|
Object.assign(this.options, overrideOptions);
|
|
32
32
|
this.options.src = this.options.src != '' ? this.options.src : (element.hasAttribute('href') ? element.getAttribute('href') : (element.hasAttribute('data-hc-src') ? element.dataset.hcSrc : ''));
|
|
33
33
|
this.options.parentEl = this.options.parentEl !== null ? document.querySelector(this.options.parentEl) : (element.hasAttribute('data-hc-modal-parent') ? document.querySelector(element.getAttribute('data-hc-modal-parent')) : '');
|
|
34
|
-
Fancybox.bind(elements, this.options, {
|
|
34
|
+
Fancybox.bind(elements, Object.assign(this.options, {
|
|
35
35
|
on: {
|
|
36
|
-
|
|
36
|
+
done: () => {
|
|
37
37
|
document.dispatchEvent(this.showEvent);
|
|
38
38
|
},
|
|
39
39
|
closing: () => {
|
|
40
40
|
document.dispatchEvent(this.hideEvent);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
});
|
|
43
|
+
}));
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
document.querySelectorAll(ElementEnum.modalClose).forEach(element => {
|
|
@@ -40,7 +40,7 @@ export class HcTooltip {
|
|
|
40
40
|
document.querySelectorAll(elements).forEach(element => {
|
|
41
41
|
let options = {};
|
|
42
42
|
Object.assign(options, this.defaultOptions, overrideOptions);
|
|
43
|
-
options.trigger = options.trigger != '' ? options.trigger : (element.hasAttribute(TooltipEnum.attrPopover) ? "click" : "mouseenter
|
|
43
|
+
options.trigger = options.trigger != '' ? options.trigger : (element.hasAttribute(TooltipEnum.attrPopover) ? "click" : "mouseenter");
|
|
44
44
|
options.content = options.content != '' ? options.content : (element.hasAttribute(TooltipEnum.attrContent) ? element.getAttribute(TooltipEnum.attrContent) : '');
|
|
45
45
|
options.placement = options.placement != '' ? options.placement : (element.hasAttribute(TooltipEnum.attrPlacement) ? element.getAttribute(TooltipEnum.attrPlacement) : 'bottom');
|
|
46
46
|
options.interactive = options.interactive != '' ? options.interactive : (element.hasAttribute(TooltipEnum.attrInteractive) ? element.getAttribute(TooltipEnum.attrInteractive) : false);
|