flyonui
Version:
The easiest, free and open-source Tailwind CSS component library with semantic classes.
1 lines • 1.14 kB
JavaScript
var e,t={d:(e,o)=>{for(var l in o)t.o(o,l)&&!t.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:o[l]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},o={};t.d(o,{A:()=>s});const l=null!==(e=null===window||void 0===window?void 0:window.HS_CLIPBOARD_SELECTOR)&&void 0!==e?e:".js-clipboard";function n(e){document.querySelectorAll(e).forEach(e=>{new ClipboardJS(e,{text:e=>{const t=e.dataset.clipboardText;if(t)return t;const o=e.dataset.clipboardTarget,l=document.querySelector(o);return"SELECT"===l.tagName||"INPUT"===l.tagName||"TEXTAREA"===l.tagName?l.value:l.textContent}}).on("success",()=>{const t=e.querySelector(".js-clipboard-default"),o=e.querySelector(".js-clipboard-success"),l=e.querySelector(".js-clipboard-success-text"),n=e.dataset.clipboardSuccessText||"",s=e.closest(".tooltip");let a;l&&(a=l.textContent,l.textContent=n),t&&o&&(t.style.display="none",o.style.display="block"),s&&window.HSTooltip.show(s),setTimeout(function(){l&&a&&(l.textContent=a),s&&window.HSTooltip.hide(s),t&&o&&(o.style.display="",t.style.display="")},2e3)})})}window.addEventListener("load",()=>{n(l)});const s=n,a=o.A;export{a as default};