mirror of
https://gitee.com/wot-design-uni/wot-design-uni.git
synced 2025-12-06 17:18:40 +08:00
2 lines
4.7 KiB
JavaScript
2 lines
4.7 KiB
JavaScript
var a=Object.defineProperty,e=Object.defineProperties,t=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,n=(e,t,s)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,r=(a,e)=>{for(var t in e||(e={}))o.call(e,t)&&n(a,t,e[t]);if(s)for(var t of s(e))l.call(e,t)&&n(a,t,e[t]);return a},u=(a,s)=>e(a,t(s));import{b as i,c,_ as d,a as h}from"./page-wraper.D9WpzC1k.js";import{d as m,r as p,c as g,H as f,G as v,C as b,a7 as w,Z as _,b as j,g as y,w as $,h as I,i as O,q as x,aF as T,K as P,D,E as S,bc as z,V as B,m as C,F as H,e as M,f as A,n as V,j as F,t as G,l as k}from"./index-ChV97F5w.js";import{_ as E}from"./wd-cell-group.C1j5zmf1.js";import{b as U,t as Y,d as q,c as K,f as R,m as Z,_ as J}from"./base64.D3gEw_Hf.js";import{u as L}from"./useTouch.yh-0Hnfy.js";import{_ as N,a as Q}from"./wd-tabs.BeePpGhR.js";import"./wd-root-portal.BUSGVytV.js";import"./useChildren.C_02WC2s.js";import"./wd-badge.B8CK6WcG.js";import"./wd-sticky-box.BwR4vTrH.js";import"./wd-resize.CYHa5EIT.js";import"./useTranslate.BPiTMMfr.js";const W=u(r({},U),{height:Z(0),anchors:R(),safeAreaInsetBottom:K(!1),showScrollbar:Y,duration:q(300),contentDraggable:Y}),X=J(m(u(r({},{name:"wd-floating-panel",options:{virtualHost:!0,addGlobalClass:!0,styleIsolation:"shared"}}),{props:W,emits:["update:height","height-change"],setup(a,{emit:e}){const t=L(),s=a,o=e,l=p(s.height);let n;const r=p(0),u=p(!1),i=g((()=>({min:s.anchors[0]?s.anchors[0]:100,max:s.anchors[s.anchors.length-1]?s.anchors[s.anchors.length-1]:Math.round(.6*r.value)}))),c=g((()=>s.anchors.length>=2?s.anchors:[i.value.min,i.value.max])),d=g((()=>{const a={height:f(i.value.max),transform:`translateY(calc(100% + ${f(-l.value)}))`,transition:u.value?"none":`transform ${s.duration}ms cubic-bezier(0.18, 0.89, 0.32, 1.28)`};return`${v(a)}${s.customStyle}`})),h=a=>{l.value=a,o("update:height",a)},m=a=>{t.touchStart(a),u.value=!0,n=-l.value},B=a=>{if("content"==a.currentTarget.dataset.id&&!s.contentDraggable)return;t.touchMove(a);const e=t.deltaY.value+n;h(-H(e))},C=()=>{u.value=!1,h(z(c.value,l.value)),l.value!==-n&&o("height-change",{height:l.value})},H=a=>{const e=Math.abs(a),{min:t,max:s}=i.value;return e>s?-(s+.2*(e-s)):e<t?-(t-.2*(t-e)):a};return b((()=>s.height),(a=>{l.value=a})),b(i,(()=>{h(z(c.value,l.value))}),{immediate:!0}),w((()=>{const{windowHeight:a}=_();r.value=a})),(a,e)=>{const t=O,s=T;return y(),j(t,{class:x(`wd-floating-panel ${a.customClass} ${a.safeAreaInsetBottom?"is-safe":""}`),style:S(d.value),onTouchstartPassive:m,onTouchmovePassive:B,onTouchend:C,onTouchcancel:C},{default:$((()=>[I(t,{class:x("wd-floating-panel__header")},{default:$((()=>[I(t,{class:x("wd-floating-panel__header-bar")})])),_:1}),I(s,{class:x("wd-floating-panel__content"),"data-id":"content","show-scrollbar":a.showScrollbar,"scroll-y":"",onTouchmove:P(B,["stop","prevent"])},{default:$((()=>[D(a.$slots,"default",{},void 0,!0)])),_:3},8,["show-scrollbar"])])),_:3},8,["class","style"])}}})),[["__scopeId","data-v-27b23456"]]),aa=J(m({__name:"Index",setup(a){const{show:e}=i(),t=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],s=p(0),o=p(0),l=p(0),n=p([]),r=({height:a})=>{e(f(a))};return B((()=>{l.value=_().windowHeight,n.value=[100,Math.round(.4*l.value),Math.round(.7*l.value)],o.value=n.value[1]})),(a,e)=>{const l=M(A("wd-toast"),c),u=M(A("wd-cell"),d),i=M(A("wd-cell-group"),E),m=M(A("wd-floating-panel"),X),p=M(A("wd-tab"),N),g=O,v=M(A("wd-tabs"),Q),b=M(A("page-wraper"),h);return y(),C(H,null,[I(l),I(g,{class:"floating-panel"},{default:$((()=>[I(b,null,{default:$((()=>[I(v,{modelValue:s.value,"onUpdate:modelValue":e[1]||(e[1]=a=>s.value=a)},{default:$((()=>[I(p,{title:a.$t("ji-chu-yong-fa-1")},{default:$((()=>[I(m,{safeAreaInsetBottom:""},{default:$((()=>[I(i,{border:""},{default:$((()=>[(y(),C(H,null,V(t,(a=>I(u,{key:a,title:a},null,8,["title"]))),64))])),_:1})])),_:1})])),_:1},8,["title"]),I(p,{title:a.$t("zi-ding-yi-mao-dian-0")},{default:$((()=>[I(m,{height:o.value,"onUpdate:height":e[0]||(e[0]=a=>o.value=a),anchors:n.value,safeAreaInsetBottom:"",onHeightChange:r},{default:$((()=>[I(g,{class:"inner-content"},{default:$((()=>[F(G(a.$t('"zi-ding-yi-mao-dian"'))+" "+G(n.value.map(k(f)))+" - "+G(k(f)(o.value.toFixed(0))),1)])),_:1})])),_:1},8,["height","anchors"])])),_:1},8,["title"]),I(p,{title:a.$t("jin-tou-bu-tuo-zhuai-0")},{default:$((()=>[I(m,{contentDraggable:!1},{default:$((()=>[I(g,{class:"inner-content"},{default:$((()=>[F(G(a.$t("nei-rong-qu-bu-ke-yi-tuo-zhuai")),1)])),_:1})])),_:1})])),_:1},8,["title"])])),_:1},8,["modelValue"])])),_:1})])),_:1})],64)}}}),[["__scopeId","data-v-303ac8e3"]]);export{aa as default};
|