@iris.interactive/handcook 2.6.0 → 2.6.1
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/mix-manifest.json +1 -13
- package/package.json +1 -1
- package/public/scripts/components/collapse/collapse.component.js +76 -1
- package/public/scripts/components/collapse/collapse.component.scss +19 -0
- package/public/scripts/components/dropdown/dropdown.component.js +72 -1
- package/public/scripts/components/dropdown/dropdown.component.scss +48 -0
- package/public/scripts/components/lazyload/lazyload.component.js +28 -1
- package/public/scripts/components/lightbox/lightbox.component.js +36 -1
- package/public/scripts/components/modal/modal.component.js +46 -1
- package/public/scripts/components/modal/modal.component.scss +20 -0
- package/public/scripts/components/slider/slider.component.js +156 -1
- package/public/scripts/components/smooth-scroll/smooth-scroll.component.js +65 -1
- package/public/scripts/components/tab/tab.component.js +73 -1
- package/public/scripts/components/tab/tab.component.scss +23 -0
- package/public/scripts/components/toggle/toggle.component.js +51 -1
- package/public/scripts/components/tooltip/tooltip.component.js +102 -1
- package/public/scripts/enumerators/element.enum.js +28 -1
- package/public/scripts/enumerators/tooltip.enum.js +21 -1
- package/public/scripts/handcook.js +39 -1
- package/public/scripts/index.js +22316 -1
- package/public/styles/scss/style.css +161 -2
- package/public/styles/style.css +166 -1
|
@@ -1 +1,73 @@
|
|
|
1
|
-
(()=>{"use strict";var e={812:(e,t,n)=>{function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)};r(o,"tooltip","[data-hc-tooltip], [data-hc-popover]"),r(o,"popover","[data-hc-popover]"),r(o,"scrollSmooth","data-hc-smooth-scroll"),r(o,"modal","[data-hc-modal]"),r(o,"lightbox","[data-hc-lightbox]"),r(o,"dropdown","[data-hc-dropdown]"),r(o,"collapse","[data-hc-collapse]"),r(o,"collapseItem","[data-hc-collapse-item]"),r(o,"tab","[data-hc-tab]"),r(o,"toggle","[data-hc-toggle]"),r(o,"slider","[data-hc-slider]")},49:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(385),o=n(147),a=n(930);const i=class{constructor(e){(e=(0,o.sb)(e))&&(this._element=e,r.Z.set(this._element,this.constructor.DATA_KEY,this))}dispose(){r.Z.remove(this._element,this.constructor.DATA_KEY),a.Z.off(this._element,this.constructor.EVENT_KEY),Object.getOwnPropertyNames(this).forEach((e=>{this[e]=null}))}_queueCallback(e,t,n=!0){(0,o.e0)(e,t,n)}static getInstance(e){return r.Z.get((0,o.sb)(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return"5.1.3"}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}}},385:(e,t,n)=>{n.d(t,{Z:()=>o});const r=new Map,o={set(e,t,n){r.has(e)||r.set(e,new Map);const o=r.get(e);o.has(t)||0===o.size?o.set(t,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(o.keys())[0]}.`)},get:(e,t)=>r.has(e)&&r.get(e).get(t)||null,remove(e,t){if(!r.has(e))return;const n=r.get(e);n.delete(t),0===n.size&&r.delete(e)}}},930:(e,t,n)=>{n.d(t,{Z:()=>E});var r=n(147);const o=/[^.]*(?=\..*)\.|.*/,a=/\..*/,i=/::\d+$/,s={};let c=1;const l={mouseenter:"mouseover",mouseleave:"mouseout"},u=/^(mouseenter|mouseleave)/i,d=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function f(e,t){return t&&`${t}::${c++}`||e.uidEvent||c++}function p(e){const t=f(e);return e.uidEvent=t,s[t]=s[t]||{},s[t]}function h(e,t,n=null){const r=Object.keys(e);for(let o=0,a=r.length;o<a;o++){const a=e[r[o]];if(a.originalHandler===t&&a.delegationSelector===n)return a}return null}function m(e,t,n){const r="string"==typeof t,o=r?n:t;let a=b(e);return d.has(a)||(a=e),[r,o,a]}function g(e,t,n,r,a){if("string"!=typeof t||!e)return;if(n||(n=r,r=null),u.test(t)){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};r?r=e(r):n=e(n)}const[i,s,c]=m(t,n,r),l=p(e),d=l[c]||(l[c]={}),g=h(d,s,i?n:null);if(g)return void(g.oneOff=g.oneOff&&a);const v=f(s,t.replace(o,"")),b=i?function(e,t,n){return function r(o){const a=e.querySelectorAll(t);for(let{target:i}=o;i&&i!==this;i=i.parentNode)for(let s=a.length;s--;)if(a[s]===i)return o.delegateTarget=i,r.oneOff&&y.off(e,o.type,t,n),n.apply(i,[o]);return null}}(e,n,r):function(e,t){return function n(r){return r.delegateTarget=e,n.oneOff&&y.off(e,r.type,t),t.apply(e,[r])}}(e,n);b.delegationSelector=i?n:null,b.originalHandler=s,b.oneOff=a,b.uidEvent=v,d[v]=b,e.addEventListener(c,b,i)}function v(e,t,n,r,o){const a=h(t[n],r,o);a&&(e.removeEventListener(n,a,Boolean(o)),delete t[n][a.uidEvent])}function b(e){return e=e.replace(a,""),l[e]||e}const y={on(e,t,n,r){g(e,t,n,r,!1)},one(e,t,n,r){g(e,t,n,r,!0)},off(e,t,n,r){if("string"!=typeof t||!e)return;const[o,a,s]=m(t,n,r),c=s!==t,l=p(e),u=t.startsWith(".");if(void 0!==a){if(!l||!l[s])return;return void v(e,l,s,a,o?n:null)}u&&Object.keys(l).forEach((n=>{!function(e,t,n,r){const o=t[n]||{};Object.keys(o).forEach((a=>{if(a.includes(r)){const r=o[a];v(e,t,n,r.originalHandler,r.delegationSelector)}}))}(e,l,n,t.slice(1))}));const d=l[s]||{};Object.keys(d).forEach((n=>{const r=n.replace(i,"");if(!c||t.includes(r)){const t=d[n];v(e,l,s,t.originalHandler,t.delegationSelector)}}))},trigger(e,t,n){if("string"!=typeof t||!e)return null;const o=(0,r.KF)(),a=b(t),i=t!==a,s=d.has(a);let c,l=!0,u=!0,f=!1,p=null;return i&&o&&(c=o.Event(t,n),o(e).trigger(c),l=!c.isPropagationStopped(),u=!c.isImmediatePropagationStopped(),f=c.isDefaultPrevented()),s?(p=document.createEvent("HTMLEvents"),p.initEvent(a,l,!0)):p=new CustomEvent(t,{bubbles:l,cancelable:!0}),void 0!==n&&Object.keys(n).forEach((e=>{Object.defineProperty(p,e,{get:()=>n[e]})})),f&&p.preventDefault(),u&&e.dispatchEvent(p),p.defaultPrevented&&void 0!==c&&c.preventDefault(),p}},E=y},357:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(147);const o={find:(e,t=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(t,e)),findOne:(e,t=document.documentElement)=>Element.prototype.querySelector.call(t,e),children:(e,t)=>[].concat(...e.children).filter((e=>e.matches(t))),parents(e,t){const n=[];let r=e.parentNode;for(;r&&r.nodeType===Node.ELEMENT_NODE&&3!==r.nodeType;)r.matches(t)&&n.push(r),r=r.parentNode;return n},prev(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return[n];n=n.previousElementSibling}return[]},next(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return[n];n=n.nextElementSibling}return[]},focusableChildren(e){const t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((e=>`${e}:not([tabindex^="-"])`)).join(", ");return this.find(t,e).filter((e=>!(0,r.pK)(e)&&(0,r.pn)(e)))}}},147:(e,t,n)=>{n.d(t,{sb:()=>s,dG:()=>a,pn:()=>c,pK:()=>l,nq:()=>u,KF:()=>d,pF:()=>p,e0:()=>m});const r="transitionend",o=e=>{let t=e.getAttribute("data-bs-target");if(!t||"#"===t){let n=e.getAttribute("href");if(!n||!n.includes("#")&&!n.startsWith("."))return null;n.includes("#")&&!n.startsWith("#")&&(n=`#${n.split("#")[1]}`),t=n&&"#"!==n?n.trim():null}return t},a=e=>{const t=o(e);return t?document.querySelector(t):null},i=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),s=e=>i(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(e):null,c=e=>!(!i(e)||0===e.getClientRects().length)&&"visible"===getComputedStyle(e).getPropertyValue("visibility"),l=e=>!e||e.nodeType!==Node.ELEMENT_NODE||(!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled"))),u=e=>{e.offsetHeight},d=()=>{const{jQuery:e}=window;return e&&!document.body.hasAttribute("data-bs-no-jquery")?e:null},f=[],p=e=>{var t;t=()=>{const t=d();if(t){const n=e.NAME,r=t.fn[n];t.fn[n]=e.jQueryInterface,t.fn[n].Constructor=e,t.fn[n].noConflict=()=>(t.fn[n]=r,e.jQueryInterface)}},"loading"===document.readyState?(f.length||document.addEventListener("DOMContentLoaded",(()=>{f.forEach((e=>e()))})),f.push(t)):t()},h=e=>{"function"==typeof e&&e()},m=(e,t,n=!0)=>{if(!n)return void h(e);const o=(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:n}=window.getComputedStyle(e);const r=Number.parseFloat(t),o=Number.parseFloat(n);return r||o?(t=t.split(",")[0],n=n.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(n))):0})(t)+5;let a=!1;const i=({target:n})=>{n===t&&(a=!0,t.removeEventListener(r,i),h(e))};t.addEventListener(r,i),setTimeout((()=>{a||t.dispatchEvent(new Event(r))}),o)}},668:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,"/*!\n * IRIS Interactive\n *\n * NOTICE OF LICENSE\n *\n * This source file is no subject to a specific license\n * but it belongs to the company IRIS Interactive.\n * You can contact IRIS Interactive at the following\n * address: contact@iris-interactive.fr\n *\n * @author Lucas ROCHE\n * @date 22/02/2022 14:57\n * @copyright Copyright (c) 2002-2022 IRIS Interactive, Inc. (http://www.iris-interactive.fr)\n */[data-hc-tab-content]>[data-hc-tab-pane]{display:none}[data-hc-tab-content]>.active{display:block}",""]);const a=o},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var a=0;a<this.length;a++){var i=this[a][0];null!=i&&(o[i]=!0)}for(var s=0;s<e.length;s++){var c=[].concat(e[s]);r&&o[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),t.push(c))}},t}},379:(e,t,n)=>{var r,o=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},a=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),i=[];function s(e){for(var t=-1,n=0;n<i.length;n++)if(i[n].identifier===e){t=n;break}return t}function c(e,t){for(var n={},r=[],o=0;o<e.length;o++){var a=e[o],c=t.base?a[0]+t.base:a[0],l=n[c]||0,u="".concat(c," ").concat(l);n[c]=l+1;var d=s(u),f={css:a[1],media:a[2],sourceMap:a[3]};-1!==d?(i[d].references++,i[d].updater(f)):i.push({identifier:u,updater:g(f,t),references:1}),r.push(u)}return r}function l(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var o=n.nc;o&&(r.nonce=o)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var i=a(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(t)}return t}var u,d=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function f(e,t,n,r){var o=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=d(t,o);else{var a=document.createTextNode(o),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(a,i[t]):e.appendChild(a)}}function p(e,t,n){var r=n.css,o=n.media,a=n.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var h=null,m=0;function g(e,t){var n,r,o;if(t.singleton){var a=m++;n=h||(h=l(t)),r=f.bind(null,n,a,!1),o=f.bind(null,n,a,!0)}else n=l(t),r=p.bind(null,n,t),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=o());var n=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var o=s(n[r]);i[o].references--}for(var a=c(e,t),l=0;l<n.length;l++){var u=s(n[l]);0===i[u].references&&(i[u].updater(),i.splice(u,1))}n=a}}}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={id:r,exports:{}};return e[r](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{n(812);var e=n(379),t=n.n(e),r=n(668),o={insert:"head",singleton:!1};t()(r.Z,o);r.Z.locals;var a=n(147),i=n(930),s=n(357),c=n(49);const l="active",u="fade",d="show",f=".active",p=":scope > li > .active";class h extends c.Z{static get NAME(){return"tab"}show(){if(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&this._element.classList.contains(l))return;let e;const t=(0,a.dG)(this._element),n=this._element.closest(".nav, .list-group");if(n){const t="UL"===n.nodeName||"OL"===n.nodeName?p:f;e=s.Z.find(t,n),e=e[e.length-1]}const r=e?i.Z.trigger(e,"hide.bs.tab",{relatedTarget:this._element}):null;if(i.Z.trigger(this._element,"show.bs.tab",{relatedTarget:e}).defaultPrevented||null!==r&&r.defaultPrevented)return;this._activate(this._element,n);const o=()=>{i.Z.trigger(e,"hidden.bs.tab",{relatedTarget:this._element}),i.Z.trigger(this._element,"shown.bs.tab",{relatedTarget:e})};t?this._activate(t,t.parentNode,o):o()}_activate(e,t,n){const r=(!t||"UL"!==t.nodeName&&"OL"!==t.nodeName?s.Z.children(t,f):s.Z.find(p,t))[0],o=n&&r&&r.classList.contains(u),a=()=>this._transitionComplete(e,r,n);r&&o?(r.classList.remove(d),this._queueCallback(a,e,!0)):a()}_transitionComplete(e,t,n){if(t){t.classList.remove(l);const e=s.Z.findOne(":scope > .dropdown-menu .active",t.parentNode);e&&e.classList.remove(l),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!1)}e.classList.add(l),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!0),(0,a.nq)(e),e.classList.contains(u)&&e.classList.add(d);let r=e.parentNode;if(r&&"LI"===r.nodeName&&(r=r.parentNode),r&&r.classList.contains("dropdown-menu")){const t=e.closest(".dropdown");t&&s.Z.find(".dropdown-toggle",t).forEach((e=>e.classList.add(l))),e.setAttribute("aria-expanded",!0)}n&&n()}static jQueryInterface(e){return this.each((function(){const t=h.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}}))}}i.Z.on(document,"click.bs.tab.data-api",'[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',(function(e){if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),(0,a.pK)(this))return;h.getOrCreateInstance(this).show()})),(0,a.pF)(h)})()})();
|
|
1
|
+
/*
|
|
2
|
+
* IRIS Interactive
|
|
3
|
+
*
|
|
4
|
+
* NOTICE OF LICENSE
|
|
5
|
+
*
|
|
6
|
+
* This source file is no subject to a specific license
|
|
7
|
+
* but it belongs to the company IRIS Interactive.
|
|
8
|
+
* You can contact IRIS Interactive at the following
|
|
9
|
+
* address: contact@iris-interactive.fr
|
|
10
|
+
*
|
|
11
|
+
* @author Lucas ROCHE
|
|
12
|
+
* @date 22/02/2022 14:34
|
|
13
|
+
* @copyright Copyright (c) 2002-2022 IRIS Interactive, Inc. (http://www.iris-interactive.fr)
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import ElementEnum from "../../enumerators/element.enum";
|
|
17
|
+
import "./tab.component.scss";
|
|
18
|
+
import Tab from "bootstrap/js/src/tab";
|
|
19
|
+
|
|
20
|
+
export class HcTab {
|
|
21
|
+
|
|
22
|
+
showEvent;
|
|
23
|
+
shownEvent;
|
|
24
|
+
hideEvent;
|
|
25
|
+
hiddenEvent;
|
|
26
|
+
|
|
27
|
+
constructor(elements = ElementEnum.tab) {
|
|
28
|
+
this.buildDOM();
|
|
29
|
+
const triggerTabList = [].slice.call(document.querySelectorAll(elements))
|
|
30
|
+
triggerTabList.forEach(function (triggerEl) {
|
|
31
|
+
const tabTrigger = new Tab(triggerEl);
|
|
32
|
+
|
|
33
|
+
triggerEl.addEventListener('click', function (event) {
|
|
34
|
+
event.preventDefault()
|
|
35
|
+
tabTrigger.show()
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
document.querySelectorAll(elements).forEach(trigger => {
|
|
39
|
+
trigger.addEventListener('hide.bs.tab', (e) => {
|
|
40
|
+
trigger.dispatchEvent(this.hideEvent);
|
|
41
|
+
});
|
|
42
|
+
trigger.addEventListener('show.bs.tab', (e) => {
|
|
43
|
+
trigger.dispatchEvent(this.showEvent);
|
|
44
|
+
});
|
|
45
|
+
trigger.addEventListener('shown.bs.tab', (e) => {
|
|
46
|
+
trigger.dispatchEvent(this.shownEvent);
|
|
47
|
+
});
|
|
48
|
+
trigger.addEventListener('hidden.bs.tab', (e) => {
|
|
49
|
+
trigger.dispatchEvent(this.hiddenEvent);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
buildDOM() {
|
|
55
|
+
document.querySelectorAll("[data-hc-tab-wrapper]").forEach(wrapper => {
|
|
56
|
+
if (!wrapper.classList.contains("nav")) {
|
|
57
|
+
wrapper.classList.add("nav")
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
createEvent() {
|
|
63
|
+
this.showEvent = new Event("show.hc.collapse");
|
|
64
|
+
this.shownEvent = new Event("shown.hc.collapse");
|
|
65
|
+
this.hideEvent = new Event("hide.hc.collapse");
|
|
66
|
+
this.hiddenEvent = new Event("hidden.hc.collapse");
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const hc_tab = function (trigger) {
|
|
71
|
+
return new HcTab(trigger);
|
|
72
|
+
}
|
|
73
|
+
export default hc_tab;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* IRIS Interactive
|
|
3
|
+
*
|
|
4
|
+
* NOTICE OF LICENSE
|
|
5
|
+
*
|
|
6
|
+
* This source file is no subject to a specific license
|
|
7
|
+
* but it belongs to the company IRIS Interactive.
|
|
8
|
+
* You can contact IRIS Interactive at the following
|
|
9
|
+
* address: contact@iris-interactive.fr
|
|
10
|
+
*
|
|
11
|
+
* @author Lucas ROCHE
|
|
12
|
+
* @date 22/02/2022 14:57
|
|
13
|
+
* @copyright Copyright (c) 2002-2022 IRIS Interactive, Inc. (http://www.iris-interactive.fr)
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
[data-hc-tab-content] {
|
|
17
|
+
> [data-hc-tab-pane] {
|
|
18
|
+
display: none;
|
|
19
|
+
}
|
|
20
|
+
> .active {
|
|
21
|
+
display: block;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1 +1,51 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* IRIS Interactive
|
|
3
|
+
*
|
|
4
|
+
* NOTICE OF LICENSE
|
|
5
|
+
*
|
|
6
|
+
* This source file is no subject to a specific license
|
|
7
|
+
* but it belongs to the company IRIS Interactive.
|
|
8
|
+
* You can contact IRIS Interactive at the following
|
|
9
|
+
* address: contact@iris-interactive.fr
|
|
10
|
+
*
|
|
11
|
+
* @author Lucas ROCHE
|
|
12
|
+
* @date 22/02/2022 16:50
|
|
13
|
+
* @copyright Copyright (c) 2002-2022 IRIS Interactive, Inc. (http://www.iris-interactive.fr)
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
import ElementEnum from "../../enumerators/element.enum";
|
|
18
|
+
|
|
19
|
+
export class HcToggle {
|
|
20
|
+
|
|
21
|
+
constructor(elements = ElementEnum.toggle) {
|
|
22
|
+
document.querySelectorAll(elements).forEach(element => {
|
|
23
|
+
element.addEventListener('click', (e) => {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
const attribute = e.currentTarget.dataset.hcToggleAttribute;
|
|
26
|
+
const value = e.currentTarget.dataset.hcToggleValue;
|
|
27
|
+
const targets = e.currentTarget.getAttribute("href") ? e.currentTarget.getAttribute("href") : e.currentTarget.dataset.hcToggleTarget;
|
|
28
|
+
document.querySelectorAll(targets).forEach(target => {
|
|
29
|
+
if(target.getAttribute(attribute) === value) {
|
|
30
|
+
if(attribute === "class"){
|
|
31
|
+
target.classList.remove(value);
|
|
32
|
+
} else {
|
|
33
|
+
target.removeAttribute(attribute);
|
|
34
|
+
}
|
|
35
|
+
} else {
|
|
36
|
+
if(attribute === "class"){
|
|
37
|
+
target.classList.add(value);
|
|
38
|
+
} else {
|
|
39
|
+
target.setAttribute(attribute, value);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const hc_toggle = function (trigger) {
|
|
49
|
+
return new HcToggle(trigger);
|
|
50
|
+
}
|
|
51
|
+
export default hc_toggle;
|
|
@@ -1 +1,102 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* IRIS Interactive
|
|
3
|
+
*
|
|
4
|
+
* NOTICE OF LICENSE
|
|
5
|
+
*
|
|
6
|
+
* This source file is no subject to a specific license
|
|
7
|
+
* but it belongs to the company IRIS Interactive.
|
|
8
|
+
* You can contact IRIS Interactive at the following
|
|
9
|
+
* address: contact@iris-interactive.fr
|
|
10
|
+
*
|
|
11
|
+
* @author Lucas ROCHE
|
|
12
|
+
* @date 28/01/2022 14:52
|
|
13
|
+
* @copyright Copyright (c) 2002-2022 IRIS Interactive, Inc. (http://www.iris-interactive.fr)
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
import tippy from "tippy.js";
|
|
18
|
+
import "tippy.js/dist/tippy.css"
|
|
19
|
+
import ElementEnum from "../../enumerators/element.enum";
|
|
20
|
+
import TooltipEnum from "../../enumerators/tooltip.enum";
|
|
21
|
+
|
|
22
|
+
export class HcTooltip {
|
|
23
|
+
|
|
24
|
+
showEvent;
|
|
25
|
+
shownEvent;
|
|
26
|
+
hideEvent;
|
|
27
|
+
hiddenEvent;
|
|
28
|
+
|
|
29
|
+
instances = [];
|
|
30
|
+
defaultOptions = {
|
|
31
|
+
placement: '',
|
|
32
|
+
content: '',
|
|
33
|
+
trigger: '',
|
|
34
|
+
allowHTML: true
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
constructor(elements = ElementEnum.tooltip, overrideOptions = {}) {
|
|
38
|
+
this.createEvent();
|
|
39
|
+
document.querySelectorAll(elements).forEach(element => {
|
|
40
|
+
let options = {};
|
|
41
|
+
Object.assign(options, this.defaultOptions, overrideOptions);
|
|
42
|
+
options.trigger = options.trigger != '' ? options.trigger : (element.hasAttribute(TooltipEnum.attrPopover) ? "click" : "mouseenter focus");
|
|
43
|
+
options.content = options.content != '' ? options.content : (element.hasAttribute(TooltipEnum.attrContent) ? element.getAttribute(TooltipEnum.attrContent) : '');
|
|
44
|
+
options.placement = options.placement != '' ? options.placement : (element.hasAttribute(TooltipEnum.attrPlacement) ? element.getAttribute(TooltipEnum.attrPlacement) : '');
|
|
45
|
+
if (options.trigger === 'click') {
|
|
46
|
+
element.addEventListener('click', (e) => {
|
|
47
|
+
e.preventDefault();
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
options.onShow = (instance) => {
|
|
51
|
+
instance.reference.dispatchEvent(this.showEvent);
|
|
52
|
+
}
|
|
53
|
+
options.onShown = (instance) => {
|
|
54
|
+
instance.reference.dispatchEvent(this.shownEvent);
|
|
55
|
+
}
|
|
56
|
+
options.onHide = (instance) => {
|
|
57
|
+
instance.reference.dispatchEvent(this.hideEvent);
|
|
58
|
+
}
|
|
59
|
+
options.onHidden = (instance) => {
|
|
60
|
+
instance.reference.dispatchEvent(this.hiddenEvent);
|
|
61
|
+
}
|
|
62
|
+
const instance = tippy(element, options);
|
|
63
|
+
this.instances.push(instance);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
createEvent() {
|
|
68
|
+
this.showEvent = new Event('show.hc.tooltip');
|
|
69
|
+
this.shownEvent = new Event('shown.hc.tooltip');
|
|
70
|
+
this.hideEvent = new Event('hide.hc.tooltip');
|
|
71
|
+
this.hiddenEvent = new Event('hidden.hc.tooltip');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
show() {
|
|
75
|
+
this.instances.forEach(instance => {
|
|
76
|
+
instance.show();
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
hide() {
|
|
81
|
+
this.instances.forEach(instance => {
|
|
82
|
+
instance.hide();
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
disable() {
|
|
87
|
+
this.instances.forEach(instance => {
|
|
88
|
+
instance.disable();
|
|
89
|
+
})
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
enable() {
|
|
93
|
+
this.instances.forEach(instance => {
|
|
94
|
+
instance.enable();
|
|
95
|
+
})
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const hc_tooltip = function (trigger, options) {
|
|
100
|
+
return new HcTooltip(trigger, options);
|
|
101
|
+
}
|
|
102
|
+
export default hc_tooltip;
|
|
@@ -1 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* IRIS Interactive
|
|
3
|
+
*
|
|
4
|
+
* NOTICE OF LICENSE
|
|
5
|
+
*
|
|
6
|
+
* This source file is no subject to a specific license
|
|
7
|
+
* but it belongs to the company IRIS Interactive.
|
|
8
|
+
* You can contact IRIS Interactive at the following
|
|
9
|
+
* address: contact@iris-interactive.fr
|
|
10
|
+
*
|
|
11
|
+
* @author Lucas ROCHE
|
|
12
|
+
* @date 01/02/2022 10:36
|
|
13
|
+
* @copyright Copyright (c) 2002-2022 IRIS Interactive, Inc. (http://www.iris-interactive.fr)
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
export default class ElementEnum {
|
|
17
|
+
static tooltip = '[data-hc-tooltip], [data-hc-popover]';
|
|
18
|
+
static popover = '[data-hc-popover]';
|
|
19
|
+
static scrollSmooth = 'data-hc-smooth-scroll';
|
|
20
|
+
static modal = '[data-hc-modal]';
|
|
21
|
+
static lightbox = '[data-hc-lightbox]';
|
|
22
|
+
static dropdown = '[data-hc-dropdown]';
|
|
23
|
+
static collapse = '[data-hc-collapse]';
|
|
24
|
+
static collapseItem = '[data-hc-collapse-item]';
|
|
25
|
+
static tab = '[data-hc-tab]';
|
|
26
|
+
static toggle = '[data-hc-toggle]';
|
|
27
|
+
static slider = '[data-hc-slider]';
|
|
28
|
+
}
|
|
@@ -1 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* IRIS Interactive
|
|
3
|
+
*
|
|
4
|
+
* NOTICE OF LICENSE
|
|
5
|
+
*
|
|
6
|
+
* This source file is no subject to a specific license
|
|
7
|
+
* but it belongs to the company IRIS Interactive.
|
|
8
|
+
* You can contact IRIS Interactive at the following
|
|
9
|
+
* address: contact@iris-interactive.fr
|
|
10
|
+
*
|
|
11
|
+
* @author Lucas ROCHE
|
|
12
|
+
* @date 01/02/2022 10:40
|
|
13
|
+
* @copyright Copyright (c) 2002-2022 IRIS Interactive, Inc. (http://www.iris-interactive.fr)
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
export default class TooltipEnum {
|
|
18
|
+
static attrPopover = "data-hc-popover";
|
|
19
|
+
static attrContent = "data-hc-tooltip-content";
|
|
20
|
+
static attrPlacement = "data-hc-tooltip-placement";
|
|
21
|
+
}
|