1 |
- System.register(["./index-legacy-e5fdf239.js","./index-legacy-997d7b8d.js"],(function(e,o){"use strict";var t,l,n,a,i,r,s,c,u,d,m,p,v,h,g,b,f,C,S,T,B,x,H,y,k,w,O,D,A,L,M,P,V,F,G,I,N,E;return{setters:[e=>{t=e.aU,l=e.bi,n=e.bj,a=e.bk,i=e.d,r=e.bl,s=e.bm,c=e.bn,u=e.l,d=e.bo,m=e.e,p=e.bp,v=e.bq,h=e.br,g=e.bs,b=e.f,f=e.bt,C=e.bu,S=e.bv,T=e.bw,B=e.bx,x=e.by,H=e.bz,y=e.w,k=e.bA,w=e.bB,O=e.bC,D=e.bD,A=e.ae,L=e.bE,M=e.aX,P=e.bF,V=e.bG,F=e.c,G=e.bH,I=e.bI,N=e.bJ},e=>{E=e.u}],execute:function(){const[o,R,W]=t("picker"),$=e=>e.find((e=>!e.disabled))||e[0];function j(e,o){for(let t=o=a(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 z=(e,o,t)=>void 0!==o&&!!e.find((e=>e[t.value]===o));function X(e,o,t){const l=e.findIndex((e=>e[t.value]===o));return e[j(e,l)]}const[K,Q]=t("picker-column"),q=Symbol(K);var J=i({name:K,props:{value:r,fields:s(Object),options:c(),readonly:Boolean,allowHtml:Boolean,optionHeight:s(Number),swipeDuration:s(r),visibleOptionNum:s(r)},emits:["change","clickOption","scrollInto"],setup(e,{emit:o,slots:t}){let l,n,i,r,s;const c=u(),C=u(),S=u(0),T=u(0),B=d(),x=()=>e.options.length,H=()=>e.optionHeight*(+e.visibleOptionNum-1)/2,y=t=>{let n=j(e.options,t);const a=-n*e.optionHeight,i=()=>{n>x()-1&&(n=j(e.options,t));const l=e.options[n][e.fields.value];l!==e.value&&o("change",l)};l&&a!==S.value?s=i:i(),S.value=a},k=()=>e.readonly||!e.options.length,w=o=>a(Math.round(-o/e.optionHeight),0,x()-1),O=m((()=>w(S.value))),D=()=>{l=!1,T.value=0,s&&(s(),s=null)},A=e=>{if(!k()){if(B.start(e),l){const e=function(e){const{transform:o}=window.getComputedStyle(e),t=o.slice(7,o.length-1).split(", ")[5];return Number(t)}(C.value);S.value=Math.min(0,e-H())}T.value=0,n=S.value,i=Date.now(),r=n,s=null}},L=()=>{if(k())return;const o=S.value-r,t=Date.now()-i;if(t<300&&Math.abs(o)>15)return void((o,t)=>{const l=Math.abs(o/t);o=S.value+l/.003*(o<0?-1:1);const n=w(o);T.value=+e.swipeDuration,y(n)})(o,t);const n=w(S.value);T.value=200,y(n),setTimeout((()=>{l=!1}),0)},M=()=>{const n={height:`${e.optionHeight}px`};return e.options.map(((a,i)=>{const r=a[e.fields.text],{disabled:c}=a,u=a[e.fields.value],d={role:"button",style:n,tabindex:c?-1:0,class:[Q("item",{disabled:c,selected:u===e.value}),a.className],onClick:()=>(t=>{l||k()||(s=null,T.value=200,y(t),o("clickOption",e.options[t]))})(i)},m={class:"van-ellipsis",[e.allowHtml?"innerHTML":"textContent"]:r};return b("li",d,[t.option?t.option(a,i):b("div",m,null)])}))};return p(q),v({stopMomentum:D}),h((()=>{const o=l?Math.floor(-S.value/e.optionHeight):e.options.findIndex((o=>o[e.fields.value]===e.value)),t=j(e.options,o),n=-t*e.optionHeight;l&&t<o&&D(),S.value=n})),g("touchmove",(t=>{if(k())return;B.move(t),B.isVertical()&&(l=!0,f(t,!0));const s=a(n+B.deltaY.value,-x()*e.optionHeight,e.optionHeight),c=w(s);c!==O.value&&o("scrollInto",e.options[c]),S.value=s;const u=Date.now();u-i>300&&(i=u,r=s)}),{target:c}),()=>b("div",{ref:c,class:Q(),onTouchstartPassive:A,onTouchend:L,onTouchcancel:L},[b("ul",{ref:C,style:{transform:`translate3d(0, ${S.value+H()}px, 0)`,transitionDuration:`${T.value}ms`,transitionProperty:T.value?"all":"none"},class:Q("wrapper"),onTransitionend:D},[M()])])}});const[U]=t("picker-toolbar"),Y={title:String,cancelButtonText:String,confirmButtonText:String},Z=["cancel","confirm","title","toolbar"],_=Object.keys(Y);var ee=i({name:U,props:Y,emits:["confirm","cancel"],setup(e,{emit:o,slots:t}){const l=()=>o("cancel"),n=()=>o("confirm"),a=()=>{const o=e.cancelButtonText||W("cancel");return b("button",{type:"button",class:[R("cancel"),C],onClick:l},[t.cancel?t.cancel():o])},i=()=>{const o=e.confirmButtonText||W("confirm");return b("button",{type:"button",class:[R("confirm"),C],onClick:n},[t.confirm?t.confirm():o])};return()=>b("div",{class:R("toolbar")},[t.toolbar?t.toolbar():[a(),t.title?t.title():e.title?b("div",{class:[R("title"),"van-ellipsis"]},[e.title]):void 0,i()]])}});const[oe,te]=t("picker-group"),le=Symbol(oe);n({tabs:c(),activeTab:S(0),nextStepText:String},Y);const ne=n({loading:Boolean,readonly:Boolean,allowHtml:Boolean,optionHeight:S(44),showToolbar:T,swipeDuration:S(1e3),visibleOptionNum:S(6)},Y),ae=n({},ne,{columns:c(),modelValue:c(),toolbarPosition:B("top"),columnsFieldNames:Object});var ie=i({name:o,props:ae,emits:["confirm","cancel","change","scrollInto","clickOption","update:modelValue"],setup(e,{emit:o,slots:t}){const a=u(),i=u(e.modelValue.slice(0)),{parent:r}=p(le),{children:s,linkChildren:c}=x(q);c();const d=m((()=>function(e){return n({text:"text",value:"value",children:"children"},e)}(e.columnsFieldNames))),h=m((()=>H(e.optionHeight))),C=m((()=>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=m((()=>{const{columns:o}=e;switch(C.value){case"multiple":return o;case"cascade":return function(e,o,t){const n=[];let a={[o.children]:e},i=0;for(;a&&a[o.children];){const e=a[o.children],r=t.value[i];a=l(r)?X(e,r,o):void 0,!a&&e.length&&(a=X(e,$(e)[o.value],o)),i++,n.push(e)}return n}(o,d.value,i);default:return[o]}})),T=m((()=>S.value.some((e=>e.length)))),B=m((()=>S.value.map(((e,o)=>X(e,i.value[o],d.value))))),M=m((()=>S.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:B.value,selectedIndexes:M.value}),F=()=>{s.forEach((e=>e.stopMomentum()));const e=V();return A((()=>{o("confirm",e)})),e},G=()=>o("cancel",V()),I=()=>S.value.map(((l,a)=>b(J,{value:i.value[a],fields:d.value,options:l,readonly:e.readonly,allowHtml:e.allowHtml,optionHeight:h.value,swipeDuration:e.swipeDuration,visibleOptionNum:e.visibleOptionNum,onChange:e=>((e,t)=>{P(t,e),"cascade"===C.value&&i.value.forEach(((e,o)=>{const t=S.value[o];z(t,e,d.value)||P(o,t.length?t[0][d.value.value]:void 0)})),A((()=>{o("change",n({columnIndex:t},V()))}))})(e,a),onClickOption:e=>((e,t)=>{const l={columnIndex:t,currentOption:e};o("clickOption",n(V(),l)),o("scrollInto",l)})(e,a),onScrollInto:e=>{o("scrollInto",{currentOption:e,columnIndex:a})}},{option:t.option}))),N=e=>{if(T.value){const o={height:`${h.value}px`},t={backgroundSize:`100% ${(e-h.value)/2}px`};return[b("div",{class:R("mask"),style:t},null),b("div",{class:[L,R("frame")],style:o},null)]}},E=()=>{const o=h.value*+e.visibleOptionNum,t={height:`${o}px`};return b("div",{ref:a,class:R("columns"),style:t},[I(),N(o)])},W=()=>{if(e.showToolbar&&!r)return b(ee,D(O(e,_),{onConfirm:F,onCancel:G}),O(t,Z))};let j;return y(S,(e=>{e.forEach(((e,o)=>{e.length&&!z(e,i.value[o],d.value)&&P(o,$(e)[d.value.value])}))}),{immediate:!0}),y((()=>e.modelValue),(e=>{k(e,i.value)||k(e,j)||(i.value=e.slice(0),j=e.slice(0))}),{deep:!0}),y(i,(t=>{k(t,e.modelValue)||(j=t.slice(0),o("update:modelValue",j))}),{immediate:!0}),g("touchmove",f,{target:a}),v({confirm:F,getSelectedOptions:()=>B.value}),()=>{var o,l;return b("div",{class:R()},["top"===e.toolbarPosition?W():null,e.loading?b(w,{class:R("loading")},null):null,null==(o=t["columns-top"])?void 0:o.call(t),E(),null==(l=t["columns-bottom"])?void 0:l.call(t),"bottom"===e.toolbarPosition?W():null])}}});e("a",M(ie));const[re,se,ce]=t("list"),ue={error:Boolean,offset:S(300),loading:Boolean,disabled:Boolean,finished:Boolean,scroller:Object,errorText:String,direction:B("down"),loadingText:String,finishedText:String,immediateCheck:T};var de=i({name:re,props:ue,emits:["load","update:error","update:loading"],setup(e,{emit:o,slots:t}){const l=u(e.loading),n=u(),a=u(),i=E(),r=P(n),s=m((()=>e.scroller||r.value)),c=()=>{A((()=>{if(l.value||e.finished||e.disabled||e.error||!1===(null==i?void 0:i.value))return;const{direction:t}=e,r=+e.offset,c=G(s);if(!c.height||I(n))return;let u=!1;const d=G(a);u="up"===t?c.top-d.top<=r:d.bottom-c.bottom<=r,u&&(l.value=!0,o("update:loading",!0),o("load"))}))},d=()=>{if(e.finished){const o=t.finished?t.finished():e.finishedText;if(o)return b("div",{class:se("finished-text")},[o])}},p=()=>{o("update:error",!1),c()},h=()=>{if(e.error){const o=t.error?t.error():e.errorText;if(o)return b("div",{role:"button",class:se("error-text"),tabindex:0,onClick:p},[o])}},f=()=>{if(l.value&&!e.finished&&!e.disabled)return b("div",{class:se("loading")},[t.loading?t.loading():b(w,{class:se("loading-icon")},{default:()=>[e.loadingText||ce("loading")]})])};return y((()=>[e.loading,e.finished,e.error]),c),i&&y(i,(e=>{e&&c()})),V((()=>{l.value=e.loading})),F((()=>{e.immediateCheck&&c()})),v({check:c}),g("scroll",c,{target:s,passive:!0}),()=>{var o;const i=null==(o=t.default)?void 0:o.call(t),r=b("div",{ref:a,class:se("placeholder")},null);return b("div",{ref:n,role:"feed",class:se(),"aria-busy":l.value},["down"===e.direction?i:r,f(),d(),h(),"up"===e.direction?i:r])}}});e("L",M(de));const[me,pe]=t("progress"),ve={color:String,inactive:Boolean,pivotText:String,textColor:String,showPivot:T,pivotColor:String,trackColor:String,strokeWidth:r,percentage:{type:r,default:0,validator:e=>+e>=0&&+e<=100}};var he=i({name:me,props:ve,setup(e){const o=m((()=>e.inactive?void 0:e.color)),t=()=>{const{textColor:t,pivotText:l,pivotColor:n,percentage:a}=e,i=null!=l?l:`${a}%`;if(e.showPivot&&i){const l={color:t,left:+a+"%",transform:`translate(-${+a}%,-50%)`,background:n||o.value};return b("span",{style:l,class:pe("pivot",{inactive:e.inactive})},[i])}};return()=>{const{trackColor:l,percentage:n,strokeWidth:a}=e,i={background:l,height:N(a)},r={width:`${n}%`,background:o.value};return b("div",{class:pe(),style:i},[b("span",{class:pe("portion",{inactive:e.inactive}),style:r},null),t()])}}});e("P",M(he));const ge={"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:"口风琴","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 ge)if(o.toLocaleLowerCase().replace(/ /g,"").includes(e))return ge[o];for(let o in ge){const t=o.toLocaleLowerCase().replace(/ /g,"");if(e.includes(t))return ge[o]}return""}))}}}));
|