1 |
- System.register(["./index-legacy-71db9258.js","./index-legacy-5f47be38.js"],(function(e,o){"use strict";var t,a,n,l,i,r,s,c,u,d,m,p,v,h,b,g,f,T,C,S,B,k,x,y,H,w,O,D,L,P,A,M,V,F,G,N,R,E,W,$;return{setters:[e=>{t=e.aV,a=e.bt,n=e.bu,l=e.bv,i=e.d,r=e.bw,s=e.bx,c=e.by,u=e.l,d=e.bz,m=e.bA,p=e.bB,v=e.bC,h=e.bD,b=e.f,g=e.bE,f=e.bF,T=e.bG,C=e.bH,S=e.bI,B=e.bJ,k=e.bK,x=e.e,y=e.bL,H=e.w,w=e.bM,O=e.bN,D=e.bO,L=e.as,P=e.bP,A=e.aY,M=e.bQ,V=e.bR,F=e.c,G=e.bS,N=e.bT,R=e.bU},e=>{E=e.T,W=e.c,$=e.u}],execute:function(){const[o,I,j]=t("picker"),z=e=>e.find((e=>!e.disabled))||e[0];function K(e,o){for(let t=o=l(o,0,e.length);t<e.length;t++)if(!e[t].disabled)return t;for(let t=o-1;t>=0;t--)if(!e[t].disabled)return t;return 0}const Q=(e,o,t)=>void 0!==o&&!!e.find((e=>e[t.value]===o));function U(e,o,t){const a=e.findIndex((e=>e[t.value]===o));return e[K(e,a)]}const[X,Y]=t("picker-column"),J=Symbol(X);var q=i({name:X,props:{value:r,fields:s(Object),options:c(),readonly:Boolean,allowHtml:Boolean,optionHeight:s(Number),swipeDuration:s(r),visibleOptionNum:s(r)},emits:["change","clickOption"],setup(e,{emit:o,slots:t}){let a,n,i,r,s;const c=u(),f=u(),T=u(0),C=u(0),S=d(),B=()=>e.options.length,k=()=>e.optionHeight*(+e.visibleOptionNum-1)/2,x=t=>{const n=K(e.options,t),l=-n*e.optionHeight,i=()=>{const t=e.options[n][e.fields.value];t!==e.value&&o("change",t)};a&&l!==T.value?s=i:i(),T.value=l},y=()=>e.readonly||!e.options.length,H=o=>l(Math.round(-o/e.optionHeight),0,B()-1),w=()=>{a=!1,C.value=0,s&&(s(),s=null)},O=e=>{if(!y()){if(S.start(e),a){const e=function(e){const{transform:o}=window.getComputedStyle(e),t=o.slice(7,o.length-1).split(", ")[5];return Number(t)}(f.value);T.value=Math.min(0,e-k())}C.value=0,n=T.value,i=Date.now(),r=n,s=null}},D=()=>{if(y())return;const o=T.value-r,t=Date.now()-i;if(t<300&&Math.abs(o)>15)return void((o,t)=>{const a=Math.abs(o/t);o=T.value+a/.003*(o<0?-1:1);const n=H(o);C.value=+e.swipeDuration,x(n)})(o,t);const n=H(T.value);C.value=200,x(n),setTimeout((()=>{a=!1}),0)},L=()=>{const n={height:`${e.optionHeight}px`};return e.options.map(((l,i)=>{const r=l[e.fields.text],{disabled:c}=l,u=l[e.fields.value],d={role:"button",style:n,tabindex:c?-1:0,class:[Y("item",{disabled:c,selected:u===e.value}),l.className],onClick:()=>(t=>{a||y()||(s=null,C.value=200,x(t),o("clickOption",e.options[t]))})(i)},m={class:"van-ellipsis",[e.allowHtml?"innerHTML":"textContent"]:r};return b("li",d,[t.option?t.option(l,i):b("div",m,null)])}))};return m(J),p({stopMomentum:w}),v((()=>{const o=e.options.findIndex((o=>o[e.fields.value]===e.value)),t=-K(e.options,o)*e.optionHeight;T.value=t})),h("touchmove",(o=>{if(y())return;S.move(o),S.isVertical()&&(a=!0,g(o,!0)),T.value=l(n+S.deltaY.value,-B()*e.optionHeight,e.optionHeight);const t=Date.now();t-i>300&&(i=t,r=T.value)}),{target:c}),()=>b("div",{ref:c,class:Y(),onTouchstartPassive:O,onTouchend:D,onTouchcancel:D},[b("ul",{ref:f,style:{transform:`translate3d(0, ${T.value+k()}px, 0)`,transitionDuration:`${C.value}ms`,transitionProperty:C.value?"all":"none"},class:Y("wrapper"),onTransitionend:w},[L()])])}});const[Z]=t("picker-toolbar"),_={title:String,cancelButtonText:String,confirmButtonText:String},ee=["cancel","confirm","title","toolbar"],oe=Object.keys(_);var te=i({name:Z,props:_,emits:["confirm","cancel"],setup(e,{emit:o,slots:t}){const a=()=>o("cancel"),n=()=>o("confirm"),l=()=>{const o=e.cancelButtonText||j("cancel");return b("button",{type:"button",class:[I("cancel"),f],onClick:a},[t.cancel?t.cancel():o])},i=()=>{const o=e.confirmButtonText||j("confirm");return b("button",{type:"button",class:[I("confirm"),f],onClick:n},[t.confirm?t.confirm():o])};return()=>b("div",{class:I("toolbar")},[t.toolbar?t.toolbar():[l(),t.title?t.title():e.title?b("div",{class:[I("title"),"van-ellipsis"]},[e.title]):void 0,i()]])}});const[ae,ne]=t("picker-group"),le=Symbol(ae),ie=n({tabs:c(),nextStepText:String},_);i({name:ae,props:ie,emits:["confirm","cancel"],setup(e,{emit:o,slots:t}){const a=u(0),{children:n,linkChildren:l}=T(le);l();const i=()=>a.value<e.tabs.length-1&&e.nextStepText,r=()=>{i()?a.value++:o("confirm",n.map((e=>e.confirm())))},s=()=>o("cancel");return()=>{var o;const n=null==(o=t.default)?void 0:o.call(t),l=i()?e.nextStepText:e.confirmButtonText;return b("div",{class:ne()},[b(te,{title:e.title,cancelButtonText:e.cancelButtonText,confirmButtonText:l,onConfirm:r,onCancel:s},C(t,ee)),b(E,{active:a.value,"onUpdate:active":e=>a.value=e,class:ne("tabs"),shrink:!0,animated:!0,lazyRender:!1},{default:()=>[e.tabs.map(((e,o)=>b(W,{title:e,titleClass:ne("tab-title")},{default:()=>[null==n?void 0:n[o]]})))]})])}}});const re=n({loading:Boolean,readonly:Boolean,allowHtml:Boolean,optionHeight:S(44),showToolbar:B,swipeDuration:S(1e3),visibleOptionNum:S(6)},_),se=n({},re,{columns:c(),modelValue:c(),toolbarPosition:k("top"),columnsFieldNames:Object});var ce=i({name:o,props:se,emits:["confirm","cancel","change","clickOption","update:modelValue"],setup(e,{emit:o,slots:t}){const l=u(),i=u(e.modelValue.slice(0)),{parent:r}=m(le),{children:s,linkChildren:c}=T(J);c();const d=x((()=>function(e){return n({text:"text",value:"value",children:"children"},e)}(e.columnsFieldNames))),v=x((()=>y(e.optionHeight))),f=x((()=>function(e,o){const t=e[0];if(t){if(Array.isArray(t))return"multiple";if(o.children in t)return"cascade"}return"default"}(e.columns,d.value))),S=x((()=>{const{columns:o}=e;switch(f.value){case"multiple":return o;case"cascade":return function(e,o,t){const n=[];let l={[o.children]:e},i=0;for(;l&&l[o.children];){const e=l[o.children],r=t.value[i];l=a(r)?U(e,r,o):void 0,!l&&e.length&&(l=U(e,z(e)[o.value],o)),i++,n.push(e)}return n}(o,d.value,i);default:return[o]}})),B=x((()=>S.value.some((e=>e.length)))),k=x((()=>S.value.map(((e,o)=>U(e,i.value[o],d.value))))),A=x((()=>S.value.map(((e,o)=>e.findIndex((e=>e[d.value.value]===i.value[o])))))),M=(e,o)=>{if(i.value[e]!==o){const t=i.value.slice(0);t[e]=o,i.value=t}},V=()=>({selectedValues:i.value.slice(0),selectedOptions:k.value,selectedIndexes:A.value}),F=()=>{s.forEach((e=>e.stopMomentum()));const e=V();return L((()=>{o("confirm",e)})),e},G=()=>o("cancel",V()),N=()=>S.value.map(((a,l)=>b(q,{value:i.value[l],fields:d.value,options:a,readonly:e.readonly,allowHtml:e.allowHtml,optionHeight:v.value,swipeDuration:e.swipeDuration,visibleOptionNum:e.visibleOptionNum,onChange:e=>((e,t)=>{M(t,e),"cascade"===f.value&&i.value.forEach(((e,o)=>{const t=S.value[o];Q(t,e,d.value)||M(o,t.length?t[0][d.value.value]:void 0)})),L((()=>{o("change",n({columnIndex:t},V()))}))})(e,l),onClickOption:e=>((e,t)=>o("clickOption",n({columnIndex:t,currentOption:e},V())))(e,l)},{option:t.option}))),R=e=>{if(B.value){const o={height:`${v.value}px`},t={backgroundSize:`100% ${(e-v.value)/2}px`};return[b("div",{class:I("mask"),style:t},null),b("div",{class:[P,I("frame")],style:o},null)]}},E=()=>{const o=v.value*+e.visibleOptionNum,t={height:`${o}px`};return b("div",{ref:l,class:I("columns"),style:t},[N(),R(o)])},W=()=>{if(e.showToolbar&&!r)return b(te,D(C(e,oe),{onConfirm:F,onCancel:G}),C(t,ee))};let $;return H(S,(e=>{e.forEach(((e,o)=>{e.length&&!Q(e,i.value[o],d.value)&&M(o,z(e)[d.value.value])}))}),{immediate:!0}),H((()=>e.modelValue),(e=>{w(e,i.value)||w(e,$)||(i.value=e.slice(0),$=e.slice(0))}),{deep:!0}),H(i,(t=>{w(t,e.modelValue)||($=t.slice(0),o("update:modelValue",$))}),{immediate:!0}),h("touchmove",g,{target:l}),p({confirm:F,getSelectedOptions:()=>k.value}),()=>{var o,a;return b("div",{class:I()},["top"===e.toolbarPosition?W():null,e.loading?b(O,{class:I("loading")},null):null,null==(o=t["columns-top"])?void 0:o.call(t),E(),null==(a=t["columns-bottom"])?void 0:a.call(t),"bottom"===e.toolbarPosition?W():null])}}});e("a",A(ce));const[ue,de,me]=t("list"),pe={error:Boolean,offset:S(300),loading:Boolean,disabled:Boolean,finished:Boolean,errorText:String,direction:k("down"),loadingText:String,finishedText:String,immediateCheck:B};var ve=i({name:ue,props:pe,emits:["load","update:error","update:loading"],setup(e,{emit:o,slots:t}){const a=u(e.loading),n=u(),l=u(),i=$(),r=M(n),s=()=>{L((()=>{if(a.value||e.finished||e.disabled||e.error||!1===(null==i?void 0:i.value))return;const{direction:t}=e,s=+e.offset,c=G(r);if(!c.height||N(n))return;let u=!1;const d=G(l);u="up"===t?c.top-d.top<=s:d.bottom-c.bottom<=s,u&&(a.value=!0,o("update:loading",!0),o("load"))}))},c=()=>{if(e.finished){const o=t.finished?t.finished():e.finishedText;if(o)return b("div",{class:de("finished-text")},[o])}},d=()=>{o("update:error",!1),s()},m=()=>{if(e.error){const o=t.error?t.error():e.errorText;if(o)return b("div",{role:"button",class:de("error-text"),tabindex:0,onClick:d},[o])}},v=()=>{if(a.value&&!e.finished&&!e.disabled)return b("div",{class:de("loading")},[t.loading?t.loading():b(O,{class:de("loading-icon")},{default:()=>[e.loadingText||me("loading")]})])};return H((()=>[e.loading,e.finished,e.error]),s),i&&H(i,(e=>{e&&s()})),V((()=>{a.value=e.loading})),F((()=>{e.immediateCheck&&s()})),p({check:s}),h("scroll",s,{target:r,passive:!0}),()=>{var o;const i=null==(o=t.default)?void 0:o.call(t),r=b("div",{ref:l,class:de("placeholder")},null);return b("div",{ref:n,role:"feed",class:de(),"aria-busy":a.value},["down"===e.direction?i:r,v(),c(),m(),"up"===e.direction?i:r])}}});e("L",A(ve));const[he,be]=t("progress"),ge={color:String,inactive:Boolean,pivotText:String,textColor:String,showPivot:B,pivotColor:String,trackColor:String,strokeWidth:r,percentage:{type:r,default:0,validator:e=>+e>=0&&+e<=100}};var fe=i({name:he,props:ge,setup(e){const o=x((()=>e.inactive?void 0:e.color)),t=()=>{const{textColor:t,pivotText:a,pivotColor:n,percentage:l}=e,i=null!=a?a:`${l}%`;if(e.showPivot&&i){const a={color:t,left:+l+"%",transform:`translate(-${+l}%,-50%)`,background:n||o.value};return b("span",{style:a,class:be("pivot",{inactive:e.inactive})},[i])}};return()=>{const{trackColor:a,percentage:n,strokeWidth:l}=e,i={background:a,height:R(l)},r={width:`${n}%`,background:o.value};return b("div",{class:be(),style:i},[b("span",{class:be("portion",{inactive:e.inactive}),style:r},null),t()])}}});e("P",A(fe));const Te={"Acoustic Grand Piano":"大钢琴","Bright Acoustic Piano":"明亮的钢琴","Electric Grand Piano":"电钢琴","Rhodes Piano":"柔和的电钢琴","Chorused Piano":"加合唱效果的电钢琴",Harpsichord:"羽管键琴",Clavichord:"科拉维科特琴",Celesta:"钢片琴",Glockenspiel:"钢片琴","Music box":"八音盒",Vibraphone:"颤音琴",Marimba:"马林巴",Xylophone:"木琴","Tubular Bells":"管钟",Dulcimer:"大扬琴","Hammond Organ":"击杆风琴","Percussive Organ":"打击式风琴","Rock Organ":"摇滚风琴","Church Organ":"教堂风琴","Reed Organ":"簧管风琴",Accordian:"手风琴",Harmonica:"口琴","Tango Accordian":"探戈手风琴","Acoustic Guitar":"钢弦吉他","Electric Guitar":"闷音电吉他","Overdriven Guitar":"加驱动效果的电吉他","Distortion Guitar":"加失真效果的电吉他","Guitar Harmonics":"吉他和音","Acoustic Bass":"大贝司","Electric Bass":"电贝司","Fretless Bass":"无品贝司","Slap Bass":"掌击","Synth Bass":"电子合成",Violin:"小提琴",Viola:"中提琴",Cello:"大提琴",Contrabass:"低音大提琴","Tremolo Strings":"弦乐群颤音音色","Pizzicato Strings":"弦乐群拨弦音色","Orchestral Harp":"竖琴",Timpani:"定音鼓","String Ensemble":"弦乐合奏音色","Synth Strings":"合成弦乐合奏音色","Choir Aahs":"人声合唱","Voice Oohs":"人声","Synth Voice":"合成人声","Orchestra Hit":"管弦乐敲击齐奏",Trumpet:"小号",Trombone:"长号",Tuba:"大号","Muted Trumpet":"加弱音器小号","French Horn":"法国号","Brass Section":"铜管组","Synth Brass":"合成铜管音色","Soprano Sax":"高音萨克斯管","Alto Sax":"中音萨克斯管","Tenor Sax":"次中音萨克斯管","Baritone Sax":"低音萨克斯管",Oboe:"双簧管","English Horn":"英国管",Bassoon:"巴松",Clarinet:"单簧管","Soprano Saxophone":"高音萨克斯管","Alto Saxophone":"中音萨克斯管","Tenor Saxophone":"次中音萨克斯管","Baritone Saxophone":"低音萨克斯管",Piccolo:"短笛",Flute:"长笛",Recorder:"竖笛","Soprano Recorder":"高音竖笛","Pan Flute":"排箫","Bottle Blow":"瓶木管",Whistle:"口哨声",Ocarina:"陶笛",Lead:"合成主音","Lead lead":"合成主音","Pad age":"合成音色",Pad:"合成音色",FX:"合成效果 科幻",Sitar:"西塔尔",Banjo:"班卓琴",Shamisen:"三昧线",Koto:"十三弦筝",Kalimba:"卡林巴",Bagpipe:"风笛",Fiddle:"民族提琴",Shanai:"山奈","Tinkle Bell":"叮当铃",Agogos:"阿戈戈铃","Steel Drums":"钢鼓","Taiko Drum":"太鼓","Melodic Toms":"嗵嗵鼓","Synth Drums":"合成鼓","Reverse Cymbals":"反向镲","Agogo Bells":"阿戈戈铃","Taiko Drums":"太鼓",Bongos:"邦戈鼓","Bongo Bell":"邦戈铃",Congas:"康加鼓",Guiro:"刮壶","Guitar Fret Noise":"吉他换把杂音","Breath Noise":"呼吸声",Seashore:"海浪声","Bird Tweet":"鸟鸣","Telephone Ring":"电话铃",Helicopter:"直升机",Applause:"鼓掌声",Gunshot:"枪声","Acoustic Bass Drum":"大鼓","Bass Drum":"大鼓","Side Drum":"小鼓鼓边","Acoustic Snare":"小鼓","Hand Claps":"拍手","Electric Snare":"小鼓","Low Floor Tom":"低音嗵鼓","Closed Hi-Hat":"闭合踩镲","High Floor Tom":"高音落地嗵鼓","Pedal Hi-Hat":"脚踏踩镲","Low Tom":"低音嗵鼓","Open Hi-Hat":"开音踩镲","Low-Mid Tom":"中低音嗵鼓","Hi Mid Tom":"高音鼓","Crash Cymbals":"对镲","High Tom":"高音嗵鼓","Ride Cymbals":"叮叮镲","Chinese Cymbals":"中国镲","Ride Bell":"圆铃",Tambourine:"铃鼓","Splash Cymbal":"溅音镲",Cowbell:"牛铃","Crash Cymbal":"强音钹","Vibra-Slap":"颤音器","Ride Cymbal":"打点钹","Hi Bongo":"高音邦戈鼓","Low Bongo":"低音邦戈鼓","Mute Hi Conga":"弱音高音康加鼓","Open Hi Conga":"强音高音康加鼓","Low Conga":"低音康加鼓","High Timbale":"高音天巴鼓","Low Timbale":"低音天巴鼓","High Agogo":"高音阿戈戈铃","Low Agogo":"低音阿戈戈铃",Cabasa:"卡巴萨",Maracas:"沙锤","Short Whistle":"短口哨","Long Whistle":"长口哨","Short Guiro":"短刮壶","Long Guiro":"长刮壶",Claves:"响棒","Hi Wood Block":"高音木鱼","Low Wood Block":"低音木鱼","Mute Triangle":"弱音三角铁","Open Triangle":"强音三角铁","Drum Set":"架子鼓","Hulusi flute":"葫芦丝",Melodica:"口风琴",Nai:"口风琴","Snare Drum":"小军鼓",Cymbal:"镲",Cymbals:"镲","Horn in F":"圆号",Triangle:"三角铁",Vibrato:"颤音琴","Suspend Cymbals":"吊镲","Suspended Cymbals":"吊镲","Tom-Toms":"嗵嗵鼓",Bell:"铃铛",Bells:"铃铛","Alto Clarinet":"中音单簧管","Bass Clarinet":"低音单簧管",Cornet:"短号",Euphonium:"上低音号","crash cymbals":"对镲",Castanets:"响板",Shaker:"沙锤","Mark tree":"音树",Chimes:"管钟","Mark Tree":"音树","Tom-toms":"嗵嗵鼓","Hi-Hat":"踩镲","Sleigh Bells":"雪橇铃",Flexatone:"弹音器","Brake drum":"闸鼓",Gong:"锣","concert tom":"音乐会嗵嗵鼓","brake drum":"车轮鼓","finger cymbal":"指钹","ride cymbal":"叮叮镲","Concert Toms":"音乐会嗵嗵鼓",Vibraslap:"弹音器","Wood Blocks":"木鱼","Temple Blocks":"木鱼","Wood Block":"木鱼","Field Drum":"军鼓","Quad-Toms":"筒鼓",Quads:"筒鼓","Drums set":"架子鼓","High Bongo":"邦戈",Timbales:"天巴鼓"};e("g",((e="")=>{if(!(e=e.toLocaleLowerCase().replace(/ /g,"")))return"";for(let o in Te)if(o.toLocaleLowerCase().replace(/ /g,"").includes(e))return Te[o];for(let o in Te){const t=o.toLocaleLowerCase().replace(/ /g,"");if(e.includes(t))return Te[o]}return""})),e("s",((e,o)=>{let t=0;switch(e){case"长笛":t=1;break;case"单簧管":t=2;break;case"中音单簧管":t=3;break;case"低音单簧管":t=4;break;case"高音萨克斯风":t=5;break;case"中音萨克斯风":t=6;break;case"次中音萨克斯风":t=7;break;case"低音萨克斯风":t=8;break;case"小号":t=9;break;case"长号":t=10;break;case"圆号":t=11;break;case"大号":t=12;break;case"上低音号":t=13;break;default:t=o+14}return t}))}}}));
|