Files
bruno/app/dist/spa/assets/userstore-SjLknvTP.js
2026-02-19 18:54:57 +01:00

2 lines
9.3 KiB
JavaScript

import{c as le,aI as B,P as se,t as ue,Q as re,g as $,r as H,a as c,aJ as ce,R as de,aK as fe,S as me,aL as ve,w as Y,f as J,z as Z,C as G,u as ge,h as T,aS as he,b as pe,H as K,F as ye,A as be,au as Se,az as Fe,aU as xe,ax as Te,aA as Ce,aV as Pe,aB as ee,aW as Oe,aw as ke,E as we,k as ze,aX as Ee,as as Ae}from"./index-GXFLJtQL.js";import{v as Ve,a as te,g as je,p as ae,d as De,e as _e,f as Ne,r as ne,s as qe,c as ie,h as Ie}from"./LocalStorage-DjXJ9f5H.js";import{a as He}from"./QChip-DE2_FO3B.js";const $e=le({name:"QTooltip",inheritAttrs:!1,props:{...je,...re,...B,maxHeight:{type:String,default:null},maxWidth:{type:String,default:null},transitionShow:{...B.transitionShow,default:"jump-down"},transitionHide:{...B.transitionHide,default:"jump-up"},anchor:{type:String,default:"bottom middle",validator:te},self:{type:String,default:"top middle",validator:te},offset:{type:Array,default:()=>[14,14],validator:Ve},scrollTarget:ue,delay:{type:Number,default:0},hideDelay:{type:Number,default:0},persistent:Boolean},emits:[...se],setup(e,{slots:v,emit:C,attrs:b}){let o,s;const y=$(),{proxy:{$q:d}}=y,S=H(null),x=H(!1),w=c(()=>ae(e.anchor,d.lang.rtl)),z=c(()=>ae(e.self,d.lang.rtl)),E=c(()=>e.persistent!==!0),{registerTick:N,removeTick:q}=ce(),{registerTimeout:l}=de(),{transitionProps:A,transitionStyle:I}=fe(e),{localScrollTarget:t,changeScrollEvent:h,unconfigureScrollTarget:P}=De(e,D),{anchorEl:f,canShow:n,anchorEvents:r}=_e({showing:x,configureAnchorEl:p}),{show:F,hide:i}=me({showing:x,canShow:n,handleShow:U,handleHide:j,hideOnRouteChange:E,processOnMount:!0});Object.assign(r,{delayShow:a,delayHide:m});const{showPortal:u,hidePortal:V,renderPortal:R}=ve(y,S,oe,"tooltip");if(d.platform.is.mobile===!0){const g={anchorEl:f,innerRef:S,onClickOutside(k){return i(k),k.target.classList.contains("q-dialog__backdrop")&&K(k),!0}},W=c(()=>e.modelValue===null&&e.persistent!==!0&&x.value===!0);Y(W,k=>{(k===!0?Ne:ne)(g)}),J(()=>{ne(g)})}function U(g){u(),N(()=>{s=new MutationObserver(()=>O()),s.observe(S.value,{attributes:!1,childList:!0,characterData:!0,subtree:!0}),O(),D()}),o===void 0&&(o=Y(()=>d.screen.width+"|"+d.screen.height+"|"+e.self+"|"+e.anchor+"|"+d.lang.rtl,O)),l(()=>{u(!0),C("show",g)},e.transitionDuration)}function j(g){q(),V(),L(),l(()=>{V(!0),C("hide",g)},e.transitionDuration)}function L(){s!==void 0&&(s.disconnect(),s=void 0),o!==void 0&&(o(),o=void 0),P(),Z(r,"tooltipTemp")}function O(){qe({targetEl:S.value,offset:e.offset,anchorEl:f.value,anchorOrigin:w.value,selfOrigin:z.value,maxHeight:e.maxHeight,maxWidth:e.maxWidth})}function a(g){if(d.platform.is.mobile===!0){ie(),document.body.classList.add("non-selectable");const W=f.value,k=["touchmove","touchcancel","touchend","click"].map(X=>[W,X,"delayHide","passiveCapture"]);G(r,"tooltipTemp",k)}l(()=>{F(g)},e.delay)}function m(g){d.platform.is.mobile===!0&&(Z(r,"tooltipTemp"),ie(),setTimeout(()=>{document.body.classList.remove("non-selectable")},10)),l(()=>{i(g)},e.hideDelay)}function p(){if(e.noParentEvent===!0||f.value===null)return;const g=d.platform.is.mobile===!0?[[f.value,"touchstart","delayShow","passive"]]:[[f.value,"mouseenter","delayShow","passive"],[f.value,"mouseleave","delayHide","passive"]];G(r,"anchor",g)}function D(){if(f.value!==null||e.scrollTarget!==void 0){t.value=ge(f.value,e.scrollTarget);const g=e.noParentEvent===!0?O:i;h(t.value,g)}}function M(){return x.value===!0?T("div",{...b,ref:S,class:["q-tooltip q-tooltip--style q-position-engine no-pointer-events",b.class],style:[b.style,I.value],role:"tooltip"},pe(v.default)):null}function oe(){return T(he,A.value,M)}return J(L),Object.assign(y.proxy,{updatePosition:O}),R}});function _(e,v,C,b){const o=[];return e.forEach(s=>{b(s)===!0?o.push(s):v.push({failedPropValidation:C,file:s})}),o}function Q(e){e?.dataTransfer&&(e.dataTransfer.dropEffect="copy"),K(e)}const Re={multiple:Boolean,accept:String,capture:String,maxFileSize:[Number,String],maxTotalSize:[Number,String],maxFiles:[Number,String],filter:Function},Ue=["rejected"];function Le({editable:e,dnd:v,getFileInput:C,addFilesToQueue:b}){const{props:o,emit:s,proxy:y}=$(),d=H(null),S=c(()=>o.accept!==void 0?o.accept.split(",").map(t=>(t=t.trim(),t==="*"?"*/":(t.endsWith("/*")&&(t=t.slice(0,t.length-1)),t.toUpperCase()))):null),x=c(()=>parseInt(o.maxFiles,10)),w=c(()=>parseInt(o.maxTotalSize,10));function z(t){if(e.value)if(t!==Object(t)&&(t={target:null}),t.target?.matches('input[type="file"]')===!0)t.clientX===0&&t.clientY===0&&ye(t);else{const h=C();h!==t.target&&h?.click(t)}}function E(t){e.value&&t&&b(null,t)}function N(t,h,P,f){let n=Array.from(h||t.target.files);const r=[],F=()=>{r.length!==0&&s("rejected",r)};if(o.accept!==void 0&&S.value.indexOf("*/")===-1&&(n=_(n,r,"accept",i=>S.value.some(u=>i.type.toUpperCase().startsWith(u)||i.name.toUpperCase().endsWith(u))),n.length===0))return F();if(o.maxFileSize!==void 0){const i=parseInt(o.maxFileSize,10);if(n=_(n,r,"max-file-size",u=>u.size<=i),n.length===0)return F()}if(o.multiple!==!0&&n.length!==0&&(n=[n[0]]),n.forEach(i=>{i.__key=i.webkitRelativePath+i.lastModified+i.name+i.size}),f===!0){const i=P.map(u=>u.__key);n=_(n,r,"duplicate",u=>i.includes(u.__key)===!1)}if(n.length===0)return F();if(o.maxTotalSize!==void 0){let i=f===!0?P.reduce((u,V)=>u+V.size,0):0;if(n=_(n,r,"max-total-size",u=>(i+=u.size,i<=w.value)),n.length===0)return F()}if(typeof o.filter=="function"){const i=o.filter(n);n=_(n,r,"filter",u=>i.includes(u))}if(o.maxFiles!==void 0){let i=f===!0?P.length:0;if(n=_(n,r,"max-files",()=>(i++,i<=x.value)),n.length===0)return F()}if(F(),n.length!==0)return n}function q(t){Q(t),v.value!==!0&&(v.value=!0)}function l(t){K(t),(t.relatedTarget!==null||be.is.safari!==!0?t.relatedTarget!==d.value:document.elementsFromPoint(t.clientX,t.clientY).includes(d.value)===!1)===!0&&(v.value=!1)}function A(t){Q(t);const h=t.dataTransfer.files;h.length!==0&&b(null,h),v.value=!1}function I(t){if(v.value===!0)return T("div",{ref:d,class:`q-${t}__dnd absolute-full`,onDragenter:Q,onDragover:Q,onDragleave:l,onDrop:A})}return Object.assign(y,{pickFiles:z,addFiles:E}),{pickFiles:z,addFiles:E,onDragover:q,onDragleave:l,processFiles:N,getDndNode:I,maxFilesNumber:x,maxTotalSizeNumber:w}}const Ke=le({name:"QFile",inheritAttrs:!1,props:{...xe,...Fe,...Re,modelValue:[File,FileList,Array],append:Boolean,useChips:Boolean,displayValue:[String,Number],tabindex:{type:[String,Number],default:0},counterLabel:Function,inputClass:[Array,String,Object],inputStyle:[Array,String,Object]},emits:[...Se,...Ue],setup(e,{slots:v,emit:C,attrs:b}){const{proxy:o}=$(),s=Te(),y=H(null),d=H(!1),S=Ce(e),{pickFiles:x,onDragover:w,onDragleave:z,processFiles:E,getDndNode:N}=Le({editable:s.editable,dnd:d,getFileInput:R,addFilesToQueue:U}),q=Pe(e),l=c(()=>Object(e.modelValue)===e.modelValue?"length"in e.modelValue?Array.from(e.modelValue):[e.modelValue]:[]),A=c(()=>ee(l.value)),I=c(()=>l.value.map(a=>a.name).join(", ")),t=c(()=>Ie(l.value.reduce((a,m)=>a+m.size,0))),h=c(()=>({totalSize:t.value,filesNumber:l.value.length,maxFiles:e.maxFiles})),P=c(()=>({tabindex:-1,type:"file",title:"",accept:e.accept,capture:e.capture,name:S.value,...b,id:s.targetUid.value,disabled:s.editable.value!==!0})),f=c(()=>"q-file q-field--auto-height"+(d.value===!0?" q-file--dnd":"")),n=c(()=>e.multiple===!0&&e.append===!0);function r(a){const m=l.value.slice();m.splice(a,1),i(m)}function F(a){const m=l.value.indexOf(a);m!==-1&&r(m)}function i(a){C("update:modelValue",e.multiple===!0?a:a[0])}function u(a){a.keyCode===13&&we(a)}function V(a){(a.keyCode===13||a.keyCode===32)&&x(a)}function R(){return y.value}function U(a,m){const p=E(a,m,l.value,n.value),D=R();D!=null&&(D.value=""),p!==void 0&&((e.multiple===!0?e.modelValue&&p.every(M=>l.value.includes(M)):e.modelValue===p[0])||i(n.value===!0?l.value.concat(p):p))}function j(){return[T("input",{class:[e.inputClass,"q-file__filler"],style:e.inputStyle})]}function L(){if(v.file!==void 0)return l.value.length===0?j():l.value.map((m,p)=>v.file({index:p,file:m,ref:this}));if(v.selected!==void 0)return l.value.length===0?j():v.selected({files:l.value,ref:this});if(e.useChips===!0)return l.value.length===0?j():l.value.map((m,p)=>T(He,{key:"file-"+p,removable:s.editable.value,dense:!0,textColor:e.color,tabindex:e.tabindex,onRemove:()=>{r(p)}},()=>T("span",{class:"ellipsis",textContent:m.name})));const a=e.displayValue!==void 0?e.displayValue:I.value;return a.length!==0?[T("div",{class:e.inputClass,style:e.inputStyle,textContent:a})]:j()}function O(){const a={ref:y,...P.value,...q.value,class:"q-field__input fit absolute-full cursor-pointer",onChange:U};return e.multiple===!0&&(a.multiple=!0),T("input",a)}return Object.assign(s,{fieldClass:f,emitValue:i,hasValue:A,inputRef:y,innerValue:l,floatingLabel:c(()=>A.value===!0||ee(e.displayValue)),computedCounter:c(()=>{if(e.counterLabel!==void 0)return e.counterLabel(h.value);const a=e.maxFiles;return`${l.value.length}${a!==void 0?" / "+a:""} (${t.value})`}),getControlChild:()=>N("file"),getControl:()=>{const a={ref:s.targetRef,class:"q-field__native row items-center cursor-pointer",tabindex:e.tabindex};return s.editable.value===!0&&Object.assign(a,{onDragover:w,onDragleave:z,onKeydown:u,onKeyup:V}),T("div",a,[O()].concat(L()))}}),Object.assign(o,{removeAtIndex:r,removeFile:F,getNativeElement:()=>y.value}),Oe(o,"nativeEl",()=>y.value),ke(s)}});function Xe(){return ze(Ee)}const Qe="00000000-0000-0000-0000-000000000000",Ye=Ae("userstore",{state:()=>({id:Qe})});export{$e as Q,Ye as a,Ke as b,Xe as u};