* chore: remove marketplace components * feat: add static marketplace * feat: add entry point for static marketplace * doc: add comment * chore: include nostr-bundle.js
1 line
5.5 KiB
JavaScript
1 line
5.5 KiB
JavaScript
import{c as q,i as j,e as C,l as O,p as W,a as u,h as d,b as k,g as P,d as A,w as T,o as D,f as K,n as U,j as I,k as G,m as J,q as X,r as p,s as Y,t as L,u as _,v as Z,x as ee,_ as te,y as oe,z as ne,A as le,B as ie,C as B,D as x,E}from"./index.725caa24.js";import{Q as F}from"./QResizeObserver.bcb70109.js";var ae=q({name:"QPageContainer",setup(e,{slots:h}){const{proxy:{$q:n}}=P(),o=j(O,C);if(o===C)return console.error("QPageContainer needs to be child of QLayout"),C;W(A,!0);const i=u(()=>{const a={};return o.header.space===!0&&(a.paddingTop=`${o.header.size}px`),o.right.space===!0&&(a[`padding${n.lang.rtl===!0?"Left":"Right"}`]=`${o.right.size}px`),o.footer.space===!0&&(a.paddingBottom=`${o.footer.size}px`),o.left.space===!0&&(a[`padding${n.lang.rtl===!0?"Right":"Left"}`]=`${o.left.size}px`),a});return()=>d("div",{class:"q-page-container",style:i.value},k(h.default))}});const{passive:M}=G,re=["both","horizontal","vertical"];var se=q({name:"QScrollObserver",props:{axis:{type:String,validator:e=>re.includes(e),default:"vertical"},debounce:[String,Number],scrollTarget:{default:void 0}},emits:["scroll"],setup(e,{emit:h}){const n={position:{top:0,left:0},direction:"down",directionChanged:!1,delta:{top:0,left:0},inflectionPoint:{top:0,left:0}};let o=null,i,a;T(()=>e.scrollTarget,()=>{f(),y()});function c(){o!==null&&o();const g=Math.max(0,J(i)),m=X(i),s={top:g-n.position.top,left:m-n.position.left};if(e.axis==="vertical"&&s.top===0||e.axis==="horizontal"&&s.left===0)return;const S=Math.abs(s.top)>=Math.abs(s.left)?s.top<0?"up":"down":s.left<0?"left":"right";n.position={top:g,left:m},n.directionChanged=n.direction!==S,n.delta=s,n.directionChanged===!0&&(n.direction=S,n.inflectionPoint=n.position),h("scroll",{...n})}function y(){i=I(a,e.scrollTarget),i.addEventListener("scroll",r,M),r(!0)}function f(){i!==void 0&&(i.removeEventListener("scroll",r,M),i=void 0)}function r(g){if(g===!0||e.debounce===0||e.debounce==="0")c();else if(o===null){const[m,s]=e.debounce?[setTimeout(c,e.debounce),clearTimeout]:[requestAnimationFrame(c),cancelAnimationFrame];o=()=>{s(m),o=null}}}const{proxy:b}=P();return T(()=>b.$q.lang.rtl,c),D(()=>{a=b.$el.parentNode,y()}),K(()=>{o!==null&&o(),f()}),Object.assign(b,{trigger:r,getPosition:()=>n}),U}}),ce=q({name:"QLayout",props:{container:Boolean,view:{type:String,default:"hhh lpr fff",validator:e=>/^(h|l)h(h|r) lpr (f|l)f(f|r)$/.test(e.toLowerCase())},onScroll:Function,onScrollHeight:Function,onResize:Function},setup(e,{slots:h,emit:n}){const{proxy:{$q:o}}=P(),i=p(null),a=p(o.screen.height),c=p(e.container===!0?0:o.screen.width),y=p({position:0,direction:"down",inflectionPoint:0}),f=p(0),r=p(Y.value===!0?0:L()),b=u(()=>"q-layout q-layout--"+(e.container===!0?"containerized":"standard")),g=u(()=>e.container===!1?{minHeight:o.screen.height+"px"}:null),m=u(()=>r.value!==0?{[o.lang.rtl===!0?"left":"right"]:`${r.value}px`}:null),s=u(()=>r.value!==0?{[o.lang.rtl===!0?"right":"left"]:0,[o.lang.rtl===!0?"left":"right"]:`-${r.value}px`,width:`calc(100% + ${r.value}px)`}:null);function S(t){if(e.container===!0||document.qScrollPrevented!==!0){const l={position:t.position.top,direction:t.direction,directionChanged:t.directionChanged,inflectionPoint:t.inflectionPoint.top,delta:t.delta.top};y.value=l,e.onScroll!==void 0&&n("scroll",l)}}function N(t){const{height:l,width:v}=t;let w=!1;a.value!==l&&(w=!0,a.value=l,e.onScrollHeight!==void 0&&n("scrollHeight",l),R()),c.value!==v&&(w=!0,c.value=v),w===!0&&e.onResize!==void 0&&n("resize",t)}function V({height:t}){f.value!==t&&(f.value=t,R())}function R(){if(e.container===!0){const t=a.value>f.value?L():0;r.value!==t&&(r.value=t)}}let z=null;const H={instances:{},view:u(()=>e.view),isContainer:u(()=>e.container),rootRef:i,height:a,containerHeight:f,scrollbarWidth:r,totalWidth:u(()=>c.value+r.value),rows:u(()=>{const t=e.view.toLowerCase().split(" ");return{top:t[0].split(""),middle:t[1].split(""),bottom:t[2].split("")}}),header:_({size:0,offset:0,space:!1}),right:_({size:300,offset:0,space:!1}),footer:_({size:0,offset:0,space:!1}),left:_({size:300,offset:0,space:!1}),scroll:y,animate(){z!==null?clearTimeout(z):document.body.classList.add("q-body--layout-animate"),z=setTimeout(()=>{z=null,document.body.classList.remove("q-body--layout-animate")},155)},update(t,l,v){H[t][l]=v}};if(W(O,H),L()>0){let v=function(){t=null,l.classList.remove("hide-scrollbar")},w=function(){if(t===null){if(l.scrollHeight>o.screen.height)return;l.classList.add("hide-scrollbar")}else clearTimeout(t);t=setTimeout(v,300)},$=function(Q){t!==null&&Q==="remove"&&(clearTimeout(t),v()),window[`${Q}EventListener`]("resize",w)},t=null;const l=document.body;T(()=>e.container!==!0?"add":"remove",$),e.container!==!0&&$("add"),Z(()=>{$("remove")})}return()=>{const t=ee(h.default,[d(se,{onScroll:S}),d(F,{onResize:N})]),l=d("div",{class:b.value,style:g.value,ref:e.container===!0?void 0:i,tabindex:-1},t);return e.container===!0?d("div",{class:"q-layout-container overflow-hidden",ref:i},[d(F,{onResize:V}),d("div",{class:"absolute-full",style:m.value},[d("div",{class:"scroll",style:s.value},[l])])]):l}}});const ue=oe({name:"MainLayout",setup(){return{}}}),de={class:"row q-mb-sm q-mt-md"},fe=x("div",{class:"col-lg-2 col-md-1 col-sm-0"},null,-1),ve={class:"col-lg-8 col-md-10 col-sm-12 auto-width q-ml-md q-mr-md"},he=x("div",{class:"col-lg-2 col-md-1 col-sm-0"},null,-1);function ge(e,h,n,o,i,a){const c=ne("router-view");return le(),ie(ce,{view:"lHh Lpr lFf"},{default:B(()=>[x("div",de,[fe,x("div",ve,[E(ae,null,{default:B(()=>[E(c)]),_:1})]),he])]),_:1})}var ye=te(ue,[["render",ge]]);export{ye as default};
|