@iris.interactive/handcook 2.5.1 → 2.6.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/mix-manifest.json +15 -0
- package/package.json +3 -3
- package/public/index.html +14 -14
- package/public/scripts/components/collapse/collapse.component.js +1 -66
- package/public/scripts/components/dropdown/dropdown.component.js +1 -45
- package/public/scripts/components/lazyload/lazyload.component.js +1 -26
- package/public/scripts/components/lightbox/lightbox.component.js +1 -32
- package/public/scripts/components/modal/modal.component.js +1 -45
- package/public/scripts/components/slider/slider.component.js +1 -123
- package/public/scripts/components/smooth-scroll/smooth-scroll.component.js +1 -64
- package/public/scripts/components/tab/tab.component.js +1 -46
- package/public/scripts/components/toggle/toggle.component.js +1 -50
- package/public/scripts/components/tooltip/tooltip.component.js +1 -75
- package/public/scripts/enumerators/element.enum.js +1 -28
- package/public/scripts/enumerators/tooltip.enum.js +1 -21
- package/public/scripts/handcook.js +1 -0
- package/public/scripts/index.js +1 -22147
- package/public/styles/scss/handcook.scss +1 -1
- package/public/styles/scss/style.css +2 -161
- package/public/styles/style.css +1 -166
- package/public/scripts/components/collapse/collapse.component.css +0 -50
- package/public/scripts/components/collapse/collapse.component.scss +0 -19
- package/public/scripts/components/modal/modal.component.css +0 -18
- package/public/scripts/components/modal/modal.component.scss +0 -20
- package/public/scripts/components/tab/tab.component.css +0 -20
- package/public/scripts/components/tab/tab.component.scss +0 -23
|
@@ -1,46 +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 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.css";
|
|
18
|
-
import Tab from "bootstrap/js/src/tab";
|
|
19
|
-
|
|
20
|
-
class HcTab {
|
|
21
|
-
|
|
22
|
-
constructor(elements = ElementEnum.tab) {
|
|
23
|
-
this.buildDOM();
|
|
24
|
-
const triggerTabList = [].slice.call(document.querySelectorAll(elements))
|
|
25
|
-
triggerTabList.forEach(function (triggerEl) {
|
|
26
|
-
const tabTrigger = new Tab(triggerEl);
|
|
27
|
-
|
|
28
|
-
triggerEl.addEventListener('click', function (event) {
|
|
29
|
-
event.preventDefault()
|
|
30
|
-
tabTrigger.show()
|
|
31
|
-
})
|
|
32
|
-
})
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
buildDOM() {
|
|
36
|
-
document.querySelectorAll("[data-hc-tab-wrapper]").forEach(wrapper => {
|
|
37
|
-
if (!wrapper.classList.contains("nav")) {
|
|
38
|
-
wrapper.classList.add("nav")
|
|
39
|
-
}
|
|
40
|
-
})
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export const hc_tab = function (trigger) {
|
|
45
|
-
return new HcTab(trigger);
|
|
46
|
-
}
|
|
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,50 +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
|
-
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
|
-
export const hc_toggle = function (trigger) {
|
|
49
|
-
return new HcToggle(trigger);
|
|
50
|
-
}
|
|
1
|
+
(()=>{"use strict";var o={812:(o,t,a)=>{function e(o,t,a){return t in o?Object.defineProperty(o,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[t]=a,o}var r=function o(){!function(o,t){if(!(o instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o)};e(r,"tooltip","[data-hc-tooltip], [data-hc-popover]"),e(r,"popover","[data-hc-popover]"),e(r,"scrollSmooth","data-hc-smooth-scroll"),e(r,"modal","[data-hc-modal]"),e(r,"lightbox","[data-hc-lightbox]"),e(r,"dropdown","[data-hc-dropdown]"),e(r,"collapse","[data-hc-collapse]"),e(r,"collapseItem","[data-hc-collapse-item]"),e(r,"tab","[data-hc-tab]"),e(r,"toggle","[data-hc-toggle]"),e(r,"slider","[data-hc-slider]")}},t={};function a(e){var r=t[e];if(void 0!==r)return r.exports;var c=t[e]={exports:{}};return o[e](c,c.exports,a),c.exports}a.d=(o,t)=>{for(var e in t)a.o(t,e)&&!a.o(o,e)&&Object.defineProperty(o,e,{enumerable:!0,get:t[e]})},a.o=(o,t)=>Object.prototype.hasOwnProperty.call(o,t),a(812)})();
|
|
@@ -1,75 +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
|
-
class HcTooltip {
|
|
23
|
-
|
|
24
|
-
instances = [];
|
|
25
|
-
defaultOptions = {
|
|
26
|
-
placement: '',
|
|
27
|
-
content: '',
|
|
28
|
-
trigger: ''
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
constructor(elements = ElementEnum.tooltip, overrideOptions = {}) {
|
|
32
|
-
document.querySelectorAll(elements).forEach(element => {
|
|
33
|
-
let options = {};
|
|
34
|
-
Object.assign(options, this.defaultOptions, overrideOptions);
|
|
35
|
-
options.trigger = options.trigger != '' ? options.trigger : (element.hasAttribute(TooltipEnum.attrPopover) ? "click" : "mouseenter focus");
|
|
36
|
-
options.content = options.content != '' ? options.content : (element.hasAttribute(TooltipEnum.attrContent) ? element.getAttribute(TooltipEnum.attrContent) : '');
|
|
37
|
-
options.placement = options.placement != '' ? options.placement : (element.hasAttribute(TooltipEnum.attrPlacement) ? element.getAttribute(TooltipEnum.attrPlacement) : '');
|
|
38
|
-
if (options.trigger === 'click') {
|
|
39
|
-
element.addEventListener('click', (e) => {
|
|
40
|
-
e.preventDefault();
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
const instance = tippy(element, options);
|
|
44
|
-
this.instances.push(instance);
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
show() {
|
|
49
|
-
this.instances.forEach(instance => {
|
|
50
|
-
instance.show();
|
|
51
|
-
})
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
hide() {
|
|
55
|
-
this.instances.forEach(instance => {
|
|
56
|
-
instance.hide();
|
|
57
|
-
})
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
disable() {
|
|
61
|
-
this.instances.forEach(instance => {
|
|
62
|
-
instance.disable();
|
|
63
|
-
})
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
enable() {
|
|
67
|
-
this.instances.forEach(instance => {
|
|
68
|
-
instance.enable();
|
|
69
|
-
})
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export const hc_tooltip = function (trigger, options) {
|
|
74
|
-
return new HcTooltip(trigger, options);
|
|
75
|
-
};
|
|
1
|
+
(()=>{"use strict";var t={812:(t,e,o)=>{function r(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}var n=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)};r(n,"tooltip","[data-hc-tooltip], [data-hc-popover]"),r(n,"popover","[data-hc-popover]"),r(n,"scrollSmooth","data-hc-smooth-scroll"),r(n,"modal","[data-hc-modal]"),r(n,"lightbox","[data-hc-lightbox]"),r(n,"dropdown","[data-hc-dropdown]"),r(n,"collapse","[data-hc-collapse]"),r(n,"collapseItem","[data-hc-collapse-item]"),r(n,"tab","[data-hc-tab]"),r(n,"toggle","[data-hc-toggle]"),r(n,"slider","[data-hc-slider]")},484:(t,e,o)=>{function r(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}var n=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)};r(n,"attrPopover","data-hc-popover"),r(n,"attrContent","data-hc-tooltip-content"),r(n,"attrPlacement","data-hc-tooltip-placement")},95:(t,e,o)=>{o.d(e,{Z:()=>a});var r=o(645),n=o.n(r)()((function(t){return t[1]}));n.push([t.id,'.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{background-color:#333;border-radius:4px;color:#fff;font-size:14px;line-height:1.4;outline:0;position:relative;transition-property:transform,visibility,opacity;white-space:normal}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{border-top-color:initial;border-width:8px 8px 0;bottom:-7px;left:0;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:initial;border-width:0 8px 8px;left:0;top:-7px;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-left-color:initial;border-width:8px 0 8px 8px;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{border-right-color:initial;border-width:8px 8px 8px 0;left:-7px;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{color:#333;height:16px;width:16px}.tippy-arrow:before{border-color:transparent;border-style:solid;content:"";position:absolute}.tippy-content{padding:5px 9px;position:relative;z-index:1}',""]);const a=n},645:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var o=t(e);return e[2]?"@media ".concat(e[2]," {").concat(o,"}"):o})).join("")},e.i=function(t,o,r){"string"==typeof t&&(t=[[null,t,""]]);var n={};if(r)for(var a=0;a<this.length;a++){var i=this[a][0];null!=i&&(n[i]=!0)}for(var c=0;c<t.length;c++){var p=[].concat(t[c]);r&&n[p[0]]||(o&&(p[2]?p[2]="".concat(o," and ").concat(p[2]):p[2]=o),e.push(p))}},e}},514:(t,e,o)=>{var r=o(379),n=o.n(r),a=o(95),i={insert:"head",singleton:!1};n()(a.Z,i),a.Z.locals},379:(t,e,o)=>{var r,n=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},a=function(){var t={};return function(e){if(void 0===t[e]){var o=document.querySelector(e);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(t){o=null}t[e]=o}return t[e]}}(),i=[];function c(t){for(var e=-1,o=0;o<i.length;o++)if(i[o].identifier===t){e=o;break}return e}function p(t,e){for(var o={},r=[],n=0;n<t.length;n++){var a=t[n],p=e.base?a[0]+e.base:a[0],l=o[p]||0,d="".concat(p," ").concat(l);o[p]=l+1;var s=c(d),f={css:a[1],media:a[2],sourceMap:a[3]};-1!==s?(i[s].references++,i[s].updater(f)):i.push({identifier:d,updater:m(f,e),references:1}),r.push(d)}return r}function l(t){var e=document.createElement("style"),r=t.attributes||{};if(void 0===r.nonce){var n=o.nc;n&&(r.nonce=n)}if(Object.keys(r).forEach((function(t){e.setAttribute(t,r[t])})),"function"==typeof t.insert)t.insert(e);else{var i=a(t.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(e)}return e}var d,s=(d=[],function(t,e){return d[t]=e,d.filter(Boolean).join("\n")});function f(t,e,o,r){var n=o?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(t.styleSheet)t.styleSheet.cssText=s(e,n);else{var a=document.createTextNode(n),i=t.childNodes;i[e]&&t.removeChild(i[e]),i.length?t.insertBefore(a,i[e]):t.appendChild(a)}}function u(t,e,o){var r=o.css,n=o.media,a=o.sourceMap;if(n?t.setAttribute("media",n):t.removeAttribute("media"),a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}var h=null,b=0;function m(t,e){var o,r,n;if(e.singleton){var a=b++;o=h||(h=l(e)),r=f.bind(null,o,a,!1),n=f.bind(null,o,a,!0)}else o=l(e),r=u.bind(null,o,e),n=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(o)};return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else n()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=n());var o=p(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var r=0;r<o.length;r++){var n=c(o[r]);i[n].references--}for(var a=p(t,e),l=0;l<o.length;l++){var d=c(o[l]);0===i[d].references&&(i[d].updater(),i.splice(d,1))}o=a}}}}},e={};function o(r){var n=e[r];if(void 0!==n)return n.exports;var a=e[r]={id:r,exports:{}};return t[r](a,a.exports,o),a.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o(514),o(812),o(484)})();
|
|
@@ -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
|
+
(()=>{"use strict";var a={};function o(a,o,t){return o in a?Object.defineProperty(a,o,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[o]=t,a}a.d=(o,t)=>{for(var e in t)a.o(t,e)&&!a.o(o,e)&&Object.defineProperty(o,e,{enumerable:!0,get:t[e]})},a.o=(a,o)=>Object.prototype.hasOwnProperty.call(a,o);var t=function a(){!function(a,o){if(!(a instanceof o))throw new TypeError("Cannot call a class as a function")}(this,a)};o(t,"tooltip","[data-hc-tooltip], [data-hc-popover]"),o(t,"popover","[data-hc-popover]"),o(t,"scrollSmooth","data-hc-smooth-scroll"),o(t,"modal","[data-hc-modal]"),o(t,"lightbox","[data-hc-lightbox]"),o(t,"dropdown","[data-hc-dropdown]"),o(t,"collapse","[data-hc-collapse]"),o(t,"collapseItem","[data-hc-collapse-item]"),o(t,"tab","[data-hc-tab]"),o(t,"toggle","[data-hc-toggle]"),o(t,"slider","[data-hc-slider]")})();
|
|
@@ -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
|
-
}
|
|
1
|
+
(()=>{"use strict";var t={};function e(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}t.d=(e,a)=>{for(var n in a)t.o(a,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:a[n]})},t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var a=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)};e(a,"attrPopover","data-hc-popover"),e(a,"attrContent","data-hc-tooltip-content"),e(a,"attrPlacement","data-hc-tooltip-placement")})();
|