@public-ui/components 1.1.13-rc.3 → 1.1.13-rc.5

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.
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * KoliBri - the accessible web component library
3
3
  */
4
- import{r as registerInstance,h,H as Host}from"./index-bc1a7f22.js";import{w as watchTooltipAlignment}from"./button-link-f2957683.js";import{g as getDocument,n as nonce}from"./dev.utils-bbaf8793.js";import{w as watchString}from"./prop.validators-0af22c96.js";import"./index.m-df5ce03f.js";import"./a11y.tipps-bb9add07.js";import"./index-36adcf98.js";const defaultStyleCss='kol-badge,.tooltip{font-size:1rem;position:fixed;animation-name:fadeInOpacity;animation-iteration-count:1;animation-timing-function:ease-in;animation-duration:0.5s;display:none;z-index:1000;max-width:300px;box-shadow:0 0 0.15rem rgba(255, 255, 255, 0.8)}kol-badge::after,.tooltip::after{content:" ";position:absolute;border-style:solid;border-width:5px}kol-badge.arrow-left::after,.tooltip.arrow-left::after{margin-top:-5px;top:50%;right:100%;border-color:transparent black transparent transparent}kol-badge.arrow-right::after,.tooltip.arrow-right::after{margin-top:-5px;top:50%;left:100%;border-color:transparent transparent transparent black}kol-badge.arrow-top::after,.tooltip.arrow-top::after{margin-left:-5px;left:50%;bottom:100%;border-color:transparent transparent black transparent}kol-badge.arrow-bottom::after,.tooltip.arrow-bottom::after{margin-left:-5px;left:50%;top:100%;border-color:black transparent transparent transparent}@keyframes fadeInOpacity{0%{opacity:0}100%{opacity:1}}',KolTooltip=class{constructor(t){registerInstance(this,t),this.hydrated=!1,this.hostElement=null,this.childElements=[],this.alignTooltip=()=>{const t=this.childElements[0];{const e=t.getBoundingClientRect();if(this.tooltipElement instanceof HTMLElement){switch(this.state._align){case"top":case"bottom":this.tooltipElement.style.left=e.left+t.offsetWidth/2-this.tooltipElement.offsetWidth/2+"px";break;default:this.tooltipElement.style.top=e.top+e.height/2-this.tooltipElement.offsetHeight/2+"px"}switch(this.state._align){case"left":this.tooltipElement.style.left=`calc(${e.left-this.tooltipElement.offsetWidth}px - 0.5em)`;break;case"right":this.tooltipElement.style.left=`calc(${e.right}px + 0.5em)`;break;case"bottom":this.tooltipElement.style.top=`calc(${e.bottom}px + 0.5em)`;break;default:this.tooltipElement.style.top=`calc(${e.top-this.tooltipElement.offsetHeight}px - 0.5em)`}}}},this.showTooltip=()=>{this.tooltipElement instanceof HTMLElement&&(this.tooltipElement.style.setProperty("display","block"),getDocument().body.addEventListener("keyup",this.hideTooltipByEscape),this.alignTooltip(),this.tooltipElement.style.setProperty("visibility","visible"))},this.hideTooltip=()=>{this.tooltipElement instanceof HTMLElement&&(this.tooltipElement.style.setProperty("display","none"),this.tooltipElement.style.setProperty("visibility","hidden"))},this.hideTooltipByEscape=t=>{"Escape"===t.key&&(getDocument().body.removeEventListener("keyup",this.hideTooltipByEscape),this.hideTooltip())},this.catchHostElement=t=>{if(this.hostElement=t,this.hostElement instanceof HTMLElement){const t=this.hostElement.previousElementSibling;t instanceof HTMLElement&&(t.removeEventListener("mouseover",this.showTooltip),t.addEventListener("mouseover",this.showTooltip),t.removeEventListener("focus",this.showTooltip),t.addEventListener("focus",this.showTooltip),t.removeEventListener("mouseout",this.hideTooltip),t.addEventListener("mouseout",this.hideTooltip),t.removeEventListener("blur",this.hideTooltip),t.addEventListener("blur",this.hideTooltip),this.childElements.push(t))}},this.catchTooltipElement=t=>{this.tooltipElement=t},this._align="top",this._id=void 0,this._label=void 0,this.state={_align:"top",_id:nonce(),_label:""}}render(){const t=setTimeout((()=>{clearTimeout(t),this.alignTooltip()}),250);return h(Host,{ref:this.catchHostElement,style:{maxWidth:"300px"}},""!==this.state._label&&h("kol-badge",{class:{"arrow-bottom":"top"===this.state._align,"arrow-left":"right"===this.state._align,"arrow-top":"bottom"===this.state._align,"arrow-right":"left"===this.state._align},id:this.state._id,ref:this.catchTooltipElement,_color:{backgroundColor:"#333",color:"#ddd"},_label:this.state._label}))}validateAlign(t){watchTooltipAlignment(this,"_align",t)}validateId(t){watchString(this,"_id",t)}validateLabel(t){watchString(this,"_label",t)}componentWillLoad(){this.validateAlign(this._align),this.validateId(this._id),this.validateLabel(this._label),this.hydrated=!0}static get watchers(){return{_align:["validateAlign"],_id:["validateId"],_label:["validateLabel"]}}};KolTooltip.style={default:defaultStyleCss};export{KolTooltip as kol_tooltip};
4
+ import{r as registerInstance,h,H as Host}from"./index-bc1a7f22.js";import{w as watchTooltipAlignment}from"./button-link-f2957683.js";import{g as getDocument,n as nonce}from"./dev.utils-bbaf8793.js";import{w as watchString}from"./prop.validators-0af22c96.js";import"./index.m-df5ce03f.js";import"./a11y.tipps-bb9add07.js";import"./index-36adcf98.js";const defaultStyleCss='kol-badge,.tooltip{font-size:1rem;position:fixed;animation-name:fadeInOpacity;animation-iteration-count:1;animation-timing-function:ease-in;animation-duration:0.5s;display:none;z-index:1000;max-width:300px;box-shadow:0 0 0.15rem rgba(255, 255, 255, 0.8)}kol-badge::after,.tooltip::after{content:" ";position:absolute;border-style:solid;border-width:5px}kol-badge.arrow-left::after,.tooltip.arrow-left::after{margin-top:-5px;top:50%;right:100%;border-color:transparent black transparent transparent}kol-badge.arrow-right::after,.tooltip.arrow-right::after{margin-top:-5px;top:50%;left:100%;border-color:transparent transparent transparent black}kol-badge.arrow-top::after,.tooltip.arrow-top::after{margin-left:-5px;left:50%;bottom:100%;border-color:transparent transparent black transparent}kol-badge.arrow-bottom::after,.tooltip.arrow-bottom::after{margin-left:-5px;left:50%;top:100%;border-color:black transparent transparent transparent}@keyframes fadeInOpacity{0%{opacity:0}100%{opacity:1}}',KolTooltip=class{constructor(t){registerInstance(this,t),this.hydrated=!1,this.hostElement=null,this.childElements=[],this.alignTooltip=()=>{const t=this.childElements[0];{const e=t.getBoundingClientRect();if(this.tooltipElement instanceof HTMLElement){switch(this.state._align){case"top":case"bottom":this.tooltipElement.style.left=e.left+t.offsetWidth/2-this.tooltipElement.offsetWidth/2+"px";break;default:this.tooltipElement.style.top=e.top+e.height/2-this.tooltipElement.offsetHeight/2+"px"}switch(this.state._align){case"left":this.tooltipElement.style.left=`calc(${e.left-this.tooltipElement.offsetWidth}px - 0.5em)`;break;case"right":this.tooltipElement.style.left=`calc(${e.right}px + 0.5em)`;break;case"bottom":this.tooltipElement.style.top=`calc(${e.bottom}px + 0.5em)`;break;default:this.tooltipElement.style.top=`calc(${e.top-this.tooltipElement.offsetHeight}px - 0.5em)`}}}},this.showTooltip=()=>{this.tooltipElement instanceof HTMLElement&&(this.tooltipElement.style.setProperty("display","block"),getDocument().body.addEventListener("keyup",this.hideTooltipByEscape),this.alignTooltip(),this.tooltipElement.style.setProperty("visibility","visible"),document.addEventListener("scroll",this.alignTooltip))},this.hideTooltip=()=>{this.tooltipElement instanceof HTMLElement&&(this.tooltipElement.style.setProperty("display","none"),this.tooltipElement.style.setProperty("visibility","hidden"),document.removeEventListener("scroll",this.alignTooltip))},this.hideTooltipByEscape=t=>{"Escape"===t.key&&(getDocument().body.removeEventListener("keyup",this.hideTooltipByEscape),this.hideTooltip())},this.catchHostElement=t=>{if(this.hostElement=t,this.hostElement instanceof HTMLElement){const t=this.hostElement.previousElementSibling;t instanceof HTMLElement&&(t.removeEventListener("mouseover",this.showTooltip),t.addEventListener("mouseover",this.showTooltip),t.removeEventListener("focus",this.showTooltip),t.addEventListener("focus",this.showTooltip),t.removeEventListener("mouseout",this.hideTooltip),t.addEventListener("mouseout",this.hideTooltip),t.removeEventListener("blur",this.hideTooltip),t.addEventListener("blur",this.hideTooltip),this.childElements.push(t))}},this.catchTooltipElement=t=>{this.tooltipElement=t},this._align="top",this._id=void 0,this._label=void 0,this.state={_align:"top",_id:nonce(),_label:""}}render(){const t=setTimeout((()=>{clearTimeout(t),this.alignTooltip()}),250);return h(Host,{ref:this.catchHostElement,style:{maxWidth:"300px"}},""!==this.state._label&&h("kol-badge",{class:{"arrow-bottom":"top"===this.state._align,"arrow-left":"right"===this.state._align,"arrow-top":"bottom"===this.state._align,"arrow-right":"left"===this.state._align},id:this.state._id,ref:this.catchTooltipElement,_color:{backgroundColor:"#333",color:"#ddd"},_label:this.state._label}))}validateAlign(t){watchTooltipAlignment(this,"_align",t)}validateId(t){watchString(this,"_id",t)}validateLabel(t){watchString(this,"_label",t)}componentWillLoad(){this.validateAlign(this._align),this.validateId(this._id),this.validateLabel(this._label),this.hydrated=!0}static get watchers(){return{_align:["validateAlign"],_id:["validateId"],_label:["validateLabel"]}}};KolTooltip.style={default:defaultStyleCss};export{KolTooltip as kol_tooltip};
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * KoliBri - the accessible web component library
3
3
  */
4
- import{r as t,h as i,H as a}from"./index-bc1a7f22.js";import{w as s}from"./button-link-f2957683.js";import{g as o,n as e}from"./dev.utils-bbaf8793.js";import{w as r}from"./prop.validators-0af22c96.js";import"./index.m-df5ce03f.js";import"./a11y.tipps-bb9add07.js";import"./index-36adcf98.js";const n=class{constructor(i){t(this,i),this.hydrated=!1,this.hostElement=null,this.childElements=[],this.alignTooltip=()=>{const t=this.childElements[0];{const e=t.getBoundingClientRect();if(this.tooltipElement instanceof HTMLElement){switch(this.state._align){case"top":case"bottom":this.tooltipElement.style.left=e.left+t.offsetWidth/2-this.tooltipElement.offsetWidth/2+"px";break;default:this.tooltipElement.style.top=e.top+e.height/2-this.tooltipElement.offsetHeight/2+"px"}switch(this.state._align){case"left":this.tooltipElement.style.left=`calc(${e.left-this.tooltipElement.offsetWidth}px - 0.5em)`;break;case"right":this.tooltipElement.style.left=`calc(${e.right}px + 0.5em)`;break;case"bottom":this.tooltipElement.style.top=`calc(${e.bottom}px + 0.5em)`;break;default:this.tooltipElement.style.top=`calc(${e.top-this.tooltipElement.offsetHeight}px - 0.5em)`}}}},this.showTooltip=()=>{this.tooltipElement instanceof HTMLElement&&(this.tooltipElement.style.setProperty("display","block"),o().body.addEventListener("keyup",this.hideTooltipByEscape),this.alignTooltip(),this.tooltipElement.style.setProperty("visibility","visible"))},this.hideTooltip=()=>{this.tooltipElement instanceof HTMLElement&&(this.tooltipElement.style.setProperty("display","none"),this.tooltipElement.style.setProperty("visibility","hidden"))},this.hideTooltipByEscape=t=>{"Escape"===t.key&&(o().body.removeEventListener("keyup",this.hideTooltipByEscape),this.hideTooltip())},this.catchHostElement=t=>{if(this.hostElement=t,this.hostElement instanceof HTMLElement){const t=this.hostElement.previousElementSibling;t instanceof HTMLElement&&(t.removeEventListener("mouseover",this.showTooltip),t.addEventListener("mouseover",this.showTooltip),t.removeEventListener("focus",this.showTooltip),t.addEventListener("focus",this.showTooltip),t.removeEventListener("mouseout",this.hideTooltip),t.addEventListener("mouseout",this.hideTooltip),t.removeEventListener("blur",this.hideTooltip),t.addEventListener("blur",this.hideTooltip),this.childElements.push(t))}},this.catchTooltipElement=t=>{this.tooltipElement=t},this._align="top",this._id=void 0,this._label=void 0,this.state={_align:"top",_id:e(),_label:""}}render(){const t=setTimeout((()=>{clearTimeout(t),this.alignTooltip()}),250);return i(a,{ref:this.catchHostElement,style:{maxWidth:"300px"}},""!==this.state._label&&i("kol-badge",{class:{"arrow-bottom":"top"===this.state._align,"arrow-left":"right"===this.state._align,"arrow-top":"bottom"===this.state._align,"arrow-right":"left"===this.state._align},id:this.state._id,ref:this.catchTooltipElement,_color:{backgroundColor:"#333",color:"#ddd"},_label:this.state._label}))}validateAlign(t){s(this,"_align",t)}validateId(t){r(this,"_id",t)}validateLabel(t){r(this,"_label",t)}componentWillLoad(){this.validateAlign(this._align),this.validateId(this._id),this.validateLabel(this._label),this.hydrated=!0}static get watchers(){return{_align:["validateAlign"],_id:["validateId"],_label:["validateLabel"]}}};n.style={default:'kol-badge,.tooltip{font-size:1rem;position:fixed;animation-name:fadeInOpacity;animation-iteration-count:1;animation-timing-function:ease-in;animation-duration:0.5s;display:none;z-index:1000;max-width:300px;box-shadow:0 0 0.15rem rgba(255, 255, 255, 0.8)}kol-badge::after,.tooltip::after{content:" ";position:absolute;border-style:solid;border-width:5px}kol-badge.arrow-left::after,.tooltip.arrow-left::after{margin-top:-5px;top:50%;right:100%;border-color:transparent black transparent transparent}kol-badge.arrow-right::after,.tooltip.arrow-right::after{margin-top:-5px;top:50%;left:100%;border-color:transparent transparent transparent black}kol-badge.arrow-top::after,.tooltip.arrow-top::after{margin-left:-5px;left:50%;bottom:100%;border-color:transparent transparent black transparent}kol-badge.arrow-bottom::after,.tooltip.arrow-bottom::after{margin-left:-5px;left:50%;top:100%;border-color:black transparent transparent transparent}@keyframes fadeInOpacity{0%{opacity:0}100%{opacity:1}}'};export{n as kol_tooltip};
4
+ import{r as t,h as i,H as a}from"./index-bc1a7f22.js";import{w as s}from"./button-link-f2957683.js";import{g as o,n as e}from"./dev.utils-bbaf8793.js";import{w as r}from"./prop.validators-0af22c96.js";import"./index.m-df5ce03f.js";import"./a11y.tipps-bb9add07.js";import"./index-36adcf98.js";const n=class{constructor(i){t(this,i),this.hydrated=!1,this.hostElement=null,this.childElements=[],this.alignTooltip=()=>{const t=this.childElements[0];{const e=t.getBoundingClientRect();if(this.tooltipElement instanceof HTMLElement){switch(this.state._align){case"top":case"bottom":this.tooltipElement.style.left=e.left+t.offsetWidth/2-this.tooltipElement.offsetWidth/2+"px";break;default:this.tooltipElement.style.top=e.top+e.height/2-this.tooltipElement.offsetHeight/2+"px"}switch(this.state._align){case"left":this.tooltipElement.style.left=`calc(${e.left-this.tooltipElement.offsetWidth}px - 0.5em)`;break;case"right":this.tooltipElement.style.left=`calc(${e.right}px + 0.5em)`;break;case"bottom":this.tooltipElement.style.top=`calc(${e.bottom}px + 0.5em)`;break;default:this.tooltipElement.style.top=`calc(${e.top-this.tooltipElement.offsetHeight}px - 0.5em)`}}}},this.showTooltip=()=>{this.tooltipElement instanceof HTMLElement&&(this.tooltipElement.style.setProperty("display","block"),o().body.addEventListener("keyup",this.hideTooltipByEscape),this.alignTooltip(),this.tooltipElement.style.setProperty("visibility","visible"),document.addEventListener("scroll",this.alignTooltip))},this.hideTooltip=()=>{this.tooltipElement instanceof HTMLElement&&(this.tooltipElement.style.setProperty("display","none"),this.tooltipElement.style.setProperty("visibility","hidden"),document.removeEventListener("scroll",this.alignTooltip))},this.hideTooltipByEscape=t=>{"Escape"===t.key&&(o().body.removeEventListener("keyup",this.hideTooltipByEscape),this.hideTooltip())},this.catchHostElement=t=>{if(this.hostElement=t,this.hostElement instanceof HTMLElement){const t=this.hostElement.previousElementSibling;t instanceof HTMLElement&&(t.removeEventListener("mouseover",this.showTooltip),t.addEventListener("mouseover",this.showTooltip),t.removeEventListener("focus",this.showTooltip),t.addEventListener("focus",this.showTooltip),t.removeEventListener("mouseout",this.hideTooltip),t.addEventListener("mouseout",this.hideTooltip),t.removeEventListener("blur",this.hideTooltip),t.addEventListener("blur",this.hideTooltip),this.childElements.push(t))}},this.catchTooltipElement=t=>{this.tooltipElement=t},this._align="top",this._id=void 0,this._label=void 0,this.state={_align:"top",_id:e(),_label:""}}render(){const t=setTimeout((()=>{clearTimeout(t),this.alignTooltip()}),250);return i(a,{ref:this.catchHostElement,style:{maxWidth:"300px"}},""!==this.state._label&&i("kol-badge",{class:{"arrow-bottom":"top"===this.state._align,"arrow-left":"right"===this.state._align,"arrow-top":"bottom"===this.state._align,"arrow-right":"left"===this.state._align},id:this.state._id,ref:this.catchTooltipElement,_color:{backgroundColor:"#333",color:"#ddd"},_label:this.state._label}))}validateAlign(t){s(this,"_align",t)}validateId(t){r(this,"_id",t)}validateLabel(t){r(this,"_label",t)}componentWillLoad(){this.validateAlign(this._align),this.validateId(this._id),this.validateLabel(this._label),this.hydrated=!0}static get watchers(){return{_align:["validateAlign"],_id:["validateId"],_label:["validateLabel"]}}};n.style={default:'kol-badge,.tooltip{font-size:1rem;position:fixed;animation-name:fadeInOpacity;animation-iteration-count:1;animation-timing-function:ease-in;animation-duration:0.5s;display:none;z-index:1000;max-width:300px;box-shadow:0 0 0.15rem rgba(255, 255, 255, 0.8)}kol-badge::after,.tooltip::after{content:" ";position:absolute;border-style:solid;border-width:5px}kol-badge.arrow-left::after,.tooltip.arrow-left::after{margin-top:-5px;top:50%;right:100%;border-color:transparent black transparent transparent}kol-badge.arrow-right::after,.tooltip.arrow-right::after{margin-top:-5px;top:50%;left:100%;border-color:transparent transparent transparent black}kol-badge.arrow-top::after,.tooltip.arrow-top::after{margin-left:-5px;left:50%;bottom:100%;border-color:transparent transparent black transparent}kol-badge.arrow-bottom::after,.tooltip.arrow-bottom::after{margin-left:-5px;left:50%;top:100%;border-color:black transparent transparent transparent}@keyframes fadeInOpacity{0%{opacity:0}100%{opacity:1}}'};export{n as kol_tooltip};