@iris.interactive/handcook 8.2.0 → 8.4.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/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
|
@@ -172,7 +172,7 @@ ${this.ctx.stack}`),this.cancel(e)):(this.callback(null,t),"count"===this.opts.s
|
|
|
172
172
|
* @author Lucas ROCHE
|
|
173
173
|
* @date 28/01/2022 14:52
|
|
174
174
|
* @copyright Copyright (c) 2002-2022 IRIS Interactive, Inc. (http://www.iris-interactive.fr)
|
|
175
|
-
*/class iW{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(const 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))){const e={};Object.assign(e,this.defaultOptions,r),e.trigger=""!==e.trigger?e.trigger:t.hasAttribute(iH.attrPopover)?"click focus":"mouseenter focus",e.content=""!==e.content?e.content:t.hasAttribute(iH.attrContent)?t.getAttribute(iH.attrContent):"",e.placement=""!==e.placement?e.placement:t.hasAttribute(iH.attrPlacement)?t.getAttribute(iH.attrPlacement):"bottom",e.interactive=""!==e.interactive?e.interactive
|
|
175
|
+
*/class iW{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(const 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))){const e={};Object.assign(e,this.defaultOptions,r),e.trigger=""!==e.trigger?e.trigger:t.hasAttribute(iH.attrPopover)?"click focus":"mouseenter focus",e.content=""!==e.content?e.content:t.hasAttribute(iH.attrContent)?t.getAttribute(iH.attrContent):"",e.placement=""!==e.placement?e.placement:t.hasAttribute(iH.attrPlacement)?t.getAttribute(iH.attrPlacement):"bottom",e.interactive=""!==e.interactive?e.interactive:"false"!==t.getAttribute(iH.attrInteractive);const i=t.hasAttribute(iH.attrBackgroundColor)?t.getAttribute(iH.attrBackgroundColor):"",s=t.hasAttribute(iH.attrColor)?t.getAttribute(iH.attrColor):"",n=t.hasAttribute(iH.attrFontSize)?t.getAttribute(iH.attrFontSize):"";-1!==e.trigger.indexOf("click")?t.addEventListener("click",e=>{e.preventDefault()}):e.touch=!1,e.onMount=e=>{let t=t=>{"Escape"===t.key&&e.hide()};document.addEventListener("keydown",t),e._escapeHandler=t},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.popper.setAttribute("role","tooltip"),e.reference.dispatchEvent(this.showEvent)},e.onShown=e=>{e.reference.dispatchEvent(this.shownEvent)},e.onHide=e=>{e._escapeHandler&&document.removeEventListener("keydown",e._escapeHandler),e.reference.dispatchEvent(this.hideEvent)},e.onHidden=e=>{e.reference.dispatchEvent(this.hiddenEvent)};const o=tN(t,e);this.instances.push(o)}}}let iV=(e,t)=>new iW(e,t),iG=(e,t)=>new ih(e,t),iX=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 ic(e,i)};/*
|
|
176
176
|
* IRIS Interactive
|
|
177
177
|
*
|
|
178
178
|
* 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:"",allowHTML:!0};constructor(
|
|
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(n=e.tooltip,i={}){for(let e of(this.createEvent(),document.querySelectorAll(n))){let n={};Object.assign(n,this.defaultOptions,i),n.trigger=""!==n.trigger?n.trigger:e.hasAttribute(o.attrPopover)?"click focus":"mouseenter focus",n.content=""!==n.content?n.content:e.hasAttribute(o.attrContent)?e.getAttribute(o.attrContent):"",n.placement=""!==n.placement?n.placement:e.hasAttribute(o.attrPlacement)?e.getAttribute(o.attrPlacement):"bottom",n.interactive=""!==n.interactive?n.interactive:"false"!==e.getAttribute(o.attrInteractive);let r=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!==n.trigger.indexOf("click")?e.addEventListener("click",t=>{t.preventDefault()}):n.touch=!1,n.onMount=t=>{let e=e=>{"Escape"===e.key&&t.hide()};document.addEventListener("keydown",e),t._escapeHandler=e},n.onShow=t=>{r&&t.popper.querySelector(".tippy-box").style.setProperty("--iris--tooltip--background-color",r),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.popper.setAttribute("role","tooltip"),t.reference.dispatchEvent(this.showEvent)},n.onShown=t=>{t.reference.dispatchEvent(this.shownEvent)},n.onHide=t=>{t._escapeHandler&&document.removeEventListener("keydown",t._escapeHandler),t.reference.dispatchEvent(this.hideEvent)},n.onHidden=t=>{t.reference.dispatchEvent(this.hiddenEvent)};let a=t(e,n);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;
|
|
@@ -168,4 +168,25 @@
|
|
|
168
168
|
/* ============================================= */
|
|
169
169
|
.not-focus-style:focus {
|
|
170
170
|
outline: none !important;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* Reset button style
|
|
174
|
+
/* ============================================= */
|
|
175
|
+
.reset-button-style {
|
|
176
|
+
-webkit-appearance: none;
|
|
177
|
+
border-radius: 0;
|
|
178
|
+
text-align: inherit;
|
|
179
|
+
background: none;
|
|
180
|
+
box-shadow: none;
|
|
181
|
+
padding: 0;
|
|
182
|
+
cursor: pointer;
|
|
183
|
+
border: none;
|
|
184
|
+
color: inherit;
|
|
185
|
+
font: inherit;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/* Reset margin
|
|
189
|
+
/* ============================================= */
|
|
190
|
+
.reset-margin {
|
|
191
|
+
margin: 0 !important;
|
|
171
192
|
}
|
|
@@ -737,6 +737,11 @@ $detail-sit-title-font-size--rem: var(--iris--detail-sit-title--font-size--rem,
|
|
|
737
737
|
$detail-sit-title-font-size-small: var(--iris--detail-sit-title--font-size--small, $h2-font-size-small);
|
|
738
738
|
$detail-sit-title-font-size-small--rem: var(--iris--detail-sit-title--font-size--small--rem, $h2-font-size-small--rem);
|
|
739
739
|
|
|
740
|
+
/* A11y
|
|
741
|
+
/ ================================================== */
|
|
742
|
+
$a11y-focus-color: var(--iris--focus--color, $color);
|
|
743
|
+
$a11y-outline: 2px dashed $a11y-focus-color;
|
|
744
|
+
|
|
740
745
|
/* Notifications
|
|
741
746
|
/ ================================================== */
|
|
742
747
|
$c-error: #f33;
|