PageSourceSearch

https://wheelofnames.com/assets/QToggle-v431.js

js wheelofnames.com collected 2026-09-24 08:31:41 UTC 7,850 bytes, 1 lines download raw bytes

vendor: 7,850 bytes, line 1
1import{c as e,ct as t,lt as n,x as r,y as i}from"./runtime-core.esm-bundler-v431.js";import{E as a,Lt as o,Rt as s,b as c,d as l,g as u,jt as d,m as f,p,u as m,y as h}from"./use-router-link-v431.js";import{rt as g}from"./stores-v431.js";var _=[Element,String,Object],v=[null,document,document.body,document.scrollingElement,document.documentElement];function y(e,t){let n=c(t);if(n!==void 0&&n!==window&&!(n instanceof Element)&&!v.includes(n)&&(console.warn(`[Quasar] scroll-target: the specified value is not an Element nor a component with a root element; falling back to auto detection`),n=void 0),n===void 0){if(e==null)return window;n=e.closest(`.scroll,.scroll-y,.overflow-auto`)}return v.includes(n)?window:n}function b(e){return(e===window?document.body:e).scrollHeight}function x(e){return e===window?window.scrollY:e.scrollTop}function S(e){return e===window?window.scrollX:e.scrollLeft}function C(e,t,n=0,r){let i=r===void 0?performance.now():r,a=x(e);if(n<=0){a!==t&&T(e,t);return}requestAnimationFrame(r=>{let o=r-i,s=a+(t-a)/Math.max(o,n)*o;T(e,s),s!==t&&C(e,t,n-o,r)})}function w(e,t,n=0,r){let i=r===void 0?performance.now():r,a=S(e);if(n<=0){a!==t&&E(e,t);return}requestAnimationFrame(r=>{let o=r-i,s=a+(t-a)/Math.max(o,n)*o;E(e,s),s!==t&&w(e,t,n-o,r)})}function T(e,t){if(e===window){window.scrollTo(window.scrollX,t);return}e.scrollTop=t}function E(e,t){if(e===window){window.scrollTo(t,window.scrollY);return}e.scrollLeft=t}function D(e,t,n){if(n){C(e,t,n);return}T(e,t)}function O(e,t,n){if(n){w(e,t,n);return}E(e,t)}var k;function A(){if(k!==void 0)return k;let e=document.createElement(`p`),t=document.createElement(`div`);h(e,{width:`100%`,height:`200px`}),h(t,{position:`absolute`,top:`0px`,left:`0px`,visibility:`hidden`,width:`200px`,height:`150px`,overflow:`hidden`}),t.append(e),document.body.append(t);let n=e.offsetWidth;t.style.overflow=`scroll`;let r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),k=n-r,k}var j=0,M,N,P,F=!1,I,L,R=!1,z,B=null,V=new Set;function H(e){V.add(e)}function ee(e){V.delete(e)}function U(e){F||(F=!0,requestAnimationFrame(()=>{F=!1;let{height:t,scale:n}=e.target;if(Math.abs(n-1)>.01)return;let{clientHeight:r,scrollTop:i}=document.scrollingElement;(P===void 0||t!==window.innerHeight)&&(P=r-t,document.scrollingElement.scrollTop=i),i>P&&(document.scrollingElement.scrollTop-=Math.ceil((i-P)/8))}))}function W(e){let t=document.body;if(e===`add`){M=S(window),N=x(window),z=window.location.pathname,R=g.is.ios;let e=[`q-document--prevent-scroll`];R?(I=t.style.left,L=t.style.top,t.style.left=`-${M}px`,t.style.top=`-${N}px`,e.push(`q-document--pin-body`)):(e.push(`q-document--clip-scroll`),window.innerWidth-document.documentElement.clientWidth>0&&e.push(`q-document--reserve-scrollbar`)),document.documentElement.classList.add(...e),document.qScrollPrevented=!0,R&&(window.scrollTo(0,0),window.visualViewport?.addEventListener(`resize`,U,d.passiveCapture),window.visualViewport?.addEventListener(`scroll`,U,d.passiveCapture),window.scrollTo(0,0))}else R&&(window.visualViewport?.removeEventListener(`resize`,U,d.passiveCapture),window.visualViewport?.removeEventListener(`scroll`,U,d.passiveCapture)),document.documentElement.classList.remove(`q-document--prevent-scroll`,`q-document--clip-scroll`,`q-document--reserve-scrollbar`,`q-document--pin-body`),document.qScrollPrevented=!1,R&&(t.style.left=I,t.style.top=L),R&&window.location.pathname===z&&(S(window)!==M||x(window)!==N)?window.scrollTo(M,N):V.forEach(e=>{e()}),P=void 0}function te(e){let t=`add`;if(e===!0){if(j++,B!==null){clearTimeout(B),B=null;return}if(j>1)return}else{if(j===0||(j--,j>0))return;if(t=`remove`,R&&g.is.nativeMobile){B!==null&&clearTimeout(B),B=setTimeout(()=>{W(t),B=null},100);return}}W(t)}var G={dark:{type:Boolean,default:null}};function K(e,t){return()=>e.dark===null?t.dark.isActive:e.dark}var q={name:String};function ne(e){return()=>({type:`hidden`,name:e.name,value:e.modelValue})}function J(e){return(t,n,i)=>{t[n](r(`input`,{class:`hidden`+(i||``),...e===void 0?void 0:e()}))}}function re(e){return()=>e.name||e.for}function Y(n,i){let a=t(null),o=e(()=>n.disable?null:r(`span`,{ref:a,class:`no-outline`,tabindex:-1}));function s(e){let t=i.value;e?.qAvoidFocus!==!0&&t?.getAttribute(`aria-hidden`)!==`true`&&(e?.type.indexOf(`key`)===0?document.activeElement!==t&&t?.contains(document.activeElement)===!0&&t.focus({preventScroll:!0}):a.value!==null&&(e===void 0||t?.contains(e.target)===!0)&&a.value.focus({preventScroll:!0}))}return{refocusTargetEl:o,refocusTarget:s}}var X=l({xs:30,sm:35,md:40,lg:50,xl:60}),Z={...G,...p,...q,modelValue:{required:!0,default:null},val:{},trueValue:{default:!0},falseValue:{default:!1},indeterminateValue:{default:null},checkedIcon:String,uncheckedIcon:String,indeterminateIcon:String,toggleOrder:{type:String,validator:e=>e===`tf`||e===`ft`},toggleIndeterminate:Boolean,label:String,leftLabel:Boolean,color:String,keepColor:Boolean,dense:Boolean,disable:Boolean,tabindex:[String,Number]},Q=[`update:modelValue`];function ie(e){(e.keyCode===13||e.keyCode===32)&&o(e)}function $(s,c){let{props:l,slots:d,emit:p,proxy:m}=i(),h=K(l,a()),g=t(null),{refocusTargetEl:_,refocusTarget:v}=Y(l,g),y=e(()=>l.val!==void 0&&Array.isArray(l.modelValue)),b=e(()=>{let e=n(l.val);return y.value?l.modelValue.findIndex(t=>n(t)===e):-1}),x=e(()=>y.value?b.value!==-1:n(l.modelValue)===n(l.trueValue)),S=e(()=>y.value?b.value===-1:n(l.modelValue)===n(l.falseValue)),C=e(()=>!x.value&&!S.value),w=e(()=>l.disable?-1:l.tabindex||0),T=e(()=>`q-${s} cursor-pointer no-outline row inline no-wrap items-center`+(l.disable?` disabled`:``)+(h()?` q-${s}--dark`:``)+(l.dense?` q-${s}--dense`:``)+(l.leftLabel?` reverse`:``)),E=e(()=>`q-${s}__inner relative-position non-selectable q-${s}__inner--${x.value?`truthy`:S.value?`falsy`:`indet`}${l.color!==void 0&&(l.keepColor||(s===`toggle`?x.value:!S.value))?` text-${l.color}`:``}`),D=J(()=>{let e={type:`checkbox`};return l.name!==void 0&&Object.assign(e,{".checked":x.value,"^checked":x.value?`checked`:void 0,name:l.name,value:y.value?l.val:l.trueValue}),e}),O=e(()=>{let e={tabindex:w.value,role:s===`toggle`?`switch`:`checkbox`,"aria-label":l.label,"aria-checked":C.value?s===`toggle`?`false`:`mixed`:x.value?`true`:`false`};return l.disable&&(e[`aria-disabled`]=`true`),e});function k(e){e!==void 0&&(o(e),v(e)),l.disable||p(`update:modelValue`,A(),e)}function A(){if(y.value){if(x.value){let e=[...l.modelValue];return e.splice(b.value,1),e}return[...l.modelValue,l.val]}if(x.value){if(l.toggleOrder!==`ft`||!l.toggleIndeterminate)return l.falseValue}else if(S.value){if(l.toggleOrder===`ft`||!l.toggleIndeterminate)return l.trueValue}else return l.toggleOrder===`ft`?l.falseValue:l.trueValue;return l.indeterminateValue}function j(e){(e.keyCode===13||e.keyCode===32)&&k(e)}let M=c(x,C);return Object.assign(m,{toggle:k}),()=>{let e=M();l.disable||D(e,`unshift`,` q-${s}__native absolute q-ma-none q-pa-none`);let t=[r(`div`,{class:E.value,style:X(l.size),"aria-hidden":`true`},e)];_.value!==null&&t.push(_.value);let n=l.label===void 0?u(d.default):f(d.default,[l.label]);return n!==void 0&&t.push(r(`div`,{class:`q-${s}__label q-anchor--skip`},n)),r(`div`,{ref:g,class:T.value,...O.value,onClick:k,onKeydown:ie,onKeyup:j},t)}}var ae=s({name:`QToggle`,props:{...Z,icon:String,iconColor:String},emits:Q,setup(t){function n(n,i){let a=e(()=>(n.value?t.checkedIcon:i.value?t.indeterminateIcon:t.uncheckedIcon)||t.icon),o=e(()=>n.value?t.iconColor:null);return()=>[r(`div`,{class:`q-toggle__track`}),r(`div`,{class:`q-toggle__thumb absolute flex flex-center no-wrap`},a.value===void 0?void 0:[r(m,{name:a.value,color:o.value})])]}return $(`toggle`,n)}});export{D as C,O as S,b as _,X as a,x as b,J as c,K as d,G as f,S as g,ee as h,Z as i,re as l,te as m,$ as n,Y as o,H as p,Q as r,ne as s,ae as t,q as u,y as v,_ as x,A as y};

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.