@iris.interactive/handcook 2.6.9 → 2.6.12
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/package.json +1 -1
- package/public/scripts/components/modal/modal.component.js +19 -2
- package/public/scripts/components/tab/tab.component.js +12 -4
- package/public/styles/scss/mixins/_mixin-layout.scss +17 -1
- package/public/styles/scss/mixins/_mixin-style.scss +1 -1
- package/public/styles/style.css +2 -2
package/package.json
CHANGED
|
@@ -20,9 +20,12 @@ import './modal.component.scss';
|
|
|
20
20
|
|
|
21
21
|
export class HcModal {
|
|
22
22
|
|
|
23
|
+
showEvent;
|
|
24
|
+
hideEvent;
|
|
23
25
|
options = {};
|
|
24
26
|
|
|
25
27
|
constructor(elements = ElementEnum.modal, overrideOptions = {}) {
|
|
28
|
+
this.createEvent();
|
|
26
29
|
document.querySelectorAll(elements).forEach(element => {
|
|
27
30
|
Fancybox.bind(element);
|
|
28
31
|
element.addEventListener('click', (e) => {
|
|
@@ -31,7 +34,16 @@ export class HcModal {
|
|
|
31
34
|
Object.assign(this.options, overrideOptions);
|
|
32
35
|
this.options.src = this.options.src != '' ? this.options.src : (e.currentTarget.hasAttribute('href') ? e.currentTarget.getAttribute('href') : (e.currentTarget.hasAttribute('data-hc-src') ? e.currentTarget.dataset.hcSrc : ''));
|
|
33
36
|
this.options.parentEl = this.options.parentEl !== null ? document.querySelector(this.options.parentEl) : (e.currentTarget.hasAttribute('data-hc-modal-parent') ? document.querySelector(e.currentTarget.getAttribute('data-hc-modal-parent')) : '');
|
|
34
|
-
Fancybox.show([this.options]
|
|
37
|
+
Fancybox.show([this.options], {
|
|
38
|
+
on: {
|
|
39
|
+
reveal: () => {
|
|
40
|
+
document.dispatchEvent(this.showEvent);
|
|
41
|
+
},
|
|
42
|
+
closing: () => {
|
|
43
|
+
document.dispatchEvent(this.hideEvent);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
});
|
|
35
47
|
});
|
|
36
48
|
});
|
|
37
49
|
}
|
|
@@ -48,9 +60,14 @@ export class HcModal {
|
|
|
48
60
|
this.options = {
|
|
49
61
|
src: '',
|
|
50
62
|
type: 'inline',
|
|
51
|
-
parentEl: null
|
|
63
|
+
parentEl: null,
|
|
52
64
|
};
|
|
53
65
|
}
|
|
66
|
+
|
|
67
|
+
createEvent() {
|
|
68
|
+
this.showEvent = new Event("show.hc.modal");
|
|
69
|
+
this.hideEvent = new Event("hide.hc.modal");
|
|
70
|
+
}
|
|
54
71
|
}
|
|
55
72
|
|
|
56
73
|
const hc_modal = function (trigger, options) {
|
|
@@ -61,10 +61,18 @@ export class HcTab {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
createEvent() {
|
|
64
|
-
this.showEvent = new Event("show.hc.
|
|
65
|
-
this.shownEvent = new Event("shown.hc.
|
|
66
|
-
this.hideEvent = new Event("hide.hc.
|
|
67
|
-
this.hiddenEvent = new Event("hidden.hc.
|
|
64
|
+
this.showEvent = new Event("show.hc.tab");
|
|
65
|
+
this.shownEvent = new Event("shown.hc.tab");
|
|
66
|
+
this.hideEvent = new Event("hide.hc.tab");
|
|
67
|
+
this.hiddenEvent = new Event("hidden.hc.tab");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
static show(trigger) {
|
|
71
|
+
var triggerTabList = [].slice.call(document.querySelectorAll(trigger));
|
|
72
|
+
triggerTabList.forEach(function (triggerEl) {
|
|
73
|
+
var tabTrigger = new Tab(triggerEl)
|
|
74
|
+
tabTrigger.show();
|
|
75
|
+
});
|
|
68
76
|
}
|
|
69
77
|
}
|
|
70
78
|
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
flex-direction: $direction;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
/* Hover
|
|
58
|
+
/* Hover
|
|
59
59
|
/* ============================================= */
|
|
60
60
|
@mixin hover {
|
|
61
61
|
&:hover {
|
|
@@ -63,6 +63,22 @@
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
@mixin hover-focus() {
|
|
67
|
+
&:hover,
|
|
68
|
+
&:focus {
|
|
69
|
+
@content;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@mixin hover-focus-active() {
|
|
74
|
+
&:hover,
|
|
75
|
+
&:focus,
|
|
76
|
+
&:active {
|
|
77
|
+
@content;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
|
|
66
82
|
/* Touch
|
|
67
83
|
/* ============================================= */
|
|
68
84
|
@mixin touch {
|
package/public/styles/style.css
CHANGED
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
/* ============================================= */
|
|
43
43
|
/* display flex
|
|
44
44
|
/* ============================================= */
|
|
45
|
-
/* Hover
|
|
45
|
+
/* Hover
|
|
46
46
|
/* ============================================= */
|
|
47
47
|
/* Touch
|
|
48
48
|
/* ============================================= */
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
*/
|
|
55
55
|
/* Transition
|
|
56
56
|
/* ============================================= */
|
|
57
|
-
/*
|
|
57
|
+
/* Animate
|
|
58
58
|
/* ============================================= */
|
|
59
59
|
/* Ellipsis
|
|
60
60
|
/* ============================================= */
|