1 |
- System.register(["./index-legacy-ae1873ef.js","./index-legacy-a68a78f7.js"],(function(e,o){"use strict";var t,a,l,n,i,r,s,c,u,d,m,p,v,b,h,g,f,T,C,B,S,x,k,H,y,w,O,D,L,A,M,P,V,F,G,N,R,E,W;return{setters:[e=>{t=e.aW,a=e.by,l=e.bz,n=e.bA,i=e.d,r=e.bB,s=e.bC,c=e.bD,u=e.l,d=e.bE,m=e.bF,p=e.bG,v=e.bH,b=e.bI,h=e.f,g=e.bJ,f=e.bK,T=e.bL,C=e.bM,B=e.bN,S=e.bO,x=e.bP,k=e.e,H=e.bQ,y=e.w,w=e.bR,O=e.bS,D=e.bT,L=e.at,A=e.bU,M=e.aZ,P=e.bV,V=e.bW,F=e.c,G=e.bX,N=e.bY},e=>{R=e.T,E=e.c,W=e.u}],execute:function(){const[o,I,j]=t("picker"),$=e=>e.find((e=>!e.disabled))||e[0];function z(e,o){for(let t=o=n(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 K=(e,o,t)=>void 0!==o&&!!e.find((e=>e[t.value]===o));function Q(e,o,t){const a=e.findIndex((e=>e[t.value]===o));return e[z(e,a)]}const[X,U]=t("picker-column"),Y=Symbol(X);var J=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,l,i,r,s;const c=u(),f=u(),T=u(0),C=u(0),B=d(),S=()=>e.options.length,x=()=>e.optionHeight*(+e.visibleOptionNum-1)/2,k=t=>{const l=z(e.options,t),n=-l*e.optionHeight,i=()=>{const t=e.options[l][e.fields.value];t!==e.value&&o("change",t)};a&&n!==T.value?s=i:i(),T.value=n},H=()=>e.readonly||!e.options.length,y=o=>n(Math.round(-o/e.optionHeight),0,S()-1),w=()=>{a=!1,C.value=0,s&&(s(),s=null)},O=e=>{if(!H()){if(B.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-x())}C.value=0,l=T.value,i=Date.now(),r=l,s=null}},D=()=>{if(H())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 l=y(o);C.value=+e.swipeDuration,k(l)})(o,t);const l=y(T.value);C.value=200,k(l),setTimeout((()=>{a=!1}),0)},L=()=>{const l={height:`${e.optionHeight}px`};return e.options.map(((n,i)=>{const r=n[e.fields.text],{disabled:c}=n,u=n[e.fields.value],d={role:"button",style:l,tabindex:c?-1:0,class:[U("item",{disabled:c,selected:u===e.value}),n.className],onClick:()=>(t=>{a||H()||(s=null,C.value=200,k(t),o("clickOption",e.options[t]))})(i)},m={class:"van-ellipsis",[e.allowHtml?"innerHTML":"textContent"]:r};return h("li",d,[t.option?t.option(n,i):h("div",m,null)])}))};return m(Y),p({stopMomentum:w}),v((()=>{const o=e.options.findIndex((o=>o[e.fields.value]===e.value)),t=-z(e.options,o)*e.optionHeight;T.value=t})),b("touchmove",(o=>{if(H())return;B.move(o),B.isVertical()&&(a=!0,g(o,!0)),T.value=n(l+B.deltaY.value,-S()*e.optionHeight,e.optionHeight);const t=Date.now();t-i>300&&(i=t,r=T.value)}),{target:c}),()=>h("div",{ref:c,class:U(),onTouchstartPassive:O,onTouchend:D,onTouchcancel:D},[h("ul",{ref:f,style:{transform:`translate3d(0, ${T.value+x()}px, 0)`,transitionDuration:`${C.value}ms`,transitionProperty:C.value?"all":"none"},class:U("wrapper"),onTransitionend:w},[L()])])}});const[Z]=t("picker-toolbar"),q={title:String,cancelButtonText:String,confirmButtonText:String},_=["cancel","confirm","title","toolbar"],ee=Object.keys(q);var oe=i({name:Z,props:q,emits:["confirm","cancel"],setup(e,{emit:o,slots:t}){const a=()=>o("cancel"),l=()=>o("confirm"),n=()=>{const o=e.cancelButtonText||j("cancel");return h("button",{type:"button",class:[I("cancel"),f],onClick:a},[t.cancel?t.cancel():o])},i=()=>{const o=e.confirmButtonText||j("confirm");return h("button",{type:"button",class:[I("confirm"),f],onClick:l},[t.confirm?t.confirm():o])};return()=>h("div",{class:I("toolbar")},[t.toolbar?t.toolbar():[n(),t.title?t.title():e.title?h("div",{class:[I("title"),"van-ellipsis"]},[e.title]):void 0,i()]])}});const[te,ae]=t("picker-group"),le=Symbol(te),ne=l({tabs:c(),nextStepText:String},q);i({name:te,props:ne,emits:["confirm","cancel"],setup(e,{emit:o,slots:t}){const a=u(0),{children:l,linkChildren:n}=T(le);n();const i=()=>a.value<e.tabs.length-1&&e.nextStepText,r=()=>{i()?a.value++:o("confirm",l.map((e=>e.confirm())))},s=()=>o("cancel");return()=>{var o;const l=null==(o=t.default)?void 0:o.call(t),n=i()?e.nextStepText:e.confirmButtonText;return h("div",{class:ae()},[h(oe,{title:e.title,cancelButtonText:e.cancelButtonText,confirmButtonText:n,onConfirm:r,onCancel:s},C(t,_)),h(R,{active:a.value,"onUpdate:active":e=>a.value=e,class:ae("tabs"),shrink:!0,animated:!0,lazyRender:!1},{default:()=>[e.tabs.map(((e,o)=>h(E,{title:e,titleClass:ae("tab-title")},{default:()=>[null==l?void 0:l[o]]})))]})])}}});const ie=l({loading:Boolean,readonly:Boolean,allowHtml:Boolean,optionHeight:B(44),showToolbar:S,swipeDuration:B(1e3),visibleOptionNum:B(6)},q),re=l({},ie,{columns:c(),modelValue:c(),toolbarPosition:x("top"),columnsFieldNames:Object});var se=i({name:o,props:re,emits:["confirm","cancel","change","clickOption","update:modelValue"],setup(e,{emit:o,slots:t}){const n=u(),i=u(e.modelValue.slice(0)),{parent:r}=m(le),{children:s,linkChildren:c}=T(Y);c();const d=k((()=>function(e){return l({text:"text",value:"value",children:"children"},e)}(e.columnsFieldNames))),v=k((()=>H(e.optionHeight))),f=k((()=>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))),B=k((()=>{const{columns:o}=e;switch(f.value){case"multiple":return o;case"cascade":return function(e,o,t){const l=[];let n={[o.children]:e},i=0;for(;n&&n[o.children];){const e=n[o.children],r=t.value[i];n=a(r)?Q(e,r,o):void 0,!n&&e.length&&(n=Q(e,$(e)[o.value],o)),i++,l.push(e)}return l}(o,d.value,i);default:return[o]}})),S=k((()=>B.value.some((e=>e.length)))),x=k((()=>B.value.map(((e,o)=>Q(e,i.value[o],d.value))))),M=k((()=>B.value.map(((e,o)=>e.findIndex((e=>e[d.value.value]===i.value[o])))))),P=(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:x.value,selectedIndexes:M.value}),F=()=>{s.forEach((e=>e.stopMomentum()));const e=V();return L((()=>{o("confirm",e)})),e},G=()=>o("cancel",V()),N=()=>B.value.map(((a,n)=>h(J,{value:i.value[n],fields:d.value,options:a,readonly:e.readonly,allowHtml:e.allowHtml,optionHeight:v.value,swipeDuration:e.swipeDuration,visibleOptionNum:e.visibleOptionNum,onChange:e=>((e,t)=>{P(t,e),"cascade"===f.value&&i.value.forEach(((e,o)=>{const t=B.value[o];K(t,e,d.value)||P(o,t.length?t[0][d.value.value]:void 0)})),L((()=>{o("change",l({columnIndex:t},V()))}))})(e,n),onClickOption:e=>((e,t)=>o("clickOption",l({columnIndex:t,currentOption:e},V())))(e,n)},{option:t.option}))),R=e=>{if(S.value){const o={height:`${v.value}px`},t={backgroundSize:`100% ${(e-v.value)/2}px`};return[h("div",{class:I("mask"),style:t},null),h("div",{class:[A,I("frame")],style:o},null)]}},E=()=>{const o=v.value*+e.visibleOptionNum,t={height:`${o}px`};return h("div",{ref:n,class:I("columns"),style:t},[N(),R(o)])},W=()=>{if(e.showToolbar&&!r)return h(oe,D(C(e,ee),{onConfirm:F,onCancel:G}),C(t,_))};let j;return y(B,(e=>{e.forEach(((e,o)=>{e.length&&!K(e,i.value[o],d.value)&&P(o,$(e)[d.value.value])}))}),{immediate:!0}),y((()=>e.modelValue),(e=>{w(e,i.value)||w(e,j)||(i.value=e.slice(0),j=e.slice(0))}),{deep:!0}),y(i,(t=>{w(t,e.modelValue)||(j=t.slice(0),o("update:modelValue",j))}),{immediate:!0}),b("touchmove",g,{target:n}),p({confirm:F,getSelectedOptions:()=>x.value}),()=>{var o,a;return h("div",{class:I()},["top"===e.toolbarPosition?W():null,e.loading?h(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("P",M(se));const[ce,ue,de]=t("list"),me={error:Boolean,offset:B(300),loading:Boolean,disabled:Boolean,finished:Boolean,errorText:String,direction:x("down"),loadingText:String,finishedText:String,immediateCheck:S};var pe=i({name:ce,props:me,emits:["load","update:error","update:loading"],setup(e,{emit:o,slots:t}){const a=u(e.loading),l=u(),n=u(),i=W(),r=P(l),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(l))return;let u=!1;const d=G(n);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 h("div",{class:ue("finished-text")},[o])}},d=()=>{o("update:error",!1),s()},m=()=>{if(e.error){const o=t.error?t.error():e.errorText;if(o)return h("div",{role:"button",class:ue("error-text"),tabindex:0,onClick:d},[o])}},v=()=>{if(a.value&&!e.finished&&!e.disabled)return h("div",{class:ue("loading")},[t.loading?t.loading():h(O,{class:ue("loading-icon")},{default:()=>[e.loadingText||de("loading")]})])};return y((()=>[e.loading,e.finished,e.error]),s),i&&y(i,(e=>{e&&s()})),V((()=>{a.value=e.loading})),F((()=>{e.immediateCheck&&s()})),p({check:s}),b("scroll",s,{target:r,passive:!0}),()=>{var o;const i=null==(o=t.default)?void 0:o.call(t),r=h("div",{ref:n,class:ue("placeholder")},null);return h("div",{ref:l,role:"feed",class:ue(),"aria-busy":a.value},["down"===e.direction?i:r,v(),c(),m(),"up"===e.direction?i:r])}}});e("L",M(pe));const ve={"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 ve)if(o.toLocaleLowerCase().replace(/ /g,"").includes(e))return ve[o];for(let o in ve){const t=o.toLocaleLowerCase().replace(/ /g,"");if(e.includes(t))return ve[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}))}}}));
|