@kelvininc/ui-components
Version:
Kelvin UI Components
1 lines • 2.63 kB
JavaScript
import{r as t,c as i,h as e,H as s,g as o}from"./p-D-JVwta2.js";import{a as p}from"./p-CJTtq_QG.js";import{g as a}from"./p-DKOxy79t.js";import{d as r}from"./p-CSL3BQvE.js";import{T as n}from"./p-nGbDFIaH.js";import{m as d}from"./p-DOeJaCJq.js";import{i as h}from"./p-BA_npyc9.js";import"./p-DjSNdVAB.js";import"./p-DzZLIMy0.js";import"./p-DwRzddFC.js";import"./p-DVds6a5Z.js";import"./p-CojoW2Y2.js";import"./p-SVedE_O8.js";import"./p-BcMhjKoS.js";import"./p-Do0EyoO8.js";import"./p-CBuzk8fR.js";import"./p-DHk26cGe.js";import"./p-7ioMFMb5.js";import"./p-Dp5Jdzmz.js";import"./p-CK4jS9_E.js";import"./p-DVju43gQ.js";import"./p-DfPM2t43.js";import"./p-Dkd2PDJ-.js";import"./p-CiDQ1Z66.js";import"./p-DSZg-gfB.js";const c={strategy:"fixed"},m={padding:5},f=class{constructor(e){t(this,e),this.openStateChange=i(this,"openStateChange",7),this.options=c,this.isOpen=!1,this.isFixed=!1,this.withArrow=!1,this.disabled=!1,this.customClass="",this.getOptions=()=>{const t=h(this.allowedPositions)?this.position:void 0,i=[];return!h(this.allowedPositions)&&h(t)&&i.push(p(Object.assign(Object.assign({},m),{allowedPlacements:this.allowedPositions}))),d({placement:t,middleware:i},this.options)},this.onButtonClick=()=>{this.disabled||(this.isOpen=!this.isOpen,this.openStateChange.emit(this.isOpen))}}checkForClickOutside(t){if(!this.isFixed){if(r(this.portal,t)||r(this.openElement,t))return;this.isOpen&&(this.isOpen=!1,this.openStateChange.emit(!1))}}disconnectedCallback(){this.portal.remove()}render(){return e(s,{key:"b1f906d3722e716415d2d3c28947b741f0999e01"},e("div",{key:"33f70fe3397750231db9c2e8150a88d3dae1ef56",ref:t=>this.openElement=t,onClick:this.onButtonClick,class:"toggle-tip-open-element-container"},e("slot",{key:"19dc8d6cc5fb8a7d2fcb6aa27017d0d31adaa76c",name:"open-element-slot"})),e("kv-portal",{key:"de8fc57324a0a7aae3226cadc576e8ba26007330",zIndex:n,ref:t=>this.portal=t,withArrow:this.withArrow,animated:!0,show:this.isOpen,reference:this.openElement,options:this.getOptions()},e("kv-tooltip-text",{key:"07935d0ff814c5abb81867e29eb20a7078fc3fa4",class:Object.assign({"toggle-tip-container":!0},a(this.customClass)),text:this.text},e("div",{key:"b25195d4018c74a6e4b65e12a85e80d96beffbe7"},e("slot",{key:"f8b33d9087b0d9e956d302b8023fd9af695f1af8",name:"content-slot"})))))}get el(){return o(this)}};f.style='@property --rotation{syntax:"<angle>";initial-value:0deg;inherits:false}@keyframes rotate-border{to{--rotation:360deg}}.toggle-tip-open-element-container{width:fit-content;height:fit-content}.toggle-tip-container::part(tooltip-container){padding:var(--kv-spacing-3x, 12px)}';export{f as kv_toggle_tip}