index-legacy-2e328223.js 2.5 KB

1
  1. !function(){const t=["window"];function e(t,e){if(null==t)return{};var o,n,i=function(t,e){if(null==t)return{};var o,n,i={},r=Object.keys(t);for(n=0;n<r.length;n++)o=r[n],e.indexOf(o)>=0||(i[o]=t[o]);return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(n=0;n<r.length;n++)o=r[n],e.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(t,o)&&(i[o]=t[o])}return i}System.register(["./index-legacy-8aae7957.js","./index-legacy-835c2a22.js"],(function(o,n){"use strict";var i,r,s,c,d,l,f,a,u,p,y;return{setters:[t=>{i=t.t,r=t.b,s=t.i},t=>{c=t.c,d=t.S,l=t.Q,f=t.az,a=t.o,u=t.d,p=t.r,y=t.a}],execute:function(){var n=document.createElement("style");n.textContent="._sticky_4d2w6_1{position:sticky;top:0;z-index:99}._white_4d2w6_6{background-color:#fff}._white_4d2w6_6>div{padding-top:.4rem;box-shadow:0 0 .26667rem rgba(216,216,216,.5)}\n",document.head.appendChild(n);function m(t){var e;const o=r(t);return null!=(e=null==o?void 0:o.$el)?e:o}const v=s?window:void 0;function h(t){const e=function(){const t=l(!1);return f()&&a((()=>{t.value=!0})),t}();return c((()=>(e.value,Boolean(t()))))}o("O",u({name:"m-sticky",props:{position:{type:String,"default":"top"},mode:{type:String,"default":"fixed"},offsetTop:{type:String,"default":"0px"},offsetBottom:{"default":"0px"},varName:{type:String,"default":"--header-height"}},emits:["barHeight"],setup(o,{slots:n,emit:r}){const s=p({divStyle:{},heightV:0,sectionStyle:{width:"100%",height:"auto",left:"0"}}),f=l(),u=l();return a((()=>{"top"===o.position?s.divStyle.top=o.offsetTop||"0px":s.divStyle.bottom=o.offsetBottom||"0px";try{!function(o,n,r={}){const{window:s=v}=r,l=e(r,t);let f;const a=h((()=>s&&"ResizeObserver"in s)),u=()=>{f&&(f.disconnect(),f=void 0)},p=c((()=>Array.isArray(o)?o.map((t=>m(t))):[m(o)])),y=d(p,(t=>{if(u(),a.value&&s){f=new ResizeObserver(n);for(const e of t)e&&f.observe(e,l)}}),{immediate:!0,flush:"post",deep:!0});i((()=>{u(),y()}))}(u.value,(t=>{const e=t[0],{height:n}=e.contentRect;Math.abs(n-s.heightV)>1&&setTimeout((()=>{(t=>{s.sectionStyle.height=`${t}px`,s.heightV=t,document.documentElement.style.setProperty(o.varName,`${t}px`),r("barHeight",t)})(n)}),10)}))}catch(n){}})),d((()=>o.offsetTop),(()=>{s.divStyle.top=o.offsetTop})),d((()=>o.offsetBottom),(()=>{s.divStyle.bottom=o.offsetBottom})),()=>y("div",{style:[s.sectionStyle],"class":"sticky"===o.mode&&"_sticky_4d2w6_1"},[y("div",{ref:f,"class":["van-sticky","fixed"===o.mode?"van-sticky--fixed":""],style:[s.divStyle,s.sectionStyle]},[y("div",{ref:u},[n["default"]&&n["default"]()])])])}}))}}}))}();