GateWay/web/js/619.a1ca49f9.js

1 line
48 KiB
JavaScript
Raw Normal View History

2024-11-13 11:26:59 +08:00
"use strict";(self["webpackChunkset_vue"]=self["webpackChunkset_vue"]||[]).push([[619],{1125:function(){},4259:function(){},696:function(e,t,l){l.r(t),l.d(t,{default:function(){return Ut}});var o=l(6769),n=l(6987),a=(l(6463),l(4726)),i=l(6768),r=l(144),s=l(5828),u=l(6370),c=l(8442),d=l(240),v=l(7905),p=l(9725),m=l(6591),h=l(4390),f=l(6145);const[b,g]=(0,s.YX)("swipe-cell"),w={name:(0,u.TU)(""),disabled:Boolean,leftWidth:u.VQ,rightWidth:u.VQ,beforeClose:Function,stopPropagation:Boolean};var k=(0,i.pM)({name:b,props:w,emits:["open","close","click"],setup(e,{emit:t,slots:l}){let o,n,a,s;const u=(0,r.KR)(),b=(0,r.KR)(),w=(0,r.KR)(),k=(0,r.Kh)({offset:0,dragging:!1}),y=(0,h.P)(),C=e=>e.value?(0,m.yD)(e).width:0,V=(0,i.EW)((()=>(0,c.C8)(e.leftWidth)?+e.leftWidth:C(b))),x=(0,i.EW)((()=>(0,c.C8)(e.rightWidth)?+e.rightWidth:C(w))),F=l=>{k.offset="left"===l?V.value:-x.value,o||(o=!0,t("open",{name:e.name,position:l}))},S=l=>{k.offset=0,o&&(o=!1,t("close",{name:e.name,position:l}))},R=e=>{const t=Math.abs(k.offset),l=.15,n=o?1-l:l,a="left"===e?V.value:x.value;a&&t>a*n?F(e):S(e)},T=t=>{e.disabled||(a=k.offset,y.start(t))},_=t=>{if(e.disabled)return;const{deltaX:l}=y;if(y.move(t),y.isHorizontal()){n=!0,k.dragging=!0;const i=!o||l.value*a<0;i&&(0,d.wo)(t,e.stopPropagation),k.offset=(0,v.qE)(l.value+a,-x.value,V.value)}},I=()=>{k.dragging&&(k.dragging=!1,R(k.offset>0?"left":"right"),setTimeout((()=>{n=!1}),0))},B=(l="outside")=>{s||(t("click",l),o&&!n&&(s=!0,(0,p.m)(e.beforeClose,{args:[{name:e.name,position:l}],done:()=>{s=!1,S(l)},canceled:()=>s=!1,error:()=>s=!1})))},P=(e,t)=>l=>{t&&l.stopPropagation(),B(e)},E=(e,t)=>{const o=l[e];if(o)return(0,i.bF)("div",{ref:t,class:g(e),onClick:P(e,!0)},[o()])};return(0,f.c)({open:F,close:S}),(0,m.W3)(u,(()=>B("outside")),{eventName:"touchstart"}),(0,m.ML)("touchmove",_,{target:u}),()=>{var e;const t={transform:`translate3d(${k.offset}px, 0, 0)`,transitionDuration:k.dragging?"0s":".6s"};return(0,i.bF)("div",{ref:u,class:g(),onClick:P("cell",n),onTouchstartPassive:T,onTouchend:I,onTouchcancel:I},[(0,i.bF)("div",{class:g("wrapper"),style:t},[E("left",b),null==(e=l.default)?void 0:e.call(l),E("right",w)])])}}});const y=(0,a.G)(k);l(6647);var C=l(5632),V=(l(7708),l(7484),l(122)),x=(l(9998),l(3064)),F=(l(269),l(4371),l(4612));l(4114);const[S,R,T]=(0,s.YX)("picker"),_=e=>e.find((e=>!e.disabled))||e[0];function I(e,t){const l=e[0];if(l){if(Array.isArray(l))return"multiple";if(t.children in l)return"cascade"}return"default"}function B(e,t){t=(0,v.qE)(t,0,e.length);for(let l=t;l<e.length;l++)if(!e[l].disabled)return l;for(let l=t-1;l>=0;l--)if(!e[l].disabled)return l;return 0}const P=(e,t,l)=>void 0!==t&&!!e.find((e=>e[l.value]===t));function E(e,t,l){const o=e.findIndex((e=>e[l.value]===t)),n=B(e,o);return e[n]}function U(e,t,l){const o=[];let n={[t.children]:e},a=0;while(n&&n[t.children]){const e=n[t.children],i=l.value[a];if(n=(0,c.C8)(i)?E(e,i,t):void 0,!n&&e.length){const l=_(e)[t.value];n=E(e,l,t)}a++,o.push(e)}return o}function K(e){const{transform:t}=window.getComputedStyle(e),l=t.slice(7,t.length-1).split(", ")[5];return Number(l)}function O(e){return(0,c.X$)({text:"text",value:"value",children:"children"},e)}var W=l(2094);const $=200,M=300,L=15,[N,X]=(0,s.YX)("picker-column"),z=Symbol(N);var Y=(0,i.pM)({name:N,props:{value:u.VQ,fields:(0,u.$g)(Object),options:(0,u.zj)(),readonly:Boolean,allowHtml:Boolean,optionHeight:(0,u.$g)(Number),swipeDuration:(0,u.$g)(u.VQ),visibleOptionNum:(0,u.$g)(u.VQ)},emits:["change","clickOption","scrollInto"],setup(e,{emit:t,slots:l}){let o,n,a,s,u;const c=(0,r.KR)(),p=(0,r.KR)(),b=(0,r.KR)(0),g=(0,r.KR)(0),w=(0,h.P)(),k=()=>e.options.length,y=()=>e.optionHeight*(+e.visibleOptionNum-1)/2,C=l=>{let n=B(e.options,l);const a=-n*e.optionHeight,i=()=>{n>k()-1&&(n=B(e.options,l));const o=e.options[n][e.fields.value];o!==e.value&&t("change",o)};o&&a!==b.value?u=i:i(),b.value=a},V=()=>e.readonly||!e.options.length,x=l=>{o||V()||(u=null,g.value=$,C(l),t("clickOption",e.options[l]))},F=t=>(0,v.qE)(Math.round(-t/e.optionHeight),0,k()-1),S=(0,i.EW)((()=>F(b.value))),R=(t,l)=>{