| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057 |
- "use strict";
- (wx["webpackJsonp"] = wx["webpackJsonp"] || []).push([["vendors-node_modules_taro_weapp_prebundle_taro-ui_js"],{
- /***/ "./node_modules/.taro/weapp/prebundle/taro-ui.js":
- /*!*******************************************************!*\
- !*** ./node_modules/.taro/weapp/prebundle/taro-ui.js ***!
- \*******************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ AtAccordion: function() { return /* binding */ AtAccordion; },
- /* harmony export */ AtActionSheet: function() { return /* binding */ AtActionSheet; },
- /* harmony export */ AtActionSheetItem: function() { return /* binding */ AtActionSheetItem; },
- /* harmony export */ AtActivityIndicator: function() { return /* binding */ AtActivityIndicator; },
- /* harmony export */ AtAvatar: function() { return /* binding */ AtAvatar; },
- /* harmony export */ AtBadge: function() { return /* binding */ AtBadge; },
- /* harmony export */ AtButton: function() { return /* binding */ AtButton; },
- /* harmony export */ AtCalendar: function() { return /* binding */ AtCalendar; },
- /* harmony export */ AtCard: function() { return /* binding */ AtCard; },
- /* harmony export */ AtCheckbox: function() { return /* binding */ AtCheckbox; },
- /* harmony export */ AtComponent: function() { return /* binding */ AtComponent; },
- /* harmony export */ AtCountdown: function() { return /* binding */ AtCountdown; },
- /* harmony export */ AtCurtain: function() { return /* binding */ AtCurtain; },
- /* harmony export */ AtDivider: function() { return /* binding */ AtDivider; },
- /* harmony export */ AtDrawer: function() { return /* binding */ AtDrawer; },
- /* harmony export */ AtFab: function() { return /* binding */ AtFab; },
- /* harmony export */ AtFloatLayout: function() { return /* binding */ AtFloatLayout; },
- /* harmony export */ AtForm: function() { return /* binding */ AtForm; },
- /* harmony export */ AtGrid: function() { return /* binding */ AtGrid; },
- /* harmony export */ AtIcon: function() { return /* binding */ AtIcon; },
- /* harmony export */ AtImagePicker: function() { return /* binding */ AtImagePicker; },
- /* harmony export */ AtIndexes: function() { return /* binding */ AtIndexes; },
- /* harmony export */ AtInput: function() { return /* binding */ AtInput; },
- /* harmony export */ AtInputNumber: function() { return /* binding */ AtInputNumber; },
- /* harmony export */ AtList: function() { return /* binding */ AtList; },
- /* harmony export */ AtListItem: function() { return /* binding */ AtListItem; },
- /* harmony export */ AtLoadMore: function() { return /* binding */ AtLoadMore; },
- /* harmony export */ AtLoading: function() { return /* binding */ AtLoading; },
- /* harmony export */ AtMessage: function() { return /* binding */ AtMessage; },
- /* harmony export */ AtModal: function() { return /* binding */ AtModal; },
- /* harmony export */ AtModalAction: function() { return /* binding */ AtModalAction; },
- /* harmony export */ AtModalContent: function() { return /* binding */ AtModalContent; },
- /* harmony export */ AtModalHeader: function() { return /* binding */ AtModalHeader; },
- /* harmony export */ AtNavBar: function() { return /* binding */ AtNavBar; },
- /* harmony export */ AtNoticebar: function() { return /* binding */ AtNoticebar; },
- /* harmony export */ AtPagination: function() { return /* binding */ AtPagination; },
- /* harmony export */ AtProgress: function() { return /* binding */ AtProgress; },
- /* harmony export */ AtRadio: function() { return /* binding */ AtRadio; },
- /* harmony export */ AtRange: function() { return /* binding */ AtRange; },
- /* harmony export */ AtRate: function() { return /* binding */ AtRate; },
- /* harmony export */ AtSearchBar: function() { return /* binding */ AtSearchBar; },
- /* harmony export */ AtSegmentedControl: function() { return /* binding */ AtSegmentedControl; },
- /* harmony export */ AtSlider: function() { return /* binding */ AtSlider; },
- /* harmony export */ AtSteps: function() { return /* binding */ AtSteps; },
- /* harmony export */ AtSwipeAction: function() { return /* binding */ AtSwipeAction; },
- /* harmony export */ AtSwitch: function() { return /* binding */ AtSwitch; },
- /* harmony export */ AtTabBar: function() { return /* binding */ AtTabBar; },
- /* harmony export */ AtTabs: function() { return /* binding */ AtTabs; },
- /* harmony export */ AtTabsPane: function() { return /* binding */ AtTabsPane; },
- /* harmony export */ AtTag: function() { return /* binding */ AtTag; },
- /* harmony export */ AtTextarea: function() { return /* binding */ AtTextarea; },
- /* harmony export */ AtTimeline: function() { return /* binding */ AtTimeline; },
- /* harmony export */ AtToast: function() { return /* binding */ AtToast; }
- /* harmony export */ });
- /* harmony import */ var _chunk_6GAVBEBQ_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk-6GAVBEBQ.js */ "./node_modules/.taro/weapp/prebundle/chunk-6GAVBEBQ.js");
- /* harmony import */ var _chunk_3EXGJ5BE_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chunk-3EXGJ5BE.js */ "./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js");
- /* harmony import */ var _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./chunk-77KB62LY.js */ "./node_modules/.taro/weapp/prebundle/chunk-77KB62LY.js");
- /* harmony import */ var _chunk_LNJCN3VW_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./chunk-LNJCN3VW.js */ "./node_modules/.taro/weapp/prebundle/chunk-LNJCN3VW.js");
- /* harmony import */ var _chunk_SOUSFT7N_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./chunk-SOUSFT7N.js */ "./node_modules/.taro/weapp/prebundle/chunk-SOUSFT7N.js");
- /* harmony import */ var _chunk_P7VEE7PG_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./chunk-P7VEE7PG.js */ "./node_modules/.taro/weapp/prebundle/chunk-P7VEE7PG.js");
- /* provided dependency */ var window = __webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js */ "./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js")["window$1"];
- /* provided dependency */ var document = __webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js */ "./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js")["document$1"];
- // node_modules/taro-ui/dist/index.esm.js
- var import_react = (0,_chunk_P7VEE7PG_js__WEBPACK_IMPORTED_MODULE_5__.__toESM)((0,_chunk_LNJCN3VW_js__WEBPACK_IMPORTED_MODULE_3__.require_react_production_min)());
- // node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js
- var View = "view";
- var Text = "text";
- var Button = "button";
- var Form = "form";
- var Input = "input";
- var Label = "label";
- var Picker = "picker";
- var Slider = "slider";
- var Switch = "switch";
- var Textarea = "textarea";
- var MovableArea = "movable-area";
- var MovableView = "movable-view";
- var ScrollView = "scroll-view";
- var Swiper = "swiper";
- var SwiperItem = "swiper-item";
- var Image = "image";
- var OpenData = "open-data";
- // node_modules/taro-ui/dist/index.esm.js
- var import_taro = (0,_chunk_P7VEE7PG_js__WEBPACK_IMPORTED_MODULE_5__.__toESM)((0,_chunk_6GAVBEBQ_js__WEBPACK_IMPORTED_MODULE_0__.require_taro)());
- var extendStatics = function(d2, b2) {
- extendStatics = Object.setPrototypeOf || ({
- __proto__: []
- }) instanceof Array && function(d3, b3) {
- d3.__proto__ = b3;
- } || function(d3, b3) {
- for(var p2 in b3)if (Object.prototype.hasOwnProperty.call(b3, p2)) d3[p2] = b3[p2];
- };
- return extendStatics(d2, b2);
- };
- function __extends(d2, b2) {
- if (typeof b2 !== "function" && b2 !== null) throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
- extendStatics(d2, b2);
- function __() {
- this.constructor = d2;
- }
- d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
- }
- var __assign = function() {
- __assign = Object.assign || function __assign2(t2) {
- for(var s, i = 1, n2 = arguments.length; i < n2; i++){
- s = arguments[i];
- for(var p2 in s)if (Object.prototype.hasOwnProperty.call(s, p2)) t2[p2] = s[p2];
- }
- return t2;
- };
- return __assign.apply(this, arguments);
- };
- function __awaiter(thisArg, _arguments, P, generator) {
- function adopt(value) {
- return value instanceof P ? value : new P(function(resolve) {
- resolve(value);
- });
- }
- return new (P || (P = Promise))(function(resolve, reject) {
- function fulfilled(value) {
- try {
- step(generator.next(value));
- } catch (e2) {
- reject(e2);
- }
- }
- function rejected(value) {
- try {
- step(generator["throw"](value));
- } catch (e2) {
- reject(e2);
- }
- }
- function step(result) {
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
- }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
- }
- function __generator(thisArg, body) {
- var _ = {
- label: 0,
- sent: function() {
- if (t2[0] & 1) throw t2[1];
- return t2[1];
- },
- trys: [],
- ops: []
- }, f2, y2, t2, g2;
- return g2 = {
- next: verb(0),
- "throw": verb(1),
- "return": verb(2)
- }, typeof Symbol === "function" && (g2[Symbol.iterator] = function() {
- return this;
- }), g2;
- function verb(n2) {
- return function(v2) {
- return step([
- n2,
- v2
- ]);
- };
- }
- function step(op) {
- if (f2) throw new TypeError("Generator is already executing.");
- while(g2 && (g2 = 0, op[0] && (_ = 0)), _)try {
- if (f2 = 1, y2 && (t2 = op[0] & 2 ? y2["return"] : op[0] ? y2["throw"] || ((t2 = y2["return"]) && t2.call(y2), 0) : y2.next) && !(t2 = t2.call(y2, op[1])).done) return t2;
- if (y2 = 0, t2) op = [
- op[0] & 2,
- t2.value
- ];
- switch(op[0]){
- case 0:
- case 1:
- t2 = op;
- break;
- case 4:
- _.label++;
- return {
- value: op[1],
- done: false
- };
- case 5:
- _.label++;
- y2 = op[1];
- op = [
- 0
- ];
- continue;
- case 7:
- op = _.ops.pop();
- _.trys.pop();
- continue;
- default:
- if (!(t2 = _.trys, t2 = t2.length > 0 && t2[t2.length - 1]) && (op[0] === 6 || op[0] === 2)) {
- _ = 0;
- continue;
- }
- if (op[0] === 3 && (!t2 || op[1] > t2[0] && op[1] < t2[3])) {
- _.label = op[1];
- break;
- }
- if (op[0] === 6 && _.label < t2[1]) {
- _.label = t2[1];
- t2 = op;
- break;
- }
- if (t2 && _.label < t2[2]) {
- _.label = t2[2];
- _.ops.push(op);
- break;
- }
- if (t2[2]) _.ops.pop();
- _.trys.pop();
- continue;
- }
- op = body.call(thisArg, _);
- } catch (e2) {
- op = [
- 6,
- e2
- ];
- y2 = 0;
- } finally{
- f2 = t2 = 0;
- }
- if (op[0] & 5) throw op[1];
- return {
- value: op[0] ? op[1] : void 0,
- done: true
- };
- }
- }
- function __read(o, n2) {
- var m2 = typeof Symbol === "function" && o[Symbol.iterator];
- if (!m2) return o;
- var i = m2.call(o), r2, ar = [], e2;
- try {
- while((n2 === void 0 || n2-- > 0) && !(r2 = i.next()).done)ar.push(r2.value);
- } catch (error2) {
- e2 = {
- error: error2
- };
- } finally{
- try {
- if (r2 && !r2.done && (m2 = i["return"])) m2.call(i);
- } finally{
- if (e2) throw e2.error;
- }
- }
- return ar;
- }
- function __spread() {
- for(var ar = [], i = 0; i < arguments.length; i++)ar = ar.concat(__read(arguments[i]));
- return ar;
- }
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : typeof self !== "undefined" ? self : {};
- function createCommonjsModule(fn, module) {
- return module = {
- exports: {}
- }, fn(module, module.exports), module.exports;
- }
- var classnames = createCommonjsModule(function(module) {
- (function() {
- var hasOwn = {}.hasOwnProperty;
- function classNames() {
- var classes = [];
- for(var i = 0; i < arguments.length; i++){
- var arg = arguments[i];
- if (!arg) continue;
- var argType = typeof arg;
- if (argType === "string" || argType === "number") {
- classes.push(arg);
- } else if (Array.isArray(arg)) {
- if (arg.length) {
- var inner = classNames.apply(null, arg);
- if (inner) {
- classes.push(inner);
- }
- }
- } else if (argType === "object") {
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
- classes.push(arg.toString());
- continue;
- }
- for(var key in arg){
- if (hasOwn.call(arg, key) && arg[key]) {
- classes.push(key);
- }
- }
- }
- }
- return classes.join(" ");
- }
- if (module.exports) {
- classNames.default = classNames;
- module.exports = classNames;
- } else {
- window.classNames = classNames;
- }
- })();
- });
- var b = "function" === typeof Symbol && Symbol.for;
- var c = b ? Symbol.for("react.element") : 60103;
- var d = b ? Symbol.for("react.portal") : 60106;
- var e = b ? Symbol.for("react.fragment") : 60107;
- var f = b ? Symbol.for("react.strict_mode") : 60108;
- var g = b ? Symbol.for("react.profiler") : 60114;
- var h = b ? Symbol.for("react.provider") : 60109;
- var k = b ? Symbol.for("react.context") : 60110;
- var l = b ? Symbol.for("react.async_mode") : 60111;
- var m = b ? Symbol.for("react.concurrent_mode") : 60111;
- var n = b ? Symbol.for("react.forward_ref") : 60112;
- var p = b ? Symbol.for("react.suspense") : 60113;
- var q = b ? Symbol.for("react.suspense_list") : 60120;
- var r = b ? Symbol.for("react.memo") : 60115;
- var t = b ? Symbol.for("react.lazy") : 60116;
- var v = b ? Symbol.for("react.block") : 60121;
- var w = b ? Symbol.for("react.fundamental") : 60117;
- var x = b ? Symbol.for("react.responder") : 60118;
- var y = b ? Symbol.for("react.scope") : 60119;
- var reactIs_development = createCommonjsModule(function(module, exports) {
- if (true) {
- (function() {
- var hasSymbol = typeof Symbol === "function" && Symbol.for;
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103;
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106;
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107;
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108;
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114;
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109;
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110;
- var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111;
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111;
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112;
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113;
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120;
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115;
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116;
- var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121;
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117;
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118;
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119;
- function isValidElementType(type) {
- return typeof type === "string" || typeof type === "function" || type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
- }
- function typeOf(object) {
- if (typeof object === "object" && object !== null) {
- var $$typeof = object.$$typeof;
- switch($$typeof){
- case REACT_ELEMENT_TYPE:
- var type = object.type;
- switch(type){
- case REACT_ASYNC_MODE_TYPE:
- case REACT_CONCURRENT_MODE_TYPE:
- case REACT_FRAGMENT_TYPE:
- case REACT_PROFILER_TYPE:
- case REACT_STRICT_MODE_TYPE:
- case REACT_SUSPENSE_TYPE:
- return type;
- default:
- var $$typeofType = type && type.$$typeof;
- switch($$typeofType){
- case REACT_CONTEXT_TYPE:
- case REACT_FORWARD_REF_TYPE:
- case REACT_LAZY_TYPE:
- case REACT_MEMO_TYPE:
- case REACT_PROVIDER_TYPE:
- return $$typeofType;
- default:
- return $$typeof;
- }
- }
- case REACT_PORTAL_TYPE:
- return $$typeof;
- }
- }
- return void 0;
- }
- var AsyncMode = REACT_ASYNC_MODE_TYPE;
- var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
- var ContextConsumer = REACT_CONTEXT_TYPE;
- var ContextProvider = REACT_PROVIDER_TYPE;
- var Element = REACT_ELEMENT_TYPE;
- var ForwardRef = REACT_FORWARD_REF_TYPE;
- var Fragment = REACT_FRAGMENT_TYPE;
- var Lazy = REACT_LAZY_TYPE;
- var Memo = REACT_MEMO_TYPE;
- var Portal = REACT_PORTAL_TYPE;
- var Profiler = REACT_PROFILER_TYPE;
- var StrictMode = REACT_STRICT_MODE_TYPE;
- var Suspense = REACT_SUSPENSE_TYPE;
- var hasWarnedAboutDeprecatedIsAsyncMode = false;
- function isAsyncMode(object) {
- {
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
- hasWarnedAboutDeprecatedIsAsyncMode = true;
- console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
- }
- }
- return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
- }
- function isConcurrentMode(object) {
- return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
- }
- function isContextConsumer(object) {
- return typeOf(object) === REACT_CONTEXT_TYPE;
- }
- function isContextProvider(object) {
- return typeOf(object) === REACT_PROVIDER_TYPE;
- }
- function isElement(object) {
- return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
- }
- function isForwardRef(object) {
- return typeOf(object) === REACT_FORWARD_REF_TYPE;
- }
- function isFragment(object) {
- return typeOf(object) === REACT_FRAGMENT_TYPE;
- }
- function isLazy(object) {
- return typeOf(object) === REACT_LAZY_TYPE;
- }
- function isMemo(object) {
- return typeOf(object) === REACT_MEMO_TYPE;
- }
- function isPortal(object) {
- return typeOf(object) === REACT_PORTAL_TYPE;
- }
- function isProfiler(object) {
- return typeOf(object) === REACT_PROFILER_TYPE;
- }
- function isStrictMode(object) {
- return typeOf(object) === REACT_STRICT_MODE_TYPE;
- }
- function isSuspense(object) {
- return typeOf(object) === REACT_SUSPENSE_TYPE;
- }
- exports.AsyncMode = AsyncMode;
- exports.ConcurrentMode = ConcurrentMode;
- exports.ContextConsumer = ContextConsumer;
- exports.ContextProvider = ContextProvider;
- exports.Element = Element;
- exports.ForwardRef = ForwardRef;
- exports.Fragment = Fragment;
- exports.Lazy = Lazy;
- exports.Memo = Memo;
- exports.Portal = Portal;
- exports.Profiler = Profiler;
- exports.StrictMode = StrictMode;
- exports.Suspense = Suspense;
- exports.isAsyncMode = isAsyncMode;
- exports.isConcurrentMode = isConcurrentMode;
- exports.isContextConsumer = isContextConsumer;
- exports.isContextProvider = isContextProvider;
- exports.isElement = isElement;
- exports.isForwardRef = isForwardRef;
- exports.isFragment = isFragment;
- exports.isLazy = isLazy;
- exports.isMemo = isMemo;
- exports.isPortal = isPortal;
- exports.isProfiler = isProfiler;
- exports.isStrictMode = isStrictMode;
- exports.isSuspense = isSuspense;
- exports.isValidElementType = isValidElementType;
- exports.typeOf = typeOf;
- })();
- }
- });
- reactIs_development.AsyncMode;
- reactIs_development.ConcurrentMode;
- reactIs_development.ContextConsumer;
- reactIs_development.ContextProvider;
- reactIs_development.Element;
- reactIs_development.ForwardRef;
- reactIs_development.Fragment;
- reactIs_development.Lazy;
- reactIs_development.Memo;
- reactIs_development.Portal;
- reactIs_development.Profiler;
- reactIs_development.StrictMode;
- reactIs_development.Suspense;
- reactIs_development.isAsyncMode;
- reactIs_development.isConcurrentMode;
- reactIs_development.isContextConsumer;
- reactIs_development.isContextProvider;
- reactIs_development.isElement;
- reactIs_development.isForwardRef;
- reactIs_development.isFragment;
- reactIs_development.isLazy;
- reactIs_development.isMemo;
- reactIs_development.isPortal;
- reactIs_development.isProfiler;
- reactIs_development.isStrictMode;
- reactIs_development.isSuspense;
- reactIs_development.isValidElementType;
- reactIs_development.typeOf;
- var reactIs = createCommonjsModule(function(module) {
- if (false) {} else {
- module.exports = reactIs_development;
- }
- });
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
- var hasOwnProperty$7 = Object.prototype.hasOwnProperty;
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
- function toObject(val) {
- if (val === null || val === void 0) {
- throw new TypeError("Object.assign cannot be called with null or undefined");
- }
- return Object(val);
- }
- function shouldUseNative() {
- try {
- if (!Object.assign) {
- return false;
- }
- var test1 = new String("abc");
- test1[5] = "de";
- if (Object.getOwnPropertyNames(test1)[0] === "5") {
- return false;
- }
- var test2 = {};
- for(var i = 0; i < 10; i++){
- test2["_" + String.fromCharCode(i)] = i;
- }
- var order2 = Object.getOwnPropertyNames(test2).map(function(n2) {
- return test2[n2];
- });
- if (order2.join("") !== "0123456789") {
- return false;
- }
- var test3 = {};
- "abcdefghijklmnopqrst".split("").forEach(function(letter) {
- test3[letter] = letter;
- });
- if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
- return false;
- }
- return true;
- } catch (err) {
- return false;
- }
- }
- var objectAssign = shouldUseNative() ? Object.assign : function(target, source) {
- var from;
- var to = toObject(target);
- var symbols;
- for(var s = 1; s < arguments.length; s++){
- from = Object(arguments[s]);
- for(var key in from){
- if (hasOwnProperty$7.call(from, key)) {
- to[key] = from[key];
- }
- }
- if (getOwnPropertySymbols) {
- symbols = getOwnPropertySymbols(from);
- for(var i = 0; i < symbols.length; i++){
- if (propIsEnumerable.call(from, symbols[i])) {
- to[symbols[i]] = from[symbols[i]];
- }
- }
- }
- }
- return to;
- };
- var ReactPropTypesSecret$2 = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
- var ReactPropTypesSecret_1 = ReactPropTypesSecret$2;
- var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
- var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
- var has$1 = has$2;
- var printWarning$1 = function() {};
- if (true) {
- ReactPropTypesSecret = ReactPropTypesSecret$1;
- loggedTypeFailures = {};
- has = has$1;
- printWarning$1 = function(text) {
- var message = "Warning: " + text;
- if (typeof console !== "undefined") {
- console.error(message);
- }
- try {
- throw new Error(message);
- } catch (x2) {}
- };
- }
- var ReactPropTypesSecret;
- var loggedTypeFailures;
- var has;
- function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
- if (true) {
- for(var typeSpecName in typeSpecs){
- if (has(typeSpecs, typeSpecName)) {
- var error2;
- try {
- if (typeof typeSpecs[typeSpecName] !== "function") {
- var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
- err.name = "Invariant Violation";
- throw err;
- }
- error2 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
- } catch (ex) {
- error2 = ex;
- }
- if (error2 && !(error2 instanceof Error)) {
- printWarning$1((componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error2 + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).");
- }
- if (error2 instanceof Error && !(error2.message in loggedTypeFailures)) {
- loggedTypeFailures[error2.message] = true;
- var stack = getStack ? getStack() : "";
- printWarning$1("Failed " + location + " type: " + error2.message + (stack != null ? stack : ""));
- }
- }
- }
- }
- }
- checkPropTypes$1.resetWarningCache = function() {
- if (true) {
- loggedTypeFailures = {};
- }
- };
- var checkPropTypes_1 = checkPropTypes$1;
- var checkPropTypes = checkPropTypes_1;
- var printWarning = function() {};
- if (true) {
- printWarning = function(text) {
- var message = "Warning: " + text;
- if (typeof console !== "undefined") {
- console.error(message);
- }
- try {
- throw new Error(message);
- } catch (x2) {}
- };
- }
- function emptyFunctionThatReturnsNull() {
- return null;
- }
- var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
- var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
- var FAUX_ITERATOR_SYMBOL = "@@iterator";
- function getIteratorFn(maybeIterable) {
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
- if (typeof iteratorFn === "function") {
- return iteratorFn;
- }
- }
- var ANONYMOUS = "<<anonymous>>";
- var ReactPropTypes = {
- array: createPrimitiveTypeChecker("array"),
- bigint: createPrimitiveTypeChecker("bigint"),
- bool: createPrimitiveTypeChecker("boolean"),
- func: createPrimitiveTypeChecker("function"),
- number: createPrimitiveTypeChecker("number"),
- object: createPrimitiveTypeChecker("object"),
- string: createPrimitiveTypeChecker("string"),
- symbol: createPrimitiveTypeChecker("symbol"),
- any: createAnyTypeChecker(),
- arrayOf: createArrayOfTypeChecker,
- element: createElementTypeChecker(),
- elementType: createElementTypeTypeChecker(),
- instanceOf: createInstanceTypeChecker,
- node: createNodeChecker(),
- objectOf: createObjectOfTypeChecker,
- oneOf: createEnumTypeChecker,
- oneOfType: createUnionTypeChecker,
- shape: createShapeTypeChecker,
- exact: createStrictShapeTypeChecker
- };
- function is(x2, y2) {
- if (x2 === y2) {
- return x2 !== 0 || 1 / x2 === 1 / y2;
- } else {
- return x2 !== x2 && y2 !== y2;
- }
- }
- function PropTypeError(message, data) {
- this.message = message;
- this.data = data && typeof data === "object" ? data : {};
- this.stack = "";
- }
- PropTypeError.prototype = Error.prototype;
- function createChainableTypeChecker(validate) {
- if (true) {
- var manualPropTypeCallCache = {};
- var manualPropTypeWarningCount = 0;
- }
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
- componentName = componentName || ANONYMOUS;
- propFullName = propFullName || propName;
- if (secret !== ReactPropTypesSecret$1) {
- if (throwOnDirectAccess) {
- var err = new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");
- err.name = "Invariant Violation";
- throw err;
- } else if (typeof console !== "undefined") {
- var cacheKey = componentName + ":" + propName;
- if (!manualPropTypeCallCache[cacheKey] && manualPropTypeWarningCount < 3) {
- printWarning("You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.");
- manualPropTypeCallCache[cacheKey] = true;
- manualPropTypeWarningCount++;
- }
- }
- }
- if (props[propName] == null) {
- if (isRequired) {
- if (props[propName] === null) {
- return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
- }
- return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
- }
- return null;
- } else {
- return validate(props, propName, componentName, location, propFullName);
- }
- }
- var chainedCheckType = checkType.bind(null, false);
- chainedCheckType.isRequired = checkType.bind(null, true);
- return chainedCheckType;
- }
- function createPrimitiveTypeChecker(expectedType) {
- function validate(props, propName, componentName, location, propFullName, secret) {
- var propValue = props[propName];
- var propType = getPropType(propValue);
- if (propType !== expectedType) {
- var preciseType = getPreciseType(propValue);
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."), {
- expectedType
- });
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
- function createAnyTypeChecker() {
- return createChainableTypeChecker(emptyFunctionThatReturnsNull);
- }
- function createArrayOfTypeChecker(typeChecker) {
- function validate(props, propName, componentName, location, propFullName) {
- if (typeof typeChecker !== "function") {
- return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
- }
- var propValue = props[propName];
- if (!Array.isArray(propValue)) {
- var propType = getPropType(propValue);
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
- }
- for(var i = 0; i < propValue.length; i++){
- var error2 = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret$1);
- if (error2 instanceof Error) {
- return error2;
- }
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
- function createElementTypeChecker() {
- function validate(props, propName, componentName, location, propFullName) {
- var propValue = props[propName];
- if (!isValidElement(propValue)) {
- var propType = getPropType(propValue);
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
- function createElementTypeTypeChecker() {
- function validate(props, propName, componentName, location, propFullName) {
- var propValue = props[propName];
- if (!reactIs.isValidElementType(propValue)) {
- var propType = getPropType(propValue);
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
- function createInstanceTypeChecker(expectedClass) {
- function validate(props, propName, componentName, location, propFullName) {
- if (!(props[propName] instanceof expectedClass)) {
- var expectedClassName = expectedClass.name || ANONYMOUS;
- var actualClassName = getClassName(props[propName]);
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
- function createEnumTypeChecker(expectedValues) {
- if (!Array.isArray(expectedValues)) {
- if (true) {
- if (arguments.length > 1) {
- printWarning("Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).");
- } else {
- printWarning("Invalid argument supplied to oneOf, expected an array.");
- }
- }
- return emptyFunctionThatReturnsNull;
- }
- function validate(props, propName, componentName, location, propFullName) {
- var propValue = props[propName];
- for(var i = 0; i < expectedValues.length; i++){
- if (is(propValue, expectedValues[i])) {
- return null;
- }
- }
- var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
- var type = getPreciseType(value);
- if (type === "symbol") {
- return String(value);
- }
- return value;
- });
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
- }
- return createChainableTypeChecker(validate);
- }
- function createObjectOfTypeChecker(typeChecker) {
- function validate(props, propName, componentName, location, propFullName) {
- if (typeof typeChecker !== "function") {
- return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
- }
- var propValue = props[propName];
- var propType = getPropType(propValue);
- if (propType !== "object") {
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
- }
- for(var key in propValue){
- if (has$1(propValue, key)) {
- var error2 = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret$1);
- if (error2 instanceof Error) {
- return error2;
- }
- }
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
- function createUnionTypeChecker(arrayOfTypeCheckers) {
- if (!Array.isArray(arrayOfTypeCheckers)) {
- true ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : 0;
- return emptyFunctionThatReturnsNull;
- }
- for(var i = 0; i < arrayOfTypeCheckers.length; i++){
- var checker = arrayOfTypeCheckers[i];
- if (typeof checker !== "function") {
- printWarning("Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + ".");
- return emptyFunctionThatReturnsNull;
- }
- }
- function validate(props, propName, componentName, location, propFullName) {
- var expectedTypes = [];
- for(var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++){
- var checker2 = arrayOfTypeCheckers[i2];
- var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1);
- if (checkerResult == null) {
- return null;
- }
- if (checkerResult.data && has$1(checkerResult.data, "expectedType")) {
- expectedTypes.push(checkerResult.data.expectedType);
- }
- }
- var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
- }
- return createChainableTypeChecker(validate);
- }
- function createNodeChecker() {
- function validate(props, propName, componentName, location, propFullName) {
- if (!isNode(props[propName])) {
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
- function invalidValidatorError(componentName, location, propFullName, key, type) {
- return new PropTypeError((componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`.");
- }
- function createShapeTypeChecker(shapeTypes) {
- function validate(props, propName, componentName, location, propFullName) {
- var propValue = props[propName];
- var propType = getPropType(propValue);
- if (propType !== "object") {
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
- }
- for(var key in shapeTypes){
- var checker = shapeTypes[key];
- if (typeof checker !== "function") {
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
- }
- var error2 = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret$1);
- if (error2) {
- return error2;
- }
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
- function createStrictShapeTypeChecker(shapeTypes) {
- function validate(props, propName, componentName, location, propFullName) {
- var propValue = props[propName];
- var propType = getPropType(propValue);
- if (propType !== "object") {
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
- }
- var allKeys = objectAssign({}, props[propName], shapeTypes);
- for(var key in allKeys){
- var checker = shapeTypes[key];
- if (has$1(shapeTypes, key) && typeof checker !== "function") {
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
- }
- if (!checker) {
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " "));
- }
- var error2 = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret$1);
- if (error2) {
- return error2;
- }
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
- function isNode(propValue) {
- switch(typeof propValue){
- case "number":
- case "string":
- case "undefined":
- return true;
- case "boolean":
- return !propValue;
- case "object":
- if (Array.isArray(propValue)) {
- return propValue.every(isNode);
- }
- if (propValue === null || isValidElement(propValue)) {
- return true;
- }
- var iteratorFn = getIteratorFn(propValue);
- if (iteratorFn) {
- var iterator = iteratorFn.call(propValue);
- var step;
- if (iteratorFn !== propValue.entries) {
- while(!(step = iterator.next()).done){
- if (!isNode(step.value)) {
- return false;
- }
- }
- } else {
- while(!(step = iterator.next()).done){
- var entry = step.value;
- if (entry) {
- if (!isNode(entry[1])) {
- return false;
- }
- }
- }
- }
- } else {
- return false;
- }
- return true;
- default:
- return false;
- }
- }
- function isSymbol2(propType, propValue) {
- if (propType === "symbol") {
- return true;
- }
- if (!propValue) {
- return false;
- }
- if (propValue["@@toStringTag"] === "Symbol") {
- return true;
- }
- if (typeof Symbol === "function" && propValue instanceof Symbol) {
- return true;
- }
- return false;
- }
- function getPropType(propValue) {
- var propType = typeof propValue;
- if (Array.isArray(propValue)) {
- return "array";
- }
- if (propValue instanceof RegExp) {
- return "object";
- }
- if (isSymbol2(propType, propValue)) {
- return "symbol";
- }
- return propType;
- }
- function getPreciseType(propValue) {
- if (typeof propValue === "undefined" || propValue === null) {
- return "" + propValue;
- }
- var propType = getPropType(propValue);
- if (propType === "object") {
- if (propValue instanceof Date) {
- return "date";
- } else if (propValue instanceof RegExp) {
- return "regexp";
- }
- }
- return propType;
- }
- function getPostfixForTypeWarning(value) {
- var type = getPreciseType(value);
- switch(type){
- case "array":
- case "object":
- return "an " + type;
- case "boolean":
- case "date":
- case "regexp":
- return "a " + type;
- default:
- return type;
- }
- }
- function getClassName(propValue) {
- if (!propValue.constructor || !propValue.constructor.name) {
- return ANONYMOUS;
- }
- return propValue.constructor.name;
- }
- ReactPropTypes.checkPropTypes = checkPropTypes;
- ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
- ReactPropTypes.PropTypes = ReactPropTypes;
- return ReactPropTypes;
- };
- function emptyFunction() {}
- function emptyFunctionWithReset() {}
- emptyFunctionWithReset.resetWarningCache = emptyFunction;
- var require$$1 = factoryWithTypeCheckers;
- var propTypes = createCommonjsModule(function(module) {
- if (true) {
- var ReactIs = reactIs;
- var throwOnDirectAccess = true;
- module.exports = require$$1(ReactIs.isElement, throwOnDirectAccess);
- } else {}
- });
- var PropTypes = propTypes;
- var AtActionSheetBody = function(_super) {
- __extends(AtActionSheetBody2, _super);
- function AtActionSheetBody2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtActionSheetBody2.prototype.render = function() {
- var rootClass = classnames("at-action-sheet__body", this.props.className);
- return import_react.default.createElement(View, {
- className: rootClass
- }, this.props.children);
- };
- return AtActionSheetBody2;
- }(import_react.default.Component);
- var AtActionSheetFooter = function(_super) {
- __extends(AtActionSheetFooter2, _super);
- function AtActionSheetFooter2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.handleClick = function() {
- var _a2;
- var args = [];
- for(var _i = 0; _i < arguments.length; _i++){
- args[_i] = arguments[_i];
- }
- if (typeof _this.props.onClick === "function") {
- (_a2 = _this.props).onClick.apply(_a2, __spread(args));
- }
- };
- return _this;
- }
- AtActionSheetFooter2.prototype.render = function() {
- var rootClass = classnames("at-action-sheet__footer", this.props.className);
- return import_react.default.createElement(View, {
- onClick: this.handleClick,
- className: rootClass
- }, this.props.children);
- };
- return AtActionSheetFooter2;
- }(import_react.default.Component);
- AtActionSheetFooter.propTypes = {
- onClick: PropTypes.func
- };
- var AtActionSheetHeader = function(_super) {
- __extends(AtActionSheetHeader2, _super);
- function AtActionSheetHeader2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtActionSheetHeader2.prototype.render = function() {
- var rootClass = classnames("at-action-sheet__header", this.props.className);
- return import_react.default.createElement(View, {
- className: rootClass
- }, this.props.children);
- };
- return AtActionSheetHeader2;
- }(import_react.default.Component);
- var AtActionSheet = function(_super) {
- __extends(AtActionSheet2, _super);
- function AtActionSheet2(props) {
- var _this = _super.call(this, props) || this;
- _this.handleClose = function() {
- if (typeof _this.props.onClose === "function") {
- _this.props.onClose();
- }
- };
- _this.handleCancel = function() {
- if (typeof _this.props.onCancel === "function") {
- return _this.props.onCancel();
- }
- _this.close();
- };
- _this.close = function() {
- _this.setState({
- _isOpened: false
- }, _this.handleClose);
- };
- _this.handleTouchMove = function(e2) {
- e2.stopPropagation();
- e2.preventDefault();
- };
- var isOpened = props.isOpened;
- _this.state = {
- _isOpened: isOpened
- };
- return _this;
- }
- AtActionSheet2.prototype.UNSAFE_componentWillReceiveProps = function(nextProps) {
- var isOpened = nextProps.isOpened;
- if (isOpened !== this.state._isOpened) {
- this.setState({
- _isOpened: isOpened
- });
- !isOpened && this.handleClose();
- }
- };
- AtActionSheet2.prototype.render = function() {
- var _a2 = this.props, title = _a2.title, cancelText = _a2.cancelText, className = _a2.className;
- var _isOpened = this.state._isOpened;
- var rootClass = classnames("at-action-sheet", {
- "at-action-sheet--active": _isOpened
- }, className);
- return import_react.default.createElement(View, {
- className: rootClass,
- onTouchMove: this.handleTouchMove
- }, import_react.default.createElement(View, {
- onClick: this.close,
- className: "at-action-sheet__overlay"
- }), import_react.default.createElement(View, {
- className: "at-action-sheet__container"
- }, title && import_react.default.createElement(AtActionSheetHeader, null, title), import_react.default.createElement(AtActionSheetBody, null, this.props.children), cancelText && import_react.default.createElement(AtActionSheetFooter, {
- onClick: this.handleCancel
- }, cancelText)));
- };
- return AtActionSheet2;
- }(import_react.default.Component);
- AtActionSheet.defaultProps = {
- title: "",
- cancelText: "",
- isOpened: false
- };
- AtActionSheet.propTypes = {
- title: PropTypes.string,
- onClose: PropTypes.func,
- onCancel: PropTypes.func,
- isOpened: PropTypes.bool.isRequired,
- cancelText: PropTypes.string
- };
- var AtActionSheetItem = function(_super) {
- __extends(AtActionSheetItem2, _super);
- function AtActionSheetItem2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.handleClick = function(args) {
- if (typeof _this.props.onClick === "function") {
- _this.props.onClick(args);
- }
- };
- return _this;
- }
- AtActionSheetItem2.prototype.render = function() {
- var rootClass = classnames("at-action-sheet__item", this.props.className);
- return import_react.default.createElement(View, {
- className: rootClass,
- onClick: this.handleClick
- }, this.props.children);
- };
- return AtActionSheetItem2;
- }(import_react.default.Component);
- AtActionSheetItem.propTypes = {
- onClick: PropTypes.func
- };
- var ENV$4 = import_taro.default.getEnv();
- function delay(delayTime) {
- if (delayTime === void 0) {
- delayTime = 25;
- }
- return new Promise(function(resolve) {
- setTimeout(function() {
- resolve();
- }, delayTime);
- });
- }
- function delayQuerySelector(selectorStr, delayTime) {
- if (delayTime === void 0) {
- delayTime = 500;
- }
- return new Promise(function(resolve) {
- var selector = import_taro.default.createSelectorQuery();
- delay(delayTime).then(function() {
- selector.select(selectorStr).boundingClientRect().exec(function(res) {
- resolve(res);
- });
- });
- });
- }
- function delayGetClientRect(_a2) {
- var selectorStr = _a2.selectorStr, _b = _a2.delayTime, delayTime = _b === void 0 ? 500 : _b;
- var selector = import_taro.default.createSelectorQuery();
- return new Promise(function(resolve) {
- delay(delayTime).then(function() {
- selector.select(selectorStr).boundingClientRect().exec(function(res) {
- resolve(res);
- });
- });
- });
- }
- function uuid(len, radix) {
- if (len === void 0) {
- len = 8;
- }
- if (radix === void 0) {
- radix = 16;
- }
- var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
- var value = [];
- var i = 0;
- radix = radix || chars.length;
- if (len) {
- for(i = 0; i < len; i++)value[i] = chars[0 | Math.random() * radix];
- } else {
- var r2 = void 0;
- value[8] = value[13] = value[18] = value[23] = "-";
- value[14] = "4";
- for(i = 0; i < 36; i++){
- if (!value[i]) {
- r2 = 0 | Math.random() * 16;
- value[i] = chars[i === 19 ? r2 & 3 | 8 : r2];
- }
- }
- }
- return value.join("");
- }
- function getEventDetail(event) {
- var detail;
- switch(ENV$4){
- case import_taro.default.ENV_TYPE.WEB:
- detail = {
- pageX: event.pageX,
- pageY: event.pageY,
- clientX: event.clientX,
- clientY: event.clientY,
- offsetX: event.offsetX,
- offsetY: event.offsetY,
- x: event.x,
- y: event.y
- };
- break;
- case import_taro.default.ENV_TYPE.WEAPP:
- detail = {
- pageX: event.touches[0].pageX,
- pageY: event.touches[0].pageY,
- clientX: event.touches[0].clientX,
- clientY: event.touches[0].clientY,
- offsetX: event.target.offsetLeft,
- offsetY: event.target.offsetTop,
- x: event.target.x,
- y: event.target.y
- };
- break;
- case import_taro.default.ENV_TYPE.ALIPAY:
- detail = {
- pageX: event.target.pageX,
- pageY: event.target.pageY,
- clientX: event.target.clientX,
- clientY: event.target.clientY,
- offsetX: event.target.offsetLeft,
- offsetY: event.target.offsetTop,
- x: event.target.x,
- y: event.target.y
- };
- break;
- case import_taro.default.ENV_TYPE.SWAN:
- detail = {
- pageX: event.changedTouches[0].pageX,
- pageY: event.changedTouches[0].pageY,
- clientX: event.target.clientX,
- clientY: event.target.clientY,
- offsetX: event.target.offsetLeft,
- offsetY: event.target.offsetTop,
- x: event.detail.x,
- y: event.detail.y
- };
- break;
- default:
- detail = {
- pageX: 0,
- pageY: 0,
- clientX: 0,
- clientY: 0,
- offsetX: 0,
- offsetY: 0,
- x: 0,
- y: 0
- };
- console.warn("getEventDetail\u6682\u672A\u652F\u6301\u8BE5\u73AF\u5883");
- break;
- }
- return detail;
- }
- function isTest() {
- return false;
- }
- var scrollTop = 0;
- function handleTouchScroll(flag) {
- if (ENV$4 !== import_taro.default.ENV_TYPE.WEB) {
- return;
- }
- if (flag) {
- scrollTop = document.documentElement.scrollTop;
- document.body.classList.add("at-frozen");
- document.body.style.top = -scrollTop + "px";
- } else {
- document.body.style.top = "";
- document.body.classList.remove("at-frozen");
- document.documentElement.scrollTop = scrollTop;
- }
- }
- function pxTransform(size) {
- if (!size) return "";
- var designWidth = 750;
- var deviceRatio = {
- 640: 2.34 / 2,
- 750: 1,
- 828: 1.81 / 2
- };
- return size / deviceRatio[designWidth] + "rpx";
- }
- function objectToString$2(style) {
- if (style && typeof style === "object") {
- var styleStr_1 = "";
- Object.keys(style).forEach(function(key) {
- var lowerCaseKey = key.replace(/([A-Z])/g, "-$1").toLowerCase();
- styleStr_1 += lowerCaseKey + ":" + style[key] + ";";
- });
- return styleStr_1;
- } else if (style && typeof style === "string") {
- return style;
- }
- return "";
- }
- function mergeStyle(style1, style2) {
- if (style1 && typeof style1 === "object" && style2 && typeof style2 === "object") {
- return Object.assign({}, style1, style2);
- }
- return objectToString$2(style1) + objectToString$2(style2);
- }
- var AtLoading = function(_super) {
- __extends(AtLoading2, _super);
- function AtLoading2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtLoading2.prototype.render = function() {
- var _a2 = this.props, color = _a2.color, size = _a2.size;
- var loadingSize = typeof size === "string" ? size : String(size);
- var sizeStyle = {
- width: size ? "" + pxTransform(parseInt(loadingSize)) : "",
- height: size ? "" + pxTransform(parseInt(loadingSize)) : ""
- };
- var colorStyle = {
- border: color ? "1px solid " + color : "",
- borderColor: color ? color + " transparent transparent transparent" : ""
- };
- var ringStyle = Object.assign({}, colorStyle, sizeStyle);
- return import_react.default.createElement(View, {
- className: "at-loading",
- style: sizeStyle
- }, import_react.default.createElement(View, {
- className: "at-loading__ring",
- style: ringStyle
- }), import_react.default.createElement(View, {
- className: "at-loading__ring",
- style: ringStyle
- }), import_react.default.createElement(View, {
- className: "at-loading__ring",
- style: ringStyle
- }));
- };
- return AtLoading2;
- }(import_react.default.Component);
- AtLoading.defaultProps = {
- size: 0,
- color: ""
- };
- AtLoading.propTypes = {
- size: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.number
- ]),
- color: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.number
- ])
- };
- var AtActivityIndicator = function(_super) {
- __extends(AtActivityIndicator2, _super);
- function AtActivityIndicator2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtActivityIndicator2.prototype.render = function() {
- var _a2 = this.props, color = _a2.color, size = _a2.size, mode = _a2.mode, content = _a2.content, isOpened = _a2.isOpened;
- var rootClass = classnames("at-activity-indicator", {
- "at-activity-indicator--center": mode === "center",
- "at-activity-indicator--isopened": isOpened
- }, this.props.className);
- return import_react.default.createElement(View, {
- className: rootClass
- }, import_react.default.createElement(View, {
- className: "at-activity-indicator__body"
- }, import_react.default.createElement(AtLoading, {
- size,
- color
- })), content && import_react.default.createElement(Text, {
- className: "at-activity-indicator__content"
- }, content));
- };
- return AtActivityIndicator2;
- }(import_react.default.Component);
- AtActivityIndicator.defaultProps = {
- size: 0,
- mode: "normal",
- color: "",
- content: "",
- className: "",
- isOpened: true
- };
- AtActivityIndicator.propTypes = {
- size: PropTypes.number,
- mode: PropTypes.string,
- color: PropTypes.string,
- content: PropTypes.string,
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ]),
- isOpened: PropTypes.bool
- };
- var SIZE_CLASS$2 = {
- large: "large",
- normal: "normal",
- small: "small"
- };
- var AtAvatar = function(_super) {
- __extends(AtAvatar2, _super);
- function AtAvatar2(props) {
- var _this = _super.call(this, props) || this;
- _this.state = {
- isWEAPP: import_taro.default.getEnv() === import_taro.default.ENV_TYPE.WEAPP
- };
- return _this;
- }
- AtAvatar2.prototype.render = function() {
- var _a2;
- var _b = this.props, size = _b.size, circle = _b.circle, image = _b.image, text = _b.text, openData = _b.openData, customStyle = _b.customStyle;
- var rootClassName = [
- "at-avatar"
- ];
- var iconSize = SIZE_CLASS$2[size || "normal"];
- var classObject = (_a2 = {}, _a2["at-avatar--" + iconSize] = iconSize, _a2["at-avatar--circle"] = circle, _a2);
- var letter = "";
- if (text) letter = text[0];
- var elem;
- if (openData && openData.type === "userAvatarUrl" && this.state.isWEAPP) {
- elem = import_react.default.createElement(OpenData, {
- type: openData.type
- });
- } else if (image) {
- elem = import_react.default.createElement(Image, {
- className: "at-avatar__img",
- src: image
- });
- } else {
- elem = import_react.default.createElement(Text, {
- className: "at-avatar__text"
- }, letter);
- }
- return import_react.default.createElement(View, {
- className: classnames(rootClassName, classObject, this.props.className),
- style: customStyle
- }, elem);
- };
- return AtAvatar2;
- }(import_react.default.Component);
- AtAvatar.defaultProps = {
- size: "normal",
- circle: false,
- text: "",
- image: "",
- customStyle: {},
- className: ""
- };
- AtAvatar.propTypes = {
- size: PropTypes.oneOf([
- "large",
- "normal",
- "small"
- ]),
- circle: PropTypes.bool,
- text: PropTypes.string,
- image: PropTypes.string,
- openData: PropTypes.object,
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ])
- };
- var AtBadge = function(_super) {
- __extends(AtBadge2, _super);
- function AtBadge2(props) {
- var _this = _super.call(this, props) || this;
- _this.state = {};
- return _this;
- }
- AtBadge2.prototype.formatValue = function(value, maxValue) {
- if (value === "" || value === null || typeof value === "undefined") return "";
- var numValue = +value;
- if (Number.isNaN(numValue)) {
- return value;
- }
- return numValue > maxValue ? maxValue + "+" : numValue;
- };
- AtBadge2.prototype.render = function() {
- var _a2 = this.props, dot = _a2.dot, value = _a2.value, _b = _a2.maxValue, maxValue = _b === void 0 ? 99 : _b, customStyle = _a2.customStyle;
- var rootClassName = [
- "at-badge"
- ];
- var val = this.formatValue(value, maxValue);
- return import_react.default.createElement(View, {
- className: classnames(rootClassName, this.props.className),
- style: customStyle
- }, this.props.children, dot ? import_react.default.createElement(View, {
- className: "at-badge__dot"
- }) : val !== "" && import_react.default.createElement(View, {
- className: "at-badge__num"
- }, val));
- };
- return AtBadge2;
- }(import_react.default.Component);
- AtBadge.defaultProps = {
- dot: false,
- value: "",
- maxValue: 99,
- customStyle: {},
- className: ""
- };
- AtBadge.propTypes = {
- dot: PropTypes.bool,
- value: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.number
- ]),
- maxValue: PropTypes.number,
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ])
- };
- var SIZE_CLASS$1 = {
- normal: "normal",
- small: "small"
- };
- var TYPE_CLASS$1 = {
- primary: "primary",
- secondary: "secondary"
- };
- var AtButton = function(_super) {
- __extends(AtButton2, _super);
- function AtButton2(props) {
- var _this = _super.call(this, props) || this;
- _this.state = {
- isWEB: import_taro.default.getEnv() === import_taro.default.ENV_TYPE.WEB,
- isWEAPP: import_taro.default.getEnv() === import_taro.default.ENV_TYPE.WEAPP,
- isALIPAY: import_taro.default.getEnv() === import_taro.default.ENV_TYPE.ALIPAY
- };
- return _this;
- }
- AtButton2.prototype.onClick = function(event) {
- if (!this.props.disabled) {
- this.props.onClick && this.props.onClick(event);
- }
- };
- AtButton2.prototype.onGetUserInfo = function(event) {
- this.props.onGetUserInfo && this.props.onGetUserInfo(event);
- };
- AtButton2.prototype.onContact = function(event) {
- this.props.onContact && this.props.onContact(event);
- };
- AtButton2.prototype.onGetPhoneNumber = function(event) {
- this.props.onGetPhoneNumber && this.props.onGetPhoneNumber(event);
- };
- AtButton2.prototype.onError = function(event) {
- this.props.onError && this.props.onError(event);
- };
- AtButton2.prototype.onOpenSetting = function(event) {
- this.props.onOpenSetting && this.props.onOpenSetting(event);
- };
- AtButton2.prototype.render = function() {
- var _a2;
- var _b = this.props, _c = _b.size, size = _c === void 0 ? "normal" : _c, _d = _b.type, type = _d === void 0 ? "" : _d, circle = _b.circle, full = _b.full, loading2 = _b.loading, disabled = _b.disabled, customStyle = _b.customStyle, formType = _b.formType, openType = _b.openType, lang = _b.lang, sessionFrom = _b.sessionFrom, sendMessageTitle = _b.sendMessageTitle, sendMessagePath = _b.sendMessagePath, sendMessageImg = _b.sendMessageImg, showMessageCard = _b.showMessageCard, appParameter = _b.appParameter;
- var _e = this.state, isWEAPP = _e.isWEAPP, isALIPAY = _e.isALIPAY, isWEB = _e.isWEB;
- var rootClassName = [
- "at-button"
- ];
- var classObject = (_a2 = {}, _a2["at-button--" + SIZE_CLASS$1[size]] = SIZE_CLASS$1[size], _a2["at-button--disabled"] = disabled, _a2["at-button--" + type] = TYPE_CLASS$1[type], _a2["at-button--circle"] = circle, _a2["at-button--full"] = full, _a2);
- var loadingColor = type === "primary" ? "#fff" : "";
- var loadingSize = size === "small" ? "30" : 0;
- var loadingComponent = null;
- if (loading2) {
- loadingComponent = import_react.default.createElement(View, {
- className: "at-button__icon"
- }, import_react.default.createElement(AtLoading, {
- color: loadingColor,
- size: loadingSize
- }));
- rootClassName.push("at-button--icon");
- }
- var webButton = import_react.default.createElement(Button, {
- className: "at-button__wxbutton",
- lang,
- formType
- });
- var button = import_react.default.createElement(Button, {
- className: "at-button__wxbutton",
- formType,
- openType,
- lang,
- sessionFrom,
- sendMessageTitle,
- sendMessagePath,
- sendMessageImg,
- showMessageCard,
- appParameter,
- onGetUserInfo: this.onGetUserInfo.bind(this),
- onGetPhoneNumber: this.onGetPhoneNumber.bind(this),
- onOpenSetting: this.onOpenSetting.bind(this),
- onError: this.onError.bind(this),
- onContact: this.onContact.bind(this)
- });
- return import_react.default.createElement(View, {
- className: classnames(rootClassName, classObject, this.props.className),
- style: customStyle,
- onClick: this.onClick.bind(this)
- }, isWEB && !disabled && webButton, isWEAPP && !disabled && button, isALIPAY && !disabled && button, loadingComponent, import_react.default.createElement(View, {
- className: "at-button__text"
- }, this.props.children));
- };
- return AtButton2;
- }(import_react.default.Component);
- AtButton.defaultProps = {
- size: "normal",
- circle: false,
- full: false,
- loading: false,
- disabled: false,
- customStyle: {},
- lang: "en",
- sessionFrom: "",
- sendMessageTitle: "",
- sendMessagePath: "",
- sendMessageImg: "",
- showMessageCard: false,
- appParameter: ""
- };
- AtButton.propTypes = {
- size: PropTypes.oneOf([
- "normal",
- "small"
- ]),
- type: PropTypes.oneOf([
- "primary",
- "secondary",
- ""
- ]),
- circle: PropTypes.bool,
- full: PropTypes.bool,
- loading: PropTypes.bool,
- disabled: PropTypes.bool,
- onClick: PropTypes.func,
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- formType: PropTypes.oneOf([
- "submit",
- "reset",
- ""
- ]),
- openType: PropTypes.oneOf([
- "contact",
- "share",
- "getUserInfo",
- "getPhoneNumber",
- "launchApp",
- "openSetting",
- "feedback",
- "getRealnameAuthInfo",
- "getAuthorize",
- "contactShare",
- ""
- ]),
- lang: PropTypes.string,
- sessionFrom: PropTypes.string,
- sendMessageTitle: PropTypes.string,
- sendMessagePath: PropTypes.string,
- sendMessageImg: PropTypes.string,
- showMessageCard: PropTypes.bool,
- appParameter: PropTypes.string,
- onGetUserInfo: PropTypes.func,
- onContact: PropTypes.func,
- onGetPhoneNumber: PropTypes.func,
- onError: PropTypes.func,
- onOpenSetting: PropTypes.func
- };
- var AtCard = function(_super) {
- __extends(AtCard2, _super);
- function AtCard2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.handleClick = function(args) {
- if (typeof _this.props.onClick === "function") {
- _this.props.onClick(args);
- }
- };
- return _this;
- }
- AtCard2.prototype.render = function() {
- var _a2;
- var _b = this.props, title = _b.title, note = _b.note, extra = _b.extra, extraStyle = _b.extraStyle, thumb = _b.thumb, isFull = _b.isFull, icon = _b.icon, renderIcon = _b.renderIcon;
- var rootClass = classnames("at-card", {
- "at-card--full": isFull
- }, this.props.className);
- var iconClass = classnames((_a2 = {
- "at-icon": true
- }, _a2["at-icon-" + (icon && icon.value)] = icon && icon.value, _a2["at-card__header-icon"] = true, _a2));
- var iconStyle = {
- color: icon && icon.color || "",
- fontSize: icon && icon.size + "px" || ""
- };
- return import_react.default.createElement(View, {
- onClick: this.handleClick,
- className: rootClass
- }, import_react.default.createElement(View, {
- className: "at-card__header"
- }, thumb && import_react.default.createElement(View, {
- className: "at-card__header-thumb"
- }, import_react.default.createElement(Image, {
- className: "at-card__header-thumb-info",
- mode: "scaleToFill",
- src: thumb
- })), renderIcon || "", !thumb && icon && icon.value && import_react.default.createElement(Text, {
- className: iconClass,
- style: iconStyle
- }), import_react.default.createElement(Text, {
- className: "at-card__header-title"
- }, title), extra && import_react.default.createElement(Text, {
- style: __assign({}, extraStyle),
- className: "at-card__header-extra"
- }, extra)), import_react.default.createElement(View, {
- className: "at-card__content"
- }, import_react.default.createElement(View, {
- className: "at-card__content-info"
- }, this.props.children), note && import_react.default.createElement(View, {
- className: "at-card__content-note"
- }, note)));
- };
- return AtCard2;
- }(import_react.default.Component);
- AtCard.defaultProps = {
- note: "",
- isFull: false,
- thumb: "",
- title: "",
- extra: "",
- extraStyle: {}
- };
- AtCard.propTypes = {
- note: PropTypes.string,
- isFull: PropTypes.bool,
- thumb: PropTypes.string,
- title: PropTypes.string,
- extra: PropTypes.string,
- icon: PropTypes.object,
- onClick: PropTypes.func,
- renderIcon: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.element
- ]),
- extraStyle: PropTypes.object
- };
- var AtCheckbox = function(_super) {
- __extends(AtCheckbox2, _super);
- function AtCheckbox2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtCheckbox2.prototype.handleClick = function(idx) {
- var _a2 = this.props, selectedList = _a2.selectedList, options = _a2.options;
- var option = options[idx];
- var disabled = option.disabled, value = option.value;
- if (disabled) return;
- var selectedSet = new Set(selectedList);
- if (!selectedSet.has(value)) {
- selectedSet.add(value);
- } else {
- selectedSet.delete(value);
- }
- this.props.onChange(__spread(selectedSet));
- };
- AtCheckbox2.prototype.render = function() {
- var _this = this;
- var _a2 = this.props, customStyle = _a2.customStyle, className = _a2.className, options = _a2.options, selectedList = _a2.selectedList;
- var rootCls = classnames("at-checkbox", className);
- return import_react.default.createElement(View, {
- className: rootCls,
- style: customStyle
- }, options.map(function(option, idx) {
- var value = option.value, disabled = option.disabled, label = option.label, desc = option.desc;
- var optionCls = classnames("at-checkbox__option", {
- "at-checkbox__option--disabled": disabled,
- "at-checkbox__option--selected": selectedList.includes(value)
- });
- return import_react.default.createElement(View, {
- className: optionCls,
- key: value,
- onClick: _this.handleClick.bind(_this, idx)
- }, import_react.default.createElement(View, {
- className: "at-checkbox__option-wrap"
- }, import_react.default.createElement(View, {
- className: "at-checkbox__option-cnt"
- }, import_react.default.createElement(View, {
- className: "at-checkbox__icon-cnt"
- }, import_react.default.createElement(Text, {
- className: "at-icon at-icon-check"
- })), import_react.default.createElement(View, {
- className: "at-checkbox__title"
- }, label)), desc && import_react.default.createElement(View, {
- className: "at-checkbox__desc"
- }, desc)));
- }));
- };
- return AtCheckbox2;
- }(import_react.default.Component);
- AtCheckbox.defaultProps = {
- customStyle: "",
- className: "",
- options: [],
- selectedList: [],
- onChange: function() {}
- };
- AtCheckbox.propTypes = {
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ]),
- options: PropTypes.array,
- selectedList: PropTypes.array,
- onChange: PropTypes.func
- };
- var AtList = function(_super) {
- __extends(AtList2, _super);
- function AtList2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtList2.prototype.render = function() {
- var rootClass = classnames("at-list", {
- "at-list--no-border": !this.props.hasBorder
- }, this.props.className);
- return import_react.default.createElement(View, {
- className: rootClass
- }, this.props.children);
- };
- return AtList2;
- }(import_react.default.Component);
- AtList.defaultProps = {
- hasBorder: true
- };
- AtList.propTypes = {
- hasBorder: PropTypes.bool
- };
- var AtListItem = function(_super) {
- __extends(AtListItem2, _super);
- function AtListItem2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.handleClick = function(event) {
- if (typeof _this.props.onClick === "function" && !_this.props.disabled) {
- _this.props.onClick(event);
- }
- };
- _this.handleSwitchChange = function(event) {
- if (typeof _this.props.onSwitchChange === "function" && !_this.props.disabled) {
- _this.props.onSwitchChange(event);
- }
- };
- return _this;
- }
- AtListItem2.prototype.handleSwitchClick = function(e2) {
- e2.stopPropagation();
- };
- AtListItem2.prototype.render = function() {
- var _a2;
- var _b = this.props, note = _b.note, arrow = _b.arrow, thumb = _b.thumb, iconInfo = _b.iconInfo, disabled = _b.disabled, isSwitch = _b.isSwitch, hasBorder = _b.hasBorder, extraThumb = _b.extraThumb, switchColor = _b.switchColor, switchIsCheck = _b.switchIsCheck;
- var _c = this.props, extraText = _c.extraText, title = _c.title;
- extraText = String(extraText);
- title = String(title);
- var rootClass = classnames("at-list__item", {
- "at-list__item--thumb": thumb,
- "at-list__item--multiple": note,
- "at-list__item--disabled": disabled,
- "at-list__item--no-border": !hasBorder
- }, this.props.className);
- var iconClass = classnames(iconInfo && iconInfo.prefixClass || "at-icon", (_a2 = {}, _a2[(iconInfo && iconInfo.prefixClass || "at-icon") + "-" + (iconInfo && iconInfo.value)] = iconInfo && iconInfo.value, _a2), iconInfo && iconInfo.className);
- return import_react.default.createElement(View, {
- className: rootClass,
- onClick: this.handleClick
- }, import_react.default.createElement(View, {
- className: "at-list__item-container"
- }, thumb && import_react.default.createElement(View, {
- className: "at-list__item-thumb item-thumb"
- }, import_react.default.createElement(Image, {
- className: "item-thumb__info",
- mode: "scaleToFill",
- src: thumb
- })), iconInfo && iconInfo.value && import_react.default.createElement(View, {
- className: "at-list__item-icon item-icon"
- }, import_react.default.createElement(Text, {
- className: iconClass,
- style: mergeStyle({
- color: iconInfo.color || "",
- fontSize: (iconInfo.size || 24) + "px"
- }, iconInfo.customStyle || "")
- })), import_react.default.createElement(View, {
- className: "at-list__item-content item-content"
- }, import_react.default.createElement(View, {
- className: "item-content__info"
- }, import_react.default.createElement(View, {
- className: "item-content__info-title"
- }, title), note && import_react.default.createElement(View, {
- className: "item-content__info-note"
- }, note))), import_react.default.createElement(View, {
- className: "at-list__item-extra item-extra"
- }, extraText && import_react.default.createElement(View, {
- className: "item-extra__info"
- }, extraText), extraThumb && !extraText && import_react.default.createElement(View, {
- className: "item-extra__image"
- }, import_react.default.createElement(Image, {
- className: "item-extra__image-info",
- mode: "aspectFit",
- src: extraThumb
- })), isSwitch && !extraThumb && !extraText && import_react.default.createElement(View, {
- className: "item-extra__switch",
- onClick: this.handleSwitchClick
- }, import_react.default.createElement(Switch, {
- color: switchColor,
- disabled,
- checked: switchIsCheck,
- onChange: this.handleSwitchChange
- })), arrow ? import_react.default.createElement(View, {
- className: "item-extra__icon"
- }, import_react.default.createElement(Text, {
- className: "at-icon item-extra__icon-arrow at-icon-chevron-" + arrow
- })) : null)));
- };
- return AtListItem2;
- }(import_react.default.Component);
- AtListItem.defaultProps = {
- note: "",
- disabled: false,
- title: "",
- thumb: "",
- isSwitch: false,
- hasBorder: true,
- switchColor: "#6190E8",
- switchIsCheck: false,
- extraText: "",
- extraThumb: "",
- iconInfo: {
- value: ""
- }
- };
- AtListItem.propTypes = {
- note: PropTypes.string,
- disabled: PropTypes.bool,
- title: PropTypes.string,
- thumb: PropTypes.string,
- onClick: PropTypes.func,
- isSwitch: PropTypes.bool,
- hasBorder: PropTypes.bool,
- switchColor: PropTypes.string,
- switchIsCheck: PropTypes.bool,
- extraText: PropTypes.string,
- extraThumb: PropTypes.string,
- onSwitchChange: PropTypes.func,
- arrow: PropTypes.oneOf([
- "up",
- "down",
- "right"
- ]),
- iconInfo: PropTypes.shape({
- size: PropTypes.number,
- value: PropTypes.string,
- color: PropTypes.string,
- prefixClass: PropTypes.string,
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ])
- })
- };
- var AtDrawer = function(_super) {
- __extends(AtDrawer2, _super);
- function AtDrawer2(props) {
- var _this = _super.call(this, props) || this;
- _this.state = {
- animShow: false,
- _show: props.show
- };
- return _this;
- }
- AtDrawer2.prototype.componentDidMount = function() {
- var _show = this.state._show;
- if (_show) this.animShow();
- };
- AtDrawer2.prototype.onItemClick = function(index) {
- this.props.onItemClick && this.props.onItemClick(index);
- this.animHide();
- };
- AtDrawer2.prototype.onHide = function() {
- var _this = this;
- this.setState({
- _show: false
- }, function() {
- _this.props.onClose && _this.props.onClose();
- });
- };
- AtDrawer2.prototype.animHide = function() {
- var _this = this;
- this.setState({
- animShow: false
- });
- setTimeout(function() {
- _this.onHide();
- }, 300);
- };
- AtDrawer2.prototype.animShow = function() {
- var _this = this;
- this.setState({
- _show: true
- });
- setTimeout(function() {
- _this.setState({
- animShow: true
- });
- }, 200);
- };
- AtDrawer2.prototype.onMaskClick = function() {
- this.animHide();
- };
- AtDrawer2.prototype.UNSAFE_componentWillReceiveProps = function(nextProps) {
- var show = nextProps.show;
- if (show !== this.state._show) {
- show ? this.animShow() : this.animHide();
- }
- };
- AtDrawer2.prototype.render = function() {
- var _this = this;
- var _a2 = this.props, mask = _a2.mask, width = _a2.width, right = _a2.right, items = _a2.items;
- var _b = this.state, animShow = _b.animShow, _show = _b._show;
- var rootClassName = [
- "at-drawer"
- ];
- var maskStyle = {
- display: mask ? "block" : "none",
- opacity: animShow ? 1 : 0
- };
- var listStyle = {
- width,
- transition: animShow ? "all 225ms cubic-bezier(0, 0, 0.2, 1)" : "all 195ms cubic-bezier(0.4, 0, 0.6, 1)"
- };
- var classObject = {
- "at-drawer--show": animShow,
- "at-drawer--right": right,
- "at-drawer--left": !right
- };
- return _show ? import_react.default.createElement(View, {
- className: classnames(rootClassName, classObject, this.props.className)
- }, import_react.default.createElement(View, {
- className: "at-drawer__mask",
- style: maskStyle,
- onClick: this.onMaskClick.bind(this)
- }), import_react.default.createElement(View, {
- className: "at-drawer__content",
- style: listStyle
- }, !!items && items.length ? import_react.default.createElement(AtList, null, items.map(function(name, index) {
- return import_react.default.createElement(AtListItem, {
- key: name + "-" + index,
- "data-index": index,
- onClick: _this.onItemClick.bind(_this, index),
- title: name,
- arrow: "right"
- });
- })) : this.props.children)) : import_react.default.createElement(View, null);
- };
- return AtDrawer2;
- }(import_react.default.Component);
- AtDrawer.defaultProps = {
- show: false,
- mask: true,
- width: "",
- right: false,
- items: []
- };
- AtDrawer.propTypes = {
- show: PropTypes.bool,
- mask: PropTypes.bool,
- width: PropTypes.string,
- items: PropTypes.arrayOf(PropTypes.string),
- onItemClick: PropTypes.func,
- onClose: PropTypes.func
- };
- var AtFloatLayout = function(_super) {
- __extends(AtFloatLayout2, _super);
- function AtFloatLayout2(props) {
- var _this = _super.call(this, props) || this;
- _this.handleClose = function() {
- if (typeof _this.props.onClose === "function") {
- _this.props.onClose();
- }
- };
- _this.close = function() {
- _this.setState({
- _isOpened: false
- }, _this.handleClose);
- };
- _this.handleTouchMove = function(e2) {
- e2.stopPropagation();
- };
- var isOpened = props.isOpened;
- _this.state = {
- _isOpened: isOpened
- };
- return _this;
- }
- AtFloatLayout2.prototype.UNSAFE_componentWillReceiveProps = function(nextProps) {
- var isOpened = nextProps.isOpened;
- if (this.props.isOpened !== isOpened) {
- handleTouchScroll(isOpened);
- }
- if (isOpened !== this.state._isOpened) {
- this.setState({
- _isOpened: isOpened
- });
- }
- };
- AtFloatLayout2.prototype.render = function() {
- var _isOpened = this.state._isOpened;
- var _a2 = this.props, title = _a2.title, scrollY = _a2.scrollY, scrollX = _a2.scrollX, scrollTop2 = _a2.scrollTop, scrollLeft = _a2.scrollLeft, upperThreshold = _a2.upperThreshold, lowerThreshold = _a2.lowerThreshold, scrollWithAnimation = _a2.scrollWithAnimation;
- var rootClass = classnames("at-float-layout", {
- "at-float-layout--active": _isOpened
- }, this.props.className);
- return import_react.default.createElement(View, {
- className: rootClass,
- onTouchMove: this.handleTouchMove
- }, import_react.default.createElement(View, {
- onClick: this.close,
- className: "at-float-layout__overlay"
- }), import_react.default.createElement(View, {
- className: "at-float-layout__container layout"
- }, title ? import_react.default.createElement(View, {
- className: "layout-header"
- }, import_react.default.createElement(Text, {
- className: "layout-header__title"
- }, title), import_react.default.createElement(View, {
- className: "layout-header__btn-close",
- onClick: this.close
- })) : null, import_react.default.createElement(View, {
- className: "layout-body"
- }, import_react.default.createElement(ScrollView, {
- scrollY,
- scrollX,
- scrollTop: scrollTop2,
- scrollLeft,
- upperThreshold,
- lowerThreshold,
- scrollWithAnimation,
- onScroll: this.props.onScroll,
- onScrollToLower: this.props.onScrollToLower,
- onScrollToUpper: this.props.onScrollToUpper,
- className: "layout-body__content"
- }, this.props.children))));
- };
- return AtFloatLayout2;
- }(import_react.default.Component);
- AtFloatLayout.defaultProps = {
- title: "",
- isOpened: false,
- scrollY: true,
- scrollX: false,
- scrollWithAnimation: false
- };
- AtFloatLayout.propTypes = {
- title: PropTypes.string,
- isOpened: PropTypes.bool,
- scrollY: PropTypes.bool,
- scrollX: PropTypes.bool,
- scrollTop: PropTypes.number,
- scrollLeft: PropTypes.number,
- upperThreshold: PropTypes.number,
- lowerThreshold: PropTypes.number,
- scrollWithAnimation: PropTypes.bool,
- onClose: PropTypes.func,
- onScroll: PropTypes.func,
- onScrollToLower: PropTypes.func,
- onScrollToUpper: PropTypes.func
- };
- var AtForm = function(_super) {
- __extends(AtForm2, _super);
- function AtForm2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtForm2.prototype.onSubmit = function() {
- this.props.onSubmit && this.props.onSubmit(arguments);
- };
- AtForm2.prototype.onReset = function() {
- this.props.onReset && this.props.onReset(arguments);
- };
- AtForm2.prototype.render = function() {
- var _a2 = this.props, customStyle = _a2.customStyle, className = _a2.className, reportSubmit = _a2.reportSubmit;
- var rootCls = classnames("at-form", className);
- return import_react.default.createElement(Form, {
- className: rootCls,
- style: customStyle,
- onSubmit: this.onSubmit.bind(this),
- reportSubmit,
- onReset: this.onReset.bind(this)
- }, this.props.children);
- };
- return AtForm2;
- }(import_react.default.Component);
- AtForm.defaultProps = {
- customStyle: "",
- className: "",
- reportSubmit: false
- };
- AtForm.propTypes = {
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ]),
- reportSubmit: PropTypes.bool,
- onSubmit: PropTypes.func,
- onReset: PropTypes.func
- };
- function baseSlice(array, start, end) {
- var index = -1, length = array.length;
- if (start < 0) {
- start = -start > length ? 0 : length + start;
- }
- end = end > length ? length : end;
- if (end < 0) {
- end += length;
- }
- length = start > end ? 0 : end - start >>> 0;
- start >>>= 0;
- var result = Array(length);
- while(++index < length){
- result[index] = array[index + start];
- }
- return result;
- }
- var _baseSlice = baseSlice;
- function eq(value, other) {
- return value === other || value !== value && other !== other;
- }
- var eq_1 = eq;
- var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
- var _freeGlobal = freeGlobal;
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
- var root = _freeGlobal || freeSelf || Function("return this")();
- var _root = root;
- var Symbol$1 = _root.Symbol;
- var _Symbol = Symbol$1;
- var objectProto$8 = Object.prototype;
- var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
- var nativeObjectToString$1 = objectProto$8.toString;
- var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : void 0;
- function getRawTag(value) {
- var isOwn = hasOwnProperty$6.call(value, symToStringTag$1), tag = value[symToStringTag$1];
- try {
- value[symToStringTag$1] = void 0;
- var unmasked = true;
- } catch (e2) {}
- var result = nativeObjectToString$1.call(value);
- if (unmasked) {
- if (isOwn) {
- value[symToStringTag$1] = tag;
- } else {
- delete value[symToStringTag$1];
- }
- }
- return result;
- }
- var _getRawTag = getRawTag;
- var objectProto$7 = Object.prototype;
- var nativeObjectToString = objectProto$7.toString;
- function objectToString$1(value) {
- return nativeObjectToString.call(value);
- }
- var _objectToString = objectToString$1;
- var nullTag = "[object Null]";
- var undefinedTag = "[object Undefined]";
- var symToStringTag = _Symbol ? _Symbol.toStringTag : void 0;
- function baseGetTag(value) {
- if (value == null) {
- return value === void 0 ? undefinedTag : nullTag;
- }
- return symToStringTag && symToStringTag in Object(value) ? _getRawTag(value) : _objectToString(value);
- }
- var _baseGetTag = baseGetTag;
- function isObject(value) {
- var type = typeof value;
- return value != null && (type == "object" || type == "function");
- }
- var isObject_1 = isObject;
- var asyncTag = "[object AsyncFunction]";
- var funcTag$1 = "[object Function]";
- var genTag = "[object GeneratorFunction]";
- var proxyTag = "[object Proxy]";
- function isFunction(value) {
- if (!isObject_1(value)) {
- return false;
- }
- var tag = _baseGetTag(value);
- return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
- }
- var isFunction_1 = isFunction;
- var MAX_SAFE_INTEGER$1 = 9007199254740991;
- function isLength(value) {
- return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
- }
- var isLength_1 = isLength;
- function isArrayLike(value) {
- return value != null && isLength_1(value.length) && !isFunction_1(value);
- }
- var isArrayLike_1 = isArrayLike;
- var MAX_SAFE_INTEGER = 9007199254740991;
- var reIsUint = /^(?:0|[1-9]\d*)$/;
- function isIndex(value, length) {
- var type = typeof value;
- length = length == null ? MAX_SAFE_INTEGER : length;
- return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
- }
- var _isIndex = isIndex;
- function isIterateeCall(value, index, object) {
- if (!isObject_1(object)) {
- return false;
- }
- var type = typeof index;
- if (type == "number" ? isArrayLike_1(object) && _isIndex(index, object.length) : type == "string" && index in object) {
- return eq_1(object[index], value);
- }
- return false;
- }
- var _isIterateeCall = isIterateeCall;
- var reWhitespace = /\s/;
- function trimmedEndIndex(string) {
- var index = string.length;
- while(index-- && reWhitespace.test(string.charAt(index))){}
- return index;
- }
- var _trimmedEndIndex = trimmedEndIndex;
- var reTrimStart = /^\s+/;
- function baseTrim(string) {
- return string ? string.slice(0, _trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
- }
- var _baseTrim = baseTrim;
- function isObjectLike(value) {
- return value != null && typeof value == "object";
- }
- var isObjectLike_1 = isObjectLike;
- var symbolTag = "[object Symbol]";
- function isSymbol(value) {
- return typeof value == "symbol" || isObjectLike_1(value) && _baseGetTag(value) == symbolTag;
- }
- var isSymbol_1 = isSymbol;
- var NAN = 0 / 0;
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
- var reIsBinary = /^0b[01]+$/i;
- var reIsOctal = /^0o[0-7]+$/i;
- var freeParseInt = parseInt;
- function toNumber(value) {
- if (typeof value == "number") {
- return value;
- }
- if (isSymbol_1(value)) {
- return NAN;
- }
- if (isObject_1(value)) {
- var other = typeof value.valueOf == "function" ? value.valueOf() : value;
- value = isObject_1(other) ? other + "" : other;
- }
- if (typeof value != "string") {
- return value === 0 ? value : +value;
- }
- value = _baseTrim(value);
- var isBinary = reIsBinary.test(value);
- return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
- }
- var toNumber_1 = toNumber;
- var INFINITY$1 = 1 / 0;
- var MAX_INTEGER = 17976931348623157e292;
- function toFinite(value) {
- if (!value) {
- return value === 0 ? value : 0;
- }
- value = toNumber_1(value);
- if (value === INFINITY$1 || value === -INFINITY$1) {
- var sign = value < 0 ? -1 : 1;
- return sign * MAX_INTEGER;
- }
- return value === value ? value : 0;
- }
- var toFinite_1 = toFinite;
- function toInteger(value) {
- var result = toFinite_1(value), remainder = result % 1;
- return result === result ? remainder ? result - remainder : result : 0;
- }
- var toInteger_1 = toInteger;
- var nativeCeil = Math.ceil;
- var nativeMax$1 = Math.max;
- function chunk(array, size, guard) {
- if (guard ? _isIterateeCall(array, size, guard) : size === void 0) {
- size = 1;
- } else {
- size = nativeMax$1(toInteger_1(size), 0);
- }
- var length = array == null ? 0 : array.length;
- if (!length || size < 1) {
- return [];
- }
- var index = 0, resIndex = 0, result = Array(nativeCeil(length / size));
- while(index < length){
- result[resIndex++] = _baseSlice(array, index, index += size);
- }
- return result;
- }
- var chunk_1 = chunk;
- var AtGrid = function(_super) {
- __extends(AtGrid2, _super);
- function AtGrid2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.handleClick = function(item, index, row, event) {
- var _a2 = _this.props, onClick = _a2.onClick, _b = _a2.columnNum, columnNum = _b === void 0 ? 3 : _b;
- if (typeof onClick === "function") {
- var clickIndex = row * columnNum + index;
- onClick(item, clickIndex, event);
- }
- };
- return _this;
- }
- AtGrid2.prototype.render = function() {
- var _this = this;
- var _a2 = this.props, data = _a2.data, mode = _a2.mode, _b = _a2.columnNum, columnNum = _b === void 0 ? 3 : _b, hasBorder = _a2.hasBorder;
- if (Array.isArray(data) && data.length === 0) {
- return null;
- }
- var gridGroup = chunk_1(data, columnNum);
- var bodyClass = classnames([
- "at-grid__flex-item",
- "at-grid-item",
- "at-grid-item--" + mode
- ], {
- "at-grid-item--no-border": !hasBorder
- });
- return import_react.default.createElement(View, {
- className: classnames("at-grid", this.props.className)
- }, gridGroup.map(function(item, i) {
- return import_react.default.createElement(View, {
- className: "at-grid__flex",
- key: "at-grid-group-" + i
- }, item.map(function(childItem, index) {
- var _a3;
- return import_react.default.createElement(View, {
- key: "at-grid-item-" + index,
- className: classnames(bodyClass, {
- "at-grid-item--last": index === columnNum - 1
- }),
- onClick: _this.handleClick.bind(_this, childItem, index, i),
- style: {
- flex: "0 0 " + 100 / columnNum + "%"
- }
- }, import_react.default.createElement(View, {
- className: "at-grid-item__content"
- }, import_react.default.createElement(View, {
- className: "at-grid-item__content-inner"
- }, import_react.default.createElement(View, {
- className: "content-inner__icon"
- }, childItem.image && import_react.default.createElement(Image, {
- className: "content-inner__img",
- src: childItem.image,
- mode: "scaleToFill"
- }), childItem.iconInfo && !childItem.image && import_react.default.createElement(Text, {
- className: classnames(childItem.iconInfo.prefixClass || "at-icon", (_a3 = {}, _a3[(childItem.iconInfo.prefixClass || "at-icon") + "-" + childItem.iconInfo.value] = childItem.iconInfo.value, _a3), childItem.iconInfo.className),
- style: mergeStyle({
- color: childItem.iconInfo.color,
- fontSize: (childItem.iconInfo.size || 24) + "px"
- }, childItem.iconInfo.customStyle)
- })), import_react.default.createElement(Text, {
- className: "content-inner__text"
- }, childItem.value))));
- }));
- }));
- };
- return AtGrid2;
- }(import_react.default.Component);
- AtGrid.defaultProps = {
- data: [],
- columnNum: 3,
- mode: "square",
- hasBorder: true
- };
- AtGrid.propTypes = {
- mode: PropTypes.string,
- onClick: PropTypes.func,
- hasBorder: PropTypes.bool,
- columnNum: PropTypes.number,
- data: PropTypes.arrayOf(PropTypes.shape({
- image: PropTypes.string,
- value: PropTypes.string,
- iconInfo: PropTypes.shape({
- size: PropTypes.number,
- value: PropTypes.string,
- color: PropTypes.string,
- prefixClass: PropTypes.string,
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ])
- })
- }))
- };
- var AtIcon = function(_super) {
- __extends(AtIcon2, _super);
- function AtIcon2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtIcon2.prototype.handleClick = function() {
- this.props.onClick && this.props.onClick(arguments);
- };
- AtIcon2.prototype.render = function() {
- var _a2 = this.props, _b = _a2.customStyle, customStyle = _b === void 0 ? {} : _b, className = _a2.className, prefixClass = _a2.prefixClass, value = _a2.value, size = _a2.size, color = _a2.color;
- var rootStyle = {
- fontSize: "" + pxTransform(parseInt(String(size)) * 2),
- color
- };
- var iconName = value ? prefixClass + "-" + value : "";
- return import_react.default.createElement(Text, {
- className: classnames(prefixClass, iconName, className),
- style: mergeStyle(rootStyle, customStyle),
- onClick: this.handleClick.bind(this)
- });
- };
- return AtIcon2;
- }(import_react.default.Component);
- AtIcon.defaultProps = {
- customStyle: "",
- className: "",
- prefixClass: "at-icon",
- value: "",
- color: "",
- size: 24
- };
- AtIcon.propTypes = {
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ]),
- prefixClass: PropTypes.string,
- value: PropTypes.string,
- color: PropTypes.string,
- size: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.number
- ]),
- onClick: PropTypes.func
- };
- function getInputProps(props) {
- var actualProps = {
- type: props.type,
- maxLength: props.maxLength || props.maxlength,
- disabled: props.disabled,
- password: false
- };
- switch(actualProps.type){
- case "phone":
- actualProps.type = "number";
- actualProps.maxLength = 11;
- break;
- case "password":
- actualProps.type = "text";
- actualProps.password = true;
- break;
- }
- if (!props.disabled && !props.editable) {
- actualProps.disabled = true;
- }
- return actualProps;
- }
- var AtInput = function(_super) {
- __extends(AtInput2, _super);
- function AtInput2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.inputClearing = false;
- _this.handleInput = function(event) {
- var _a2, _b;
- return (_b = (_a2 = _this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a2, event.detail.value, event);
- };
- _this.handleFocus = function(event) {
- if (typeof _this.props.onFocus === "function") {
- _this.props.onFocus(event.detail.value, event);
- }
- };
- _this.handleBlur = function(event) {
- var _a2, _b;
- if (typeof _this.props.onBlur === "function") {
- _this.props.onBlur(event.detail.value, event);
- }
- if (event.type === "blur" && !_this.inputClearing) {
- (_b = (_a2 = _this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a2, event.detail.value, event);
- }
- _this.inputClearing = false;
- };
- _this.handleConfirm = function(event) {
- if (typeof _this.props.onConfirm === "function") {
- _this.props.onConfirm(event.detail.value, event);
- }
- };
- _this.handleClick = function(event) {
- if (!_this.props.editable && typeof _this.props.onClick === "function") {
- _this.props.onClick(event);
- }
- };
- _this.handleClearValue = function(event) {
- var _a2, _b;
- _this.inputClearing = true;
- (_b = (_a2 = _this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a2, "", event);
- };
- _this.handleKeyboardHeightChange = function(event) {
- if (typeof _this.props.onKeyboardHeightChange === "function") {
- _this.props.onKeyboardHeightChange(event);
- }
- };
- _this.handleErrorClick = function(event) {
- if (typeof _this.props.onErrorClick === "function") {
- _this.props.onErrorClick(event);
- }
- };
- return _this;
- }
- AtInput2.prototype.render = function() {
- var _a2 = this.props, className = _a2.className, customStyle = _a2.customStyle, name = _a2.name, cursorSpacing = _a2.cursorSpacing, confirmType = _a2.confirmType, cursor = _a2.cursor, selectionStart = _a2.selectionStart, selectionEnd = _a2.selectionEnd, adjustPosition = _a2.adjustPosition, border = _a2.border, title = _a2.title, error2 = _a2.error, clear = _a2.clear, placeholder = _a2.placeholder, placeholderStyle = _a2.placeholderStyle, placeholderClass = _a2.placeholderClass, _b = _a2.autoFocus, autoFocus = _b === void 0 ? false : _b, _c = _a2.focus, focus = _c === void 0 ? false : _c, value = _a2.value, required = _a2.required;
- var _d = getInputProps(this.props), type = _d.type, maxLength = _d.maxLength, disabled = _d.disabled, password = _d.password;
- var rootCls = classnames("at-input", {
- "at-input--without-border": !border
- }, className);
- var containerCls = classnames("at-input__container", {
- "at-input--error": error2,
- "at-input--disabled": disabled
- });
- var overlayCls = classnames("at-input__overlay", {
- "at-input__overlay--hidden": !disabled
- });
- var placeholderCls = classnames("placeholder", placeholderClass);
- var id = name && {
- id: name
- };
- return import_react.default.createElement(View, {
- className: rootCls,
- style: customStyle
- }, import_react.default.createElement(View, {
- className: containerCls
- }, import_react.default.createElement(View, {
- className: overlayCls,
- onClick: this.handleClick
- }), title && import_react.default.createElement(Label, {
- className: "at-input__title " + (required && "at-input__title--required"),
- for: name
- }, title), import_react.default.createElement(Input, __assign({
- className: "at-input__input"
- }, id, {
- name,
- type,
- disabled,
- password,
- placeholderStyle,
- placeholderClass: placeholderCls,
- placeholder,
- cursorSpacing,
- maxlength: maxLength,
- autoFocus
- }, focus ? {
- focus
- } : {}, {
- value,
- confirmType,
- cursor,
- selectionStart,
- selectionEnd,
- adjustPosition,
- onInput: this.handleInput,
- onFocus: this.handleFocus,
- onBlur: this.handleBlur,
- onConfirm: this.handleConfirm,
- onKeyboardHeightChange: this.handleKeyboardHeightChange
- })), clear && value && import_react.default.createElement(View, {
- className: "at-input__icon",
- onTouchEnd: this.handleClearValue
- }, import_react.default.createElement(Text, {
- className: "at-icon at-icon-close-circle at-input__icon-close"
- })), error2 && import_react.default.createElement(View, {
- className: "at-input__icon",
- onTouchStart: this.handleErrorClick
- }, import_react.default.createElement(Text, {
- className: "at-icon at-icon-alert-circle at-input__icon-alert"
- })), import_react.default.createElement(View, {
- className: "at-input__children"
- }, this.props.children)));
- };
- return AtInput2;
- }(import_react.default.Component);
- AtInput.defaultProps = {
- className: "",
- customStyle: "",
- value: "",
- name: "",
- placeholder: "",
- placeholderStyle: "",
- placeholderClass: "",
- title: "",
- cursorSpacing: 50,
- confirmType: "done",
- cursor: 0,
- selectionStart: -1,
- selectionEnd: -1,
- adjustPosition: true,
- maxlength: 140,
- maxLength: 140,
- type: "text",
- disabled: false,
- border: true,
- editable: true,
- error: false,
- clear: false,
- autoFocus: false,
- focus: false,
- required: false,
- onChange: function() {}
- };
- AtInput.propTypes = {
- className: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.array
- ]),
- customStyle: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.object
- ]),
- value: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.number
- ]),
- name: PropTypes.string,
- placeholder: PropTypes.string,
- placeholderStyle: PropTypes.string,
- placeholderClass: PropTypes.string,
- title: PropTypes.string,
- confirmType: PropTypes.string,
- cursor: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.number
- ]),
- selectionStart: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.number
- ]),
- selectionEnd: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.number
- ]),
- adjustPosition: PropTypes.bool,
- cursorSpacing: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.number
- ]),
- maxlength: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.number
- ]),
- maxLength: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.number
- ]),
- type: PropTypes.string,
- disabled: PropTypes.bool,
- border: PropTypes.bool,
- editable: PropTypes.bool,
- error: PropTypes.bool,
- clear: PropTypes.bool,
- autoFocus: PropTypes.bool,
- focus: PropTypes.bool,
- onChange: PropTypes.func,
- onFocus: PropTypes.func,
- onBlur: PropTypes.func,
- onConfirm: PropTypes.func,
- onErrorClick: PropTypes.func,
- onClick: PropTypes.func,
- required: PropTypes.bool
- };
- function arrayMap(array, iteratee) {
- var index = -1, length = array == null ? 0 : array.length, result = Array(length);
- while(++index < length){
- result[index] = iteratee(array[index], index, array);
- }
- return result;
- }
- var _arrayMap = arrayMap;
- var isArray = Array.isArray;
- var isArray_1 = isArray;
- var INFINITY = 1 / 0;
- var symbolProto = _Symbol ? _Symbol.prototype : void 0;
- var symbolToString = symbolProto ? symbolProto.toString : void 0;
- function baseToString(value) {
- if (typeof value == "string") {
- return value;
- }
- if (isArray_1(value)) {
- return _arrayMap(value, baseToString) + "";
- }
- if (isSymbol_1(value)) {
- return symbolToString ? symbolToString.call(value) : "";
- }
- var result = value + "";
- return result == "0" && 1 / value == -INFINITY ? "-0" : result;
- }
- var _baseToString = baseToString;
- function toString(value) {
- return value == null ? "" : _baseToString(value);
- }
- var toString_1 = toString;
- function addNum(num1, num2) {
- var sq1, sq2;
- try {
- sq1 = toString_1(num1).split(".")[1].length;
- } catch (e2) {
- sq1 = 0;
- }
- try {
- sq2 = toString_1(num2).split(".")[1].length;
- } catch (e21) {
- sq2 = 0;
- }
- var m2 = Math.pow(10, Math.max(sq1, sq2));
- return (Math.round(num1 * m2) + Math.round(num2 * m2)) / m2;
- }
- function parseValue(num) {
- if (num === "") return "0";
- var numStr = toString_1(num);
- if (numStr.indexOf("0") === 0 && numStr.indexOf(".") === -1) {
- return toString_1(parseFloat(num));
- }
- return toString_1(num);
- }
- var AtInputNumber = function(_super) {
- __extends(AtInputNumber2, _super);
- function AtInputNumber2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.handleValue = function(value) {
- var _a2 = _this.props, _b = _a2.max, max = _b === void 0 ? 100 : _b, _c = _a2.min, min = _c === void 0 ? 0 : _c;
- var resultValue = value === "" ? min : value;
- if (resultValue > max) {
- resultValue = max;
- _this.handleError({
- type: "OVER",
- errorValue: resultValue
- });
- }
- if (resultValue < min) {
- resultValue = min;
- _this.handleError({
- type: "LOW",
- errorValue: resultValue
- });
- }
- if (resultValue && !Number(resultValue)) {
- resultValue = parseFloat(String(resultValue)) || min;
- _this.handleError({
- type: "OVER",
- errorValue: resultValue
- });
- }
- resultValue = parseValue(String(resultValue));
- return resultValue;
- };
- _this.handleInput = function(e2) {
- var value = e2.target.value;
- var disabled = _this.props.disabled;
- if (disabled) return "";
- var newValue = _this.handleValue(value);
- _this.props.onChange(Number(newValue), e2);
- return newValue;
- };
- _this.handleBlur = function(event) {
- return _this.props.onBlur && _this.props.onBlur(event);
- };
- _this.handleError = function(errorValue) {
- if (!_this.props.onErrorInput) {
- return;
- }
- _this.props.onErrorInput(errorValue);
- };
- return _this;
- }
- AtInputNumber2.prototype.handleClick = function(clickType, e2) {
- var _a2 = this.props, disabled = _a2.disabled, value = _a2.value, _b = _a2.min, min = _b === void 0 ? 0 : _b, _c = _a2.max, max = _c === void 0 ? 100 : _c, _d = _a2.step, step = _d === void 0 ? 1 : _d;
- var lowThanMin = clickType === "minus" && value <= min;
- var overThanMax = clickType === "plus" && value >= max;
- if (lowThanMin || overThanMax || disabled) {
- var deltaValue_1 = clickType === "minus" ? -step : step;
- var errorValue = addNum(Number(value), deltaValue_1);
- if (disabled) {
- this.handleError({
- type: "DISABLED",
- errorValue
- });
- } else {
- this.handleError({
- type: lowThanMin ? "LOW" : "OVER",
- errorValue
- });
- }
- return;
- }
- var deltaValue = clickType === "minus" ? -step : step;
- var newValue = addNum(Number(value), deltaValue);
- newValue = Number(this.handleValue(newValue));
- this.props.onChange(newValue, e2);
- };
- AtInputNumber2.prototype.render = function() {
- var _a2 = this.props, customStyle = _a2.customStyle, className = _a2.className, width = _a2.width, disabled = _a2.disabled, value = _a2.value, type = _a2.type, _b = _a2.min, min = _b === void 0 ? 0 : _b, _c = _a2.max, max = _c === void 0 ? 100 : _c, size = _a2.size, disabledInput = _a2.disabledInput;
- var inputStyle = {
- width: width ? "" + pxTransform(width) : ""
- };
- var inputValue = Number(this.handleValue(value));
- var rootCls = classnames("at-input-number", {
- "at-input-number--lg": size === "large"
- }, className);
- var minusBtnCls = classnames("at-input-number__btn", {
- "at-input-number--disabled": inputValue <= min || disabled
- });
- var plusBtnCls = classnames("at-input-number__btn", {
- "at-input-number--disabled": inputValue >= max || disabled
- });
- return import_react.default.createElement(View, {
- className: rootCls,
- style: customStyle
- }, import_react.default.createElement(View, {
- className: minusBtnCls,
- onClick: this.handleClick.bind(this, "minus")
- }, import_react.default.createElement(Text, {
- className: "at-icon at-icon-subtract at-input-number__btn-subtract"
- })), import_react.default.createElement(Input, {
- className: "at-input-number__input",
- style: inputStyle,
- type,
- value: String(inputValue),
- disabled: disabledInput || disabled,
- onInput: this.handleInput,
- onBlur: this.handleBlur
- }), import_react.default.createElement(View, {
- className: plusBtnCls,
- onClick: this.handleClick.bind(this, "plus")
- }, import_react.default.createElement(Text, {
- className: "at-icon at-icon-add at-input-number__btn-add"
- })));
- };
- return AtInputNumber2;
- }(import_react.default.Component);
- AtInputNumber.defaultProps = {
- customStyle: {},
- className: "",
- disabled: false,
- disabledInput: false,
- value: 1,
- type: "number",
- width: 0,
- min: 0,
- max: 100,
- step: 1,
- size: "normal",
- onChange: function() {}
- };
- AtInputNumber.propTypes = {
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ]),
- value: PropTypes.oneOfType([
- PropTypes.number,
- PropTypes.string
- ]),
- type: PropTypes.oneOf([
- "number",
- "digit"
- ]),
- disabled: PropTypes.bool,
- width: PropTypes.number,
- min: PropTypes.number,
- max: PropTypes.number,
- step: PropTypes.number,
- size: PropTypes.oneOf([
- "normal",
- "large"
- ]),
- disabledInput: PropTypes.bool,
- onChange: PropTypes.func,
- onBlur: PropTypes.func,
- onErrorInput: PropTypes.func
- };
- var AtModalAction = function(_super) {
- __extends(AtModalAction2, _super);
- function AtModalAction2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtModalAction2.prototype.render = function() {
- var rootClass = classnames("at-modal__footer", {
- "at-modal__footer--simple": this.props.isSimple
- }, this.props.className);
- return import_react.default.createElement(View, {
- className: rootClass
- }, import_react.default.createElement(View, {
- className: "at-modal__action"
- }, this.props.children));
- };
- return AtModalAction2;
- }(import_react.default.Component);
- AtModalAction.defaultProps = {
- isSimple: false
- };
- AtModalAction.propTypes = {
- isSimple: PropTypes.bool
- };
- var AtModalContent = function(_super) {
- __extends(AtModalContent2, _super);
- function AtModalContent2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtModalContent2.prototype.render = function() {
- var rootClass = classnames("at-modal__content", this.props.className);
- return import_react.default.createElement(ScrollView, {
- scrollY: true,
- className: rootClass
- }, this.props.children);
- };
- return AtModalContent2;
- }(import_react.default.Component);
- var AtModalHeader = function(_super) {
- __extends(AtModalHeader2, _super);
- function AtModalHeader2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtModalHeader2.prototype.render = function() {
- var rootClass = classnames("at-modal__header", this.props.className);
- return import_react.default.createElement(View, {
- className: rootClass
- }, this.props.children);
- };
- return AtModalHeader2;
- }(import_react.default.Component);
- var AtModal = function(_super) {
- __extends(AtModal2, _super);
- function AtModal2(props) {
- var _this = _super.call(this, props) || this;
- _this.handleClickOverlay = function() {
- if (_this.props.closeOnClickOverlay) {
- _this.setState({
- _isOpened: false
- }, _this.handleClose);
- }
- };
- _this.handleClose = function(event) {
- if (typeof _this.props.onClose === "function") {
- _this.props.onClose(event);
- }
- };
- _this.handleCancel = function(event) {
- if (typeof _this.props.onCancel === "function") {
- _this.props.onCancel(event);
- }
- };
- _this.handleConfirm = function(event) {
- if (typeof _this.props.onConfirm === "function") {
- _this.props.onConfirm(event);
- }
- };
- _this.handleTouchMove = function(e2) {
- e2.stopPropagation();
- };
- var isOpened = props.isOpened;
- _this.state = {
- _isOpened: isOpened,
- isWEB: import_taro.default.getEnv() === import_taro.default.ENV_TYPE.WEB
- };
- return _this;
- }
- AtModal2.prototype.UNSAFE_componentWillReceiveProps = function(nextProps) {
- var isOpened = nextProps.isOpened;
- if (this.props.isOpened !== isOpened) {
- handleTouchScroll(isOpened);
- }
- if (isOpened !== this.state._isOpened) {
- this.setState({
- _isOpened: isOpened
- });
- }
- };
- AtModal2.prototype.render = function() {
- var _a2 = this.state, _isOpened = _a2._isOpened, isWEB = _a2.isWEB;
- var _b = this.props, title = _b.title, content = _b.content, cancelText = _b.cancelText, confirmText = _b.confirmText;
- var rootClass = classnames("at-modal", {
- "at-modal--active": _isOpened
- }, this.props.className);
- if (title || content) {
- var isRenderAction = cancelText || confirmText;
- return import_react.default.createElement(View, {
- className: rootClass
- }, import_react.default.createElement(View, {
- onClick: this.handleClickOverlay,
- className: "at-modal__overlay"
- }), import_react.default.createElement(View, {
- className: "at-modal__container"
- }, title && import_react.default.createElement(AtModalHeader, null, import_react.default.createElement(Text, null, title)), content && import_react.default.createElement(AtModalContent, null, import_react.default.createElement(View, {
- className: "content-simple"
- }, isWEB ? import_react.default.createElement(Text, {
- dangerouslySetInnerHTML: {
- __html: content.replace(/\\n/g, "<br/>")
- }
- }) : import_react.default.createElement(Text, null, content))), isRenderAction && import_react.default.createElement(AtModalAction, {
- isSimple: true
- }, cancelText && import_react.default.createElement(Button, {
- onClick: this.handleCancel
- }, cancelText), confirmText && import_react.default.createElement(Button, {
- onClick: this.handleConfirm
- }, confirmText))));
- }
- return import_react.default.createElement(View, {
- onTouchMove: this.handleTouchMove,
- className: rootClass
- }, import_react.default.createElement(View, {
- className: "at-modal__overlay",
- onClick: this.handleClickOverlay
- }), import_react.default.createElement(View, {
- className: "at-modal__container"
- }, this.props.children));
- };
- return AtModal2;
- }(import_react.default.Component);
- AtModal.defaultProps = {
- isOpened: false,
- closeOnClickOverlay: true
- };
- AtModal.propTypes = {
- title: PropTypes.string,
- isOpened: PropTypes.bool,
- onCancel: PropTypes.func,
- onConfirm: PropTypes.func,
- onClose: PropTypes.func,
- content: PropTypes.string,
- closeOnClickOverlay: PropTypes.bool,
- cancelText: PropTypes.string,
- confirmText: PropTypes.string
- };
- var AtNavBar = function(_super) {
- __extends(AtNavBar2, _super);
- function AtNavBar2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtNavBar2.prototype.handleClickLeftView = function(event) {
- this.props.onClickLeftIcon && this.props.onClickLeftIcon(event);
- };
- AtNavBar2.prototype.handleClickSt = function(event) {
- this.props.onClickRgIconSt && this.props.onClickRgIconSt(event);
- };
- AtNavBar2.prototype.handleClickNd = function(event) {
- this.props.onClickRgIconNd && this.props.onClickRgIconNd(event);
- };
- AtNavBar2.prototype.handleClickTitle = function(event) {
- this.props.onClickTitle && this.props.onClickTitle(event);
- };
- AtNavBar2.prototype.render = function() {
- var _a2, _b, _c;
- var _d = this.props, customStyle = _d.customStyle, className = _d.className, color = _d.color, fixed = _d.fixed, border = _d.border, leftIconType = _d.leftIconType, leftText = _d.leftText, title = _d.title, rightFirstIconType = _d.rightFirstIconType, rightSecondIconType = _d.rightSecondIconType;
- var linkStyle = {
- color
- };
- var defaultIconInfo = {
- customStyle: "",
- className: "",
- prefixClass: "at-icon",
- value: "",
- color: "",
- size: 24
- };
- var leftIconInfo = leftIconType instanceof Object ? __assign(__assign({}, defaultIconInfo), leftIconType) : __assign(__assign({}, defaultIconInfo), {
- value: leftIconType
- });
- var leftIconClass = classnames(leftIconInfo.prefixClass, (_a2 = {}, _a2[leftIconInfo.prefixClass + "-" + leftIconInfo.value] = leftIconInfo.value, _a2), leftIconInfo.className);
- var rightFirstIconInfo = rightFirstIconType instanceof Object ? __assign(__assign({}, defaultIconInfo), rightFirstIconType) : __assign(__assign({}, defaultIconInfo), {
- value: rightFirstIconType
- });
- var rightFirstIconClass = classnames(rightFirstIconInfo.prefixClass, (_b = {}, _b[rightFirstIconInfo.prefixClass + "-" + rightFirstIconInfo.value] = rightFirstIconInfo.value, _b), rightFirstIconInfo.className);
- var rightSecondIconInfo = rightSecondIconType instanceof Object ? __assign(__assign({}, defaultIconInfo), rightSecondIconType) : __assign(__assign({}, defaultIconInfo), {
- value: rightSecondIconType
- });
- var rightSecondIconClass = classnames(rightSecondIconInfo.prefixClass, (_c = {}, _c[rightSecondIconInfo.prefixClass + "-" + rightSecondIconInfo.value] = rightSecondIconInfo.value, _c), rightSecondIconInfo.className);
- return import_react.default.createElement(View, {
- className: classnames({
- "at-nav-bar": true,
- "at-nav-bar--fixed": fixed,
- "at-nav-bar--no-border": !border
- }, className),
- style: customStyle
- }, import_react.default.createElement(View, {
- className: "at-nav-bar__left-view",
- onClick: this.handleClickLeftView.bind(this),
- style: linkStyle
- }, leftIconType && import_react.default.createElement(Text, {
- className: leftIconClass,
- style: mergeStyle({
- color: leftIconInfo.color,
- fontSize: "" + pxTransform(parseInt(leftIconInfo.size.toString()) * 2)
- }, leftIconInfo.customStyle)
- }), import_react.default.createElement(Text, {
- className: "at-nav-bar__text"
- }, leftText)), import_react.default.createElement(View, {
- className: "at-nav-bar__title",
- onClick: this.handleClickTitle.bind(this)
- }, title || this.props.children), import_react.default.createElement(View, {
- className: "at-nav-bar__right-view"
- }, import_react.default.createElement(View, {
- className: classnames({
- "at-nav-bar__container": true,
- "at-nav-bar__container--hide": !rightSecondIconType
- }),
- style: linkStyle,
- onClick: this.handleClickNd.bind(this)
- }, rightSecondIconType && import_react.default.createElement(Text, {
- className: rightSecondIconClass,
- style: mergeStyle({
- color: rightSecondIconInfo.color,
- fontSize: "" + pxTransform(parseInt(rightSecondIconInfo.size.toString()) * 2)
- }, rightSecondIconInfo.customStyle)
- })), import_react.default.createElement(View, {
- className: classnames({
- "at-nav-bar__container": true,
- "at-nav-bar__container--hide": !rightFirstIconType
- }),
- style: linkStyle,
- onClick: this.handleClickSt.bind(this)
- }, rightFirstIconType && import_react.default.createElement(Text, {
- className: rightFirstIconClass,
- style: mergeStyle({
- color: rightFirstIconInfo.color,
- fontSize: "" + pxTransform(parseInt(rightFirstIconInfo.size.toString()) * 2)
- }, rightFirstIconInfo.customStyle)
- }))));
- };
- return AtNavBar2;
- }(import_react.default.Component);
- AtNavBar.defaultProps = {
- customStyle: "",
- className: "",
- fixed: false,
- border: true,
- color: "",
- leftIconType: "",
- leftText: "",
- title: "",
- rightFirstIconType: "",
- rightSecondIconType: ""
- };
- AtNavBar.propTypes = {
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ]),
- fixed: PropTypes.bool,
- border: PropTypes.bool,
- color: PropTypes.string,
- leftIconType: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.object
- ]),
- leftText: PropTypes.string,
- title: PropTypes.string,
- rightFirstIconType: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.object
- ]),
- rightSecondIconType: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.object
- ]),
- onClickLeftIcon: PropTypes.func,
- onClickRgIconSt: PropTypes.func,
- onClickRgIconNd: PropTypes.func,
- onClickTitle: PropTypes.func
- };
- var AtNoticebar = function(_super) {
- __extends(AtNoticebar2, _super);
- function AtNoticebar2(props) {
- var _this = _super.call(this, props) || this;
- var animElemId = "J_" + Math.ceil(Math.random() * 1e6).toString(36);
- _this.state = {
- show: true,
- animElemId,
- animationData: {
- actions: [
- {}
- ]
- },
- dura: 15,
- isWEAPP: import_taro.default.getEnv() === import_taro.default.ENV_TYPE.WEAPP,
- isALIPAY: import_taro.default.getEnv() === import_taro.default.ENV_TYPE.ALIPAY,
- isWEB: import_taro.default.getEnv() === import_taro.default.ENV_TYPE.WEB
- };
- return _this;
- }
- AtNoticebar2.prototype.onClose = function(event) {
- this.setState({
- show: false
- });
- this.props.onClose && this.props.onClose(event);
- };
- AtNoticebar2.prototype.onGotoMore = function(event) {
- this.props.onGotoMore && this.props.onGotoMore(event);
- };
- AtNoticebar2.prototype.UNSAFE_componentWillReceiveProps = function() {
- if (!this.timeout) {
- this.interval && clearInterval(this.interval);
- this.initAnimation();
- }
- };
- AtNoticebar2.prototype.componentDidMount = function() {
- if (!this.props.marquee) return;
- this.initAnimation();
- };
- AtNoticebar2.prototype.initAnimation = function() {
- var _this = this;
- var _a2 = this.state, isWEAPP = _a2.isWEAPP, isALIPAY = _a2.isALIPAY;
- this.timeout = setTimeout(function() {
- _this.timeout = null;
- if (_this.state.isWEB) {
- var _a3 = _this.props.speed, speed = _a3 === void 0 ? 100 : _a3;
- var elem = document.querySelector("." + _this.state.animElemId);
- if (!elem) return;
- var width = elem.getBoundingClientRect().width;
- var dura = width / +speed;
- _this.setState({
- dura
- });
- } else if (isWEAPP || isALIPAY) {
- var query = import_taro.default.createSelectorQuery();
- query.select("." + _this.state.animElemId).boundingClientRect().exec(function(res) {
- var queryRes = res[0];
- if (!queryRes) return;
- var width2 = queryRes.width;
- var _a4 = _this.props.speed, speed2 = _a4 === void 0 ? 100 : _a4;
- var dura2 = width2 / +speed2;
- var animation = import_taro.default.createAnimation({
- duration: dura2 * 1e3,
- timingFunction: "linear"
- });
- var resetAnimation = import_taro.default.createAnimation({
- duration: 0,
- timingFunction: "linear"
- });
- var resetOpacityAnimation = import_taro.default.createAnimation({
- duration: 0,
- timingFunction: "linear"
- });
- var animBody = function() {
- resetOpacityAnimation.opacity(0).step();
- _this.setState({
- animationData: resetOpacityAnimation.export()
- });
- setTimeout(function() {
- resetAnimation.translateX(0).step();
- _this.setState({
- animationData: resetAnimation.export()
- });
- }, 300);
- setTimeout(function() {
- resetOpacityAnimation.opacity(1).step();
- _this.setState({
- animationData: resetOpacityAnimation.export()
- });
- }, 600);
- setTimeout(function() {
- animation.translateX(-width2).step();
- _this.setState({
- animationData: animation.export()
- });
- }, 900);
- };
- animBody();
- _this.interval = setInterval(animBody, dura2 * 1e3 + 1e3);
- });
- }
- }, 1e3);
- };
- AtNoticebar2.prototype.render = function() {
- var _a2 = this.props, single = _a2.single, icon = _a2.icon, marquee = _a2.marquee, customStyle = _a2.customStyle, className = _a2.className, _b = _a2.moreText, moreText = _b === void 0 ? "\u67E5\u770B\u8BE6\u60C5" : _b;
- var _c = this.props, showMore = _c.showMore, close = _c.close;
- var _d = this.state, dura = _d.dura, show = _d.show, animElemId = _d.animElemId, animationData = _d.animationData, isWEAPP = _d.isWEAPP, isALIPAY = _d.isALIPAY;
- var rootClassName = [
- "at-noticebar"
- ];
- if (!single) showMore = false;
- var style = {};
- var innerClassName = [
- "at-noticebar__content-inner"
- ];
- if (marquee) {
- close = false;
- style["animation-duration"] = dura + "s";
- innerClassName.push(animElemId);
- }
- var classObject = {
- "at-noticebar--marquee": marquee,
- "at-noticebar--weapp": marquee && (isWEAPP || isALIPAY),
- "at-noticebar--single": !marquee && single
- };
- var iconClass = [
- "at-icon"
- ];
- if (icon) iconClass.push("at-icon-" + icon);
- return show && import_react.default.createElement(View, {
- className: classnames(rootClassName, classObject, className),
- style: customStyle
- }, close && import_react.default.createElement(View, {
- className: "at-noticebar__close",
- onClick: this.onClose.bind(this)
- }, import_react.default.createElement(Text, {
- className: "at-icon at-icon-close"
- })), import_react.default.createElement(View, {
- className: "at-noticebar__content"
- }, icon && import_react.default.createElement(View, {
- className: "at-noticebar__content-icon"
- }, import_react.default.createElement(Text, {
- className: classnames(iconClass, iconClass)
- })), import_react.default.createElement(View, {
- className: "at-noticebar__content-text"
- }, import_react.default.createElement(View, {
- id: animElemId,
- animation: animationData,
- className: classnames(innerClassName),
- style
- }, this.props.children))), showMore && import_react.default.createElement(View, {
- className: "at-noticebar__more",
- onClick: this.onGotoMore.bind(this)
- }, import_react.default.createElement(Text, {
- className: "text"
- }, moreText), import_react.default.createElement(View, {
- className: "at-noticebar__more-icon"
- }, import_react.default.createElement(Text, {
- className: "at-icon at-icon-chevron-right"
- }))));
- };
- return AtNoticebar2;
- }(import_react.default.Component);
- AtNoticebar.defaultProps = {
- close: false,
- single: false,
- marquee: false,
- speed: 100,
- moreText: "\u67E5\u770B\u8BE6\u60C5",
- showMore: false,
- icon: "",
- customStyle: {}
- };
- AtNoticebar.propTypes = {
- close: PropTypes.bool,
- single: PropTypes.bool,
- marquee: PropTypes.bool,
- speed: PropTypes.number,
- moreText: PropTypes.string,
- showMore: PropTypes.bool,
- icon: PropTypes.string,
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- onClose: PropTypes.func,
- onGotoMore: PropTypes.func
- };
- var MIN_MAXPAGE = 1;
- var getMaxPage = function(maxPage) {
- if (maxPage === void 0) {
- maxPage = 0;
- }
- if (maxPage <= 0) return MIN_MAXPAGE;
- return maxPage;
- };
- var createPickerRange = function(max) {
- var range = new Array(max).fill(0).map(function(_val, index) {
- return index + 1;
- });
- return range;
- };
- var AtPagination = function(_super) {
- __extends(AtPagination2, _super);
- function AtPagination2(props) {
- var _this = _super.call(this, props) || this;
- var _a2 = _this.props, current = _a2.current, _b = _a2.pageSize, pageSize = _b === void 0 ? 20 : _b, total = _a2.total;
- var maxPage = getMaxPage(Math.ceil(total / pageSize));
- _this.state = {
- currentPage: current || 1,
- maxPage,
- pickerRange: createPickerRange(maxPage)
- };
- return _this;
- }
- AtPagination2.prototype.onPrev = function() {
- var currentPage = this.state.currentPage;
- var originCur = currentPage;
- currentPage -= 1;
- currentPage = Math.max(1, currentPage);
- if (originCur === currentPage) return;
- this.props.onPageChange && this.props.onPageChange({
- type: "prev",
- current: currentPage
- });
- this.setState({
- currentPage
- });
- };
- AtPagination2.prototype.onNext = function() {
- var currentPage = this.state.currentPage;
- var originCur = currentPage;
- var maxPage = this.state.maxPage;
- currentPage += 1;
- currentPage = Math.min(maxPage, currentPage);
- if (originCur === currentPage) return;
- this.props.onPageChange && this.props.onPageChange({
- type: "next",
- current: currentPage
- });
- this.setState({
- currentPage
- });
- };
- AtPagination2.prototype.UNSAFE_componentWillReceiveProps = function(props) {
- var total = props.total, _a2 = props.pageSize, pageSize = _a2 === void 0 ? 20 : _a2, current = props.current;
- var maxPage = getMaxPage(Math.ceil(total / pageSize));
- if (maxPage !== this.state.maxPage) {
- this.setState({
- maxPage,
- pickerRange: createPickerRange(maxPage)
- });
- }
- if (typeof current === "number" && current !== this.state.currentPage) {
- this.setState({
- currentPage: current
- });
- }
- };
- AtPagination2.prototype.render = function() {
- var _a2 = this.props, icon = _a2.icon, customStyle = _a2.customStyle;
- var _b = this.state, currentPage = _b.currentPage, maxPage = _b.maxPage;
- var rootClassName = [
- "at-pagination"
- ];
- var prevDisabled = maxPage === MIN_MAXPAGE || currentPage === 1;
- var nextDisabled = maxPage === MIN_MAXPAGE || currentPage === maxPage;
- var classObject = {
- "at-pagination--icon": icon
- };
- return import_react.default.createElement(View, {
- className: classnames(rootClassName, classObject, this.props.className),
- style: customStyle
- }, import_react.default.createElement(View, {
- className: "at-pagination__btn-prev"
- }, icon && import_react.default.createElement(AtButton, {
- onClick: this.onPrev.bind(this),
- size: "small",
- disabled: prevDisabled
- }, import_react.default.createElement(Text, {
- className: "at-icon at-icon-chevron-left"
- })), !icon && import_react.default.createElement(AtButton, {
- onClick: this.onPrev.bind(this),
- size: "small",
- disabled: prevDisabled
- }, "\u4E0A\u4E00\u9875")), import_react.default.createElement(View, {
- className: "at-pagination__number"
- }, import_react.default.createElement(Text, {
- className: "at-pagination__number-current"
- }, currentPage), "/", maxPage), import_react.default.createElement(View, {
- className: "at-pagination__btn-next"
- }, icon && import_react.default.createElement(AtButton, {
- onClick: this.onNext.bind(this),
- size: "small",
- disabled: nextDisabled
- }, import_react.default.createElement(Text, {
- className: "at-icon at-icon-chevron-right"
- })), !icon && import_react.default.createElement(AtButton, {
- onClick: this.onNext.bind(this),
- size: "small",
- disabled: nextDisabled
- }, "\u4E0B\u4E00\u9875")));
- };
- return AtPagination2;
- }(import_react.default.Component);
- AtPagination.defaultProps = {
- current: 1,
- total: 0,
- pageSize: 20,
- icon: false,
- customStyle: {}
- };
- AtPagination.propTypes = {
- current: PropTypes.number,
- total: PropTypes.number,
- pageSize: PropTypes.number,
- icon: PropTypes.bool,
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- onPageChange: PropTypes.func
- };
- var AtProgress = function(_super) {
- __extends(AtProgress2, _super);
- function AtProgress2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtProgress2.prototype.render = function() {
- var _a2;
- var color = this.props.color;
- var percent = this.props.percent;
- var _b = this.props, strokeWidth = _b.strokeWidth, status = _b.status, isHidePercent = _b.isHidePercent;
- if (typeof percent !== "number") {
- percent = 0;
- }
- if (percent < 0) {
- percent = 0;
- } else if (percent > 100) {
- percent = 100;
- }
- var rootClass = classnames("at-progress", (_a2 = {}, _a2["at-progress--" + status] = !!status, _a2), this.props.className);
- var iconClass = classnames("at-icon", {
- "at-icon-close-circle": status === "error",
- "at-icon-check-circle": status === "success"
- });
- var progressStyle = {
- width: percent && +percent + "%",
- height: strokeWidth && +strokeWidth + "px",
- backgroundColor: color
- };
- return import_react.default.createElement(View, {
- className: rootClass
- }, import_react.default.createElement(View, {
- className: "at-progress__outer"
- }, import_react.default.createElement(View, {
- className: "at-progress__outer-inner"
- }, import_react.default.createElement(View, {
- className: "at-progress__outer-inner-background",
- style: progressStyle
- }))), !isHidePercent && import_react.default.createElement(View, {
- className: "at-progress__content"
- }, !status || status === "progress" ? percent + "%" : import_react.default.createElement(Text, {
- className: iconClass
- })));
- };
- return AtProgress2;
- }(import_react.default.Component);
- AtProgress.propTypes = {
- color: PropTypes.string,
- status: PropTypes.string,
- percent: PropTypes.number,
- strokeWidth: PropTypes.number,
- isHidePercent: PropTypes.bool
- };
- var AtRadio = function(_super) {
- __extends(AtRadio2, _super);
- function AtRadio2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtRadio2.prototype.handleClick = function(option, event) {
- if (option.disabled) return;
- this.props.onClick(option.value, event);
- };
- AtRadio2.prototype.render = function() {
- var _this = this;
- var _a2 = this.props, customStyle = _a2.customStyle, className = _a2.className, options = _a2.options, value = _a2.value;
- return import_react.default.createElement(View, {
- className: classnames("at-radio", className),
- style: customStyle
- }, options.map(function(option) {
- return import_react.default.createElement(View, {
- key: option.value,
- onClick: _this.handleClick.bind(_this, option),
- className: classnames({
- "at-radio__option": true,
- "at-radio__option--disabled": option.disabled
- })
- }, import_react.default.createElement(View, {
- className: "at-radio__option-wrap"
- }, import_react.default.createElement(View, {
- className: "at-radio__option-container"
- }, import_react.default.createElement(View, {
- className: "at-radio__title"
- }, option.label), import_react.default.createElement(View, {
- className: classnames({
- "at-radio__icon": true,
- "at-radio__icon--checked": value === option.value
- })
- }, import_react.default.createElement(Text, {
- className: "at-icon at-icon-check"
- }))), option.desc && import_react.default.createElement(View, {
- className: "at-radio__desc"
- }, option.desc)));
- }));
- };
- return AtRadio2;
- }(import_react.default.Component);
- AtRadio.defaultProps = {
- customStyle: "",
- className: "",
- value: "",
- options: [],
- onClick: function() {}
- };
- AtRadio.propTypes = {
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ]),
- value: PropTypes.string,
- options: PropTypes.array,
- onClick: PropTypes.func
- };
- var AtRate = function(_super) {
- __extends(AtRate2, _super);
- function AtRate2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtRate2.prototype.handleClick = function(event) {
- this.props.onChange && this.props.onChange(event);
- };
- AtRate2.prototype.render = function() {
- var _this = this;
- var _a2 = this.props, customStyle = _a2.customStyle, className = _a2.className, _b = _a2.value, value = _b === void 0 ? 0 : _b, _c = _a2.max, max = _c === void 0 ? 5 : _c, size = _a2.size, _d = _a2.margin, margin = _d === void 0 ? 5 : _d;
- var iconStyle = {
- marginRight: pxTransform(margin)
- };
- var starIconStyle = {
- fontSize: size ? size + "px" : ""
- };
- var classNameArr = [];
- var floorValue = Math.floor(value);
- var ceilValue = Math.ceil(value);
- for(var i = 0; i < max; i++){
- if (floorValue > i) {
- classNameArr.push("at-rate__icon at-rate__icon--on");
- } else if (ceilValue - 1 === i) {
- classNameArr.push("at-rate__icon at-rate__icon--half");
- } else {
- classNameArr.push("at-rate__icon at-rate__icon--off");
- }
- }
- return import_react.default.createElement(View, {
- className: classnames("at-rate", className),
- style: customStyle
- }, classNameArr.map(function(cls, i2) {
- return import_react.default.createElement(View, {
- className: cls,
- key: "at-rate-star-" + i2,
- style: iconStyle,
- onClick: _this.handleClick.bind(_this, i2 + 1)
- }, import_react.default.createElement(Text, {
- className: "at-icon at-icon-star-2",
- style: starIconStyle
- }), import_react.default.createElement(View, {
- className: "at-rate__left"
- }, import_react.default.createElement(Text, {
- className: "at-icon at-icon-star-2",
- style: starIconStyle
- })));
- }));
- };
- return AtRate2;
- }(import_react.default.Component);
- AtRate.defaultProps = {
- customStyle: "",
- className: "",
- size: 0,
- value: 0,
- max: 5,
- margin: 5
- };
- AtRate.propTypes = {
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ]),
- size: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.number
- ]),
- value: PropTypes.number,
- max: PropTypes.number,
- margin: PropTypes.number,
- onChange: PropTypes.func
- };
- var AtSegmentedControl = function(_super) {
- __extends(AtSegmentedControl2, _super);
- function AtSegmentedControl2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtSegmentedControl2.prototype.handleClick = function(index, event) {
- if (this.props.disabled) return;
- this.props.onClick(index, event);
- };
- AtSegmentedControl2.prototype.render = function() {
- var _this = this;
- var _a2 = this.props, _b = _a2.customStyle, customStyle = _b === void 0 ? "" : _b, className = _a2.className, disabled = _a2.disabled, values = _a2.values, selectedColor = _a2.selectedColor, current = _a2.current, color = _a2.color, _c = _a2.fontSize, fontSize = _c === void 0 ? 28 : _c;
- var rootStyle = {
- borderColor: selectedColor
- };
- var itemStyle = {
- color: selectedColor,
- fontSize: pxTransform(fontSize),
- borderColor: selectedColor,
- backgroundColor: color
- };
- var selectedItemStyle = {
- color,
- fontSize: pxTransform(fontSize),
- borderColor: selectedColor,
- backgroundColor: selectedColor
- };
- var rootCls = classnames("at-segmented-control", {
- "at-segmented-control--disabled": disabled
- }, className);
- return import_react.default.createElement(View, {
- className: rootCls,
- style: mergeStyle(rootStyle, customStyle)
- }, values.map(function(value, i) {
- return import_react.default.createElement(View, {
- className: classnames("at-segmented-control__item", {
- "at-segmented-control__item--active": current === i
- }),
- style: current === i ? selectedItemStyle : itemStyle,
- key: value,
- onClick: _this.handleClick.bind(_this, i)
- }, value);
- }));
- };
- return AtSegmentedControl2;
- }(import_react.default.Component);
- AtSegmentedControl.defaultProps = {
- customStyle: "",
- className: "",
- current: 0,
- color: "",
- fontSize: 28,
- disabled: false,
- selectedColor: "",
- values: [],
- onClick: function() {}
- };
- AtSegmentedControl.propTypes = {
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ]),
- current: PropTypes.number,
- color: PropTypes.string,
- fontSize: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.number
- ]),
- disabled: PropTypes.bool,
- values: PropTypes.array,
- onClick: PropTypes.func
- };
- var AtSwitch = function(_super) {
- __extends(AtSwitch2, _super);
- function AtSwitch2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.handleChange = function(event) {
- var _a2 = event.detail, value = _a2.value, checked = _a2.checked;
- var state = typeof value === "undefined" ? checked : value;
- _this.props.onChange && _this.props.onChange(state);
- };
- return _this;
- }
- AtSwitch2.prototype.render = function() {
- var _a2 = this.props, customStyle = _a2.customStyle, className = _a2.className, disabled = _a2.disabled, border = _a2.border, title = _a2.title, checked = _a2.checked, color = _a2.color;
- var rootCls = classnames("at-switch", {
- "at-switch--without-border": !border
- }, className);
- var containerCls = classnames("at-switch__container", {
- "at-switch--disabled": disabled
- });
- return import_react.default.createElement(View, {
- className: rootCls,
- style: customStyle
- }, import_react.default.createElement(View, {
- className: "at-switch__title"
- }, title), import_react.default.createElement(View, {
- className: containerCls
- }, import_react.default.createElement(View, {
- className: "at-switch__mask"
- }), import_react.default.createElement(Switch, {
- className: "at-switch__switch",
- checked,
- color,
- onChange: this.handleChange
- })));
- };
- return AtSwitch2;
- }(import_react.default.Component);
- AtSwitch.defaultProps = {
- customStyle: "",
- className: "",
- title: "",
- color: "#6190e8",
- border: true,
- disabled: false,
- checked: false
- };
- AtSwitch.propTypes = {
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ]),
- title: PropTypes.string,
- color: PropTypes.string,
- checked: PropTypes.bool,
- border: PropTypes.bool,
- disabled: PropTypes.bool,
- onChange: PropTypes.func
- };
- var AtTabBar = function(_super) {
- __extends(AtTabBar2, _super);
- function AtTabBar2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtTabBar2.prototype.handleClick = function(index, event) {
- this.props.onClick(index, event);
- };
- AtTabBar2.prototype.render = function() {
- var _this = this;
- var _a2 = this.props, _b = _a2.customStyle, customStyle = _b === void 0 ? "" : _b, className = _a2.className, fixed = _a2.fixed, backgroundColor = _a2.backgroundColor, tabList = _a2.tabList, current = _a2.current, color = _a2.color, iconSize = _a2.iconSize, fontSize = _a2.fontSize, selectedColor = _a2.selectedColor;
- var defaultStyle = {
- color: color || ""
- };
- var selectedStyle = {
- color: selectedColor || ""
- };
- var titleStyle = {
- fontSize: fontSize ? fontSize + "px" : ""
- };
- var rootStyle = {
- backgroundColor: backgroundColor || ""
- };
- var imgStyle = {
- width: iconSize + "px",
- height: iconSize + "px"
- };
- return import_react.default.createElement(View, {
- className: classnames({
- "at-tab-bar": true,
- "at-tab-bar--fixed": fixed
- }, className),
- style: mergeStyle(rootStyle, customStyle)
- }, tabList.map(function(item, i) {
- var _a3;
- return import_react.default.createElement(View, {
- className: classnames("at-tab-bar__item", {
- "at-tab-bar__item--active": current === i
- }),
- style: current === i ? selectedStyle : defaultStyle,
- key: item.title,
- onClick: _this.handleClick.bind(_this, i)
- }, item.iconType ? import_react.default.createElement(AtBadge, {
- dot: !!item.dot,
- value: item.text,
- maxValue: Number(item.max)
- }, import_react.default.createElement(View, {
- className: "at-tab-bar__icon"
- }, import_react.default.createElement(Text, {
- className: classnames("" + (item.iconPrefixClass || "at-icon"), (_a3 = {}, _a3[(item.iconPrefixClass || "at-icon") + "-" + item.selectedIconType] = current === i && item.selectedIconType, _a3[(item.iconPrefixClass || "at-icon") + "-" + item.iconType] = !(current === i && item.selectedIconType), _a3)),
- style: {
- color: current === i ? selectedColor : color,
- fontSize: iconSize ? iconSize + "px" : ""
- }
- }))) : null, item.image ? import_react.default.createElement(AtBadge, {
- dot: !!item.dot,
- value: item.text,
- maxValue: Number(item.max)
- }, import_react.default.createElement(View, {
- className: "at-tab-bar__icon"
- }, import_react.default.createElement(Image, {
- className: classnames("at-tab-bar__inner-img", {
- "at-tab-bar__inner-img--inactive": current !== i
- }),
- mode: "widthFix",
- src: item.selectedImage || item.image,
- style: imgStyle
- }), import_react.default.createElement(Image, {
- className: classnames("at-tab-bar__inner-img", {
- "at-tab-bar__inner-img--inactive": current === i
- }),
- mode: "widthFix",
- src: item.image,
- style: imgStyle
- }))) : null, import_react.default.createElement(View, null, import_react.default.createElement(AtBadge, {
- dot: item.iconType || item.image ? false : !!item.dot,
- value: item.iconType || item.image ? "" : item.text,
- maxValue: item.iconType || item.image ? 0 : Number(item.max)
- }, import_react.default.createElement(View, {
- className: "at-tab-bar__title",
- style: titleStyle
- }, item.title))));
- }));
- };
- return AtTabBar2;
- }(import_react.default.Component);
- AtTabBar.defaultProps = {
- customStyle: "",
- className: "",
- fixed: false,
- current: 0,
- tabList: [],
- onClick: function() {}
- };
- AtTabBar.propTypes = {
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ]),
- fixed: PropTypes.bool,
- backgroundColor: PropTypes.string,
- current: PropTypes.number,
- iconSize: PropTypes.oneOfType([
- PropTypes.number,
- PropTypes.string
- ]),
- fontSize: PropTypes.oneOfType([
- PropTypes.number,
- PropTypes.string
- ]),
- color: PropTypes.string,
- selectedColor: PropTypes.string,
- tabList: PropTypes.array,
- onClick: PropTypes.func
- };
- var ENV$3 = import_taro.default.getEnv();
- var MIN_DISTANCE = 100;
- var MAX_INTERVAL = 10;
- var AtTabs = function(_super) {
- __extends(AtTabs2, _super);
- function AtTabs2(props) {
- var _this = _super.call(this, props) || this;
- _this.updateState = function(idx) {
- if (_this.props.scroll) {
- switch(ENV$3){
- case import_taro.default.ENV_TYPE.WEAPP:
- case import_taro.default.ENV_TYPE.ALIPAY:
- case import_taro.default.ENV_TYPE.SWAN:
- {
- var index = Math.max(idx - 1, 0);
- _this.setState({
- _scrollIntoView: "tab" + _this._tabId + index
- });
- break;
- }
- case import_taro.default.ENV_TYPE.WEB:
- {
- var index = Math.max(idx - 1, 0);
- var prevTabItem = _this.tabHeaderRef.children[index];
- prevTabItem && _this.setState({
- _scrollTop: prevTabItem.offsetTop,
- _scrollLeft: prevTabItem.offsetLeft
- });
- break;
- }
- default:
- {
- console.warn("AtTab \u7EC4\u4EF6\u5728\u8BE5\u73AF\u5883\u8FD8\u672A\u9002\u914D");
- break;
- }
- }
- }
- };
- _this.state = {
- _scrollLeft: 0,
- _scrollTop: 0,
- _scrollIntoView: ""
- };
- _this._tabId = isTest() ? "tabs-AOTU2018" : uuid();
- _this._touchDot = 0;
- _this._timer = null;
- _this._interval = 0;
- _this._isMoving = false;
- return _this;
- }
- AtTabs2.prototype.handleClick = function(index, event) {
- this.props.onClick(index, event);
- };
- AtTabs2.prototype.handleTouchStart = function(e2) {
- var _this = this;
- var _a2 = this.props, swipeable = _a2.swipeable, tabDirection = _a2.tabDirection;
- if (!swipeable || tabDirection === "vertical") return;
- this._touchDot = e2.touches[0].pageX;
- this._timer = setInterval(function() {
- _this._interval++;
- }, 100);
- };
- AtTabs2.prototype.handleTouchMove = function(e2) {
- var _a2 = this.props, swipeable = _a2.swipeable, tabDirection = _a2.tabDirection, current = _a2.current, tabList = _a2.tabList;
- if (!swipeable || tabDirection === "vertical") return;
- var touchMove = e2.touches[0].pageX;
- var moveDistance = touchMove - this._touchDot;
- var maxIndex = tabList.length;
- if (!this._isMoving && this._interval < MAX_INTERVAL && this._touchDot > 20) {
- if (current + 1 < maxIndex && moveDistance <= -MIN_DISTANCE) {
- this._isMoving = true;
- this.handleClick(current + 1, e2);
- } else if (current - 1 >= 0 && moveDistance >= MIN_DISTANCE) {
- this._isMoving = true;
- this.handleClick(current - 1, e2);
- }
- }
- };
- AtTabs2.prototype.handleTouchEnd = function() {
- var _a2 = this.props, swipeable = _a2.swipeable, tabDirection = _a2.tabDirection;
- if (!swipeable || tabDirection === "vertical") return;
- clearInterval(this._timer);
- this._interval = 0;
- this._isMoving = false;
- };
- AtTabs2.prototype.getTabHeaderRef = function() {
- if (ENV$3 === import_taro.default.ENV_TYPE.WEB) {
- this.tabHeaderRef = document.getElementById(this._tabId);
- }
- };
- AtTabs2.prototype.UNSAFE_componentWillReceiveProps = function(nextProps) {
- if (nextProps.scroll !== this.props.scroll) {
- this.getTabHeaderRef();
- }
- if (nextProps.current !== this.props.current) {
- this.updateState(nextProps.current);
- }
- };
- AtTabs2.prototype.componentDidMount = function() {
- this.getTabHeaderRef();
- this.updateState(this.props.current);
- };
- AtTabs2.prototype.componentWillUnmount = function() {
- this.tabHeaderRef = null;
- };
- AtTabs2.prototype.render = function() {
- var _a2;
- var _this = this;
- var _b = this.props, _c = _b.customStyle, customStyle = _c === void 0 ? "" : _c, className = _b.className, height = _b.height, tabDirection = _b.tabDirection, animated = _b.animated, tabList = _b.tabList, scroll = _b.scroll, current = _b.current;
- var _d = this.state, _scrollLeft = _d._scrollLeft, _scrollTop = _d._scrollTop, _scrollIntoView = _d._scrollIntoView;
- var heightStyle = {
- height
- };
- var underlineStyle = {
- height: tabDirection === "vertical" ? tabList.length * 100 + "%" : "1PX",
- width: tabDirection === "horizontal" ? tabList.length * 100 + "%" : "1PX"
- };
- var bodyStyle = {};
- var transformStyle = "translate3d(0px, -" + current * 100 + "%, 0px)";
- if (tabDirection === "horizontal") {
- transformStyle = "translate3d(-" + current * 100 + "%, 0px, 0px)";
- }
- Object.assign(bodyStyle, {
- transform: transformStyle,
- "-webkit-transform": transformStyle
- });
- if (!animated) {
- bodyStyle.transition = "unset";
- }
- var tabItems = tabList.map(function(item, idx) {
- var itemCls = classnames({
- "at-tabs__item": true,
- "at-tabs__item--active": current === idx
- });
- return import_react.default.createElement(View, {
- className: itemCls,
- id: "tab" + _this._tabId + idx,
- key: "at-tabs-item-" + idx,
- onClick: _this.handleClick.bind(_this, idx)
- }, item.title, import_react.default.createElement(View, {
- className: "at-tabs__item-underline"
- }));
- });
- var rootCls = classnames((_a2 = {
- "at-tabs": true,
- "at-tabs--scroll": scroll
- }, _a2["at-tabs--" + tabDirection] = true, _a2["at-tabs--" + ENV$3] = true, _a2), className);
- var scrollX = tabDirection === "horizontal";
- var scrollY = tabDirection === "vertical";
- return import_react.default.createElement(View, {
- className: rootCls,
- style: mergeStyle(heightStyle, customStyle)
- }, scroll ? import_react.default.createElement(ScrollView, {
- id: this._tabId,
- className: "at-tabs__header",
- style: heightStyle,
- scrollX,
- scrollY,
- scrollWithAnimation: true,
- scrollLeft: _scrollLeft,
- scrollTop: _scrollTop,
- scrollIntoView: _scrollIntoView
- }, tabItems) : import_react.default.createElement(View, {
- id: this._tabId,
- className: "at-tabs__header"
- }, tabItems), import_react.default.createElement(View, {
- className: "at-tabs__body",
- onTouchStart: this.handleTouchStart.bind(this),
- onTouchEnd: this.handleTouchEnd.bind(this),
- onTouchMove: this.handleTouchMove.bind(this),
- style: mergeStyle(bodyStyle, heightStyle)
- }, import_react.default.createElement(View, {
- className: "at-tabs__underline",
- style: underlineStyle
- }), this.props.children));
- };
- return AtTabs2;
- }(import_react.default.Component);
- AtTabs.defaultProps = {
- customStyle: "",
- className: "",
- tabDirection: "horizontal",
- height: "",
- current: 0,
- swipeable: true,
- scroll: false,
- animated: true,
- tabList: [],
- onClick: function() {}
- };
- AtTabs.propTypes = {
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ]),
- height: PropTypes.string,
- tabDirection: PropTypes.oneOf([
- "horizontal",
- "vertical"
- ]),
- current: PropTypes.number,
- swipeable: PropTypes.bool,
- scroll: PropTypes.bool,
- animated: PropTypes.bool,
- tabList: PropTypes.array,
- onClick: PropTypes.func
- };
- var AtTabsPane = function(_super) {
- __extends(AtTabsPane2, _super);
- function AtTabsPane2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtTabsPane2.prototype.render = function() {
- var _a2 = this.props, customStyle = _a2.customStyle, className = _a2.className, tabDirection = _a2.tabDirection, index = _a2.index, current = _a2.current;
- return import_react.default.createElement(View, {
- className: classnames({
- "at-tabs-pane": true,
- "at-tabs-pane--vertical": tabDirection === "vertical",
- "at-tabs-pane--active": index === current,
- "at-tabs-pane--inactive": index !== current
- }, className),
- style: customStyle
- }, this.props.children);
- };
- return AtTabsPane2;
- }(import_react.default.Component);
- AtTabsPane.defaultProps = {
- customStyle: "",
- className: "",
- tabDirection: "horizontal",
- index: 0,
- current: 0
- };
- AtTabsPane.propTypes = {
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ]),
- tabDirection: PropTypes.oneOf([
- "horizontal",
- "vertical"
- ]),
- index: PropTypes.number,
- current: PropTypes.number
- };
- var SIZE_CLASS = {
- normal: "normal",
- small: "small"
- };
- var TYPE_CLASS = {
- primary: "primary"
- };
- var AtTag = function(_super) {
- __extends(AtTag2, _super);
- function AtTag2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtTag2.prototype.onClick = function(event) {
- var _a2 = this.props, _b = _a2.name, name = _b === void 0 ? "" : _b, _c = _a2.active, active = _c === void 0 ? false : _c, disabled = _a2.disabled, onClick = _a2.onClick;
- if (!disabled) {
- typeof onClick === "function" && onClick({
- name,
- active
- }, event);
- }
- };
- AtTag2.prototype.render = function() {
- var _a2;
- var _b = this.props, _c = _b.size, size = _c === void 0 ? "normal" : _c, _d = _b.type, type = _d === void 0 ? "" : _d, _e = _b.circle, circle = _e === void 0 ? false : _e, _f = _b.disabled, disabled = _f === void 0 ? false : _f, _g = _b.active, active = _g === void 0 ? false : _g, customStyle = _b.customStyle;
- var rootClassName = [
- "at-tag"
- ];
- var classObject = (_a2 = {}, _a2["at-tag--" + SIZE_CLASS[size]] = SIZE_CLASS[size], _a2["at-tag--" + type] = TYPE_CLASS[type], _a2["at-tag--disabled"] = disabled, _a2["at-tag--active"] = active, _a2["at-tag--circle"] = circle, _a2);
- return import_react.default.createElement(View, {
- className: classnames(rootClassName, classObject, this.props.className),
- style: customStyle,
- onClick: this.onClick.bind(this)
- }, this.props.children);
- };
- return AtTag2;
- }(import_react.default.Component);
- AtTag.defaultProps = {
- size: "normal",
- type: "",
- name: "",
- circle: false,
- active: false,
- disabled: false,
- customStyle: {}
- };
- AtTag.propTypes = {
- size: PropTypes.oneOf([
- "normal",
- "small"
- ]),
- type: PropTypes.oneOf([
- "",
- "primary"
- ]),
- name: PropTypes.string,
- circle: PropTypes.bool,
- active: PropTypes.bool,
- disabled: PropTypes.bool,
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- onClick: PropTypes.func
- };
- function getMaxLength(maxLength, textOverflowForbidden) {
- if (!textOverflowForbidden) {
- return maxLength + 500;
- }
- return maxLength;
- }
- var ENV$2 = import_taro.default.getEnv();
- var AtTextarea = function(_super) {
- __extends(AtTextarea2, _super);
- function AtTextarea2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.handleInput = function(event) {
- _this.props.onChange(event.detail.value, event);
- };
- _this.handleFocus = function(event) {
- _this.props.onFocus && _this.props.onFocus(event);
- };
- _this.handleBlur = function(event) {
- _this.props.onBlur && _this.props.onBlur(event);
- };
- _this.handleConfirm = function(event) {
- _this.props.onConfirm && _this.props.onConfirm(event);
- };
- _this.handleLinechange = function(event) {
- _this.props.onLinechange && _this.props.onLinechange(event);
- };
- return _this;
- }
- AtTextarea2.prototype.render = function() {
- var _a2 = this.props, customStyle = _a2.customStyle, className = _a2.className, value = _a2.value, cursorSpacing = _a2.cursorSpacing, placeholder = _a2.placeholder, placeholderStyle = _a2.placeholderStyle, placeholderClass = _a2.placeholderClass, _b = _a2.maxLength, maxLength = _b === void 0 ? 200 : _b, count = _a2.count, disabled = _a2.disabled, autoFocus = _a2.autoFocus, focus = _a2.focus, showConfirmBar = _a2.showConfirmBar, selectionStart = _a2.selectionStart, selectionEnd = _a2.selectionEnd, fixed = _a2.fixed, _c = _a2.textOverflowForbidden, textOverflowForbidden = _c === void 0 ? true : _c, height = _a2.height;
- var _maxLength = parseInt(maxLength.toString());
- var actualMaxLength = getMaxLength(_maxLength, textOverflowForbidden);
- var textareaStyle = height ? "height:" + pxTransform(Number(height)) : "";
- var rootCls = classnames("at-textarea", "at-textarea--" + ENV$2, {
- "at-textarea--error": _maxLength < value.length
- }, className);
- var placeholderCls = classnames("placeholder", placeholderClass);
- return import_react.default.createElement(View, {
- className: rootCls,
- style: customStyle
- }, import_react.default.createElement(Textarea, {
- className: "at-textarea__textarea",
- style: textareaStyle,
- placeholderStyle,
- placeholderClass: placeholderCls,
- cursorSpacing,
- value,
- maxlength: actualMaxLength,
- placeholder,
- disabled,
- autoFocus,
- focus,
- showConfirmBar,
- selectionStart,
- selectionEnd,
- fixed,
- onInput: this.handleInput,
- onFocus: this.handleFocus,
- onBlur: this.handleBlur,
- onConfirm: this.handleConfirm,
- onLineChange: this.handleLinechange
- }), count && import_react.default.createElement(View, {
- className: "at-textarea__counter"
- }, value.length, "/", _maxLength));
- };
- return AtTextarea2;
- }(import_react.default.Component);
- AtTextarea.defaultProps = {
- customStyle: "",
- className: "",
- value: "",
- cursorSpacing: 100,
- maxLength: 200,
- placeholder: "",
- disabled: false,
- autoFocus: false,
- focus: false,
- showConfirmBar: false,
- selectionStart: -1,
- selectionEnd: -1,
- count: true,
- fixed: false,
- height: "",
- textOverflowForbidden: true,
- onChange: function() {}
- };
- AtTextarea.propTypes = {
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ]),
- value: PropTypes.string.isRequired,
- cursorSpacing: PropTypes.number,
- maxLength: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.number
- ]),
- placeholderClass: PropTypes.string,
- placeholderStyle: PropTypes.string,
- placeholder: PropTypes.string,
- disabled: PropTypes.bool,
- autoFocus: PropTypes.bool,
- focus: PropTypes.bool,
- showConfirmBar: PropTypes.bool,
- selectionStart: PropTypes.number,
- selectionEnd: PropTypes.number,
- count: PropTypes.bool,
- textOverflowForbidden: PropTypes.bool,
- fixed: PropTypes.bool,
- height: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.number
- ]),
- onLinechange: PropTypes.func,
- onChange: PropTypes.func.isRequired,
- onFocus: PropTypes.func,
- onBlur: PropTypes.func,
- onConfirm: PropTypes.func
- };
- var AtTimeline = function(_super) {
- __extends(AtTimeline2, _super);
- function AtTimeline2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtTimeline2.prototype.render = function() {
- var _a2 = this.props, pending = _a2.pending, items = _a2.items, customStyle = _a2.customStyle;
- var rootClassName = [
- "at-timeline"
- ];
- if (pending) rootClassName.push("at-timeline--pending");
- var rootClassObject = {
- "at-timeline--pending": pending
- };
- var itemElems = items.map(function(item, index) {
- var _a3;
- var _b = item.title, title = _b === void 0 ? "" : _b, color = item.color, icon = item.icon, _c = item.content, content = _c === void 0 ? [] : _c;
- var iconClass = classnames((_a3 = {
- "at-icon": true
- }, _a3["at-icon-" + icon] = icon, _a3));
- var itemRootClassName = [
- "at-timeline-item"
- ];
- if (color) itemRootClassName.push("at-timeline-item--" + color);
- var dotClass = [];
- if (icon) {
- dotClass.push("at-timeline-item__icon");
- } else {
- dotClass.push("at-timeline-item__dot");
- }
- return import_react.default.createElement(View, {
- className: classnames(itemRootClassName),
- key: "at-timeline-item-" + index
- }, import_react.default.createElement(View, {
- className: "at-timeline-item__tail"
- }), import_react.default.createElement(View, {
- className: classnames(dotClass)
- }, icon && import_react.default.createElement(Text, {
- className: iconClass
- })), import_react.default.createElement(View, {
- className: "at-timeline-item__content"
- }, import_react.default.createElement(View, {
- className: "at-timeline-item__content-item"
- }, title), content.map(function(sub, subIndex) {
- return import_react.default.createElement(View, {
- className: "at-timeline-item__content-item at-timeline-item__content--sub",
- key: subIndex
- }, sub);
- })));
- });
- return import_react.default.createElement(View, {
- className: classnames(rootClassName, rootClassObject, this.props.className),
- style: customStyle
- }, itemElems);
- };
- return AtTimeline2;
- }(import_react.default.Component);
- AtTimeline.defaultProps = {
- pending: false,
- items: [],
- customStyle: {}
- };
- AtTimeline.propTypes = {
- pending: PropTypes.bool,
- items: PropTypes.arrayOf(PropTypes.object),
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ])
- };
- var error = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAAGwtJREFUeAHtnUusndV1x7mAIYABG/MUYGzLBCUtFHcCtB3YZgISGaCodOQ4QGGSoJAgV5FiOTAALBowY6tFASoUmYyS0EoRYPEonUUKRETYKNhWEnCwFZvWEIzB/f3v/T773HPP2Wt/79da0v/uc85+rfVfa93vsff5zswpLpUwcPz48aUMvAKsTMpLKC8Ey0bKc3h9JjhjpOTlKUfBpyPlEV4fBAdGy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PWrIA95jE50jf7IvmFatSrbIhtlax4i7uUDu6OhrpGCc/TV06tAmmvzNBsqo2zVRNjnwQfqartPL+ke2SBbRkFeIq71z8S+auxzQl3KcdZ+YDlIel8XTbzyEDWuA2eCmXWxeVAP6RbpKF3TzlnQNFbErThu7SPRrb+ygPP2IXAuAsvBnMEgyuH3GH08Ah6OlrvWR0ZGtubQv7cLbNSJ8NED+FD0uwgfP03f/wrWYOOfWbZWiiCvlmQRRHo7im6lvhyU9dXdzYylhBEeBy+DLUDbtXwN7IjwJktBoqtpgiY1hfcDJYH2VloeBHRu1EuKsvZijzHmt8E6EuMtlq2XziRIz5Mkik4gPwHOBacD7WFM4hnQHuIX4HpwM4nxdnzV9pV0LkH6XUiy7M9vfVhUyfIx0Gk+sL8nOmy8Cygp/pOkeLVX0LWlBUTkcZJlLqs6BBNae2k3MjduocPAdeAGkuKJuEpd2m4JMsTbJMt8Np8NTgF6OURbedKe4gFwG1hPUmxkadLHQFsd32ditlWSRSfEC8GiCGWd4GdTPL61TrSVEMLtJIUuHJjEMGAJEkNM3GYSZjZl/QkzJ65uTbbrkmx/QjxbE70aoYYlSEY3RXuY4+imh2NZ1znM9IxdJ22+jQY6h7gf3NeD7SFgIoNYgmQgz9WUxNFtF4eBudHyEJaawxB68xmage6f89C6RPMhmh/pzY38H+v98ydafxE8CUa1JBFeYWmSMwP/D9ulVgFLdbgRAAAAAElFTkSuQmCC";
- var loading = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAMAAACahl6sAAAAn1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8Kd3m4AAAANHRSTlMA6AN+QRH69xUI7Z7x2sWzcWYvphvj4MxiXVIiGAuH08K9ibepmI+Oc2tKHQ+helY5NykfkF5N9AAABmhJREFUeNrdnWlT4kAQhjt3CARIwg1yH3Lpqv3/f9tabsYJMUGCsM6b56NVVjGV6WP6pLvTijTb8bS2X29U581BaBEm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loading
- };
- var AtToast = function(_super) {
- __extends(AtToast2, _super);
- function AtToast2(props) {
- var _this = _super.call(this, props) || this;
- _this.handleClick = function(event) {
- var _a2 = _this.props, onClick = _a2.onClick, status = _a2.status;
- if (status === "loading") {
- return;
- }
- if (onClick) {
- return onClick(event);
- }
- _this.close();
- };
- var isOpened = props.isOpened, duration = props.duration;
- if (isOpened) {
- _this.makeTimer(duration || 0);
- }
- _this._timer = null;
- _this.state = {
- _isOpened: isOpened
- };
- return _this;
- }
- AtToast2.prototype.clearTimmer = function() {
- if (this._timer) {
- clearTimeout(this._timer);
- this._timer = null;
- }
- };
- AtToast2.prototype.makeTimer = function(duration) {
- var _this = this;
- if (duration === 0) {
- return;
- }
- this._timer = setTimeout(function() {
- _this.close();
- }, +duration);
- };
- AtToast2.prototype.close = function() {
- var _isOpened = this.state._isOpened;
- if (_isOpened) {
- this.setState({
- _isOpened: false
- }, this.handleClose);
- this.clearTimmer();
- }
- };
- AtToast2.prototype.handleClose = function(event) {
- if (typeof this.props.onClose === "function") {
- this.props.onClose(event);
- }
- };
- AtToast2.prototype.UNSAFE_componentWillReceiveProps = function(nextProps) {
- var isOpened = nextProps.isOpened, duration = nextProps.duration;
- if (!isOpened) {
- this.close();
- return;
- }
- if (!this.state._isOpened) {
- this.setState({
- _isOpened: true
- });
- } else {
- this.clearTimmer();
- }
- this.makeTimer(duration || 0);
- };
- AtToast2.prototype.render = function() {
- var _a2, _b;
- var _isOpened = this.state._isOpened;
- var _c = this.props, customStyle = _c.customStyle, text = _c.text, icon = _c.icon, status = _c.status, image = _c.image, hasMask = _c.hasMask;
- var realImg = image || statusImg[status] || null;
- var isRenderIcon = !!(icon && !(image || statusImg[status]));
- var bodyClass = classnames("toast-body", (_a2 = {
- "at-toast__body--custom-image": image,
- "toast-body--text": !realImg && !icon
- }, _a2["at-toast__body--" + status] = !!status, _a2));
- var iconClass = classnames("at-icon", (_b = {}, _b["at-icon-" + icon] = icon, _b));
- return _isOpened ? import_react.default.createElement(View, {
- className: classnames("at-toast", this.props.className)
- }, hasMask && import_react.default.createElement(View, {
- className: "at-toast__overlay"
- }), import_react.default.createElement(View, {
- className: bodyClass,
- style: customStyle,
- onClick: this.handleClick
- }, import_react.default.createElement(View, {
- className: "toast-body-content"
- }, realImg ? import_react.default.createElement(View, {
- className: "toast-body-content__img"
- }, import_react.default.createElement(Image, {
- className: "toast-body-content__img-item",
- src: realImg,
- mode: "scaleToFill"
- })) : null, isRenderIcon && import_react.default.createElement(View, {
- className: "toast-body-content__icon"
- }, import_react.default.createElement(Text, {
- className: iconClass
- })), text && import_react.default.createElement(View, {
- className: "toast-body-content__info"
- }, import_react.default.createElement(Text, null, text))))) : null;
- };
- return AtToast2;
- }(import_react.default.Component);
- AtToast.defaultProps = {
- duration: 3e3,
- isOpened: false
- };
- AtToast.propTypes = {
- text: PropTypes.string,
- icon: PropTypes.string,
- hasMask: PropTypes.bool,
- image: PropTypes.string,
- isOpened: PropTypes.bool,
- duration: PropTypes.number,
- status: PropTypes.oneOf([
- "",
- "error",
- "loading",
- "success"
- ]),
- onClick: PropTypes.func,
- onClose: PropTypes.func
- };
- var AtAccordion = function(_super) {
- __extends(AtAccordion2, _super);
- function AtAccordion2(props) {
- var _this = _super.call(this, props) || this;
- _this.handleClick = function(event) {
- var open = _this.props.open;
- if (!_this.isCompleted) return;
- _this.props.onClick && _this.props.onClick(!open, event);
- };
- _this.isCompleted = true;
- _this.startOpen = false;
- _this.state = {
- wrapperHeight: 0
- };
- return _this;
- }
- AtAccordion2.prototype.toggleWithAnimation = function() {
- var _this = this;
- var _a2 = this.props, open = _a2.open, isAnimation = _a2.isAnimation;
- if (!this.isCompleted || !isAnimation) return;
- this.isCompleted = false;
- delayQuerySelector(".at-accordion__body", 0).then(function(rect) {
- var height = parseInt(rect[0].height.toString());
- var startHeight = open ? height : 0;
- var endHeight = open ? 0 : height;
- _this.startOpen = false;
- _this.setState({
- wrapperHeight: startHeight
- }, function() {
- setTimeout(function() {
- _this.setState({
- wrapperHeight: endHeight
- }, function() {
- setTimeout(function() {
- _this.isCompleted = true;
- _this.setState({});
- }, 700);
- });
- }, 100);
- });
- });
- };
- AtAccordion2.prototype.UNSAFE_componentWillReceiveProps = function(nextProps) {
- if (nextProps.open !== this.props.open) {
- this.startOpen = !!nextProps.open && !!nextProps.isAnimation;
- this.toggleWithAnimation();
- }
- };
- AtAccordion2.prototype.render = function() {
- var _a2;
- var _b = this.props, customStyle = _b.customStyle, className = _b.className, title = _b.title, icon = _b.icon, hasBorder = _b.hasBorder, open = _b.open, note = _b.note;
- var wrapperHeight = this.state.wrapperHeight;
- var rootCls = classnames("at-accordion", className);
- var prefixClass = icon && icon.prefixClass || "at-icon";
- var iconCls = classnames((_a2 = {}, _a2[prefixClass] = true, _a2[prefixClass + "-" + (icon && icon.value)] = icon && icon.value, _a2["at-accordion__icon"] = true, _a2));
- var headerCls = classnames("at-accordion__header", {
- "at-accordion__header--noborder": !hasBorder
- });
- var arrowCls = classnames("at-accordion__arrow", {
- "at-accordion__arrow--folded": !!open
- });
- var contentCls = classnames("at-accordion__content", {
- "at-accordion__content--inactive": !open && this.isCompleted || this.startOpen
- });
- var iconStyle = {
- color: icon && icon.color || "",
- fontSize: icon && icon.size + "px" || ""
- };
- var contentStyle = {
- height: wrapperHeight + "px"
- };
- if (this.isCompleted) {
- contentStyle.height = "";
- }
- return import_react.default.createElement(View, {
- className: rootCls,
- style: customStyle
- }, import_react.default.createElement(View, {
- className: headerCls,
- onClick: this.handleClick
- }, icon && icon.value && import_react.default.createElement(Text, {
- className: iconCls,
- style: iconStyle
- }), import_react.default.createElement(View, {
- className: "at-accordion__info"
- }, import_react.default.createElement(View, {
- className: "at-accordion__info__title"
- }, title), import_react.default.createElement(View, {
- className: "at-accordion__info__note"
- }, note)), import_react.default.createElement(View, {
- className: arrowCls
- }, import_react.default.createElement(Text, {
- className: "at-icon at-icon-chevron-down"
- }))), import_react.default.createElement(View, {
- style: contentStyle,
- className: contentCls
- }, import_react.default.createElement(View, {
- className: "at-accordion__body"
- }, this.props.children)));
- };
- return AtAccordion2;
- }(import_react.default.Component);
- AtAccordion.defaultProps = {
- open: false,
- customStyle: "",
- className: "",
- title: "",
- note: "",
- icon: {
- value: ""
- },
- hasBorder: true,
- isAnimation: true
- };
- AtAccordion.propTypes = {
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ]),
- open: PropTypes.bool,
- isAnimation: PropTypes.bool,
- title: PropTypes.string,
- note: PropTypes.string,
- icon: PropTypes.object,
- hasBorder: PropTypes.bool,
- onClick: PropTypes.func
- };
- var AtSlider = function(_super) {
- __extends(AtSlider2, _super);
- function AtSlider2(props) {
- var _this = _super.call(this, props) || this;
- var _a2 = props.value, value = _a2 === void 0 ? 0 : _a2, _b = props.min, min = _b === void 0 ? 0 : _b, _c = props.max, max = _c === void 0 ? 100 : _c;
- _this.state = {
- _value: AtSlider2.clampNumber(value, min, max)
- };
- return _this;
- }
- AtSlider2.clampNumber = function(value, lower, upper) {
- return Math.max(lower, Math.min(upper, value));
- };
- AtSlider2.prototype.handleChanging = function(e2) {
- var _value = this.state._value;
- var value = e2.detail.value;
- if (value !== _value) {
- this.setState({
- _value: value
- });
- }
- this.props.onChanging && this.props.onChanging(value);
- };
- AtSlider2.prototype.handleChange = function(e2) {
- var value = e2.detail.value;
- this.setState({
- _value: value
- });
- this.props.onChange && this.props.onChange(value);
- };
- AtSlider2.prototype.UNSAFE_componentWillReceiveProps = function(props) {
- var _a2 = props.value, value = _a2 === void 0 ? 0 : _a2, _b = props.min, min = _b === void 0 ? 0 : _b, _c = props.max, max = _c === void 0 ? 100 : _c;
- this.setState({
- _value: AtSlider2.clampNumber(value, min, max)
- });
- };
- AtSlider2.prototype.render = function() {
- var _value = this.state._value;
- var _a2 = this.props, customStyle = _a2.customStyle, className = _a2.className, min = _a2.min, max = _a2.max, step = _a2.step, disabled = _a2.disabled, activeColor = _a2.activeColor, backgroundColor = _a2.backgroundColor, blockSize = _a2.blockSize, blockColor = _a2.blockColor, showValue = _a2.showValue;
- return import_react.default.createElement(View, {
- className: classnames({
- "at-slider": true,
- "at-slider--disabled": disabled
- }, className),
- style: customStyle
- }, import_react.default.createElement(View, {
- className: "at-slider__inner"
- }, import_react.default.createElement(Slider, {
- min,
- max,
- step,
- value: _value,
- disabled,
- activeColor,
- backgroundColor,
- blockSize,
- blockColor,
- onChanging: this.handleChanging.bind(this),
- onChange: this.handleChange.bind(this)
- })), showValue && import_react.default.createElement(View, {
- className: "at-slider__text"
- }, "" + _value));
- };
- return AtSlider2;
- }(import_react.default.Component);
- AtSlider.defaultProps = {
- customStyle: "",
- className: "",
- min: 0,
- max: 100,
- step: 1,
- value: 0,
- disabled: false,
- activeColor: "#6190e8",
- backgroundColor: "#e9e9e9",
- blockSize: 28,
- blockColor: "#ffffff",
- showValue: false
- };
- AtSlider.propTypes = {
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ]),
- min: PropTypes.number,
- max: PropTypes.number,
- step: PropTypes.number,
- value: PropTypes.number,
- disabled: PropTypes.bool,
- activeColor: PropTypes.string,
- backgroundColor: PropTypes.string,
- blockSize: PropTypes.number,
- blockColor: PropTypes.string,
- showValue: PropTypes.bool,
- onChange: PropTypes.func,
- onChanging: PropTypes.func
- };
- var AtSwipeActionOptions = function(_super) {
- __extends(AtSwipeActionOptions2, _super);
- function AtSwipeActionOptions2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtSwipeActionOptions2.prototype.render = function() {
- var rootClass = classnames("at-swipe-action__options", this.props.className);
- return import_react.default.createElement(View, {
- id: "swipeActionOptions-" + this.props.componentId,
- className: rootClass,
- style: this.props.customStyle
- }, this.props.children);
- };
- return AtSwipeActionOptions2;
- }(import_react.default.Component);
- var AtSwipeAction = function(_super) {
- __extends(AtSwipeAction2, _super);
- function AtSwipeAction2(props) {
- var _this = _super.call(this, props) || this;
- _this.handleOpened = function(event) {
- var onOpened = _this.props.onOpened;
- if (typeof onOpened === "function") {
- onOpened(event);
- }
- };
- _this.handleClosed = function(event) {
- var onClosed = _this.props.onClosed;
- if (typeof onClosed === "function") {
- onClosed(event);
- }
- };
- _this.handleClick = function(item, index, event) {
- var _a2 = _this.props, onClick = _a2.onClick, autoClose = _a2.autoClose;
- if (typeof onClick === "function") {
- onClick(item, index, event);
- }
- if (autoClose) {
- _this._reset(false);
- _this.handleClosed(event);
- }
- };
- _this.onTouchEnd = function(e2) {
- var maxOffsetSize = _this.state.maxOffsetSize;
- if (_this.moveX === -maxOffsetSize) {
- _this._reset(true);
- _this.handleOpened(e2);
- return;
- }
- if (_this.moveX === 0) {
- _this._reset(false);
- _this.handleClosed(e2);
- return;
- }
- if (_this.state._isOpened && _this.moveX < 0) {
- _this._reset(false);
- _this.handleClosed(e2);
- return;
- }
- if (Math.abs(_this.moveX) < maxOffsetSize * _this.moveRatio) {
- _this._reset(false);
- _this.handleClosed(e2);
- } else {
- _this._reset(true);
- _this.handleOpened(e2);
- }
- };
- _this.onChange = function(e2) {
- _this.moveX = e2.detail.x;
- };
- var isOpened = props.isOpened, moveRatio = props.moveRatio;
- _this.state = {
- componentId: uuid(),
- offsetSize: 0,
- _isOpened: !!isOpened,
- needAnimation: false,
- eleWidth: 0,
- maxOffsetSize: 0
- };
- _this.moveX = _this.state.offsetSize;
- _this.moveRatio = moveRatio || 0.5;
- return _this;
- }
- AtSwipeAction2.prototype.componentDidMount = function() {
- this.getAreaWidth();
- };
- AtSwipeAction2.prototype.componentDidUpdate = function(_, prevState) {
- var eleWidth = this.state.eleWidth;
- if (prevState.eleWidth !== eleWidth) {
- this.getMaxOffsetSize();
- }
- };
- AtSwipeAction2.prototype.UNSAFE_componentWillReceiveProps = function(nextProps) {
- var isOpened = nextProps.isOpened;
- var _a2 = this.state, _isOpened = _a2._isOpened, maxOffsetSize = _a2.maxOffsetSize;
- if (isOpened !== _isOpened) {
- this.moveX = isOpened ? 0 : maxOffsetSize;
- this._reset(!!isOpened);
- }
- };
- AtSwipeAction2.prototype.getAreaWidth = function() {
- return __awaiter(this, void 0, void 0, function() {
- var systemInfo;
- return __generator(this, function(_a2) {
- switch(_a2.label){
- case 0:
- return [
- 4,
- import_taro.default.getSystemInfo()
- ];
- case 1:
- systemInfo = _a2.sent();
- this.setState({
- eleWidth: systemInfo.windowWidth
- });
- return [
- 2
- ];
- }
- });
- });
- };
- AtSwipeAction2.prototype.getMaxOffsetSize = function() {
- return __awaiter(this, void 0, void 0, function() {
- var componentId, actionOptionsRect, maxOffsetSize;
- return __generator(this, function(_a2) {
- switch(_a2.label){
- case 0:
- componentId = this.state.componentId;
- return [
- 4,
- delayGetClientRect({
- selectorStr: "#swipeActionOptions-" + componentId
- })
- ];
- case 1:
- actionOptionsRect = _a2.sent();
- maxOffsetSize = actionOptionsRect[0].width;
- this.setState({
- maxOffsetSize
- });
- return [
- 2
- ];
- }
- });
- });
- };
- AtSwipeAction2.prototype._reset = function(isOpened) {
- var _this = this;
- if (isOpened) {
- var maxOffsetSize = this.state.maxOffsetSize;
- if (false) {} else {
- this.setState({
- _isOpened: true,
- offsetSize: -maxOffsetSize
- });
- }
- } else {
- this.setState({
- offsetSize: this.moveX
- }, function() {
- _this.setState({
- offsetSize: 0,
- _isOpened: false
- });
- });
- }
- };
- AtSwipeAction2.prototype.render = function() {
- var _this = this;
- var _a2 = this.state, componentId = _a2.componentId, maxOffsetSize = _a2.maxOffsetSize, eleWidth = _a2.eleWidth, offsetSize = _a2.offsetSize;
- var _b = this.props, options = _b.options, disabled = _b.disabled;
- var rootClass = classnames("at-swipe-action", this.props.className);
- return import_react.default.createElement(View, {
- id: "swipeAction-" + componentId,
- className: rootClass,
- style: {
- width: eleWidth + "px"
- }
- }, import_react.default.createElement(MovableArea, {
- className: "at-swipe-action__area",
- style: {
- width: eleWidth + "px"
- }
- }, import_react.default.createElement(MovableView, {
- className: "at-swipe-action__content",
- direction: "horizontal",
- damping: 50,
- x: offsetSize,
- onTouchEnd: this.onTouchEnd,
- onChange: this.onChange,
- disabled,
- style: {
- width: eleWidth + maxOffsetSize + "px"
- }
- }, this.props.children, Array.isArray(options) && options.length > 0 ? import_react.default.createElement(AtSwipeActionOptions, {
- options,
- componentId,
- customStyle: {
- opacity: maxOffsetSize ? 1 : 0
- }
- }, options.map(function(item, key) {
- return import_react.default.createElement(View, {
- key: item.text + "-" + key,
- style: item.style,
- onClick: function(e2) {
- return _this.handleClick(item, key, e2);
- },
- className: classnames("at-swipe-action__option", item.className)
- }, import_react.default.createElement(Text, {
- className: "option__text"
- }, item.text));
- })) : null)));
- };
- return AtSwipeAction2;
- }(import_react.default.Component);
- AtSwipeAction.defaultProps = {
- options: [],
- isOpened: false,
- disabled: false,
- autoClose: false,
- maxDistance: 0,
- areaWidth: 0
- };
- AtSwipeAction.propTypes = {
- isOpened: PropTypes.bool,
- disabled: PropTypes.bool,
- autoClose: PropTypes.bool,
- options: PropTypes.arrayOf(PropTypes.shape({
- text: PropTypes.string,
- style: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string,
- PropTypes.array
- ])
- })),
- onClick: PropTypes.func,
- onOpened: PropTypes.func,
- onClosed: PropTypes.func
- };
- var AtSearchBar = function(_super) {
- __extends(AtSearchBar2, _super);
- function AtSearchBar2(props) {
- var _this = _super.call(this, props) || this;
- _this.handleFocus = function(event) {
- _this.setState({
- isFocus: true
- });
- _this.props.onFocus && _this.props.onFocus(event);
- };
- _this.handleBlur = function(event) {
- _this.setState({
- isFocus: false
- });
- _this.props.onBlur && _this.props.onBlur(event);
- };
- _this.handleChange = function(e2) {
- _this.props.onChange(e2.detail.value, e2);
- };
- _this.handleClear = function(event) {
- if (_this.props.onClear) {
- _this.props.onClear(event);
- } else {
- _this.props.onChange("", event);
- }
- };
- _this.handleConfirm = function(event) {
- _this.props.onConfirm && _this.props.onConfirm(event);
- };
- _this.handleActionClick = function(event) {
- _this.props.onActionClick && _this.props.onActionClick(event);
- };
- _this.state = {
- isFocus: !!props.focus
- };
- return _this;
- }
- AtSearchBar2.prototype.UNSAFE_componentWillReceiveProps = function(nextProps) {
- if (nextProps.focus !== this.props.focus) {
- this.setState({
- isFocus: !!nextProps.focus
- });
- }
- };
- AtSearchBar2.prototype.render = function() {
- var _a2 = this.props, value = _a2.value, placeholder = _a2.placeholder, maxLength = _a2.maxLength, fixed = _a2.fixed, disabled = _a2.disabled, showActionButton = _a2.showActionButton, _b = _a2.actionName, actionName = _b === void 0 ? "\u641C\u7D22" : _b, inputType = _a2.inputType, className = _a2.className, customStyle = _a2.customStyle, enableNative = _a2.enableNative;
- var isFocus = this.state.isFocus;
- var fontSize = 14;
- var rootCls = classnames("at-search-bar", {
- "at-search-bar--fixed": fixed
- }, className);
- var placeholderWrapStyle = {};
- var actionStyle = {};
- if (isFocus || !isFocus && value) {
- actionStyle.opacity = 1;
- actionStyle.marginRight = "0";
- placeholderWrapStyle.flexGrow = 0;
- } else if (!isFocus && !value) {
- placeholderWrapStyle.flexGrow = 1;
- actionStyle.opacity = 0;
- actionStyle.marginRight = "-" + ((actionName.length + 1) * fontSize + fontSize / 2 + 10) + "px";
- }
- if (showActionButton) {
- actionStyle.opacity = 1;
- actionStyle.marginRight = "0";
- }
- var clearIconStyle = {
- display: "flex"
- };
- var placeholderStyle = {
- visibility: "hidden"
- };
- if (!value.length) {
- clearIconStyle.display = "none";
- placeholderStyle.visibility = "visible";
- }
- return import_react.default.createElement(View, {
- className: rootCls,
- style: customStyle
- }, import_react.default.createElement(View, {
- className: "at-search-bar__input-cnt"
- }, import_react.default.createElement(View, {
- className: "at-search-bar__placeholder-wrap",
- style: placeholderWrapStyle
- }, import_react.default.createElement(Text, {
- className: "at-icon at-icon-search"
- }), import_react.default.createElement(Text, {
- className: "at-search-bar__placeholder",
- style: placeholderStyle
- }, isFocus ? "" : placeholder)), import_react.default.createElement(Input, {
- className: "at-search-bar__input",
- type: inputType,
- confirmType: "search",
- value,
- focus: isFocus,
- disabled,
- maxlength: maxLength,
- enableNative,
- onInput: this.handleChange,
- onFocus: this.handleFocus,
- onBlur: this.handleBlur,
- onConfirm: this.handleConfirm
- }), import_react.default.createElement(View, {
- className: "at-search-bar__clear",
- style: clearIconStyle,
- onTouchStart: this.handleClear
- }, import_react.default.createElement(Text, {
- className: "at-icon at-icon-close-circle"
- }))), import_react.default.createElement(View, {
- className: "at-search-bar__action",
- style: actionStyle,
- onClick: this.handleActionClick
- }, actionName));
- };
- return AtSearchBar2;
- }(import_react.default.Component);
- AtSearchBar.defaultProps = {
- value: "",
- placeholder: "\u641C\u7D22",
- maxLength: 140,
- fixed: false,
- focus: false,
- disabled: false,
- showActionButton: false,
- actionName: "\u641C\u7D22",
- inputType: "text",
- onChange: function() {},
- enableNative: true
- };
- AtSearchBar.propTypes = {
- value: PropTypes.string,
- placeholder: PropTypes.string,
- maxLength: PropTypes.number,
- fixed: PropTypes.bool,
- focus: PropTypes.bool,
- disabled: PropTypes.bool,
- showActionButton: PropTypes.bool,
- actionName: PropTypes.string,
- inputType: PropTypes.oneOf([
- "text",
- "number",
- "idcard",
- "digit"
- ]),
- onChange: PropTypes.func,
- onFocus: PropTypes.func,
- onBlur: PropTypes.func,
- onConfirm: PropTypes.func,
- onActionClick: PropTypes.func,
- onClear: PropTypes.func,
- enableNative: PropTypes.bool
- };
- var AtLoadMore = function(_super) {
- __extends(AtLoadMore2, _super);
- function AtLoadMore2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtLoadMore2.prototype.onClick = function() {
- this.props.onClick && this.props.onClick(arguments);
- };
- AtLoadMore2.prototype.render = function() {
- var _a2 = this.props, className = _a2.className, customStyle = _a2.customStyle, loadingText = _a2.loadingText, moreText = _a2.moreText, status = _a2.status, moreBtnStyle = _a2.moreBtnStyle, noMoreTextStyle = _a2.noMoreTextStyle, noMoreText = _a2.noMoreText;
- var component = null;
- if (status === "loading") {
- component = import_react.default.createElement(AtActivityIndicator, {
- mode: "center",
- content: loadingText
- });
- } else if (status === "more") {
- component = import_react.default.createElement(View, {
- className: "at-load-more__cnt"
- }, import_react.default.createElement(AtButton, {
- full: true,
- onClick: this.onClick.bind(this),
- customStyle: moreBtnStyle
- }, moreText));
- } else {
- component = import_react.default.createElement(Text, {
- className: "at-load-more__tip",
- style: noMoreTextStyle
- }, noMoreText);
- }
- return import_react.default.createElement(View, {
- className: classnames("at-load-more", className),
- style: customStyle
- }, component);
- };
- return AtLoadMore2;
- }(import_react.default.Component);
- AtLoadMore.defaultProps = {
- customStyle: "",
- className: "",
- noMoreTextStyle: "",
- moreBtnStyle: "",
- status: "more",
- loadingText: "\u52A0\u8F7D\u4E2D",
- moreText: "\u67E5\u770B\u66F4\u591A",
- noMoreText: "\u6CA1\u6709\u66F4\u591A"
- };
- AtLoadMore.propTypes = {
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ]),
- noMoreTextStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- moreBtnStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- status: PropTypes.oneOf([
- "more",
- "loading",
- "noMore"
- ]),
- loadingText: PropTypes.string,
- moreText: PropTypes.string,
- noMoreText: PropTypes.string,
- onClick: PropTypes.func
- };
- var AtDivider = function(_super) {
- __extends(AtDivider2, _super);
- function AtDivider2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtDivider2.prototype.render = function() {
- var _a2 = this.props, className = _a2.className, customStyle = _a2.customStyle, content = _a2.content, height = _a2.height, fontColor = _a2.fontColor, fontSize = _a2.fontSize, lineColor = _a2.lineColor;
- var rootStyle = {
- height: height ? "" + pxTransform(Number(height)) : ""
- };
- var fontStyle = {
- color: fontColor,
- "fontSize": fontSize ? "" + pxTransform(Number(fontSize)) : ""
- };
- var lineStyle = {
- backgroundColor: lineColor
- };
- return import_react.default.createElement(View, {
- className: classnames("at-divider", className),
- style: mergeStyle(rootStyle, customStyle)
- }, import_react.default.createElement(View, {
- className: "at-divider__content",
- style: fontStyle
- }, content === "" ? this.props.children : content), import_react.default.createElement(View, {
- className: "at-divider__line",
- style: lineStyle
- }));
- };
- return AtDivider2;
- }(import_react.default.Component);
- AtDivider.defaultProps = {
- content: "",
- height: 0,
- fontColor: "",
- fontSize: 0,
- lineColor: ""
- };
- AtDivider.propTypes = {
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ]),
- content: PropTypes.string,
- height: PropTypes.oneOfType([
- PropTypes.number,
- PropTypes.string
- ]),
- fontColor: PropTypes.string,
- fontSize: PropTypes.oneOfType([
- PropTypes.number,
- PropTypes.string
- ]),
- lineColor: PropTypes.string
- };
- var AtCountdownItem = function(_super) {
- __extends(AtCountdownItem2, _super);
- function AtCountdownItem2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtCountdownItem2.prototype.formatNum = function(num) {
- return num <= 9 ? "0" + num : "" + num;
- };
- AtCountdownItem2.prototype.render = function() {
- var _a2 = this.props, num = _a2.num, separator = _a2.separator;
- return import_react.default.createElement(View, {
- className: "at-countdown__item"
- }, import_react.default.createElement(View, {
- className: "at-countdown__time-box"
- }, import_react.default.createElement(Text, {
- className: "at-countdown__time"
- }, this.formatNum(num))), import_react.default.createElement(Text, {
- className: "at-countdown__separator"
- }, separator));
- };
- return AtCountdownItem2;
- }(import_react.default.Component);
- AtCountdownItem.defaultProps = {
- num: 0,
- separator: ":"
- };
- AtCountdownItem.propTypes = {
- num: PropTypes.number.isRequired,
- separator: PropTypes.string
- };
- var toSeconds = function(day, hours, minutes, seconds) {
- return day * 60 * 60 * 24 + hours * 60 * 60 + minutes * 60 + seconds;
- };
- var AtCountdown = function(_super) {
- __extends(AtCountdown2, _super);
- function AtCountdown2(props) {
- var _this = _super.call(this, props) || this;
- var _a2 = _this.props, _b = _a2.day, day = _b === void 0 ? 0 : _b, _c = _a2.hours, hours = _c === void 0 ? 0 : _c, _d = _a2.minutes, minutes = _d === void 0 ? 0 : _d, _e = _a2.seconds, seconds = _e === void 0 ? 0 : _e;
- _this.seconds = toSeconds(day, hours, minutes, seconds);
- var _f = _this.calculateTime(), _day = _f.day, _hours = _f.hours, _minutes = _f.minutes, _seconds = _f.seconds;
- _this.state = {
- _day,
- _hours,
- _minutes,
- _seconds
- };
- return _this;
- }
- AtCountdown2.prototype.setTimer = function() {
- if (!this.timer) this.countdonwn();
- };
- AtCountdown2.prototype.clearTimer = function() {
- if (this.timer) {
- clearTimeout(this.timer);
- }
- };
- AtCountdown2.prototype.calculateTime = function() {
- var _a2 = __read([
- 0,
- 0,
- 0,
- 0
- ], 4), day = _a2[0], hours = _a2[1], minutes = _a2[2], seconds = _a2[3];
- if (this.seconds > 0) {
- day = this.props.isShowDay ? Math.floor(this.seconds / (60 * 60 * 24)) : 0;
- hours = Math.floor(this.seconds / (60 * 60)) - day * 24;
- minutes = Math.floor(this.seconds / 60) - day * 24 * 60 - hours * 60;
- seconds = Math.floor(this.seconds) - day * 24 * 60 * 60 - hours * 60 * 60 - minutes * 60;
- }
- return {
- day,
- hours,
- minutes,
- seconds
- };
- };
- AtCountdown2.prototype.countdonwn = function() {
- var _this = this;
- var _a2 = this.calculateTime(), day = _a2.day, hours = _a2.hours, minutes = _a2.minutes, seconds = _a2.seconds;
- this.setState({
- _day: day,
- _hours: hours,
- _minutes: minutes,
- _seconds: seconds
- });
- this.seconds--;
- if (this.seconds < 0) {
- this.clearTimer();
- this.props.onTimeUp && this.props.onTimeUp();
- return;
- }
- this.timer = setTimeout(function() {
- _this.countdonwn();
- }, 1e3);
- };
- AtCountdown2.prototype.UNSAFE_componentWillReceiveProps = function(nextProps) {
- if (JSON.stringify(this.props) === JSON.stringify(nextProps)) return;
- var day = nextProps.day, hours = nextProps.hours, minutes = nextProps.minutes, seconds = nextProps.seconds;
- this.seconds = toSeconds(day, hours, minutes, seconds);
- this.clearTimer();
- this.setTimer();
- };
- AtCountdown2.prototype.componentDidMount = function() {
- this.setTimer();
- };
- AtCountdown2.prototype.componentWillUnmount = function() {
- this.clearTimer();
- };
- AtCountdown2.prototype.componentDidHide = function() {
- this.clearTimer();
- };
- AtCountdown2.prototype.componentDidShow = function() {
- this.setTimer();
- };
- AtCountdown2.prototype.render = function() {
- var _a2 = this.props, className = _a2.className, customStyle = _a2.customStyle, format = _a2.format, isShowDay = _a2.isShowDay, isCard = _a2.isCard, isShowHour = _a2.isShowHour;
- var _b = this.state, _day = _b._day, _hours = _b._hours, _minutes = _b._minutes, _seconds = _b._seconds;
- return import_react.default.createElement(View, {
- className: classnames({
- "at-countdown": true,
- "at-countdown--card": isCard
- }, className),
- style: customStyle
- }, isShowDay && import_react.default.createElement(AtCountdownItem, {
- num: _day,
- separator: format.day
- }), isShowHour && import_react.default.createElement(AtCountdownItem, {
- num: _hours,
- separator: format.hours
- }), import_react.default.createElement(AtCountdownItem, {
- num: _minutes,
- separator: format.minutes
- }), import_react.default.createElement(AtCountdownItem, {
- num: _seconds,
- separator: format.seconds
- }));
- };
- return AtCountdown2;
- }(import_react.default.Component);
- AtCountdown.defaultProps = {
- customStyle: "",
- className: "",
- isCard: false,
- isShowDay: false,
- isShowHour: true,
- format: {
- day: "\u5929",
- hours: "\u65F6",
- minutes: "\u5206",
- seconds: "\u79D2"
- },
- day: 0,
- hours: 0,
- minutes: 0,
- seconds: 0
- };
- AtCountdown.propTypes = {
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ]),
- isCard: PropTypes.bool,
- isShowDay: PropTypes.bool,
- isShowHour: PropTypes.bool,
- format: PropTypes.object,
- day: PropTypes.number,
- hours: PropTypes.number,
- minutes: PropTypes.number,
- seconds: PropTypes.number,
- onTimeUp: PropTypes.func
- };
- var AtSteps = function(_super) {
- __extends(AtSteps2, _super);
- function AtSteps2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtSteps2.prototype.handleClick = function(current, event) {
- this.props.onChange(current, event);
- };
- AtSteps2.prototype.render = function() {
- var _this = this;
- var _a2 = this.props, customStyle = _a2.customStyle, className = _a2.className, items = _a2.items, current = _a2.current;
- return import_react.default.createElement(View, {
- className: classnames("at-steps", className),
- style: customStyle
- }, !!items && items.map(function(item, i) {
- var _a3;
- return import_react.default.createElement(View, {
- key: item.title,
- className: classnames({
- "at-steps__item": true,
- "at-steps__item--active": i === current,
- "at-steps__item--inactive": i !== current
- }),
- onClick: _this.handleClick.bind(_this, i)
- }, import_react.default.createElement(View, {
- className: "at-steps__circular-wrap"
- }, i !== 0 && import_react.default.createElement(View, {
- className: "at-steps__left-line"
- }), item.status ? import_react.default.createElement(View, {
- className: classnames({
- "at-icon": true,
- "at-icon-check-circle": item.status === "success",
- "at-icon-close-circle": item.status === "error",
- "at-steps__single-icon": true,
- "at-steps__single-icon--success": item.status === "success",
- "at-steps__single-icon--error": item.status === "error"
- })
- }) : import_react.default.createElement(View, {
- className: "at-steps__circular"
- }, item.icon ? import_react.default.createElement(Text, {
- className: classnames("at-icon", (_a3 = {}, _a3["at-icon-" + item.icon.value] = item.icon.value, _a3["at-steps__circle-icon"] = true, _a3))
- }) : import_react.default.createElement(Text, {
- className: "at-steps__num"
- }, i + 1)), i !== items.length - 1 && import_react.default.createElement(View, {
- className: "at-steps__right-line"
- })), import_react.default.createElement(View, {
- className: "at-steps__title"
- }, item.title), import_react.default.createElement(View, {
- className: "at-steps__desc"
- }, item.desc));
- }));
- };
- return AtSteps2;
- }(import_react.default.Component);
- AtSteps.defaultProps = {
- customStyle: "",
- className: "",
- current: 0,
- items: [],
- onChange: function() {}
- };
- AtSteps.propTypes = {
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ]),
- current: PropTypes.number,
- items: PropTypes.array,
- onChange: PropTypes.func
- };
- var AtCurtain = function(_super) {
- __extends(AtCurtain2, _super);
- function AtCurtain2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtCurtain2.prototype.onClose = function(e2) {
- e2.stopPropagation();
- this.props.onClose(e2);
- };
- AtCurtain2.prototype._stopPropagation = function(e2) {
- e2.stopPropagation();
- };
- AtCurtain2.prototype.render = function() {
- var _a2;
- var _b = this.props, className = _b.className, customStyle = _b.customStyle, isOpened = _b.isOpened, closeBtnPosition = _b.closeBtnPosition;
- var curtainClass = classnames({
- "at-curtain": true,
- "at-curtain--closed": !isOpened
- }, className);
- var btnCloseClass = classnames((_a2 = {
- "at-curtain__btn-close": true
- }, _a2["at-curtain__btn-close--" + closeBtnPosition] = closeBtnPosition, _a2));
- return import_react.default.createElement(View, {
- className: curtainClass,
- style: customStyle,
- onClick: this._stopPropagation
- }, import_react.default.createElement(View, {
- className: "at-curtain__container"
- }, import_react.default.createElement(View, {
- className: "at-curtain__body"
- }, this.props.children, import_react.default.createElement(View, {
- className: btnCloseClass,
- onClick: this.onClose.bind(this)
- }))));
- };
- return AtCurtain2;
- }(import_react.default.Component);
- AtCurtain.defaultProps = {
- customStyle: "",
- className: "",
- isOpened: false,
- closeBtnPosition: "bottom",
- onClose: function() {}
- };
- AtCurtain.propTypes = {
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ]),
- isOpened: PropTypes.bool,
- closeBtnPosition: PropTypes.string,
- onClose: PropTypes.func
- };
- var AtMessage = function(_super) {
- __extends(AtMessage2, _super);
- function AtMessage2(props) {
- var _this = _super.call(this, props) || this;
- _this.state = {
- _isOpened: false,
- _message: "",
- _type: "info",
- _duration: 3e3
- };
- _this._timer = null;
- return _this;
- }
- AtMessage2.prototype.bindMessageListener = function() {
- var _this = this;
- import_taro.default.eventCenter.on("atMessage", function(options) {
- if (options === void 0) {
- options = {};
- }
- var message = options.message, type = options.type, duration = options.duration;
- var newState = {
- _isOpened: true,
- _message: message,
- _type: type,
- _duration: duration || _this.state._duration
- };
- _this.setState(newState, function() {
- clearTimeout(_this._timer);
- _this._timer = setTimeout(function() {
- _this.setState({
- _isOpened: false
- });
- }, _this.state._duration);
- });
- });
- import_taro.default.atMessage = import_taro.default.eventCenter.trigger.bind(import_taro.default.eventCenter, "atMessage");
- };
- AtMessage2.prototype.componentDidShow = function() {
- this.bindMessageListener();
- };
- AtMessage2.prototype.componentDidMount = function() {
- this.bindMessageListener();
- };
- AtMessage2.prototype.componentDidHide = function() {
- import_taro.default.eventCenter.off("atMessage");
- };
- AtMessage2.prototype.componentWillUnmount = function() {
- import_taro.default.eventCenter.off("atMessage");
- };
- AtMessage2.prototype.render = function() {
- var _a2 = this.props, className = _a2.className, customStyle = _a2.customStyle;
- var _b = this.state, _message = _b._message, _isOpened = _b._isOpened, _type = _b._type;
- var rootCls = classnames({
- "at-message": true,
- "at-message--show": _isOpened,
- "at-message--hidden": !_isOpened
- }, "at-message--" + _type, className);
- return import_react.default.createElement(View, {
- className: rootCls,
- style: customStyle
- }, _message);
- };
- return AtMessage2;
- }(import_react.default.Component);
- AtMessage.defaultProps = {
- customStyle: "",
- className: ""
- };
- AtMessage.propTypes = {
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ])
- };
- var generateMatrix = function(files, col, showAddBtn) {
- var matrix = [];
- var length = showAddBtn ? files.length + 1 : files.length;
- var row = Math.ceil(length / col);
- for(var i = 0; i < row; i++){
- if (i === row - 1) {
- var lastArr = files.slice(i * col);
- if (lastArr.length < col) {
- if (showAddBtn) {
- lastArr.push({
- type: "btn",
- uuid: uuid()
- });
- }
- for(var j = lastArr.length; j < col; j++){
- lastArr.push({
- type: "blank",
- uuid: uuid()
- });
- }
- }
- matrix.push(lastArr);
- } else {
- matrix.push(files.slice(i * col, (i + 1) * col));
- }
- }
- return matrix;
- };
- var ENV$1 = import_taro.default.getEnv();
- var AtImagePicker = function(_super) {
- __extends(AtImagePicker2, _super);
- function AtImagePicker2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.chooseFile = function() {
- var _a2 = _this.props, _b = _a2.files, files = _b === void 0 ? [] : _b, multiple = _a2.multiple, count = _a2.count, sizeType = _a2.sizeType, sourceType = _a2.sourceType;
- var filePathName = ENV$1 === import_taro.default.ENV_TYPE.ALIPAY ? "apFilePaths" : "tempFiles";
- var params = {};
- if (multiple) {
- params.count = 99;
- }
- if (count) {
- params.count = count;
- }
- if (sizeType) {
- params.sizeType = sizeType;
- }
- if (sourceType) {
- params.sourceType = sourceType;
- }
- import_taro.default.chooseImage(params).then(function(res) {
- var targetFiles = res.tempFilePaths.map(function(path, i) {
- return {
- url: path,
- file: res[filePathName][i]
- };
- });
- var newFiles = files.concat(targetFiles);
- _this.props.onChange(newFiles, "add");
- }).catch(function(err) {
- var _a3, _b2;
- (_b2 = (_a3 = _this.props) === null || _a3 === void 0 ? void 0 : _a3.onFail) === null || _b2 === void 0 ? void 0 : _b2.call(_a3, err);
- });
- };
- _this.handleImageClick = function(idx) {
- _this.props.onImageClick && _this.props.onImageClick(idx, _this.props.files[idx]);
- };
- _this.handleRemoveImg = function(idx, event) {
- event.stopPropagation();
- event.preventDefault();
- var _a2 = _this.props.files, files = _a2 === void 0 ? [] : _a2;
- if (ENV$1 === import_taro.default.ENV_TYPE.WEB) {
- window.URL.revokeObjectURL(files[idx].url);
- }
- var newFiles = files.filter(function(_, i) {
- return i !== idx;
- });
- _this.props.onChange(newFiles, "remove", idx);
- };
- return _this;
- }
- AtImagePicker2.prototype.render = function() {
- var _this = this;
- var _a2 = this.props, className = _a2.className, customStyle = _a2.customStyle, files = _a2.files, mode = _a2.mode, _b = _a2.length, length = _b === void 0 ? 4 : _b, _c = _a2.showAddBtn, showAddBtn = _c === void 0 ? true : _c;
- var rowLength = length <= 0 ? 1 : length;
- var matrix = generateMatrix(files, rowLength, showAddBtn);
- var rootCls = classnames("at-image-picker", className);
- return import_react.default.createElement(View, {
- className: rootCls,
- style: customStyle
- }, matrix.map(function(row, i) {
- return import_react.default.createElement(View, {
- className: "at-image-picker__flex-box",
- key: i + 1
- }, row.map(function(item, j) {
- return item.url ? import_react.default.createElement(View, {
- className: "at-image-picker__flex-item",
- key: i * length + j
- }, import_react.default.createElement(View, {
- className: "at-image-picker__item"
- }, import_react.default.createElement(View, {
- className: "at-image-picker__remove-btn",
- onClick: _this.handleRemoveImg.bind(_this, i * length + j)
- }), import_react.default.createElement(Image, {
- className: "at-image-picker__preview-img",
- mode,
- src: item.url,
- onClick: _this.handleImageClick.bind(_this, i * length + j)
- }))) : import_react.default.createElement(View, {
- className: "at-image-picker__flex-item",
- key: "empty_" + i * length + j
- }, item.type === "btn" && import_react.default.createElement(View, {
- className: "at-image-picker__item at-image-picker__choose-btn",
- onClick: _this.chooseFile
- }, import_react.default.createElement(View, {
- className: "add-bar"
- }), import_react.default.createElement(View, {
- className: "add-bar"
- })));
- }));
- }));
- };
- return AtImagePicker2;
- }(import_react.default.Component);
- AtImagePicker.defaultProps = {
- className: "",
- customStyle: "",
- files: [],
- mode: "aspectFill",
- showAddBtn: true,
- multiple: false,
- length: 4,
- onChange: function() {}
- };
- AtImagePicker.propTypes = {
- className: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.array
- ]),
- customStyle: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.object
- ]),
- files: PropTypes.array,
- mode: PropTypes.oneOf([
- "scaleToFill",
- "aspectFit",
- "aspectFill",
- "widthFix",
- "top",
- "bottom",
- "center",
- "left",
- "right",
- "top left",
- "top right",
- "bottom left",
- "bottom right"
- ]),
- showAddBtn: PropTypes.bool,
- multiple: PropTypes.bool,
- length: PropTypes.number,
- onChange: PropTypes.func,
- onImageClick: PropTypes.func,
- onFail: PropTypes.func,
- count: PropTypes.number,
- sizeType: PropTypes.array,
- sourceType: PropTypes.array
- };
- var AtRange = function(_super) {
- __extends(AtRange2, _super);
- function AtRange2(props) {
- var _this = _super.call(this, props) || this;
- _this.handleClick = function(event) {
- if (_this.currentSlider && !_this.props.disabled) {
- var sliderValue = 0;
- var detail = getEventDetail(event);
- sliderValue = detail.x - _this.left;
- _this.setSliderValue(_this.currentSlider, sliderValue, "onChange");
- }
- };
- var _a2 = props.min, min = _a2 === void 0 ? 0 : _a2, _b = props.max, max = _b === void 0 ? 100 : _b;
- _this.width = 0;
- _this.left = 0;
- _this.deltaValue = max - min;
- _this.currentSlider = "";
- _this.state = {
- aX: 0,
- bX: 0
- };
- return _this;
- }
- AtRange2.prototype.handleTouchMove = function(sliderName, event) {
- if (this.props.disabled) return;
- event.stopPropagation();
- var clientX = event.touches[0].clientX;
- this.setSliderValue(sliderName, clientX - this.left, "onChange");
- };
- AtRange2.prototype.handleTouchEnd = function(sliderName) {
- if (this.props.disabled) return;
- this.currentSlider = sliderName;
- this.triggerEvent("onAfterChange");
- };
- AtRange2.prototype.setSliderValue = function(sliderName, targetValue, funcName) {
- var _a2, _b;
- var _this = this;
- var distance = Math.min(Math.max(targetValue, 0), this.width);
- var sliderValue = Math.floor(distance / this.width * 100);
- if (funcName) {
- this.setState((_a2 = {}, _a2[sliderName] = sliderValue, _a2), function() {
- return _this.triggerEvent(funcName);
- });
- } else {
- this.setState((_b = {}, _b[sliderName] = sliderValue, _b));
- }
- };
- AtRange2.prototype.setValue = function(value) {
- var _a2 = this.props.min, min = _a2 === void 0 ? 0 : _a2;
- var aX = Math.round((value[0] - min) / this.deltaValue * 100);
- var bX = Math.round((value[1] - min) / this.deltaValue * 100);
- this.setState({
- aX,
- bX
- });
- };
- AtRange2.prototype.triggerEvent = function(funcName) {
- var _a2 = this.props.min, min = _a2 === void 0 ? 0 : _a2;
- var _b = this.state, aX = _b.aX, bX = _b.bX;
- var a = Math.round(aX / 100 * this.deltaValue) + min;
- var b2 = Math.round(bX / 100 * this.deltaValue) + min;
- var result = [
- a,
- b2
- ].sort(function(x2, y2) {
- return x2 - y2;
- });
- if (funcName === "onChange") {
- this.props.onChange && this.props.onChange(result);
- } else if (funcName === "onAfterChange") {
- this.props.onAfterChange && this.props.onAfterChange(result);
- }
- };
- AtRange2.prototype.updatePos = function() {
- var _this = this;
- delayQuerySelector(".at-range__container", 0).then(function(rect) {
- var _a2, _b;
- _this.width = Math.round((_a2 = rect[0]) === null || _a2 === void 0 ? void 0 : _a2.width);
- _this.left = Math.round((_b = rect[0]) === null || _b === void 0 ? void 0 : _b.left);
- });
- };
- AtRange2.prototype.UNSAFE_componentWillReceiveProps = function(nextProps) {
- var value = nextProps.value;
- this.updatePos();
- if (this.props.value[0] !== value[0] || this.props.value[1] !== value[1]) {
- this.setValue(value);
- }
- };
- AtRange2.prototype.componentDidMount = function() {
- var value = this.props.value;
- this.updatePos();
- this.setValue(value);
- };
- AtRange2.prototype.render = function() {
- var _a2 = this.props, className = _a2.className, customStyle = _a2.customStyle, sliderStyle = _a2.sliderStyle, railStyle = _a2.railStyle, trackStyle = _a2.trackStyle, blockSize = _a2.blockSize, disabled = _a2.disabled;
- var rootCls = classnames("at-range", {
- "at-range--disabled": disabled
- }, className);
- var _b = this.state, aX = _b.aX, bX = _b.bX;
- var sliderCommonStyle = {
- width: blockSize ? blockSize + "PX" : "",
- height: blockSize ? blockSize + "PX" : "",
- marginLeft: blockSize ? -blockSize / 2 + "PX" : ""
- };
- var sliderAStyle = __assign(__assign({}, sliderCommonStyle), {
- left: aX + "%"
- });
- var sliderBStyle = __assign(__assign({}, sliderCommonStyle), {
- left: bX + "%"
- });
- var containerStyle = {
- height: blockSize ? blockSize + "PX" : ""
- };
- var smallerX = Math.min(aX, bX);
- var deltaX = Math.abs(aX - bX);
- var atTrackStyle = {
- left: smallerX + "%",
- width: deltaX + "%"
- };
- return import_react.default.createElement(View, {
- className: rootCls,
- style: customStyle,
- onClick: this.handleClick
- }, import_react.default.createElement(View, {
- className: "at-range__container",
- style: containerStyle
- }, import_react.default.createElement(View, {
- className: "at-range__rail",
- style: railStyle
- }), import_react.default.createElement(View, {
- className: "at-range__track",
- style: mergeStyle(atTrackStyle, trackStyle)
- }), import_react.default.createElement(View, {
- className: "at-range__slider",
- style: mergeStyle(sliderAStyle, sliderStyle),
- onTouchMove: this.handleTouchMove.bind(this, "aX"),
- onTouchEnd: this.handleTouchEnd.bind(this, "aX")
- }), import_react.default.createElement(View, {
- className: "at-range__slider",
- style: mergeStyle(sliderBStyle, sliderStyle),
- onTouchMove: this.handleTouchMove.bind(this, "bX"),
- onTouchEnd: this.handleTouchEnd.bind(this, "bX")
- })));
- };
- return AtRange2;
- }(import_react.default.Component);
- AtRange.defaultProps = {
- customStyle: "",
- className: "",
- sliderStyle: "",
- railStyle: "",
- trackStyle: "",
- value: [
- 0,
- 0
- ],
- min: 0,
- max: 100,
- disabled: false,
- blockSize: 0
- };
- AtRange.propTypes = {
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ]),
- sliderStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- railStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- trackStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- value: PropTypes.array,
- min: PropTypes.number,
- max: PropTypes.number,
- disabled: PropTypes.bool,
- blockSize: PropTypes.number,
- onChange: PropTypes.func,
- onAfterChange: PropTypes.func
- };
- var ENV = import_taro.default.getEnv();
- var AtIndexes = function(_super) {
- __extends(AtIndexes2, _super);
- function AtIndexes2(props) {
- var _this = _super.call(this, props) || this;
- _this.handleClick = function(item) {
- _this.props.onClick && _this.props.onClick(item);
- };
- _this.handleTouchMove = function(event) {
- event.stopPropagation();
- event.preventDefault();
- var list = _this.props.list;
- var pageY = event.touches[0].pageY;
- var index = Math.floor((pageY - _this.startTop) / _this.itemHeight);
- if (index >= 0 && index <= list.length && _this.currentIndex !== index) {
- _this.currentIndex = index;
- var key = index > 0 ? list[index - 1].key : "top";
- var touchView = "at-indexes__list-" + key;
- _this.jumpTarget(touchView, index);
- }
- };
- _this.handleTouchEnd = function() {
- _this.currentIndex = -1;
- };
- _this.state = {
- _scrollIntoView: "",
- _scrollTop: 0,
- _tipText: "",
- _isShowToast: false,
- isWEB: import_taro.default.getEnv() === import_taro.default.ENV_TYPE.WEB
- };
- _this.menuHeight = 0;
- _this.startTop = 0;
- _this.itemHeight = 0;
- _this.currentIndex = -1;
- _this.listId = isTest() ? "indexes-list-AOTU2018" : "list-" + uuid();
- return _this;
- }
- AtIndexes2.prototype.jumpTarget = function(_scrollIntoView, idx) {
- var _this = this;
- var _a2 = this.props, _b = _a2.topKey, topKey = _b === void 0 ? "Top" : _b, list = _a2.list;
- var _tipText = idx === 0 ? topKey : list[idx - 1].key;
- if (ENV === import_taro.default.ENV_TYPE.WEB) {
- delayQuerySelector(".at-indexes", 0).then(function(rect) {
- var targetOffsetTop = _this.listRef.children[idx].offsetTop;
- var _scrollTop = targetOffsetTop - rect[0].top;
- _this.updateState({
- _scrollTop,
- _scrollIntoView,
- _tipText
- });
- });
- return;
- }
- this.updateState({
- _scrollIntoView,
- _tipText
- });
- };
- AtIndexes2.prototype.__jumpTarget = function(key) {
- var list = this.props.list;
- var index = list.findIndex(function(item) {
- return item.key === key;
- });
- var targetView = "at-indexes__list-" + key;
- this.jumpTarget(targetView, index + 1);
- };
- AtIndexes2.prototype.updateState = function(state) {
- var _this = this;
- var _a2 = this.props, isShowToast = _a2.isShowToast, isVibrate = _a2.isVibrate;
- var _scrollIntoView = state._scrollIntoView, _tipText = state._tipText, _scrollTop = state._scrollTop;
- this.setState({
- _scrollIntoView,
- _tipText,
- _scrollTop,
- _isShowToast: isShowToast
- }, function() {
- clearTimeout(_this.timeoutTimer);
- _this.timeoutTimer = setTimeout(function() {
- _this.setState({
- _tipText: "",
- _isShowToast: false
- });
- }, 3e3);
- });
- if (isVibrate) {
- import_taro.default.vibrateShort();
- }
- };
- AtIndexes2.prototype.initData = function() {
- var _this = this;
- delayQuerySelector(".at-indexes__menu").then(function(rect) {
- var len = _this.props.list.length;
- _this.menuHeight = rect[0].height;
- _this.startTop = rect[0].top;
- _this.itemHeight = Math.floor(_this.menuHeight / (len + 1));
- });
- };
- AtIndexes2.prototype.handleScroll = function(e2) {
- if (e2 && e2.detail) {
- this.setState({
- _scrollTop: e2.detail.scrollTop
- });
- }
- };
- AtIndexes2.prototype.UNSAFE_componentWillReceiveProps = function(nextProps) {
- if (nextProps.list.length !== this.props.list.length) {
- this.initData();
- }
- };
- AtIndexes2.prototype.componentDidMount = function() {
- if (ENV === import_taro.default.ENV_TYPE.WEB) {
- this.listRef = document.getElementById(this.listId);
- }
- this.initData();
- };
- AtIndexes2.prototype.UNSAFE_componentWillMount = function() {
- this.props.onScrollIntoView && this.props.onScrollIntoView(this.__jumpTarget.bind(this));
- };
- AtIndexes2.prototype.render = function() {
- var _this = this;
- var _a2 = this.props, className = _a2.className, customStyle = _a2.customStyle, animation = _a2.animation, topKey = _a2.topKey, list = _a2.list;
- var _b = this.state, _scrollTop = _b._scrollTop, _scrollIntoView = _b._scrollIntoView, _tipText = _b._tipText, _isShowToast = _b._isShowToast, isWEB = _b.isWEB;
- var toastStyle = {
- minWidth: pxTransform(100)
- };
- var rootCls = classnames("at-indexes", className);
- var menuList = list.map(function(dataList, i) {
- var key = dataList.key;
- var targetView = "at-indexes__list-" + key;
- return import_react.default.createElement(View, {
- className: "at-indexes__menu-item",
- key,
- onClick: _this.jumpTarget.bind(_this, targetView, i + 1)
- }, key);
- });
- var indexesList = list.map(function(dataList) {
- return import_react.default.createElement(View, {
- id: "at-indexes__list-" + dataList.key,
- className: "at-indexes__list",
- key: dataList.key
- }, import_react.default.createElement(View, {
- className: "at-indexes__list-title"
- }, dataList.title), import_react.default.createElement(AtList, null, dataList.items && dataList.items.map(function(item) {
- return import_react.default.createElement(AtListItem, {
- key: item.name,
- title: item.name,
- onClick: _this.handleClick.bind(_this, item)
- });
- })));
- });
- return import_react.default.createElement(View, {
- className: rootCls,
- style: customStyle
- }, import_react.default.createElement(AtToast, {
- customStyle: toastStyle,
- isOpened: _isShowToast,
- text: _tipText,
- duration: 2e3
- }), import_react.default.createElement(View, {
- className: "at-indexes__menu",
- onTouchMove: this.handleTouchMove,
- onTouchEnd: this.handleTouchEnd
- }, import_react.default.createElement(View, {
- className: "at-indexes__menu-item",
- onClick: this.jumpTarget.bind(this, "at-indexes__top", 0)
- }, topKey), menuList), import_react.default.createElement(ScrollView, {
- className: "at-indexes__body",
- id: this.listId,
- scrollY: true,
- scrollWithAnimation: animation,
- scrollTop: isWEB ? _scrollTop : void 0,
- scrollIntoView: !isWEB ? _scrollIntoView : "",
- onScroll: this.handleScroll.bind(this)
- }, import_react.default.createElement(View, {
- className: "at-indexes__content",
- id: "at-indexes__top"
- }, this.props.children), indexesList));
- };
- return AtIndexes2;
- }(import_react.default.Component);
- AtIndexes.propTypes = {
- customStyle: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.string
- ]),
- className: PropTypes.oneOfType([
- PropTypes.array,
- PropTypes.string
- ]),
- animation: PropTypes.bool,
- isVibrate: PropTypes.bool,
- isShowToast: PropTypes.bool,
- topKey: PropTypes.string,
- list: PropTypes.array,
- onClick: PropTypes.func,
- onScrollIntoView: PropTypes.func
- };
- AtIndexes.defaultProps = {
- customStyle: "",
- className: "",
- animation: false,
- topKey: "Top",
- isVibrate: true,
- isShowToast: true,
- list: []
- };
- var dayjs_min = createCommonjsModule(function(module, exports) {
- !function(t2, e2) {
- module.exports = e2();
- }(commonjsGlobal, function() {
- var t2 = 1e3, e2 = 6e4, n2 = 36e5, r2 = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", f2 = "month", h2 = "quarter", c2 = "year", d2 = "date", l2 = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y2 = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = {
- name: "en",
- weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
- months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
- ordinal: function(t3) {
- var e3 = [
- "th",
- "st",
- "nd",
- "rd"
- ], n3 = t3 % 100;
- return "[" + t3 + (e3[(n3 - 20) % 10] || e3[n3] || e3[0]) + "]";
- }
- }, m2 = function(t3, e3, n3) {
- var r3 = String(t3);
- return !r3 || r3.length >= e3 ? t3 : "" + Array(e3 + 1 - r3.length).join(n3) + t3;
- }, v2 = {
- s: m2,
- z: function(t3) {
- var e3 = -t3.utcOffset(), n3 = Math.abs(e3), r3 = Math.floor(n3 / 60), i2 = n3 % 60;
- return (e3 <= 0 ? "+" : "-") + m2(r3, 2, "0") + ":" + m2(i2, 2, "0");
- },
- m: function t3(e3, n3) {
- if (e3.date() < n3.date()) return -t3(n3, e3);
- var r3 = 12 * (n3.year() - e3.year()) + (n3.month() - e3.month()), i2 = e3.clone().add(r3, f2), s2 = n3 - i2 < 0, u2 = e3.clone().add(r3 + (s2 ? -1 : 1), f2);
- return +(-(r3 + (n3 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
- },
- a: function(t3) {
- return t3 < 0 ? Math.ceil(t3) || 0 : Math.floor(t3);
- },
- p: function(t3) {
- return ({
- M: f2,
- y: c2,
- w: o,
- d: a,
- D: d2,
- h: u,
- m: s,
- s: i,
- ms: r2,
- Q: h2
- })[t3] || String(t3 || "").toLowerCase().replace(/s$/, "");
- },
- u: function(t3) {
- return void 0 === t3;
- }
- }, g2 = "en", D = {};
- D[g2] = M;
- var p2 = function(t3) {
- return t3 instanceof _;
- }, S = function t3(e3, n3, r3) {
- var i2;
- if (!e3) return g2;
- if ("string" == typeof e3) {
- var s2 = e3.toLowerCase();
- D[s2] && (i2 = s2), n3 && (D[s2] = n3, i2 = s2);
- var u2 = e3.split("-");
- if (!i2 && u2.length > 1) return t3(u2[0]);
- } else {
- var a2 = e3.name;
- D[a2] = e3, i2 = a2;
- }
- return !r3 && i2 && (g2 = i2), i2 || !r3 && g2;
- }, w2 = function(t3, e3) {
- if (p2(t3)) return t3.clone();
- var n3 = "object" == typeof e3 ? e3 : {};
- return n3.date = t3, n3.args = arguments, new _(n3);
- }, O = v2;
- O.l = S, O.i = p2, O.w = function(t3, e3) {
- return w2(t3, {
- locale: e3.$L,
- utc: e3.$u,
- x: e3.$x,
- $offset: e3.$offset
- });
- };
- var _ = function() {
- function M2(t3) {
- this.$L = S(t3.locale, null, true), this.parse(t3);
- }
- var m3 = M2.prototype;
- return m3.parse = function(t3) {
- this.$d = function(t4) {
- var e3 = t4.date, n3 = t4.utc;
- if (null === e3) return new Date(NaN);
- if (O.u(e3)) return new Date();
- if (e3 instanceof Date) return new Date(e3);
- if ("string" == typeof e3 && !/Z$/i.test(e3)) {
- var r3 = e3.match($);
- if (r3) {
- var i2 = r3[2] - 1 || 0, s2 = (r3[7] || "0").substring(0, 3);
- return n3 ? new Date(Date.UTC(r3[1], i2, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s2)) : new Date(r3[1], i2, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s2);
- }
- }
- return new Date(e3);
- }(t3), this.$x = t3.x || {}, this.init();
- }, m3.init = function() {
- var t3 = this.$d;
- this.$y = t3.getFullYear(), this.$M = t3.getMonth(), this.$D = t3.getDate(), this.$W = t3.getDay(), this.$H = t3.getHours(), this.$m = t3.getMinutes(), this.$s = t3.getSeconds(), this.$ms = t3.getMilliseconds();
- }, m3.$utils = function() {
- return O;
- }, m3.isValid = function() {
- return !(this.$d.toString() === l2);
- }, m3.isSame = function(t3, e3) {
- var n3 = w2(t3);
- return this.startOf(e3) <= n3 && n3 <= this.endOf(e3);
- }, m3.isAfter = function(t3, e3) {
- return w2(t3) < this.startOf(e3);
- }, m3.isBefore = function(t3, e3) {
- return this.endOf(e3) < w2(t3);
- }, m3.$g = function(t3, e3, n3) {
- return O.u(t3) ? this[e3] : this.set(n3, t3);
- }, m3.unix = function() {
- return Math.floor(this.valueOf() / 1e3);
- }, m3.valueOf = function() {
- return this.$d.getTime();
- }, m3.startOf = function(t3, e3) {
- var n3 = this, r3 = !!O.u(e3) || e3, h3 = O.p(t3), l3 = function(t4, e4) {
- var i2 = O.w(n3.$u ? Date.UTC(n3.$y, e4, t4) : new Date(n3.$y, e4, t4), n3);
- return r3 ? i2 : i2.endOf(a);
- }, $2 = function(t4, e4) {
- return O.w(n3.toDate()[t4].apply(n3.toDate("s"), (r3 ? [
- 0,
- 0,
- 0,
- 0
- ] : [
- 23,
- 59,
- 59,
- 999
- ]).slice(e4)), n3);
- }, y3 = this.$W, M3 = this.$M, m4 = this.$D, v3 = "set" + (this.$u ? "UTC" : "");
- switch(h3){
- case c2:
- return r3 ? l3(1, 0) : l3(31, 11);
- case f2:
- return r3 ? l3(1, M3) : l3(0, M3 + 1);
- case o:
- var g3 = this.$locale().weekStart || 0, D2 = (y3 < g3 ? y3 + 7 : y3) - g3;
- return l3(r3 ? m4 - D2 : m4 + (6 - D2), M3);
- case a:
- case d2:
- return $2(v3 + "Hours", 0);
- case u:
- return $2(v3 + "Minutes", 1);
- case s:
- return $2(v3 + "Seconds", 2);
- case i:
- return $2(v3 + "Milliseconds", 3);
- default:
- return this.clone();
- }
- }, m3.endOf = function(t3) {
- return this.startOf(t3, false);
- }, m3.$set = function(t3, e3) {
- var n3, o2 = O.p(t3), h3 = "set" + (this.$u ? "UTC" : ""), l3 = (n3 = {}, n3[a] = h3 + "Date", n3[d2] = h3 + "Date", n3[f2] = h3 + "Month", n3[c2] = h3 + "FullYear", n3[u] = h3 + "Hours", n3[s] = h3 + "Minutes", n3[i] = h3 + "Seconds", n3[r2] = h3 + "Milliseconds", n3)[o2], $2 = o2 === a ? this.$D + (e3 - this.$W) : e3;
- if (o2 === f2 || o2 === c2) {
- var y3 = this.clone().set(d2, 1);
- y3.$d[l3]($2), y3.init(), this.$d = y3.set(d2, Math.min(this.$D, y3.daysInMonth())).$d;
- } else l3 && this.$d[l3]($2);
- return this.init(), this;
- }, m3.set = function(t3, e3) {
- return this.clone().$set(t3, e3);
- }, m3.get = function(t3) {
- return this[O.p(t3)]();
- }, m3.add = function(r3, h3) {
- var d3, l3 = this;
- r3 = Number(r3);
- var $2 = O.p(h3), y3 = function(t3) {
- var e3 = w2(l3);
- return O.w(e3.date(e3.date() + Math.round(t3 * r3)), l3);
- };
- if ($2 === f2) return this.set(f2, this.$M + r3);
- if ($2 === c2) return this.set(c2, this.$y + r3);
- if ($2 === a) return y3(1);
- if ($2 === o) return y3(7);
- var M3 = (d3 = {}, d3[s] = e2, d3[u] = n2, d3[i] = t2, d3)[$2] || 1, m4 = this.$d.getTime() + r3 * M3;
- return O.w(m4, this);
- }, m3.subtract = function(t3, e3) {
- return this.add(-1 * t3, e3);
- }, m3.format = function(t3) {
- var e3 = this, n3 = this.$locale();
- if (!this.isValid()) return n3.invalidDate || l2;
- var r3 = t3 || "YYYY-MM-DDTHH:mm:ssZ", i2 = O.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n3.weekdays, f3 = n3.months, h3 = function(t4, n4, i3, s3) {
- return t4 && (t4[n4] || t4(e3, r3)) || i3[n4].slice(0, s3);
- }, c3 = function(t4) {
- return O.s(s2 % 12 || 12, t4, "0");
- }, d3 = n3.meridiem || function(t4, e4, n4) {
- var r4 = t4 < 12 ? "AM" : "PM";
- return n4 ? r4.toLowerCase() : r4;
- }, $2 = {
- YY: String(this.$y).slice(-2),
- YYYY: this.$y,
- M: a2 + 1,
- MM: O.s(a2 + 1, 2, "0"),
- MMM: h3(n3.monthsShort, a2, f3, 3),
- MMMM: h3(f3, a2),
- D: this.$D,
- DD: O.s(this.$D, 2, "0"),
- d: String(this.$W),
- dd: h3(n3.weekdaysMin, this.$W, o2, 2),
- ddd: h3(n3.weekdaysShort, this.$W, o2, 3),
- dddd: o2[this.$W],
- H: String(s2),
- HH: O.s(s2, 2, "0"),
- h: c3(1),
- hh: c3(2),
- a: d3(s2, u2, true),
- A: d3(s2, u2, false),
- m: String(u2),
- mm: O.s(u2, 2, "0"),
- s: String(this.$s),
- ss: O.s(this.$s, 2, "0"),
- SSS: O.s(this.$ms, 3, "0"),
- Z: i2
- };
- return r3.replace(y2, function(t4, e4) {
- return e4 || $2[t4] || i2.replace(":", "");
- });
- }, m3.utcOffset = function() {
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
- }, m3.diff = function(r3, d3, l3) {
- var $2, y3 = O.p(d3), M3 = w2(r3), m4 = (M3.utcOffset() - this.utcOffset()) * e2, v3 = this - M3, g3 = O.m(this, M3);
- return g3 = ($2 = {}, $2[c2] = g3 / 12, $2[f2] = g3, $2[h2] = g3 / 3, $2[o] = (v3 - m4) / 6048e5, $2[a] = (v3 - m4) / 864e5, $2[u] = v3 / n2, $2[s] = v3 / e2, $2[i] = v3 / t2, $2)[y3] || v3, l3 ? g3 : O.a(g3);
- }, m3.daysInMonth = function() {
- return this.endOf(f2).$D;
- }, m3.$locale = function() {
- return D[this.$L];
- }, m3.locale = function(t3, e3) {
- if (!t3) return this.$L;
- var n3 = this.clone(), r3 = S(t3, e3, true);
- return r3 && (n3.$L = r3), n3;
- }, m3.clone = function() {
- return O.w(this.$d, this);
- }, m3.toDate = function() {
- return new Date(this.valueOf());
- }, m3.toJSON = function() {
- return this.isValid() ? this.toISOString() : null;
- }, m3.toISOString = function() {
- return this.$d.toISOString();
- }, m3.toString = function() {
- return this.$d.toUTCString();
- }, M2;
- }(), T = _.prototype;
- return w2.prototype = T, [
- [
- "$ms",
- r2
- ],
- [
- "$s",
- i
- ],
- [
- "$m",
- s
- ],
- [
- "$H",
- u
- ],
- [
- "$W",
- a
- ],
- [
- "$M",
- f2
- ],
- [
- "$y",
- c2
- ],
- [
- "$D",
- d2
- ]
- ].forEach(function(t3) {
- T[t3[1]] = function(e3) {
- return this.$g(e3, t3[0], t3[1]);
- };
- }), w2.extend = function(t3, e3) {
- return t3.$i || (t3(e3, _, w2), t3.$i = true), w2;
- }, w2.locale = S, w2.isDayjs = p2, w2.unix = function(t3) {
- return w2(1e3 * t3);
- }, w2.en = D[g2], w2.Ls = D, w2.p = {}, w2;
- });
- });
- var objectCreate = Object.create;
- var baseCreate = function() {
- function object() {}
- return function(proto) {
- if (!isObject_1(proto)) {
- return {};
- }
- if (objectCreate) {
- return objectCreate(proto);
- }
- object.prototype = proto;
- var result = new object();
- object.prototype = void 0;
- return result;
- };
- }();
- var _baseCreate = baseCreate;
- function baseLodash() {}
- var _baseLodash = baseLodash;
- function LodashWrapper(value, chainAll) {
- this.__wrapped__ = value;
- this.__actions__ = [];
- this.__chain__ = !!chainAll;
- this.__index__ = 0;
- this.__values__ = void 0;
- }
- LodashWrapper.prototype = _baseCreate(_baseLodash.prototype);
- LodashWrapper.prototype.constructor = LodashWrapper;
- var _LodashWrapper = LodashWrapper;
- function arrayPush(array, values) {
- var index = -1, length = values.length, offset = array.length;
- while(++index < length){
- array[offset + index] = values[index];
- }
- return array;
- }
- var _arrayPush = arrayPush;
- var argsTag$1 = "[object Arguments]";
- function baseIsArguments(value) {
- return isObjectLike_1(value) && _baseGetTag(value) == argsTag$1;
- }
- var _baseIsArguments = baseIsArguments;
- var objectProto$6 = Object.prototype;
- var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
- var propertyIsEnumerable = objectProto$6.propertyIsEnumerable;
- var isArguments = _baseIsArguments(function() {
- return arguments;
- }()) ? _baseIsArguments : function(value) {
- return isObjectLike_1(value) && hasOwnProperty$5.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
- };
- var isArguments_1 = isArguments;
- var spreadableSymbol = _Symbol ? _Symbol.isConcatSpreadable : void 0;
- function isFlattenable(value) {
- return isArray_1(value) || isArguments_1(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
- }
- var _isFlattenable = isFlattenable;
- function baseFlatten(array, depth, predicate, isStrict, result) {
- var index = -1, length = array.length;
- predicate || (predicate = _isFlattenable);
- result || (result = []);
- while(++index < length){
- var value = array[index];
- if (depth > 0 && predicate(value)) {
- if (depth > 1) {
- baseFlatten(value, depth - 1, predicate, isStrict, result);
- } else {
- _arrayPush(result, value);
- }
- } else if (!isStrict) {
- result[result.length] = value;
- }
- }
- return result;
- }
- var _baseFlatten = baseFlatten;
- function flatten(array) {
- var length = array == null ? 0 : array.length;
- return length ? _baseFlatten(array, 1) : [];
- }
- var flatten_1 = flatten;
- function apply(func, thisArg, args) {
- switch(args.length){
- case 0:
- return func.call(thisArg);
- case 1:
- return func.call(thisArg, args[0]);
- case 2:
- return func.call(thisArg, args[0], args[1]);
- case 3:
- return func.call(thisArg, args[0], args[1], args[2]);
- }
- return func.apply(thisArg, args);
- }
- var _apply = apply;
- var nativeMax = Math.max;
- function overRest(func, start, transform) {
- start = nativeMax(start === void 0 ? func.length - 1 : start, 0);
- return function() {
- var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
- while(++index < length){
- array[index] = args[start + index];
- }
- index = -1;
- var otherArgs = Array(start + 1);
- while(++index < start){
- otherArgs[index] = args[index];
- }
- otherArgs[start] = transform(array);
- return _apply(func, this, otherArgs);
- };
- }
- var _overRest = overRest;
- function constant(value) {
- return function() {
- return value;
- };
- }
- var constant_1 = constant;
- var coreJsData = _root["__core-js_shared__"];
- var _coreJsData = coreJsData;
- var maskSrcKey = function() {
- var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || "");
- return uid ? "Symbol(src)_1." + uid : "";
- }();
- function isMasked(func) {
- return !!maskSrcKey && maskSrcKey in func;
- }
- var _isMasked = isMasked;
- var funcProto$1 = Function.prototype;
- var funcToString$1 = funcProto$1.toString;
- function toSource(func) {
- if (func != null) {
- try {
- return funcToString$1.call(func);
- } catch (e2) {}
- try {
- return func + "";
- } catch (e21) {}
- }
- return "";
- }
- var _toSource = toSource;
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
- var funcProto = Function.prototype;
- var objectProto$5 = Object.prototype;
- var funcToString = funcProto.toString;
- var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
- var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty$4).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
- function baseIsNative(value) {
- if (!isObject_1(value) || _isMasked(value)) {
- return false;
- }
- var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
- return pattern.test(_toSource(value));
- }
- var _baseIsNative = baseIsNative;
- function getValue(object, key) {
- return object == null ? void 0 : object[key];
- }
- var _getValue = getValue;
- function getNative(object, key) {
- var value = _getValue(object, key);
- return _baseIsNative(value) ? value : void 0;
- }
- var _getNative = getNative;
- var defineProperty = function() {
- try {
- var func = _getNative(Object, "defineProperty");
- func({}, "", {});
- return func;
- } catch (e2) {}
- }();
- var _defineProperty = defineProperty;
- function identity(value) {
- return value;
- }
- var identity_1 = identity;
- var baseSetToString = !_defineProperty ? identity_1 : function(func, string) {
- return _defineProperty(func, "toString", {
- "configurable": true,
- "enumerable": false,
- "value": constant_1(string),
- "writable": true
- });
- };
- var _baseSetToString = baseSetToString;
- var HOT_COUNT = 800;
- var HOT_SPAN = 16;
- var nativeNow = Date.now;
- function shortOut(func) {
- var count = 0, lastCalled = 0;
- return function() {
- var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
- lastCalled = stamp;
- if (remaining > 0) {
- if (++count >= HOT_COUNT) {
- return arguments[0];
- }
- } else {
- count = 0;
- }
- return func.apply(void 0, arguments);
- };
- }
- var _shortOut = shortOut;
- var setToString = _shortOut(_baseSetToString);
- var _setToString = setToString;
- function flatRest(func) {
- return _setToString(_overRest(func, void 0, flatten_1), func + "");
- }
- var _flatRest = flatRest;
- var WeakMap = _getNative(_root, "WeakMap");
- var _WeakMap = WeakMap;
- var metaMap = _WeakMap && new _WeakMap();
- var _metaMap = metaMap;
- function noop() {}
- var noop_1 = noop;
- var getData = !_metaMap ? noop_1 : function(func) {
- return _metaMap.get(func);
- };
- var _getData = getData;
- var realNames = {};
- var _realNames = realNames;
- var objectProto$4 = Object.prototype;
- var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
- function getFuncName(func) {
- var result = func.name + "", array = _realNames[result], length = hasOwnProperty$3.call(_realNames, result) ? array.length : 0;
- while(length--){
- var data = array[length], otherFunc = data.func;
- if (otherFunc == null || otherFunc == func) {
- return data.name;
- }
- }
- return result;
- }
- var _getFuncName = getFuncName;
- var MAX_ARRAY_LENGTH = 4294967295;
- function LazyWrapper(value) {
- this.__wrapped__ = value;
- this.__actions__ = [];
- this.__dir__ = 1;
- this.__filtered__ = false;
- this.__iteratees__ = [];
- this.__takeCount__ = MAX_ARRAY_LENGTH;
- this.__views__ = [];
- }
- LazyWrapper.prototype = _baseCreate(_baseLodash.prototype);
- LazyWrapper.prototype.constructor = LazyWrapper;
- var _LazyWrapper = LazyWrapper;
- function copyArray(source, array) {
- var index = -1, length = source.length;
- array || (array = Array(length));
- while(++index < length){
- array[index] = source[index];
- }
- return array;
- }
- var _copyArray = copyArray;
- function wrapperClone(wrapper) {
- if (wrapper instanceof _LazyWrapper) {
- return wrapper.clone();
- }
- var result = new _LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
- result.__actions__ = _copyArray(wrapper.__actions__);
- result.__index__ = wrapper.__index__;
- result.__values__ = wrapper.__values__;
- return result;
- }
- var _wrapperClone = wrapperClone;
- var objectProto$3 = Object.prototype;
- var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
- function lodash(value) {
- if (isObjectLike_1(value) && !isArray_1(value) && !(value instanceof _LazyWrapper)) {
- if (value instanceof _LodashWrapper) {
- return value;
- }
- if (hasOwnProperty$2.call(value, "__wrapped__")) {
- return _wrapperClone(value);
- }
- }
- return new _LodashWrapper(value);
- }
- lodash.prototype = _baseLodash.prototype;
- lodash.prototype.constructor = lodash;
- var wrapperLodash = lodash;
- function isLaziable(func) {
- var funcName = _getFuncName(func), other = wrapperLodash[funcName];
- if (typeof other != "function" || !(funcName in _LazyWrapper.prototype)) {
- return false;
- }
- if (func === other) {
- return true;
- }
- var data = _getData(other);
- return !!data && func === data[0];
- }
- var _isLaziable = isLaziable;
- var FUNC_ERROR_TEXT = "Expected a function";
- var WRAP_CURRY_FLAG = 8;
- var WRAP_PARTIAL_FLAG = 32;
- var WRAP_ARY_FLAG = 128;
- var WRAP_REARG_FLAG = 256;
- function createFlow(fromRight) {
- return _flatRest(function(funcs) {
- var length = funcs.length, index = length, prereq = _LodashWrapper.prototype.thru;
- if (fromRight) {
- funcs.reverse();
- }
- while(index--){
- var func = funcs[index];
- if (typeof func != "function") {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- if (prereq && !wrapper && _getFuncName(func) == "wrapper") {
- var wrapper = new _LodashWrapper([], true);
- }
- }
- index = wrapper ? index : length;
- while(++index < length){
- func = funcs[index];
- var funcName = _getFuncName(func), data = funcName == "wrapper" ? _getData(func) : void 0;
- if (data && _isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1) {
- wrapper = wrapper[_getFuncName(data[0])].apply(wrapper, data[3]);
- } else {
- wrapper = func.length == 1 && _isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func);
- }
- }
- return function() {
- var args = arguments, value = args[0];
- if (wrapper && args.length == 1 && isArray_1(value)) {
- return wrapper.plant(value).value();
- }
- var index2 = 0, result = length ? funcs[index2].apply(this, args) : value;
- while(++index2 < length){
- result = funcs[index2].call(this, result);
- }
- return result;
- };
- });
- }
- var _createFlow = createFlow;
- var flow = _createFlow();
- var flow_1 = flow;
- var TYPE_PRE_MONTH = -1;
- var TYPE_NOW_MONTH = 0;
- var TYPE_NEXT_MONTH = 1;
- var objectProto$2 = Object.prototype;
- function isPrototype(value) {
- var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$2;
- return value === proto;
- }
- var _isPrototype = isPrototype;
- function overArg(func, transform) {
- return function(arg) {
- return func(transform(arg));
- };
- }
- var _overArg = overArg;
- var nativeKeys = _overArg(Object.keys, Object);
- var _nativeKeys = nativeKeys;
- var objectProto$1 = Object.prototype;
- var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
- function baseKeys(object) {
- if (!_isPrototype(object)) {
- return _nativeKeys(object);
- }
- var result = [];
- for(var key in Object(object)){
- if (hasOwnProperty$1.call(object, key) && key != "constructor") {
- result.push(key);
- }
- }
- return result;
- }
- var _baseKeys = baseKeys;
- var DataView = _getNative(_root, "DataView");
- var _DataView = DataView;
- var Map = _getNative(_root, "Map");
- var _Map = Map;
- var Promise$1 = _getNative(_root, "Promise");
- var _Promise = Promise$1;
- var Set$1 = _getNative(_root, "Set");
- var _Set = Set$1;
- var mapTag$2 = "[object Map]";
- var objectTag$1 = "[object Object]";
- var promiseTag = "[object Promise]";
- var setTag$2 = "[object Set]";
- var weakMapTag$1 = "[object WeakMap]";
- var dataViewTag$1 = "[object DataView]";
- var dataViewCtorString = _toSource(_DataView);
- var mapCtorString = _toSource(_Map);
- var promiseCtorString = _toSource(_Promise);
- var setCtorString = _toSource(_Set);
- var weakMapCtorString = _toSource(_WeakMap);
- var getTag = _baseGetTag;
- if (_DataView && getTag(new _DataView(new ArrayBuffer(1))) != dataViewTag$1 || _Map && getTag(new _Map()) != mapTag$2 || _Promise && getTag(_Promise.resolve()) != promiseTag || _Set && getTag(new _Set()) != setTag$2 || _WeakMap && getTag(new _WeakMap()) != weakMapTag$1) {
- getTag = function(value) {
- var result = _baseGetTag(value), Ctor = result == objectTag$1 ? value.constructor : void 0, ctorString = Ctor ? _toSource(Ctor) : "";
- if (ctorString) {
- switch(ctorString){
- case dataViewCtorString:
- return dataViewTag$1;
- case mapCtorString:
- return mapTag$2;
- case promiseCtorString:
- return promiseTag;
- case setCtorString:
- return setTag$2;
- case weakMapCtorString:
- return weakMapTag$1;
- }
- }
- return result;
- };
- }
- var _getTag = getTag;
- function stubFalse() {
- return false;
- }
- var stubFalse_1 = stubFalse;
- var isBuffer_1 = createCommonjsModule(function(module, exports) {
- var freeExports = exports && !exports.nodeType && exports;
- var freeModule = freeExports && true && module && !module.nodeType && module;
- var moduleExports = freeModule && freeModule.exports === freeExports;
- var Buffer = moduleExports ? _root.Buffer : void 0;
- var nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0;
- var isBuffer = nativeIsBuffer || stubFalse_1;
- module.exports = isBuffer;
- });
- var argsTag = "[object Arguments]";
- var arrayTag = "[object Array]";
- var boolTag = "[object Boolean]";
- var dateTag = "[object Date]";
- var errorTag = "[object Error]";
- var funcTag = "[object Function]";
- var mapTag$1 = "[object Map]";
- var numberTag = "[object Number]";
- var objectTag = "[object Object]";
- var regexpTag = "[object RegExp]";
- var setTag$1 = "[object Set]";
- var stringTag = "[object String]";
- var weakMapTag = "[object WeakMap]";
- var arrayBufferTag = "[object ArrayBuffer]";
- var dataViewTag = "[object DataView]";
- var float32Tag = "[object Float32Array]";
- var float64Tag = "[object Float64Array]";
- var int8Tag = "[object Int8Array]";
- var int16Tag = "[object Int16Array]";
- var int32Tag = "[object Int32Array]";
- var uint8Tag = "[object Uint8Array]";
- var uint8ClampedTag = "[object Uint8ClampedArray]";
- var uint16Tag = "[object Uint16Array]";
- var uint32Tag = "[object Uint32Array]";
- var typedArrayTags = {};
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
- typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag$1] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag$1] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
- function baseIsTypedArray(value) {
- return isObjectLike_1(value) && isLength_1(value.length) && !!typedArrayTags[_baseGetTag(value)];
- }
- var _baseIsTypedArray = baseIsTypedArray;
- function baseUnary(func) {
- return function(value) {
- return func(value);
- };
- }
- var _baseUnary = baseUnary;
- var _nodeUtil = createCommonjsModule(function(module, exports) {
- var freeExports = exports && !exports.nodeType && exports;
- var freeModule = freeExports && true && module && !module.nodeType && module;
- var moduleExports = freeModule && freeModule.exports === freeExports;
- var freeProcess = moduleExports && _freeGlobal.process;
- var nodeUtil = function() {
- try {
- var types = freeModule && freeModule.require && freeModule.require("util").types;
- if (types) {
- return types;
- }
- return freeProcess && freeProcess.binding && freeProcess.binding("util");
- } catch (e2) {}
- }();
- module.exports = nodeUtil;
- });
- var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray;
- var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray;
- var isTypedArray_1 = isTypedArray;
- var mapTag = "[object Map]";
- var setTag = "[object Set]";
- var objectProto = Object.prototype;
- var hasOwnProperty = objectProto.hasOwnProperty;
- function isEmpty(value) {
- if (value == null) {
- return true;
- }
- if (isArrayLike_1(value) && (isArray_1(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer_1(value) || isTypedArray_1(value) || isArguments_1(value))) {
- return !value.length;
- }
- var tag = _getTag(value);
- if (tag == mapTag || tag == setTag) {
- return !value.size;
- }
- if (_isPrototype(value)) {
- return !_baseKeys(value).length;
- }
- for(var key in value){
- if (hasOwnProperty.call(value, key)) {
- return false;
- }
- }
- return true;
- }
- var isEmpty_1 = isEmpty;
- function handleActive(args, item) {
- var selectedDate = args.selectedDate;
- var _value = item._value;
- var start = selectedDate.start, end = selectedDate.end;
- var dayjsEnd = dayjs_min(end);
- var dayjsStart = start ? dayjs_min(start) : dayjsEnd;
- item.isSelected = (_value === null || _value === void 0 ? void 0 : _value.isSame(dayjsEnd)) || (_value === null || _value === void 0 ? void 0 : _value.isSame(dayjsStart)) || (_value === null || _value === void 0 ? void 0 : _value.isAfter(dayjsStart)) && (_value === null || _value === void 0 ? void 0 : _value.isBefore(dayjsEnd));
- item.isSelectedHead = _value === null || _value === void 0 ? void 0 : _value.isSame(dayjsStart);
- item.isSelectedTail = _value === null || _value === void 0 ? void 0 : _value.isSame(dayjsEnd);
- item.isToday = (_value === null || _value === void 0 ? void 0 : _value.diff(dayjs_min(Date.now()).startOf("day"), "day")) === 0;
- return item;
- }
- function handleMarks(args, item) {
- var options = args.options;
- var _value = item._value;
- var marks = options.marks;
- var markList = marks.filter(function(mark) {
- return dayjs_min(mark.value).startOf("day").isSame(_value);
- });
- item.marks = markList.slice(0, 1);
- return item;
- }
- function handleDisabled(args, item) {
- var options = args.options;
- var _value = item._value;
- var minDate = options.minDate, maxDate = options.maxDate;
- var dayjsMinDate = dayjs_min(minDate);
- var dayjsMaxDate = dayjs_min(maxDate);
- item.isDisabled = !!(minDate && (_value === null || _value === void 0 ? void 0 : _value.isBefore(dayjsMinDate))) || !!(maxDate && (_value === null || _value === void 0 ? void 0 : _value.isAfter(dayjsMaxDate)));
- return item;
- }
- function handleValid(args, item) {
- var options = args.options;
- var _value = item._value;
- var validDates = options.validDates;
- if (!isEmpty_1(validDates)) {
- var isInclude = validDates.some(function(date) {
- return dayjs_min(date.value).startOf("day").isSame(_value);
- });
- item.isDisabled = !isInclude;
- }
- delete item._value;
- return item;
- }
- var plugins = [
- handleActive,
- handleMarks,
- handleDisabled,
- handleValid
- ];
- var TOTAL = 7 * 6;
- function getFullItem(item, options, selectedDate, isShowStatus) {
- if (options.marks.find(function(x2) {
- return x2.value === item.value;
- })) {
- item.marks = [
- {
- value: item.value
- }
- ];
- }
- if (!isShowStatus) return item;
- var bindedPlugins = plugins.map(function(fn) {
- return fn.bind(null, {
- options,
- selectedDate
- });
- });
- return flow_1(bindedPlugins)(item);
- }
- function generateCalendarGroup(options) {
- return function(generateDate, selectedDate, isShowStatus) {
- var date = dayjs_min(generateDate);
- var format = options.format;
- var firstDate = date.startOf("month");
- var lastDate = date.endOf("month");
- var preMonthDate = date.subtract(1, "month");
- var list = [];
- var nowMonthDays = date.daysInMonth();
- var preMonthLastDay = preMonthDate.endOf("month").day();
- for(var i_1 = 1; i_1 <= preMonthLastDay + 1; i_1++){
- var thisDate = firstDate.subtract(i_1, "day").startOf("day");
- var item = {
- marks: [],
- _value: thisDate,
- text: thisDate.date(),
- type: TYPE_PRE_MONTH,
- value: thisDate.format(format)
- };
- item = getFullItem(item, options, selectedDate, isShowStatus);
- list.push(item);
- }
- list.reverse();
- for(var i_2 = 0; i_2 < nowMonthDays; i_2++){
- var thisDate = firstDate.add(i_2, "day").startOf("day");
- var item = {
- marks: [],
- _value: thisDate,
- text: thisDate.date(),
- type: TYPE_NOW_MONTH,
- value: thisDate.format(format)
- };
- item = getFullItem(item, options, selectedDate, isShowStatus);
- list.push(item);
- }
- var i = 1;
- while(list.length < TOTAL){
- var thisDate = lastDate.add(i++, "day").startOf("day");
- var item = {
- marks: [],
- _value: thisDate,
- text: thisDate.date(),
- type: TYPE_NEXT_MONTH,
- value: thisDate.format(format)
- };
- item = getFullItem(item, options, selectedDate, isShowStatus);
- list.push(item);
- }
- return {
- list,
- value: generateDate
- };
- };
- }
- var _a;
- var MAP = (_a = {}, _a[TYPE_PRE_MONTH] = "pre", _a[TYPE_NOW_MONTH] = "now", _a[TYPE_NEXT_MONTH] = "next", _a);
- var AtCalendarList = function(_super) {
- __extends(AtCalendarList2, _super);
- function AtCalendarList2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.handleClick = function(item) {
- if (typeof _this.props.onClick === "function") {
- _this.props.onClick(item);
- }
- };
- _this.handleLongClick = function(item) {
- if (typeof _this.props.onLongClick === "function") {
- _this.props.onLongClick(item);
- }
- };
- return _this;
- }
- AtCalendarList2.prototype.render = function() {
- var _this = this;
- var list = this.props.list;
- if (!list || list.length === 0) return null;
- return import_react.default.createElement(View, {
- className: "at-calendar__list flex"
- }, list.map(function(item) {
- return import_react.default.createElement(View, {
- key: "list-item-" + item.value,
- onClick: _this.handleClick.bind(_this, item),
- onLongPress: _this.handleLongClick.bind(_this, item),
- className: classnames("flex__item", "flex__item--" + MAP[item.type], {
- "flex__item--today": item.isToday,
- "flex__item--active": item.isActive,
- "flex__item--selected": item.isSelected,
- "flex__item--selected-head": item.isSelectedHead,
- "flex__item--selected-tail": item.isSelectedTail,
- "flex__item--blur": item.isDisabled || item.type === TYPE_PRE_MONTH || item.type === TYPE_NEXT_MONTH
- })
- }, import_react.default.createElement(View, {
- className: "flex__item-container"
- }, import_react.default.createElement(View, {
- className: "container-text"
- }, item.text)), import_react.default.createElement(View, {
- className: "flex__item-extra extra"
- }, item.marks && item.marks.length > 0 ? import_react.default.createElement(View, {
- className: "extra-marks"
- }, item.marks.map(function(mark, key) {
- return import_react.default.createElement(Text, {
- key,
- className: "mark"
- }, mark.value);
- })) : null));
- }));
- };
- return AtCalendarList2;
- }(import_react.default.Component);
- var AtCalendarHeader = function(_super) {
- __extends(AtCalendarHeader2, _super);
- function AtCalendarHeader2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtCalendarHeader2.prototype.render = function() {
- return import_react.default.createElement(View, {
- className: "at-calendar__header header"
- }, import_react.default.createElement(View, {
- className: "header__flex"
- }, import_react.default.createElement(View, {
- className: "header__flex-item"
- }, "\u65E5"), import_react.default.createElement(View, {
- className: "header__flex-item"
- }, "\u4E00"), import_react.default.createElement(View, {
- className: "header__flex-item"
- }, "\u4E8C"), import_react.default.createElement(View, {
- className: "header__flex-item"
- }, "\u4E09"), import_react.default.createElement(View, {
- className: "header__flex-item"
- }, "\u56DB"), import_react.default.createElement(View, {
- className: "header__flex-item"
- }, "\u4E94"), import_react.default.createElement(View, {
- className: "header__flex-item"
- }, "\u516D")));
- };
- return AtCalendarHeader2;
- }(import_react.default.Component);
- var ANIMTE_DURATION = 300;
- var defaultProps$1 = {
- marks: [],
- selectedDate: {
- end: Date.now(),
- start: Date.now()
- },
- format: "YYYY-MM-DD",
- generateDate: Date.now()
- };
- var AtCalendarBody = function(_super) {
- __extends(AtCalendarBody2, _super);
- function AtCalendarBody2(props) {
- var _this = _super.call(this, props) || this;
- _this.changeCount = 0;
- _this.currentSwiperIndex = 1;
- _this.startX = 0;
- _this.swipeStartPoint = 0;
- _this.isPreMonth = false;
- _this.maxWidth = 0;
- _this.isTouching = false;
- _this.getGroups = function(generateDate2, selectedDate2) {
- var dayjsDate = dayjs_min(generateDate2);
- var arr = [];
- var preList = _this.generateFunc(dayjsDate.subtract(1, "month").valueOf(), selectedDate2);
- var nowList = _this.generateFunc(generateDate2, selectedDate2, true);
- var nextList = _this.generateFunc(dayjsDate.add(1, "month").valueOf(), selectedDate2);
- var preListIndex = _this.currentSwiperIndex === 0 ? 2 : _this.currentSwiperIndex - 1;
- var nextListIndex = _this.currentSwiperIndex === 2 ? 0 : _this.currentSwiperIndex + 1;
- arr[preListIndex] = preList;
- arr[nextListIndex] = nextList;
- arr[_this.currentSwiperIndex] = nowList;
- return arr;
- };
- _this.handleTouchStart = function(e2) {
- if (!_this.props.isSwiper) {
- return;
- }
- _this.isTouching = true;
- _this.startX = e2.touches[0].clientX;
- };
- _this.handleTouchMove = function(e2) {
- if (!_this.props.isSwiper) {
- return;
- }
- if (!_this.isTouching) return;
- var clientX = e2.touches[0].clientX;
- var offsetSize = clientX - _this.startX;
- _this.setState({
- offsetSize
- });
- };
- _this.animateMoveSlide = function(offset, callback) {
- _this.setState({
- isAnimate: true
- }, function() {
- _this.setState({
- offsetSize: offset
- });
- setTimeout(function() {
- _this.setState({
- isAnimate: false
- }, function() {
- callback && callback();
- });
- }, ANIMTE_DURATION);
- });
- };
- _this.handleTouchEnd = function() {
- if (!_this.props.isSwiper) {
- return;
- }
- var offsetSize = _this.state.offsetSize;
- _this.isTouching = false;
- var isRight = offsetSize > 0;
- var breakpoint = _this.maxWidth / 2;
- var absOffsetSize = Math.abs(offsetSize);
- if (absOffsetSize > breakpoint) {
- var res = isRight ? _this.maxWidth : -_this.maxWidth;
- return _this.animateMoveSlide(res, function() {
- _this.props.onSwipeMonth(isRight ? -1 : 1);
- });
- }
- _this.animateMoveSlide(0);
- };
- _this.handleChange = function(e2) {
- var _a2 = e2.detail, current = _a2.current, source = _a2.source;
- if (source === "touch") {
- _this.currentSwiperIndex = current;
- _this.changeCount += 1;
- }
- };
- _this.handleAnimateFinish = function() {
- if (_this.changeCount > 0) {
- _this.props.onSwipeMonth(_this.isPreMonth ? -_this.changeCount : _this.changeCount);
- _this.changeCount = 0;
- }
- };
- _this.handleSwipeTouchStart = function(e2) {
- var _a2 = e2.changedTouches[0], clientY = _a2.clientY, clientX = _a2.clientX;
- _this.swipeStartPoint = _this.props.isVertical ? clientY : clientX;
- };
- _this.handleSwipeTouchEnd = function(e2) {
- var _a2 = e2.changedTouches[0], clientY = _a2.clientY, clientX = _a2.clientX;
- _this.isPreMonth = _this.props.isVertical ? clientY - _this.swipeStartPoint > 0 : clientX - _this.swipeStartPoint > 0;
- };
- var validDates = props.validDates, marks = props.marks, format = props.format, minDate = props.minDate, maxDate = props.maxDate, generateDate = props.generateDate, selectedDate = props.selectedDate, selectedDates = props.selectedDates;
- _this.generateFunc = generateCalendarGroup({
- validDates,
- format,
- minDate,
- maxDate,
- marks,
- selectedDates
- });
- var listGroup = _this.getGroups(generateDate, selectedDate);
- _this.state = {
- listGroup,
- offsetSize: 0,
- isAnimate: false
- };
- return _this;
- }
- AtCalendarBody2.prototype.componentDidMount = function() {
- var _this = this;
- delayQuerySelector(".at-calendar-slider__main").then(function(res) {
- _this.maxWidth = res[0].width;
- });
- };
- AtCalendarBody2.prototype.UNSAFE_componentWillReceiveProps = function(nextProps) {
- var validDates = nextProps.validDates, marks = nextProps.marks, format = nextProps.format, minDate = nextProps.minDate, maxDate = nextProps.maxDate, generateDate = nextProps.generateDate, selectedDate = nextProps.selectedDate, selectedDates = nextProps.selectedDates;
- this.generateFunc = generateCalendarGroup({
- validDates,
- format,
- minDate,
- maxDate,
- marks,
- selectedDates
- });
- var listGroup = this.getGroups(generateDate, selectedDate);
- this.setState({
- offsetSize: 0,
- listGroup
- });
- };
- AtCalendarBody2.prototype.render = function() {
- var _this = this;
- var isSwiper = this.props.isSwiper;
- var _a2 = this.state, isAnimate = _a2.isAnimate, offsetSize = _a2.offsetSize, listGroup = _a2.listGroup;
- if (!isSwiper) {
- return import_react.default.createElement(View, {
- className: classnames("main", "at-calendar-slider__main", "at-calendar-slider__main--weapp")
- }, import_react.default.createElement(AtCalendarHeader, null), import_react.default.createElement(View, {
- className: "main__body body"
- }, import_react.default.createElement(View, {
- className: "body__slider body__slider--now"
- }, import_react.default.createElement(AtCalendarList, {
- list: listGroup[1].list,
- onClick: this.props.onDayClick,
- onLongClick: this.props.onLongClick
- }))));
- }
- if (false) {}
- return import_react.default.createElement(View, {
- className: classnames("main", "at-calendar-slider__main", "at-calendar-slider__main--weapp")
- }, import_react.default.createElement(AtCalendarHeader, null), import_react.default.createElement(Swiper, {
- circular: true,
- current: 1,
- skipHiddenItemLayout: true,
- className: classnames("main__body"),
- onChange: this.handleChange,
- vertical: this.props.isVertical,
- onAnimationFinish: this.handleAnimateFinish,
- onTouchEnd: this.handleSwipeTouchEnd,
- onTouchStart: this.handleSwipeTouchStart
- }, listGroup.map(function(item, key) {
- return import_react.default.createElement(SwiperItem, {
- key,
- itemId: key.toString()
- }, import_react.default.createElement(AtCalendarList, {
- list: item.list,
- onClick: _this.props.onDayClick,
- onLongClick: _this.props.onLongClick
- }));
- })));
- };
- AtCalendarBody2.defaultProps = defaultProps$1;
- return AtCalendarBody2;
- }(import_react.default.Component);
- var AtCalendarController = function(_super) {
- __extends(AtCalendarController2, _super);
- function AtCalendarController2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtCalendarController2.prototype.render = function() {
- var _a2 = this.props, generateDate = _a2.generateDate, minDate = _a2.minDate, maxDate = _a2.maxDate, monthFormat = _a2.monthFormat, hideArrow = _a2.hideArrow;
- var dayjsDate = dayjs_min(generateDate);
- var dayjsMinDate = !!minDate && dayjs_min(minDate);
- var dayjsMaxDate = !!maxDate && dayjs_min(maxDate);
- var isMinMonth = dayjsMinDate && dayjsMinDate.startOf("month").isSame(dayjsDate);
- var isMaxMonth = dayjsMaxDate && dayjsMaxDate.startOf("month").isSame(dayjsDate);
- var minDateValue = dayjsMinDate ? dayjsMinDate.format("YYYY-MM") : "";
- var maxDateValue = dayjsMaxDate ? dayjsMaxDate.format("YYYY-MM") : "";
- return import_react.default.createElement(View, {
- className: "at-calendar__controller controller"
- }, hideArrow ? null : import_react.default.createElement(View, {
- className: classnames("controller__arrow controller__arrow--left", {
- "controller__arrow--disabled": isMinMonth
- }),
- onClick: this.props.onPreMonth.bind(this, isMinMonth)
- }), import_react.default.createElement(Picker, {
- mode: "date",
- fields: "month",
- end: maxDateValue,
- start: minDateValue,
- onChange: this.props.onSelectDate,
- value: dayjsDate.format("YYYY-MM")
- }, import_react.default.createElement(Text, {
- className: "controller__info"
- }, dayjsDate.format(monthFormat))), hideArrow ? null : import_react.default.createElement(View, {
- className: classnames("controller__arrow controller__arrow--right", {
- "controller__arrow--disabled": isMaxMonth
- }),
- onClick: this.props.onNextMonth.bind(this, isMaxMonth)
- }));
- };
- return AtCalendarController2;
- }(import_react.default.Component);
- var defaultProps = {
- validDates: [],
- marks: [],
- isSwiper: true,
- hideArrow: false,
- isVertical: false,
- selectedDates: [],
- isMultiSelect: false,
- format: "YYYY-MM-DD",
- currentDate: Date.now(),
- monthFormat: "YYYY\u5E74MM\u6708"
- };
- var AtCalendar = function(_super) {
- __extends(AtCalendar2, _super);
- function AtCalendar2(props) {
- var _this = _super.call(this, props) || this;
- _this.getSingleSelectdState = function(value) {
- var generateDate = _this.state.generateDate;
- var stateValue = {
- selectedDate: _this.getSelectedDate(value.valueOf())
- };
- var dayjsGenerateDate = value.startOf("month");
- var generateDateValue = dayjsGenerateDate.valueOf();
- if (generateDateValue !== generateDate) {
- _this.triggerChangeDate(dayjsGenerateDate);
- stateValue.generateDate = generateDateValue;
- }
- return stateValue;
- };
- _this.getMultiSelectedState = function(value) {
- var selectedDate = _this.state.selectedDate;
- var end = selectedDate.end, start = selectedDate.start;
- var valueUnix = value.valueOf();
- var state = {
- selectedDate
- };
- if (end) {
- state.selectedDate = _this.getSelectedDate(valueUnix, 0);
- } else {
- state.selectedDate.end = Math.max(valueUnix, +start);
- state.selectedDate.start = Math.min(valueUnix, +start);
- }
- return state;
- };
- _this.getSelectedDate = function(start, end) {
- var stateValue = {
- start,
- end: start
- };
- if (typeof end !== "undefined") {
- stateValue.end = end;
- }
- return stateValue;
- };
- _this.triggerChangeDate = function(value) {
- var format = _this.props.format;
- if (typeof _this.props.onMonthChange !== "function") return;
- _this.props.onMonthChange(value.format(format));
- };
- _this.setMonth = function(vectorCount) {
- var format = _this.props.format;
- var generateDate = _this.state.generateDate;
- var _generateDate = dayjs_min(generateDate).add(vectorCount, "month");
- _this.setState({
- generateDate: _generateDate.valueOf()
- });
- if (vectorCount && typeof _this.props.onMonthChange === "function") {
- _this.props.onMonthChange(_generateDate.format(format));
- }
- };
- _this.handleClickPreMonth = function(isMinMonth) {
- if (isMinMonth === true) {
- return;
- }
- _this.setMonth(-1);
- if (typeof _this.props.onClickPreMonth === "function") {
- _this.props.onClickPreMonth();
- }
- };
- _this.handleClickNextMonth = function(isMaxMonth) {
- if (isMaxMonth === true) {
- return;
- }
- _this.setMonth(1);
- if (typeof _this.props.onClickNextMonth === "function") {
- _this.props.onClickNextMonth();
- }
- };
- _this.handleSelectDate = function(e2) {
- var value = e2.detail.value;
- var _generateDate = dayjs_min(value);
- var _generateDateValue = _generateDate.valueOf();
- if (_this.state.generateDate === _generateDateValue) return;
- _this.triggerChangeDate(_generateDate);
- _this.setState({
- generateDate: _generateDateValue
- });
- };
- _this.handleDayClick = function(item) {
- var isMultiSelect2 = _this.props.isMultiSelect;
- var isDisabled = item.isDisabled, value = item.value;
- if (isDisabled) return;
- var dayjsDate = dayjs_min(value);
- var stateValue = {};
- if (isMultiSelect2) {
- stateValue = _this.getMultiSelectedState(dayjsDate);
- } else {
- stateValue = _this.getSingleSelectdState(dayjsDate);
- }
- _this.setState(stateValue, function() {
- _this.handleSelectedDate();
- });
- if (typeof _this.props.onDayClick === "function") {
- _this.props.onDayClick({
- value: item.value
- });
- }
- };
- _this.handleSelectedDate = function() {
- var selectDate = _this.state.selectedDate;
- if (typeof _this.props.onSelectDate === "function") {
- var info = {
- start: dayjs_min(selectDate.start).format(_this.props.format)
- };
- if (selectDate.end) {
- info.end = dayjs_min(selectDate.end).format(_this.props.format);
- }
- _this.props.onSelectDate({
- value: info
- });
- }
- };
- _this.handleDayLongClick = function(item) {
- if (typeof _this.props.onDayLongClick === "function") {
- _this.props.onDayLongClick({
- value: item.value
- });
- }
- };
- var _a2 = props, currentDate = _a2.currentDate, isMultiSelect = _a2.isMultiSelect;
- _this.state = _this.getInitializeState(currentDate, isMultiSelect);
- return _this;
- }
- AtCalendar2.prototype.UNSAFE_componentWillReceiveProps = function(nextProps) {
- var currentDate = nextProps.currentDate, isMultiSelect = nextProps.isMultiSelect;
- if (!currentDate || currentDate === this.props.currentDate) return;
- if (isMultiSelect && this.props.isMultiSelect) {
- var _a2 = currentDate, start = _a2.start, end = _a2.end;
- var _b = this.props.currentDate, preStart = _b.start, preEnd = _b.end;
- if (start === preStart && preEnd === end) {
- return;
- }
- }
- var stateValue = this.getInitializeState(currentDate, isMultiSelect);
- this.setState(stateValue);
- };
- AtCalendar2.prototype.getInitializeState = function(currentDate, isMultiSelect) {
- var end;
- var start;
- var generateDateValue;
- if (!currentDate) {
- var dayjsStart = dayjs_min();
- start = dayjsStart.startOf("day").valueOf();
- generateDateValue = dayjsStart.startOf("month").valueOf();
- return {
- generateDate: generateDateValue,
- selectedDate: {
- start: ""
- }
- };
- }
- if (isMultiSelect) {
- var _a2 = currentDate, cStart = _a2.start, cEnd = _a2.end;
- var dayjsStart = dayjs_min(cStart);
- start = dayjsStart.startOf("day").valueOf();
- generateDateValue = dayjsStart.startOf("month").valueOf();
- end = cEnd ? dayjs_min(cEnd).startOf("day").valueOf() : start;
- } else {
- var dayjsStart = dayjs_min(currentDate);
- start = dayjsStart.startOf("day").valueOf();
- generateDateValue = dayjsStart.startOf("month").valueOf();
- end = start;
- }
- return {
- generateDate: generateDateValue,
- selectedDate: this.getSelectedDate(start, end)
- };
- };
- AtCalendar2.prototype.render = function() {
- var _a2 = this.state, generateDate = _a2.generateDate, selectedDate = _a2.selectedDate;
- var _b = this.props, validDates = _b.validDates, marks = _b.marks, format = _b.format, minDate = _b.minDate, maxDate = _b.maxDate, isSwiper = _b.isSwiper, className = _b.className, hideArrow = _b.hideArrow, isVertical = _b.isVertical, monthFormat = _b.monthFormat, selectedDates = _b.selectedDates;
- return import_react.default.createElement(View, {
- className: classnames("at-calendar", className)
- }, import_react.default.createElement(AtCalendarController, {
- minDate,
- maxDate,
- hideArrow,
- monthFormat,
- generateDate,
- onPreMonth: this.handleClickPreMonth,
- onNextMonth: this.handleClickNextMonth,
- onSelectDate: this.handleSelectDate
- }), import_react.default.createElement(AtCalendarBody, {
- validDates,
- marks,
- format,
- minDate,
- maxDate,
- isSwiper,
- isVertical,
- selectedDate,
- selectedDates,
- generateDate,
- onDayClick: this.handleDayClick,
- onSwipeMonth: this.setMonth,
- onLongClick: this.handleDayLongClick
- }));
- };
- AtCalendar2.defaultProps = defaultProps;
- return AtCalendar2;
- }(import_react.default.Component);
- var AtFab = function(_super) {
- __extends(AtFab2, _super);
- function AtFab2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtFab2.prototype.onClick = function(e2) {
- if (typeof this.props.onClick === "function") {
- this.props.onClick(e2);
- }
- };
- AtFab2.prototype.render = function() {
- var _a2;
- var _b = this.props, size = _b.size, className = _b.className, children = _b.children;
- var rootClass = classnames("at-fab", className, (_a2 = {}, _a2["at-fab--" + size] = size, _a2));
- return import_react.default.createElement(View, {
- className: rootClass,
- onClick: this.onClick.bind(this)
- }, children);
- };
- return AtFab2;
- }(import_react.default.Component);
- AtFab.propTypes = {
- size: PropTypes.oneOf([
- "normal",
- "small"
- ]),
- onClick: PropTypes.func
- };
- AtFab.defaultProps = {
- size: "normal"
- };
- var objectToString = function(style) {
- if (style && typeof style === "object") {
- var styleStr_1 = "";
- Object.keys(style).forEach(function(key) {
- var lowerCaseKey = key.replace(/([A-Z])/g, "-$1").toLowerCase();
- styleStr_1 += lowerCaseKey + ":" + style[key] + ";";
- });
- return styleStr_1;
- } else if (style && typeof style === "string") {
- return style;
- }
- return "";
- };
- var AtComponent = function(_super) {
- __extends(AtComponent2, _super);
- function AtComponent2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- AtComponent2.prototype.mergeStyle = function(style1, style2) {
- if (style1 && typeof style1 === "object" && style2 && typeof style2 === "object") {
- return Object.assign({}, style1, style2);
- }
- return objectToString(style1) + objectToString(style2);
- };
- return AtComponent2;
- }(import_react.Component);
- /*
- object-assign
- (c) Sindre Sorhus
- @license MIT
- */ /*!
- Copyright (c) 2018 Jed Watson.
- Licensed under the MIT License (MIT), see
- http://jedwatson.github.io/classnames
- */ /** @license React v16.13.1
- * react-is.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
- /***/ })
- }]);
|