@iris.interactive/handcook 8.0.0-alpha.10 → 8.0.0-alpha.11
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
|
-

|
|
3
3
|

|
|
4
4
|
[](#)
|
|
5
5
|
[](https://twitter.com/captain\_iris)
|
package/package.json
CHANGED
package/public/index.js
CHANGED
|
@@ -211,7 +211,7 @@ ${this.ctx.stack}`),this.cancel(e)):(this.callback(null,t),"count"===this.opts.s
|
|
|
211
211
|
* @author Lucas ROCHE
|
|
212
212
|
* @date 28/01/2022 14:52
|
|
213
213
|
* @copyright Copyright (c) 2002-2022 IRIS Interactive, Inc. (http://www.iris-interactive.fr)
|
|
214
|
-
*/class iY{createEvent(){this.showEvent=new Event("show.hc.tooltip"),this.shownEvent=new Event("shown.hc.tooltip"),this.hideEvent=new Event("hide.hc.tooltip"),this.hiddenEvent=new Event("hidden.hc.tooltip")}show(){for(let e of this.instances)e.show()}hide(){for(let e of this.instances)e.hide()}disable(){for(let e of this.instances)e.disable()}enable(){for(let e of this.instances)e.enable()}constructor(i=t.tooltip,r={}){for(let t of(e(this,"showEvent",void 0),e(this,"shownEvent",void 0),e(this,"hideEvent",void 0),e(this,"hiddenEvent",void 0),e(this,"instances",[]),e(this,"defaultOptions",{placement:"",content:"",trigger:"",interactive
|
|
214
|
+
*/class iY{createEvent(){this.showEvent=new Event("show.hc.tooltip"),this.shownEvent=new Event("shown.hc.tooltip"),this.hideEvent=new Event("hide.hc.tooltip"),this.hiddenEvent=new Event("hidden.hc.tooltip")}show(){for(let e of this.instances)e.show()}hide(){for(let e of this.instances)e.hide()}disable(){for(let e of this.instances)e.disable()}enable(){for(let e of this.instances)e.enable()}constructor(i=t.tooltip,r={}){for(let t of(e(this,"showEvent",void 0),e(this,"shownEvent",void 0),e(this,"hideEvent",void 0),e(this,"hiddenEvent",void 0),e(this,"instances",[]),e(this,"defaultOptions",{placement:"",content:"",trigger:"",interactive:"",allowHTML:!0}),this.createEvent(),document.querySelectorAll(i))){let e={};Object.assign(e,this.defaultOptions,r),e.trigger=""!==e.trigger?e.trigger:t.hasAttribute(iX.attrPopover)?"click focus":"mouseenter focus",e.content=""!==e.content?e.content:t.hasAttribute(iX.attrContent)?t.getAttribute(iX.attrContent):"",e.placement=""!==e.placement?e.placement:t.hasAttribute(iX.attrPlacement)?t.getAttribute(iX.attrPlacement):"bottom",e.interactive=""!==e.interactive?e.interactive:!!t.hasAttribute(iX.attrInteractive)&&t.getAttribute(iX.attrInteractive);let i=t.hasAttribute(iX.attrBackgroundColor)?t.getAttribute(iX.attrBackgroundColor):"",s=t.hasAttribute(iX.attrColor)?t.getAttribute(iX.attrColor):"",n=t.hasAttribute(iX.attrFontSize)?t.getAttribute(iX.attrFontSize):"";-1!==e.trigger.indexOf("click")?t.addEventListener("click",e=>{e.preventDefault()}):e.touch=!1,e.onShow=e=>{i&&e.popper.querySelector(".tippy-box").style.setProperty("--iris--tooltip--background-color",i),s&&e.popper.querySelector(".tippy-box").style.setProperty("--iris--tooltip--color",s),n&&e.popper.querySelector(".tippy-box").style.setProperty("--iris--tooltip--font-size",n),e.reference.dispatchEvent(this.showEvent)},e.onShown=e=>{e.reference.dispatchEvent(this.shownEvent)},e.onHide=e=>{e.reference.dispatchEvent(this.hideEvent)},e.onHidden=e=>{e.reference.dispatchEvent(this.hiddenEvent)};let o=tF(t,e);this.instances.push(o)}}}let iJ={hc_tooltip:(e,t)=>new iY(e,t),hc_smooth_scroll:(e,t)=>{new iA(e,t)},hc_modal:(e,t)=>new ig(e,t),hc_lightbox:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.lightbox,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new ip(e,i)},hc_dropdown:e=>new tU(e),hc_collapse:e=>new eo(e),hc_lazyload:()=>tB.getInstance(),hc_tab:e=>new iV(e),hc_toggle:e=>new iG(e),hc_slider:e=>new i_(e),hc_scrollspy:e=>new iE(e),hc_popin:e=>{new iv(e)},hc_scroll_reveal:()=>new iw,hc_overlay:e=>new iy(e)};/*
|
|
215
215
|
* IRIS Interactive
|
|
216
216
|
*
|
|
217
217
|
* NOTICE OF LICENSE
|
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
* @author Lucas ROCHE
|
|
12
12
|
* @date 28/01/2022 14:52
|
|
13
13
|
* @copyright Copyright (c) 2002-2022 IRIS Interactive, Inc. (http://www.iris-interactive.fr)
|
|
14
|
-
*/import t from"tippy.js";import"tippy.js/dist/tippy.css";import e from"../../enumerators/element.enum";import o from"../../enumerators/tooltip.enum";export class HcTooltip{showEvent;shownEvent;hideEvent;hiddenEvent;instances=[];defaultOptions={placement:"",content:"",trigger:"",interactive
|
|
14
|
+
*/import t from"tippy.js";import"tippy.js/dist/tippy.css";import e from"../../enumerators/element.enum";import o from"../../enumerators/tooltip.enum";export class HcTooltip{showEvent;shownEvent;hideEvent;hiddenEvent;instances=[];defaultOptions={placement:"",content:"",trigger:"",interactive:"",allowHTML:!0};constructor(i=e.tooltip,r={}){for(let e of(this.createEvent(),document.querySelectorAll(i))){let i={};Object.assign(i,this.defaultOptions,r),i.trigger=""!==i.trigger?i.trigger:e.hasAttribute(o.attrPopover)?"click focus":"mouseenter focus",i.content=""!==i.content?i.content:e.hasAttribute(o.attrContent)?e.getAttribute(o.attrContent):"",i.placement=""!==i.placement?i.placement:e.hasAttribute(o.attrPlacement)?e.getAttribute(o.attrPlacement):"bottom",i.interactive=""!==i.interactive?i.interactive:!!e.hasAttribute(o.attrInteractive)&&e.getAttribute(o.attrInteractive);let n=e.hasAttribute(o.attrBackgroundColor)?e.getAttribute(o.attrBackgroundColor):"",s=e.hasAttribute(o.attrColor)?e.getAttribute(o.attrColor):"",c=e.hasAttribute(o.attrFontSize)?e.getAttribute(o.attrFontSize):"";-1!==i.trigger.indexOf("click")?e.addEventListener("click",t=>{t.preventDefault()}):i.touch=!1,i.onShow=t=>{n&&t.popper.querySelector(".tippy-box").style.setProperty("--iris--tooltip--background-color",n),s&&t.popper.querySelector(".tippy-box").style.setProperty("--iris--tooltip--color",s),c&&t.popper.querySelector(".tippy-box").style.setProperty("--iris--tooltip--font-size",c),t.reference.dispatchEvent(this.showEvent)},i.onShown=t=>{t.reference.dispatchEvent(this.shownEvent)},i.onHide=t=>{t.reference.dispatchEvent(this.hideEvent)},i.onHidden=t=>{t.reference.dispatchEvent(this.hiddenEvent)};let a=t(e,i);this.instances.push(a)}}createEvent(){this.showEvent=new Event("show.hc.tooltip"),this.shownEvent=new Event("shown.hc.tooltip"),this.hideEvent=new Event("hide.hc.tooltip"),this.hiddenEvent=new Event("hidden.hc.tooltip")}show(){for(let t of this.instances)t.show()}hide(){for(let t of this.instances)t.hide()}disable(){for(let t of this.instances)t.disable()}enable(){for(let t of this.instances)t.enable()}}let hc_tooltip=(t,e)=>new HcTooltip(t,e);export default hc_tooltip;
|