PageSourceSearch

https://merciki.be/assets/Toggles-6bb97f3a.js

js merciki.be collected 2026-10-06 13:43:13 UTC 2,405 bytes, 1 lines download raw bytes

1import{k as x,a7 as v,l as h,Z as m,c as l,t as o,n as u,e as i,D as d,A as k,a6 as w,al as p,h as s,_ as L}from"./index-5ef33a32.js";const V={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between h-full w-full"},B=["for"],C={class:"flex items-center gap-3 mt-2 sm:mt-0"},S=["id","aria-checked","aria-label","disabled"],T=["id","name","checked","disabled"],$=x({__name:"Toggles",props:{modelValue:{type:Boolean,default:void 0},defaultSelected:{type:Boolean,default:!1},label:{default:""},name:{default:"toggle"},errors:{default:()=>[]},disabled:{type:Boolean,default:!1},onLabel:{default:""},offLabel:{default:""},id:{default:""}},emits:["update:modelValue"],setup(e,{emit:g}){const b=g,t=e,a=v(t.modelValue??t.defaultSelected),r=h(()=>t.id||`${t.name}-toggle`),y=()=>{t.disabled||(a.value=!a.value)};return m(()=>t.modelValue,n=>{if(typeof n=="boolean"){a.value=n;return}a.value=t.defaultSelected}),m(a,n=>{b("update:modelValue",n)}),(n,c)=>(s(),l("div",V,[e.label?(s(),l("label",{key:0,for:r.value,class:"block text-sm sm:text-lg font-bold leading-6 text-gray-900 mr-5"},o(e.label),9,B)):u("",!0),i("div",C,[e.offLabel?(s(),l("span",{key:0,class:d(["text-sm text-gray-500",{"font-semibold text-gray-900":!a.value}])},o(e.offLabel),3)):u("",!0),i("button",{id:r.value,type:"button",role:"switch","aria-checked":a.value,"aria-label":e.label||e.name,disabled:e.disabled,class:d([a.value?"bg-primary":"bg-gray-200",e.disabled?"opacity-60 cursor-not-allowed":"cursor-pointer","group relative inline-flex w-11 shrink-0 rounded-full p-0.5 ring-1 ring-inset ring-gray-900/5 transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-primary"]),onClick:y},[i("span",{class:d([a.value?"translate-x-5":"translate-x-0","size-5 rounded-full bg-white shadow-sm ring-1 ring-gray-900/5 transition-transform duration-200 ease-in-out"])},null,2)],10,S),e.onLabel?(s(),l("span",{key:1,class:d(["text-sm text-gray-500",{"font-semibold text-gray-900":a.value}])},o(e.onLabel),3)):u("",!0),i("input",{id:`${r.value}-hidden`,name:e.name,type:"checkbox",class:"sr-only",checked:a.value,disabled:e.disabled,tabindex:"-1","aria-hidden":"true",onChange:c[0]||(c[0]=k(()=>{},["prevent"]))},null,40,T)]),(s(!0),l(w,null,p(e.errors,f=>(s(),l("span",{key:f.$uid,class:"mt-2 text-sm text-danger"},o(f.$message),1))),128))]))}}),D=L($,[["__file","Toggles.vue"]]);export{D as T};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.